Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.67 KB | None | 0 0
  1. ; PAL Colour Bars
  2. ; And full BGR(2:3:3) colourspace
  3. ; of Vector-06c
  4. ;
  5. ; Assemble with the Pretty i8080 Assembler
  6. ;
  7. ; Author: Viacheslav Slavinsky
  8. ;
  9. ; This code is Public Domain
  10. ;
  11. .binfile clrspace.rom
  12. .nodump
  13.  
  14.  
  15. dlines equ 128
  16. dlist equ $4000
  17. dlend equ dlist+dlines*8*3
  18. ddata equ dlist+$2000
  19. ddend equ ddata+dlines*8*2
  20.  
  21.  
  22. .org $100
  23. clrscr:
  24. di
  25. lxi h, $8000
  26. cs1: xra a
  27. out $10
  28. mov m, a
  29. inx h
  30. ora h
  31. jnz cs1
  32.  
  33. lxi sp, $100
  34.  
  35. ; draw pal colourbars
  36. ; 8 bars (4 columns each), 128 lines high
  37. ; easy colours $e000=R, $c000=G, $a000=B
  38. ;
  39. ; white
  40. lxi d, $e000
  41. lxi b, 256*4*0+256
  42. call palbar
  43. lxi d, $c000
  44. lxi b, 256*4*0+256
  45. call palbar
  46. lxi d, $a000
  47. lxi b, 256*4*0+256
  48. call palbar
  49.  
  50. ; yellow
  51. lxi d, $e000
  52. lxi b, 256*4*1+256
  53. call palbar
  54. lxi d, $c000
  55. lxi b, 256*4*1+256
  56. call palbar
  57.  
  58. ; cyan
  59. lxi d, $c000
  60. lxi b, 256*4*2+256
  61. call palbar
  62. lxi d, $a000
  63. lxi b, 256*4*2+256
  64. call palbar
  65.  
  66. ; green
  67. lxi d, $c000
  68. lxi b, 256*4*3+256
  69. call palbar
  70.  
  71. ; magenta
  72. lxi d, $e000
  73. lxi b, 256*4*4+256
  74. call palbar
  75. lxi d, $a000
  76. lxi b, 256*4*4+256
  77. call palbar
  78.  
  79. ; red
  80. lxi d, $e000
  81. lxi b, 256*4*5+256
  82. call palbar
  83.  
  84. ; blue
  85. lxi d, $a000
  86. lxi b, 256*4*6+256
  87. call palbar
  88.  
  89. ; black ;)
  90.  
  91. jmp part2
  92. palbar:
  93. lxi h, 0
  94. dad sp
  95. shld savedsp
  96. xchg
  97. dad b
  98. sphl
  99. mvi b, $ff
  100. mov c, b
  101. mvi e, 4
  102. barpo: mvi d, 64
  103. barpu: push b
  104. dcr d
  105. jnz barpu
  106. lxi h, 128+256
  107. dad sp
  108. sphl
  109. dcr e
  110. jnz barpo
  111. lhld savedsp
  112. sphl
  113. ret
  114. savedsp: dw 0
  115.  
  116. blit:
  117. shld gdstld+1
  118. xchg
  119. shld gsrcld+1
  120. lxi h, 0
  121. dad sp
  122. shld savedsp
  123.  
  124. gsrcld: lxi sp, 0
  125. gdstld: lxi h, 0
  126. ;mvi b, $4
  127.  
  128. gorra:
  129. pop d
  130. dcr l
  131. mov m, e
  132. dcr l
  133. mov m, d
  134. jnz gorra
  135. inr h
  136. mov l, c
  137. dcr b
  138. jnz gorra
  139. lhld savedsp
  140. sphl
  141. ret
  142.  
  143. part2:
  144. lxi h, $8080 ; destination
  145. lxi d, tits_0
  146. lxi b, $0880
  147. call blit
  148.  
  149. ; make palette
  150. ; start with colour in a=0
  151. ; Blue spins each cycle (they be columns)
  152. ; R increments every 4 B
  153. ; G increments every 4 R
  154. lxi h, sintbl
  155. lxi d, rgysorted
  156. xra a
  157. mov b, a
  158. palea:
  159. mov m, a
  160. adi $40 ; add 1 to blue, overflow to R
  161. ;adc b
  162. jnc paleb
  163. xchg
  164. inx h
  165. mov a, m
  166. xchg
  167. paleb:
  168. inr l
  169. jnz palea
  170.  
  171. ; prepare display list
  172. ;
  173. ; one "poxel"
  174. ; pop psw
  175. ; out $c
  176. ; == db $f1,$d3,$0c
  177. ; 3 bytes, 24 cycles; 8 poxels per scanline exactly
  178. lxi h, dlines
  179. lxi b, $0cd3
  180. lxi d, $f100
  181. lxi sp, dlend+1 ; that's a ret
  182. mvi a, $c9
  183. push psw
  184. inx sp
  185. pox1:
  186. lxi b, $00db ; dummy in instruction
  187. lxi d, $f100
  188. push b
  189. push d
  190. inx sp
  191. push b
  192. push d
  193. inx sp
  194. push b
  195. push d
  196. inx sp
  197.  
  198. lxi b, $0cd3
  199. lxi d, $f100
  200. push b
  201. push d
  202. inx sp
  203. push b
  204. push d
  205. inx sp
  206. push b
  207. push d
  208. inx sp
  209. push b
  210. push d
  211. inx sp
  212. push b
  213. push d
  214. inx sp
  215.  
  216.  
  217. dcx h
  218. mov a, h
  219. ora l
  220. jnz pox1
  221.  
  222. ; a == 0
  223. sta dactr
  224. lxi b, $00fc
  225. dalup:
  226. ; prepare actual poxel data
  227. lxi sp, ddend
  228. lxi d, dlines*8
  229. dafi:
  230. lxi h, dactr
  231. mov a, m
  232. ani $4
  233. jz daclip
  234.  
  235. lxi h, sintbl
  236. dad b
  237. mov a, m
  238. push psw
  239. jmp dafi00
  240. daclip:
  241. xra a
  242. push psw
  243. dafi00:
  244. inr c
  245.  
  246. ;
  247. lxi h, dactr
  248. inr m
  249. mov a, m
  250. ani $0f
  251. jnz dafi2
  252. mov a, c
  253. sbi 4 ; -4, advance to next colourline
  254. mov c, a
  255. jmp dafi3
  256. dafi2:
  257. mov a, m
  258. ani $7
  259. jnz dafi3
  260. mov a, c
  261. sbi 8 ; -8, stay at the current colourline
  262. mov c, a
  263. dafi3:
  264. dcx d
  265. mov a, d
  266. ora e
  267. jnz dafi
  268.  
  269. mvi a, $c3
  270. sta $38
  271.  
  272. intreturn:
  273. xra a
  274. out $c
  275. lxi sp, $100
  276. lxi h, plasmaint
  277. shld $39
  278. puuup:
  279. ei
  280. hlt
  281.  
  282. ;white 1 1 1
  283. ;yellow 1 1 0
  284. ;cyan 0 1 1
  285. ;green 0 1 0
  286. ;magenta 1 0 1
  287. ;red 1 0 0
  288. ;blue 0 0 1
  289. ;black 0 0 0
  290.  
  291. palpal: ; @75%
  292. ;db $00, $07, $38, $3f, $c0, $c7, $f8, $ff
  293. db $00, $05, $28, $2d, $80, $84, $a0, $a4
  294.  
  295. plasmaint:
  296.  
  297. nop
  298. nop
  299. nop
  300. nop
  301. nop
  302. nop
  303.  
  304. mvi a, 8
  305. out $2
  306. mvi a, $ff
  307. out $c
  308.  
  309. ; program palette for pal colourbarnik
  310. lxi h, palpal+7
  311. mvi b, 7
  312. pallup: mov a, b
  313. out $2
  314. mov a, m
  315. out $c
  316. dcx h
  317. out $c
  318. dcr b
  319. out $c
  320. jp pallup
  321.  
  322. ;mvi a, 1
  323. ;out 02
  324. ;xra a
  325. ;out $0c
  326. ;out 02
  327. mvi l, $c0
  328. xthl
  329. xthl
  330. ;jmp intreturn
  331.  
  332. pivw: xthl
  333. xthl
  334. xthl
  335. xthl
  336. xthl
  337. xthl
  338. dcr l
  339. jnz pivw
  340.  
  341. lxi h, intreturn
  342. lxi sp, ddend+2
  343. push h
  344. lxi sp, ddata
  345. jmp dlist
  346.  
  347. ; tits or gtfo
  348. tits_columns equ 8
  349. tits_rows equ 128
  350. ; layer 0
  351. tits_0:
  352. db 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,080h,0f7h,0f6h,0f7h,0f6h,0f5h,0f6h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0edh,0edh,0e9h,0e5h,0edh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,087h,093h,093h,086h,092h,092h,087h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0feh,0fch,0f8h,0f0h,0f0h,0e0h,0e1h,0e1h,0e1h,0e1h,0e1h,0e1h,0f0h,0f0h,0f0h,0f8h,0f8h,0f8h,0fch,0fch,0feh,0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ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,03fh,03fh,01fh,01fh,01fh,01fh,01fh,03eh,03eh,07eh,0fch,0fch,0fch,0fch,0fch,0fch,0fch,0fch,0fch,0feh,0feh,0feh,0ffh,0ffh,03fh,01fh,01h,00h,0e0h,0feh,0ffh,0ffh,0feh,0fch,0fch,0feh,0ffh,0fch,0feh,0ffh,
  355. db 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,057h,057h,057h,056h,043h,0fbh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,07fh,07fh,0ffh,07fh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0c7h,04bh,04bh,04ah,0c7h,0cfh,0cfh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0feh,0f8h,0f0h,0e0h,0c1h,083h,07h,0fh,0fh,01fh,01fh,03fh,03fh,03fh,03fh,03fh,03fh,03fh,03fh,03fh,01fh,01fh,0fh,07h,07h,081h,0c0h,0e0h,00h,00h,00h,0c0h,0ffh,033h,093h,0f3h,033h,093h,098h,03ch,0ffh,
  356. db 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0feh,0feh,03eh,0deh,01eh,0deh,01eh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,058h,05bh,058h,05bh,08h,0efh,0ffh,0ffh,0ffh,0ffh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ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,067h,027h,027h,027h,027h,027h,020h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,033h,07dh,071h,06dh,071h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,07fh,0ffh,069h,029h,029h,029h,060h,0fch,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,07fh,03fh,01fh,0fh,0fh,087h,087h,0c7h,0c3h,0c3h,0e3h,0e3h,0e3h,0e3h,0e3h,0c3h,0c3h,0c7h,087h,08fh,0fh,01fh,01fh,03fh,07fh,03fh,01fh,0fh,07h,0ffh,071h,024h,024h,030h,03ch,024h,071h,0ffh,
  359. db 080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,
  360.  
  361.  
  362. rgysorted: db , 0, 1, 2, 9, 3, 10, 4, 11, 5, 18, 12, 6, 19, 13, 7, 20, 14, 27, 21, 15, 28, 22, 29, 23, 36, 30, 37, 31, 38, 45, 39, 46, 47, 54, 55, 63, 62, 61, 60, 53, 59, 52, 58, 51, 57, 44, 50, 56, 43, 49, 42, 48, 35, 41, 34, 40, 33, 26, 32, 25, 24, 17, 16, 8
  363.  
  364.  
  365. dactr: equ .
  366. sintbl equ $1000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement