This commit is contained in:
yenatch 2015-01-19 21:31:29 -08:00
parent 1aa28c7712
commit 3fe3cd1a46
5 changed files with 185 additions and 283 deletions

View File

@ -35,7 +35,7 @@ _PlayBattleAnim: ; cc0e4
ld c, 3 ld c, 3
.asm_cc0ff .asm_cc0ff
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
@ -43,7 +43,7 @@ _PlayBattleAnim: ; cc0e4
call Functioncc11c call Functioncc11c
pop af pop af
ld [$ff9e], a ld [hVBlank], a
ld a, $1 ld a, $1
ld [hBGMapMode], a ld [hBGMapMode], a

View File

@ -188,10 +188,10 @@ Function109847:: ; 109847
call GetCreditsPalette call GetCreditsPalette
call Function32f9 call Function32f9
ld a, [$ff9e] ld a, [hVBlank]
push af push af
ld a, $5 ld a, $5
ld [$ff9e], a ld [hVBlank], a
ld a, $1 ld a, $1
ld [$ffaa], a ld [$ffaa], a
xor a xor a
@ -215,7 +215,7 @@ Function109847:: ; 109847
ld [hLCDStatCustom], a ld [hLCDStatCustom], a
ld [hBGMapAddress], a ld [hBGMapAddress], a
pop af pop af
ld [$ff9e], a ld [hVBlank], a
pop af pop af
ld [rSVBK], a ld [rSVBK], a
ret ret

View File

@ -12,27 +12,23 @@ VBlank:: ; 283
push bc push bc
push de push de
push hl push hl
; get vblank type ld a, [hVBlank]
ld a, [$ff9e] and 7
and $7
; get fn pointer
ld e, a ld e, a
ld d, $0 ld d, 0
ld hl, .VBlanks ld hl, .VBlanks
add hl, de add hl, de
add hl, de add hl, de
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
; down to business
call _hl_ call _hl_
; since this is called once per frame
call GameTimer call GameTimer
pop hl pop hl
pop de pop de
pop bc pop bc
@ -41,14 +37,14 @@ VBlank:: ; 283
; 2a1 ; 2a1
.VBlanks ; 2a1 .VBlanks ; 2a1
dw VBlank0 ; 0 dw VBlank0
dw VBlank1 ; 1 dw VBlank1
dw VBlank2 ; 2 dw VBlank2
dw VBlank3 ; 3 dw VBlank3
dw VBlank4 ; 4 dw VBlank4
dw VBlank5 ; 5 dw VBlank5
dw VBlank6 ; 6 dw VBlank6
dw VBlank0 ; 7 dw VBlank0 ; just in case
; 2b1 ; 2b1
@ -66,117 +62,91 @@ VBlank0:: ; 2b1
; joypad ; joypad
; sound ; sound
; inc frame counter ; inc frame counter
ld hl, $ff9b ld hl, $ff9b
inc [hl] inc [hl]
; advance rng ; advance random variables
ld a, [rDIV] ld a, [rDIV]
ld b, a ld b, a
ld a, [hRandomAdd] ld a, [hRandomAdd]
adc b adc b
ld [hRandomAdd], a ld [hRandomAdd], a
ld a, [rDIV] ld a, [rDIV]
ld b, a ld b, a
ld a, [hRandomSub] ld a, [hRandomSub]
sbc b sbc b
ld [hRandomSub], a ld [hRandomSub], a
; save bank ld a, [hROMBank]
ld a, [hROMBank] ; current bank ld [hROMBankBackup], a
ld [$ff8a], a
; scroll x
ld a, [hSCX] ld a, [hSCX]
ld [rSCX], a ld [rSCX], a
; scroll y
ld a, [hSCY] ld a, [hSCY]
ld [rSCY], a ld [rSCY], a
; window y
ld a, [hWY] ld a, [hWY]
ld [rWY], a ld [rWY], a
; window x + 7
ld a, [hWX] ld a, [hWX]
ld [rWX], a ld [rWX], a
; some time management is in order ; There's only time to call one of these in one vblank.
; only have time for one of these during vblank ; Calls are in order of priority.
; bg map buffer has priority
call UpdateBGMapBuffer call UpdateBGMapBuffer
jr c, .doneframeaction jr c, .done
; then pals
call UpdatePalsIfCGB call UpdatePalsIfCGB
jr c, .doneframeaction jr c, .done
; dma transfer
call DMATransfer call DMATransfer
jr c, .doneframeaction jr c, .done
; bg map
call UpdateBGMap call UpdateBGMap
; these have their own timing checks ; These have their own timing checks.
call Serve2bppRequest call Serve2bppRequest
call Serve1bppRequest call Serve1bppRequest
call AnimateTileset call AnimateTileset
.doneframeaction .done
; oam update off?
ld a, [hOAMUpdate] ld a, [hOAMUpdate]
and a and a
jr nz, .vblankoccurred jr nz, .done_oam
; update oam by dma transfer
call hPushOAM call hPushOAM
; @PushOAM: .done_oam
; ld a, Sprites >> 8
; ld [rDMA], a
; ld a, $28
; .loop
; dec a
; jr nz, .loop
; ret
; vblank-sensitive operations are done ; vblank-sensitive operations are done
.vblankoccurred
; tell other fns vblank happened
xor a xor a
ld [VBlankOccurred], a ld [VBlankOccurred], a
; dec OverworldDelay until 0
ld a, [OverworldDelay] ld a, [OverworldDelay]
and a and a
jr z, .textdelay jr z, .ok
dec a dec a
ld [OverworldDelay], a ld [OverworldDelay], a
.ok
.textdelay
; dec text delay counter until 0
ld a, [TextDelayFrames] ld a, [TextDelayFrames]
and a and a
jr z, .joypad jr z, .ok2
dec a dec a
ld [TextDelayFrames], a ld [TextDelayFrames], a
.ok2
.joypad
call Joypad call Joypad
; update sound
ld a, BANK(_UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch
call _UpdateSound call _UpdateSound
ld a, [$ff8a] ld a, [hROMBankBackup]
rst Bankswitch ; restore bank rst Bankswitch
;
ld a, [hSeconds] ld a, [hSeconds]
ld [$ffe3], a ld [$ffe3], a
ret ret
; 325 ; 325
@ -184,20 +154,16 @@ VBlank0:: ; 2b1
VBlank2:: ; 325 VBlank2:: ; 325
; sound only ; sound only
; save bank
ld a, [hROMBank] ld a, [hROMBank]
ld [$ff8a], a ld [hROMBankBackup], a
; update sound
ld a, BANK(_UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch
call _UpdateSound
; restore bank
ld a, [$ff8a]
rst Bankswitch rst Bankswitch
call _UpdateSound
; tell other fns vblank happened
ld a, [hROMBankBackup]
rst Bankswitch
xor a xor a
ld [VBlankOccurred], a ld [VBlankOccurred], a
ret ret
@ -212,77 +178,60 @@ VBlank1:: ; 337
; oam ; oam
; sound / lcd stat ; sound / lcd stat
; save bank
ld a, [hROMBank] ld a, [hROMBank]
ld [$ff8a], a ld [hROMBankBackup], a
; scroll x
ld a, [hSCX] ld a, [hSCX]
ld [rSCX], a ld [rSCX], a
; scroll y
ld a, [hSCY] ld a, [hSCY]
ld [rSCY], a ld [rSCY], a
; time-sensitive fns
call UpdatePals call UpdatePals
jr c, .vblankoccurred jr c, .done
; these have their own timing checks
call UpdateBGMap call UpdateBGMap
call Serve2bppRequest@VBlank call Serve2bppRequest@VBlank
; update oam by dma transfer
call hPushOAM call hPushOAM
; @PushOAM: .done
; ld a, Sprites >> 8
; ld [rDMA], a
; ld a, $28
; .loop
; dec a
; jr nz, .loop
; ret
.vblankoccurred
; tell other fns vblank happened
xor a xor a
ld [VBlankOccurred], a ld [VBlankOccurred], a
; get requested ints ; get requested ints
ld a, [rIF] ld a, [rIF]
ld b, a ld b, a
; discard requested ints ; discard requested ints
xor a xor a
ld [rIF], a ld [rIF], a
; enable lcd stat ; enable lcd stat
ld a, %10 ; lcd stat ld a, %10 ; lcd stat
ld [rIE], a ld [rIE], a
; rerequest serial int if applicable (still disabled) ; rerequest serial int if applicable (still disabled)
; request lcd stat ; request lcd stat
ld a, b ld a, b
and %1000 ; serial and %1000 ; serial
or %10 ; lcd stat or %10 ; lcd stat
ld [rIF], a ld [rIF], a
ei ei
; update sound
ld a, BANK(_UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch
call _UpdateSound call _UpdateSound
; restore bank ld a, [hROMBankBackup]
ld a, [$ff8a]
rst Bankswitch rst Bankswitch
di di
; get requested ints ; get requested ints
ld a, [rIF] ld a, [rIF]
ld b, a ld b, a
; discard requested ints ; discard requested ints
xor a xor a
ld [rIF], a ld [rIF], a
; enable ints besides joypad ; enable ints besides joypad
ld a, %1111 ; serial timer lcdstat vblank ld a, %1111 ; serial timer lcdstat vblank
ld [rIE], a ld [rIE], a
; rerequest ints ; rerequest ints
ld a, b ld a, b
ld [rIF], a ld [rIF], a
ret ret
@ -292,21 +241,18 @@ VBlank1:: ; 337
UpdatePals:: ; 37f UpdatePals:: ; 37f
; update pals for either dmg or cgb ; update pals for either dmg or cgb
; check cgb
ld a, [hCGB] ld a, [hCGB]
and a and a
jp nz, UpdateCGBPals jp nz, UpdateCGBPals
; update gb pals ; update gb pals
ld a, [$cfc7] ld a, [$cfc7]
ld [rBGP], a ld [rBGP], a
ld a, [$cfc8] ld a, [$cfc8]
ld [rOBP0], a ld [rOBP0], a
ld a, [$cfc9] ld a, [$cfc9]
ld [rOBP1], a ld [rOBP1], a
and a and a
ret ret
; 396 ; 396
@ -320,77 +266,58 @@ VBlank3:: ; 396
; oam ; oam
; sound / lcd stat ; sound / lcd stat
; save bank
ld a, [hROMBank] ld a, [hROMBank]
ld [$ff8a], a ld [hROMBankBackup], a
; scroll x
ld a, [hSCX] ld a, [hSCX]
ld [rSCX], a ld [rSCX], a
; scroll y
ld a, [hSCY] ld a, [hSCY]
ld [rSCY], a ld [rSCY], a
; any pals to update?
ld a, [hCGBPalUpdate] ld a, [hCGBPalUpdate]
and a and a
call nz, ForceUpdateCGBPals call nz, ForceUpdateCGBPals
jr c, .vblankoccurred jr c, .done
; else
call UpdateBGMap call UpdateBGMap
call Serve2bppRequest@VBlank call Serve2bppRequest@VBlank
; update oam by dma transfer
call hPushOAM call hPushOAM
; @PushOAM: .done
; ld a, Sprites >> 8
; ld [rDMA], a
; ld a, $28
; .loop
; dec a
; jr nz, .loop
; ret
.vblankoccurred
; tell other fns vblank happened
xor a xor a
ld [VBlankOccurred], a ld [VBlankOccurred], a
; save int flag
ld a, [rIF] ld a, [rIF]
push af push af
; reset ints
xor a xor a
ld [rIF], a ld [rIF], a
; force lcdstat int during sound update
ld a, %10 ; lcd stat ld a, %10 ; lcd stat
ld [rIE], a ld [rIE], a
ld [rIF], a ld [rIF], a
ei ei
; update sound
ld a, BANK(_UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch
call _UpdateSound call _UpdateSound
; restore bank ld a, [hROMBankBackup]
ld a, [$ff8a]
rst Bankswitch rst Bankswitch
di di
; request lcdstat ; request lcdstat
ld a, [rIF] ld a, [rIF]
ld b, a ld b, a
; and any other ints ; and any other ints
pop af pop af
or b or b
ld b, a ld b, a
; reset ints ; reset ints
xor a xor a
ld [rIF], a ld [rIF], a
; enable ints besides joypad ; enable ints besides joypad
ld a, %1111 ; serial timer lcdstat vblank ld a, %1111 ; serial timer lcdstat vblank
ld [rIE], a ld [rIE], a
; request ints ; request ints
ld a, b ld a, b
ld [rIF], a ld [rIF], a
ret ret
@ -405,40 +332,26 @@ VBlank4:: ; 3df
; serial ; serial
; sound ; sound
; save bank
ld a, [hROMBank] ld a, [hROMBank]
ld [$ff8a], a ld [hROMBankBackup], a
call UpdateBGMap call UpdateBGMap
call Serve2bppRequest call Serve2bppRequest
; update oam by dma transfer
call hPushOAM call hPushOAM
; @PushOAM:
; ld a, Sprites >> 8
; ld [rDMA], a
; ld a, $28
; .loop
; dec a
; jr nz, .loop
; ret
; update joypad
call Joypad call Joypad
; tell other fns vblank happened
xor a xor a
ld [VBlankOccurred], a ld [VBlankOccurred], a
; handshake
call AskSerial call AskSerial
; update sound
ld a, BANK(_UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch
call _UpdateSound call _UpdateSound
; restore bank
ld a, [$ff8a] ld a, [hROMBankBackup]
rst Bankswitch rst Bankswitch
ret ret
; 400 ; 400
@ -452,52 +365,42 @@ VBlank5:: ; 400
; joypad ; joypad
; ;
; save bank
ld a, [hROMBank] ld a, [hROMBank]
ld [$ff8a], a ld [hROMBankBackup], a
; scroll x
ld a, [hSCX] ld a, [hSCX]
ld [rSCX], a ld [rSCX], a
; if we can update pals, skip this part
call UpdatePalsIfCGB call UpdatePalsIfCGB
jr c, .vblankoccurred jr c, .done
call UpdateBGMap call UpdateBGMap
call Serve2bppRequest call Serve2bppRequest
.done
.vblankoccurred
; tell other fns vblank happened
xor a xor a
ld [VBlankOccurred], a ld [VBlankOccurred], a
; joypad
call Joypad call Joypad
; discard requested ints
xor a xor a
ld [rIF], a ld [rIF], a
; enable lcd stat
ld a, %10 ; lcd stat ld a, %10 ; lcd stat
ld [rIE], a ld [rIE], a
; request lcd stat ; request lcd stat
ld [rIF], a ld [rIF], a
ei ei
; update sound
ld a, BANK(_UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch
call _UpdateSound call _UpdateSound
; restore bank ld a, [hROMBankBackup]
ld a, [$ff8a]
rst Bankswitch rst Bankswitch
di di
; discard requested ints
xor a xor a
ld [rIF], a ld [rIF], a
; enable ints besides joypad ; enable ints besides joypad
ld a, %1111 ; serial timer lcdstat vblank ld a, %1111 ; serial timer lcdstat vblank
ld [rIE], a ld [rIE], a
ret ret
@ -510,32 +413,29 @@ VBlank6:: ; 436
; dma transfer ; dma transfer
; sound ; sound
; save bank
ld a, [hROMBank] ld a, [hROMBank]
ld [$ff8a], a ld [hROMBankBackup], a
; inc frame counter ; inc frame counter
ld hl, $ff9b ld hl, $ff9b
inc [hl] inc [hl]
call UpdateCGBPals call UpdateCGBPals
jr c, .vblankoccurred jr c, .done
call Serve2bppRequest call Serve2bppRequest
call Serve1bppRequest call Serve1bppRequest
call DMATransfer call DMATransfer
.done
.vblankoccurred
; tell other fns vblank happened
xor a xor a
ld [VBlankOccurred], a ld [VBlankOccurred], a
; update sound
ld a, BANK(_UpdateSound) ld a, BANK(_UpdateSound)
rst Bankswitch ; bankswitch rst Bankswitch
call _UpdateSound call _UpdateSound
; restore bank
ld a, [$ff8a] ld a, [hROMBankBackup]
rst Bankswitch rst Bankswitch
ret ret
; 45a ; 45a

View File

@ -1,5 +1,6 @@
hPushOAM EQU $ff80 hPushOAM EQU $ff80
hROMBankBackup EQU $ff8a
hBuffer EQU $ff8b hBuffer EQU $ff8b
hRTCDayHi EQU $ff8d hRTCDayHi EQU $ff8d
@ -15,6 +16,7 @@ hMinutes EQU $ff96
hSeconds EQU $ff98 hSeconds EQU $ff98
hROMBank EQU $ff9d hROMBank EQU $ff9d
hVBlank EQU $ff9e
hJoypadReleased EQU $ffa2 hJoypadReleased EQU $ffa2
hJoypadPressed EQU $ffa3 hJoypadPressed EQU $ffa3

View File

@ -36515,7 +36515,7 @@ Function283b2: ; 283b2
xor a xor a
ld [hld], a ld [hld], a
ld [hl], a ld [hl], a
ld [$ff9e], a ld [hVBlank], a
push de push de
hlcoord 0, 12 hlcoord 0, 12
ld b, $4 ld b, $4
@ -39695,7 +39695,7 @@ Function29c7b: ; 29c7b
ld c, $28 ld c, $28
call DelayFrames call DelayFrames
xor a xor a
ld [$ff9e], a ld [hVBlank], a
inc a inc a
ld [InLinkBattle], a ld [InLinkBattle], a
ret ret
@ -39744,7 +39744,7 @@ Function29c92: ; 29c92
xor a xor a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld [$ff9e], a ld [hVBlank], a
ld [InLinkBattle], a ld [InLinkBattle], a
ret ret
; 29ce8 ; 29ce8
@ -39860,12 +39860,12 @@ Function29d92: ; 29d92
ld [hl], a ld [hl], a
call WaitBGMap call WaitBGMap
ld a, $2 ld a, $2
ld [$ff9e], a ld [hVBlank], a
call DelayFrame call DelayFrame
call DelayFrame call DelayFrame
call Function29e0c call Function29e0c
xor a xor a
ld [$ff9e], a ld [hVBlank], a
ld a, [ScriptVar] ld a, [ScriptVar]
and a and a
ret nz ret nz
@ -39882,7 +39882,7 @@ Function29dba: ; 29dba
ld [hl], a ld [hl], a
call WaitBGMap call WaitBGMap
ld a, $2 ld a, $2
ld [$ff9e], a ld [hVBlank], a
call DelayFrame call DelayFrame
call DelayFrame call DelayFrame
call Function29e0c call Function29e0c
@ -39916,7 +39916,7 @@ Function29dba: ; 29dba
.asm_29e08 .asm_29e08
xor a xor a
ld [$ff9e], a ld [hVBlank], a
ret ret
; 29e0c ; 29e0c
@ -40019,7 +40019,7 @@ Function29e82: ; 29e82
inc a inc a
ld [InLinkBattle], a ld [InLinkBattle], a
xor a xor a
ld [$ff9e], a ld [hVBlank], a
ld a, $1 ld a, $1
ld [ScriptVar], a ld [ScriptVar], a
ret ret
@ -40037,7 +40037,7 @@ Function29eaf: ; 29eaf
callab Function28000 callab Function28000
call Function2ee4 call Function2ee4
xor a xor a
ld [$ff9e], a ld [hVBlank], a
ret ret
; 29ec4 ; 29ec4
@ -40048,7 +40048,7 @@ Function29ec4: ; 29ec4
callab Function28000 callab Function28000
call Function2ee4 call Function2ee4
xor a xor a
ld [$ff9e], a ld [hVBlank], a
ret ret
; 29ed9 ; 29ed9
@ -40059,7 +40059,7 @@ Function29ed9: ; 29ed9
callab Function28000 callab Function28000
call Function2ee4 call Function2ee4
xor a xor a
ld [$ff9e], a ld [hVBlank], a
ret ret
; 29eee ; 29eee
@ -40096,7 +40096,7 @@ Function29f17: ; 29f17
ld [$cf56], a ld [$cf56], a
ld [$cf57], a ld [$cf57], a
ld a, $2 ld a, $2
ld [$ff9e], a ld [hVBlank], a
call DelayFrame call DelayFrame
call DelayFrame call DelayFrame
.asm_29f29 .asm_29f29
@ -40114,7 +40114,7 @@ Function29f17: ; 29f17
.asm_29f40 .asm_29f40
xor a xor a
ld [$ff9e], a ld [hVBlank], a
ld a, b ld a, b
and $f and $f
ret ret
@ -64171,7 +64171,7 @@ Function8442c: ; 8442c
ld a, $e4 ld a, $e4
call DmgToCgbBGPals call DmgToCgbBGPals
call DelayFrame call DelayFrame
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $4 ld [hl], $4
@ -64196,7 +64196,7 @@ Function8442c: ; 8442c
.asm_8449d .asm_8449d
pop af pop af
ld [$ff9e], a ld [hVBlank], a
call Function84411 call Function84411
xor a xor a
ld [rIF], a ld [rIF], a
@ -64237,7 +64237,7 @@ Function844bc: ; 844bc (21:44bc)
ld [rIF], a ; $ff00+$f ld [rIF], a ; $ff00+$f
ld a, $9 ld a, $9
ld [rIE], a ; $ff00+$ff ld [rIE], a ; $ff00+$ff
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $4 ld [hl], $4
@ -64279,7 +64279,7 @@ Function844bc: ; 844bc (21:44bc)
call Function84559 call Function84559
.asm_84545 .asm_84545
pop af pop af
ld [$ff9e], a ld [hVBlank], a
call Function84411 call Function84411
xor a xor a
ld [rIF], a ; $ff00+$f ld [rIF], a ; $ff00+$f
@ -64307,7 +64307,7 @@ Function84560: ; 84560
ld [rIF], a ld [rIF], a
ld a, $9 ld a, $9
ld [rIE], a ld [rIE], a
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $4 ld [hl], $4
@ -64343,7 +64343,7 @@ Function84560: ; 84560
.asm_845c0 .asm_845c0
pop af pop af
ld [$ff9e], a ld [hVBlank], a
call Function84411 call Function84411
call Function30b4 call Function30b4
xor a xor a
@ -64377,7 +64377,7 @@ Function845db: ; 845db
ld [hBGMapMode], a ld [hBGMapMode], a
ld a, $13 ld a, $13
call Function84419 call Function84419
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $4 ld [hl], $4
@ -64385,7 +64385,7 @@ Function845db: ; 845db
ld [$cf65], a ld [$cf65], a
call Function843f0 call Function843f0
pop af pop af
ld [$ff9e], a ld [hVBlank], a
call Function84411 call Function84411
call Function84735 call Function84735
xor a xor a
@ -64414,7 +64414,7 @@ Function8461a: ; 8461a
callba Function1dc381 callba Function1dc381
ld a, $10 ld a, $10
call Function84419 call Function84419
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $4 ld [hl], $4
@ -64438,7 +64438,7 @@ Function8461a: ; 8461a
.asm_84671 .asm_84671
pop af pop af
ld [$ff9e], a ld [hVBlank], a
call Function84411 call Function84411
call Function84735 call Function84735
xor a xor a
@ -64464,7 +64464,7 @@ Function84688: ; 84688
ld [rIF], a ld [rIF], a
ld a, $9 ld a, $9
ld [rIE], a ld [rIE], a
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $4 ld [hl], $4
@ -64492,7 +64492,7 @@ Function84688: ; 84688
.asm_846e2 .asm_846e2
pop af pop af
ld [$ff9e], a ld [hVBlank], a
call Function84411 call Function84411
xor a xor a
ld [rIF], a ld [rIF], a
@ -73282,7 +73282,7 @@ Function8c20f: ; 8c20f
ld a, [rOBP1] ld a, [rOBP1]
ld [$cfc9], a ld [$cfc9], a
call DelayFrame call DelayFrame
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $1 ld [hl], $1
@ -73317,7 +73317,7 @@ Function8c20f: ; 8c20f
ld a, $1 ld a, $1
ld [rSVBK], a ld [rSVBK], a
pop af pop af
ld [$ff9e], a ld [hVBlank], a
call DelayFrame call DelayFrame
ret ret
; 8c26d ; 8c26d
@ -74572,7 +74572,7 @@ Function8cc04: ; 8cc04
ld a, [hSCY] ld a, [hSCY]
push af push af
call Function8ccc9 call Function8ccc9
ld hl, $ff9e ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $1 ld [hl], $1
@ -74595,7 +74595,7 @@ Function8cc04: ; 8cc04
.asm_8cc6b .asm_8cc6b
pop af pop af
ld [$ff9e], a ld [hVBlank], a
call WhiteBGMap call WhiteBGMap
xor a xor a
ld [hLCDStatCustom], a ld [hLCDStatCustom], a
@ -96304,7 +96304,7 @@ Functione48ac: ; e48ac
ld [rSVBK], a ld [rSVBK], a
ld a, [$ffaa] ld a, [$ffaa]
push af push af
ld a, [$ff9e] ld a, [hVBlank]
push af push af
call Functione4901 call Functione4901
@ -96337,7 +96337,7 @@ Functione48bc: ; e48bc
ld a, $90 ld a, $90
ld [hWY], a ld [hWY], a
pop af pop af
ld [$ff9e], a ld [hVBlank], a
pop af pop af
ld [$ffaa], a ld [$ffaa], a
pop af pop af
@ -96347,7 +96347,7 @@ Functione48bc: ; e48bc
Functione4901: ; e4901 Functione4901: ; e4901
xor a xor a
ld [$ff9e], a ld [hVBlank], a
ld a, $1 ld a, $1
ld [$ffaa], a ld [$ffaa], a
xor a xor a
@ -100510,7 +100510,7 @@ Function1000a4: ; 1000a4
ld [$ffc9], a ld [$ffc9], a
ld [$ffe9], a ld [$ffe9], a
xor a xor a
ld [$ff9e], a ld [hVBlank], a
call NormalSpeed call NormalSpeed
xor a xor a
ld [rIF], a ld [rIF], a
@ -101857,20 +101857,20 @@ Function1008a6: ; 1008a6
Function1008e0: ; 1008e0 Function1008e0: ; 1008e0
ld a, [hBGMapMode] ld a, [hBGMapMode]
ld b, a ld b, a
ld a, [$ff9e] ld a, [hVBlank]
ld c, a ld c, a
push bc push bc
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
ld a, $3 ld a, $3
ld [$ff9e], a ld [hVBlank], a
call Function100970 call Function100970
call Function100902 call Function100902
call Function100989 call Function100989
call DelayFrame call DelayFrame
pop bc pop bc
ld a, c ld a, c
ld [$ff9e], a ld [hVBlank], a
ld a, b ld a, b
ld [hBGMapMode], a ld [hBGMapMode], a
ret ret
@ -114136,7 +114136,7 @@ Function118452: ; 118452
xor a xor a
ld [$ffc9], a ld [$ffc9], a
ld [$ffe9], a ld [$ffe9], a
ld [$ff9e], a ld [hVBlank], a
call NormalSpeed call NormalSpeed
xor a xor a
ld [rIF], a ld [rIF], a