-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtxy51.a80
179 lines (168 loc) · 2.15 KB
/
txy51.a80
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Poziciovy print 42*27 znakov ;
; + znakovy subor 6*7 bodov ;
; (vytvoreny pre disasembler) ;
; . -28.05.1988- Busy software ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;DEMO:napiste:asm,dbg,rpp,g
//Original by BusySoft
MODULE txy51
txy ld a,(hl)
and 127
/* cp 13
jr z,T42_ZMEN */
cp 16
jr z,colorchange
push hl
call xy
pop hl
/* ld a,(T42_BORE)
dec a
cp c
jr c,T42_ZMEN
inc c */
T42_BACK ld a,(hl)
rla
ret c
inc hl
jr txy
colorchange
inc hl
ld a,(hl)
ld (T42_ATT),a
jr T42_BACK
T42_ATT defb 0
//exampleBusy
/*
start ld hl,#4000
ld de,#4001
ld bc,#17ff
ld (hl),#00
ldir
ld hl,#0202
ld (cursor),hl
ld hl,text
aaa ld a,(hl)
call xy
inc hl
jr nz,aaa
ld a,' '
bbb ld b,a
call xy
ld a,b
inc a
cp #80
jr c,bbb
ld hl,#2758
exx
ret
text db '*** Rutina print'
db ' 42*27 znakov v '
db 'obraze ***'
db ' Priklad '
db 'vypisu: '
db ' '
db #00
*/
;main code
xy and a
ret z
exx
ld bc,(cursor)
xy8 ld de,znaky
ld h,#00
ld l,a
add hl,hl
add hl,hl
add hl,hl
add hl,de
push hl
pop iy
ld xh,#08
xy8dd ld a,b
cp #c0
jr nc,xyend
; call #22b1
and a
rra
scf
rra
and a
rra
xor b
and 248
xor b
ld h,a
ld a,c
rlca
rlca
rlca
xor b
and 199
xor b
rlca
rlca
ld l,a
ld a,c
and 07
ld d,(iy+#00)
ld e,#00
jr z,xy8bb
xy8cc rr d
rr e
dec a
jr nz,xy8cc
xy8bb ld a,d
or (hl)
ld (hl),a
inc hl
ld a,e
or (hl)
ld (hl),a
inc b
inc iy
dec xh
jr nz,xy8dd
call T51_COLOR
xyend ld ix,flag0
ld a,(ix+#04)
add a,5
ld (ix+#04),a
cp 256-3
jr c,xystop
ld (ix+#04),2
ld a,(ix+#05)
add a,7
ld (ix+#05),a
xystop exx
ret
T51_COLOR
ld a,(T42_ATT)
or a
ret z
; pokud je nula, tak se neobarvuje
; dec h
dec l
ld a,h
rrca
rrca
rrca
and 3
or 88
ld h,a
ld a,(T42_ATT)
ld (hl),a
ret
;systemove premenne:(pre disu)
flag0 db #00
flag1 db #00
flag2 db #00
inp db #00
cursor
xxx db #00
yyy db #00
leni dw 0
adr dw 0
znaky
INCBIN zx51.ch6
ENDMODULE