THE-FACE-C128-{MULTIPLIED} -------------------------------------------------------------------------------------------------- TOOL: BASIC 7.0 {Commodore C128} Language: BASIC 7.0 Extra: None Author: Misel Zivanovic Note: (C) 15th JAN 2024 - www.lived.ch, mzretro.ch Information: None ----------------------------------------------------------------------------------------------------- Faces/C128: { four characters } Listing 1 - Full Screen Graphics C128 { BASIC } { modified listing, Final }, 19:22 07.10.2024 All you need to do is copy/paste into an C128 emulator: VICE, Cloanto's C64Forever etc. I am using here 4 blocks {bricks}, each 8 bytes in size and the pattern is arranged in pairs: 12121212 etc. {40 blocks wide = 8 x 40 = 320 pixels} 34343434 etc. {same here, of course} 12121212 ... 34343434.... Vertical expansion is also in pairs, which means it is going only until line 24 and 25th is used for text. When first part is done, until the line 510, the 2nd part is modifying only some existing bits to achieve an interesting effect = 3x face expression: smile, sad, neutral in random order. This means that every picture is different from the previous one. If you like one special, better save it, because chances are equal to zero, you'll ever see it again! RUN 1000 to save it if you want! {A floppy should be inside the drive!} I am not a skilled artist, but this code could be extended to make a bigger picture {e.g 4x4} and add then some more significant random changes to it and create state of the art Commodore C128 picture. Who will try it? Anyone? ;-) >>> Hit SPACE to EXIT the GRAPHICS MODE 1 ----------------------------------------------------------------------------------------------------- COMMODORE C128 BASIC 7.0 CODE: ----------------------------------------------------------------------------------------------------- list 1 rem by www.lived.ch, www.mzretro.ch 2 rem 100 graphic 1,1: rem graphic mode 101 color 1,5: rem drawing color 105 gs=8192: rem graphic area $2000 106 nl=320: rem gfx horizontal res 107 cs=7168: rem graphic color ram 108 cl=40: rem 1 color=8=byte!=320 120 for y = 0 to 23 step 2 130 for x = 0 to 39 step 2 140 poke gs+(nl*y)+0+(x*8),173 150 poke gs+(nl*y)+1+(x*8),80 160 poke gs+(nl*y)+2+(x*8),182 170 poke gs+(nl*y)+3+(x*8),96 180 poke gs+(nl*y)+4+(x*8),193 190 poke gs+(nl*y)+5+(x*8),160 200 poke gs+(nl*y)+6+(x*8),128 210 poke gs+(nl*y)+7+(x*8),143 220 rem 230 poke gs+(nl*y)+0+(x+1)*8,181 240 poke gs+(nl*y)+1+(x+1)*8,10 250 poke gs+(nl*y)+2+(x+1)*8,109 260 poke gs+(nl*y)+3+(x+1)*8,6 270 poke gs+(nl*y)+4+(x+1)*8,131 280 poke gs+(nl*y)+5+(x+1)*8,5 290 poke gs+(nl*y)+6+(x+1)*8,1 300 poke gs+(nl*y)+7+(x+1)*8,241 310 rem 320 poke gs+nl*(y+1)+0+(x)*8,192 330 poke gs+nl*(y+1)+1+(x)*8,127 340 poke gs+nl*(y+1)+2+(x)*8,197 350 poke gs+nl*(y+1)+3+(x)*8,93 360 poke gs+nl*(y+1)+4+(x)*8,221 370 poke gs+nl*(y+1)+5+(x)*8,93 380 poke gs+nl*(y+1)+6+(x)*8,197 390 poke gs+nl*(y+1)+7+(x)*8,127 400 rem 410 poke gs+nl*(y+1)+0+(x+1)*8,2 420 poke gs+nl*(y+1)+1+(x+1)*8,254 430 poke gs+nl*(y+1)+2+(x+1)*8,35 440 poke gs+nl*(y+1)+3+(x+1)*8,170 450 poke gs+nl*(y+1)+4+(x+1)*8,35 460 poke gs+nl*(y+1)+5+(x+1)*8,107 470 poke gs+nl*(y+1)+6+(x+1)*8,35 480 poke gs+nl*(y+1)+7+(x+1)*8,254 490 rem 500 next x 510 next y 520 rem this part is drawing diff 530 rem faces 540 for y=0 to 23 step 2 550 for x=0 to 19 560 ex=int(rnd(1)*3)+1 570 gosub 860 580 if ex=1 then gosub 620 590 if ex=2 then gosub 690 600 if ex=3 then goto 770 610 goto 770 620 fora=6 to 6 630 poke gs+(x*16)+(nl*(0+y))+a,16 640 next 650 fora=6to6 660 poke gs+8+(x*16)+(nl*(0+y))+a,8 660 poke gs+8+(x*16)+(nl*(0+y))+a,8 670 next:return 690 rem next row ::::::::::::::::: 700 fora=0 to 0 710 poke gs+(x*16)+(nl*(1+y))+a,16 720 next 730 fora=0 to 0 740 poke gs+8+(x*16)+(nl*(1+y))+a,8 750 next: return 770 rem exit rnd and next rotation 780 next:next 790 b$="commodore c128/it can be done!" 800 c$=" 2024!":d$=b$+c$ 810 t=len(d$)/2:color 1,15 820 char 1,20-t,24,d$,1 830 get a$:if a$=" " then goto 850 840 goto 830 850 graphic 0:end 860 rem colors 870 l=(rnd(1)*10)+1 880 poke cs+(x*2)+(cl*(0+y)),l 890 o=(rnd(1)*10)+1 900 poke cs+1+(x*2)+(cl*(0+y)),o 910 k=(rnd(1)*10)+1 920 poke cs+(x*2)+(cl*(1+y)),k 930 i=(rnd(1)*10)+1 940 poke cs+1+(x*2)+(cl*(1+y)),i 950 return 960 end 1000 rn=int(rnd(ti)*3000)+1000 1010 gg$="c128gfx00"+str$(rn) 1020 cc$="c128col00"+str$(rn) 1030 rem graphic 1040 bsave (gg$),b15,p8192top16384 1050 rem color 1060 bsave (cc$),b15,p7168top8169 1070 graphic 0:print "gfx saved":end 1080 rem : 2000 rem bload"graphicpartname" 2010 rem bload"colorpartname" 2020 rem graphic 1,0: no gfx clear 2030 rem get a$:if a$=" " then 2050 2040 rem goto 2030 2050 rem graphic 0:end