-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_selector.s
119 lines (79 loc) · 1.4 KB
/
mod_selector.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
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
align 4
submod_selector:
dc.l s_s_name
dc.l s_s_reset
dc.l s_s_init
dc.l s_s_update
s_s_name:
dc.b "MOD LIST ",0
s_s_reset:
movem.l D0-D7/A0-A6, -(A7)
moveq.l #0,d0
move.l d0,(a0)
movem.l (A7)+, D0-D7/A0-A6
rts
s_s_init:
movem.l D0-D7/A0-A6, -(A7)
jsr clear_mod_vram
movem.l (A7)+, D0-D7/A0-A6
rts
s_s_update:
movem.l D0-D7/A0-A6, -(A7)
jsr clear_mod_vram
move.l (a0),d1
moveq.l #0,d2
move.l VAR_INPUT_TRG,d0
move.l VAR_NUM_MODS,d3
btst #0,d0
beq .c1
move.l #-1,d2
.c1:
btst #1,d0
beq .c2
move.l #1,d2
.c2:
add.l d2,d1
cmp.l #-1,d1
bne .skip1
moveq.l #0,d1
.skip1:
cmp.l d3,d1
bne .skip2
move.l d3,d1
subi.l #1,d1
.skip2:
move.l d1,(a0)
move.l a0,a2
btst #4,d0
bne .change_mod
;draw list
move.l #0,d3
move.l #MOD_Y,d1
move.l VAR_NUM_MODS,d6
sub.l #1,d6
.drawloop:
movem.l D0-D7/a2, -(A7)
move.l d3,d0
jsr get_module_parameters
movem.l (A7)+, D0-D7/a2
move.l (a1),a0 ; text
move.l #5,d0
move.l #COLOR_WHITE,d2
move.l (a2),a1
cmp.l d3,a1
bne .skip3
move.l #COLOR_GREEN,d2
.skip3:
jsr print_text
addi.l #1,d1
addi.l #1,d3
dbra d6,.drawloop
;move.l VAR_MODULE,d4
bra .end
.change_mod:
move.l #VAR_MODULE,a1
move.l (a0),(a1)
jsr init_module
.end:
movem.l (A7)+, D0-D7/A0-A6
rts