comparison level1/cmds/grfo.asm @ 1587:5f18094d961d

kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
author boisy
date Mon, 24 May 2004 14:51:21 +0000
parents 84ea83668304
children
comparison
equal deleted inserted replaced
1586:e26f7d2e40df 1587:5f18094d961d
14 14
15 * Disassembled 02/04/05 23:44:21 by Disasm v1.6 (C) 1988 by RML 15 * Disassembled 02/04/05 23:44:21 by Disasm v1.6 (C) 1988 by RML
16 16
17 ifp1 17 ifp1
18 use defsfile 18 use defsfile
19 use cciodefs
19 endc 20 endc
20 21
21 tylg set Systm+Objct 22 tylg set Systm+Objct
22 atrv set ReEnt+rev 23 atrv set ReEnt+rev
23 rev set $00 24 rev set $00
24 edition set 1 25 edition set 1
25 26
26 mod eom,name,tylg,atrv,start,size 27 mod eom,name,tylg,atrv,start,size
27 28
28 org 0 29 org 0
29 u0000 rmb 0
30 size equ . 30 size equ .
31 31
32 fcb $07 32 fcb $07
33 name fcs /GRFO/ 33 name fcs /GRFO/
34 fcb edition 34 fcb edition
35 35
36 start lbra Entry7 36 * Dispatch table
37 lbra L002C 37 start lbra Init
38 lbra L0026 38 lbra Write
39 lbra L0026 39 lbra GetStat
40 lbra Entry7 40 lbra SetStat
41 41 lbra Term
42 L0022 fdb $0055 42
43 L0024 fdb $aaff 43 * 128x192 4 color pixel table
44 L0026 comb 44 Mode1Clr fdb $0055,$aaff
45
46 GetStat
47 SetStat comb
45 ldb #E$UnkSvc 48 ldb #E$UnkSvc
46 rts 49 rts
47 50
48 L002C suba #$15 51 Write suba #$15
49 leax <Table,pcr 52 leax <Table,pcr
50 lsla 53 lsla
51 ldd a,x 54 ldd a,x
52 jmp d,x 55 jmp d,x
53 56
54 Table fdb Entry1-Table 57 Table fdb Do15-Table
55 fdb Entry2-Table 58 fdb Do16-Table
56 fdb Entry3-Table 59 fdb Do17-Table
57 fdb Entry4-Table 60 fdb Do18-Table
58 fdb Entry5-Table 61 fdb Do19-Table
59 fdb Entry6-Table 62 fdb Do1A-Table
60 fdb Entry7-Table 63 fdb NoOp-Table
61 fdb Entry8-Table 64 fdb Do1C-Table
62 fdb Entry9-Table 65 fdb Do1D-Table
63 fdb Entry7-Table 66 fdb NoOp-Table
64 fdb Entry7-Table 67 fdb NoOp-Table
65 68
66 L004A ldd <$28,u 69 * Fix X/Y coords:
67 cmpb #$C0 70 * - if Y > 191 then cap it at 191
68 bcs L0053 71 * - adjust X coord if in 128x192 mode
69 ldb #$BF 72 FixXY ldd <V.NChar,u get next 2 charas
70 L0053 tst <$24,u 73 cmpb #192 Y greater than max?
71 bmi L0059 74 bcs L0053 branch if lower than
72 lsra 75 ldb #191
73 L0059 std <$28,u 76 L0053 tst <V.Mode,u which mode?
74 rts 77 bmi L0059 branch if 256x192
75 78 lsra else divide X by 2
76 Entry1 leax <L0065,pcr 79 L0059 std <V.NChar,u and save
77 L0060 ldb #$02 80 rts
78 lbra L015A 81
79 L0065 bsr L004A 82 * $15 - set graphics cursor
80 std <$45,u 83 Do15 leax <SetGC,pcr load X with return address
81 84 GChar2 ldb #$02 need two parameters
82 Entry7 clrb 85 lbra GChar
83 rts 86
84 87 SetGC bsr FixXY fix coords
85 Entry5 clr <$47,u 88 std <V.GCrsX,u and save new gfx cursor pos
86 Entry4 leax <L0074,pcr 89
87 bra L0060 90 NoOp
88 L0074 bsr L004A 91 Init
89 std <$45,u 92 Term clrb
90 bsr L007E 93 rts
94
95 * $19 - erase point
96 Do19 clr <V.Msk1,u
97 * $18 - set point
98 Do18 leax <DrawPnt,pcr
99 bra GChar2
100
101 DrawPnt bsr FixXY fix coords
102 std <V.GCrsX,u save as new gfx cursor pos
103 bsr DrwPt2
91 lbra L014A 104 lbra L014A
92 L007E jsr [<$5D,u] 105 DrwPt2 jsr [<V.CnvVct,u]
93 L0081 tfr a,b 106 L0081 tfr a,b
94 comb 107 comb
95 andb ,x 108 andb ,x
96 stb ,x 109 stb ,x
97 anda <$47,u 110 anda <V.Msk1,u and with mask
98 ora ,x 111 ora ,x
99 sta ,x 112 sta ,x
100 rts 113 rts
101 Entry3 clr <$47,u 114
102 Entry2 leax <L0098,pcr 115 * $17 - erase line
103 bra L0060 116 Do17 clr <V.Msk1,u clear mask value
104 L0098 bsr L004A 117
105 leas -$0E,s 118 * $16 - draw line
106 std $0C,s 119 Do16 leax <DrawLine,pcr load X with return address
107 jsr [<$5D,u] 120 bra GChar2 need two params
108 stx $02,s 121
109 sta $01,s 122 DrawLine bsr FixXY fix up coords
110 ldd <$45,u 123 leas -$0E,s make room on stack
111 jsr [<$5D,u] 124 std $0C,s save X/Y
125 jsr [<V.CnvVct,u] get address given X/Y
126 stx $02,s save on stack
127 sta $01,s and pixel too
128 ldd <V.GCrsX,u get current graphics cursor
129 jsr [<V.CnvVct,u] get address given X/Y
112 sta ,s 130 sta ,s
113 clra 131 clra
114 clrb 132 clrb
115 std $04,s 133 std $04,s
116 lda #$BF 134 lda #$BF
117 suba <$46,u 135 suba <V.GCrsY,u
118 sta <$46,u 136 sta <V.GCrsY,u
119 lda #$BF 137 lda #$BF
120 suba <$29,u 138 suba <V.NChr2,u
121 sta <$29,u 139 sta <V.NChr2,u
122 lda #$FF 140 lda #$FF
123 sta $06,s 141 sta $06,s
124 clra 142 clra
125 ldb <$45,u 143 ldb <V.GCrsX,u
126 subb <$28,u 144 subb <V.NChar,u
127 sbca #$00 145 sbca #$00
128 bpl L00D6 146 bpl L00D6
129 nega 147 nega
130 negb 148 negb
131 sbca #$00 149 sbca #$00
135 ldd #$FFFF 153 ldd #$FFFF
136 std $04,s 154 std $04,s
137 L00DF lda #$E0 155 L00DF lda #$E0
138 sta $07,s 156 sta $07,s
139 clra 157 clra
140 ldb <$46,u 158 ldb <V.GCrsY,u
141 subb <$29,u 159 subb <V.NChr2,u
142 sbca #$00 160 sbca #$00
143 bpl L00F4 161 bpl L00F4
144 nega 162 nega
145 negb 163 negb
146 sbca #$00 164 sbca #$00
167 bra L0100 185 bra L0100
168 L011D lda ,s 186 L011D lda ,s
169 ldb $06,s 187 ldb $06,s
170 bpl L0133 188 bpl L0133
171 lsla 189 lsla
172 ldb <$24,u 190 ldb <V.Mode,u which mode?
173 bmi L012A 191 bmi L012A branch if 256x192
174 lsla 192 lsla
175 L012A bcc L00F8 193 L012A bcc L00F8
176 lda <$4A,u 194 lda <V.4A,u
177 leax -$01,x 195 leax -$01,x
178 bra L00F8 196 bra L00F8
179 L0133 lsra 197 L0133 lsra
180 ldb <$24,u 198 ldb <V.Mode,u which mode?
181 bmi L013A 199 bmi L013A branch if 256x196
182 lsra 200 lsra
183 L013A bcc L00F8 201 L013A bcc L00F8
184 lda <$49,u 202 lda <V.MCol,u
185 leax $01,x 203 leax $01,x
186 bra L00F8 204 bra L00F8
187 L0143 ldd $0C,s 205 L0143 ldd $0C,s
188 std <$45,u 206 std <V.GCrsX,u
189 leas $0E,s 207 leas $0E,s
190 L014A lda <$48,u 208 L014A lda <V.Msk2,u
191 sta <$47,u 209 sta <V.Msk1,u
192 clrb 210 clrb
193 rts 211 rts
194 Entry8 clr <$47,u 212
195 Entry6 leax <L0162,pcr 213 * $1C - erase circle
196 ldb #$01 214 Do1C clr <V.Msk1,u clear mask value
197 L015A stb <$25,u 215 * $1A - draw circle
198 stx <$26,u 216 Do1A leax <Circle,pcr
217 ldb #$01 require another param -- radius
218 GChar stb <V.NGChr,u one more char
219 stx <V.RTAdd,u return address
199 clrb 220 clrb
200 rts 221 rts
201 L0162 leas -$04,s 222
202 ldb <$29,u 223 Circle leas -$04,s make room on stack
203 stb $01,s 224 ldb <V.NChr2,u get radius
225 stb $01,s store on stack
204 clra 226 clra
205 sta ,s 227 sta ,s
206 addb $01,s 228 addb $01,s
207 adca #$00 229 adca #$00
208 nega 230 nega
285 ldx ,s 307 ldx ,s
286 bsr L0202 308 bsr L0202
287 leas $08,s 309 leas $08,s
288 rts 310 rts
289 L0202 pshs b,a 311 L0202 pshs b,a
290 ldb <$46,u 312 ldb <V.GCrsY,u
291 clra 313 clra
292 leax d,x 314 leax d,x
293 cmpx #$0000 315 cmpx #$0000
294 bmi L0214 316 bmi L0214
295 cmpx #$00BF 317 cmpx #$00BF
296 ble L0216 318 ble L0216
297 L0214 puls pc,b,a 319 L0214 puls pc,b,a
298 L0216 ldb <$45,u 320 L0216 ldb <V.GCrsX,u
299 clra 321 clra
300 tst <$24,u 322 tst <V.Mode,u
301 bmi L0221 323 bmi L0221
302 lslb 324 lslb
303 rola 325 rola
304 L0221 addd ,s++ 326 L0221 addd ,s++
305 tsta 327 tsta
306 beq L0227 328 beq L0227
307 rts 329 rts
308 L0227 pshs b 330 L0227 pshs b
309 tfr x,d 331 tfr x,d
310 puls a 332 puls a
311 tst <$24,u 333 tst <V.Mode,u which mode?
312 lbmi L007E 334 lbmi DrwPt2 branch if 256x192
313 lsra 335 lsra else divide A by 2
314 lbra L007E 336 lbra DrwPt2
315 Entry9 clr <$41,u 337
338 * $1D - flood fill
339 Do1D clr <V.FFFlag,u
316 leas -$07,s 340 leas -$07,s
317 lbsr L03AB 341 lbsr L03AB
318 lbcs L0346 342 lbcs L0346
319 lda #$FF 343 lda #$FF
320 sta <$4F,u 344 sta <V.4F,u
321 ldd <$45,u 345 ldd <V.GCrsX,u
322 lbsr L0351 346 lbsr L0351
323 lda <$4C,u 347 lda <V.4C,u
324 sta <$4D,u 348 sta <V.4D,u
325 tst <$24,u 349 tst <V.Mode,u which mode?
326 bpl L0261 350 bpl L0261 branch if 128x192
327 tsta 351 tsta
328 beq L0267 352 beq L0267
329 lda #$FF 353 lda #$FF
330 bra L0267 354 bra L0267
331 L0261 leax >L0022,pcr 355 L0261 leax >Mode1Clr,pcr
332 lda a,x 356 lda a,x
333 L0267 sta <$4E,u 357 L0267 sta <V.4E,u
334 cmpa <$47,u 358 cmpa <V.Msk1,u
335 lbeq L0346 359 lbeq L0346
336 ldd <$45,u 360 ldd <V.GCrsX,u
337 L0274 suba #$01 361 L0274 suba #$01
338 bcs L027F 362 bcs L027F
339 lbsr L0351 363 lbsr L0351
340 bcs L027F 364 bcs L027F
341 beq L0274 365 beq L0274
348 bcs L0290 372 bcs L0290
349 beq L0282 373 beq L0282
350 L0290 deca 374 L0290 deca
351 ldx $01,s 375 ldx $01,s
352 lbsr L03D3 376 lbsr L03D3
353 neg <$4F,u 377 neg <V.4F,u
354 lbsr L03D3 378 lbsr L03D3
355 L029C lbsr L03F9 379 L029C lbsr L03F9
356 lbcs L0346 380 lbcs L0346
357 tst <$4F,u 381 tst <V.4F,u
358 bpl L02B3 382 bpl L02B3
359 subb #$01 383 subb #$01
360 bcs L029C 384 bcs L029C
361 std $03,s 385 std $03,s
362 tfr x,d 386 tfr x,d
390 bcc L02FB 414 bcc L02FB
391 ldd $01,s 415 ldd $01,s
392 decb 416 decb
393 cmpd $05,s 417 cmpd $05,s
394 beq L02FB 418 beq L02FB
395 neg <$4F,u 419 neg <V.4F,u
396 ldx $05,s 420 ldx $05,s
397 lbsr L03D3 421 lbsr L03D3
398 neg <$4F,u 422 neg <V.4F,u
399 L02FB ldd $05,s 423 L02FB ldd $05,s
400 L02FD std $01,s 424 L02FD std $01,s
401 L02FF bsr L0351 425 L02FF bsr L0351
402 bcs L030B 426 bcs L030B
403 bne L030B 427 bne L030B
423 cmpa #$02 447 cmpa #$02
424 lbcs L029C 448 lbcs L029C
425 ldd $05,s 449 ldd $05,s
426 cmpd $03,s 450 cmpd $03,s
427 lbcs L029C 451 lbcs L029C
428 neg <$4F,u 452 neg <V.4F,u
429 ldx $03,s 453 ldx $03,s
430 lbsr L03D3 454 lbsr L03D3
431 lbra L029C 455 lbra L029C
432 L0346 leas $07,s 456 L0346 leas $07,s
433 clrb 457 clrb
434 ldb <$41,u 458 ldb <V.FFFlag,u
435 beq L0350 459 beq L0350
436 L034E orcc #Carry 460 L034E orcc #Carry
437 L0350 rts 461 L0350 rts
438 L0351 pshs b,a 462 L0351 pshs b,a
439 cmpb #$BF 463 cmpb #$BF
440 bhi L0380 464 bhi L0380
441 tst <$24,u 465 tst <V.Mode,u which mode?
442 bmi L0360 466 bmi L0360 branch if 256x192
443 cmpa #$7F 467 cmpa #$7F
444 bhi L0380 468 bhi L0380
445 L0360 jsr [<$5D,u] 469 L0360 jsr [<V.CnvVct,u]
446 tfr a,b 470 tfr a,b
447 andb ,x 471 andb ,x
448 L0367 bita #$01 472 L0367 bita #$01
449 bne L0376 473 bne L0376
450 lsra 474 lsra
451 lsrb 475 lsrb
452 tst <$24,u 476 tst <V.Mode,u which mode?
453 bmi L0367 477 bmi L0367 branch if 256x192
454 lsra 478 lsra
455 lsrb 479 lsrb
456 bra L0367 480 bra L0367
457 L0376 stb <$4C,u 481 L0376 stb <V.4C,u
458 cmpb <$4D,u 482 cmpb <V.4D,u
459 andcc #^Carry 483 andcc #^Carry
460 puls pc,b,a 484 puls pc,b,a
461 L0380 orcc #Carry 485 L0380 orcc #Carry
462 puls pc,b,a 486 puls pc,b,a
463 L0384 pshs b,a 487 L0384 pshs b,a
464 jsr [<$5D,u] 488 jsr [<V.CnvVct,u]
465 bita #$80 489 bita #$80
466 beq L03A6 490 beq L03A6
467 ldb <$4E,u 491 ldb <V.4E,u
468 cmpb ,x 492 cmpb ,x
469 bne L03A6 493 bne L03A6
470 ldb <$47,u 494 ldb <V.Msk1,u
471 stb ,x 495 stb ,x
472 puls b,a 496 puls b,a
473 tst <$24,u 497 tst <V.Mode,u which mode?
474 bmi L03A3 498 bmi L03A3 branch if 256x192
475 adda #$03 499 adda #$03
476 rts 500 rts
477 L03A3 adda #$07 501 L03A3 adda #$07
478 rts 502 rts
479 L03A6 lbsr L0081 503 L03A6 lbsr L0081
480 puls pc,b,a 504 puls pc,b,a
481 L03AB ldx <$3F,u 505 L03AB ldx <V.FFSTp,u get top of flood fill stack
482 beq L03B5 506 beq L03B5 if zero, we need to allocate stack
483 stx <$3D,u 507 stx <V.FFSPt,u else reset flood fill stack ptr
484 L03B3 clrb 508 L03B3 clrb
485 rts 509 rts
486 L03B5 pshs u 510
487 ldd #$0200 511 * Allocate Flood Fill Stack
488 os9 F$SRqMem 512 L03B5 pshs u save U for now
489 bcc L03C1 513 ldd #$0200 get 512 bytes
490 puls pc,u 514 os9 F$SRqMem from system
491 L03C1 tfr u,d 515 bcc AllocOk branch if ok
492 puls u 516 puls pc,u else pull out with error
493 std <$3B,u 517 AllocOk tfr u,d move pointer to alloced mem to D
494 addd #$0200 518 puls u get stat pointer we saved earlier
495 std <$3F,u 519 std <V.FFMem,u save pointer to alloc'ed mem
496 std <$3D,u 520 addd #512 point D to end of alloc'ed mem
497 bra L03B3 521 std <V.FFSTp,u and save here as top of fill stack
522 std <V.FFSPt,u and here
523 bra L03B3 do a clean return
524
498 L03D3 pshs b,a 525 L03D3 pshs b,a
499 ldd <$3D,u 526 ldd <V.FFSPt,u
500 subd #$0004 527 subd #$0004
501 cmpd <$3B,u 528 cmpd <V.FFMem,u
502 bcs L03F2 529 bcs L03F2
503 std <$3D,u 530 std <V.FFSPt,u
504 tfr d,y 531 tfr d,y
505 lda <$4F,u 532 lda <V.4F,u
506 sta ,y 533 sta ,y
507 stx $01,y 534 stx $01,y
508 puls b,a 535 puls b,a
509 sta $03,y 536 sta $03,y
510 rts 537 rts
511 L03F2 ldb #$F5 538 L03F2 ldb #$F5
512 stb <$41,u 539 stb <V.FFFlag,u
513 puls pc,b,a 540 puls pc,b,a
514 L03F9 ldd <$3D,u 541 L03F9 ldd <V.FFSPt,u
515 cmpd <$3F,u 542 cmpd <V.FFSTp,u top of flood fill stack?
516 lbcc L034E 543 lbcc L034E
517 tfr d,y 544 tfr d,y
518 addd #$0004 545 addd #$0004
519 std <$3D,u 546 std <V.FFSPt,u
520 lda ,y 547 lda ,y
521 sta <$4F,u 548 sta <V.4F,u
522 ldd $01,y 549 ldd $01,y
523 tfr d,x 550 tfr d,x
524 lda $03,y 551 lda $03,y
525 andcc #^Carry 552 andcc #^Carry
526 rts 553 rts