Clean up some WRAM and SRAM involving unused mobile data (#6)

This commit is contained in:
xCrystal
2023-08-18 12:04:53 +02:00
parent a5feb38470
commit d7ce3b27ab
7 changed files with 11 additions and 77 deletions

View File

@@ -1,21 +1,3 @@
InitCrystalData:
ld a, $1
ld [wd474], a
xor a
ld [wd473], a
ld [wPlayerGender], a
ld [wd475], a
ld [wd476], a
ld [wd477], a
ld [wd478], a
ld a, [wd479]
res 0, a ; ???
ld [wd479], a
ld a, [wd479]
res 1, a ; ???
ld [wd479], a
ret
InitGender:
call InitGenderScreen
call LoadGenderScreenPal
@@ -62,7 +44,6 @@ InitGenderScreen:
ld c, 8
call DelayFrames
call ClearBGPalettes
call InitCrystalData
call LoadFrame
hlcoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH

View File

@@ -302,7 +302,6 @@ LoadOrRegenerateLuckyIDNumber:
Continue:
farcall TryLoadSaveFile
jr c, .FailToLoad
farcall _LoadData
call LoadStandardMenuHeader
call DisplaySaveInfoOnContinue
ld a, $1

View File

@@ -339,7 +339,6 @@ ErasePreviousSave:
call EraseBoxes
call EraseHallOfFame
call EraseLinkBattleStats
call SaveData
ld a, BANK(sStackTop)
call OpenSRAM
xor a
@@ -368,10 +367,6 @@ EraseHallOfFame:
call ByteFill
jp CloseSRAM
SaveData:
call _SaveData
ret
HallOfFame_InitSaveIfNeeded:
ld a, [wSavedAtLeastOnce]
and a
@@ -717,31 +712,6 @@ VerifyBackupChecksum:
pop af
ret
_SaveData:
; This is called within two scenarios:
; a) ErasePreviousSave (the process of erasing the save from a previous game file)
; b) unused mobile functionality
; It is not part of a regular save.
ld a, BANK(sCrystalData)
call OpenSRAM
ld hl, wCrystalData
ld de, sCrystalData
ld bc, wCrystalDataEnd - wCrystalData
call CopyBytes
jp CloseSRAM
_LoadData:
ld a, BANK(sCrystalData)
call OpenSRAM
ld hl, sCrystalData
ld de, wCrystalData
ld bc, wCrystalDataEnd - wCrystalData
call CopyBytes
jp CloseSRAM
GetBoxAddress:
ld a, [wCurBox]
cp NUM_BOXES