CARD

=CARD ($C00468)=

The CARD system ROM call is used to perform opeartions on the memory card.

Warning: register contents aren't preserved !

Variables
The following variables are used when calling CARD:

The following temporary variables are used when calling 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.