C128_HiResolutionGraphic ------------------------------------- lived.ch, 13.01.2024 Listing 1 - Step 2, Step 4, Step 8... Step Step Step! 10 print chr$(27)+"e" 15 graphic 1,1 20 ti$="000000":c=1 25 fora=0to160step2 26 c=c+1 27 if c>16 then c=2 30 circle1,160,100,a,a 35 color 1,c 40 next 45 print ti$ 50 print peek(216) 51 color 1,2 53 char 1,0,0,"step 2" 55 char 1,17,12,"space!",1 60 geta$:ifa$=" " then goto 70 65 goto 60 70 graphic 0 ------------------------------------- Listing 2 - ColorMap designed as a block of 8 x 8 bit = 64 bit for one pixel. That's 1024 bytes for 8000 pixels. That's a bombastic color pixel. Guess they were just not ready for more or better. 10 print chr$(27)+"e" 15 graphic 1,1 20 ti$="000000":c=1 25 fora=0to160 26 c=c+1 27 if c>16 then c=2 30 circle1,158,100,a,a 31 circle1,159,100,a,a 32 circle1,160,100,a,a 33 circle1,161,100,a,a 34 circle1,162,100,a,a 35 color 1,c 40 next 45 print ti$ 50 print peek(216) 51 color 1,2 53 char 1,0,0,"step 00" 55 char 1,17,12,"space!",1 60 geta$:ifa$=" " then goto 70 65 goto 60 70 graphic 0 ------------------------------------- Listing 3 - 16 Colors High Resolution { 320 x 200 } But due to the cheap Color Map for High Resolution screens of C128 for BitMap, you don't really see good results. Good effects, yes... However, if you want a second clean color line, you need to keep a distance of 8 pixels for streight lines and much more for circles etc. or neighbor color register might catch you! 100 printchr$(27)+"e" 110 color 0,1:color 4,1:c=1 120 graphic1,1 160 fory=0to199 step 8 165 gosub 300 170 draw1,0,yto319,y:next 180 rem forx=0to319 step 8 185 rem gosub 300 190 rem draw1,x,0tox,199:next 200 geta$:ifa$=" " then goto 220 210 goto 200 220 graphic 0 230 end 240 rem :::::: 300 c=c+1 301 if c>16 then c=2 302 color1,c 303 return ------------------------------------- Listing 4 - 16 Colors, calculate the byte and do wonder { It's 1985! } If you have time, then you can make borders even with big boy color map. Just calculate them right and position your graphic accordingly. You can achieve nice graphic elements where nobody is going to notice the 1 byte big color pixel { unless they know about it! } 100 printchr$(27)+"e" 110 color 0,1:color 4,1:c=1 120 graphic1,1 130 color 1,7 140 box 1,15,95,304,160,,0 150 box 1,14,94,305,161,,0 160 color 1,8 170 paint 1,225,125 180 fora=0to7:color 1,7+a 190 box 1,10+(a*40),76,30+(a*40),86,,0 200 next 210 color 1,7 220 for a=0 to 9 230 box1,22+(a*30),162,27+(a*30),167,,1 240 next 250 a$="commodore 128":ca=len(a$)/2 260 b$="the show must go on!" 270 db=len(b$)/2 290 color1,4:char 1,20-ca,13,a$,1 295 color1,5:char 1,20-db,15,b$,1 297 color1,3:char 1,20-2,17,"2024",1 300 color 1,3 310 draw 1,0,168to319,168 320 draw 1,0,169to319,169 330 draw 1,0,170to319,170 340 draw 1,0,172to319,172 350 draw 1,0,173to319,173 355 w$="what are you waiting for?" 360 geta$:ifa$=" " then goto 380 365 gosub 400 370 goto 360 380 graphic 0 390 end 400 rem :::::: 403 fora=0to25:next 405 char 1,20-12,5,w$ 410 c=c+1 420 if c>16 then c=2 430 color1,c 440 return ------------------------------------- Assembly part: Standard Graphic Modes Graphic 1 {full screen 16 colors high resolution, 319 x 199 } = lda #$20, sta $d8 Graphic 2 {split screen 16 colors high resolution 319 x xxx } = lda #$60, sta $d8, *depending on text part Graphic 3 {full screen multi color low resolution 159 x 199 } = lda #$a0, sta $d8 Graphic 4 {split screen multi color low resolution 159 x xxx } = lda #$e0, sta $d8, *depending on text part Text Mode = lda #$00, sta $d8 Split Screen Line 16 { Mode 2, 4 } = lda #$b0, sta $0a34 * Split screen raster line is set using register $0a34, dec 2612 If split screen is set, value hier is copied to $d012, dec 53266 to position the raster line To position it properly: ( row line * 8 ) + 48 Default value is 208 = scanline of 20 (208-48) = 160 / 8 = 20