10 rem a 256-color bitmap behind the text screen, drawn by the blitter 20 poke 53359,86:poke 53359,88:poke 53359,33 30 if peek(53312)<>86 or peek(53313)<>88 then print "no vic-x here":end 40 print "{clr}setting up..." 50 rem --- palette entries 16-20 at $20040: 4 bytes each (r,g,b,spare) 60 a=131072+4*16 70 for i=0 to 4:for j=0 to 2:read v:gosub 1000:next:a=a+1:next 80 data 16,16,48, 228,60,40, 250,212,64, 120,178,238, 255,255,255 90 rem --- four blitter descriptors at $20880, 32 bytes apart, chained: 100 rem clear the bitmap, then three rectangles 110 for n=0 to 3:a=133248+32*n:for i=0 to 20:read v:gosub 1000:next:next 120 data 1,4, 0,0,0,0, 0,0,0,0, 0,250, 0,0, 0,0, 0,0, 16,0,1 130 data 1,20, 0,0,0,0, 40,50,0,0, 240,0, 120,0, 0,0, 64,1, 17,0,2 140 data 1,20, 0,0,0,0, 80,75,0,0, 160,0, 80,0, 0,0, 64,1, 18,0,3 150 data 1,20, 0,0,0,0, 120,100,0,0, 80,0, 40,0, 0,0, 64,1, 19,0,255 160 poke 53338,0:rem start at descriptor 0 170 if peek(53338)>127 then 170:rem wait while the blitter is busy 180 rem --- a diagonal line, pixel by pixel: address = y*320+x 190 for i=0 to 199:a=60+i*321:v=20:gosub 1000:next 200 rem --- layer 0 at $20800: 8-bit bitmap at vram 0, 320 bytes a line 210 a=133120:for i=0 to 14:read v:gosub 1000:next 220 data 3,0, 0,0,0, 0,0,0, 0,0, 0,0, 64,1, 0 230 rem --- layer 0 on, and let it show through the text background 240 poke 53320,17 250 print "{clr}text on top of 256 colors" 260 end 1000 rem --- write v at port address a, then a=a+1 1010 h=int(a/65536):m=int((a-h*65536)/256) 1020 poke 53324,a-h*65536-m*256:poke 53325,m:poke 53326,h 1030 poke 53327,v:a=a+1:return