-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu_vbl.asm
137 lines (118 loc) · 2.04 KB
/
menu_vbl.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
;Airaki! - FSE 2014
;Released under the GPL V3, see LICENSE.TXT
menu_vbl:
call RAMtoOAM
xor a
ldh ($43),a ;Scroll X
call sfx_update
call dofade
ld hl,OAMCOPY
ld bc,$A0
call clear
ld hl,OAMCOPY
;Render selection markers
ld a,(MCURSOR_PSEL)
ld c,(6*8)+10
or a
jr z,+
ld c,(16*8)+9
+:
ld a,65+16
ldi (hl),a
ld a,c
ldi (hl),a
ld a,T_VAL
ldi (hl),a
xor a
ldi (hl),a
ld a,(MCURSOR_SSEL)
swap a
ld b,a
sla a
add b ;*48
add 47
ld c,a
ld a,147-16
ldi (hl),a
ld a,c
ldi (hl),a
ld a,T_VAL
ldi (hl),a
xor a
ldi (hl),a
;Render cursor
ld a,(MCURSOR_LINE)
or a
jr nz,+
ld a,(MCURSOR_PSEL)
or a
ld de,mcur_lut2 ;Cursor is 2P
jr nz,++
ld de,mcur_lut1 ;Cursor is 1P
++:
ld b,3
-:
ld a,(de)
ldi (hl),a
inc de
ld a,(de)
ldi (hl),a
inc de
ld a,T_MCURSOR
ldi (hl),a
ld a,(de)
ldi (hl),a
inc de
dec b
jr nz,-
jr +++
+:
ld a,(MCURSOR_SSEL)
swap a
ld b,a
sla a
add b ;*48
ld c,a
ld de,mcur_lut3 ;Cursor is special skill
ld b,3
-:
ld a,(de)
ldi (hl),a
inc de
ld a,(de)
add c
ldi (hl),a
inc de
ld a,T_MCURSOR
ldi (hl),a
ld a,(de)
ldi (hl),a
inc de
dec b
jr nz,-
+++:
call readinput
call menu_input
ret
;Y,X,tile,attr
mcur_lut1:
;1P
.db 5+16+16,29+8,0
.db 5+16+16,50+8,%00100000
.db 41+16+16,29+8,%01000000
mcur_lut2:
;2P
.db 5+16+16,86+8,0
.db 5+16+16,129+8,%00100000
.db 41+16+16,86+8,%01000000
mcur_lut3:
;Special
.db 109,17+8,0
.db 109,39+8,%00100000
.db 123,17+8,%01000000
RLI_menu:
push af
ld a,-4
ldh ($43),a ;Scroll X
pop af
reti