pokecrystal-board/ram/sram.asm

148 lines
2.9 KiB
NASM
Raw Normal View History

SECTION "Scratch", SRAM
sScratch:: ds $60 tiles
2015-10-04 11:14:51 -07:00
SECTION "SRAM Bank 0", SRAM
2015-10-04 11:14:51 -07:00
2015-11-17 14:56:49 -08:00
sPartyMail::
; sPartyMon1Mail - sPartyMon6Mail
for n, 1, PARTY_LENGTH + 1
sPartyMon{d:n}Mail:: mailmsg sPartyMon{d:n}Mail
endr
2015-11-17 20:29:14 -08:00
2015-11-17 14:56:49 -08:00
sPartyMailBackup::
; sPartyMon1MailBackup - sPartyMon6MailBackup
for n, 1, PARTY_LENGTH + 1
sPartyMon{d:n}MailBackup:: mailmsg sPartyMon{d:n}MailBackup
endr
2015-11-17 14:56:49 -08:00
sMailboxCount:: db
sMailboxes::
; sMailbox1 - sMailbox10
for n, 1, MAILBOX_CAPACITY + 1
sMailbox{d:n}:: mailmsg sMailbox{d:n}
endr
2015-11-17 20:29:14 -08:00
sMailboxCountBackup:: db
sMailboxesBackup::
; sMailbox1Backup - sMailbox10Backup
for n, 1, MAILBOX_CAPACITY + 1
sMailbox{d:n}Backup:: mailmsg sMailbox{d:n}Backup
endr
2015-11-17 20:29:14 -08:00
sLuckyNumberDay:: db
sLuckyIDNumber:: dw
if DEF(_DEBUG)
sRTCStatusFlags:: db
endc
2015-10-04 11:14:51 -07:00
SECTION "Backup Save", SRAM
2018-01-23 14:39:09 -08:00
sBackupOptions:: ds wOptionsEnd - wOptions
2015-10-04 11:14:51 -07:00
sBackupCheckValue1:: db ; loaded with SAVE_CHECK_VALUE_1, used to check save corruption
2015-10-04 11:14:51 -07:00
2020-06-20 20:03:40 -07:00
sBackupGameData::
2015-10-04 11:14:51 -07:00
sBackupPlayerData:: ds wPlayerDataEnd - wPlayerData
2018-09-09 12:09:51 -07:00
sBackupCurMapData:: ds wCurMapDataEnd - wCurMapData
2015-10-04 11:14:51 -07:00
sBackupPokemonData:: ds wPokemonDataEnd - wPokemonData
sBackupGameDataEnd::
sBackupChecksum:: dw
sBackupCheckValue2:: db ; loaded with SAVE_CHECK_VALUE_2, used to check save corruption
sStackTop:: dw
2015-10-04 11:14:51 -07:00
if DEF(_DEBUG)
sRTCHaltCheckValue:: dw
sSkipBattle:: db
sDebugTimeCyclesSinceLastCall:: db
sOpenedInvalidSRAM:: db
sIsBugMon:: db
endc
2015-10-04 11:14:51 -07:00
SECTION "Save", SRAM
2015-10-04 11:14:51 -07:00
2018-01-23 14:39:09 -08:00
sOptions:: ds wOptionsEnd - wOptions
2015-10-04 11:14:51 -07:00
sCheckValue1:: db ; loaded with SAVE_CHECK_VALUE_1, used to check save corruption
2015-10-04 11:14:51 -07:00
2020-06-20 20:03:40 -07:00
sGameData::
2015-10-04 11:14:51 -07:00
sPlayerData:: ds wPlayerDataEnd - wPlayerData
2018-09-09 12:09:51 -07:00
sCurMapData:: ds wCurMapDataEnd - wCurMapData
2015-10-04 11:14:51 -07:00
sPokemonData:: ds wPokemonDataEnd - wPokemonData
sGameDataEnd::
sChecksum:: dw
sCheckValue2:: db ; loaded with SAVE_CHECK_VALUE_2, used to check save corruption
2015-10-04 11:14:51 -07:00
SECTION "Active Box", SRAM
sBox:: box sBox
2015-10-04 11:14:51 -07:00
SECTION "Link Battle Data", SRAM
sLinkBattleStats::
2020-06-20 20:03:40 -07:00
sLinkBattleWins:: dw
sLinkBattleLosses:: dw
sLinkBattleDraws:: dw
2017-12-13 21:36:24 -08:00
2016-01-12 21:39:41 -08:00
sLinkBattleRecord::
; sLinkBattleRecord1 - sLinkBattleRecord5
for n, 1, NUM_LINK_BATTLE_RECORDS + 1
sLinkBattleRecord{d:n}:: link_battle_record sLinkBattleRecord{d:n}
endr
2015-10-04 11:14:51 -07:00
sLinkBattleStatsEnd::
SECTION "SRAM Hall of Fame", SRAM
2020-06-20 20:03:40 -07:00
sHallOfFame::
; sHallOfFame1 - sHallOfFame30
for n, 1, NUM_HOF_TEAMS + 1
sHallOfFame{d:n}:: hall_of_fame sHallOfFame{d:n}
endr
2015-10-04 11:14:51 -07:00
sHallOfFameEnd::
; The PC boxes will not fit into one SRAM bank,
; so they use multiple SECTIONs
DEF box_n = 0
MACRO boxes
rept \1
DEF box_n += 1
sBox{d:box_n}:: box sBox{d:box_n}
endr
ENDM
2015-10-04 11:14:51 -07:00
2019-11-17 10:47:42 -08:00
SECTION "Boxes 1-7", SRAM
; sBox1 - sBox7
boxes 7
SECTION "Boxes 8-14", SRAM
; sBox8 - sBox14
boxes 7
; All 14 boxes fit exactly within 2 SRAM banks
assert box_n == NUM_BOXES, \
"boxes: Expected {d:NUM_BOXES} total boxes, got {d:box_n}"
SECTION "SRAM Disabled Spaces Backups", SRAM
sDisabledSpacesBackups:: ds wDisabledSpacesBackupsEnd - wDisabledSpacesBackups
SECTION "SRAM Map Objects Backups", SRAM
sMapObjectsBackups:: ds wMapObjectsBackupsEnd - wMapObjectsBackups