aboutsummaryrefslogtreecommitdiff
path: root/modes/vblank_handler_list.gbasm
blob: 99db06375bf25cea9e0808ad5b36cb171a7e42ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Update_VBlank_Handler:
	PUSH HL
	LD A, $mem_current_mode
	AND $0f
	SLA A
	LD HL, =VBlank_Handler_List
	ADD L
	LD L, A
	LD A, $00
	ADC H
	LD H, A
	LD A, (HL+)
	LD ($mem_vblank_jump_destination+1), A
	LD A, (HL)
	LD ($mem_vblank_jump_destination), A
	POP HL
	RET

VBlank_Handler_List:
	; 0 (dungeon, dead)
	.DB =Dungeon_VBLANK_Entrypoint

	; 1 (dungeon dialogue, menu)
	.DB =Dialogue_VBLANK_Entrypoint

	; 2 (loading, animation)
	.DB =Loading_VBLANK_Entrypoint

	; 3 (new dungeon)
	.DB =New_Dungeon

	; 4 (pregenerated map loading)
	.DB =Map_Loading

.INCLUDE "modes/dialoguemenu.gbasm"
.INCLUDE "modes/dungeon.gbasm"
.INCLUDE "modes/loading.gbasm"
.INCLUDE "modes/dungeongeneration.gbasm"
.INCLUDE "modes/maploading.gbasm"