CARD

= CARD ($C00468) =

The CARD routine is used to perform action on the memory card.

Warning: register contents aren't preserved !

Variables
The following variables are used when using the CARD routine :

The following temporary variable are used when calling CARD :

BIOS_CARD_ANSWER
This variable contain the result of the operation.

$00: Normal completion

$80: No card inserted

$81: Card isn't formated

$82: Data doesn't exist

$83: FAT error

$84: Memory card is full

$85: Write disable or ROM card

$0 - Format memory card
Format the memory card.

$1 - Data Search
Find the number of save files for the specified game.

Inputs :

BIOS_CARD_FCB must contain the NGH number of the game to search.

Outputs :

BIOS_CARD_SUB contain a 16 bits mask for all 16 available blocks for the game. If bit n is set to 1, then the n save exist for this game.

$2 - Data load
Load the specified save file in RAM.

Inputs:

BIOS_CARD_FCB must contain the game NGH number.

BIOS_CARD_SUB must contain the game save number (16 max per game).

BIOS_CARD_START must contain an address where the save will be loaded.

BIOS_CARD_SIZE must contain the size of the save (normally 64 bytes).

$3 - Data save
Save from RAM to the specified save file.

Inputs:

BIOS_CARD_FCB must contain the game NGH number.

BIOS_CARD_SUB must contain the game save number (16 max per game).

BIOS_CARD_START must contain an address from where the save will be saved.

BIOS_CARD_SIZE must contain the size of the save (normally 64 bytes).

$4 - Data delete
Delete the specified file.

Inputs:

BIOS_CARD_FCB must contain the game NGH number.

BIOS_CARD_SUB must contain the game save number (16 max per game).

$5 - Read Data title
Read the Data Title of the BIOS_CARD_SIZE save file.

Inputs:

BIOS_CARD_START must contain an address to put the Data Title

BIOS_CARD_SIZE contain the save file to read from.

$6 - User name save
Set the user name of the memory card.

Inputs:

BIOS_CARD_START address to the username (max 16 bytes).

$7 - User name load
Load the user name of the memory card.

Inputs:

BIOS_CARD_START address where to put the data.

= CARD_ERROR ($C0046E) =

The CARD_ERROR routine can handle automatically some errors depending on the command and the error code.

Most of the time it will display a message on screen (using MESS_OUT) but the routine can also automatically format the memory card if it's needed. (On AES, a user confirmation is asked before formating, on MVS it is done automatically).

List of command/error combination that CARD_ERROR handle (based on the sp-s2 bios) :