Backup RAM: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
 
(30 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The backup RAM is a battery-powered 64KiB RAM space used by [[MVS systems]] to store game scores, cab infos and income logs. Access is handled by the [[BIOSes]].
The backup RAM is a [[battery-backed_RAM|battery-powered]] 64KiB RAM space used by the [[MVS]] to store game scores, cab infos and income logs. Access can be handled by [[BIOS calls]].


[[68k memory map|Memory region]]: $D00000~$D0FFFF (Mirrored up to $DFFFFF ?).
[[68k memory map|Memory region]]: $D00000~$D0FFFF (Mirrored up to $DFFFFF ?).
Line 5: Line 5:
== Data structure ==
== Data structure ==


All offset are taken from the sp-s2.bin bios.
All offset are taken from the sp-s2.bin system ROM.


{| class="regdef"
{| class="regdef"
Line 16: Line 16:
|$D00000
|$D00000
|$D0000F
|$D0000F
|$F
|16
|$00
|$00
|Unused, fill with $00
|Unused, fill with $00
Line 22: Line 22:
|$D00010
|$D00010
|$D0001F
|$D0001F
|$F
|16
|"BACKUP RAM OK!Ç"
|"BACKUP RAM OK!Ç"
|The routine at $C125C8 will check if this string is present, if not it will test the ram (using the test_ram routine at $C13134) and re-init the backupram
|The routine at $C125C8 will check if this string is present, if not it will test the ram (using the test_ram routine at $C13134) and re-init the backupram
|-
|-
|$D00020
|$D00020
|$D00039
|$D00021
|$19
|2
|
|Coin deposit related (rising edge finding), old and new value of REG_STATUS_A
|-
|$D00022
|$D00023
|2
|
|Temp value for the coin deposit rising edge finding
|-
|$D00024
|$D00025
|2
|
|Internal coin counter (not credit)
|-
|'''$D00026'''
|'''$D0002F'''
|
|
|?
|-
|$D00034
|$D00035
|2
|$00
|$00
|Unused, fill with $00
|"Internal" credit counters for player 1 and player 2 (BCD)
|-
|'''$D00036'''
|'''$D00039'''
|
|
|?
|-
|$D0003A
|$D00045
|12
|
|Cab settings.
;$D0003A: Coins needed for crediting player 1 (initialized to $01)
;$D0003B: Credits added to player 1 (initialized to $01)
;$D0003C: Coins needed for crediting player 2 (initialized to $01)
;$D0003D: Credits added to player 2 (initialized to $02)
;$D00042: Game select (1=Free, 0=Only when credited) (initialized to 0)
;$D00043: Game start compulsion (0 = enabled, 1 = disabled)
;$D00044: Game start compulsion time (max time in seconds in BCD between inserting a coin and starting the game) (initialized to $30)
;$D00046: Demo sound (1=Without) (initialized to 0)
|-
|-
|$D00046
|$D00046
|$D00046
|$D00046
|$1
|1
|SOUND_STOP
|SOUND_STOP
|No sound at all if non-zero
|No sound at all if non-zero (except coinage sound effect)
|-
|-
|$D00047
|$D00047
|$D00047
|$D00047
|$1
|1
|SLOT NUMBER
|SLOT NUMBER
|Number of detected slots (2 for slot1)
|Number of detected slots (2 for slot1)
|-
|-
|$D0003A
|$D00048
|$D00045
|$D0004B
|$C
|4
|$01010102010101030000303B0000
|PLAY TIME
|the init_backupram routine ($C125F4) will copy $C data from $C1F000 there.
|Counter of second played on the game in hex.
 
Reset to 0 by [[SYSTEM_RETURN]].
|-
|$D0004C
|$D0004C
|1
|PLAY_TIME_FRAME_TIMER
|Frame timer, start at $3C, decremented each frame. When the counter reach $00, PLAY_TIME is incremented and the counter is reseted to $3C
|-
|'''$D0004D'''
|'''$D00057'''
|
|
|?
|-
|$D00058
|$D00058
|1
|
|First slot number with a boot logo flag to 0 (playable by the system ROM)
|-
|-
|$D0005A
|$D0005A
|$D0005D
|$D0005D
|$4
|4
|HHMMSSMM
|HHMMSSFF
|Current time, hour is mult by 4 (???), MM is the milliseconds.
|Timer based on frames.
*FF: frame down-counter ($3C to $00)
*SS: second counter ($00 to $3B)
*MM: minute counter ($00 to $3B)
*HH: hour counter *4 ($00 to $60 by 4 steps)
|-
|$D0005E
|$D00103
|
|
|?
|-
|-
|$D00104
|$D00104
|$D0017
|$D00107
|$4
|4
|YYMMDDdd
|YYMMDDdd
|Current date
|Current date
|-
|$D00108
|$D00108
|1
|Selected slot number (start at 0)
|Output directly to the EL panels
|-
|'''$D00109'''
|'''$D00109'''
|1
|EL_PANEL
|State of the EL-PANEL ???
|-
|-
|$D0010A
|$D0010A
|$D0010D
|$D0010D
|$4
|4
|
|
|Play time address related
|Detailed game start book address
|-
|-
|$D0010E
|$D0010E
|$D00111
|$D00111
|$4
|4
|
|
|Play time address related
|Total game start book address
|-
|-
|$D00112
|$D00112
|$D00115
|$D00115
|$4
|4
|
|
|Play time address related
|Detailed cabinet coin book address (sub 0x240 for the start book one)
|-
|-
|$D00116
|$D00116
|$D00119
|$D00119
|$4
|4
|
|Current month cabinet coin book address (sub 0xC for the start book one)
|-
|'''$D0011A'''
|'''$D00121'''
|
|
|
|Play time address related
|?
|-
|-
|$D00122
|$D00122
|$D00123
|$D00123
|$2
|2
|$23
|$23
|The init_backupram routine write $23 there, purpose unknown.
|The init_backupram routine write $23 there, purpose unknown.
Line 94: Line 186:
|$D00124
|$D00124
|$D00127
|$D00127
|$4
|4
|Slot-1 [[NGH number]] and game name ID (see below)
|Slot-1 [[NGH number]] and bram game block ID (see below)
|If not present $0000 as NGH and $FFFF as game name ID
|If not present $0000 as NGH and $FFFF as game name ID
|-
|-
|$D00128
|$D00128
|$D0012B
|$D0012B
|$4
|4
|Slot-2 [[NGH number]] and game name ID (see below)
|Slot-2 [[NGH number]] and bram game block ID (see below)
|If not present $0000 as NGH and $FFFF as game name ID.
|If not present $0000 as NGH and $FFFF as game name ID.
On a slot1 always unset (slot1 are slot2 with the second one empty)
On a slot1 always unset (slot1 are slot2 with the second one empty)
Line 107: Line 199:
|$D0012C
|$D0012C
|$D0012F
|$D0012F
|$4
|4
|Slot-3 [[NGH number]] and game name ID (see below)
|Slot-3 [[NGH number]] and bram game block ID (see below)
|If not present $0000 as NGH and $FFFF as game name ID
|If not present $0000 as NGH and $FFFF as game name ID
|-
|-
|$D00130
|$D00130
|$D00133
|$D00133
|$4
|4
|Slot-4 [[NGH number]] and game name ID (see below)
|Slot-4 [[NGH number]] and bram game block ID (see below)
|If not present $0000 as NGH and $FFFF as game name ID
|If not present $0000 as NGH and $FFFF as game name ID
|-
|-
|$D00134
|$D00134
|$D00137
|$D00137
|$4
|4
|Slot-5 [[NGH number]] and game name ID (see below)
|Slot-5 [[NGH number]] and bram game block ID (see below)
|If not present $0000 as NGH and $FFFF as game name ID
|If not present $0000 as NGH and $FFFF as game name ID
|-
|-
|$D00138
|$D00138
|$D0013B
|$D0013B
|$4
|4
|Slot-6 [[NGH number]] and game name ID (see below)
|Slot-6 [[NGH number]] and bram game block ID (see below)
|If not present $0000 as NGH and $FFFF as game name ID
|If not present $0000 as NGH and $FFFF as game name ID
|-
|-
|$D0013C
|$D0013C
|$D0013F
|$D0013F
|$4
|4
|Slot-7 [[NGH number]] and game name ID (see below)
|Slot-7 [[NGH number]] and bram game block ID (see below)
|If not present $0000 as NGH and $FFFF as game name ID
|If not present $0000 as NGH and $FFFF as game name ID
|-
|-
|$D00140
|$D00140
|$D00143
|$D00143
|$4
|4
|Slot-8 [[NGH number]] and game name ID (see below)
|Slot-8 [[NGH number]] and bram game block ID (see below)
|If not present $0000 as NGH and $FFFF as game name ID
|If not present $0000 as NGH and $FFFF as game name ID
|-
|-
|$D00144
|$D00144
|$D00147
|$D00147
|$4
|4
|YYMMDDdd
|YYMMDDdd
|Slot-1 book creation time YEAR-MONTH-DAY-day number
|Slot-1 book creation time YEAR-MONTH-DAY-day number
Line 149: Line 241:
|$D00148
|$D00148
|$D0014B
|$D0014B
|$4
|4
|YYMMDDdd
|YYMMDDdd
|Slot-2 book creation time YEAR-MONTH-DAY-day number
|Slot-2 book creation time YEAR-MONTH-DAY-day number
Line 161: Line 253:
|$D00150
|$D00150
|$D00153
|$D00153
|$4
|4
|YYMMDDdd
|YYMMDDdd
|Slot-4 book creation time YEAR-MONTH-DAY-day number
|Slot-4 book creation time YEAR-MONTH-DAY-day number
Line 167: Line 259:
|$D00154
|$D00154
|$D00157
|$D00157
|$4
|4
|YYMMDDdd
|YYMMDDdd
|Slot-5 book creation time YEAR-MONTH-DAY-day number
|Slot-5 book creation time YEAR-MONTH-DAY-day number
Line 173: Line 265:
|$D00158
|$D00158
|$D0015B
|$D0015B
|$4
|4
|YYMMDDdd
|YYMMDDdd
|Slot-6 book creation time YEAR-MONTH-DAY-day number
|Slot-6 book creation time YEAR-MONTH-DAY-day number
Line 179: Line 271:
|$D0015C
|$D0015C
|$D0015F
|$D0015F
|$4
|4
|YYMMDDdd
|YYMMDDdd
|Slot-7 book creation time YEAR-MONTH-DAY-day number
|Slot-7 book creation time YEAR-MONTH-DAY-day number
Line 185: Line 277:
|$D00160
|$D00160
|$D00163
|$D00163
|$4
|4
|YYMMDDdd
|YYMMDDdd
|Slot-8 book creation time YEAR-MONTH-DAY-day number
|Slot-8 book creation time YEAR-MONTH-DAY-day number
|-
|'''$D00164'''
|'''$D001A3'''
|
|
|?
|-
|$D001A4
|$D001A7
|4
|
|Current month game start book
|-
|'''$D001A8'''
|'''$D0021F'''
|
|
|?
|-
|$D00220
|$D0029F
|16*8
|
|Games soft DIPs settings (in which order ?)
|-
|-
|$D002A0
|$D002A0
|$D002AF
|$D002AF
|$F
|16
|Game Name 0
|
|
|bram block 0 game name
|-
|-
|$D002B0
|$D002B0
|$D002BF
|$D002BF
|$F
|16
|
|
|Game Name 1
|bram block 1 game name
|-
|-
|$D002C0
|$D002C0
|$D002CF
|$D002CF
|$F
|16
|
|
|Game Name 2
|bram block 2 game name
|-
|-
|$D002D0
|$D002D0
|$D002DF
|$D002DF
|$F
|16
|
|
|Game Name 3
|bram block 3 game name
|-
|-
|$D002E0
|$D002E0
|$D002EF
|$D002EF
|$F
|16
|
|
|Game Name 4
|bram block 4 game name
|-
|-
|$D002F0
|$D002F0
|$D002FF
|$D002FF
|$F
|16
|
|
|Game Name 5
|bram block 5 game name
|-
|-
|$D00300
|$D00300
|$D0030F
|$D0030F
|$F
|16
|
|
|Game Name 6
|bram block 6 game name
|-
|-
|$D00310
|$D00310
|$D0031F
|$D0031F
|$F
|16
|
|
|Game Name 7
|bram block 7 game name
|-
|-
|$D00320
|$D00320
Line 241: Line 357:
|$1000
|$1000
|
|
|Game 1 data
|bram block 1 data
|-
|-
|$D01320
|$D01320
Line 247: Line 363:
|$1000
|$1000
|
|
|Game 2 data
|bram block 2 data
|-
|-
|$D02320
|$D02320
Line 253: Line 369:
|$1000
|$1000
|
|
|Game 3 data
|bram block 3 data
|-
|-
|$D03320
|$D03320
Line 259: Line 375:
|$1000
|$1000
|
|
|Game 4 data
|bram block 4 data
|-
|-
|$D04320
|$D04320
Line 265: Line 381:
|$1000
|$1000
|
|
|Game 5 data
|bram block 5 data
|-
|-
|$D05320
|$D05320
Line 271: Line 387:
|$1000
|$1000
|
|
|Game 6 data
|bram block 6 data
|-
|-
|$D06320
|$D06320
Line 277: Line 393:
|$1000
|$1000
|
|
|Game 7 data
|bram block 7 data
|-
|-
|$D07320
|$D07320
Line 283: Line 399:
|$1000
|$1000
|
|
|Game 8 data
|bram block 8 data
|}
|-
|$D09BA0
|$D09DE0
|$240
|YYMMDDdd - COIN1 - COIN2 - SERVICE
|Bookkeeping - Current month coin


*$D00000~$D0000F: Nothing ($00)
Each entry is $10 byte long
*$D00010: "BACKUP RAM OK !",$80
|-
*$D00020.l: ?
|$D09DE0
*$D00021.b: btst 0,1,2,3,4
|$D0A01F
*$D00024.l: adresse ?
|$240
*$D00034.l: adresse ?
|YYMMDDdd - PLAY - CONTINUE - TIME
*$D00038.w: ? bit 4 tst
|Bookkeeping - Current month play
*$D0003A: Start of ? (13 bytes)
*$D00042.b: tst ?
*$D00043.b: tst ?
*$D00044.w: ?
*$D00046.b: SOUND_STOP, No sound at all if non-zero
*$D00047.b: Number of detected slots
*$D00048.l: ?
*$D0004C.b: ? ($3B)
*$D00058.b: First valid slot
*$D0005E.b: Something to do with tested slot? tst
*$D0005A.b: heure ?
*$D00060.w: multi-slot flag
*$D00104: year,month,day ? (3 bytes) Modify date
*$D00108.b: Selected tested slot
*$D00109.b: Compared with 8
*$D0011A: Start of ?
*$D00122.b: ? ($23)
*$D00124: adresses ? (4 bytes * nb of slots ?)
*$D00144: Date (Year, Month, Day, ? *8 ?) Creation date
*$D001AC.l: $F0F0F0F0
*$D001B0.w: $FFFF


*$D002A0: Title of game (16 bytes *8 ?)
Each entry is $10 byte long
 
|-
*$D00320: ?
|$D0A020
|$D0A0DF
|$C0
|00000000 - COIN1 - COIN2 - SERVICE
|Bookkeeping - Year coin
|-
|$D0A0E0
|$D0A19F
|$C0
|00000000 - PLAY - CONTINUE - TIME
|Bookkeeping - Year play
|}


[[Category:Cartridge systems]]
[[Category:Cartridge systems]]

Latest revision as of 02:38, 21 October 2017

The backup RAM is a battery-powered 64KiB RAM space used by the MVS to store game scores, cab infos and income logs. Access can be handled by BIOS calls.

Memory region: $D00000~$D0FFFF (Mirrored up to $DFFFFF ?).

Data structure

All offset are taken from the sp-s2.bin system ROM.

Start End Size Data Description
$D00000 $D0000F 16 $00 Unused, fill with $00
$D00010 $D0001F 16 "BACKUP RAM OK!Ç" The routine at $C125C8 will check if this string is present, if not it will test the ram (using the test_ram routine at $C13134) and re-init the backupram
$D00020 $D00021 2 Coin deposit related (rising edge finding), old and new value of REG_STATUS_A
$D00022 $D00023 2 Temp value for the coin deposit rising edge finding
$D00024 $D00025 2 Internal coin counter (not credit)
$D00026 $D0002F ?
$D00034 $D00035 2 $00 "Internal" credit counters for player 1 and player 2 (BCD)
$D00036 $D00039 ?
$D0003A $D00045 12 Cab settings.
$D0003A
Coins needed for crediting player 1 (initialized to $01)
$D0003B
Credits added to player 1 (initialized to $01)
$D0003C
Coins needed for crediting player 2 (initialized to $01)
$D0003D
Credits added to player 2 (initialized to $02)
$D00042
Game select (1=Free, 0=Only when credited) (initialized to 0)
$D00043
Game start compulsion (0 = enabled, 1 = disabled)
$D00044
Game start compulsion time (max time in seconds in BCD between inserting a coin and starting the game) (initialized to $30)
$D00046
Demo sound (1=Without) (initialized to 0)
$D00046 $D00046 1 SOUND_STOP No sound at all if non-zero (except coinage sound effect)
$D00047 $D00047 1 SLOT NUMBER Number of detected slots (2 for slot1)
$D00048 $D0004B 4 PLAY TIME Counter of second played on the game in hex.

Reset to 0 by SYSTEM_RETURN.

$D0004C $D0004C 1 PLAY_TIME_FRAME_TIMER Frame timer, start at $3C, decremented each frame. When the counter reach $00, PLAY_TIME is incremented and the counter is reseted to $3C
$D0004D $D00057 ?
$D00058 $D00058 1 First slot number with a boot logo flag to 0 (playable by the system ROM)
$D0005A $D0005D 4 HHMMSSFF Timer based on frames.
  • FF: frame down-counter ($3C to $00)
  • SS: second counter ($00 to $3B)
  • MM: minute counter ($00 to $3B)
  • HH: hour counter *4 ($00 to $60 by 4 steps)
$D0005E $D00103 ?
$D00104 $D00107 4 YYMMDDdd Current date
$D00108 $D00108 1 Selected slot number (start at 0) Output directly to the EL panels
$D00109 $D00109 1 EL_PANEL State of the EL-PANEL ???
$D0010A $D0010D 4 Detailed game start book address
$D0010E $D00111 4 Total game start book address
$D00112 $D00115 4 Detailed cabinet coin book address (sub 0x240 for the start book one)
$D00116 $D00119 4 Current month cabinet coin book address (sub 0xC for the start book one)
$D0011A $D00121 ?
$D00122 $D00123 2 $23 The init_backupram routine write $23 there, purpose unknown.
$D00124 $D00127 4 Slot-1 NGH number and bram game block ID (see below) If not present $0000 as NGH and $FFFF as game name ID
$D00128 $D0012B 4 Slot-2 NGH number and bram game block ID (see below) If not present $0000 as NGH and $FFFF as game name ID.

On a slot1 always unset (slot1 are slot2 with the second one empty)

$D0012C $D0012F 4 Slot-3 NGH number and bram game block ID (see below) If not present $0000 as NGH and $FFFF as game name ID
$D00130 $D00133 4 Slot-4 NGH number and bram game block ID (see below) If not present $0000 as NGH and $FFFF as game name ID
$D00134 $D00137 4 Slot-5 NGH number and bram game block ID (see below) If not present $0000 as NGH and $FFFF as game name ID
$D00138 $D0013B 4 Slot-6 NGH number and bram game block ID (see below) If not present $0000 as NGH and $FFFF as game name ID
$D0013C $D0013F 4 Slot-7 NGH number and bram game block ID (see below) If not present $0000 as NGH and $FFFF as game name ID
$D00140 $D00143 4 Slot-8 NGH number and bram game block ID (see below) If not present $0000 as NGH and $FFFF as game name ID
$D00144 $D00147 4 YYMMDDdd Slot-1 book creation time YEAR-MONTH-DAY-day number
$D00148 $D0014B 4 YYMMDDdd Slot-2 book creation time YEAR-MONTH-DAY-day number
$D0014C $D0014F $4 YYMMDDdd Slot-3 book creation time YEAR-MONTH-DAY-day number
$D00150 $D00153 4 YYMMDDdd Slot-4 book creation time YEAR-MONTH-DAY-day number
$D00154 $D00157 4 YYMMDDdd Slot-5 book creation time YEAR-MONTH-DAY-day number
$D00158 $D0015B 4 YYMMDDdd Slot-6 book creation time YEAR-MONTH-DAY-day number
$D0015C $D0015F 4 YYMMDDdd Slot-7 book creation time YEAR-MONTH-DAY-day number
$D00160 $D00163 4 YYMMDDdd Slot-8 book creation time YEAR-MONTH-DAY-day number
$D00164 $D001A3 ?
$D001A4 $D001A7 4 Current month game start book
$D001A8 $D0021F ?
$D00220 $D0029F 16*8 Games soft DIPs settings (in which order ?)
$D002A0 $D002AF 16 bram block 0 game name
$D002B0 $D002BF 16 bram block 1 game name
$D002C0 $D002CF 16 bram block 2 game name
$D002D0 $D002DF 16 bram block 3 game name
$D002E0 $D002EF 16 bram block 4 game name
$D002F0 $D002FF 16 bram block 5 game name
$D00300 $D0030F 16 bram block 6 game name
$D00310 $D0031F 16 bram block 7 game name
$D00320 $D0131F $1000 bram block 1 data
$D01320 $D0231F $1000 bram block 2 data
$D02320 $D0331F $1000 bram block 3 data
$D03320 $D0431F $1000 bram block 4 data
$D04320 $D0531F $1000 bram block 5 data
$D05320 $D0631F $1000 bram block 6 data
$D06320 $D0731F $1000 bram block 7 data
$D07320 $D0831F $1000 bram block 8 data
$D09BA0 $D09DE0 $240 YYMMDDdd - COIN1 - COIN2 - SERVICE Bookkeeping - Current month coin

Each entry is $10 byte long

$D09DE0 $D0A01F $240 YYMMDDdd - PLAY - CONTINUE - TIME Bookkeeping - Current month play

Each entry is $10 byte long

$D0A020 $D0A0DF $C0 00000000 - COIN1 - COIN2 - SERVICE Bookkeeping - Year coin
$D0A0E0 $D0A19F $C0 00000000 - PLAY - CONTINUE - TIME Bookkeeping - Year play