home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_22_1988_Transactor_Publishing.d64 / grplot.pal (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  6KB  |  247 lines

  1. 5  open 2,8,2,"@0:grplot.obj,s,w"
  2. 10 pal=peek(701)+256*peek(702)
  3. 20 poke pal+1759,44:poke pal+1764,44
  4. 30 sys 700
  5. 40           .opt o2
  6. 50           *=-2
  7. 60 xxxxxx    = 0
  8. 89 ;
  9. 97 ;--------------
  10. 98 ; code section
  11. 99 ;--------------
  12. 100          .word creloc
  13. 110 ;
  14. 120 cstart   jmp xxxxxx
  15. 130 ;
  16. 131 ;"function:
  17. 132 ;"   lenlear (atnddress,(NULL)ength,peekyte)
  18. 133 ;"    unsigned int [193]ddress;
  19. 134 ;"    unsigned int (NULL)ength;
  20. 135 ;"    char [194]yte;
  21. 136 ;"
  22. 137 ;"global:
  23. 138 ;"   unsigned int atnddress;
  24. 139 ;
  25. 140 address  .word $e000
  26. 150 ;
  27. 160 clear    =*
  28. 165 extn2    jsr xxxxxx
  29. 170          lda $033c     ; <addr
  30. 180 rloc1    sta !address
  31. 190          sta $22
  32. 200          lda $033d     ; >addr
  33. 210 rloc2    sta !address+1
  34. 220          sta $23
  35. 230          lda $0340     ; byte
  36. 240          ldy #$00
  37. 250          ldx $033f     ; >length
  38. 260          beq floop2
  39. 270 floop1   sta ($22),y   ; fill a
  40. 280          dey           ; page
  41. 290          bne floop1
  42. 300          inc $23       ; fill many
  43. 310          dex           ; pages
  44. 320          bne floop1
  45. 330          ldy #0
  46. 340 floop2   cpy $033e     ; <length
  47. 350          beq fexit
  48. 360          sta ($22),y   ; fill part
  49. 370          iny           ; of a page
  50. 380          bne floop2
  51. 390 fexit    rts
  52. 399 ;
  53. 400 grrows  .word 0, 320, 640, 960,1280
  54. 410      .word 1600,1920,2240,2560,2880
  55. 420      .word 3200,3520,3840,4160,4480
  56. 430      .word 4800,5120,5440,5760,6080
  57. 440      .word 6400,6720,7040,7360,7680
  58. 449 ;
  59. 450 orbits  .byte 128,64,32,16,8,4,2,1
  60. 460 andbits .byte 127,191,223,239
  61. 470         .byte 247,251,253,254
  62. 490 ;
  63. 491 ; function:
  64. 492 ;"   char [208]lot (x,y)
  65. 493 ;"   unsigned int x,y;
  66. 494 ;
  67. 495 ;
  68. 500 plot     =*
  69. 505 extn3    jsr xxxxxx
  70. 510          lda $033e     ; y coord
  71. 520          lsr a
  72. 530          lsr a
  73. 540          and #254
  74. 550          tay
  75. 560 rloc3    lda grrows,y  ; get row
  76. 570          clc           ; and add
  77. 580 rloc4    adc !address  ; bitmap
  78. 590          sta $22       ; address
  79. 600 rloc5    lda grrows+1,y
  80. 610 rloc6    adc !address+1
  81. 620          sta $23
  82. 630          lda $033c     ; x coord lo
  83. 640          and #%11111000
  84. 650          adc $22
  85. 660          sta $22
  86. 670          lda $033d     ; x coord hi
  87. 680          adc $23
  88. 690          sta $23
  89. 700          lda $033e     ; y coord
  90. 710          and #%00000111
  91. 720          tay
  92. 740          lda $033c     ; x coord lo
  93. 750          and #%00000111
  94. 760          sta $24
  95. 770          sei
  96. 780          lda $01       ; swap all
  97. 790          pha           ; rom/io out
  98. 800          lda #$30
  99. 810          sta $01
  100. 820          lda ($22),y   ; check
  101. 830 extn1    ldx !xxxxxx   ; plot type
  102. 840          beq bitoff    ; and modify
  103. 850          cpx #1        ; pixel
  104. 860          beq biton
  105. 870 bitflip  ldx $24       ; invert
  106. 880 rloc7    eor !orbits,x
  107. 890 rloc8    jmp pexit
  108. 900 biton    ldx $24       ; pixel on
  109. 910 rloc9    ora !orbits,x
  110. 920 rloc10   jmp pexit
  111. 930 bitoff   ldx $24       ; pixel off
  112. 940 rloc11   and !andbits,x
  113. 950 pexit    sta ($22),y   ; replace
  114. 960 rloc12   and !orbits,x ; byte and
  115. 970          sta $033c     ; return
  116. 980          pla           ; bit state.
  117. 990          sta $01       ; restore
  118. 1000         cli           ; io/roms.
  119. 1010         rts
  120. 1090 ;
  121. 1091 ; function:
  122. 1092 ;"   [198]ast[203]eys ()
  123. 1093 ;
  124. 1100 fastkey [178][172]
  125. 1110         sei
  126. 1120 extn4   lda #[179]irqkeys
  127. 1130         sta $0314
  128. 1140 extn5   lda #[177]irqkeys
  129. 1150         sta $0315
  130. 1160         cli
  131. 1170         rts
  132. 1299 ;
  133. 1300 irqkeys [178][172]
  134. 1310         lda #$01
  135. 1320         sta $028b
  136. 1330         lda #$00
  137. 1340         sta $028c
  138. 1350         jmp $ea31
  139. 1390 ;
  140. 1391 ; functi[145]:
  141. 1392 ;"   (NULL)low(NULL)eys ()
  142. 1393 ;
  143. 1400 slowkey =*
  144. 1410         sei
  145. 1420         lda #<$ea31
  146. 1430         sta $0314
  147. 1440         lda #>$ea31
  148. 1450         sta $0315
  149. 1460         cli
  150. 1470         rts
  151. 1480 ;
  152. 6997 ;------------------
  153. 6998 ; relocate section
  154. 6999 ;------------------
  155. 7000 creloc  =*
  156. 7010         .word (cglobal-creloc)>1-1
  157. 7020 ;
  158. 7030         .word rloc1
  159. 7040         .word rloc2
  160. 7050         .word rloc3  ; the addrs
  161. 7060         .word rloc4  ; of all
  162. 7070         .word rloc5  ; instructions
  163. 7080         .word rloc6  ; accessing
  164. 7090         .word rloc7  ; local
  165. 7100         .word rloc8  ; variables.
  166. 7110         .word rloc9
  167. 7120         .word rloc10
  168. 7130         .word rloc11
  169. 7140         .word rloc12
  170. 7996 ;
  171. 7997 ;----------------
  172. 7998 ; global section
  173. 7999 ;----------------
  174. 8000 cglobal =*
  175. 8010 numglob = 0
  176. 8020         .word numglob
  177. 8030 ;
  178. 8040 numglob _ numglob+1
  179. 8050         .asc "[193]ddress":.byt 0
  180. 8060         .byt 1
  181. 8070         .word address
  182. 8080 ;
  183. 8090 numglob _ numglob+1
  184. 8100         .asc "[195]lear":.byt 0
  185. 8110         .byt 1
  186. 8120         .word clear
  187. 8130 ;
  188. 8140 numglob _ numglob+1
  189. 8150         .asc "[208]lot":.byt 0
  190. 8160         .byt 1
  191. 8170         .word plot
  192. 8180 ;
  193. 8190 numglob _ numglob+1
  194. 8200         .asc "[198]ast[203]eys":.byt 0
  195. 8210         .byt 1
  196. 8220         .word fastkey
  197. 8230 ;
  198. 8240 numglob _ numglob+1
  199. 8250         .asc "[211]low[203]eys":.byt 0
  200. 8260         .byt 1
  201. 8270         .word slowkey
  202. 8280 ;
  203. 8290 numglob _ numglob+1
  204. 8300         .asc "irq%%":.byt 0
  205. 8310         .byt 1
  206. 8320         .word irqkeys
  207. 8330 ;
  208. 8996 ;
  209. 8997 ;------------------
  210. 8998 ; external section
  211. 8999 ;------------------
  212. 9000 cextern =*
  213. 9010 numext  = 0
  214. 9020         .word numext
  215. 9030 ;
  216. 9040 numext  _ numext+1
  217. 9050         .asc "c$start":.byt 0
  218. 9060         .word 0
  219. 9080         .word cstart
  220. 9090 ;
  221. 9100 numext  _ numext+1
  222. 9110         .asc "[208]lot[212]ype":.byt 0
  223. 9120         .word 0
  224. 9140         .word extn1
  225. 9150 ;
  226. 9160 numext  _ numext+1
  227. 9170         .asc "c$funct[164]init":.byt 0
  228. 9180         .word 0
  229. 9200         .word extn2
  230. 9210 ;
  231. 9220 numext  _ numext+1
  232. 9230         .asc "c$funct[164]init":.byt 0
  233. 9240         .word 0
  234. 9260         .word extn3
  235. 9270 ;
  236. 9280 numext  _ numext+1
  237. 9290         .asc "irq%%":.byt 0
  238. 9300         .word 2
  239. 9310         .word extn4
  240. 9320 ;
  241. 9330 numext  _ numext+1
  242. 9340         .asc "irq%%":.byt 0
  243. 9350         .word 1
  244. 9360         .word extn5
  245. 9998 ;
  246. 9999         .word 0       ; done!
  247.