TriOS-alt/demo/VGA_JB_Demo - Archive [Dat.../VGA_Rend_JB_001.spin

1 line
6.4 KiB
Plaintext
Raw Normal View History

2010-11-26 23:58:06 +01:00
<EFBFBD><EFBFBD>''*************************************** ''* VGA Render Driver v1.001 * ''* (C) Jim Bagley * ''*************************************** VAR long cogs[6] PUB start(params) | i repeat i from 0 to long[params][12]-1 long[params][0]:=i long[params][2]:=long[params][9]+(i*(256+8)) cogs[i]:=cognew(@entry,params)+1 repeat 1000 PUB stop(params) | i repeat i from 0 to long[params][12]-1 if cogs[i] cogstop(i) dat org 0 entry mov t1,PAR rdbyte cognum,t1 add t1,#4 rdword imageptr,t1 add t1,#4 rdword pixelbase,t1 add t1,#4 rdword screenptr,t1 add t1,#4 rdword charsptr,t1 add t1,#4 rdword sprptr,t1 add t1,#4 rdword sprchr,t1 add t1,#4 rdword sprnum,t1 add t1,#12 rdword lineptr,t1 add t1,#8 rdbyte cognums,t1 :restart mov linenum,cognum :loop mov pixelptr,pixelbase ' sub pixelptr,#4 'don't need to subtract 4, as display starts 4 pixels in. mov chrptr,linenum and chrptr,#7 shl chrptr,#2 add chrptr,charsptr mov scrptr,linenum shr scrptr,#3 shl scrptr,#6+1 add scrptr,screenptr mov t1,#64 :xlp rdword t2,scrptr add scrptr,#2 add t2,chrptr rdlong t3,t2 add pixelptr,#4 wrlong t3,pixelptr djnz t1,#:xlp mov t2,sprptr mov t1,sprnum tjz t1,#:wait :sprlp rdword t4,t2 add t2,#2 mov t6,linenum rdword t3,t2 add t2,#2 add t6,#8 rdword t5,t2 add t2,#2 add t5,sprchr and t3,#255 sub t6,t3 wc,wz if_b jmp #:skpspr cmp t6,#8 wc,wz if_ae jmp #:skpspr shl t6,#2 add t6,t5 and t4,#511 '