Save, Bill's PC

This commit is contained in:
PikalaxALT 2015-11-17 23:29:14 -05:00
parent 27ef600ace
commit bc1870e3f4
12 changed files with 218 additions and 199 deletions

View File

@ -1165,30 +1165,30 @@ endr
cp $f
jr z, .asm_e2bf5
ld b, a
call Functione3396
call GetBoxPointer
ld a, b
call GetSRAMBank
push hl
ld bc, $35
ld bc, sBoxMon1Level - sBox
add hl, bc
ld bc, $20
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonLevel], a
pop hl
push hl
ld bc, $17
ld bc, sBoxMon1Item - sBox
add hl, bc
ld bc, $20
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonItem], a
pop hl
ld bc, $2b
ld bc, sBoxMon1DVs - sBox
add hl, bc
ld bc, $20
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld de, TempMonDVs
@ -1201,19 +1201,19 @@ endr
ret
.asm_e2bc6
ld hl, PartyMon1Level
ld bc, $30
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonLevel], a
ld hl, PartyMon1Item
ld bc, $30
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonItem], a
ld hl, PartyMon1DVs
ld bc, $30
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld de, TempMonDVs
@ -1228,21 +1228,21 @@ endr
ld a, BANK(sBox)
call GetSRAMBank
ld hl, sBoxMon1Level
ld bc, $20
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonLevel], a
ld hl, sBoxMon1Item
ld bc, $20
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonItem], a
ld hl, sBoxMon1DVs
ld bc, $20
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld de, TempMonDVs
@ -1307,6 +1307,7 @@ Functione2c6e: ; e2c6e (38:6c6e)
ld de, String_e2c67
call PlaceString
ret
.asm_e2c7c
inc de
ld a, [de]
@ -1320,36 +1321,38 @@ Functione2c6e: ; e2c6e (38:6c6e)
cp $f
jr z, .asm_e2cf1
push hl
call Functione3396
call GetBoxPointer
ld a, b
call GetSRAMBank
push hl
ld bc, $16
ld bc, sBoxMons - sBox
add hl, bc
ld bc, $20
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
pop hl
and a
jr z, .asm_e2cc2
ld bc, $372
ld bc, sBoxMonNicknames - sBox
add hl, bc
ld bc, $b
ld bc, PKMN_NAME_LENGTH
ld a, e
call AddNTimes
ld de, StringBuffer1
ld bc, $b
ld bc, PKMN_NAME_LENGTH
call CopyBytes
call CloseSRAM
pop hl
ld de, StringBuffer1
call PlaceString
ret
.asm_e2cc2
call CloseSRAM
pop hl
jr .asm_e2d23
.asm_e2cc8
push hl
ld hl, PartySpecies
@ -1359,19 +1362,21 @@ Functione2c6e: ; e2c6e (38:6c6e)
and a
jr z, .asm_e2cee
ld hl, PartyMonNicknames
ld bc, $b
ld bc, PKMN_NAME_LENGTH
ld a, e
call AddNTimes
ld de, StringBuffer1
ld bc, $b
ld bc, PKMN_NAME_LENGTH
call CopyBytes
pop hl
ld de, StringBuffer1
call PlaceString
ret
.asm_e2cee
pop hl
jr .asm_e2d23
.asm_e2cf1
push hl
ld a, BANK(sBox)
@ -1394,6 +1399,7 @@ Functione2c6e: ; e2c6e (38:6c6e)
ld de, StringBuffer1
call PlaceString
ret
.asm_e2d1f
call CloseSRAM
pop hl
@ -1422,7 +1428,7 @@ Functione2d30: ; e2d30 (38:6d30)
cp $f
jr z, .asm_e2db7
ld b, a
call Functione3396
call GetBoxPointer
ld a, b
call GetSRAMBank
inc hl
@ -1447,6 +1453,7 @@ Functione2d30: ; e2d30 (38:6d30)
inc a
ld [wd004], a
jr .asm_e2d57
.asm_e2d79
call CloseSRAM
ld a, $ff
@ -1455,6 +1462,7 @@ Functione2d30: ; e2d30 (38:6d30)
inc a
ld [wcb2c], a
ret
.asm_e2d87
ld hl, PartySpecies
.asm_e2d8a
@ -1478,6 +1486,7 @@ Functione2d30: ; e2d30 (38:6d30)
inc a
ld [wd004], a
jr .asm_e2d8a
.asm_e2dac
ld a, $ff
ld [de], a
@ -1485,6 +1494,7 @@ Functione2d30: ; e2d30 (38:6d30)
inc a
ld [wcb2c], a
ret
.asm_e2db7
ld a, BANK(sBox)
call GetSRAMBank
@ -1510,6 +1520,7 @@ Functione2d30: ; e2d30 (38:6d30)
inc a
ld [wd004], a
jr .asm_e2dbf
.asm_e2de1
call CloseSRAM
ld a, $ff
@ -1538,10 +1549,11 @@ Functione2e01: ; e2e01 (38:6e01)
jr nz, .asm_e2e0b
call ClearSprites
ret
.asm_e2e0b
ld hl, Unknown_e2e2b
ld de, Sprites
.done1
.loop
ld a, [hl]
cp $ff
ret z
@ -1561,7 +1573,7 @@ Functione2e01: ; e2e01 (38:6e01)
ld a, [hli]
ld [de], a
inc de
jr .done1
jr .loop
; e2e2b (38:6e2b)
Unknown_e2e2b: ; e2e2b
@ -1795,11 +1807,11 @@ Functione2fd6: ; e2fd6 (38:6fd6)
ld a, BANK(sBox)
call GetSRAMBank
ld hl, sBoxSpecies
call Functione3357
call CopySpeciesToTemp
ld hl, sBoxMonNicknames
call Functione3363
call CopyNicknameToTemp
ld hl, sBoxMonOT
call Functione3376
call CopyOTNameToTemp
ld hl, sBoxMons
ld bc, BOXMON_STRUCT_LENGTH
ld a, [CurPartyMon]
@ -1813,11 +1825,11 @@ Functione2fd6: ; e2fd6 (38:6fd6)
.asm_e3020
ld hl, PartySpecies
call Functione3357
call CopySpeciesToTemp
ld hl, PartyMonNicknames
call Functione3363
call CopyNicknameToTemp
ld hl, PartyMonOT
call Functione3376
call CopyOTNameToTemp
ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species)
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [CurPartyMon]
@ -1829,27 +1841,27 @@ Functione2fd6: ; e2fd6 (38:6fd6)
.asm_e3048
ld b, a
call Functione3396
call GetBoxPointer
ld a, b
call GetSRAMBank
push hl
inc hl
call Functione3357
call CopySpeciesToTemp
pop hl
push hl
ld bc, $372
ld bc, sBoxMonNicknames - sBox
add hl, bc
call Functione3363
call CopyNicknameToTemp
pop hl
push hl
ld bc, $296
ld bc, sBoxMonOT - sBox
add hl, bc
call Functione3376
call CopyOTNameToTemp
pop hl
ld bc, $16
ld bc, sBoxMons - sBox
add hl, bc
ld bc, $20
call Functione3389
ld bc, BOXMON_STRUCT_LENGTH
call CopyMonToTemp
call CloseSRAM
callba Function5088b
ret
@ -2141,7 +2153,7 @@ Functione32b0: ; e32b0
ld a, [wcb31]
dec a
ld e, a
callba Function14ac2
callba MovePkmnWOMail_SaveGame
ld a, [wcb30]
ld hl, wcb2f
add [hl]
@ -2149,14 +2161,14 @@ Functione32b0: ; e32b0
ld a, $1
call GetSRAMBank
ld hl, sBoxSpecies
call Functione3357
call CopySpeciesToTemp
ld hl, sBoxMonNicknames
call Functione3363
call CopyNicknameToTemp
ld hl, sBoxMonOT
call Functione3376
call CopyOTNameToTemp
ld hl, sBoxMons
ld bc, BOXMON_STRUCT_LENGTH
call Functione3389
call CopyMonToTemp
call CloseSRAM
callba Function5088b
ld a, PC_DEPOSIT
@ -2169,7 +2181,7 @@ Functione32fa: ; e32fa
ld a, [wcb2e]
dec a
ld e, a
callba Function14ac2
callba MovePkmnWOMail_SaveGame
ld a, [wcb2b]
ld hl, wcb2a
add [hl]
@ -2184,14 +2196,14 @@ Functione3316: ; e3316
add [hl]
ld [CurPartyMon], a
ld hl, PartySpecies
call Functione3357
call CopySpeciesToTemp
ld hl, PartyMonNicknames
call Functione3363
call CopyNicknameToTemp
ld hl, PartyMonOT
call Functione3376
call CopyOTNameToTemp
ld hl, PartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call Functione3389
call CopyMonToTemp
xor a
ld [wPokemonWithdrawDepositParameter], a
callba Functione039
@ -2207,7 +2219,7 @@ Functione3346: ; e3346
ret
; e3357
Functione3357: ; e3357 (38:7357)
CopySpeciesToTemp: ; e3357 (38:7357)
ld a, [CurPartyMon]
ld c, a
ld b, $0
@ -2216,36 +2228,36 @@ Functione3357: ; e3357 (38:7357)
ld [CurPartySpecies], a
ret
Functione3363: ; e3363 (38:7363)
ld bc, $b
CopyNicknameToTemp: ; e3363 (38:7363)
ld bc, PKMN_NAME_LENGTH
ld a, [CurPartyMon]
call AddNTimes
ld de, wd002
ld bc, $b
ld bc, PKMN_NAME_LENGTH
call CopyBytes
ret
Functione3376: ; e3376 (38:7376)
ld bc, $b
CopyOTNameToTemp: ; e3376 (38:7376)
ld bc, NAME_LENGTH
ld a, [CurPartyMon]
call AddNTimes
ld de, wd00d
ld bc, $b
ld bc, NAME_LENGTH
call CopyBytes
ret
Functione3389: ; e3389 (38:7389)
CopyMonToTemp: ; e3389 (38:7389)
ld a, [CurPartyMon]
call AddNTimes
ld de, wd018
ld de, wd018_Mon
call CopyBytes
ret
Functione3396: ; e3396 (38:7396)
GetBoxPointer: ; e3396 (38:7396)
dec b
ld c, b
ld b, 0
ld hl, Unknown_e33a6
ld hl, .boxes
rept 3
add hl, bc
endr
@ -2257,7 +2269,7 @@ endr
ret
; e33a6 (38:73a6)
Unknown_e33a6: ; e33a6
.boxes: ; e33a6
; bank, address
dba sBox1
dba sBox2
@ -2576,7 +2588,7 @@ Functione36f9: ; e36f9 (38:76f9)
ld a, [wCurBox]
cp e
ret z
callba Function14a83
callba ChangeBoxSaveGame
ret
.asm_e3745

View File

@ -3969,7 +3969,7 @@ Function29e53: ; 29e53
Special_TryQuickSave: ; 29e66
ld a, [wd265]
push af
callba Function14ab2
callba Link_SaveGame
ld a, $1
jr nc, .asm_29e75
xor a

View File

@ -150,7 +150,7 @@ Function49da4: ; 49da4
nop
nop
nop
ld a, [wcfcd]
ld a, [wSaveFileExists]
and a
jr nz, .next
ld a, $0
@ -220,7 +220,7 @@ Function49de4: ; 49de4
; 49e09
Function49e09: ; 49e09
ld a, [wcfcd]
ld a, [wSaveFileExists]
and a
ret z
xor a
@ -256,7 +256,7 @@ Function49e27: ; 49e27
Function49e3d: ; 49e3d
ld a, [wcfcd]
ld a, [wSaveFileExists]
and a
ret z
call Function6e3
@ -566,7 +566,7 @@ Function4a0c2: ; 4a0c2 (12:60c2)
pop af
and a
jr nz, .asm_4a0f9
callba Function1509a
callba _SaveData
.asm_4a0f9
ld c, 5
call DelayFrames

View File

@ -3,11 +3,11 @@ SaveMenu: ; 14a1a
callba Function5e9a
call SpeechTextBox
call UpdateSprites
callba Function4cf45
callba SaveMenu_LoadDETile
ld hl, UnknownText_0x15283
call SaveTheGame_yesorno
jr nz, .refused
call CheckForExistingSaveFile
call AskOverwriteSaveFile
jr c, .refused
call SetWRAMStateForSave
call _SavingDontTurnOffThePower
@ -15,36 +15,37 @@ SaveMenu: ; 14a1a
call ExitMenu
and a
ret
.refused
call ExitMenu
call Functiond90
callba Function4cf45
callba SaveMenu_LoadDETile
scf
ret
Function14a58: ; 14a58
call SetWRAMStateForSave
callba Function14056
callba Function1050d9
callba StageRTCTimeForSave
callba BackupMysteryGift
call SavePokemonData
call Function14e13
call SaveChecksum
call SaveBackupPokemonData
call SaveBackupChecksum
callba BackupPartyMonMail
callba Function1406a
callba SaveRTC
call ClearWRAMStateAfterSave
ret
; 14a83
Function14a83: ; 14a83 (5:4a83)
ChangeBoxSaveGame: ; 14a83 (5:4a83)
push de
ld hl, UnknownText_0x152a1
call MenuTextBox
call YesNoBox
call ExitMenu
jr c, .refused
call CheckForExistingSaveFile
call AskOverwriteSaveFile
jr c, .refused
call SetWRAMStateForSave
call SavingDontTurnOffThePower
@ -61,8 +62,8 @@ Function14a83: ; 14a83 (5:4a83)
pop de
ret
Function14ab2: ; 14ab2
call CheckForExistingSaveFile
Link_SaveGame: ; 14ab2
call AskOverwriteSaveFile
jr c, .refused
call SetWRAMStateForSave
call _SavingDontTurnOffThePower
@ -73,7 +74,7 @@ Function14ab2: ; 14ab2
ret
; 14ac2
Function14ac2: ; 14ac2
MovePkmnWOMail_SaveGame: ; 14ac2
call SetWRAMStateForSave
push de
call SaveBox
@ -93,14 +94,14 @@ Function14ad5: ; 14ad5
ld a, e
ld [wCurBox], a
ld a, $1
ld [wcfcd], a
callba Function14056
callba Function1050d9
ld [wSaveFileExists], a
callba StageRTCTimeForSave
callba BackupMysteryGift
call ValidateSave
call SaveOptions
call SavePlayerData
call SavePokemonData
call Function14e13
call SaveChecksum
call ValidateBackupSave
call SaveBackupOptions
call SaveBackupPlayerData
@ -108,31 +109,31 @@ Function14ad5: ; 14ad5
call SaveBackupChecksum
callba BackupPartyMonMail
callba BackupMobileEventIndex
callba Function1406a
callba SaveRTC
call LoadBox
call ClearWRAMStateAfterSave
ld de, SFX_SAVE
call PlaySFX
ld c, $18
ld c, 24
call DelayFrames
ret
; 14b34
Function14b34: ; 14b34
StartMovePkmnWOMail_SaveGame: ; 14b34
ld hl, UnknownText_0x152a6
call MenuTextBox
call YesNoBox
call ExitMenu
jr c, .asm_14b52
call CheckForExistingSaveFile
jr c, .asm_14b52
jr c, .refused
call AskOverwriteSaveFile
jr c, .refused
call SetWRAMStateForSave
call _SavingDontTurnOffThePower
call ClearWRAMStateAfterSave
and a
ret
.asm_14b52
.refused
scf
ret
; 14b54
@ -177,8 +178,8 @@ SaveGameData: ; 14b85
ret
; 14b89
CheckForExistingSaveFile: ; 14b89
ld a, [wcfcd]
AskOverwriteSaveFile: ; 14b89
ld a, [wSaveFileExists]
and a
jr z, .erase
call Function14bcb
@ -269,15 +270,15 @@ SavedTheGame: ; 14be6
SaveGameData_: ; 14c10
ld a, 1
ld [wcfcd], a
callba Function14056
callba Function1050d9
ld [wSaveFileExists], a
callba StageRTCTimeForSave
callba BackupMysteryGift
call ValidateSave
call SaveOptions
call SavePlayerData
call SavePokemonData
call SaveBox
call Function14e13
call SaveChecksum
call ValidateBackupSave
call SaveBackupOptions
call SaveBackupPlayerData
@ -286,14 +287,14 @@ SaveGameData_: ; 14c10
call UpdateStackTop
callba BackupPartyMonMail
callba BackupMobileEventIndex
callba Function1406a
ld a, BANK(s1_be45)
callba SaveRTC
ld a, BANK(sSaveType)
call GetSRAMBank
ld a, [s1_be45]
ld a, [sSaveType]
cp $4
jr nz, .ok
xor a
ld [s1_be45], a
ld [sSaveType], a
.ok
call CloseSRAM
ret
@ -371,7 +372,7 @@ ErasePreviousSave: ; 14cbb
call EraseHallOfFame
call EraseLinkBattleStats
call EraseMysteryGift
call Function14d68
call SaveData
call Function14d5c
ld a, BANK(sStackTop)
call GetSRAMBank
@ -395,10 +396,10 @@ EraseLinkBattleStats: ; 14ce2
; 14cf4
EraseMysteryGift: ; 14cf4
ld a, BANK(s0_abe4)
ld a, BANK(sBackupMysteryGiftItem)
call GetSRAMBank
ld hl, s0_abe4
ld bc, s0_abe4End - s0_abe4
ld hl, sBackupMysteryGiftItem
ld bc, sBackupMysteryGiftItemEnd - sBackupMysteryGiftItem
xor a
call ByteFill
jp CloseSRAM
@ -437,15 +438,15 @@ Unknown_14d2c: ; 14d2c
; 14d5c
Function14d5c: ; 14d5c
ld a, BANK(s1_be45)
ld a, BANK(sSaveType)
call GetSRAMBank
xor a
ld [s1_be45], a
ld [sSaveType], a
jp CloseSRAM
; 14d68
Function14d68: ; 14d68
call Function1509a
SaveData: ; 14d68
call _SaveData
ret
; 14d6c
@ -547,7 +548,7 @@ SaveBox: ; 14e0c
ret
; 14e13
Function14e13: ; 14e13
SaveChecksum: ; 14e13
ld hl, sGameData
ld bc, sGameDataEnd - sGameData
ld a, BANK(sGameData)
@ -632,7 +633,7 @@ TryLoadSaveFile: ; 14ea5 (5:4ea5)
call LoadBox
callba RestorePartyMonMail
callba RestoreMobileEventIndex
callba Function1050ea
callba RestoreMysteryGift
call ValidateBackupSave
call SaveBackupOptions
call SaveBackupPlayerData
@ -649,12 +650,12 @@ TryLoadSaveFile: ; 14ea5 (5:4ea5)
call LoadBox
callba RestorePartyMonMail
callba RestoreMobileEventIndex
callba Function1050ea
callba RestoreMysteryGift
call ValidateSave
call SaveOptions
call SavePlayerData
call SavePokemonData
call Function14e13
call SaveChecksum
and a
ret
@ -671,11 +672,11 @@ TryLoadSaveFile: ; 14ea5 (5:4ea5)
ret
Function14f1c: ; 14f1c
TryLoadSaveData: ; 14f1c
xor a
ld [wcfcd], a
call Function14f84
ld a, [wcfcd]
ld [wSaveFileExists], a
call CheckPrimarySaveFile
ld a, [wSaveFileExists]
and a
jr z, .backup
@ -693,8 +694,8 @@ Function14f1c: ; 14f1c
ret
.backup
call Function14faf
ld a, [wcfcd]
call CheckBackupSaveFile
ld a, [wSaveFileExists]
and a
jr z, .corrupt
@ -716,7 +717,7 @@ Function14f1c: ; 14f1c
ld de, Options
ld bc, OptionsEnd - Options
call CopyBytes
call Function67e
call PanicResetClock
ret
; 14f7c
@ -731,7 +732,7 @@ DefaultOptions: ; 14f7c
db $00
; 14f84
Function14f84: ; 14f84
CheckPrimarySaveFile: ; 14f84
ld a, BANK(s1_a008)
call GetSRAMBank
ld a, [s1_a008]
@ -746,14 +747,14 @@ Function14f84: ; 14f84
call CopyBytes
call CloseSRAM
ld a, $1
ld [wcfcd], a
ld [wSaveFileExists], a
.nope
call CloseSRAM
ret
; 14faf
Function14faf: ; 14faf
CheckBackupSaveFile: ; 14faf
ld a, BANK(s0_b208)
call GetSRAMBank
ld a, [s0_b208]
@ -767,7 +768,7 @@ Function14faf: ; 14faf
ld bc, OptionsEnd - Options
call CopyBytes
ld a, $2
ld [wcfcd], a
ld [wSaveFileExists], a
.nope
call CloseSRAM
@ -787,14 +788,14 @@ LoadPlayerData: ; 14fd7 (5:4fd7)
ld bc, wMapDataEnd - wMapData
call CopyBytes
call CloseSRAM
ld a, BANK(s1_be45)
ld a, BANK(sSaveType)
call GetSRAMBank
ld a, [s1_be45]
ld a, [sSaveType]
cp $4
jr nz, .asm_15008
jr nz, .not_4
ld a, $3
ld [s1_be45], a
.asm_15008
ld [sSaveType], a
.not_4
call CloseSRAM
ret
@ -822,10 +823,10 @@ VerifyChecksum: ; 15028 (5:5028)
call Checksum
ld a, [sChecksum + 0]
cp e
jr nz, .asm_15040
jr nz, .fail
ld a, [sChecksum + 1]
cp d
.asm_15040
.fail
push af
call CloseSRAM
pop af
@ -863,17 +864,17 @@ VerifyBackupChecksum: ; 1507c (5:507c)
call Checksum
ld a, [sBackupChecksum + 0]
cp e
jr nz, .asm_15094
jr nz, .fail
ld a, [sBackupChecksum + 1]
cp d
.asm_15094
.fail
push af
call CloseSRAM
pop af
ret
Function1509a: ; 1509a
_SaveData: ; 1509a
ld a, BANK(sCrystalData)
call GetSRAMBank
ld hl, wCrystalData

View File

@ -5,10 +5,10 @@ AskTimer:: ; 591
push af
ld a, [hMobile]
and a
jr z, .asm_59a
jr z, .not_mobile
call Timer
.asm_59a
.not_mobile
pop af
reti
; 59c
@ -190,7 +190,7 @@ FixTime:: ; 61d
Function658:: ; 658
xor a
ld [StringBuffer2], a
ld a, $0
ld a, $0 ; useless
ld [StringBuffer2 + 3], a
jr Function677
@ -202,7 +202,7 @@ Function663:: ; 663
ld [StringBuffer2 + 2], a
ld a, [hSeconds]
ld [StringBuffer2 + 3], a
jr Function677
jr Function677 ; useless
Function677:: ; 677
callba Function140ed
@ -211,13 +211,13 @@ Function677:: ; 677
Function67e:: ; 67e
call Function685
PanicResetClock:: ; 67e
call .ClearhRTC
call SetClock
ret
; 685
Function685:: ; 685
.ClearhRTC ; 685
xor a
ld [hRTCSeconds], a
ld [hRTCMinutes], a

View File

@ -494,7 +494,7 @@ Function5df0: ; 5df0
call DelayFrames
ld c, $1
callba Function4802f
callba Function1509a
callba _SaveData
ld a, $8
ld [MusicFade], a
ld a, MUSIC_NONE % $100
@ -1466,7 +1466,7 @@ CopyrightString: ; 63fd
; 642e
GameInit:: ; 642e
callba Function14f1c
callba TryLoadSaveData
call ResetTextRelatedRAM
call ClearBGPalettes
call ClearTileMap
@ -9924,7 +9924,7 @@ BillsPC_MovePKMNMenu: ; e4cd
jr .quit
.no_mail
callba Function14b34
callba StartMovePkmnWOMail_SaveGame
jr c, .quit
callba _MovePKMNWithoutMail
call ReturnToMapFromSubmenu
@ -11219,7 +11219,7 @@ Unknown_1404e: ; Unreferenced
; 14056
Function14056: ; 14056
StageRTCTimeForSave: ; 14056
call UpdateTime
ld hl, wRTC
ld a, [CurDay]
@ -11233,7 +11233,7 @@ Function14056: ; 14056
ret
; 1406a
Function1406a: ; 1406a
SaveRTC: ; 1406a
ld a, $a
ld [MBC3SRamEnable], a
call LatchClock
@ -14969,12 +14969,12 @@ Function2c642: ; 2c642 (b:4642)
call Function2c6ac
ld [de], a
inc de
ld a, BANK(s0_abe4)
ld a, BANK(sBackupMysteryGiftItem)
call GetSRAMBank
ld a, [s0_abe4]
ld a, [sBackupMysteryGiftItem]
ld [de], a
inc de
ld a, [s0_abe4 + 1]
ld a, [sBackupMysteryGiftItem + 1]
ld [de], a
ld a, $14
ld [wca00], a
@ -20677,7 +20677,7 @@ EmptyAllSRAMBanks: ; 4cf1f
; 4cf45
Function4cf45: ; 4cf45 (13:4f45)
SaveMenu_LoadDETile: ; 4cf45 (13:4f45)
ld a, [hCGB]
and a
jp z, WaitBGMap
@ -38369,7 +38369,7 @@ DoMysteryGift: ; 1048ba (41:48ba)
ld c, a
callba MysteryGiftGetItemHeldEffect
ld a, c
ld [s0_abe4], a
ld [sBackupMysteryGiftItem], a
ld [wNamedObjectIndexBuffer], a
call CloseSRAM
call GetItemName
@ -39434,10 +39434,10 @@ Function1050c8: ; 1050c8
; 1050d9
Function1050d9: ; 1050d9
BackupMysteryGift: ; 1050d9
call GetMysteryGiftBank
ld hl, sMysteryGiftItem
ld de, s0_abe4
ld de, sBackupMysteryGiftItem
ld a, [hli]
ld [de], a
inc de
@ -39447,9 +39447,9 @@ Function1050d9: ; 1050d9
; 1050ea
Function1050ea: ; 1050ea (41:50ea)
RestoreMysteryGift: ; 1050ea (41:50ea)
call GetMysteryGiftBank
ld hl, s0_abe4
ld hl, sBackupMysteryGiftItem
ld de, sMysteryGiftItem
ld a, [hli]
ld [de], a
@ -39470,7 +39470,7 @@ Function1050fb: ; 1050fb (41:50fb)
GetMysteryGiftBank: ; 105106
ld a, BANK(s0_abe4)
ld a, BANK(sBackupMysteryGiftItem)
jp GetSRAMBank
; 10510b

View File

@ -409,10 +409,10 @@ CopyBTTrainer_FromBT_OT_TowBT_OTTemp: ; 1704a2
pop af
ld [rSVBK], a
ld a, BANK(s1_be45)
ld a, BANK(sSaveType)
call GetSRAMBank
ld a, $2
ld [s1_be45], a
ld [sSaveType], a
ld hl, sNrOfBeatenBattleTowerTrainers
inc [hl]
call CloseSRAM

View File

@ -7965,7 +7965,7 @@ Function10378c: ; 10378c
.asm_10379c
push bc
callba Function14ab2
callba Link_SaveGame
pop bc
jr c, .asm_1037b5
ld a, $1

View File

@ -652,18 +652,18 @@ Function1706ee: ; 1706ee (5c:46ee)
ret
Function17071b: ; 17071b (5c:471b)
ld a, BANK(s1_be45)
ld a, BANK(sSaveType)
call GetSRAMBank
ld a, $3
ld [s1_be45], a
ld [sSaveType], a
call CloseSRAM
ret
Function170729: ; 170729 (5c:4729)
ld a, BANK(s1_be45)
ld a, BANK(sSaveType)
call GetSRAMBank
ld a, $4
ld [s1_be45], a
ld [sSaveType], a
call CloseSRAM
ret
@ -704,8 +704,8 @@ Function17075f: ; 17075f (5c:475f)
ret
Function170778: ; 170778 (5c:4778)
ld hl, s1_be45
ld a, BANK(s1_be45)
ld hl, sSaveType
ld a, BANK(sSaveType)
call GetSRAMBank
ld a, [hl]
ld [ScriptVar], a
@ -728,10 +728,10 @@ Function170799: ; 170799 (5c:4799)
Function17079d: ; 17079d (5c:479d)
ld c, $0
asm_17079f: ; 17079f (5c:479f)
ld a, BANK(s1_be45)
ld a, BANK(sSaveType)
call GetSRAMBank
ld a, c
ld [s1_be45], a
ld [sSaveType], a
call CloseSRAM
ret
@ -868,7 +868,7 @@ Function170881: ; 170881 (5c:4881)
ret
Function17089a: ; 17089a
ld a, [wcfcd]
ld a, [wSaveFileExists]
and a
jr z, .asm_1708ad
callba Function14bcb

View File

@ -3111,7 +3111,7 @@ Function17e3ac: ; 17e3ac
push af
ld a, $1
ld [rSVBK], a
callba Function14e13
callba SaveChecksum
pop af
ld [rSVBK], a
ret

View File

@ -15,15 +15,16 @@ mailmsg: MACRO
ds 3
\1MailType:: ds 1
endm
; a600
sPartyMail::
sPartyMon1Mail:: mailmsg sPartyMon1Mail
sPartyMon2Mail:: mailmsg sPartyMon2Mail
sPartyMon3Mail:: mailmsg sPartyMon3Mail
sPartyMon4Mail:: mailmsg sPartyMon4Mail
sPartyMon5Mail:: mailmsg sPartyMon5Mail
sPartyMon6Mail:: mailmsg sPartyMon6Mail
sPartyMon1Mail:: mailmsg sPartyMon1Mail
sPartyMon2Mail:: mailmsg sPartyMon2Mail
sPartyMon3Mail:: mailmsg sPartyMon3Mail
sPartyMon4Mail:: mailmsg sPartyMon4Mail
sPartyMon5Mail:: mailmsg sPartyMon5Mail
sPartyMon6Mail:: mailmsg sPartyMon6Mail
; a71a
sPartyMailBackup::
sPartyMon1MailBackup:: mailmsg sPartyMon1MailBackup
sPartyMon2MailBackup:: mailmsg sPartyMon2MailBackup
@ -32,35 +33,38 @@ sPartyMon4MailBackup:: mailmsg sPartyMon4MailBackup
sPartyMon5MailBackup:: mailmsg sPartyMon5MailBackup
sPartyMon6MailBackup:: mailmsg sPartyMon6MailBackup
; a834
sMailboxCount:: ds 1
sMailbox::
sMailbox1:: mailmsg sMailbox1
sMailbox2:: mailmsg sMailbox2
sMailbox3:: mailmsg sMailbox3
sMailbox4:: mailmsg sMailbox4
sMailbox5:: mailmsg sMailbox5
sMailbox6:: mailmsg sMailbox6
sMailbox7:: mailmsg sMailbox7
sMailbox8:: mailmsg sMailbox8
sMailbox9:: mailmsg sMailbox9
sMailbox10:: mailmsg sMailbox10
sMailbox1:: mailmsg sMailbox1
sMailbox2:: mailmsg sMailbox2
sMailbox3:: mailmsg sMailbox3
sMailbox4:: mailmsg sMailbox4
sMailbox5:: mailmsg sMailbox5
sMailbox6:: mailmsg sMailbox6
sMailbox7:: mailmsg sMailbox7
sMailbox8:: mailmsg sMailbox8
sMailbox9:: mailmsg sMailbox9
sMailbox10:: mailmsg sMailbox10
; aa0b
sMailboxCountBackup:: ds 1
sMailboxBackup::
sMailbox1Backup:: mailmsg sMailbox1Backup
sMailbox2Backup:: mailmsg sMailbox2Backup
sMailbox3Backup:: mailmsg sMailbox3Backup
sMailbox4Backup:: mailmsg sMailbox4Backup
sMailbox5Backup:: mailmsg sMailbox5Backup
sMailbox6Backup:: mailmsg sMailbox6Backup
sMailbox7Backup:: mailmsg sMailbox7Backup
sMailbox8Backup:: mailmsg sMailbox8Backup
sMailbox9Backup:: mailmsg sMailbox9Backup
sMailbox10Backup:: mailmsg sMailbox10Backup
sMailbox1Backup:: mailmsg sMailbox1Backup
sMailbox2Backup:: mailmsg sMailbox2Backup
sMailbox3Backup:: mailmsg sMailbox3Backup
sMailbox4Backup:: mailmsg sMailbox4Backup
sMailbox5Backup:: mailmsg sMailbox5Backup
sMailbox6Backup:: mailmsg sMailbox6Backup
sMailbox7Backup:: mailmsg sMailbox7Backup
sMailbox8Backup:: mailmsg sMailbox8Backup
sMailbox9Backup:: mailmsg sMailbox9Backup
sMailbox10Backup:: mailmsg sMailbox10Backup
; abe2
sMysteryGiftItem:: ds 1
s0_abe3:: ds 1
s0_abe4:: ds 1
sBackupMysteryGiftItem:: ds 1
s0_abe5:: ds 1
s0_abe6:: ds 10
s0_abf0:: ds 10
@ -71,7 +75,7 @@ sMysteryGiftTrainerHouseFlag:: ds 1
s0_abfe:: ds 12
sMysteryGiftTrainer:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + 1
ds 1
s0_abe4End::
sBackupMysteryGiftItemEnd::
ds $30
@ -145,7 +149,9 @@ sMobileEventIndex:: ds 1
sCrystalData::
ds wCrystalDataEnd - wCrystalData
sMobileEventIndexBackup:: ds 1
s1_be45:: ds 1
sSaveType:: ds 1
; 0: normal
; 2: battle tower
; data of the BattleTower must be in SRAM because you can save and leave between battles
sBattleTower:: ; be46

View File

@ -1418,7 +1418,7 @@ Options:: ; cfcc
; bit 7: battle scene off/on
ds 1
wcfcd:: ds 1
wSaveFileExists:: ds 1
TextBoxFrame:: ; cfce
; bits 0-2: textbox frame 0-7