pokecrystal-board/ram/sram.asm

401 lines
7.3 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
sMysteryGiftData::
sMysteryGiftItem:: db
sMysteryGiftUnlocked:: db
sBackupMysteryGiftItem:: db
sNumDailyMysteryGiftPartnerIDs:: db
sDailyMysteryGiftPartnerIDs:: ds MAX_MYSTERY_GIFT_PARTNERS * 2
2015-11-20 08:47:52 -08:00
sMysteryGiftDecorationsReceived:: flag_array NUM_NON_TROPHY_DECOS
ds 4
sMysteryGiftTimer:: dw
2015-10-04 11:14:51 -07:00
ds 1
sMysteryGiftTrainerHouseFlag:: db
2015-11-22 21:21:21 -08:00
sMysteryGiftPartnerName:: ds NAME_LENGTH
sMysteryGiftUnusedFlag:: db
sMysteryGiftTrainer:: ds wMysteryGiftTrainerEnd - wMysteryGiftTrainer
2015-11-17 20:29:14 -08:00
sBackupMysteryGiftItemEnd::
2015-10-04 11:14:51 -07:00
ds $30
2020-11-09 13:38:21 -08:00
sRTCStatusFlags:: db
ds 7
sLuckyNumberDay:: db
sLuckyIDNumber:: dw
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::
ds $18a
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::
ds $18a
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
2020-04-23 13:10:46 -07:00
ds $100
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::
SECTION "SRAM Crystal Data", SRAM
2015-10-04 11:14:51 -07:00
2020-06-20 20:03:40 -07:00
sMobileEventIndex:: db
sCrystalData:: ds wCrystalDataEnd - wCrystalData
2018-01-10 19:34:22 -08:00
2020-06-20 20:03:40 -07:00
sMobileEventIndexBackup:: db
SECTION "SRAM Battle Tower", SRAM
; Battle Tower data must be in SRAM because you can save and leave between battles
sBattleTowerChallengeState::
2015-11-17 20:29:14 -08:00
; 0: normal
; 2: battle tower
db
2015-10-04 11:14:51 -07:00
sNrOfBeatenBattleTowerTrainers:: db
sBTChoiceOfLevelGroup:: db
; Battle Tower trainers are saved here, so nobody appears more than once
2022-07-05 15:11:09 -07:00
sBTTrainers:: ds BATTLETOWER_STREAK_LENGTH
sBattleTowerSaveFileFlags:: db
sBattleTowerReward:: db
2020-06-20 20:03:40 -07:00
sBTMonOfTrainers::
; team of previous trainer
; sBTMonPrevTrainer1 - sBTMonPrevTrainer3
for n, 1, BATTLETOWER_PARTY_LENGTH + 1
sBTMonPrevTrainer{d:n}:: db
endr
; team of preprevious trainer
; sBTMonPrevPrevTrainer1 - sBTMonPrevPrevTrainer3
for n, 1, BATTLETOWER_PARTY_LENGTH + 1
sBTMonPrevPrevTrainer{d:n}:: db
endr
; 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}"
2019-04-10 11:46:16 -07:00
SECTION "SRAM Mobile 1", SRAM
ds $7
2020-06-20 20:03:40 -07:00
s4_a007:: ; struct size $30
ds $c
2019-04-10 11:46:16 -07:00
2020-06-20 20:03:40 -07:00
s4_a013:: ds 36
2019-04-10 11:46:16 -07:00
2020-06-20 20:03:40 -07:00
s4_a037:: ds 4
2020-06-20 20:03:40 -07:00
s4_a03b:: ds 37 * 40
2020-06-20 20:03:40 -07:00
s4_a603:: ds 8
2020-06-20 20:03:40 -07:00
s4_a60b:: db
s4_a60c:: db
s4_a60d:: db
2020-06-20 20:03:40 -07:00
s4_a60e:: dw
ds $1f0
2020-06-20 20:03:40 -07:00
sMobileBattleTimer:: ds 3
2020-06-21 09:21:47 -07:00
ds $7fd
s4_b000:: db
2019-04-10 11:46:16 -07:00
SECTION "SRAM Mobile 2", SRAM
ds 1 ; JP: location of sMobileEventIndex
2018-01-10 19:34:22 -08:00
2020-06-20 20:03:40 -07:00
sTrainerRankings::
sTrainerRankingGameTimeHOF:: ds 4
sTrainerRankingStepCountHOF:: ds 4
sTrainerRankingHealingsHOF:: ds 4
sTrainerRankingBattlesHOF:: ds 3
sTrainerRankingStepCount:: ds 4
sTrainerRankingBattleTowerWins:: ds 4
sTrainerRankingTMsHMsTaught:: ds 3
sTrainerRankingBattles:: ds 3
sTrainerRankingWildBattles:: ds 3
sTrainerRankingTrainerBattles:: ds 3
sTrainerRankingUnused1:: ds 3
sTrainerRankingHOFEntries:: ds 3
sTrainerRankingWildMonsCaught:: ds 3
sTrainerRankingHookedEncounters:: ds 3
sTrainerRankingEggsHatched:: ds 3
sTrainerRankingMonsEvolved:: ds 3
sTrainerRankingFruitPicked:: ds 3
sTrainerRankingHealings:: ds 3
sTrainerRankingMysteryGift:: ds 3
sTrainerRankingTrades:: ds 3
sTrainerRankingFly:: ds 3
sTrainerRankingSurf:: ds 3
sTrainerRankingWaterfall:: ds 3
sTrainerRankingWhiteOuts:: ds 3
sTrainerRankingLuckyNumberShow:: ds 3
sTrainerRankingPhoneCalls:: ds 3
sTrainerRankingUnused2:: ds 3
sTrainerRankingLinkBattles:: ds 3
sTrainerRankingSplash:: ds 3
sTrainerRankingTreeEncounters:: ds 3
sTrainerRankingUnused3:: ds 3
sTrainerRankingColosseumWins:: ds 3
sTrainerRankingColosseumLosses:: ds 3
sTrainerRankingColosseumDraws:: ds 3
sTrainerRankingSelfdestruct:: ds 3
sTrainerRankingCurrentSlotsStreak:: ds 2
sTrainerRankingLongestSlotsStreak:: ds 2
sTrainerRankingTotalSlotsPayouts:: ds 4
sTrainerRankingTotalBattlePayouts:: ds 4
sTrainerRankingLongestMagikarp:: ds 2
sTrainerRankingShortestMagikarp:: ds 2
sTrainerRankingBugContestScore:: ds 2
sTrainerRankingsChecksum:: ds 2
2020-06-20 20:03:40 -07:00
sTrainerRankingsEnd::
ds 1 ; JP: location of sMobileEventIndexBackup
2018-01-10 19:34:22 -08:00
2020-06-20 20:03:40 -07:00
sTrainerRankingsBackup:: ds sTrainerRankingsEnd - sTrainerRankings
2019-04-10 11:46:16 -07:00
ds $6fa
2020-06-20 20:03:40 -07:00
s5_a800:: db
2019-04-10 11:46:16 -07:00
sOfferEmail:: ds MOBILE_EMAIL_LENGTH
sOfferTrainerID:: dw
sOfferSecretID:: dw
sOfferGender:: db
sOfferSpecies:: db
sOfferReqGender:: db
sOfferReqSpecies:: db
sOfferMonSender:: ds NAME_LENGTH_JAPANESE - 1
sOfferMon:: party_struct sOfferMon
sOfferMonOT:: ds NAME_LENGTH_JAPANESE - 1
sOfferMonNick:: ds NAME_LENGTH_JAPANESE - 1
sOfferMonMail:: mailmsg_jp sOfferMonMail
s5_a890:: db
s5_a891:: db
s5_a892:: db
s5_a893:: db
2021-02-05 09:44:21 -08:00
s5_a894:: ds 6
s5_a89a:: dw
2020-06-20 20:03:40 -07:00
s5_a89c:: ds 22
s5_a8b2:: ds 150
2019-04-10 11:46:16 -07:00
2020-06-20 20:03:40 -07:00
s5_a948:: ds 246
2019-04-10 11:46:16 -07:00
ds $3
2020-06-20 20:03:40 -07:00
s5_aa41:: ds 4
2019-04-10 11:46:16 -07:00
ds $2
2020-06-20 20:03:40 -07:00
s5_aa47:: db
s5_aa48:: db
2019-04-10 11:46:16 -07:00
ds $1
2020-06-20 20:03:40 -07:00
s5_aa4a:: db
2019-04-10 11:46:16 -07:00
2020-06-20 20:03:40 -07:00
sMobileLoginPassword:: ds MOBILE_LOGIN_PASSWORD_LENGTH
2019-04-10 11:46:16 -07:00
ds $1
2020-06-20 20:03:40 -07:00
s5_aa5d:: ds MOBILE_LOGIN_PASSWORD_LENGTH
2019-04-10 11:46:16 -07:00
ds $4
2020-06-20 20:03:40 -07:00
s5_aa72:: db
s5_aa73:: ds 12
s5_aa7f:: ds 12
2019-04-10 11:46:16 -07:00
2020-06-20 20:03:40 -07:00
s5_aa8b:: db
s5_aa8c:: db
s5_aa8d:: db
s5_aa8e:: ds 7 * $cc
2019-04-10 11:46:16 -07:00
ds $1
2020-06-20 20:03:40 -07:00
s5_b023:: ds 105
s5_b08c:: ds 4
s5_b090:: db
s5_b091:: db
s5_b092:: ds 31
ds $100
2020-06-20 20:03:40 -07:00
s5_b1b1:: db
s5_b1b2:: db
s5_b1b3:: db
s5_b1b4:: db
2019-04-10 11:46:16 -07:00
ds $1e
2020-06-20 20:03:40 -07:00
s5_b1d3::
ds $120
2020-06-20 20:03:40 -07:00
s5_b2f3:: db
s5_b2f4:: ds 4
ds $1
2019-04-10 11:46:16 -07:00
2020-06-20 20:03:40 -07:00
s5_b2f9:: db
s5_b2fa:: db
s5_b2fb:: db
2019-04-10 11:46:16 -07:00
ds $b49
2020-06-20 20:03:40 -07:00
s5_be45:: db
s5_be46:: db
ds $1b8
2020-06-20 20:03:40 -07:00
s5_bfff:: db
SECTION "SRAM Mobile 3", SRAM
s6_a000:: db
db
s6_a002:: db
s6_a003:: db
s6_a004:: db
s6_a005:: db
s6_a006:: ds $1000
SECTION "SRAM Mobile 4", SRAM
s7_a000:: db
s7_a001:: db
2020-06-21 09:21:47 -07:00
ds $7fe
2020-06-21 09:21:47 -07:00
s7_a800:: db