From df100d99b36645ff30ce3ede3f344e4643a3ec5a Mon Sep 17 00:00:00 2001 From: Tom Wilson Date: Wed, 24 Jan 2024 15:44:55 -0800 Subject: [PATCH 1/2] Create palette.bas Just a quick program to display the color palette --- basic/palette.bas | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 basic/palette.bas diff --git a/basic/palette.bas b/basic/palette.bas new file mode 100644 index 0000000..e1dca3b --- /dev/null +++ b/basic/palette.bas @@ -0,0 +1,18 @@ +0 REM DISPLAYS THE DEFAULT PALETTE WITH INDEX NUMBERS +10 XS=20:YS=15 +20 SCREEN 128 +30 RECT 0,0,319,239,0 +40 C=0 +50 FOR Y=0 TO 15 +60 Y1=Y*YS:Y2=Y1+YS-1 +70 Y3=Y1+8 +80 FOR X=0 TO 15 +90 X1=X*XS:X2=X1+XS-1 +100 X3=X1 +110 RECT X1,Y1,X2,Y2,C +120 C$=MID$(STR$(C),2) +130 CHAR X3+1,Y3+1,0,C$ +140 CHAR X3,Y3,1,C$ +150 C=C+1 +160 NEXT +170 NEXT From d2978ee773c53bb9079c0b6c49d0f50e4635c0fb Mon Sep 17 00:00:00 2001 From: Tom Wilson Date: Wed, 24 Jan 2024 16:12:57 -0800 Subject: [PATCH 2/2] Update palette.bas --- basic/palette.bas | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/basic/palette.bas b/basic/palette.bas index e1dca3b..e20494b 100644 --- a/basic/palette.bas +++ b/basic/palette.bas @@ -1,18 +1,28 @@ -0 REM DISPLAYS THE DEFAULT PALETTE WITH INDEX NUMBERS -10 XS=20:YS=15 -20 SCREEN 128 -30 RECT 0,0,319,239,0 -40 C=0 -50 FOR Y=0 TO 15 -60 Y1=Y*YS:Y2=Y1+YS-1 -70 Y3=Y1+8 -80 FOR X=0 TO 15 -90 X1=X*XS:X2=X1+XS-1 -100 X3=X1 -110 RECT X1,Y1,X2,Y2,C -120 C$=MID$(STR$(C),2) -130 CHAR X3+1,Y3+1,0,C$ -140 CHAR X3,Y3,1,C$ -150 C=C+1 -160 NEXT -170 NEXT +10 REM DISPLAYS THE DEFAULT PALETTE +15 REM MOVE THE MOUSE TO SEE THE COLOR VALUE +20 DIM P$(15,15) +30 XS=10:YS=10 +40 SCREEN 128 +50 RECT 0,0,319,239,0 +60 C=0 +70 FOR Y=0 TO 15 +80 Y1=Y*YS:Y2=Y1+YS-1 +90 Y3=Y1+8 +100 FOR X=0 TO 15 +110 X1=X*XS:X2=X1+XS-1 +120 X3=X1 +130 RECT X1,Y1,X2,Y2,C +140 CX=$FA00+C*2 +150 C$=HEX$(VPEEK($1,CX))+HEX$(VPEEK($1,CX+1)) +170 P$(X,Y) = C$ +180 C=C+1 +190 NEXT +200 NEXT +210 MOUSE 1 +220 X=INT(MX/XS) +230 Y=INT(MY/YS) +240 IF X<0 OR X>15 THEN 220 +250 IF Y<0 OR Y>15 THEN 220 +260 LOCATE 21,9 +270 PRINT P$(X,Y) +280 GOTO 220