CARD: Difference between revisions
No edit summary |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
=CARD ($C00468)= | =CARD ($C00468)= | ||
The CARD [[system ROM]] call is used to perform | The CARD [[system ROM]] call is used to perform operations on the [[memory card]]. | ||
'''Warning:''' register contents aren't preserved ! | '''Warning:''' register contents aren't preserved ! |
Latest revision as of 15:42, 21 August 2024
CARD ($C00468)
The CARD system ROM call is used to perform operations on the memory card.
Warning: register contents aren't preserved !
Variables
The following variables are used when calling CARD:
Address | DEF name | Size | Set by | Description |
$10FDC4 | BIOS_CARD_COMMAND | byte | System ROM or game | Command code to execute |
$10FDC6 | BIOS_CARD_ANSWER | byte | System ROM | Answer code (see below) |
$10FDC8 | BIOS_CARD_START | longword | System ROM or game | Pointer to data |
$10FDCC | BIOS_CARD_SIZE | word | System ROM or game | Size of data |
$10FDCE | BIOS_CARD_FCB | word | System ROM or game | Game NGH number |
$10FDD0 | BIOS_CARD_SUB | byte or word | System ROM or game | Game save sub-number |
The following temporary variables are used when calling CARD :
Address | DEF name | Size | Description |
$10FD04 | BIOS_CARD_DIRECTORY_START | long word | Start of directory |
$10FD08 | BIOS_CARD_BLOCK_NUMBER | word | Number of blocks |
$10FD0A | BIOS_CARD_FAT_START | long word | Start of FAT |
$10FD0E | BIOS_CARD_FAT_SIZE | word | Size of FAT |
$10FD10 | BIOS_CARD_DATA_START | long word | Start of data |
$10FD14 | BIOS_CARD_TYPE | word |
|
$10FD16 | BIOS_CARD_SIZE | word | Size of the card |
BIOS_CARD_ANSWER
This variable contains the result of the operation. Bit 7 indicates an error.
- $00: Normal completion
- $80: No card inserted
- $81: Card isn't formatted
- $82: Requested data doesn't exist
- $83: FAT error
- $84: Card is full
- $85: Write disabled or ROM card
Commands
$0: Format memory card
Formats the memory card.
$1: Data search
Return the number of save files for the specified game.
Inputs:
BIOS_CARD_FCB must contain the NGH number of the desired game.
Outputs:
BIOS_CARD_SUB contains a 16 bit mask for all 16 available blocks for the game. If a bit is set, then the corresponding save block exists.
$2: Load data
Loads the specified save file in RAM.
Inputs:
- BIOS_CARD_FCB must contain the NGH number of the desired game.
- BIOS_CARD_SUB must contain the game save number (16 max. per game).
- BIOS_CARD_START must be a pointer to which the save data will be loaded.
- BIOS_CARD_SIZE must contain the size of the save (usually 64 bytes).
$3: Save data
Save from RAM to the specified save file.
Inputs:
- BIOS_CARD_FCB must contain the NGH number of the desired game.
- BIOS_CARD_SUB must contain the game save number (16 max. per game).
- BIOS_CARD_START must be a pointer from which the save data will be copied.
- BIOS_CARD_SIZE must contain the size of the save (usually 64 bytes).
$4: Delete data
Delete the specified file.
Inputs:
- BIOS_CARD_FCB must contain the NGH number of the desired game.
- BIOS_CARD_SUB must contain the game save number (16 max. per game).
$5: Read data title
Read the data title of a save file.
Inputs:
- BIOS_CARD_START must be a pointer to which the title string will be copied.
- BIOS_CARD_SIZE must contain the game save number ?
$6: Save user name
Set the user name of the memory card.
Inputs:
BIOS_CARD_START must be a pointer to the user name's string (max. 16 bytes).
$7: Load user name
Loads the user name of the memory card.
Inputs:
BIOS_CARD_START must be a pointer to which the user name's string will be copied.