Memory card: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
JEIDA V3 memory cards used in AES and some [[MVS hardware|MVS systems]] to store game saves and/or high scores. The original SNK card could only hold 2KiB of data.
[[File:snkmemcard.jpg|thumb|SRAM memory card, showing the SRAM chip and voltage detection circuit. Picture by [[User:HPMAN|HPMAN]]]]


[[File:snkmemcard.jpg|thumb|Picture by [[User:HPMAN|HPMAN]]]]
The NeoGeo (AES and some [[MVS hardware|MVS]]) uses JEIDA V3 memory cards to store game saves and/or high scores. The original SNK-branded card could only hold 2KiB of data.


The official SNK memory card was a battery-based 2KiB card using a LH5116 CMOS SRAM chip and voltage switching circuitry. Data retention voltage: 2V.
The official SNK memory card was a battery-based 2KiB card using a LH5116 CMOS SRAM chip and voltage switching circuitry. Data retention voltage: 2V. The SP-S2 [[system ROM]] can handle memory cards up to 16KiB. The card is embedded in [[CD systems]] as a 8KiB battery-backed RAM chip.


The SP-S2 [[system ROM]] can handle memory cards up to 16KiB
See the [[CARD]] call description for memory card operations.
 
Replaced by a 8KiB fixed battery-backed RAM chip in the [[CD systems]].
 
See the [[CARD]] BIOS call description for memory card operations.


=Data format=
=Data format=


BIOS can handle 8 different card size (2K, 4K, 6K, 8K, 10K, 14K and 16K) and different card type (8 bits wide, 16 bits wide, 16 bits doubled wide and SNK ROM card).
The system ROM can handle 8 different card sizes (2K, 4K, 6K, 8K, 10K, 14K and 16K) and 4 different card types (8 bits wide, 16 bits wide, 16 bits wide "doubled", and "SNK ROM" cards).


All the data here are for all the card, it's just a matter on how to read the data between different type of card.
All cards use the same format regardless of capacity.


The internal card data are splitted into 5 regions.
The data is split into 5 regions:


==Header==
==Header==


Always $80 bytes.
Always 128 bytes.


{| class="regdef"
{| class="regdef"
Line 32: Line 28:
|
|
|10 bytes
|10 bytes
|Zero or "SNK ROM " (Development unit I think)
|Zeros or "SNK ROM " (development unit ?)


For 16bits doubled card, $6 is set to $0001
For 16 bits "doubled" cards, $6 is set to $0001
|-
|-
|$A
|$A
|CARD_SIZE
|CARD_SIZE
|word
|word
|Size of the memcard
|Card capacity
|-
|-
|$C
|$C
Line 49: Line 45:
|CARD_FAT_1_CHKSUM
|CARD_FAT_1_CHKSUM
|byte
|byte
|Checksum of the FAT 1
|Checksum of FAT 1
|-
|-
|$E
|$E
|CARD_FAT_2_CHKSUM
|CARD_FAT_2_CHKSUM
|byte
|byte
|Checksum of the FAT 2
|Checksum of FAT 2
|-
|-
|$F
|$F
Line 64: Line 60:
|CARD_USERNAME
|CARD_USERNAME
|16 bytes
|16 bytes
|Card holder username
|Card holder's username
|-
|-
|$20
|$20
|CARD_MAGIC
|CARD_MAGIC
|16 bytes
|16 bytes
|$4e $XX $45 $XX $4f $XX $2d $XX $47 $XX $45 $XX $4f $XX 80 $XX "NEO-GEO" + $80
|$4E $XX $45 $XX $4F $XX $2D $XX $47 $XX $45 $XX $4F $XX $80 $XX ("NEO-GEO", $80)
|-
|-
|$30
|$30
|CARD_REGION
|CARD_REGION
|byte
|byte
|Region of slot that formated the card, 0 = Japan, 1 = USA, 2 = Europe
|Region of the system that formated the card, 0 = Japan, 1 = USA, 2 = Europe
|}
|}


==Directory==
==Directory==


List of saves. Size depends on card size, it can hold 32, 64, 96, 128, 160, 192, 224 or 256 entries.
List of saves of 32, 64, 96, 128, 160, 192, 224 or 256 entries. The size depends on the card's capacity.  


Each entry have this format :
Each entry has the following format:


{| class="regdef"
{| class="regdef"
Line 90: Line 86:
|$0
|$0
|byte
|byte
|Game Sub number (CARD_SUB), 0 to 15. $FF if entry is free
|Save sub number (CARD_SUB), 0 to 15. $FF if entry is free.
|-
|-
|$1
|$1
|word
|word
|Game NGH number
|Game's [[NGH number]]
|-
|-
|$3
|$3
Line 103: Line 99:
==FAT 1==
==FAT 1==


List of used blocks. Size depends on card size, it can hold 64, 128 192 or 256 entries.
List of used blocks, of 64, 128, 192, or 256 entries. The size depends on the card's capacity.
* $02 is a BIOS reserved block
* $02 is a block reservd by the system ROM
* $01 is a game used block
* $01 is a block used by a game
* $00 is a free block
* $00 is a free block


Line 114: Line 110:
==Game Data==
==Game Data==


Normally 64 bytes but maybe some games use more that one block ?
Many games use 64 bytes, but some might use more.
 
The first 20 bytes are the data title (usually the game and stage name).
 
=Registers=


The first 20 bytes are the data title (generally the game name + the stage name).
* Write is enabled if {{Reg|REG_CRDUNLOCK1}} is 0 and {{Reg|REG_CRDUNLOCK2}} is 1
* The WP (Write Protect) pin is read through bit 6 of {{Reg|REG_STATUS_B}}
* CD1 (Card Detect 1) is read through bit 4 of {{Reg|REG_STATUS_B}}
* CD2 (Card Detect 2) is read through bit 5 of {{Reg|REG_STATUS_B}}
* Attribute memory is selected if {{Reg|REG_CRDREGSEL}} is 1


=Card pinout (top)=
=Card pinout (top)=

Revision as of 00:35, 9 March 2017

SRAM memory card, showing the SRAM chip and voltage detection circuit. Picture by HPMAN

The NeoGeo (AES and some MVS) uses JEIDA V3 memory cards to store game saves and/or high scores. The original SNK-branded card could only hold 2KiB of data.

The official SNK memory card was a battery-based 2KiB card using a LH5116 CMOS SRAM chip and voltage switching circuitry. Data retention voltage: 2V. The SP-S2 system ROM can handle memory cards up to 16KiB. The card is embedded in CD systems as a 8KiB battery-backed RAM chip.

See the CARD call description for memory card operations.

Data format

The system ROM can handle 8 different card sizes (2K, 4K, 6K, 8K, 10K, 14K and 16K) and 4 different card types (8 bits wide, 16 bits wide, 16 bits wide "doubled", and "SNK ROM" cards).

All cards use the same format regardless of capacity.

The data is split into 5 regions:

Header

Always 128 bytes.

Address Name Size Description
$0~$9 10 bytes Zeros or "SNK ROM " (development unit ?)

For 16 bits "doubled" cards, $6 is set to $0001

$A CARD_SIZE word Card capacity
$C byte 0
$D CARD_FAT_1_CHKSUM byte Checksum of FAT 1
$E CARD_FAT_2_CHKSUM byte Checksum of FAT 2
$F CARD_USERNAME_AVAILABLE byte 0 : Username available, !0 : Username unavailable
$10 CARD_USERNAME 16 bytes Card holder's username
$20 CARD_MAGIC 16 bytes $4E $XX $45 $XX $4F $XX $2D $XX $47 $XX $45 $XX $4F $XX $80 $XX ("NEO-GEO", $80)
$30 CARD_REGION byte Region of the system that formated the card, 0 = Japan, 1 = USA, 2 = Europe

Directory

List of saves of 32, 64, 96, 128, 160, 192, 224 or 256 entries. The size depends on the card's capacity.

Each entry has the following format:

Address Size Description
$0 byte Save sub number (CARD_SUB), 0 to 15. $FF if entry is free.
$1 word Game's NGH number
$3 byte FAT entry number (see below)

FAT 1

List of used blocks, of 64, 128, 192, or 256 entries. The size depends on the card's capacity.

  • $02 is a block reservd by the system ROM
  • $01 is a block used by a game
  • $00 is a free block

FAT 2

FAT 2 is simply a mirror of FAT 1.

Game Data

Many games use 64 bytes, but some might use more.

The first 20 bytes are the data title (usually the game and stage name).

Registers

Card pinout (top)

LH5116 pinout
Pin # Name Signal Description Goes to
1 GND
2 D3 CDD3 Data bus NEO-G0
3 D4 CDD4
4 D5 CDD5
5 D6 CDD6
6 D7 CDD7
7 /CE1 CRDC Chip enable 1 NEO-C1
8 A10 CDA10 Address NEO-E0
9 /OE CRDO Output enable NEO-C1
10 A11 CDA11 Address bus NEO-E0
11 A9 CDA9
12 A8 CDA8
13 A13 CDA13
14 A14 CDA14
15 /WE Write enable HC32
16 /BUSY Low when card is busy Not used
17 VCC
18 VPP
19 A16 CDA16 Address bus NEO-E0
20 A15 CDA15
21 A12 CDA12
22 A7 CDA7
23 A6 CDA6
24 A5 CDA5
25 A4 CDA4
26 A3 CDA3
27 A2 CDA2
28 A1 CDA1
29 A0 CDA0
30 D0 CDD0 Data bus NEO-G0
31 D1 CDD1
32 D2 CDD2
33 WP WP High if card is write-protected NEO-C1
34 GND

Card pinout (bottom)

Pin # Name Signal Description Goes to
35 GND
36 /CD1 CD1 Card detect NEO-C1
37 D11 CDD11 Data bus NEO-G0
38 D12 CDD12
39 D13 CDD13
40 D14 CDD14
41 D15 CDD15
42 /CE2 CRDC Chip enable 2 NEO-C1
43 /VS1 Not used
44 /IORD
45 /IOWR
46 A17 CDA17 Address bus NEO-E0
47 A18 CDA18
48 A19 CDA19
49 A20 CDA20
50 A21 CDA21
51 VCC
52 VCC
53 A22 CDA22 Address bus NEO-E0
54 A23 CDA23
55 A24 Not used
56 A25
57 /VS2
58 RESET
59 /WAIT
60 NC Reserved
61 /REG Select attribute memory HC32
62 BVD2 Battery voltage detect Not used
63 BVD1
64 D8 CDD8 Data bus NEO-G0
65 D9 CDD9
66 D10 CDD10
67 /CD2 CD2 Card detect NEO-C1
68 GND