Use BANK for hardcoded WRAM banks (except where bankswitches appear unnecessary).

This commit is contained in:
Adelaide Walter 2018-01-03 19:12:45 -05:00
parent 501ec9b283
commit 9d0ba6bfd3
33 changed files with 102 additions and 99 deletions

View File

@ -23,7 +23,7 @@ Predef_StartBattle: ; 8c20f
.done .done
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals1 ld hl, wBGPals1
@ -44,7 +44,7 @@ Predef_StartBattle: ; 8c20f
ld [hLYOverrideEnd], a ld [hLYOverrideEnd], a
ld [hSCY], a ld [hSCY], a
ld a, $1 ld a, 1 ; unnecessary bankswitch?
ld [rSVBK], a ld [rSVBK], a
pop af pop af
ld [hVBlank], a ld [hVBlank], a
@ -116,7 +116,7 @@ LoadTrainerBattlePokeballTiles:
ConvertTrainerBattlePokeballTilesTo2bpp: ; 8c2cf ConvertTrainerBattlePokeballTilesTo2bpp: ; 8c2cf
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
push hl push hl
ld hl, wDecompressScratch ld hl, wDecompressScratch
@ -647,7 +647,7 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
.daytime .daytime
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ; WRAM5 = palettes ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
call .copypals call .copypals
push hl push hl
@ -729,7 +729,7 @@ PokeBallTransition:
WipeLYOverrides: ; 8c6d8 WipeLYOverrides: ; 8c6d8
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(LYOverrides)
ld [rSVBK], a ld [rSVBK], a
ld hl, LYOverrides ld hl, LYOverrides

View File

@ -9320,7 +9320,7 @@ InitBattleDisplay: ; 3fb6c
.BlankBGMap: ; 3fbd6 .BlankBGMap: ; 3fbd6
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
ld hl, wDecompressScratch ld hl, wDecompressScratch
@ -9381,7 +9381,7 @@ GetTrainerBackpic: ; 3fbff
CopyBackpic: ; 3fc30 CopyBackpic: ; 3fc30
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
ld hl, vTiles0 ld hl, vTiles0
ld de, vTiles2 tile $31 ld de, vTiles2 tile $31

View File

@ -1,7 +1,7 @@
BattleIntroSlidingPics: ; 4e980 BattleIntroSlidingPics: ; 4e980
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(LYOverrides)
ld [rSVBK], a ld [rSVBK], a
call .subfunction1 call .subfunction1
ld a, rSCX - $ff00 ld a, rSCX - $ff00

View File

@ -5,7 +5,7 @@ PlayBattleAnim: ; cc0d6
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 5 ld a, BANK(ActiveAnimObjects)
ld [rSVBK], a ld [rSVBK], a
call _PlayBattleAnim call _PlayBattleAnim
@ -163,7 +163,7 @@ BattleAnimRestoreHuds: ; cc1bb
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, BANK(CurBattleMon) ; alternatively: BANK(TempMon), BANK(PartyMon1), several others
ld [rSVBK], a ld [rSVBK], a
ld hl, UpdateBattleHuds ld hl, UpdateBattleHuds
@ -917,7 +917,7 @@ BattleAnimCmd_E7: ; cc5db (33:45db)
BattleAnimCmd_Transform: ; cc5dc (33:45dc) BattleAnimCmd_Transform: ; cc5dc (33:45dc)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 1 ld a, BANK(CurPartySpecies)
ld [rSVBK], a ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies ld a, [CurPartySpecies] ; CurPartySpecies
push af push af
@ -973,7 +973,7 @@ BattleAnimCmd_RaiseSub: ; cc640 (33:4640)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 1 ld a, 1 ; unnecessary bankswitch?
ld [rSVBK], a ld [rSVBK], a
xor a xor a
call GetSRAMBank call GetSRAMBank
@ -1047,7 +1047,7 @@ GetSubstitutePic: ; cc64c
BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf) BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, 1 ; unnecessary bankswitch?
ld [rSVBK], a ld [rSVBK], a
xor a xor a
call GetSRAMBank call GetSRAMBank
@ -1103,7 +1103,7 @@ INCBIN "gfx/battle/minimize.2bpp"
BattleAnimCmd_Minimize: ; cc735 (33:4735) BattleAnimCmd_Minimize: ; cc735 (33:4735)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, 1 ; unnecessary bankswitch?
ld [rSVBK], a ld [rSVBK], a
xor a xor a
call GetSRAMBank call GetSRAMBank
@ -1118,7 +1118,7 @@ BattleAnimCmd_Minimize: ; cc735 (33:4735)
BattleAnimCmd_DropSub: ; cc750 (33:4750) BattleAnimCmd_DropSub: ; cc750 (33:4750)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, BANK(CurPartySpecies)
ld [rSVBK], a ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies ld a, [CurPartySpecies] ; CurPartySpecies
@ -1143,7 +1143,7 @@ BattleAnimCmd_DropSub: ; cc750 (33:4750)
BattleAnimCmd_BeatUp: ; cc776 (33:4776) BattleAnimCmd_BeatUp: ; cc776 (33:4776)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, BANK(CurPartySpecies)
ld [rSVBK], a ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies ld a, [CurPartySpecies] ; CurPartySpecies
push af push af
@ -1254,7 +1254,7 @@ endr
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 1 ld a, BANK(EnemyMon) ; BattleMon is in WRAM0, but EnemyMon is in WRAMX
ld [rSVBK], a ld [rSVBK], a
ld a, [hBattleTurn] ld a, [hBattleTurn]
@ -1262,14 +1262,14 @@ endr
jr nz, .enemy jr nz, .enemy
ld a, $f0 ld a, $f0
ld [CryTracks], a ; CryTracks ld [CryTracks], a
ld a, [BattleMonSpecies] ; BattleMonSpecies ld a, [BattleMonSpecies]
jr .done_cry_tracks jr .done_cry_tracks
.enemy .enemy
ld a, $0f ld a, $0f
ld [CryTracks], a ; CryTracks ld [CryTracks], a
ld a, [EnemyMonSpecies] ; EnemyMon ld a, [EnemyMonSpecies]
.done_cry_tracks .done_cry_tracks
push hl push hl
@ -1431,7 +1431,7 @@ BattleAnim_SetBGPals: ; cc91a
ret z ret z
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
ld de, wBGPals1 ld de, wBGPals1
@ -1459,7 +1459,7 @@ BattleAnim_SetOBPals: ; cc94b
ret z ret z
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wOBPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, wOBPals2 palette PAL_BATTLE_OB_GRAY ld hl, wOBPals2 palette PAL_BATTLE_OB_GRAY
ld de, wOBPals1 palette PAL_BATTLE_OB_GRAY ld de, wOBPals1 palette PAL_BATTLE_OB_GRAY

View File

@ -2578,7 +2578,7 @@ BGEffects_LoadBGPal0_OBPal1: ; c8e52 (32:4e52)
ld h, a ld h, a
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld a, h ld a, h
push bc push bc
@ -2605,7 +2605,7 @@ BGEffects_LoadBGPal1_OBPal0: ; c8e7f (32:4e7f)
ld h, a ld h, a
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld a, h ld a, h
push bc push bc

View File

@ -428,9 +428,9 @@ GetBallAnimPal: ; cd249 (33:5249)
ld hl, BallColors ld hl, BallColors
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, BANK(CurItem)
ld [rSVBK], a ld [rSVBK], a
ld a, [CurItem] ; CurItem ld a, [CurItem]
ld e, a ld e, a
pop af pop af
ld [rSVBK], a ld [rSVBK], a

View File

@ -1649,7 +1649,7 @@ CardFlip_InitAttrPals: ; e0c37 (38:4c37)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, .palettes ld hl, .palettes
ld de, wBGPals1 ld de, wBGPals1

View File

@ -394,7 +394,7 @@ LoadStatsScreenPals:
add hl, bc add hl, bc
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld a, [hli] ld a, [hli]
ld [wBGPals1 palette 0], a ld [wBGPals1 palette 0], a
@ -504,7 +504,7 @@ GetPredefPal:
LoadHLPaletteIntoDE: LoadHLPaletteIntoDE:
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wOBPals1)
ld [rSVBK], a ld [rSVBK], a
ld c, $8 ld c, $8
.loop .loop
@ -520,7 +520,7 @@ LoadHLPaletteIntoDE:
LoadPalette_White_Col1_Col2_Black: LoadPalette_White_Col1_Col2_Black:
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld a, LOW(palred 31 + palgreen 31 + palblue 31) ld a, LOW(palred 31 + palgreen 31 + palblue 31)
@ -572,7 +572,7 @@ ResetBGPals:
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals1 ld hl, wBGPals1
@ -930,7 +930,7 @@ InitCGBPals::
jr nz, .obpals_loop jr nz, .obpals_loop
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals1 ld hl, wBGPals1
call .LoadWhitePals call .LoadWhitePals
@ -1251,7 +1251,7 @@ LoadMapPals:
; Switch to palettes WRAM bank ; Switch to palettes WRAM bank
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals1 ld hl, wBGPals1
ld b, 8 ld b, 8

View File

@ -13,7 +13,7 @@ Credits:: ; 109847
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wPals)
ld [rSVBK], a ld [rSVBK], a
call ClearBGPalettes call ClearBGPalettes

View File

@ -57,7 +57,7 @@ Copyright_GFPresents: ; e4579
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
ld hl, IntroLogoGFX ld hl, IntroLogoGFX
@ -319,7 +319,7 @@ GameFreakLogoScene4: ; e4776 (39:4776)
add hl, de add hl, de
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wOBPals2)
ld [rSVBK], a ld [rSVBK], a
ld a, [hli] ld a, [hli]
ld [wOBPals2 + 12], a ld [wOBPals2 + 12], a
@ -352,7 +352,7 @@ INCBIN "gfx/splash/logo2.1bpp"
CrystalIntro: ; e48ac CrystalIntro: ; e48ac
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 5 ld a, BANK(wPals)
ld [rSVBK], a ld [rSVBK], a
ld a, [hInMenu] ld a, [hInMenu]
push af push af
@ -480,7 +480,7 @@ IntroScene1: ; e495b (39:495b)
call Intro_DecompressRequest2bpp_64Tiles call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_365ad ld hl, Palette_365ad
ld de, wBGPals1 ld de, wBGPals1
@ -553,7 +553,7 @@ IntroScene3: ; e49fd (39:49fd)
call Intro_DecompressRequest2bpp_64Tiles call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_e5edd ld hl, Palette_e5edd
ld de, wBGPals1 ld de, wBGPals1
@ -619,7 +619,7 @@ IntroScene5: ; e4a7a (39:4a7a)
call Intro_DecompressRequest2bpp_64Tiles call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_365ad ld hl, Palette_365ad
ld de, wBGPals1 ld de, wBGPals1
@ -725,7 +725,7 @@ IntroScene7: ; e4b3f (39:4b3f)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_e5edd ld hl, Palette_e5edd
@ -884,7 +884,7 @@ IntroScene11: ; e4c86 (39:4c86)
call Intro_DecompressRequest2bpp_64Tiles call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_365ad ld hl, Palette_365ad
ld de, wBGPals1 ld de, wBGPals1
@ -1011,7 +1011,7 @@ IntroScene13: ; e4d6d (39:4d6d)
call Intro_DecompressRequest2bpp_64Tiles call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_e5edd ld hl, Palette_e5edd
ld de, wBGPals1 ld de, wBGPals1
@ -1120,7 +1120,7 @@ IntroScene15: ; e4e40 (39:4e40)
call Intro_LoadTilemap call Intro_LoadTilemap
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_e77dd ld hl, Palette_e77dd
ld de, wBGPals1 ld de, wBGPals1
@ -1194,7 +1194,7 @@ IntroScene17: ; e4ef5 (39:4ef5)
call Intro_DecompressRequest2bpp_64Tiles call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_e6d6d ld hl, Palette_e6d6d
ld de, wBGPals1 ld de, wBGPals1
@ -1268,7 +1268,7 @@ IntroScene19: ; e4f7e (39:4f7e)
call Intro_LoadTilemap call Intro_LoadTilemap
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_e77dd ld hl, Palette_e77dd
ld de, wBGPals1 ld de, wBGPals1
@ -1438,7 +1438,7 @@ IntroScene26: ; e50bb (39:50bb)
call Intro_DecompressRequest2bpp_64Tiles call Intro_DecompressRequest2bpp_64Tiles
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_e679d ld hl, Palette_e679d
ld de, wBGPals1 ld de, wBGPals1
@ -1526,7 +1526,7 @@ Intro_Scene24_ApplyPaletteFade: ; e5172 (39:5172)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
ld de, wBGPals2 ld de, wBGPals2
ld b, 8 ; number of BG pals ld b, 8 ; number of BG pals
@ -1617,7 +1617,7 @@ CrystalIntro_UnownFade: ; e5223 (39:5223)
ld b, $0 ld b, $0
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
push hl push hl
@ -1722,7 +1722,7 @@ Intro_Scene20_AppearUnown: ; e5348 (39:5348)
ld c, a ld c, a
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
push bc push bc
@ -1791,7 +1791,7 @@ endr
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
push hl push hl
@ -1846,7 +1846,7 @@ endr
Intro_LoadTilemap: ; e541b (39:541b) Intro_LoadTilemap: ; e541b (39:541b)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
ld hl, wDecompressScratch ld hl, wDecompressScratch
@ -1946,7 +1946,7 @@ Intro_SetCGBPalUpdate: ; e549e (39:549e)
Intro_ClearBGPals: ; e54a3 (39:54a3) Intro_ClearBGPals: ; e54a3 (39:54a3)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
@ -1965,7 +1965,7 @@ Intro_ClearBGPals: ; e54a3 (39:54a3)
Intro_DecompressRequest2bpp_128Tiles: ; e54c2 (39:54c2) Intro_DecompressRequest2bpp_128Tiles: ; e54c2 (39:54c2)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
push de push de
@ -1984,7 +1984,7 @@ Intro_DecompressRequest2bpp_128Tiles: ; e54c2 (39:54c2)
Intro_DecompressRequest2bpp_255Tiles: ; e54de (39:54de) Intro_DecompressRequest2bpp_255Tiles: ; e54de (39:54de)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
push de push de
@ -2003,7 +2003,7 @@ Intro_DecompressRequest2bpp_255Tiles: ; e54de (39:54de)
Intro_DecompressRequest2bpp_64Tiles: ; e54fa (39:54fa) Intro_DecompressRequest2bpp_64Tiles: ; e54fa (39:54fa)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
push de push de
@ -2022,7 +2022,7 @@ Intro_DecompressRequest2bpp_64Tiles: ; e54fa (39:54fa)
Intro_ResetLYOverrides: ; e5516 (39:5516) Intro_ResetLYOverrides: ; e5516 (39:5516)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(LYOverrides)
ld [rSVBK], a ld [rSVBK], a
ld hl, LYOverrides ld hl, LYOverrides
@ -2039,7 +2039,7 @@ Intro_ResetLYOverrides: ; e5516 (39:5516)
Intro_PerspectiveScrollBG: ; e552f (39:552f) Intro_PerspectiveScrollBG: ; e552f (39:552f)
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(LYOverrides)
ld [rSVBK], a ld [rSVBK], a
; Scroll the grass every frame. ; Scroll the grass every frame.
; Scroll the trees every other frame and at half speed. ; Scroll the trees every other frame and at half speed.

View File

@ -155,7 +155,7 @@ Function819a7: ; 819a7
ret z ret z
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
ld hl, Palette_819f4 ld hl, Palette_819f4
ld de, wBGPals2 ld de, wBGPals2
@ -436,7 +436,7 @@ Function81c33: ; 81c33
jr z, .asm_81c69 jr z, .asm_81c69
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
ld de, wc608 ld de, wc608
@ -1145,7 +1145,7 @@ Function82203: ; 82203
Function8220f: ; 8220f Function8220f: ; 8220f
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld a, [wcf64] ld a, [wcf64]
ld l, a ld l, a
@ -1198,7 +1198,7 @@ Function82236: ; 82236
call Function821d8 call Function821d8
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
ld a, [wcf64] ld a, [wcf64]
@ -1228,7 +1228,7 @@ Function82236: ; 82236
Function822a3: ; 822a3 Function822a3: ; 822a3
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
ld a, [wcf64] ld a, [wcf64]

View File

@ -143,7 +143,7 @@ Mobile_ReloadMapPart: ; 104099
.unreferenced_104101 .unreferenced_104101
ld a, $1 ld a, $1
ld [rVBK], a ld [rVBK], a
ld a, $3 ld a, BANK(w3_d800)
ld [rSVBK], a ld [rSVBK], a
ld hl, w3_d800 ld hl, w3_d800
call HDMATransferToWRAMBank3 call HDMATransferToWRAMBank3
@ -221,7 +221,7 @@ CallInSafeGFXMode: ; 104177
ld [hMapAnims], a ld [hMapAnims], a
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wScratchTileMap)
ld [rSVBK], a ld [rSVBK], a
ld a, [rVBK] ld a, [rVBK]
push af push af
@ -472,7 +472,7 @@ _Get2bpp:: ; 104284
; switch to WRAM bank 6 ; switch to WRAM bank 6
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wScratchTileMap)
ld [rSVBK], a ld [rSVBK], a
push bc push bc
@ -542,7 +542,7 @@ _Get1bpp:: ; 1042b2
.bankswitch ; 1042d6 .bankswitch ; 1042d6
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wScratchTileMap)
ld [rSVBK], a ld [rSVBK], a
push bc push bc

View File

@ -198,7 +198,7 @@ INCBIN "gfx/overworld/heal_machine.2bpp"
.go .go
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wOBPals2)
ld [rSVBK], a ld [rSVBK], a
ld hl, wOBPals2 palette PAL_OW_TREE ld hl, wOBPals2 palette PAL_OW_TREE

View File

@ -16,7 +16,7 @@ Special_MagnetTrain: ; 8cc04
ld h, a ld h, a
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wMagnetTrain)
ld [rSVBK], a ld [rSVBK], a
ld a, h ld a, h
@ -129,7 +129,7 @@ MagntTrain_LoadGFX_PlayMusic: ; 8ccc9
ld [hSCY], a ld [hSCY], a
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, BANK(wPlayerGender)
ld [rSVBK], a ld [rSVBK], a
farcall GetPlayerIcon farcall GetPlayerIcon
pop af pop af
@ -325,7 +325,7 @@ MagnetTrain_Jumptable: ; 8cdf7
ld b, SPRITE_ANIM_INDEX_MAGNET_TRAIN_RED ld b, SPRITE_ANIM_INDEX_MAGNET_TRAIN_RED
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, BANK(wPlayerGender)
ld [rSVBK], a ld [rSVBK], a
ld a, [wPlayerGender] ld a, [wPlayerGender]
bit 0, a bit 0, a
@ -429,7 +429,7 @@ MagnetTrain_Jumptable_FirstRunThrough: ; 8ceae
call DelayFrame call DelayFrame
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $1 ld a, BANK(wEnvironment)
ld [rSVBK], a ld [rSVBK], a
ld a, [TimeOfDayPal] ld a, [TimeOfDayPal]
push af push af

View File

@ -26,7 +26,7 @@ LoadPoisonBGPals: ; cbcdd
.cgb .cgb
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals2)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
ld c, 4 palettes ld c, 4 palettes

View File

@ -154,7 +154,7 @@ UnownPrinter: ; 16be4
.Load2bppToSRAM: ; 16cff .Load2bppToSRAM: ; 16cff
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
ld a, BANK(sScratch) ld a, BANK(sScratch)

View File

@ -13,7 +13,7 @@ GBCOnlyScreen: ; 4ea82
ld de, wd000 ld de, wd000
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 0 ld a, 0 ; this is tantamount to selecting Bank 1
ld [rSVBK], a ld [rSVBK], a
call Decompress call Decompress
pop af pop af

View File

@ -63,7 +63,7 @@ InitDisplayForRedCredits: ; 4e8c2
ResetDisplayBetweenHallOfFameMons: ; 4e906 ResetDisplayBetweenHallOfFameMons: ; 4e906
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
ld hl, wDecompressScratch ld hl, wDecompressScratch
ld bc, wScratchAttrMap - wDecompressScratch ld bc, wScratchAttrMap - wDecompressScratch

View File

@ -79,7 +79,7 @@ LoadFonts_NoOAMUpdate:: ; 64bf
HDMATransfer_FillBGMap0WithBlack: ; 64db HDMATransfer_FillBGMap0WithBlack: ; 64db
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
ld a, "<BLACK>" ; $60 ld a, "<BLACK>" ; $60

View File

@ -1019,7 +1019,7 @@ CrystalIntroSequence: ; 620b
StartTitleScreen: ; 6219 StartTitleScreen: ; 6219
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
call .TitleScreen call .TitleScreen

View File

@ -586,7 +586,7 @@ Place2DMenuCursor: ; 24329
_PushWindow:: ; 24374 _PushWindow:: ; 24374
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $7 ld a, BANK(wWindowStack)
ld [rSVBK], a ld [rSVBK], a
ld hl, wWindowStackPointer ld hl, wWindowStackPointer
@ -691,7 +691,7 @@ _ExitMenu:: ; 243e8
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $7 ld a, BANK(wWindowStack)
ld [rSVBK], a ld [rSVBK], a
call GetWindowStackTop call GetWindowStackTop

View File

@ -279,7 +279,7 @@ PokeAnim_StereoCry: ; d0196
PokeAnim_DeinitFrames: ; d01a9 PokeAnim_DeinitFrames: ; d01a9
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $2 ld a, BANK(wPokeAnimCoord)
ld [rSVBK], a ld [rSVBK], a
call PokeAnim_PlaceGraphic call PokeAnim_PlaceGraphic
farcall HDMATransferTileMapToWRAMBank3 farcall HDMATransferTileMapToWRAMBank3
@ -876,7 +876,7 @@ PokeAnim_PlaceGraphic: ; d04bd
PokeAnim_SetVBank1: ; d0504 PokeAnim_SetVBank1: ; d0504
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $2 ld a, BANK(wPokeAnimCoord)
ld [rSVBK], a ld [rSVBK], a
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a

View File

@ -2348,7 +2348,7 @@ Pokedex_BlackOutBG: ; 41401 (10:5401)
; Make BG palettes black so that the BG becomes all black. ; Make BG palettes black so that the BG becomes all black.
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals1 ld hl, wBGPals1
ld bc, 8 palettes ld bc, 8 palettes

View File

@ -47,8 +47,8 @@ _TimeOfDayPals:: ; 8c011
; save wram bank ; save wram bank
ld a, [rSVBK] ld a, [rSVBK]
ld b, a ld b, a
; wram bank 5
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
; push palette ; push palette
@ -78,8 +78,8 @@ _TimeOfDayPals:: ; 8c011
; save wram bank ; save wram bank
ld a, [rSVBK] ld a, [rSVBK]
ld d, a ld d, a
; wram bank 5
ld a, 5 ld a, BANK(wOBPals1)
ld [rSVBK], a ld [rSVBK], a
; pop palette ; pop palette
@ -173,7 +173,7 @@ Special_FadeBlackQuickly: ; 8c0b6
FillWhiteBGColor: ; 8c0c1 FillWhiteBGColor: ; 8c0c1
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, wBGPals1 ld hl, wBGPals1

View File

@ -139,7 +139,7 @@ _TitleScreen: ; 10ed67
ld a, [rSVBK] ld a, [rSVBK]
push af push af
; WRAM bank 5 ; WRAM bank 5
ld a, 5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
; Update palette colors ; Update palette colors

View File

@ -63,7 +63,7 @@ UnusedTitleScreen: ; 10c000
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $5 ld a, BANK(wBGPals1)
ld [rSVBK], a ld [rSVBK], a
ld hl, UnusedTitleBG_Palettes ld hl, UnusedTitleBG_Palettes

View File

@ -206,7 +206,7 @@ GetMonBackpic: ; 5116c
ld c, a ld c, a
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
push de push de
@ -327,7 +327,7 @@ GetTrainerPic: ; 5120d
call AddNTimes call AddNTimes
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
push de push de
ld a, BANK(TrainerPicPointers) ld a, BANK(TrainerPicPointers)
@ -358,7 +358,7 @@ DecompressPredef: ; 5125d
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
push de push de

View File

@ -16,7 +16,7 @@ GameTimer:: ; 209e
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 1 ld a, BANK(GameTime)
ld [rSVBK], a ld [rSVBK], a
call UpdateGameTimer call UpdateGameTimer

View File

@ -96,7 +96,7 @@ Init:: ; 17d
ld [hCGB], a ld [hCGB], a
call ClearWRAM call ClearWRAM
ld a, 1 ld a, BANK(wd000)
ld [rSVBK], a ld [rSVBK], a
call ClearVRAM call ClearVRAM
call ClearSprites call ClearSprites

View File

@ -1401,7 +1401,7 @@ LoadTilesetGFX:: ; 2821
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $6 ld a, BANK(wDecompressScratch)
ld [rSVBK], a ld [rSVBK], a
ld a, e ld a, e

View File

@ -499,7 +499,7 @@ ClearWindowData:: ; 1fbf
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, $7 ld a, BANK(wWindowStack)
ld [rSVBK], a ld [rSVBK], a
xor a xor a

View File

@ -466,7 +466,7 @@ AnimateTileset:: ; 17d3
ld a, [rSVBK] ld a, [rSVBK]
push af push af
ld a, 1 ld a, BANK(TilesetAnim)
ld [rSVBK], a ld [rSVBK], a
ld a, [rVBK] ld a, [rVBK]

View File

@ -2278,6 +2278,7 @@ StartSecond:: db ; d4b9
wRTC:: ds 8 ; d4ba wRTC:: ds 8 ; d4ba
wDST:: db ; d4c2 wDST:: db ; d4c2
GameTime::
GameTimeCap:: db ; d4c3 GameTimeCap:: db ; d4c3
GameTimeHours:: dw ; d4c4 GameTimeHours:: dw ; d4c4
GameTimeMinutes:: db ; d4c6 GameTimeMinutes:: db ; d4c6
@ -2879,6 +2880,7 @@ w3_dffc:: ds 4
SECTION "GBC Video", WRAMX SECTION "GBC Video", WRAMX
; eight 4-color palettes each ; eight 4-color palettes each
wPals::
wBGPals1:: ds 8 palettes ; d000 wBGPals1:: ds 8 palettes ; d000
wOBPals1:: ds 8 palettes ; d040 wOBPals1:: ds 8 palettes ; d040
wBGPals2:: ds 8 palettes ; d080 wBGPals2:: ds 8 palettes ; d080
@ -2889,6 +2891,7 @@ LYOverridesEnd:: ; d190
ds 1 ds 1
wMagnetTrain::
wMagnetTrainDirection:: db wMagnetTrainDirection:: db
wMagnetTrainInitPosition:: db wMagnetTrainInitPosition:: db
wMagnetTrainHoldPosition:: db wMagnetTrainHoldPosition:: db