home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_22_1988_Transactor_Publishing.d64
/
grplot.pal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
6KB
|
247 lines
5 open 2,8,2,"@0:grplot.obj,s,w"
10 pal=peek(701)+256*peek(702)
20 poke pal+1759,44:poke pal+1764,44
30 sys 700
40 .opt o2
50 *=-2
60 xxxxxx = 0
89 ;
97 ;--------------
98 ; code section
99 ;--------------
100 .word creloc
110 ;
120 cstart jmp xxxxxx
130 ;
131 ;"function:
132 ;" lenlear (atnddress,(NULL)ength,peekyte)
133 ;" unsigned int [193]ddress;
134 ;" unsigned int (NULL)ength;
135 ;" char [194]yte;
136 ;"
137 ;"global:
138 ;" unsigned int atnddress;
139 ;
140 address .word $e000
150 ;
160 clear =*
165 extn2 jsr xxxxxx
170 lda $033c ; <addr
180 rloc1 sta !address
190 sta $22
200 lda $033d ; >addr
210 rloc2 sta !address+1
220 sta $23
230 lda $0340 ; byte
240 ldy #$00
250 ldx $033f ; >length
260 beq floop2
270 floop1 sta ($22),y ; fill a
280 dey ; page
290 bne floop1
300 inc $23 ; fill many
310 dex ; pages
320 bne floop1
330 ldy #0
340 floop2 cpy $033e ; <length
350 beq fexit
360 sta ($22),y ; fill part
370 iny ; of a page
380 bne floop2
390 fexit rts
399 ;
400 grrows .word 0, 320, 640, 960,1280
410 .word 1600,1920,2240,2560,2880
420 .word 3200,3520,3840,4160,4480
430 .word 4800,5120,5440,5760,6080
440 .word 6400,6720,7040,7360,7680
449 ;
450 orbits .byte 128,64,32,16,8,4,2,1
460 andbits .byte 127,191,223,239
470 .byte 247,251,253,254
490 ;
491 ; function:
492 ;" char [208]lot (x,y)
493 ;" unsigned int x,y;
494 ;
495 ;
500 plot =*
505 extn3 jsr xxxxxx
510 lda $033e ; y coord
520 lsr a
530 lsr a
540 and #254
550 tay
560 rloc3 lda grrows,y ; get row
570 clc ; and add
580 rloc4 adc !address ; bitmap
590 sta $22 ; address
600 rloc5 lda grrows+1,y
610 rloc6 adc !address+1
620 sta $23
630 lda $033c ; x coord lo
640 and #%11111000
650 adc $22
660 sta $22
670 lda $033d ; x coord hi
680 adc $23
690 sta $23
700 lda $033e ; y coord
710 and #%00000111
720 tay
740 lda $033c ; x coord lo
750 and #%00000111
760 sta $24
770 sei
780 lda $01 ; swap all
790 pha ; rom/io out
800 lda #$30
810 sta $01
820 lda ($22),y ; check
830 extn1 ldx !xxxxxx ; plot type
840 beq bitoff ; and modify
850 cpx #1 ; pixel
860 beq biton
870 bitflip ldx $24 ; invert
880 rloc7 eor !orbits,x
890 rloc8 jmp pexit
900 biton ldx $24 ; pixel on
910 rloc9 ora !orbits,x
920 rloc10 jmp pexit
930 bitoff ldx $24 ; pixel off
940 rloc11 and !andbits,x
950 pexit sta ($22),y ; replace
960 rloc12 and !orbits,x ; byte and
970 sta $033c ; return
980 pla ; bit state.
990 sta $01 ; restore
1000 cli ; io/roms.
1010 rts
1090 ;
1091 ; function:
1092 ;" [198]ast[203]eys ()
1093 ;
1100 fastkey [178][172]
1110 sei
1120 extn4 lda #[179]irqkeys
1130 sta $0314
1140 extn5 lda #[177]irqkeys
1150 sta $0315
1160 cli
1170 rts
1299 ;
1300 irqkeys [178][172]
1310 lda #$01
1320 sta $028b
1330 lda #$00
1340 sta $028c
1350 jmp $ea31
1390 ;
1391 ; functi[145]:
1392 ;" (NULL)low(NULL)eys ()
1393 ;
1400 slowkey =*
1410 sei
1420 lda #<$ea31
1430 sta $0314
1440 lda #>$ea31
1450 sta $0315
1460 cli
1470 rts
1480 ;
6997 ;------------------
6998 ; relocate section
6999 ;------------------
7000 creloc =*
7010 .word (cglobal-creloc)>1-1
7020 ;
7030 .word rloc1
7040 .word rloc2
7050 .word rloc3 ; the addrs
7060 .word rloc4 ; of all
7070 .word rloc5 ; instructions
7080 .word rloc6 ; accessing
7090 .word rloc7 ; local
7100 .word rloc8 ; variables.
7110 .word rloc9
7120 .word rloc10
7130 .word rloc11
7140 .word rloc12
7996 ;
7997 ;----------------
7998 ; global section
7999 ;----------------
8000 cglobal =*
8010 numglob = 0
8020 .word numglob
8030 ;
8040 numglob _ numglob+1
8050 .asc "[193]ddress":.byt 0
8060 .byt 1
8070 .word address
8080 ;
8090 numglob _ numglob+1
8100 .asc "[195]lear":.byt 0
8110 .byt 1
8120 .word clear
8130 ;
8140 numglob _ numglob+1
8150 .asc "[208]lot":.byt 0
8160 .byt 1
8170 .word plot
8180 ;
8190 numglob _ numglob+1
8200 .asc "[198]ast[203]eys":.byt 0
8210 .byt 1
8220 .word fastkey
8230 ;
8240 numglob _ numglob+1
8250 .asc "[211]low[203]eys":.byt 0
8260 .byt 1
8270 .word slowkey
8280 ;
8290 numglob _ numglob+1
8300 .asc "irq%%":.byt 0
8310 .byt 1
8320 .word irqkeys
8330 ;
8996 ;
8997 ;------------------
8998 ; external section
8999 ;------------------
9000 cextern =*
9010 numext = 0
9020 .word numext
9030 ;
9040 numext _ numext+1
9050 .asc "c$start":.byt 0
9060 .word 0
9080 .word cstart
9090 ;
9100 numext _ numext+1
9110 .asc "[208]lot[212]ype":.byt 0
9120 .word 0
9140 .word extn1
9150 ;
9160 numext _ numext+1
9170 .asc "c$funct[164]init":.byt 0
9180 .word 0
9200 .word extn2
9210 ;
9220 numext _ numext+1
9230 .asc "c$funct[164]init":.byt 0
9240 .word 0
9260 .word extn3
9270 ;
9280 numext _ numext+1
9290 .asc "irq%%":.byt 0
9300 .word 2
9310 .word extn4
9320 ;
9330 numext _ numext+1
9340 .asc "irq%%":.byt 0
9350 .word 1
9360 .word extn5
9998 ;
9999 .word 0 ; done!