home *** CD-ROM | disk | FTP | other *** search
- 1 rem =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- 2 rem =-= bitmapper =-=
- 3 rem c-64 bit map graphics
- 4 rem rupert report #28
- 5 rem ====== for c-64 only! =======
- 6 rem use -- gosub 1000 - to initialize bit map mode
- 7 rem use -- gosub 2000 - to plot point at location px,py
- 8 rem use -- gosub 3000 - to return to text mode
- 9 rem----------------------------------
- 10 gosub 1000
- 20 rem -- draw sun -- (or any circle of radius r)
- 30 r=2 : for th=0 to 2*(NULL) step .5
- 40 px=160+r*cos(th)
- 50 py=100-r*sin(th)
- 60 next
- 65 rem *********************************
- 66 rem lines 440 through 485 are for use
- 67 rem with comet catcher
- 68 rem *********************************
- 435 if sd=0 then a$=chr$(13)
- 440 if a$="" then 270
- 450 if a$=chr$(13) then gosub 3000 : print chr$(147) : end
- 460 if a$="[145]" then gosub 490 : goto 270
- 470 if a$="" then gosub 500 : goto 270
- 475 if a$<>"p" then 270
- 480 get a$ : if a$="" then 480
- 485 goto 270
- 486 rem ********************************
- 960 rem
- 970 rem >>> initialize bit map mode <<<
- 980 rem
- 990 rem set & reset bit functions
- 1000 def fnsb(n)=peek(mm) or 2^n
- 1010 def fnrb(n)=peek(mm) and (255-2^n)
- 1020 vv=53248 :rem vic-ii register 0
- 1030 :rem >>> put bit map at 8192 <<< (set bit 3 of vic register 24)
- 1040 mm=vv+24 : poke mm,fnsb(3)
- 1050 :rem >>> select bit map mode <<< (set bit 5 of vic register 17)
- 1060 mm=vv+17 : poke mm,fnsb(5)
- 1070 base=8192 :rem start bit map memory
- 1080 :rem >>> clear bit map <<<
- 1090 gosub 4000
- 1100 :rem > select colors c1 and c0 <
- 1110 c1=1 : c0=0 : cc=16*c1 + c0
- 1120 :rem fill screen memory with color
- 1130 for mm=1024 to 2023:poke mm,cc:next
- 1140 return
- 1150 :
- 1970 rem ==============================
- 1980 rem > turn on pixel at (px,py) <<<
- 1990 rem ==============================
- 2000 bit=7-(px and 7)
- 2010 mm=base+320*int(py/8)+8*int(px/8)+(py and 7)
- 2020 poke mm,fnsb(bit)
- 2030 return
- 2040 :
- 2970 rem ==========================
- 2980 rem >>> reset bit map mode <<<
- 2990 rem ==========================
- 3000 mm=vv+17 : poke mm,fnrb(5)
- 3010 rem restore screen memory base
- 3020 mm=vv+24 : poke mm,fnrb(3)
- 3030 return
- 3960 :
- 3970 ============================
- 3980 >>> clear bit map screen <<<
- 3990 ============================
- 4000 for m=828 to 828+43
- 4010 read b : poke m,b
- 4020 ck=ck+b
- 4030 next
- 4040 if ck<>5133 then print "data error in lines 4060 - 4110" : stop
- 4050 sys 828: return
- 4060 data 76,68,3,0,32,31,64,0
- 4070 data 173,63,3,133,251,173,64,3
- 4080 data 133,252,174,65,3,160,0,173
- 4090 data 67,3,136,145,251,208,251,230
- 4100 data 252,202,48,7,208,244,172,66
- 4110 data 3,208,239,96
-