blob: e12461cc4aafda88be729770ac2739f261f2d511 (
plain)
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
|
print_char:
pha
lda.d
pha.q
lda sp+9
cmp
beq esc
cmp
beq nl
cmp
beq clr_scr
cmp
beq en_step
cmp
beq dis_step
cmp
beq bs
cmp
beq bs
printc:
lda
sta d
lda (sp+1), y
beq @save
lda b
bne @save
sty.w scr_ptr
jsr fndend
bra @shift
@update:
lda scr_col
sta scr_tcol
@update1:
jsr findend
sta e
sta scr_row
jsr findst
lda scr_row
@update2:
sta f
jsr rdrw_ln
lda scr_trow
sta scr_row
lda scr_tcol
sta scr_col
jsr update_pos
dec d
bra @save1
@shift:
ldy.w scr_ptr3
inc scr_ptr3
tyx
dey
ldb
stb d
jsr shftln
ldb
stb d
lda sp+9
sta (sp+1), y
lda scr_row
sta scr_trow
bra @update
@save:
ldb d
bne @update
@save1:
lda sp+9
sta (sp+1), y
@incr:
inc scr_col
iny
@wrapped:
ldb
stb f
ldb scr_col
cpb
bcs @scrolled
@print:
sta scr
ldb f
beq @wrap
bra printc_end
@scrolled:
ldb scr_row
cpb
bcs @scroll
@wrapped2:
ldb
stb f
bra @print
@scroll:
sta scr
clc
lda
sta wrapped
jsr scrl_down
@wrap:
ldb
stb scr_col
ldb scr_row
cpb
bcs @wrap2
@wrap1:
inc scr_row
@wrap2:
phx.w
clc
lda scr_row
adc scr_str
tax
jsr setbit
plx.w
jsr update_pos
printc_end:
pla.q
pla
and
rts
nl:
lda
ldb (sp+1), y
bne @scroll
sta (sp+1), y
@scroll:
sta scr_col
lda scr_row
cmp
bcc @incr
jsr scrl_down
bra @end
@incr:
inc scr_row
jsr update_pos
@end:
lda
sta a
rts
|