ColecoFan1981 Posted January 31, 2010 Share Posted January 31, 2010 Hi, Does anyone know how to write properly the commands in BASIC necessary to allow all sixteen or so colors to show up on the screen at once? This is in regards to: *Commodore VIC-20 *Commodore 64 *Texas Instruments TI-99/4(A) *Tomy Tutor NTSC preferred. Thank you, Ben Edge Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted January 31, 2010 Share Posted January 31, 2010 TI-BASIC on the Texas Instruments TI-99/4A 100 CALL CLEAR 110 FOR L=1 TO 16 120 CALL COLOR(L,L,L) 130 CALL VCHAR(1,L*2-1,24+(L*,24) 140 NEXT L 150 GOTO 150 Quote Link to comment Share on other sites More sharing options...
LoTonah Posted January 31, 2010 Share Posted January 31, 2010 Hi, Does anyone know how to write properly the commands in BASIC necessary to allow all sixteen or so colors to show up on the screen at once? This is in regards to: *Commodore VIC-20 *Commodore 64 *Texas Instruments TI-99/4(A) *Tomy Tutor NTSC preferred. Thank you, Ben Edge As far as I remember, the VIC-20 could only display 8 colors. Maybe there's some assembler trickery to make it happen, but not in BASIC. Quote Link to comment Share on other sites More sharing options...
Herbarius Posted January 31, 2010 Share Posted January 31, 2010 (edited) This is for the C64: 100 PRINT CHR$(147):REM CLEAR SCREEN 110 FOR I=0TO15:POKE646,I:B$=CHR$(18) 120 FOR J=1TO40:B$=B$+" ":NEXT J 130 PRINT B$; :NEXT I There are 16 possible colors, numbered from 0 to 15. 646 is the memory adress which stores the current color for characters, this is why we POKE to it in line 110. CHR$(18) is the control character for "reverse mode" - because we want to create color bars, we will need to print reverse Spaces. We will print 40 spaces of each color, as that's the width of the screen line. If you want to change the screen background color first, add a line 90 POKE 53280,0: POKE 53281,0 53280 is for the border color, 53281 the actual background. In the above example, both are set to 0 (black). If you want the first bar to appear on the top line of the screen, instead of the second, add a ";" after CHR$(147) in line 100. The color table goes like this: 0 - black 1 - white 2 - red 3 - cyan 4 - purple 5 - green 6 - blue 7 - yellow 8 - orange 9 - brown 10 - light red 11 - dark grey 12 - medium grey 13 - light green 14 - light blue 15 - light grey Edited January 31, 2010 by Herbarius Quote Link to comment Share on other sites More sharing options...
LoTonah Posted February 1, 2010 Share Posted February 1, 2010 This is for the C64: 100 PRINT CHR$(147):REM CLEAR SCREEN 110 FOR I=0TO15:POKE646,I:B$=CHR$(18) 120 FOR J=1TO40:B$=B$+" ":NEXT J 130 PRINT B$; :NEXT I There are 16 possible colors, numbered from 0 to 15. 646 is the memory adress which stores the current color for characters, this is why we POKE to it in line 110. CHR$(18) is the control character for "reverse mode" - because we want to create color bars, we will need to print reverse Spaces. We will print 40 spaces of each color, as that's the width of the screen line. If you want to change the screen background color first, add a line 90 POKE 53280,0: POKE 53281,0 53280 is for the border color, 53281 the actual background. In the above example, both are set to 0 (black). If you want the first bar to appear on the top line of the screen, instead of the second, add a ";" after CHR$(147) in line 100. The color table goes like this: 0 - black 1 - white 2 - red 3 - cyan 4 - purple 5 - green 6 - blue 7 - yellow 8 - orange 9 - brown 10 - light red 11 - dark grey 12 - medium grey 13 - light green 14 - light blue 15 - light grey I couldn't sleep, so I made your program look more like the TI-99/4A. Yes, I'm that A-type. LOL 100 PRINT CHR$(147):REM CLEAR SCREEN 110 POKE 53280,13:POKE 53281,13 120 FOR C=0 TO 20 130 FOR I=0 TO 15 140 POKE 646,I 150 PRINT CHR$(18)+" "; 160 POKE 646,13 170 PRINT CHR$(18)+" "; 180 NEXT I 190 PRINT 200 NEXT C 210 GET K$ 220 IF K$<>" " THEN GOTO 210 230 POKE 53280,14 240 POKE 53281,6 250 POKE 646,14 260 PRINT CHR$(18)+" "; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.