Skip to content

Commit

Permalink
Identify some VBlank functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroDeoxys committed Feb 11, 2024
1 parent c921df9 commit ded830c
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 93 deletions.
2 changes: 1 addition & 1 deletion src/engine/bank2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@ ENDR
ldh [rSVBK], a
ret

VBlank_b672:
VBlank_Level:
ld hl, .Func
ld de, wVBlankFunc
ld b, .end - .Func
Expand Down
22 changes: 11 additions & 11 deletions src/engine/bank20.asm
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ OverworldStateTable:
dw Func_80e33

dw FadeBGToWhite_Normal
dw Func_80e45 ; SST_OVERWORLD_20
dw GolfBuilding ; SST_OVERWORLD_20
dw DarkenBGToPal_Normal
dw Func_80e55

Expand Down Expand Up @@ -1053,7 +1053,7 @@ Func_8055f:
ld a, $02
ldh [rSVBK], a
call ClearVirtualOAM
call VBlank_80bf9
call VBlank_Overworld

call Func_80b29
call GetNextTreasureToCollect
Expand Down Expand Up @@ -1666,7 +1666,7 @@ Func_80bd9:
ld d, h
jr .loop_outer

VBlank_80bf9:
VBlank_Overworld:
ld hl, .Func
ld de, wVBlankFunc
ld b, .end - .Func
Expand Down Expand Up @@ -1992,8 +1992,8 @@ Func_80e33:
ld [wSubState], a
ret

Func_80e45:
farcall Func_ad9b2
GolfBuilding:
farcall _GolfBuilding
ret

Func_80e55:
Expand Down Expand Up @@ -2077,7 +2077,7 @@ Func_80f0d:
and a
ret nz
di
call VBlank_80bf9
call VBlank_Overworld
ei
ret

Expand Down Expand Up @@ -4689,7 +4689,7 @@ Func_81dce:
ld a, $80
ld [w2d065], a
.asm_81dfd
call Func_81e16
call .Func_81e16
ld a, [wCutscene]
inc a
cp NUM_CUTSCENES + 1
Expand All @@ -4704,7 +4704,7 @@ Func_81dce:
ld [wLastTransitionParam], a ; = 0
ret

Func_81e16:
.Func_81e16:
ld a, [wCutscene]
call GetCutsceneOWParams
ret z
Expand All @@ -4714,15 +4714,15 @@ Func_81e16:
ld a, [wCurMapSide]
cp b
jr nz, .same_side
call Func_81e36
call .Func_81e36
.same_side
ld hl, wCutsceneOWParamsPtr
call GetByteFromPointerInHL
call GetCutsceneOWParams_GotPtr
ret z
jr .loop

Func_81e36:
.Func_81e36:
ld a, [wOWCutsceneAction]
jumptable

Expand Down Expand Up @@ -5643,7 +5643,7 @@ UpdateTopBar:
jr nz, .still_transitioning

di
call VBlank_80bf9
call VBlank_Overworld
ei

ld a, TOPBARST_INPUT
Expand Down
4 changes: 2 additions & 2 deletions src/engine/bank26.asm
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ _InitTreasureCollection:

ld a, $02
ldh [rSVBK], a
call VBlank_9a564
call VBlank_TreasureCollection
call Func_9a54e
call Func_9a559
xor a
Expand Down Expand Up @@ -507,7 +507,7 @@ Func_9a559:
call WriteAToHL_BCTimes
ret

VBlank_9a564:
VBlank_TreasureCollection:
ld hl, .Func
ld de, wVBlankFunc
ld b, .end - .Func
Expand Down
14 changes: 7 additions & 7 deletions src/engine/bank2b.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@ _InitTempleScene:
ldh [rSCY], a
ld [wSCY], a

call VBlank_accb0
call VBlank_PrologueEpilogue
call ClearGeneralSceneRAM
call ClearSceneObjsRAM

Expand Down Expand Up @@ -1860,7 +1860,7 @@ ClearSceneObjsRAM:
call WriteAToHL_BCTimes
ret

VBlank_accb0:
VBlank_PrologueEpilogue:
ld hl, .Func
ld de, wVBlankFunc
ld b, .end - .Func
Expand Down Expand Up @@ -3808,7 +3808,7 @@ Data_ad939:
db 0, 0
db $80

Func_ad9b2:
_GolfBuilding:
call DisableLCD
call FillBGMap0_With7f
call ClearVirtualOAM
Expand All @@ -3822,7 +3822,7 @@ Func_ad9b2:
ld [wSCX], a
ldh [rSCY], a
ld [wSCY], a
call .VBlank_adaac
call .VBlank_GolfBuilding

call ClearGeneralSceneRAM
call ClearSceneObjsRAM
Expand Down Expand Up @@ -3908,7 +3908,7 @@ Func_ad9b2:
inc [hl]
ret

.VBlank_adaac:
.VBlank_GolfBuilding:
ld hl, .func
ld de, wVBlankFunc
ld b, .func_end - .func
Expand Down Expand Up @@ -4450,7 +4450,7 @@ Pals_ade09:
_InitPrologueSequence:
call ClearGeneralSceneRAM
call ClearSceneObjsRAM
call VBlank_accb0
call VBlank_PrologueEpilogue

decompress_vram1 BGMap_b34c3, v1BGMap1
decompress_vram0 BGMap_b330c, v0BGMap1
Expand Down Expand Up @@ -6771,7 +6771,7 @@ _InitEpilogue:
ldh [rSCY], a
ld [wSCY], a

call VBlank_accb0
call VBlank_PrologueEpilogue
call ClearGeneralSceneRAM
call ClearSceneObjsRAM

Expand Down
124 changes: 62 additions & 62 deletions src/engine/bank2d.asm
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ Func_b4014:
jumptable

dw Func_b4001
dw Func_b403e
dw Func_b408e
dw Func_b409c
dw Func_b40c0
dw Func_b40d9
dw Func_b40ff
dw Func_b4140
dw Func_b4140
dw Func_b4141
dw Func_b4162
dw Func_b4166
dw Func_b416a
dw Func_b416e
dw Func_b4172
dw Func_b4176
dw Func_b417a
dw Func_b4247
dw Func_b42e7
dw Func_b403e ; NOWFUNC_CUT_TREE
dw Func_b408e ; NOWFUNC_OPEN_GATE
dw Func_b409c ; NOWFUNC_GARLIC
dw Func_b40c0 ; NOWFUNC_MAGIC_SEED
dw Func_b40d9 ; NOWFUNC_SUMMON_SNAKE
dw Func_b40ff ; NOWFUNC_FALL_LEAVES
dw Func_b4140 ; NOWFUNC_BLUE_MUSIC_BOX
dw Func_b4140 ; NOWFUNC_GOLD_MUSIC_BOX
dw Func_b4141 ; NOWFUNC_CRAYON_RED
dw Func_b4162 ; NOWFUNC_CRAYON_BROWN
dw Func_b4166 ; NOWFUNC_CRAYON_YELLOW
dw Func_b416a ; NOWFUNC_CRAYON_GREEN
dw Func_b416e ; NOWFUNC_CRAYON_CYAN
dw Func_b4172 ; NOWFUNC_CRAYON_BLUE
dw Func_b4176 ; NOWFUNC_CRAYON_PINK
dw Func_b417a ; NOWFUNC_BOTTOM_BAR
dw Func_b4247 ; NOWFUNC_DAY_NIGHT_SPELL
dw Func_b42e7 ; NOWFUNC_PROLOGUE

Func_b403e:
dec c
Expand Down Expand Up @@ -277,7 +277,7 @@ Func_b417a:
set 2, [hl]

farcall Func_80bd9
farcall VBlank_80bf9
farcall VBlank_Overworld

decompress_vram0 BGMap_86868, v0BGMap1
decompress_vram1 BGMap_868b2, v1BGMap1
Expand Down Expand Up @@ -340,7 +340,7 @@ Func_b4247:
ld de, .data
call InitSceneObjParams

farcall VBlank_80bf9
farcall VBlank_Overworld
farcall DrawCoinCount

xor a
Expand Down Expand Up @@ -375,14 +375,14 @@ Func_b4309:
jumptable

dw Func_b4001
dw Func_b431f
dw Func_b4351
dw Func_b435f
dw Func_b438f
dw Func_b43a8
dw Func_b43dd
dw Func_b4448
dw Func_b4474
dw Func_b431f ; WOWFUNC_RAIN
dw Func_b4351 ; WOWFUNC_CLEAR_TORNADO
dw Func_b435f ; WOWFUNC_ELEVATOR_WORKING
dw Func_b438f ; WOWFUNC_MAGIC_SEED
dw Func_b43a8 ; WOWFUNC_SUMMON_SNAKE
dw Func_b43dd ; WOWFUNC_EARTHQUAKE
dw Func_b4448 ; WOWFUNC_VULCANO_ERUPTION
dw Func_b4474 ; WOWFUNC_RED_MUSIC_BOX

Func_b431f:
ld a, c
Expand Down Expand Up @@ -595,17 +595,17 @@ Func_b449b:
jumptable

dw Func_b4001
dw Func_b44b7
dw Func_b44e7
dw Func_b4509
dw Func_b4520
dw Func_b4567
dw Func_b45c8
dw Func_b45f5
dw Func_b461b
dw Func_b4637
dw Func_b4653
dw Func_b4665
dw Func_b44b7 ; SOWFUNC_SEND_SEEDS
dw Func_b44e7 ; SOWFUNC_MAGIC_SEED
dw Func_b4509 ; SOWFUNC_YELLOW_MUSIC_BOX
dw Func_b4520 ; SOWFUNC_CANYON_THUNDER
dw Func_b4567 ; SOWFUNC_RAISE_TOWER
dw Func_b45c8 ; SOWFUNC_FAN
dw Func_b45f5 ; SOWFUNC_SUMMON_SNAKE
dw Func_b461b ; SOWFUNC_EARTHQUAKE
dw Func_b4637 ; SOWFUNC_GREEN_MUSIC_BOX
dw Func_b4653 ; SOWFUNC_EXPLOSIVES
dw Func_b4665 ; SOWFUNC_FULL_MOON

Func_b44b7:
ld a, $80
Expand Down Expand Up @@ -870,15 +870,15 @@ Func_b4688:
jumptable

dw Func_b4001
dw Func_b46a0
dw Func_b46d9
dw Func_b4712
dw Func_b4771
dw Func_b4792
dw Func_b47f7
dw Func_b481b
dw Func_b4832
dw Func_b4873
dw Func_b46a0 ; EOWFUNC_FREEZE_SEA
dw Func_b46d9 ; EOWFUNC_EARTHQUAKE
dw Func_b4712 ; EOWFUNC_FORM_CASTLE
dw Func_b4771 ; EOWFUNC_EXPLOSIVES
dw Func_b4792 ; EOWFUNC_VULCANO_ERUPTION
dw Func_b47f7 ; EOWFUNC_BURN_VINES
dw Func_b481b ; EOWFUNC_SHOW_WARPED_VOID
dw Func_b4832 ; EOWFUNC_RAISE_PIPE
dw Func_b4873 ; EOWFUNC_DAYTIME

Func_b46a0:
ld a, c
Expand Down Expand Up @@ -2414,9 +2414,9 @@ _DoOWFunction:
jumptable

dw NorthOWFunctions ; NORTH
dw WestOWFunctions ; WEST
dw WestOWFunctions ; WEST
dw SouthOWFunctions ; SOUTH
dw Func_b6ea8 ; EAST
dw EastOWFunctions ; EAST

NorthOWFunctions:
ld a, [wCutsceneActionParam]
Expand Down Expand Up @@ -3329,7 +3329,7 @@ NOWFunc_DayNightSpell:
and a
ret nz
di
farcall VBlank_80bf9
farcall VBlank_Overworld
ei
jp AdvanceOWFunc

Expand Down Expand Up @@ -6691,19 +6691,19 @@ WaitOWScene16Frames:
ld a, 16
jp WaitOWFunc

Func_b6ea8:
EastOWFunctions:
ld a, [wCutsceneActionParam]
dec a
jumptable
dw EOWFunc_FreezeSea ; EOWFUNC_FREEZE_SEA
dw EOWFunc_Earthquake ; EOWFUNC_EARTHQUAKE
dw EOWFunc_FormCastle ; EOWFUNC_FORM_CASTLE
dw EOWFunc_Explosives ; EOWFUNC_EXPLOSIVES
dw EOWFunc_FreezeSea ; EOWFUNC_FREEZE_SEA
dw EOWFunc_Earthquake ; EOWFUNC_EARTHQUAKE
dw EOWFunc_FormCastle ; EOWFUNC_FORM_CASTLE
dw EOWFunc_Explosives ; EOWFUNC_EXPLOSIVES
dw EOWFunc_VulcanoEruption ; EOWFUNC_VULCANO_ERUPTION
dw EOWFunc_BurnVines ; EOWFUNC_BURN_VINES
dw EOWFunc_ShowWarpedVoid ; EOWFUNC_SHOW_WARPED_VOID
dw EOW_RaisePipe ; EOWFUNC_RAISE_PIPE
dw EOW_Daytime ; EOWFUNC_DAYTIME
dw EOWFunc_BurnVines ; EOWFUNC_BURN_VINES
dw EOWFunc_ShowWarpedVoid ; EOWFUNC_SHOW_WARPED_VOID
dw EOWFunc_RaisePipe ; EOWFUNC_RAISE_PIPE
dw EOWFunc_Daytime ; EOWFUNC_DAYTIME

EOWFunc_FreezeSea:
call .Func_b6f77
Expand Down Expand Up @@ -8196,7 +8196,7 @@ EOWFunc_ShowWarpedVoid:
ld b, $19
jp WaitOWObjState

EOW_RaisePipe:
EOWFunc_RaisePipe:
ld a, [w2d062]
jumptable
dw AdvanceOWFunc
Expand Down Expand Up @@ -8238,7 +8238,7 @@ EOW_RaisePipe:
ld hl, wSceneObj8State
jp WaitOWObjState

EOW_Daytime:
EOWFunc_Daytime:
ld a, [w2d062]
jumptable
dw AdvanceOWFunc
Expand Down
2 changes: 1 addition & 1 deletion src/engine/bank36.asm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Func_db29b:
call LoadGameOverPals
call LoadGameOverGfx
call Func_db4cf
call VBlank_354
call VBlank_GameOver

xor a
ldh [rSCX], a
Expand Down
Loading

0 comments on commit ded830c

Please sign in to comment.