-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenuFunc.asm
152 lines (146 loc) · 1.71 KB
/
MenuFunc.asm
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
SetTI:
;put a line of 6 pixels to the left of the screen
di
push BC
push HL
push DE
ld A, (pencol)
dec A
ld C, A
srl A
srl A
srl A
add A, $20
ld D, A
ld A, C
and 7
ld C, A
ld A, 7
sub C
ld E, 1
LineLoopShift6:
or A
jr Z, LineLoopSkip6
sla E
dec A
jr LineLoopShift6
LineLoopSkip6:
ld A, $80
out ($10), A
call $000B
ld A, D
out ($10), A
in A, ($11)
ld HL, AppBackUpScreen
ld B, 6
LineLoopIn6:
call $000B
in A, ($11)
or E
ld (HL), A
inc HL
djnz LineLoopIn6
call $000B
ld A, $80
out ($10), A
call $000B
ld A, D
out ($10), A
ld HL, AppBackUpScreen
ld B, 6
LineLoopOut6:
ld A, (HL)
inc HL
call $000B
out ($11), A
djnz LineLoopOut6
pop DE
pop HL
pop BC
ei
set TextInverse, (IY + TextFlags)
ret
MoveUp:
call SelectOptionE
dec E
jr NZ, UpdateCursor
ld C, D
ld B, 0
ld HL, optionLengths
add HL, BC
dec HL
ld A, (HL)
ld E, A
jr UpdateCursor
MoveDown:
call SelectOptionE
inc E
ld C, D
ld B, 0
ld HL, optionLengths
add HL, BC
dec HL
ld A, (HL)
inc A
cp E
jr NZ, UpdateCursor
ld E, 1
jr UpdateCursor
UpdateCursor:
call SelectOptionE
jp MenuLoop
SelectOptionE:
ld A, E
add A, A
ld C, A
add A, A
add A, C
add A, $80
ld C, A
di
out ($10), A
call $000B
ld A, $20
out ($10), A
in A, ($11)
ld HL, AppBackUpScreen
ld B, 6
LineLoopIn:
call $000B
in A, ($11)
xor $FE
ld (HL), A
inc HL
djnz LineLoopIn
call $000B
ld A, C
out ($10), A
call $000B
ld A, $20
out ($10), A
ld HL, AppBackUpScreen
ld B, 6
LineLoopOut:
ld A, (HL)
inc HL
call $000B
out ($11), A
djnz LineLoopOut
ei
ret
MoveLeft:
ld E, 1
dec D
jp NZ, Menu
ld A, (titleLength)
ld D, A
jp Menu
MoveRight:
ld E, 1
inc D
ld A, (titleLength)
inc A
cp D
jp NZ, Menu
ld D, 1
jp Menu