Use BANK for hardcoded SRAM banks (except for vestigial refs to JP's banks 4-7)

This commit is contained in:
Adelaide Walter 2018-01-08 17:13:37 -05:00
parent ce985a09a7
commit d6f20ae746
10 changed files with 17 additions and 17 deletions

View File

@ -19,7 +19,7 @@ CheckBattleScene: ; 4ea44
and a
jr nz, .from_wram
ld a, $4
ld a, 4 ; MBC30 bank used by JP Crystal; inaccessible by MBC3
call GetSRAMBank
ld a, [$a60c]
ld c, a

View File

@ -232,7 +232,7 @@ BattleTurn: ; 3c12f
; 3c1bf
MobileFn_3c1bf: mobile
ld a, $5
ld a, 5 ; MBC30 bank used by JP Crystal; inaccessible by MBC3
call GetSRAMBank
ld hl, $a89b ; s5_a89b
inc [hl]

View File

@ -2104,7 +2104,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld hl, wBillsPC_BackupScrollPosition
add [hl]
ld [CurPartyMon], a
ld a, $1
ld a, BANK(sBox)
call GetSRAMBank
ld hl, sBoxSpecies
call CopySpeciesToTemp

View File

@ -69,7 +69,7 @@ ReadAnyMail: ; b9237
ld h, d
ld l, e
push hl
ld a, $0
ld a, BANK(sPartyMail)
call GetSRAMBank
ld de, sPartyMon1MailAuthorID - sPartyMon1Mail
add hl, de

View File

@ -730,7 +730,7 @@ Function24423: ; 24423
ld a, [VramState]
bit 0, a
ret z
xor a
xor a ; effectively ld a, BANK(sScratch)
call GetSRAMBank
hlcoord 0, 0
ld de, sScratch
@ -738,7 +738,7 @@ Function24423: ; 24423
call CopyBytes
call CloseSRAM
call OverworldTextModeSwitch
xor a
xor a ; effectively ld a, BANK(sScratch)
call GetSRAMBank
ld hl, sScratch
decoord 0, 0

View File

@ -174,7 +174,7 @@ GetGender: ; 50bdd
; sBoxMon data is read directly from SRAM.
ld a, [MonType]
cp BOXMON
ld a, 1
ld a, BANK(sBox)
call z, GetSRAMBank
; Attack DV

View File

@ -1561,7 +1561,7 @@ Function10578c: ; 10578c (41:578c)
ld a, [sCrystalData + 0]
ld [de], a
inc de
ld a, $4
ld a, 4 ; MBC30 bank used by JP Crystal; inaccessible by MBC3
call GetSRAMBank
ld hl, $a603
ld bc, $8

View File

@ -1,11 +1,11 @@
EmptyAllSRAMBanks: ; 4cf1f
ld a, $0
ld a, 0
call .EmptyBank
ld a, $1
ld a, 1
call .EmptyBank
ld a, $2
ld a, 2
call .EmptyBank
ld a, $3
ld a, 3
call .EmptyBank
ret

View File

@ -146,7 +146,7 @@ Function140ae: ; 140ae
farcall ClearDailyTimers
farcall Function170923
; mobile
ld a, $5
ld a, 5 ; MBC30 bank used by JP Crystal; inaccessible by MBC3
call GetSRAMBank
ld a, [$aa8c]
inc a

View File

@ -418,7 +418,7 @@ EraseHallOfFame: ; 14d06
Function14d18: ; 14d18
; XXX
; copy .Data to SRA4:a007
ld a, $4
ld a, 4 ; MBC30 bank used by JP Crystal; inaccessible by MBC3
call GetSRAMBank
ld hl, .Data
ld de, $a007
@ -454,7 +454,7 @@ SaveData: ; 14d68
Function14d6c: ; 14d6c
; XXX
ld a, $4
ld a, 4 ; MBC30 bank used by JP Crystal; inaccessible by MBC3
call GetSRAMBank
ld a, [$a60b]
ld b, $0
@ -471,7 +471,7 @@ Function14d6c: ; 14d6c
Function14d83: ; 14d83
; XXX
ld a, $4
ld a, 4 ; MBC30 bank used by JP Crystal; inaccessible by MBC3
call GetSRAMBank
xor a
ld [$a60c], a
@ -482,7 +482,7 @@ Function14d83: ; 14d83
Function14d93: ; 14d93
; XXX
ld a, $7
ld a, 7 ; MBC30 bank used by JP Crystal; inaccessible by MBC3
call GetSRAMBank
xor a
ld [$a000], a