mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Harmonize engine/{movie, pokemon} with pokegold (renames GetSRAMBank to OpenSRAM)
To do: engine/{menus, overworld}
This commit is contained in:
parent
be93ab33a7
commit
cc460a17b0
@ -521,7 +521,7 @@ Then create two new routines, `InvalidateSave` and `InvalidateBackupSave`:
|
||||
```diff
|
||||
ValidateSave:
|
||||
ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, SAVE_CHECK_VALUE_1
|
||||
ld [sCheckValue1], a
|
||||
ld a, SAVE_CHECK_VALUE_2
|
||||
@ -530,7 +530,7 @@ Then create two new routines, `InvalidateSave` and `InvalidateBackupSave`:
|
||||
|
||||
+InvalidateSave:
|
||||
+ ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
|
||||
+ call GetSRAMBank
|
||||
+ call OpenSRAM
|
||||
+ xor a
|
||||
+ ld [sCheckValue1], a
|
||||
+ ld [sCheckValue2], a
|
||||
@ -540,7 +540,7 @@ Then create two new routines, `InvalidateSave` and `InvalidateBackupSave`:
|
||||
```diff
|
||||
ValidateBackupSave:
|
||||
ld a, BANK(sBackupCheckValue1) ; aka BANK(sBackupCheckValue2)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, SAVE_CHECK_VALUE_1
|
||||
ld [sBackupCheckValue1], a
|
||||
ld a, SAVE_CHECK_VALUE_2
|
||||
@ -549,7 +549,7 @@ Then create two new routines, `InvalidateSave` and `InvalidateBackupSave`:
|
||||
|
||||
+InvalidateBackupSave:
|
||||
+ ld a, BANK(sBackupCheckValue1) ; aka BANK(sBackupCheckValue2)
|
||||
+ call GetSRAMBank
|
||||
+ call OpenSRAM
|
||||
+ xor a
|
||||
+ ld [sBackupCheckValue1], a
|
||||
+ ld [sBackupCheckValue2], a
|
||||
@ -1924,7 +1924,7 @@ This bug can affect Mew or Pokémon other than Ditto that used Transform via Mir
|
||||
jr nz, .room_in_party
|
||||
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBoxCount]
|
||||
cp MONS_PER_BOX
|
||||
call CloseSRAM
|
||||
|
@ -20,7 +20,7 @@ CheckBattleScene:
|
||||
jr nz, .from_wram
|
||||
|
||||
ld a, BANK(s4_a60c) ; MBC30 bank used by JP Crystal; inaccessible by MBC3
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s4_a60c]
|
||||
ld c, a
|
||||
call CloseSRAM
|
||||
|
@ -231,7 +231,7 @@ BattleTurn:
|
||||
Stubbed_Function3c1bf:
|
||||
ret
|
||||
ld a, BANK(s5_a89b) ; MBC30 bank used by JP Crystal; inaccessible by MBC3
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s5_a89b ; address of MBC30 bank
|
||||
inc [hl]
|
||||
jr nz, .finish
|
||||
@ -8398,7 +8398,7 @@ DisplayLinkBattleResult:
|
||||
call DelayFrames
|
||||
|
||||
ld a, BANK(sLinkBattleStats)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
call AddLastLinkBattleToLinkRecord
|
||||
call ReadAndPrintLinkBattleRecord
|
||||
@ -8446,7 +8446,7 @@ NUM_LINK_BATTLE_RECORDS EQUS "((sLinkBattleStatsEnd - sLinkBattleRecord) / LINK_
|
||||
|
||||
_DisplayLinkRecord:
|
||||
ld a, BANK(sLinkBattleStats)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
call ReadAndPrintLinkBattleRecord
|
||||
|
||||
|
@ -74,7 +74,7 @@ ReadTrainerParty:
|
||||
|
||||
.cal2
|
||||
ld a, BANK(sMysteryGiftTrainer)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, sMysteryGiftTrainer
|
||||
call TrainerType2
|
||||
call CloseSRAM
|
||||
@ -338,14 +338,14 @@ GetTrainerName::
|
||||
jr nz, .not_cal2
|
||||
|
||||
ld a, BANK(sMysteryGiftTrainerHouseFlag)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMysteryGiftTrainerHouseFlag]
|
||||
and a
|
||||
call CloseSRAM
|
||||
jr z, .not_cal2
|
||||
|
||||
ld a, BANK(sMysteryGiftPartnerName)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sMysteryGiftPartnerName
|
||||
call CopyTrainerName
|
||||
jp CloseSRAM
|
||||
|
@ -950,7 +950,7 @@ BattleAnimCmd_RaiseSub:
|
||||
ldh [rSVBK], a
|
||||
|
||||
xor a ; BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
GetSubstitutePic: ; used only for BANK(GetSubstitutePic)
|
||||
ld hl, sScratch
|
||||
@ -1025,7 +1025,7 @@ BattleAnimCmd_MinimizeOpp:
|
||||
ldh [rSVBK], a
|
||||
|
||||
xor a ; BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call GetMinimizePic
|
||||
call Request2bpp
|
||||
call CloseSRAM
|
||||
@ -1081,7 +1081,7 @@ BattleAnimCmd_Minimize:
|
||||
ldh [rSVBK], a
|
||||
|
||||
xor a ; BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call GetMinimizePic
|
||||
ld hl, vTiles0 tile $00
|
||||
call Request2bpp
|
||||
|
@ -18,7 +18,7 @@ Function1700c4:
|
||||
call Function17042c
|
||||
|
||||
ld a, BANK(s5_be45) ; aka BANK(s5_be46), BANK(s5_aa41), and BANK(s5_aa5d)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, 1
|
||||
ld [s5_be45], a
|
||||
xor a
|
||||
@ -58,7 +58,7 @@ Function170114:
|
||||
|
||||
.Function170121:
|
||||
ld a, BANK(s5_a948)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s5_a948
|
||||
ld de, wc608
|
||||
ld bc, 246
|
||||
@ -70,7 +70,7 @@ Function170114:
|
||||
Function170139:
|
||||
; Convert the 4-digit decimal number at 5:aa41 into binary
|
||||
ld a, BANK(s5_aa41)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, s5_aa41
|
||||
ld h, 0
|
||||
ld l, h
|
||||
@ -147,14 +147,14 @@ Function170139:
|
||||
jr nz, .CopyLoop
|
||||
|
||||
ld a, BANK(s4_a013)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s4_a013
|
||||
ld bc, 36
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
|
||||
ld a, BANK(s5_a894) ; aka BANK(s5_a948)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s5_a894
|
||||
ld bc, NAME_LENGTH_JAPANESE
|
||||
call CopyBytes
|
||||
@ -246,7 +246,7 @@ RunBattleTowerTrainer:
|
||||
and a ; WIN?
|
||||
jr nz, .lost
|
||||
ld a, BANK(sNrOfBeatenBattleTowerTrainers)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sNrOfBeatenBattleTowerTrainers]
|
||||
ld [wNrOfBeatenBattleTowerTrainers], a
|
||||
call CloseSRAM
|
||||
@ -410,7 +410,7 @@ endr
|
||||
ld [wCurSpecies], a
|
||||
call GetBaseData
|
||||
ld a, BANK(s5_b2fb)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_b2fb] ; s5_b2fb ; max level?
|
||||
call CloseSRAM
|
||||
ld e, a
|
||||
@ -572,7 +572,7 @@ CopyBTTrainer_FromBT_OT_TowBT_OTTemp:
|
||||
ldh [rSVBK], a
|
||||
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, BATTLETOWER_CHALLENGE_IN_PROGESS
|
||||
ld [sBattleTowerChallengeState], a
|
||||
ld hl, sNrOfBeatenBattleTowerTrainers
|
||||
@ -643,7 +643,7 @@ Function1704e1:
|
||||
|
||||
.Jumptable_0:
|
||||
ld a, BANK(s5_a89c)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld hl, s5_a89c
|
||||
ld de, wStringBuffer3
|
||||
@ -917,7 +917,7 @@ BattleTowerAction:
|
||||
; Reset the save memory for BattleTower-Trainers (Counter and all 7 TrainerBytes)
|
||||
ResetBattleTowerTrainersSRAM:
|
||||
ld a, BANK(sBTTrainers)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld a, $ff
|
||||
ld hl, sBTTrainers
|
||||
@ -933,7 +933,7 @@ ResetBattleTowerTrainersSRAM:
|
||||
|
||||
BattleTower_GiveReward:
|
||||
ld a, BANK(sBattleTowerReward)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld a, [sBattleTowerReward]
|
||||
call CloseSRAM
|
||||
@ -962,7 +962,7 @@ BattleTower_GiveReward:
|
||||
|
||||
Function17071b:
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, BATTLETOWER_WON_CHALLENGE
|
||||
ld [sBattleTowerChallengeState], a
|
||||
call CloseSRAM
|
||||
@ -970,7 +970,7 @@ Function17071b:
|
||||
|
||||
Function170729:
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, BATTLETOWER_RECEIVED_REWARD
|
||||
ld [sBattleTowerChallengeState], a
|
||||
call CloseSRAM
|
||||
@ -995,7 +995,7 @@ BattleTower_RandomlyChooseReward:
|
||||
jr z, .loop
|
||||
push af
|
||||
ld a, BANK(sBattleTowerReward)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
pop af
|
||||
ld [sBattleTowerReward], a
|
||||
call CloseSRAM
|
||||
@ -1008,7 +1008,7 @@ BattleTowerAction_CheckExplanationRead:
|
||||
ret z
|
||||
|
||||
ld a, BANK(sBattleTowerSaveFileFlags)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBattleTowerSaveFileFlags]
|
||||
and 2
|
||||
ld [wScriptVar], a
|
||||
@ -1018,7 +1018,7 @@ BattleTowerAction_CheckExplanationRead:
|
||||
BattleTowerAction_GetChallengeState:
|
||||
ld hl, sBattleTowerChallengeState
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hl]
|
||||
ld [wScriptVar], a
|
||||
call CloseSRAM
|
||||
@ -1026,7 +1026,7 @@ BattleTowerAction_GetChallengeState:
|
||||
|
||||
BattleTowerAction_SetExplanationRead:
|
||||
ld a, BANK(sBattleTowerSaveFileFlags)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBattleTowerSaveFileFlags]
|
||||
or 2
|
||||
ld [sBattleTowerSaveFileFlags], a
|
||||
@ -1041,7 +1041,7 @@ BattleTowerAction_SetByteToCancelChallenge:
|
||||
ld c, BATTLETOWER_NO_CHALLENGE
|
||||
asm_17079f:
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, c
|
||||
ld [sBattleTowerChallengeState], a
|
||||
call CloseSRAM
|
||||
@ -1049,7 +1049,7 @@ asm_17079f:
|
||||
|
||||
Function1707ac:
|
||||
ld a, BANK(s5_aa8c) ; aka BANK(s5_be46)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_aa8c]
|
||||
ld b, a
|
||||
ld a, [s5_be46]
|
||||
@ -1064,7 +1064,7 @@ Function1707ac:
|
||||
call UpdateTime
|
||||
pop bc
|
||||
ld a, BANK(s5_aa8c)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_aa8b]
|
||||
call CloseSRAM
|
||||
ld c, a
|
||||
@ -1090,7 +1090,7 @@ Function1707ac:
|
||||
|
||||
Function1707f4:
|
||||
ld a, BANK(s5_be46) ; aka BANK(s5_aa8b) and BANK(s5_aa8c)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [s5_be46], a
|
||||
ld [s5_aa8b], a
|
||||
@ -1101,7 +1101,7 @@ Function1707f4:
|
||||
Function170807:
|
||||
call UpdateTime
|
||||
ld a, BANK(s5_b2f9) ; aka BANK(s5_b2fa)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wCurDay]
|
||||
ld [s5_b2f9], a
|
||||
xor a
|
||||
@ -1113,7 +1113,7 @@ Function17081d:
|
||||
xor a
|
||||
ld [wScriptVar], a
|
||||
ld a, BANK(s5_b2f9) ; aka BANK(s5_b2fa)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_b2f9]
|
||||
ld c, a
|
||||
ld a, [s5_b2fa]
|
||||
@ -1145,7 +1145,7 @@ Function17081d:
|
||||
ld a, 1
|
||||
ld [wScriptVar], a
|
||||
ld a, BANK(s5_b2f9) ; aka BANK(s5_b2fa)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [s5_b2f9], a
|
||||
ld [s5_b2fa], a
|
||||
@ -1154,7 +1154,7 @@ Function17081d:
|
||||
|
||||
SaveBattleTowerLevelGroup:
|
||||
ld a, BANK(sBTChoiceOfLevelGroup)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ldh a, [rSVBK]
|
||||
push af
|
||||
ld a, BANK(wBTChoiceOfLvlGroup)
|
||||
@ -1168,7 +1168,7 @@ SaveBattleTowerLevelGroup:
|
||||
|
||||
LoadBattleTowerLevelGroup: ; Load level group choice
|
||||
ld a, BANK(sBTChoiceOfLevelGroup)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ldh a, [rSVBK]
|
||||
push af
|
||||
ld a, BANK(wBTChoiceOfLvlGroup)
|
||||
@ -1204,7 +1204,7 @@ Function1708b1: ; BattleTowerAction $0a
|
||||
|
||||
CheckMobileEventIndex: ; BattleTowerAction $0b something to do with GS Ball
|
||||
ld a, BANK(sMobileEventIndex)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMobileEventIndex]
|
||||
ld [wScriptVar], a
|
||||
call CloseSRAM
|
||||
@ -1213,7 +1213,7 @@ CheckMobileEventIndex: ; BattleTowerAction $0b something to do with GS Ball
|
||||
Function1708c8: ; BattleTowerAction $0c
|
||||
call UpdateTime
|
||||
ld a, BANK(s5_aa8b) ; aka BANK(s5_aa8c), BANK(s5_aa5d), BANK(s5_aa48), and BANK(s5_aa47)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wCurDay]
|
||||
ld [s5_aa8b], a
|
||||
xor a
|
||||
@ -1234,7 +1234,7 @@ Function1708f0: ; BattleTowerAction $0d
|
||||
ld [wScriptVar], a
|
||||
call UpdateTime
|
||||
ld a, BANK(s5_aa48) ; aka BANK(s5_aa47)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_aa48]
|
||||
ld c, a
|
||||
ld a, [s5_aa47]
|
||||
@ -1246,7 +1246,7 @@ Function1708f0: ; BattleTowerAction $0d
|
||||
cp [hl]
|
||||
jr nz, Function170923
|
||||
ld a, BANK(s5_aa5d)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_aa5d]
|
||||
call CloseSRAM
|
||||
cp 5
|
||||
@ -1257,7 +1257,7 @@ Function1708f0: ; BattleTowerAction $0d
|
||||
|
||||
Function170923:
|
||||
ld a, BANK(s5_aa48) ; aka BANK(s5_aa47) and BANK(s5_aa5d)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [s5_aa48], a
|
||||
ld [s5_aa47], a
|
||||
@ -1352,7 +1352,7 @@ Function1709bb: ; BattleTowerAction $10
|
||||
xor a ; FALSE
|
||||
ld [wScriptVar], a
|
||||
ld a, BANK(s5_a800)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_a800]
|
||||
call CloseSRAM
|
||||
cp 6
|
||||
@ -1369,7 +1369,7 @@ Function1709bb: ; BattleTowerAction $10
|
||||
|
||||
.invalid
|
||||
ld a, BANK(s5_a800)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [s5_a800], a
|
||||
call CloseSRAM
|
||||
@ -1385,7 +1385,7 @@ Function1709bb: ; BattleTowerAction $10
|
||||
|
||||
.DoAction1:
|
||||
ld a, BANK(s5_a800)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, 1
|
||||
ld [s5_a800], a
|
||||
call CloseSRAM
|
||||
@ -1395,7 +1395,7 @@ Function1709bb: ; BattleTowerAction $10
|
||||
|
||||
.Action4:
|
||||
ld a, BANK(s5_b023) ; aka BANK(s5_a825) and BANK(s5_a826)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s5_b023
|
||||
ld de, wc608
|
||||
ld bc, 105
|
||||
@ -1413,14 +1413,14 @@ Function1709bb: ; BattleTowerAction $10
|
||||
|
||||
.Action5:
|
||||
ld a, 0 ; ???
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wRTC
|
||||
ld de, wc608
|
||||
ld bc, 4
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, BANK(s5_b08c)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s5_b08c
|
||||
ld de, wc608
|
||||
ld c, 4
|
||||
@ -1453,7 +1453,7 @@ Function1709bb: ; BattleTowerAction $10
|
||||
.different
|
||||
call CloseSRAM
|
||||
ld a, BANK(s5_a800)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [s5_a800], a
|
||||
call CloseSRAM
|
||||
@ -1480,7 +1480,7 @@ Function170aa0:
|
||||
ld c, TRUE
|
||||
asm_170aa2:
|
||||
ld a, BANK(s5_aa8d)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, c
|
||||
ld [s5_aa8d], a
|
||||
call CloseSRAM
|
||||
@ -1488,7 +1488,7 @@ asm_170aa2:
|
||||
|
||||
Function170aaf:
|
||||
ld a, BANK(s5_aa8d)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_aa8d]
|
||||
ld [wScriptVar], a
|
||||
call CloseSRAM
|
||||
@ -1501,7 +1501,7 @@ Function170abe:
|
||||
ret z
|
||||
|
||||
ld a, BANK(sBattleTowerSaveFileFlags)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBattleTowerSaveFileFlags]
|
||||
and 1
|
||||
ld [wScriptVar], a
|
||||
@ -1510,7 +1510,7 @@ Function170abe:
|
||||
|
||||
Function170ad7:
|
||||
ld a, BANK(sBattleTowerSaveFileFlags)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBattleTowerSaveFileFlags]
|
||||
or 1
|
||||
ld [sBattleTowerSaveFileFlags], a
|
||||
@ -1519,7 +1519,7 @@ Function170ad7:
|
||||
|
||||
BattleTowerAction_LevelCheck:
|
||||
ld a, BANK(s5_b2fb)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_b2fb]
|
||||
call CloseSRAM
|
||||
ld c, 10
|
||||
@ -1531,7 +1531,7 @@ BattleTowerAction_LevelCheck:
|
||||
farcall BattleTower_LevelCheck
|
||||
ret nc
|
||||
ld a, BANK(s5_b2fb)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_b2fb]
|
||||
call CloseSRAM
|
||||
ld [wScriptVar], a
|
||||
@ -1539,7 +1539,7 @@ BattleTowerAction_LevelCheck:
|
||||
|
||||
BattleTowerAction_UbersCheck:
|
||||
ld a, BANK(s5_b2fb)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_b2fb]
|
||||
call CloseSRAM
|
||||
ld c, 10
|
||||
@ -1551,7 +1551,7 @@ BattleTowerAction_UbersCheck:
|
||||
farcall BattleTower_UbersCheck
|
||||
ret nc
|
||||
ld a, BANK(s5_b2fb)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_b2fb]
|
||||
call CloseSRAM
|
||||
ld [wScriptVar], a
|
||||
|
@ -39,7 +39,7 @@ endc
|
||||
ld b, a
|
||||
|
||||
ld a, BANK(sBTTrainers)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld c, BATTLETOWER_STREAK_LENGTH
|
||||
ld hl, sBTTrainers
|
||||
@ -96,7 +96,7 @@ Function_LoadRandomBattleTowerMon:
|
||||
.loop
|
||||
push bc
|
||||
ld a, BANK(sBTMonPrevTrainer1)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.FindARandomBattleTowerMon:
|
||||
; From Which LevelGroup are the mon loaded
|
||||
|
@ -1,6 +1,6 @@
|
||||
CheckSave::
|
||||
ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sCheckValue1]
|
||||
ld b, a
|
||||
ld a, [sCheckValue2]
|
||||
|
@ -412,7 +412,7 @@ LoadHOFTeam:
|
||||
ld bc, wHallOfFameTempEnd - wHallOfFameTemp + 1
|
||||
call AddNTimes
|
||||
ld a, BANK(sHallOfFame)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr z, .absent
|
||||
|
@ -20,7 +20,7 @@ CheckForLuckyNumberWinners:
|
||||
dec d
|
||||
jr nz, .PartyLoop
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBoxCount]
|
||||
and a
|
||||
jr z, .SkipOpenBox
|
||||
@ -59,7 +59,7 @@ CheckForLuckyNumberWinners:
|
||||
add hl, bc
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a ; hl now contains the address of the loaded box in SRAM
|
||||
|
@ -159,7 +159,7 @@ _UnownPrinter:
|
||||
ldh [rSVBK], a
|
||||
|
||||
ld a, BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, wDecompressScratch
|
||||
ld hl, sScratch
|
||||
ldh a, [hROMBank]
|
||||
@ -180,7 +180,7 @@ _UnownPrinter:
|
||||
ld de, UnownDexVacantString
|
||||
call PlaceString
|
||||
xor a ; sScratch
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sScratch
|
||||
ld bc, $31 tiles
|
||||
xor a
|
||||
|
@ -2,7 +2,7 @@ RotateUnownFrontpic:
|
||||
; something to do with Unown printer
|
||||
push de
|
||||
xor a ; BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sScratch
|
||||
ld bc, 0
|
||||
.loop
|
||||
|
@ -128,7 +128,7 @@ PlayersHousePC:
|
||||
|
||||
CheckMysteryGift:
|
||||
ld a, BANK(sMysteryGiftItem)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMysteryGiftItem]
|
||||
and a
|
||||
jr z, .no
|
||||
@ -141,7 +141,7 @@ CheckMysteryGift:
|
||||
|
||||
GetMysteryGiftItem:
|
||||
ld a, BANK(sMysteryGiftItem)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMysteryGiftItem]
|
||||
ld [wCurItem], a
|
||||
ld a, 1
|
||||
@ -420,7 +420,7 @@ PrintDiploma:
|
||||
|
||||
TrainerHouse:
|
||||
ld a, BANK(sMysteryGiftTrainerHouseFlag)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMysteryGiftTrainerHouseFlag]
|
||||
ld [wScriptVar], a
|
||||
jp CloseSRAM
|
||||
|
@ -221,7 +221,7 @@ DoAnimFrame:
|
||||
ret
|
||||
|
||||
.GameFreakLogo:
|
||||
callfar GameFreakLogoJumper
|
||||
callfar PlaceGameFreakLogo
|
||||
ret
|
||||
|
||||
.GSIntroStar
|
||||
|
@ -203,7 +203,7 @@ PokeBallEffect:
|
||||
jr nz, .room_in_party
|
||||
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBoxCount]
|
||||
cp MONS_PER_BOX
|
||||
call CloseSRAM
|
||||
@ -605,7 +605,7 @@ PokeBallEffect:
|
||||
farcall SetBoxMonCaughtData
|
||||
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld a, [sBoxCount]
|
||||
cp MONS_PER_BOX
|
||||
@ -641,7 +641,7 @@ PokeBallEffect:
|
||||
farcall NamingScreen
|
||||
|
||||
ld a, BANK(sBoxMonNicknames)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld hl, wMonOrItemNameBuffer
|
||||
ld de, sBoxMonNicknames
|
||||
@ -656,7 +656,7 @@ PokeBallEffect:
|
||||
|
||||
.SkipBoxMonNickname:
|
||||
ld a, BANK(sBoxMonNicknames)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld hl, sBoxMonNicknames
|
||||
ld de, wMonOrItemNameBuffer
|
||||
|
@ -835,7 +835,7 @@ Link_PrepPartyData_Gen2:
|
||||
|
||||
; Copy all the mail messages to wc9f9
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPartyMail
|
||||
ld b, PARTY_LENGTH
|
||||
.loop2
|
||||
@ -1706,7 +1706,7 @@ LinkTrade:
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
call AddNTimes
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
@ -2508,7 +2508,7 @@ INCBIN "gfx/trade/unused_gs_border_tiles.2bpp"
|
||||
|
||||
Unreferenced_Function29fe4:
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld d, FALSE
|
||||
ld b, CHECK_FLAG
|
||||
predef SmallFarFlagAction
|
||||
|
@ -1202,14 +1202,14 @@ MysteryGift_ClearTrainerData:
|
||||
|
||||
GetMysteryGiftBank:
|
||||
ld a, BANK(sBackupMysteryGiftItem)
|
||||
jp GetSRAMBank
|
||||
jp OpenSRAM
|
||||
|
||||
StagePartyDataForMysteryGift:
|
||||
; You will be sending this data to your mystery gift partner.
|
||||
; Structure is the same as a trainer with species and moves
|
||||
; defined.
|
||||
ld a, BANK(sPokemonData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, wMysteryGiftStaging
|
||||
ld bc, sPokemonData + wPartyMons - wPokemonData
|
||||
ld hl, sPokemonData + wPartySpecies - wPokemonData
|
||||
@ -1521,7 +1521,7 @@ Function105777:
|
||||
Function10578c:
|
||||
ld de, wLinkData
|
||||
ld a, BANK(sPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPlayerData + wPlayerName - wPlayerData
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyBytes
|
||||
@ -1533,12 +1533,12 @@ Function10578c:
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, BANK(sCrystalData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sCrystalData + 0]
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, BANK(s4_a603) ; aka BANK(s4_a007) ; MBC30 bank used by JP Crystal; inaccessible by MBC3
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s4_a603 ; address of MBC30 bank
|
||||
ld bc, $8
|
||||
call CopyBytes
|
||||
|
@ -4,7 +4,7 @@ PrepMysteryGiftDataToSend:
|
||||
ld [de], a
|
||||
inc de ; wc801
|
||||
ld a, BANK(sGameData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPlayerData + wPlayerID - wPlayerData
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
@ -42,7 +42,7 @@ PrepMysteryGiftDataToSend:
|
||||
ld [de], a
|
||||
inc de ; wc812
|
||||
ld a, BANK(sBackupMysteryGiftItem)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBackupMysteryGiftItem]
|
||||
ld [de], a
|
||||
inc de
|
||||
|
@ -10,7 +10,7 @@ EmptyAllSRAMBanks:
|
||||
ret
|
||||
|
||||
.EmptyBank:
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, SRAM_Begin
|
||||
ld bc, SRAM_End - SRAM_Begin
|
||||
xor a
|
||||
|
@ -137,7 +137,7 @@ _ResetWRAM:
|
||||
call SetDefaultBoxNames
|
||||
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxCount
|
||||
call .InitList
|
||||
call CloseSRAM
|
||||
@ -167,7 +167,7 @@ _ResetWRAM:
|
||||
ld [wRoamMon3MapNumber], a
|
||||
|
||||
ld a, BANK(sMysteryGiftItem)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sMysteryGiftItem
|
||||
xor a
|
||||
ld [hli], a
|
||||
@ -304,7 +304,7 @@ InitializeWorld:
|
||||
|
||||
LoadOrRegenerateLuckyIDNumber:
|
||||
ld a, BANK(sLuckyIDNumber)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wCurDay]
|
||||
inc a
|
||||
ld b, a
|
||||
@ -953,7 +953,7 @@ Intro_PlacePlayerSprite:
|
||||
db 10 * 8 + 4, 10 * 8, 3
|
||||
|
||||
CrystalIntroSequence:
|
||||
callfar Copyright_GFPresents
|
||||
callfar Copyright_GameFreakPresents
|
||||
jr c, StartTitleScreen
|
||||
farcall CrystalIntro
|
||||
|
||||
|
@ -155,7 +155,7 @@ MainMenu_GetWhichMenu:
|
||||
ld a, $1
|
||||
ret nz
|
||||
ld a, BANK(sNumDailyMysteryGiftPartnerIDs)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sNumDailyMysteryGiftPartnerIDs]
|
||||
cp -1
|
||||
call CloseSRAM
|
||||
|
@ -697,7 +697,7 @@ Unreferenced_Function24423:
|
||||
bit 0, a
|
||||
ret z
|
||||
xor a ; sScratch
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
hlcoord 0, 0
|
||||
ld de, sScratch
|
||||
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
||||
@ -705,7 +705,7 @@ Unreferenced_Function24423:
|
||||
call CloseSRAM
|
||||
call OverworldTextModeSwitch
|
||||
xor a ; sScratch
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sScratch
|
||||
decoord 0, 0
|
||||
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
||||
|
@ -144,7 +144,7 @@ ResumeGameLogic:
|
||||
|
||||
AddHallOfFameEntry:
|
||||
ld a, BANK(sHallOfFame)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sHallOfFame + HOF_LENGTH * (NUM_HOF_TEAMS - 1) - 1
|
||||
ld de, sHallOfFame + HOF_LENGTH * NUM_HOF_TEAMS - 1
|
||||
ld bc, HOF_LENGTH * (NUM_HOF_TEAMS - 1)
|
||||
@ -212,7 +212,7 @@ SaveTheGame_yesorno:
|
||||
|
||||
CompareLoadedAndSavedPlayerID:
|
||||
ld a, BANK(sPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPlayerData + (wPlayerID - wPlayerData)
|
||||
ld a, [hli]
|
||||
ld c, [hl]
|
||||
@ -273,7 +273,7 @@ _SaveGameData:
|
||||
farcall BackupMobileEventIndex
|
||||
farcall SaveRTC
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBattleTowerChallengeState]
|
||||
cp BATTLETOWER_RECEIVED_REWARD
|
||||
jr nz, .ok
|
||||
@ -288,7 +288,7 @@ UpdateStackTop:
|
||||
; It could have been used to debug stack overflow during saving.
|
||||
call FindStackTop
|
||||
ld a, BANK(sStackTop)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sStackTop + 0]
|
||||
ld e, a
|
||||
ld a, [sStackTop + 1]
|
||||
@ -354,7 +354,7 @@ ErasePreviousSave:
|
||||
call SaveData
|
||||
call EraseBattleTowerStatus
|
||||
ld a, BANK(sStackTop)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [sStackTop + 0], a
|
||||
ld [sStackTop + 1], a
|
||||
@ -365,7 +365,7 @@ ErasePreviousSave:
|
||||
|
||||
EraseLinkBattleStats:
|
||||
ld a, BANK(sLinkBattleStats)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sLinkBattleStats
|
||||
ld bc, sLinkBattleStatsEnd - sLinkBattleStats
|
||||
xor a
|
||||
@ -374,7 +374,7 @@ EraseLinkBattleStats:
|
||||
|
||||
EraseMysteryGift:
|
||||
ld a, BANK(sBackupMysteryGiftItem)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBackupMysteryGiftItem
|
||||
ld bc, sBackupMysteryGiftItemEnd - sBackupMysteryGiftItem
|
||||
xor a
|
||||
@ -383,7 +383,7 @@ EraseMysteryGift:
|
||||
|
||||
EraseHallOfFame:
|
||||
ld a, BANK(sHallOfFame)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sHallOfFame
|
||||
ld bc, sHallOfFameEnd - sHallOfFame
|
||||
xor a
|
||||
@ -392,7 +392,7 @@ EraseHallOfFame:
|
||||
|
||||
Unreferenced_Function14d18:
|
||||
ld a, BANK(s4_a007)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, .Data
|
||||
ld de, s4_a007
|
||||
ld bc, .DataEnd - .Data
|
||||
@ -412,7 +412,7 @@ Unreferenced_Function14d18:
|
||||
|
||||
EraseBattleTowerStatus:
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [sBattleTowerChallengeState], a
|
||||
jp CloseSRAM
|
||||
@ -423,7 +423,7 @@ SaveData:
|
||||
|
||||
Unreferenced_Function14d6c:
|
||||
ld a, BANK(s4_a60b) ; MBC30 bank used by JP Crystal; inaccessible by MBC3
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s4_a60b] ; address of MBC30 bank
|
||||
ld b, $0
|
||||
and a
|
||||
@ -438,7 +438,7 @@ Unreferenced_Function14d6c:
|
||||
|
||||
Unreferenced_Function14d83:
|
||||
ld a, BANK(s4_a60c) ; aka BANK(s4_a60d) ; MBC30 bank used by JP Crystal; inaccessible by MBC3
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [s4_a60c], a ; address of MBC30 bank
|
||||
ld [s4_a60d], a ; address of MBC30 bank
|
||||
@ -447,7 +447,7 @@ Unreferenced_Function14d83:
|
||||
|
||||
Unreferenced_Function14d93:
|
||||
ld a, BANK(s7_a000) ; MBC30 bank used by JP Crystal; inaccessible by MBC3
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [s7_a000], a ; address of MBC30 bank
|
||||
call CloseSRAM
|
||||
@ -462,7 +462,7 @@ HallOfFame_InitSaveIfNeeded:
|
||||
|
||||
ValidateSave:
|
||||
ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, SAVE_CHECK_VALUE_1
|
||||
ld [sCheckValue1], a
|
||||
ld a, SAVE_CHECK_VALUE_2
|
||||
@ -471,7 +471,7 @@ ValidateSave:
|
||||
|
||||
SaveOptions:
|
||||
ld a, BANK(sOptions)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wOptions
|
||||
ld de, sOptions
|
||||
ld bc, wOptionsEnd - wOptions
|
||||
@ -483,7 +483,7 @@ SaveOptions:
|
||||
|
||||
SavePlayerData:
|
||||
ld a, BANK(sPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wPlayerData
|
||||
ld de, sPlayerData
|
||||
ld bc, wPlayerDataEnd - wPlayerData
|
||||
@ -496,7 +496,7 @@ SavePlayerData:
|
||||
|
||||
SavePokemonData:
|
||||
ld a, BANK(sPokemonData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wPokemonData
|
||||
ld de, sPokemonData
|
||||
ld bc, wPokemonDataEnd - wPokemonData
|
||||
@ -513,7 +513,7 @@ SaveChecksum:
|
||||
ld hl, sGameData
|
||||
ld bc, sGameDataEnd - sGameData
|
||||
ld a, BANK(sGameData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call Checksum
|
||||
ld a, e
|
||||
ld [sChecksum + 0], a
|
||||
@ -524,7 +524,7 @@ SaveChecksum:
|
||||
|
||||
ValidateBackupSave:
|
||||
ld a, BANK(sBackupCheckValue1) ; aka BANK(sBackupCheckValue2)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, SAVE_CHECK_VALUE_1
|
||||
ld [sBackupCheckValue1], a
|
||||
ld a, SAVE_CHECK_VALUE_2
|
||||
@ -534,7 +534,7 @@ ValidateBackupSave:
|
||||
|
||||
SaveBackupOptions:
|
||||
ld a, BANK(sBackupOptions)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wOptions
|
||||
ld de, sBackupOptions
|
||||
ld bc, wOptionsEnd - wOptions
|
||||
@ -544,7 +544,7 @@ SaveBackupOptions:
|
||||
|
||||
SaveBackupPlayerData:
|
||||
ld a, BANK(sBackupPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wPlayerData
|
||||
ld de, sBackupPlayerData
|
||||
ld bc, wPlayerDataEnd - wPlayerData
|
||||
@ -558,7 +558,7 @@ SaveBackupPlayerData:
|
||||
|
||||
SaveBackupPokemonData:
|
||||
ld a, BANK(sBackupPokemonData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wPokemonData
|
||||
ld de, sBackupPokemonData
|
||||
ld bc, wPokemonDataEnd - wPokemonData
|
||||
@ -570,7 +570,7 @@ SaveBackupChecksum:
|
||||
ld hl, sBackupGameData
|
||||
ld bc, sBackupGameDataEnd - sBackupGameData
|
||||
ld a, BANK(sBackupGameData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call Checksum
|
||||
ld a, e
|
||||
ld [sBackupChecksum + 0], a
|
||||
@ -634,7 +634,7 @@ TryLoadSaveData:
|
||||
jr z, .backup
|
||||
|
||||
ld a, BANK(sPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPlayerData + wStartDay - wPlayerData
|
||||
ld de, wStartDay
|
||||
ld bc, 8
|
||||
@ -653,7 +653,7 @@ TryLoadSaveData:
|
||||
jr z, .corrupt
|
||||
|
||||
ld a, BANK(sBackupPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBackupPlayerData + wStartDay - wPlayerData
|
||||
ld de, wStartDay
|
||||
ld bc, 8
|
||||
@ -677,7 +677,7 @@ INCLUDE "data/default_options.asm"
|
||||
|
||||
CheckPrimarySaveFile:
|
||||
ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sCheckValue1]
|
||||
cp SAVE_CHECK_VALUE_1
|
||||
jr nz, .nope
|
||||
@ -698,7 +698,7 @@ CheckPrimarySaveFile:
|
||||
|
||||
CheckBackupSaveFile:
|
||||
ld a, BANK(sBackupCheckValue1) ; aka BANK(sBackupCheckValue2)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBackupCheckValue1]
|
||||
cp SAVE_CHECK_VALUE_1
|
||||
jr nz, .nope
|
||||
@ -718,7 +718,7 @@ CheckBackupSaveFile:
|
||||
|
||||
LoadPlayerData:
|
||||
ld a, BANK(sPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPlayerData
|
||||
ld de, wPlayerData
|
||||
ld bc, wPlayerDataEnd - wPlayerData
|
||||
@ -729,7 +729,7 @@ LoadPlayerData:
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, BANK(sBattleTowerChallengeState)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBattleTowerChallengeState]
|
||||
cp BATTLETOWER_RECEIVED_REWARD
|
||||
jr nz, .not_4
|
||||
@ -741,7 +741,7 @@ LoadPlayerData:
|
||||
|
||||
LoadPokemonData:
|
||||
ld a, BANK(sPokemonData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPokemonData
|
||||
ld de, wPokemonData
|
||||
ld bc, wPokemonDataEnd - wPokemonData
|
||||
@ -758,7 +758,7 @@ VerifyChecksum:
|
||||
ld hl, sGameData
|
||||
ld bc, sGameDataEnd - sGameData
|
||||
ld a, BANK(sGameData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call Checksum
|
||||
ld a, [sChecksum + 0]
|
||||
cp e
|
||||
@ -773,7 +773,7 @@ VerifyChecksum:
|
||||
|
||||
LoadBackupPlayerData:
|
||||
ld a, BANK(sBackupPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBackupPlayerData
|
||||
ld de, wPlayerData
|
||||
ld bc, wPlayerDataEnd - wPlayerData
|
||||
@ -787,7 +787,7 @@ LoadBackupPlayerData:
|
||||
|
||||
LoadBackupPokemonData:
|
||||
ld a, BANK(sBackupPokemonData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBackupPokemonData
|
||||
ld de, wPokemonData
|
||||
ld bc, wPokemonDataEnd - wPokemonData
|
||||
@ -799,7 +799,7 @@ VerifyBackupChecksum:
|
||||
ld hl, sBackupGameData
|
||||
ld bc, sBackupGameDataEnd - sBackupGameData
|
||||
ld a, BANK(sBackupGameData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call Checksum
|
||||
ld a, [sBackupChecksum + 0]
|
||||
cp e
|
||||
@ -819,7 +819,7 @@ _SaveData:
|
||||
; It is not part of a regular save.
|
||||
|
||||
ld a, BANK(sCrystalData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wCrystalData
|
||||
ld de, sCrystalData
|
||||
ld bc, wCrystalDataEnd - wCrystalData
|
||||
@ -840,7 +840,7 @@ _SaveData:
|
||||
|
||||
_LoadData:
|
||||
ld a, BANK(sCrystalData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sCrystalData
|
||||
ld de, wCrystalData
|
||||
ld bc, wCrystalDataEnd - wCrystalData
|
||||
@ -892,7 +892,7 @@ SaveBoxAddress:
|
||||
push af
|
||||
push de
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBox
|
||||
ld de, wBoxPartialData
|
||||
ld bc, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
@ -903,7 +903,7 @@ SaveBoxAddress:
|
||||
; Save it to the target box.
|
||||
push af
|
||||
push de
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBoxPartialData
|
||||
ld bc, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
call CopyBytes
|
||||
@ -911,7 +911,7 @@ SaveBoxAddress:
|
||||
|
||||
; Load the second part of the active box.
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBox + (wBoxPartialDataEnd - wBoxPartialData)
|
||||
ld de, wBoxPartialData
|
||||
ld bc, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
@ -927,7 +927,7 @@ SaveBoxAddress:
|
||||
; Save it to the next part of the target box.
|
||||
push af
|
||||
push de
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBoxPartialData
|
||||
ld bc, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
call CopyBytes
|
||||
@ -935,7 +935,7 @@ SaveBoxAddress:
|
||||
|
||||
; Load the third and final part of the active box.
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2
|
||||
ld de, wBoxPartialData
|
||||
ld bc, sBoxEnd - (sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2) ; $8e
|
||||
@ -949,7 +949,7 @@ SaveBoxAddress:
|
||||
ld e, l
|
||||
ld d, h
|
||||
; Save it to the final part of the target box.
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBoxPartialData
|
||||
ld bc, sBoxEnd - (sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2) ; $8e
|
||||
call CopyBytes
|
||||
@ -968,13 +968,13 @@ LoadBoxAddress:
|
||||
; Load part 1
|
||||
push af
|
||||
push hl
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, wBoxPartialData
|
||||
ld bc, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBoxPartialData
|
||||
ld de, sBox
|
||||
ld bc, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
@ -988,13 +988,13 @@ LoadBoxAddress:
|
||||
; Load part 2
|
||||
push af
|
||||
push hl
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, wBoxPartialData
|
||||
ld bc, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBoxPartialData
|
||||
ld de, sBox + (wBoxPartialDataEnd - wBoxPartialData)
|
||||
ld bc, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
@ -1005,13 +1005,13 @@ LoadBoxAddress:
|
||||
; Load part 3
|
||||
ld de, (wBoxPartialDataEnd - wBoxPartialData)
|
||||
add hl, de
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, wBoxPartialData
|
||||
ld bc, sBoxEnd - (sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2) ; $8e
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBoxPartialData
|
||||
ld de, sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2
|
||||
ld bc, sBoxEnd - (sBox + (wBoxPartialDataEnd - wBoxPartialData) * 2) ; $8e
|
||||
@ -1027,7 +1027,7 @@ EraseBoxes:
|
||||
.next
|
||||
push bc
|
||||
ld a, [hli]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
ld a, [hli]
|
||||
|
@ -80,7 +80,7 @@ Credits::
|
||||
push af
|
||||
ld a, $5
|
||||
ldh [hVBlank], a
|
||||
ld a, $1
|
||||
ld a, TRUE
|
||||
ldh [hInMenu], a
|
||||
xor a
|
||||
ldh [hBGMapMode], a
|
||||
@ -198,7 +198,7 @@ Credits_UpdateGFXRequestPath:
|
||||
Credits_RequestGFX:
|
||||
xor a
|
||||
ldh [hBGMapMode], a
|
||||
ld a, $8
|
||||
ld a, 8
|
||||
ld [wRequested2bpp], a
|
||||
jp Credits_Next
|
||||
|
||||
@ -572,14 +572,17 @@ Credits_LoadBorderGFX:
|
||||
dw CreditsPichuGFX + 16 tiles
|
||||
dw CreditsPichuGFX + 32 tiles
|
||||
dw CreditsPichuGFX + 48 tiles
|
||||
|
||||
dw CreditsSmoochumGFX
|
||||
dw CreditsSmoochumGFX + 16 tiles
|
||||
dw CreditsSmoochumGFX + 32 tiles
|
||||
dw CreditsSmoochumGFX + 48 tiles
|
||||
|
||||
dw CreditsDittoGFX
|
||||
dw CreditsDittoGFX + 16 tiles
|
||||
dw CreditsDittoGFX + 32 tiles
|
||||
dw CreditsDittoGFX + 48 tiles
|
||||
|
||||
dw CreditsIgglybuffGFX
|
||||
dw CreditsIgglybuffGFX + 16 tiles
|
||||
dw CreditsIgglybuffGFX + 32 tiles
|
||||
|
@ -47,11 +47,13 @@ EvolutionAnimation:
|
||||
call WaitBGMap
|
||||
xor a
|
||||
ldh [hBGMapMode], a
|
||||
|
||||
ld a, [wEvolutionOldSpecies]
|
||||
ld [wPlayerHPPal], a
|
||||
|
||||
ld c, $0
|
||||
ld c, FALSE
|
||||
call .GetSGBLayout
|
||||
|
||||
ld a, [wEvolutionOldSpecies]
|
||||
ld [wCurPartySpecies], a
|
||||
ld [wCurSpecies], a
|
||||
@ -69,41 +71,45 @@ EvolutionAnimation:
|
||||
ld [wCurPartySpecies], a
|
||||
ld [wCurSpecies], a
|
||||
call .LoadFrontpic
|
||||
|
||||
ld a, [wEvolutionOldSpecies]
|
||||
ld [wCurPartySpecies], a
|
||||
ld [wCurSpecies], a
|
||||
|
||||
ld a, $1
|
||||
ld a, 1
|
||||
ldh [hBGMapMode], a
|
||||
|
||||
call .check_statused
|
||||
jr c, .skip_cry
|
||||
|
||||
ld a, [wEvolutionOldSpecies]
|
||||
call PlayMonCry
|
||||
|
||||
.skip_cry
|
||||
|
||||
ld de, MUSIC_EVOLUTION
|
||||
call PlayMusic
|
||||
|
||||
ld c, 80
|
||||
call DelayFrames
|
||||
|
||||
ld c, $1
|
||||
ld c, TRUE
|
||||
call .GetSGBLayout
|
||||
|
||||
call .AnimationSequence
|
||||
jr c, .cancel_evo
|
||||
|
||||
ld a, -7 * 7
|
||||
ld [wEvolutionPicOffset], a
|
||||
call .ReplaceFrontpic
|
||||
|
||||
xor a
|
||||
ld [wEvolutionCanceled], a
|
||||
|
||||
ld a, [wEvolutionNewSpecies]
|
||||
ld [wPlayerHPPal], a
|
||||
|
||||
ld c, $0
|
||||
ld c, FALSE
|
||||
call .GetSGBLayout
|
||||
|
||||
call .PlayEvolvedSFX
|
||||
farcall ClearSpriteAnims
|
||||
call .check_statused
|
||||
@ -133,14 +139,15 @@ EvolutionAnimation:
|
||||
ret
|
||||
|
||||
.cancel_evo
|
||||
ld a, $1
|
||||
ld a, TRUE
|
||||
ld [wEvolutionCanceled], a
|
||||
|
||||
ld a, [wEvolutionOldSpecies]
|
||||
ld [wPlayerHPPal], a
|
||||
|
||||
ld c, $0
|
||||
ld c, FALSE
|
||||
call .GetSGBLayout
|
||||
|
||||
call .PlayEvolvedSFX
|
||||
farcall ClearSpriteAnims
|
||||
call .check_statused
|
||||
|
@ -1,4 +1,4 @@
|
||||
Copyright_GFPresents:
|
||||
Copyright_GameFreakPresents:
|
||||
; Play the copyright screen and GameFreak Presents sequence.
|
||||
; Return carry if user cancels animation by pressing a button.
|
||||
|
||||
@ -13,7 +13,7 @@ Copyright_GFPresents:
|
||||
ldh [hJoyDown], a
|
||||
ldh [hSCX], a
|
||||
ldh [hSCY], a
|
||||
ld a, $90
|
||||
ld a, SCREEN_HEIGHT_PX
|
||||
ldh [hWY], a
|
||||
call WaitBGMap
|
||||
ld b, SCGB_GAMEFREAK_LOGO
|
||||
@ -116,32 +116,23 @@ Copyright_GFPresents:
|
||||
ret
|
||||
|
||||
PlaceGameFreakPresents:
|
||||
ld a, [wJumptableIndex]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, .dw
|
||||
add hl, de
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
jp hl
|
||||
jumptable .scenes, wJumptableIndex
|
||||
|
||||
.dw
|
||||
dw PlaceGameFreakPresents_0
|
||||
dw PlaceGameFreakPresents_1
|
||||
dw PlaceGameFreakPresents_2
|
||||
dw PlaceGameFreakPresents_3
|
||||
.scenes
|
||||
dw GameFreakPresentsScene0
|
||||
dw GameFreakPresentsScene1
|
||||
dw GameFreakPresentsScene2
|
||||
dw GameFreakPresentsScene3
|
||||
|
||||
PlaceGameFreakPresents_AdvanceIndex:
|
||||
PlaceGameFreakPresents_NextScene:
|
||||
ld hl, wJumptableIndex
|
||||
inc [hl]
|
||||
ret
|
||||
|
||||
PlaceGameFreakPresents_0:
|
||||
GameFreakPresentsScene0:
|
||||
ret
|
||||
|
||||
PlaceGameFreakPresents_1:
|
||||
GameFreakPresentsScene1:
|
||||
ld hl, wIntroSceneTimer
|
||||
ld a, [hl]
|
||||
cp $20
|
||||
@ -155,7 +146,7 @@ PlaceGameFreakPresents_1:
|
||||
decoord 5, 10
|
||||
ld bc, .end - .GAME_FREAK
|
||||
call CopyBytes
|
||||
call PlaceGameFreakPresents_AdvanceIndex
|
||||
call PlaceGameFreakPresents_NextScene
|
||||
ld de, SFX_GAME_FREAK_PRESENTS
|
||||
call PlaySFX
|
||||
ret
|
||||
@ -166,7 +157,7 @@ PlaceGameFreakPresents_1:
|
||||
.end
|
||||
db "@"
|
||||
|
||||
PlaceGameFreakPresents_2:
|
||||
GameFreakPresentsScene2:
|
||||
ld hl, wIntroSceneTimer
|
||||
ld a, [hl]
|
||||
cp $40
|
||||
@ -180,7 +171,7 @@ PlaceGameFreakPresents_2:
|
||||
decoord 7, 11
|
||||
ld bc, .end - .presents
|
||||
call CopyBytes
|
||||
call PlaceGameFreakPresents_AdvanceIndex
|
||||
call PlaceGameFreakPresents_NextScene
|
||||
ret
|
||||
|
||||
.presents
|
||||
@ -188,7 +179,7 @@ PlaceGameFreakPresents_2:
|
||||
.end
|
||||
db "@"
|
||||
|
||||
PlaceGameFreakPresents_3:
|
||||
GameFreakPresentsScene3:
|
||||
ld hl, wIntroSceneTimer
|
||||
ld a, [hl]
|
||||
cp $80
|
||||
@ -201,12 +192,12 @@ PlaceGameFreakPresents_3:
|
||||
set 7, [hl]
|
||||
ret
|
||||
|
||||
GameFreakLogoJumper:
|
||||
PlaceGameFreakLogo:
|
||||
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
||||
add hl, bc
|
||||
ld e, [hl]
|
||||
ld d, 0
|
||||
ld hl, GameFreakLogoScenes
|
||||
ld hl, .scenes
|
||||
add hl, de
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
@ -214,7 +205,7 @@ GameFreakLogoJumper:
|
||||
ld l, a
|
||||
jp hl
|
||||
|
||||
GameFreakLogoScenes:
|
||||
.scenes:
|
||||
dw GameFreakLogoScene1
|
||||
dw GameFreakLogoScene2
|
||||
dw GameFreakLogoScene3
|
||||
@ -325,7 +316,7 @@ GameFreakLogoScene4:
|
||||
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
||||
add hl, bc
|
||||
inc [hl]
|
||||
call PlaceGameFreakPresents_AdvanceIndex
|
||||
call PlaceGameFreakPresents_NextScene
|
||||
GameFreakLogoScene5:
|
||||
ret
|
||||
|
||||
|
@ -2450,7 +2450,7 @@ Script_warpfacing:
|
||||
set PLAYERSPRITESETUP_CUSTOM_FACING_F, a
|
||||
or c
|
||||
ld [wPlayerSpriteSetupFlags], a
|
||||
; fall through
|
||||
; fallthrough
|
||||
|
||||
Script_warp:
|
||||
; script command 0x3c
|
||||
|
@ -244,7 +244,7 @@ _CheckLuckyNumberShowFlag:
|
||||
|
||||
DoMysteryGiftIfDayHasPassed:
|
||||
ld a, BANK(sMysteryGiftTimer)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sMysteryGiftTimer
|
||||
ld a, [hli]
|
||||
ld [wBuffer1], a
|
||||
@ -262,7 +262,7 @@ DoMysteryGiftIfDayHasPassed:
|
||||
|
||||
.not_timed_out
|
||||
ld a, BANK(sMysteryGiftTimer)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBuffer1
|
||||
ld a, [hli]
|
||||
ld [sMysteryGiftTimer], a
|
||||
|
@ -126,7 +126,7 @@ _GetVarAction::
|
||||
.BoxFreeSpace:
|
||||
; Remaining slots in the current box.
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxCount
|
||||
ld a, MONS_PER_BOX
|
||||
sub [hl]
|
||||
|
@ -2362,7 +2362,7 @@ Pokedex_LoadSelectedMonTiles:
|
||||
|
||||
.QuestionMark:
|
||||
ld a, BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
farcall LoadQuestionMarkPic
|
||||
ld hl, vTiles2
|
||||
ld de, sScratch
|
||||
@ -2478,7 +2478,7 @@ Pokedex_CheckSGB:
|
||||
|
||||
Pokedex_LoadUnownFont:
|
||||
ld a, BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, UnownFont
|
||||
ld de, sScratch + $188
|
||||
ld bc, 39 tiles
|
||||
|
@ -1127,7 +1127,7 @@ BillsPC_LoadMonStats:
|
||||
ld b, a
|
||||
call GetBoxPointer
|
||||
ld a, b
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
push hl
|
||||
ld bc, sBoxMon1Level - sBox
|
||||
add hl, bc
|
||||
@ -1187,7 +1187,7 @@ BillsPC_LoadMonStats:
|
||||
|
||||
.sBox
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxMon1Level
|
||||
ld bc, BOXMON_STRUCT_LENGTH
|
||||
ld a, e
|
||||
@ -1282,7 +1282,7 @@ BillsPC_RefreshTextboxes:
|
||||
push hl
|
||||
call GetBoxPointer
|
||||
ld a, b
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
push hl
|
||||
ld bc, sBoxMons - sBox
|
||||
add hl, bc
|
||||
@ -1339,7 +1339,7 @@ BillsPC_RefreshTextboxes:
|
||||
.sBox
|
||||
push hl
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxSpecies
|
||||
ld d, $0
|
||||
add hl, de
|
||||
@ -1421,7 +1421,7 @@ CopyBoxmonSpecies:
|
||||
ld b, a
|
||||
call GetBoxPointer
|
||||
ld a, b
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
inc hl
|
||||
copy_box_data 1
|
||||
ret
|
||||
@ -1433,7 +1433,7 @@ CopyBoxmonSpecies:
|
||||
|
||||
.sBox
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxSpecies
|
||||
copy_box_data 1
|
||||
ret
|
||||
@ -1652,7 +1652,7 @@ BillsPC_IsMonAnEgg:
|
||||
BillsPC_StatsScreen:
|
||||
call LowVolume
|
||||
call BillsPC_CopyMon
|
||||
ld a, $3
|
||||
ld a, TEMPMON
|
||||
ld [wMonType], a
|
||||
predef StatsScreenInit
|
||||
call BillsPC_InitGFX
|
||||
@ -1704,7 +1704,7 @@ BillsPC_CopyMon:
|
||||
cp NUM_BOXES + 1
|
||||
jr nz, .box
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxSpecies
|
||||
call CopySpeciesToTemp
|
||||
ld hl, sBoxMonNicknames
|
||||
@ -1742,7 +1742,7 @@ BillsPC_CopyMon:
|
||||
ld b, a
|
||||
call GetBoxPointer
|
||||
ld a, b
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
push hl
|
||||
inc hl
|
||||
call CopySpeciesToTemp
|
||||
@ -1823,7 +1823,7 @@ TryWithdrawPokemon:
|
||||
add [hl]
|
||||
ld [wCurPartyMon], a
|
||||
ld a, BANK(sBoxMonNicknames)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wCurPartyMon]
|
||||
ld hl, sBoxMonNicknames
|
||||
call GetNick
|
||||
@ -2046,7 +2046,7 @@ MovePKMNWitoutMail_InsertMon:
|
||||
add [hl]
|
||||
ld [wCurPartyMon], a
|
||||
ld a, BANK(sBox)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxSpecies
|
||||
call CopySpeciesToTemp
|
||||
ld hl, sBoxMonNicknames
|
||||
@ -2348,7 +2348,7 @@ GetBoxCount:
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
ld b, a
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
@ -2368,7 +2368,7 @@ GetBoxCount:
|
||||
.activebox
|
||||
ld a, BANK(sBoxCount)
|
||||
ld b, a
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxCount
|
||||
ld a, [hl]
|
||||
call CloseSRAM
|
||||
|
@ -209,11 +209,11 @@ BillsPC_WithdrawMenu:
|
||||
Unreferenced_Functione56d:
|
||||
ld a, [wPartyCount]
|
||||
cp PARTY_LENGTH
|
||||
jr nc, .asm_e576
|
||||
jr nc, .party_full
|
||||
and a
|
||||
ret
|
||||
|
||||
.asm_e576
|
||||
.party_full
|
||||
ld hl, PCCantTakeText
|
||||
call MenuTextboxBackup
|
||||
scf
|
||||
@ -256,7 +256,7 @@ CopyBoxmonToTempMon:
|
||||
ld de, wTempMonSpecies
|
||||
ld bc, BOXMON_STRUCT_LENGTH
|
||||
ld a, BANK(sBoxMon1Species)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ret
|
||||
@ -282,7 +282,7 @@ Unreferenced_LoadBoxMonListing:
|
||||
ld hl, sBoxCount
|
||||
|
||||
.okay
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hl]
|
||||
ld bc, sBoxMons - sBox
|
||||
add hl, bc
|
||||
|
@ -1,5 +1,5 @@
|
||||
CheckPartyFullAfterContest:
|
||||
ld a, [wContestMon]
|
||||
ld a, [wContestMonSpecies]
|
||||
and a
|
||||
jp z, .DidntCatchAnything
|
||||
ld [wCurPartySpecies], a
|
||||
@ -14,7 +14,7 @@ CheckPartyFullAfterContest:
|
||||
ld c, a
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [wContestMon]
|
||||
ld a, [wContestMonSpecies]
|
||||
ld [hli], a
|
||||
ld [wCurSpecies], a
|
||||
ld a, -1
|
||||
@ -80,14 +80,14 @@ CheckPartyFullAfterContest:
|
||||
or b
|
||||
ld [hl], a
|
||||
xor a
|
||||
ld [wContestMon], a
|
||||
ld [wContestMonSpecies], a
|
||||
and a ; BUGCONTEST_CAUGHT_MON
|
||||
ld [wScriptVar], a
|
||||
ret
|
||||
|
||||
.TryAddToBox:
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxCount
|
||||
ld a, [hl]
|
||||
cp MONS_PER_BOX
|
||||
@ -118,7 +118,7 @@ CheckPartyFullAfterContest:
|
||||
|
||||
.Box_SkipNickname:
|
||||
ld a, BANK(sBoxMonNicknames)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, sBoxMonNicknames
|
||||
ld bc, MON_NAME_LENGTH
|
||||
call CopyBytes
|
||||
@ -126,13 +126,13 @@ CheckPartyFullAfterContest:
|
||||
|
||||
.BoxFull:
|
||||
ld a, BANK(sBoxMon1Level)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBoxMon1Level]
|
||||
ld [wCurPartyLevel], a
|
||||
call CloseSRAM
|
||||
call SetBoxMonCaughtData
|
||||
ld a, BANK(sBoxMon1CaughtLocation)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxMon1CaughtLocation
|
||||
ld a, [hl]
|
||||
and CAUGHT_GENDER_MASK
|
||||
@ -200,7 +200,7 @@ SetBoxmonOrEggmonCaughtData:
|
||||
|
||||
SetBoxMonCaughtData:
|
||||
ld a, BANK(sBoxMon1CaughtLevel)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxMon1CaughtLevel
|
||||
call SetBoxmonOrEggmonCaughtData
|
||||
call CloseSRAM
|
||||
@ -209,7 +209,7 @@ SetBoxMonCaughtData:
|
||||
SetGiftBoxMonCaughtData:
|
||||
push bc
|
||||
ld a, BANK(sBoxMon1CaughtLevel)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxMon1CaughtLevel
|
||||
pop bc
|
||||
call SetGiftMonCaughtData
|
||||
|
@ -93,7 +93,7 @@ CalcExpAtLevel:
|
||||
ldh a, [hProduct + 3]
|
||||
sub b
|
||||
ldh [hMultiplicand + 2], a
|
||||
ld b, $0
|
||||
ld b, 0
|
||||
ldh a, [hProduct + 2]
|
||||
sbc b
|
||||
ldh [hMultiplicand + 1], a
|
||||
|
@ -18,7 +18,7 @@ SendMailToPC:
|
||||
call AddNTimes
|
||||
push hl
|
||||
ld a, BANK(sMailboxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
call CopyBytes
|
||||
pop hl
|
||||
@ -41,7 +41,7 @@ SendMailToPC:
|
||||
DeleteMailFromPC:
|
||||
; Shift all mail messages in the mailbox
|
||||
ld a, BANK(sMailboxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, b
|
||||
push bc
|
||||
ld hl, sMailbox
|
||||
@ -83,7 +83,7 @@ ReadMailMessage:
|
||||
|
||||
MoveMailFromPCToParty:
|
||||
ld a, BANK(sMailboxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
push bc
|
||||
ld a, b
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
@ -115,7 +115,7 @@ MoveMailFromPCToParty:
|
||||
|
||||
GetMailboxCount:
|
||||
ld a, BANK(sMailboxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMailboxCount]
|
||||
ld c, a
|
||||
jp CloseSRAM
|
||||
@ -137,7 +137,7 @@ CheckPokeMail::
|
||||
jr nc, .pop_return
|
||||
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wCurPartyMon]
|
||||
ld hl, sPartyMail
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
@ -209,7 +209,7 @@ GivePokeMail::
|
||||
ld hl, wd002
|
||||
ld bc, MAIL_MSG_LENGTH + 1
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call CopyBytes
|
||||
pop af
|
||||
push af
|
||||
@ -238,7 +238,7 @@ GivePokeMail::
|
||||
|
||||
BackupPartyMonMail:
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPartyMail
|
||||
ld de, sPartyMailBackup
|
||||
ld bc, 6 * MAIL_STRUCT_LENGTH
|
||||
@ -251,7 +251,7 @@ BackupPartyMonMail:
|
||||
|
||||
RestorePartyMonMail:
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPartyMailBackup
|
||||
ld de, sPartyMail
|
||||
ld bc, 6 * MAIL_STRUCT_LENGTH
|
||||
@ -264,7 +264,7 @@ RestorePartyMonMail:
|
||||
|
||||
DeletePartyMonMail:
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld hl, sPartyMail
|
||||
ld bc, 6 * MAIL_STRUCT_LENGTH
|
||||
@ -317,7 +317,7 @@ InitMail:
|
||||
; initialize wMailboxCount and beyond with incrementing values, one per mail
|
||||
; set z if no mail
|
||||
ld a, BANK(sMailboxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMailboxCount]
|
||||
call CloseSRAM
|
||||
ld hl, wMailboxCount
|
||||
@ -347,7 +347,7 @@ MailboxPC_GetMailAuthor:
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
call AddNTimes
|
||||
ld a, BANK(sMailboxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, wStringBuffer2
|
||||
push de
|
||||
ld bc, NAME_LENGTH - 1
|
||||
@ -467,7 +467,7 @@ MailboxPC:
|
||||
.GetMailType:
|
||||
push af
|
||||
ld a, BANK(sMailboxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
pop af
|
||||
ld hl, sMailbox1Type
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
|
@ -15,7 +15,7 @@ ReadAnyMail:
|
||||
pop de
|
||||
push de
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
farcall IsMailEuropean
|
||||
call CloseSRAM
|
||||
ld a, c
|
||||
@ -69,7 +69,7 @@ ReadAnyMail:
|
||||
ld l, e
|
||||
push hl
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, sPartyMon1MailAuthorID - sPartyMon1Mail
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
@ -680,7 +680,7 @@ MailGFX_PlaceMessage:
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
ld de, wTempMail
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld hl, wTempMailAuthor
|
||||
|
@ -466,7 +466,7 @@ ComposeMailMessage:
|
||||
ld hl, wTempMail
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ret
|
||||
|
@ -174,7 +174,7 @@ GetGender:
|
||||
ld a, [wMonType]
|
||||
cp BOXMON
|
||||
ld a, BANK(sBox)
|
||||
call z, GetSRAMBank
|
||||
call z, OpenSRAM
|
||||
|
||||
; Attack DV
|
||||
ld a, [hli]
|
||||
|
@ -485,7 +485,7 @@ SendGetMonIntoFromBox:
|
||||
; wPokemonWithdrawDepositParameter == 3: put mon into DayCare
|
||||
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wPokemonWithdrawDepositParameter]
|
||||
and a
|
||||
jr z, .check_IfPartyIsFull
|
||||
@ -942,7 +942,7 @@ SendMonIntoBox:
|
||||
; Sends the mon into one of Bills Boxes
|
||||
; the data comes mainly from 'wEnemyMon:'
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, sBoxCount
|
||||
ld a, [de]
|
||||
cp MONS_PER_BOX
|
||||
@ -1226,7 +1226,7 @@ RemoveMonFromPartyOrBox:
|
||||
jr z, .okay
|
||||
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxCount
|
||||
|
||||
.okay
|
||||
@ -1336,7 +1336,7 @@ RemoveMonFromPartyOrBox:
|
||||
ret nz
|
||||
; Shift mail
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
; If this is the last mon in our party, no need to shift mail.
|
||||
ld hl, wPartyCount
|
||||
ld a, [wCurPartyMon]
|
||||
@ -1735,7 +1735,7 @@ GivePoke::
|
||||
|
||||
.send_to_box
|
||||
ld a, BANK(sBoxMonOT)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, sBoxMonOT
|
||||
.loop
|
||||
ld a, [wScriptBank]
|
||||
@ -1785,7 +1785,7 @@ GivePoke::
|
||||
ld hl, WasSentToBillsPCText
|
||||
call PrintText
|
||||
ld a, BANK(sBoxMonNicknames)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wMonOrItemNameBuffer
|
||||
ld de, sBoxMonNicknames
|
||||
ld bc, MON_NAME_LENGTH
|
||||
|
@ -1,6 +1,6 @@
|
||||
InsertPokemonIntoBox:
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxCount
|
||||
call InsertSpeciesIntoBoxOrParty
|
||||
ld a, [sBoxCount]
|
||||
|
@ -75,7 +75,7 @@ CheckOwnMonAnywhere:
|
||||
|
||||
; Run CheckOwnMon on each Pokémon in the PC.
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBoxCount]
|
||||
and a
|
||||
jr z, .boxes
|
||||
@ -119,7 +119,7 @@ CheckOwnMonAnywhere:
|
||||
add hl, bc
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
|
@ -224,7 +224,7 @@ StatsScreenWaitCry:
|
||||
StatsScreen_CopyToTempMon:
|
||||
ld a, [wMonType]
|
||||
cp TEMPMON
|
||||
jr nz, .breedmon
|
||||
jr nz, .not_tempmon
|
||||
ld a, [wBufferMonSpecies]
|
||||
ld [wCurSpecies], a
|
||||
call GetBaseData
|
||||
@ -234,7 +234,7 @@ StatsScreen_CopyToTempMon:
|
||||
call CopyBytes
|
||||
jr .done
|
||||
|
||||
.breedmon
|
||||
.not_tempmon
|
||||
farcall CopyMonToTempMon
|
||||
ld a, [wCurPartySpecies]
|
||||
cp EGG
|
||||
@ -251,7 +251,7 @@ StatsScreen_GetJoypad:
|
||||
call GetJoypad
|
||||
ld a, [wMonType]
|
||||
cp TEMPMON
|
||||
jr nz, .notbreedmon
|
||||
jr nz, .not_tempmon
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
@ -263,11 +263,11 @@ StatsScreen_GetJoypad:
|
||||
and D_DOWN | D_UP
|
||||
jr nz, .set_carry
|
||||
ld a, [wMenuJoypad]
|
||||
jr .clear_flags
|
||||
jr .clear_carry
|
||||
|
||||
.notbreedmon
|
||||
.not_tempmon
|
||||
ldh a, [hJoyPressed]
|
||||
.clear_flags
|
||||
.clear_carry
|
||||
and a
|
||||
ret
|
||||
|
||||
@ -532,11 +532,11 @@ StatsScreen_LoadGFX:
|
||||
|
||||
.Jumptable:
|
||||
; entries correspond to *_PAGE constants
|
||||
dw .PinkPage
|
||||
dw .GreenPage
|
||||
dw .BluePage
|
||||
dw LoadPinkPage
|
||||
dw LoadGreenPage
|
||||
dw LoadBluePage
|
||||
|
||||
.PinkPage:
|
||||
LoadPinkPage:
|
||||
hlcoord 0, 9
|
||||
ld b, $0
|
||||
predef DrawPlayerHP
|
||||
@ -678,7 +678,7 @@ StatsScreen_LoadGFX:
|
||||
.PkrsStr:
|
||||
db "#RUS@"
|
||||
|
||||
.GreenPage:
|
||||
LoadGreenPage:
|
||||
ld de, .Item
|
||||
hlcoord 0, 8
|
||||
call PlaceString
|
||||
@ -723,17 +723,17 @@ StatsScreen_LoadGFX:
|
||||
.Move:
|
||||
db "MOVE@"
|
||||
|
||||
.BluePage:
|
||||
LoadBluePage:
|
||||
call .PlaceOTInfo
|
||||
hlcoord 10, 8
|
||||
ld de, SCREEN_WIDTH
|
||||
ld b, 10
|
||||
ld a, $31 ; vertical divider
|
||||
.BluePageVerticalDivider:
|
||||
.vertical_divider
|
||||
ld [hl], a
|
||||
add hl, de
|
||||
dec b
|
||||
jr nz, .BluePageVerticalDivider
|
||||
jr nz, .vertical_divider
|
||||
hlcoord 11, 8
|
||||
ld bc, 6
|
||||
predef PrintTempMonStats
|
||||
@ -890,7 +890,7 @@ StatsScreen_GetAnimationParam:
|
||||
ld b, h
|
||||
ld c, l
|
||||
ld a, BANK(sBoxMons)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call .CheckEggFaintedFrzSlp
|
||||
push af
|
||||
call CloseSRAM
|
||||
@ -1095,7 +1095,7 @@ CopyNickname:
|
||||
cp BOXMON
|
||||
jr nz, .partymon
|
||||
ld a, BANK(sBoxMonNicknames)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
push de
|
||||
call CopyBytes
|
||||
pop de
|
||||
|
@ -116,7 +116,7 @@ _SwitchPartyMons:
|
||||
ld de, wd002
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call CopyBytes
|
||||
ld hl, sPartyMail
|
||||
ld a, [wBuffer3]
|
||||
|
@ -107,7 +107,7 @@ GetMonSpecies:
|
||||
|
||||
.boxmon
|
||||
ld a, BANK(sBoxSpecies)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sBoxSpecies
|
||||
call .done
|
||||
call CloseSRAM
|
||||
|
@ -716,7 +716,7 @@ PrintPCBox_Page4:
|
||||
|
||||
Printer_PrintBoxListSegment:
|
||||
ld a, [wBankOfBoxToPrint]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
.loop
|
||||
ld a, c
|
||||
and a
|
||||
|
@ -18,7 +18,7 @@ _ResetClock:
|
||||
call ClockResetPassword
|
||||
jr c, .wrongpassword
|
||||
ld a, BANK(sRTCStatusFlags)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, $80
|
||||
ld [sRTCStatusFlags], a
|
||||
call CloseSRAM
|
||||
@ -216,7 +216,7 @@ ClockResetPassword:
|
||||
|
||||
.CalculatePassword:
|
||||
ld a, BANK(sPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, 0
|
||||
ld hl, sPlayerData + (wPlayerID - wPlayerData)
|
||||
ld c, 2
|
||||
|
@ -137,7 +137,7 @@ ClockContinue:
|
||||
farcall ClearDailyTimers
|
||||
farcall Function170923
|
||||
ld a, BANK(s5_aa8c) ; aka BANK(s5_b2fa)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_aa8c]
|
||||
inc a
|
||||
ld [s5_aa8c], a
|
||||
|
@ -118,7 +118,7 @@ LoadFontsExtra2:
|
||||
DecompressRequest2bpp::
|
||||
push de
|
||||
ld a, BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
push bc
|
||||
|
||||
ld de, sScratch
|
||||
|
@ -205,7 +205,7 @@ ClearsScratch::
|
||||
; Wipe the first 32 bytes of sScratch
|
||||
|
||||
ld a, BANK(sScratch)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sScratch
|
||||
ld bc, $20
|
||||
xor a
|
||||
|
@ -1,11 +1,10 @@
|
||||
GetSRAMBank::
|
||||
; load sram bank a
|
||||
OpenSRAM::
|
||||
; if invalid bank, sram is disabled
|
||||
cp NUM_SRAM_BANKS
|
||||
jr c, OpenSRAM
|
||||
jr c, .valid
|
||||
jr CloseSRAM
|
||||
|
||||
OpenSRAM::
|
||||
.valid:
|
||||
; switch to sram bank a
|
||||
push af
|
||||
; latch clock data
|
||||
|
@ -261,7 +261,7 @@ UnreferencedClearRTCStatus::
|
||||
xor a
|
||||
push af
|
||||
ld a, BANK(sRTCStatusFlags)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
pop af
|
||||
ld [sRTCStatusFlags], a
|
||||
call CloseSRAM
|
||||
@ -272,7 +272,7 @@ RecordRTCStatus::
|
||||
ld hl, sRTCStatusFlags
|
||||
push af
|
||||
ld a, BANK(sRTCStatusFlags)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
pop af
|
||||
or [hl]
|
||||
ld [hl], a
|
||||
@ -282,7 +282,7 @@ RecordRTCStatus::
|
||||
CheckRTCStatus::
|
||||
; check sRTCStatusFlags
|
||||
ld a, BANK(sRTCStatusFlags)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sRTCStatusFlags]
|
||||
call CloseSRAM
|
||||
ret
|
||||
|
@ -340,7 +340,7 @@ Function11c1b9:
|
||||
Function11c254:
|
||||
push af
|
||||
ld a, $4
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s4_a007
|
||||
pop af
|
||||
sla a
|
||||
@ -1763,7 +1763,7 @@ Function11cb66:
|
||||
and a
|
||||
jr nz, .asm_11cbd4
|
||||
ld a, $4
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s4_a007
|
||||
ld a, [wMenuCursorY]
|
||||
dec a
|
||||
|
@ -21,7 +21,7 @@ MobileCheckOwnMonAnywhere:
|
||||
dec d
|
||||
jr nz, .asm_4a851
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBoxCount]
|
||||
and a
|
||||
jr z, .asm_4a888
|
||||
@ -57,7 +57,7 @@ MobileCheckOwnMonAnywhere:
|
||||
add hl, bc
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
|
@ -15,7 +15,7 @@ String_89153:
|
||||
OpenSRAMBank4:
|
||||
push af
|
||||
ld a, $4
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
pop af
|
||||
ret
|
||||
|
||||
|
@ -1092,7 +1092,7 @@ Function1006dc:
|
||||
MobileBattleResetTimer:
|
||||
ld a, BANK(sMobileBattleTimer)
|
||||
ld hl, sMobileBattleTimer
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [hli], a
|
||||
ld [hli], a
|
||||
@ -1103,7 +1103,7 @@ MobileBattleResetTimer:
|
||||
MobileBattleFixTimer:
|
||||
ld a, BANK(sMobileBattleTimer)
|
||||
ld hl, sMobileBattleTimer
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a ; MOBILE_BATTLE_ALLOWED_SECONDS
|
||||
ld [hli], a
|
||||
ld a, MOBILE_BATTLE_ALLOWED_MINUTES
|
||||
@ -1125,7 +1125,7 @@ Function100720:
|
||||
ld [wcd74], a
|
||||
ld a, BANK(sMobileBattleTimer)
|
||||
ld hl, sMobileBattleTimer
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hli]
|
||||
ld [wcd6c], a
|
||||
ld a, [hli]
|
||||
@ -1248,7 +1248,7 @@ Function1007f6:
|
||||
ld de, wcd71
|
||||
call Function1006dc
|
||||
ld a, $04
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $a802
|
||||
call Function100826
|
||||
call CloseSRAM
|
||||
@ -1338,7 +1338,7 @@ MobileBattleGetRemainingTime:
|
||||
; Returns minutes in c and seconds in b
|
||||
ld a, BANK(sMobileBattleTimer)
|
||||
ld hl, sMobileBattleTimer
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [hli]
|
||||
ld [wStringBuffer2], a
|
||||
ld a, [hli]
|
||||
@ -2374,7 +2374,7 @@ Function100f8d:
|
||||
ret
|
||||
|
||||
.sram
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ret
|
||||
@ -2428,7 +2428,7 @@ endr
|
||||
inc hl
|
||||
ld [hl], d
|
||||
ld a, $07
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wc608
|
||||
ld de, $a001
|
||||
ld bc, wc7bd - wc608
|
||||
@ -2654,7 +2654,7 @@ LoadSelectedPartiesForColosseum:
|
||||
|
||||
Function1011f1:
|
||||
ld a, BANK(s4_a60c)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s4_a60c]
|
||||
ld [wdc41], a
|
||||
call CloseSRAM
|
||||
@ -4659,7 +4659,7 @@ Function1020bf:
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld a, $04
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call Function10208e
|
||||
call Function102068
|
||||
call CloseSRAM
|
||||
@ -4695,7 +4695,7 @@ Function1020ea:
|
||||
|
||||
Function102112:
|
||||
ld a, $04
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $a041
|
||||
ld c, 40
|
||||
.outer_loop
|
||||
@ -6254,7 +6254,7 @@ Function102c3b:
|
||||
Function102c48:
|
||||
farcall Function10165a
|
||||
ld a, 0
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $a600
|
||||
ld de, wc608
|
||||
ld bc, $2f
|
||||
@ -6364,7 +6364,7 @@ Function102d34:
|
||||
ret
|
||||
|
||||
Function102d3e:
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ret
|
||||
@ -6909,7 +6909,7 @@ Function103309:
|
||||
xor a
|
||||
call ByteFill
|
||||
ld a, BANK(s4_a60c)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wdc41]
|
||||
ld [s4_a60c], a
|
||||
ld [wBuffer1], a
|
||||
@ -6961,7 +6961,7 @@ Function103362:
|
||||
bit 6, [hl]
|
||||
jr z, .asm_103398
|
||||
ld a, BANK(s4_a60c)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wBuffer1]
|
||||
ld [s4_a60c], a
|
||||
ld [wdc41], a
|
||||
|
@ -5,7 +5,7 @@
|
||||
StubbedTrainerRankings_HallOfFame2::
|
||||
ret
|
||||
ld a, BANK(sTrainerRankingGameTimeHOF)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld hl, wGameTimeHours
|
||||
ld de, sTrainerRankingGameTimeHOF
|
||||
@ -36,7 +36,7 @@ StubbedTrainerRankings_HallOfFame2::
|
||||
StubbedTrainerRankings_MagikarpLength:
|
||||
ret
|
||||
ld a, BANK(sTrainerRankingLongestMagikarp)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, wBuffer1
|
||||
ld hl, sTrainerRankingLongestMagikarp
|
||||
|
||||
@ -104,7 +104,7 @@ StubbedTrainerRankings_MagikarpLength:
|
||||
StubbedTrainerRankings_BugContestScore:
|
||||
ret
|
||||
ld a, BANK(sTrainerRankingBugContestScore)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ldh a, [hProduct]
|
||||
ld hl, sTrainerRankingBugContestScore
|
||||
cp [hl]
|
||||
@ -133,7 +133,7 @@ StubbedTrainerRankings_BugContestScore:
|
||||
StubbedTrainerRankings_AddToSlotsWinStreak:
|
||||
ret
|
||||
ld a, BANK(sTrainerRankingCurrentSlotsStreak)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
; Increment the current streak
|
||||
ld hl, sTrainerRankingCurrentSlotsStreak + 1
|
||||
@ -173,7 +173,7 @@ StubbedTrainerRankings_AddToSlotsWinStreak:
|
||||
StubbedTrainerRankings_EndSlotsWinStreak:
|
||||
ret
|
||||
ld a, BANK(sTrainerRankingCurrentSlotsStreak)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sTrainerRankingCurrentSlotsStreak
|
||||
xor a
|
||||
ld [hli], a
|
||||
@ -185,7 +185,7 @@ StubbedTrainerRankings_EndSlotsWinStreak:
|
||||
StubbedTrainerRankings_AddToSlotsPayouts:
|
||||
ret
|
||||
ld a, BANK(sTrainerRankingTotalSlotsPayouts)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sTrainerRankingTotalSlotsPayouts + 3
|
||||
ld a, e
|
||||
add [hl]
|
||||
@ -213,7 +213,7 @@ StubbedTrainerRankings_AddToSlotsPayouts:
|
||||
StubbedTrainerRankings_AddToBattlePayouts:
|
||||
ret
|
||||
ld a, BANK(sTrainerRankingTotalBattlePayouts)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sTrainerRankingTotalBattlePayouts + 3
|
||||
ld a, [bc]
|
||||
dec bc
|
||||
@ -248,7 +248,7 @@ StubbedTrainerRankings_StepCount:
|
||||
Unreferenced_StubbedTrainerRankings_BattleTowerWins:
|
||||
ret
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [$aa8d]
|
||||
and a
|
||||
call CloseSRAM
|
||||
@ -439,7 +439,7 @@ StubbedTrainerRankings_Increment1Byte:
|
||||
; Increments a big-endian value of bc + 1 bytes at hl
|
||||
StubbedTrainerRankings_Increment:
|
||||
ld a, BANK(sTrainerRankings)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
push hl
|
||||
push de
|
||||
ld e, c
|
||||
@ -476,7 +476,7 @@ StubbedTrainerRankings_Increment:
|
||||
UpdateTrainerRankingsChecksum2:
|
||||
ret
|
||||
ld a, BANK(sTrainerRankings)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call UpdateTrainerRankingsChecksum
|
||||
call CloseSRAM
|
||||
ret
|
||||
@ -515,11 +515,11 @@ CalculateTrainerRankingsChecksum:
|
||||
|
||||
BackupMobileEventIndex:
|
||||
ld a, BANK(sMobileEventIndex)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMobileEventIndex]
|
||||
push af
|
||||
ld a, BANK(sMobileEventIndexBackup)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
pop af
|
||||
ld [sMobileEventIndexBackup], a
|
||||
call CloseSRAM
|
||||
@ -527,11 +527,11 @@ BackupMobileEventIndex:
|
||||
|
||||
RestoreMobileEventIndex:
|
||||
ld a, BANK(sMobileEventIndexBackup)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMobileEventIndexBackup]
|
||||
push af
|
||||
ld a, BANK(sMobileEventIndex)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
pop af
|
||||
ld [sMobileEventIndex], a
|
||||
call CloseSRAM
|
||||
@ -550,7 +550,7 @@ Unreferenced_VerifyTrainerRankingsChecksum:
|
||||
|
||||
DeleteMobileEventIndex:
|
||||
ld a, BANK(sMobileEventIndex)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [sMobileEventIndex], a
|
||||
call CloseSRAM
|
||||
@ -791,13 +791,13 @@ Mobile_DummyReturnFalse:
|
||||
Stubbed_Function106314:
|
||||
ret
|
||||
ld a, $4
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, c
|
||||
cpl
|
||||
ld [$b000], a
|
||||
call CloseSRAM
|
||||
ld a, $7
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, c
|
||||
ld [$a800], a
|
||||
call CloseSRAM
|
||||
@ -811,13 +811,13 @@ Function106331:
|
||||
; called by Mobile_DummyReturnFalse in Crystal-J
|
||||
; check ~[4:b000] == [7:a800]
|
||||
ld a, $4
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [$b000]
|
||||
cpl
|
||||
ld b, a
|
||||
call CloseSRAM
|
||||
ld a, $7
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [$a800]
|
||||
ld c, a
|
||||
call CloseSRAM
|
||||
|
@ -20,7 +20,7 @@ Function11766b:
|
||||
ldh [rSVBK], a
|
||||
call Function1176ee
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $b1f3
|
||||
ld de, wcd49
|
||||
ld bc, $8
|
||||
@ -35,7 +35,7 @@ Function11766b:
|
||||
|
||||
Function117699:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wcd49
|
||||
ld de, $b1f3
|
||||
ld bc, $8
|
||||
@ -408,7 +408,7 @@ Function117942:
|
||||
ld a, $1e
|
||||
ld [wcd4e], a
|
||||
ld a, BANK(sMobileLoginPassword)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wcd4f]
|
||||
ld [sMobileLoginPassword], a
|
||||
ld hl, $c708
|
||||
@ -729,7 +729,7 @@ Function117bb6:
|
||||
ld a, $3
|
||||
ldh [rSVBK], a
|
||||
ld a, $7
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, w3_d002
|
||||
ld de, $b000
|
||||
ld bc, $1000
|
||||
@ -773,7 +773,7 @@ Function117c4a:
|
||||
|
||||
Function117c89:
|
||||
ld a, $7
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld l, $0
|
||||
ld h, l
|
||||
ld de, $b000
|
||||
|
@ -184,7 +184,7 @@ Function118180:
|
||||
and a
|
||||
ret z
|
||||
ld a, BANK(s5_a89c) ; aka BANK(s5_a8b2)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wcd69
|
||||
ld de, s5_a89c
|
||||
ld bc, 22
|
||||
@ -478,7 +478,7 @@ BattleTowerRoomMenu_InitRAM:
|
||||
farcall Function115d99
|
||||
farcall Function11615a
|
||||
ld a, BANK(s5_bfff)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [s5_bfff], a
|
||||
call CloseSRAM
|
||||
@ -487,7 +487,7 @@ BattleTowerRoomMenu_InitRAM:
|
||||
Function118440:
|
||||
push af
|
||||
ld a, BANK(s5_bfff)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_bfff]
|
||||
inc a
|
||||
ld [s5_bfff], a
|
||||
@ -1091,7 +1091,7 @@ Function1188c8:
|
||||
Function1188e7:
|
||||
ld de, wc346
|
||||
ld a, BANK(s5_aa4a)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_aa4a]
|
||||
call CloseSRAM
|
||||
and a
|
||||
@ -1521,7 +1521,7 @@ Unreferenced_Function118d35:
|
||||
add b
|
||||
ld b, a
|
||||
ld a, BANK(s5_b2fb)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, b
|
||||
ld [s5_b2fb], a
|
||||
call CloseSRAM
|
||||
@ -1942,7 +1942,7 @@ Function119009:
|
||||
|
||||
Function119054:
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wd002
|
||||
ld a, [wcd4f]
|
||||
ld e, a
|
||||
@ -1972,7 +1972,7 @@ Function119054:
|
||||
ld a, $3 ; ???
|
||||
ldh [rSVBK], a
|
||||
ld a, BANK(s5_b1b3) ; aka BANK(s5_b1b4) and BANK(s5_aa7f) and BANK(s5_b2f3) and BANK(s5_b2f4)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wcd4f]
|
||||
ld [s5_b1b3], a
|
||||
ld a, [wcd50]
|
||||
@ -2012,19 +2012,19 @@ Function1190d0:
|
||||
|
||||
Function1190ec:
|
||||
ld a, BANK(s5_aa73)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBGMapBuffer
|
||||
ld de, s5_aa73
|
||||
ld bc, 12
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, BANK(s5_aa72)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, $1
|
||||
ld [s5_aa72], a
|
||||
call CloseSRAM
|
||||
ld a, BANK(s6_a000)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [w3_d000]
|
||||
ld c, a
|
||||
ld a, [w3_d000 + 1]
|
||||
@ -2069,7 +2069,7 @@ Function11915d:
|
||||
ld bc, 12
|
||||
call CopyBytes
|
||||
ld a, BANK(s5_aa7f)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wBGMapBuffer
|
||||
ld de, s5_aa7f
|
||||
ld c, 12
|
||||
@ -2201,7 +2201,7 @@ Function119223:
|
||||
ld [wcd4b], a
|
||||
ld [wcd4c], a
|
||||
ld a, BANK(s5_b092) ; aka BANK(s5_b1b1) and BANK(s5_b1b2) and BANK(s5_b1d3)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wc3cd
|
||||
ld de, s5_b092
|
||||
ld bc, 31
|
||||
@ -2237,7 +2237,7 @@ Function119223:
|
||||
jr z, .asm_1192c2
|
||||
cp $fe
|
||||
jr z, .asm_1192a5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld c, a
|
||||
@ -2308,7 +2308,7 @@ Function119223:
|
||||
|
||||
Function1192cc:
|
||||
ld a, BANK(s5_aa73)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, s5_aa73
|
||||
ld de, wc608
|
||||
ld bc, 12
|
||||
@ -2369,7 +2369,7 @@ Function119300:
|
||||
ld [wcd4c], a
|
||||
ld a, [de]
|
||||
inc de
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld c, a
|
||||
@ -2499,7 +2499,7 @@ Function1193fb:
|
||||
|
||||
Function119413:
|
||||
ld a, $6 ; ???
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [w3_d000]
|
||||
ld c, a
|
||||
ld a, [w3_d000 + 1]
|
||||
@ -3580,7 +3580,7 @@ Function119b52:
|
||||
cp $1
|
||||
jr nz, .asm_119b66
|
||||
ld a, BANK(s5_a800)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, $4
|
||||
ld [s5_a800], a
|
||||
call CloseSRAM
|
||||
@ -3680,7 +3680,7 @@ Function119b6b:
|
||||
ld a, $19
|
||||
ld [wBattleTowerRoomMenuJumptableIndex], a
|
||||
ld a, BANK(s5_a800)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, $1
|
||||
ld [s5_a800], a
|
||||
call CloseSRAM
|
||||
@ -3700,7 +3700,7 @@ Function119b6b:
|
||||
cp HIGH(w3_d869)
|
||||
jr nz, .asm_119be3
|
||||
ld a, BANK(s5_b090) ; aka BANK(s5_b091) and BANK(s5_b023)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wcf64]
|
||||
ld [s5_b090], a
|
||||
ld a, [wcf65]
|
||||
@ -3750,7 +3750,7 @@ popc
|
||||
ld a, $19
|
||||
ld [wBattleTowerRoomMenuJumptableIndex], a
|
||||
ld a, BANK(s5_a800)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, $1
|
||||
ld [s5_a800], a
|
||||
call CloseSRAM
|
||||
@ -4123,7 +4123,7 @@ Function119eb4:
|
||||
|
||||
Function119ec2:
|
||||
ld a, BANK(sMobileLoginPassword)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [sMobileLoginPassword + MOBILE_LOGIN_PASSWORD_LENGTH], a
|
||||
ld de, sMobileLoginPassword + 1
|
||||
@ -4288,7 +4288,7 @@ Function119f98:
|
||||
|
||||
Function11a00e:
|
||||
ld a, BANK(sMobileLoginPassword)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sMobileLoginPassword]
|
||||
and a
|
||||
jr z, .asm_11a02a
|
||||
@ -4297,7 +4297,7 @@ Function11a00e:
|
||||
and a
|
||||
ret nz
|
||||
ld a, BANK(sMobileLoginPassword)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [sMobileLoginPassword], a
|
||||
|
||||
@ -6955,7 +6955,7 @@ Function11b483:
|
||||
|
||||
.okay4
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, MAIL_STRUCT_LENGTH
|
||||
.loop9
|
||||
push af
|
||||
@ -7033,7 +7033,7 @@ Function11b570:
|
||||
ld a, $1
|
||||
ldh [rSVBK], a
|
||||
ld a, BANK(s5_a800)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
ld de, s5_a800
|
||||
ld a, $1
|
||||
@ -7079,14 +7079,14 @@ Function11b5e7:
|
||||
|
||||
Function11b5e8:
|
||||
ld a, $0
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wRTC
|
||||
ld de, $c608
|
||||
ld bc, 4
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $c608
|
||||
ld de, $b08c
|
||||
ld bc, 4
|
||||
@ -7174,7 +7174,7 @@ Function11b6b3:
|
||||
|
||||
Function11b6b4:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wcd30]
|
||||
ld [$c708], a
|
||||
ld a, [wcd31]
|
||||
@ -7347,7 +7347,7 @@ Function11b7e5:
|
||||
ld [wLinkMode], a
|
||||
farcall SaveAfterLinkTrade
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, $5
|
||||
ld [$a800], a
|
||||
call CloseSRAM
|
||||
@ -7373,7 +7373,7 @@ Function11b879:
|
||||
and a
|
||||
ret z
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [$a800]
|
||||
ld [wScriptVar], a
|
||||
ld a, [$a890]
|
||||
@ -7462,7 +7462,7 @@ Function11b879:
|
||||
Function11b920:
|
||||
call Mobile46_InitJumptable
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $a81f
|
||||
ld de, $c626
|
||||
ld bc, 8
|
||||
@ -7473,7 +7473,7 @@ Function11b920:
|
||||
|
||||
Function11b93b:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [$a800], a
|
||||
ld hl, $a823
|
||||
@ -7600,7 +7600,7 @@ AddMobileMonToParty:
|
||||
and a
|
||||
jr nz, .loop5
|
||||
ld a, BANK(sPartyMail)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld e, l
|
||||
ld d, h
|
||||
ld a, [wMobileMonMailPointerBuffer]
|
||||
|
@ -37,7 +37,7 @@ Function170000:
|
||||
|
||||
Function17005a:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [$a824]
|
||||
ld [wOTTrademonSpecies], a
|
||||
ld hl, $a827
|
||||
@ -75,7 +75,7 @@ INCLUDE "engine/events/battle_tower/battle_tower.asm"
|
||||
|
||||
Function170be4:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld hl, $a894
|
||||
ld bc, $0008
|
||||
@ -85,7 +85,7 @@ Function170be4:
|
||||
|
||||
Clears5_a89a:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $a89a
|
||||
xor a
|
||||
ld [hli], a
|
||||
@ -95,7 +95,7 @@ Clears5_a89a:
|
||||
|
||||
Function170c06:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $a894
|
||||
ld a, [wBattleResult]
|
||||
and a ; WIN?
|
||||
@ -589,7 +589,7 @@ Function171bdc:
|
||||
|
||||
Function171beb:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [wcd4a]
|
||||
ld [$aa4a], a
|
||||
call CloseSRAM
|
||||
|
@ -302,7 +302,7 @@ Function17d0f3:
|
||||
ld [wLinkMode], a
|
||||
farcall SaveAfterLinkTrade
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, $5
|
||||
ld [$a800], a
|
||||
call CloseSRAM
|
||||
@ -508,7 +508,7 @@ Function17d2c0:
|
||||
|
||||
Function17d2ce:
|
||||
ld a, BANK(s5_aa72)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_aa72]
|
||||
call CloseSRAM
|
||||
and a
|
||||
@ -543,13 +543,13 @@ Function17d2ce:
|
||||
|
||||
Function17d314:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [$b1b1]
|
||||
call CloseSRAM
|
||||
cp $21
|
||||
jr nc, .asm_17d354
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld l, $0
|
||||
ld h, l
|
||||
ld de, $a006
|
||||
@ -582,7 +582,7 @@ Function17d314:
|
||||
.asm_17d354
|
||||
call CloseSRAM
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld hl, $aa73
|
||||
ld bc, $c
|
||||
@ -636,7 +636,7 @@ Function17d370:
|
||||
ld a, $d0
|
||||
ld [wcd21], a
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $a006
|
||||
ld de, wBGPals1
|
||||
ld bc, $1000
|
||||
@ -948,7 +948,7 @@ Function17d5f6:
|
||||
|
||||
Function17d60b:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $b1d3
|
||||
ld de, wc608
|
||||
ld bc, $20
|
||||
@ -963,7 +963,7 @@ Function17d60b:
|
||||
ld h, a
|
||||
call CloseSRAM
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, wc708
|
||||
ld a, c
|
||||
and a
|
||||
@ -1023,7 +1023,7 @@ Function17d60b:
|
||||
.asm_17d684
|
||||
call CloseSRAM
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wc708
|
||||
ld de, $b1b3
|
||||
ld a, [$b1b1]
|
||||
@ -1040,7 +1040,7 @@ Function17d6a1:
|
||||
ld c, a
|
||||
ld b, $0
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $b1d3
|
||||
add hl, bc
|
||||
add hl, bc
|
||||
@ -1058,7 +1058,7 @@ Function17d6a1:
|
||||
ld l, c
|
||||
call CloseSRAM
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, l
|
||||
ld [wcd5e], a
|
||||
ld a, h
|
||||
@ -1177,7 +1177,7 @@ Function17d78d:
|
||||
ld b, a
|
||||
call HlToCrashCheckPointer
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $a006
|
||||
add hl, bc
|
||||
ld de, wBGPals1
|
||||
@ -1330,7 +1330,7 @@ Function17d85d:
|
||||
|
||||
.asm_17d89b
|
||||
ld a, [wcd4f]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.asm_17d8a1
|
||||
push hl
|
||||
@ -1511,7 +1511,7 @@ Function17d9e3:
|
||||
|
||||
.asm_17da01
|
||||
ld a, [wc70c]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.asm_17da07
|
||||
ld a, [wc708]
|
||||
@ -1556,7 +1556,7 @@ Function17da31:
|
||||
|
||||
.asm_17da4f
|
||||
ld a, [wc70a]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.asm_17da55
|
||||
ld a, [wc708]
|
||||
@ -2021,7 +2021,7 @@ Function17dd49:
|
||||
|
||||
.sram
|
||||
ld a, [wc708]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.got_bank
|
||||
ld a, [wc709]
|
||||
@ -2097,7 +2097,7 @@ Function17ddcd:
|
||||
|
||||
.asm_17dde7
|
||||
ld a, [wc708]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.asm_17dded
|
||||
ld a, [wc709]
|
||||
@ -2154,7 +2154,7 @@ Function17de32:
|
||||
ld b, $0
|
||||
call CopyBytes
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call Function17f4f6
|
||||
ld a, [wc708]
|
||||
ld e, a
|
||||
@ -2208,7 +2208,7 @@ Function17de91:
|
||||
ld bc, $7
|
||||
call CopyBytes
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
call Function17f4f6
|
||||
ld a, [wc708]
|
||||
ld e, a
|
||||
@ -2452,7 +2452,7 @@ Function17ded9:
|
||||
|
||||
Function17e026:
|
||||
ld a, BANK(sBoxCount)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sBoxCount]
|
||||
call CloseSRAM
|
||||
cp $14
|
||||
@ -2467,7 +2467,7 @@ Function17e026:
|
||||
pop hl
|
||||
pop bc
|
||||
ld a, BANK(sBoxMonNicknames)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
bit 1, b
|
||||
jr z, .asm_17e067
|
||||
push bc
|
||||
@ -2494,7 +2494,7 @@ Function17e026:
|
||||
call CloseSRAM
|
||||
farcall SetGiftBoxMonCaughtData
|
||||
ld a, $1
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
pop hl
|
||||
pop bc
|
||||
jr .asm_17e092
|
||||
@ -2696,7 +2696,7 @@ Function17e1a1:
|
||||
|
||||
.asm_17e1bb
|
||||
ld a, [wc708]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.asm_17e1c1
|
||||
ld a, [wc709]
|
||||
@ -2728,7 +2728,7 @@ Function17e1a1:
|
||||
|
||||
.asm_17e1f3
|
||||
ld a, [wc70c]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.asm_17e1f9
|
||||
ld a, [wc70d]
|
||||
@ -2890,7 +2890,7 @@ Function17e2a7:
|
||||
xor a
|
||||
ld [wcd7a], a
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $aa73
|
||||
ld de, $aa7f
|
||||
ld bc, $c
|
||||
@ -2926,7 +2926,7 @@ Function17e309:
|
||||
|
||||
Function17e32b:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, wc608
|
||||
ld de, $b0b1
|
||||
ld bc, $40
|
||||
@ -2939,7 +2939,7 @@ Function17e32b:
|
||||
|
||||
Function17e349:
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, $b0b1
|
||||
ld de, wc608
|
||||
ld bc, $40
|
||||
@ -3541,7 +3541,7 @@ INCLUDE "gfx/mobile/pokemon_news.pal"
|
||||
|
||||
RunMobileScript::
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
inc de
|
||||
.loop
|
||||
call _RunMobileScript
|
||||
@ -4082,13 +4082,13 @@ MobileScript_Prefecture:
|
||||
bit 7, a
|
||||
jr nz, .asm_17f355
|
||||
ld a, BANK(sCrystalData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [sCrystalData + 2]
|
||||
jr .asm_17f35d
|
||||
|
||||
.asm_17f355
|
||||
ld a, BANK(s5_b2f3)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [s5_b2f3]
|
||||
|
||||
.asm_17f35d
|
||||
@ -4125,13 +4125,13 @@ Function17f382:
|
||||
bit 7, a
|
||||
jr nz, .asm_17f3a3
|
||||
ld a, BANK(sCrystalData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, sCrystalData + 3
|
||||
jr .asm_17f3ab
|
||||
|
||||
.asm_17f3a3
|
||||
ld a, BANK(s5_b2f4)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld de, s5_b2f4
|
||||
|
||||
.asm_17f3ab
|
||||
@ -4299,7 +4299,7 @@ Function17f44f:
|
||||
|
||||
.asm_17f488
|
||||
ld a, [wcd54]
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.asm_17f48e
|
||||
ld a, [wcd55]
|
||||
@ -4321,7 +4321,7 @@ Function17f44f:
|
||||
.asm_17f4af
|
||||
call CloseSRAM
|
||||
ld a, $6
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
|
||||
.asm_17f4b7
|
||||
ld de, wc608
|
||||
@ -4491,7 +4491,7 @@ DisplayMobileError:
|
||||
|
||||
.asm_17f5a1
|
||||
ld a, BANK(sMobileLoginPassword)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
xor a
|
||||
ld [sMobileLoginPassword], a
|
||||
call CloseSRAM
|
||||
|
@ -180,7 +180,7 @@ Function4a0c2:
|
||||
ld a, 2
|
||||
call MenuClickSound
|
||||
ld a, BANK(sPlayerData)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sPlayerData + wPlayerName - wPlayerData
|
||||
ld de, wPlayerName
|
||||
ld bc, NAME_LENGTH_JAPANESE
|
||||
@ -378,7 +378,7 @@ Function4a28a:
|
||||
call WaitBGMap
|
||||
call LoadStandardMenuHeader
|
||||
ld a, $5
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld a, [$aa4b]
|
||||
call CloseSRAM
|
||||
and a
|
||||
@ -429,7 +429,7 @@ Function4a28a:
|
||||
cp $2
|
||||
jr z, .dont_delete_password
|
||||
ld a, BANK(sMobileLoginPassword)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, sMobileLoginPassword
|
||||
xor a
|
||||
ld bc, MOBILE_LOGIN_PASSWORD_LENGTH
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
Unreferenced_Function1f4003:
|
||||
ld a, BANK(s6_a000)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, .news_data
|
||||
ld de, s6_a000
|
||||
ld bc, $1000
|
||||
@ -17,7 +17,7 @@ INCBIN "mobile/news/news_1.bin"
|
||||
|
||||
Unreferenced_Function1f4dbe:
|
||||
ld a, BANK(s6_a000)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, .news_data
|
||||
ld de, s6_a000
|
||||
ld bc, $1000
|
||||
@ -30,7 +30,7 @@ INCBIN "mobile/news/news_2.bin"
|
||||
|
||||
Function1f5d9f:
|
||||
ld a, BANK(s6_a000)
|
||||
call GetSRAMBank
|
||||
call OpenSRAM
|
||||
ld hl, .news_data
|
||||
ld de, s6_a000
|
||||
ld bc, $1000
|
||||
|
Loading…
Reference in New Issue
Block a user