Jump to content
IGNORED

Change Background Color - Easiest Way?


Recommended Posts

Ok, so I looked in the "hello.bas" file by DZ-Jay and found this line of code, which seems to set the screen color:

 

MODE SCREEN_CS, STACK_WHITE, STACK_WHITE, STACK_WHITE, STACK_WHITE

So I get that SCREEN_CS sets the screen color. What I don't get is why there are four different color stacks for the same color. I tried changing them to four different colors but the screen remained white. I changed them all to red and the screen turned red.
Why are four stacks needed to set one background color? Or, is there something else this command does in the program that I didn't see, such as change the initialization routine colors that are displayed on the screen before the "HELLO WORLD" message appears?
Thanks!
Blaine
Link to comment
Share on other sites

Or if you're working in FG/BG mode, just paint the entire screen, something like this:

FOR i=0 TO 11
  PRINT AT i*20 COLOR BG_WHITE + FG_BLUE,"                    " : REM 20 spaces
NEXT

I'm not sure if there is an easier or faster way to do it, but it works and I believe some examples use this method.

CS mode is cool and gives you more foreground colours to choose from and more GROM characters to display, but not that easy to figure out. By all means try it, but remember if you get stuck there is the FG/BG mode too, mainly with colour limitations but many find it more straightforward.

  • Like 1
Link to comment
Share on other sites

 

Ok, so I looked in the "hello.bas" file by DZ-Jay and found this line of code, which seems to set the screen color:

 

MODE SCREEN_CS, STACK_WHITE, STACK_WHITE, STACK_WHITE, STACK_WHITE

 

So I get that SCREEN_CS sets the screen color. What I don't get is why there are four different color stacks for the same color. I tried changing them to four different colors but the screen remained white. I changed them all to red and the screen turned red.

 

Why are four stacks needed to set one background color? Or, is there something else this command does in the program that I didn't see, such as change the initialization routine colors that are displayed on the screen before the "HELLO WORLD" message appears?

 

Thanks!

Blaine

 

 

Those four colors are the "color stack." The Intellivision has two screen modes, "Foreground/Background" and "Color Stack." IntyBasic calls these "Mode 1" and "Mode 0," respectively. The default, as you noticed, is Color stack Mode.

 

The color stack is a 4-color circular array that sets the background color of all tiles. Here's a brief explanation of the Color Stack I wrote some time ago:

 

Imagine an array of four colours. Now consider an imaginary cursor moving across the background, from the top-left corner, all the way to the right edge, then over to the next row, and so on. As the cursor moves, it will "paint" the background of the card using the first colour in the array. It will continue painting cards the same colour until it finds a card that has the "Advance" bit set, at which point, it will start using the next colour in the array.

Now, the cursor is painting the rest of the background, row by row, with the second colour of the array until it finds another card with the "Advance" bit, which will cause it to switch to the third colour in the array. And on it goes advancing the background colour array (the "Color Stack") every time it finds a card with the "Advance" bit on. If it reaches the fourth colour, it will cycle back to the first again.

 

For a simple scene with a single background color, you only need to set the first color of the stack, since everything will use that. The "MODE" command accepts five arguments:

MODE <Screen Mode>, <Stack #0>, <Stack #1>, <Stack #2>, <Stack #3> 
As you may imagine, only the first argument is required, to set the mode. The last four are applicable only when you use "SCREEN_CS" which is "Mode 0" or Color Stack Mode.

 

In my example, we set all four colors to the same value, but we're only using the first one. The rest are just set because the "MODE" statement requires either no colors or all four.

 

-dZ.

  • Like 1
Link to comment
Share on other sites

Excellent! Thanks so much for all of this good info. I read the STIC doc and it helps also. The examples I've looked at were based around color stack. I will go have a look at FG/BG examples for comparison. Just knowing about the reason for the four colors for the background is a huge leap forward for me in understanding why things are done they way thery are in CS mode.

 

Thanks, everyone, for helping me along my learning journey!

 

Blaine

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...