-
Notifications
You must be signed in to change notification settings - Fork 2
/
Relocated_Code_Callers.s
83 lines (50 loc) · 1.75 KB
/
Relocated_Code_Callers.s
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
; -------------------- callers for relocated code
TitleScreen_RAM_Code:
; set MegaROM page for Code to be relocated
ld a, CODE_TO_BE_RELOCATED_MEGAROM_PAGE
;ld (Seg_P8000_SW), a
call Set_and_Save_MegaROM_Page
ld hl, TitleScreen_Start
ld de, RAM_Code
ld bc, TitleScreen_size
ldir
; Starts the music
ld a, MUSIC_SHUFFLE_ONE ; index of music on SONG_TABLE
call StartMusic ; param a: liiiiiii, where l (MSB) is the loop flag (0 = loop), and iiiiiii is the 0-based song index (0, 1, 2...)
call TitleScreen
call Clear_RAM_Code_Area
; Stops the music
call StopMusic
ret
ChooseInputScreen_RAM_Code:
; set MegaROM page for Code to be relocated
ld a, CODE_TO_BE_RELOCATED_MEGAROM_PAGE
; ld (Seg_P8000_SW), a
call Set_and_Save_MegaROM_Page
ld hl, ChooseInputScreen_Start
ld de, RAM_Code
ld bc, ChooseInputScreen_size
ldir
call ChooseInputScreen
call Clear_RAM_Code_Area
ret
StageClearAnimation_RAM_Code:
; set MegaROM page for Code to be relocated
ld a, CODE_TO_BE_RELOCATED_MEGAROM_PAGE
; ld (Seg_P8000_SW), a
call Set_and_Save_MegaROM_Page
ld hl, StageClearAnimation_Start
ld de, RAM_Code
ld bc, StageClearAnimation_size
ldir
call StageClearAnimation
call Clear_RAM_Code_Area
ret
Clear_RAM_Code_Area:
ld hl, RAM_Code ; source
xor a
ld (hl), a ; clear first byte
ld de, RAM_Code + 1 ; destiny
ld bc, RAM_Code.size - 1 ; size
ldir ; Copy BC bytes from HL to DE
ret