Nugget
Loading...
Searching...
No Matches
card.h
Go to the documentation of this file.
1/*
2
3MIT License
4
5Copyright (c) 2021 PCSX-Redux authors
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26
27#pragma once
28
29#include <stdlib.h>
30
31int initCard(int padStarted);
34uint8_t getCardStatus(int port);
35uint8_t waitCardStatus(int port);
36
37void mcResetStatus();
38int mcWaitForStatus();
40void mcAllowNewCard();
41int mcGetLastDevice();
42int mcReadSector(int deviceId, int sector, uint8_t* buffer);
43int mcWriteSector(int deviceId, int sector, uint8_t* buffer);
44int cardInfoInternal(int deviceId);
45
46// internals
50extern int g_mcOperation;
51extern int g_mcPortFlipping;
52extern uint8_t* g_mcUserBuffers[2];
53extern uint32_t g_mcChecksum[2];
54extern int g_mcSector[2];
55extern int g_mcDeviceId[2];
56extern int g_mcActionInProgress;
57extern int g_skipErrorOnNewCard;
58extern uint8_t g_mcFlags[2];
60extern int g_mcLastPort;
61extern int g_mcGotError;
62extern int g_mcFastTrackActive;
63
64extern int g_mcOverallSuccess;
65extern int g_mcErrors[4];
66
67extern int g_mcHandlerDelayPatch;
uint32_t g_mcChecksum[2]
Definition driver.c:234
uint8_t waitCardStatus(int port)
int stopCard()
int mcGetLastDevice()
Definition driver.c:514
int g_mcSector[2]
Definition driver.c:238
int g_mcHandlerDelayPatch
Definition driver.c:239
int g_mcDeviceId[2]
Definition driver.c:237
int g_mcActionInProgress
Definition driver.c:219
int mcInfoHandler()
uint8_t g_mcFlags[2]
Definition driver.c:223
int g_mcLastPort
Definition driver.c:221
int mcReadHandler()
int mcWaitForStatus()
Definition card.c:57
int g_mcOverallSuccess
Definition card.c:38
int mcWaitForStatusAndReturnIndex()
Definition card.c:73
int g_mcGotError
Definition driver.c:222
int g_mcPortFlipping
Definition card.h:59
int mcWriteSector(int deviceId, int sector, uint8_t *buffer)
Definition driver.c:481
void mcAllowNewCard()
Definition driver.c:462
uint8_t getCardStatus(int port)
int mcWriteHandler()
uint8_t * g_mcUserBuffers[2]
Definition driver.c:233
void mcResetStatus()
Definition card.c:44
int startCard()
int initCard(int padStarted)
int mcReadSector(int deviceId, int sector, uint8_t *buffer)
Definition driver.c:464
int g_mcCardInfoPatchActivated
Definition card.c:40
int g_mcErrors[4]
Definition card.c:39
int g_mcOperation
Definition driver.c:224
int g_mcFastTrackActive
Definition driver.c:228
int g_skipErrorOnNewCard
Definition driver.c:227
int cardInfoInternal(int deviceId)
Definition driver.c:498
static void * buffer
Definition syscalls.h:230
static int sector
Definition syscalls.h:467
void uint32_t(classId, spec)