-
Notifications
You must be signed in to change notification settings - Fork 1
/
editNavMenu.asm
111 lines (92 loc) · 1.76 KB
/
editNavMenu.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
editNavMenu:
lda PAD1_sel
beq @noSel
@noSel:
lda #$00
sta navMenuCursorX
lda writeScreen
beq @a
jsr writeNavMenuScreen
dec writeScreen
beq @a
jsr writeNavMenuHeaderFooter
lda #$01
sta dmaUpdateHeader
sta dmaUpdateTitle
lda #$00
sta writeScreen
@a: ;jsr globalKeys ;global keys
lda writeScreen ;if mode has changed, this flag will be !=0
beq @b
jmp editNavMenuExit ;if changed, don't do any more keys
@b: jsr processKeys
;lda keysHoldSel
lda keysHoldB
bne @noJump
@aa:
ldx editorModeIndex
lda editorPreviousModes-1,x
cmp navMenuCursorY
bne @ab
dec editorModeIndex
@ab:
lda navMenuCursorY
sta editorMode
lda #$00
;sta PAD1_sel
sta keysHoldB
;sta keysHoldSel
lda #$02
sta writeScreen
lda #$00
sta editBufferFlag
jmp editNavMenuExit
@noJump: lda #$01
sta editBufferFlag
jsr moveAroundEditor ;global routine for moving around editors
editNavMenuExit:
updateCursor navMenuCursorX,navMenuCursorY,navMenuCursorColumns,navMenuCursorRows,navMenuColumnCursorType
jmp editorLoop
writeNavMenuScreen:
ldx #$00
lda #CHR_SPACE
@a: sta rowBuffer,x
inx
cpx #$20
bcc @a
ldy #$00
@b: lda windowNavMenu,y
sta windowBuffer,y
iny
cpy #(14 * 16)
bcc @b
rts
writeNavMenuHeaderFooter:
ldx #$00 ;write header and title bars to buffer
@c: lda titleNavMenu,x
sta titleBuffer,x
lda headerNavMenu,x
sta headerBuffer,x
inx
cpx #$11
bne @c
rts
navMenuCursorColumns:
.REPEAT 1,i
.BYTE $53+(11*8)
.ENDREPEAT
navMenuCursorRows:
.REPEAT navModeRows,i
.BYTE $30 + (i*8)
.ENDREPEAT
rowOffsetNavMenu:
.REPEAT navModeRows,i
.BYTE 14 + (i*14)
.ENDREPEAT
columnOffsetNavMenu:
.BYTE 0
;
;0 = no cursor, 1=8x8, 2=8x16, 3=8x24
;
navMenuColumnCursorType:
.BYTE 2