CrazyBoss Posted February 25, 2016 Share Posted February 25, 2016 Hi Is there a way to make more colors per card ? I only did the fb/bg mode, never tested the cs mode. Is it possible for a card to have more than one color? What is the avantage to use the cs mode? Any one have or can create a cs mode demo in intybasic? Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 25, 2016 Share Posted February 25, 2016 Is there a way to make more colors per card ? Not unless you use flicker tricks or overlay a MOB. Is it possible for a card to have more than one color? In colour stack mode you have the choice of 16 foreground colours and 1 of 4 background colours (all taken from the 16 available). You can also advance the colour stack to get the next colour in the stack on a consecutive card basis. What is the avantage to use the cs mode? 16 foreground colours without having to resort to inverse video and the full set of background colours but you can only chose 4. Any one have or can create a cs mode demo in intybasic? Have a look at the the GRAM font handling code because that uses colour stack (all colours on the stack are black) and foreground/background mode. 1 Quote Link to comment Share on other sites More sharing options...
CrazyBoss Posted February 25, 2016 Author Share Posted February 25, 2016 ok, what is the idea of the color stack square mode ? something like 4bits in each color? Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 25, 2016 Share Posted February 25, 2016 ok, what is the idea of the color stack square mode ? something like 4bits in each color? Not quite. It gives you a resolution of 40x24 (w x h) and each chunky pixel can be one of the first 7 colours (there is a transparent pixel too). Check out this example code for a line drawing routine that works in coloured squares mode. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 26, 2016 Share Posted February 26, 2016 In colour stack mode you have the choice of 16 foreground colours and 1 of 4 background colours (all taken from the 16 available). You can also advance the colour stack to get the next colour in the stack on a consecutive card basis. Just to add to this, when painting your cards, you cannot choose freely from the four background colours. The Color Stack is like a "circular array" of four background colours, so each card will use the current background color of the stack until you advance the stack pointer to the next colour. Then all cards will use the new background colour until you advance the stack again, and so on. When the last color is reached, advancing the stack will go back to the first background colour. It requires a bit of trickery to master, but it is very flexible. The best part is that it allows you to use the entirety of GROM (so no need to copy letters to GRAM), and the full 16 colours for the foreground of each card. Here's a bit of the summary, taken from the "stic.txt" document: All 320 GROM pictures are available. For the foreground, the 8 primary colors are available to GROM cards, and all 16 colors are available to GRAM cards. The current point in the color stack determines the background color for the card. -dZ. Quote Link to comment Share on other sites More sharing options...
fsuinnc Posted February 27, 2016 Share Posted February 27, 2016 It requires a bit of trickery to master, but it is very flexible. The best part is that it allows you to use the entirety of GROM (so no need to copy letters to GRAM), and the full 16 colours for the foreground of each card. Here's a bit of the summary, taken from the "stic.txt" document: All 320 GROM pictures are available. For the foreground, the 8 primary colors are available to GROM cards, and all 16 colors are available to GRAM cards. The current point in the color stack determines the background color for the card. -dZ. Sorry, I am a bit confused by this. you say you can use the 16 colors for the foreground of each card but then the summary taken from stic.txt says you can only use the 8 primary colors as the foreground colors for GROM. does IntyBASIC support advancing the stack pointer to change to the next background color? Copying the letters to GRAM kind of started after I played Stunt Cycle on real hardware and I didn't like the way the colors looked. I was making changes but wanted the player info on the screen to match the color of the player sprite and this caused me problems. GB suggested making my own font in GRAM (and then graciously created code to move the existing letters). I am not sure I understand the stack background pointer but for my purposes I really just want one color (blue) as the background for the whole game but want to allow any other color to be used as the player color and text for scoring, etc. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 27, 2016 Share Posted February 27, 2016 does IntyBASIC support advancing the stack pointer to change to the next background color? Yes. Its not handled by IntyBASIC directly. You set a flag in each BACKTAB card to advance the colour stack. I'll put together a quick example in a minute. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 27, 2016 Share Posted February 27, 2016 Here ya go! This code :- include "constants.bas" mode 0, STACK_PINK,STACK_CYAN,STACK_BLUE,STACK_PURPLE wait #BACKTAB(0)=CS_ADVANCE+(("T"-" ")*+CS_WHITE ' Background from pink to cyan #BACKTAB(1)=CS_ADVANCE+(("E"-" ")*+CS_YELLOW ' Background from cyan to blue #BACKTAB(2)=CS_ADVANCE+(("S"-" ")*+CS_YELLOW ' Background from blue to purple #BACKTAB(3)=CS_ADVANCE+(("T"-" ")*+CS_BLACK ' Background from purple to pink ' Rest of screen now has a pink background. print at SCREENPOS(5,5) color CS_BLACK, "Hello" loop: goto loop Produces this display :- 3 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 27, 2016 Share Posted February 27, 2016 Sorry, I am a bit confused by this. you say you can use the 16 colors for the foreground of each card but then the summary taken from stic.txt says you can only use the 8 primary colors as the foreground colors for GROM. Sorry for the confusion. It allows all 16 colours for GRAM cards, but only the first "primary" colours for GROM cards. It does allow you to use all 230 GROM cards, unlike FG/BG mode. does IntyBASIC support advancing the stack pointer to change to the next background color? It does, inasmuch as it doesn't get in the way of you doing it when POKE'ing a value into the BACKTAB, or using the colour attributes in the PRINT command. You just have to set bit #13 of the BACKTAB card (CS_ADVANCE in the "constants.bas" file). Copying the letters to GRAM kind of started after I played Stunt Cycle on real hardware and I didn't like the way the colors looked. I was making changes but wanted the player info on the screen to match the color of the player sprite and this caused me problems. GB suggested making my own font in GRAM (and then graciously created code to move the existing letters). I am not sure I understand the stack background pointer but for my purposes I really just want one color (blue) as the background for the whole game but want to allow any other color to be used as the player color and text for scoring, etc. 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. This is how the "Color Stack" works. By judiciously setting the "Advance" bit on specific cards, you can change the background colour of the scene to make it more colourful. For instance, you could set the top half in blue and the bottom half in green for a "sky and grass" landscape. Notice that this only sets the background colour of the cards, i.e., their "transparent" pixels; you still have control over the foreground colour of each card individually. Conversely, if you don't set any of the "Advance" bits on any card at all, the entire background will use the first colour in the stack. This is why I said that it required a bit of "trickery." You can get very "organic" looking artwork by mixing foreground and background colours in clever ways, advancing the stack at special points as needed. Does this make sense? The best thing I find of Color Stack mode is that it allows the use of the full GROM, that means all sorts of geometric shapes, which can be used to enhance the scene -- that is, in addition to GRAM. In FG/BG mode, you only get 64 cards of GRAM and upper-case letters in GROM. -dZ. 1 Quote Link to comment Share on other sites More sharing options...
fsuinnc Posted February 28, 2016 Share Posted February 28, 2016 Here ya go! This code :- include "constants.bas" mode 0, STACK_PINK,STACK_CYAN,STACK_BLUE,STACK_PURPLE wait #BACKTAB(0)=CS_ADVANCE+(("T"-" ")*+CS_WHITE ' Background from pink to cyan #BACKTAB(1)=CS_ADVANCE+(("E"-" ")*+CS_YELLOW ' Background from cyan to blue #BACKTAB(2)=CS_ADVANCE+(("S"-" ")*+CS_YELLOW ' Background from blue to purple #BACKTAB(3)=CS_ADVANCE+(("T"-" ")*+CS_BLACK ' Background from purple to pink ' Rest of screen now has a pink background. print at SCREENPOS(5,5) color CS_BLACK, "Hello" loop: goto loop Produces this display :-shot0000.gif thanks. very nice example as usual. Quote Link to comment Share on other sites More sharing options...
fsuinnc Posted February 28, 2016 Share Posted February 28, 2016 Does this make sense? The best thing I find of Color Stack mode is that it allows the use of the full GROM, that means all sorts of geometric shapes, which can be used to enhance the scene -- that is, in addition to GRAM. In FG/BG mode, you only get 64 cards of GRAM and upper-case letters in GROM. -dZ. Yes, this makes perfect sense. Thanks. I have looked over the IntyBasic manual and also constants.bas (repeatedly) and I sometimes see or notice different things like Display starts in color-stack mode, each card of the 20x12 screen can have the bit 13 set to 1 so it avances current pointer to color-stack and changes the background color. In order to change the 4 color-stack predefined values, you should use this: MODE 0,1,2,3,4 ' Select blue color as initial color and load other 3 colors But they don't make sense to me so my eyes glaze over and I move on. I did not realize that bit 13 being set matched to cs_advance and that I could use multiple background colors on the same screen. Now it makes sense and I realize I can simplify my screens by taking advantage of this. Awesome! Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted February 28, 2016 Share Posted February 28, 2016 (edited) Yes, this makes perfect sense. Thanks. I have looked over the IntyBasic manual and also constants.bas (repeatedly) and I sometimes see or notice different things like Display starts in color-stack mode, each card of the 20x12 screen can have the bit 13 set to 1 so it avances current pointer to color-stack and changes the background color. In order to change the 4 color-stack predefined values, you should use this: MODE 0,1,2,3,4 ' Select blue color as initial color and load other 3 colors But they don't make sense to me so my eyes glaze over and I move on. I did not realize that bit 13 being set matched to cs_advance and that I could use multiple background colors on the same screen. Now it makes sense and I realize I can simplify my screens by taking advantage of this. Awesome! One thing to note is that, as opposed to FG/BG mode, in Color Stack mode you cannot randomly change the background colour; it must be in order as defined in the stack. That is, you can advance the stack pointer to the next colour, but you cannot skip colours. This is where the clever "trickery" comes in. There are techniques you can use like "reverse video" (where you reverse the foreground and background pixels of a card) that let you "skip" a colour, or use a colour in the stack in a different way. Here's a description I wrote some time ago on this technique, and here's an example where I applied it. -dZ. Edited February 28, 2016 by DZ-Jay 1 Quote Link to comment Share on other sites More sharing options...
First Spear Posted March 4, 2016 Share Posted March 4, 2016 Someone please "sticky" this thread. I asked these questions about a year ago, and it was good to have a refresher today. Quote Link to comment Share on other sites More sharing options...
dalves Posted August 4, 2016 Share Posted August 4, 2016 I don't know if anyone is still checking this thread, but as a beginner I've been looking for an easy way to change the background color of the whole screen. I've been looking at a lot of the demo roms out there and checking the code, but so many of them will always have a black background. I wanted to try to switch the background color from the "Brown" of my title screen to black or another color using color stack mode. Any guidance would be appreciated. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted August 4, 2016 Share Posted August 4, 2016 Did you try experimenting with the code I posted earlier? Quote Link to comment Share on other sites More sharing options...
dalves Posted August 4, 2016 Share Posted August 4, 2016 Hahahahaha, sorry, but no I haven't. Okay, so I haven't tried every example I've found. I didn't know if your code was designed more for changing the background and foreground of the text. I'll give it a shot and see what I can find through experimenting with it. I just wasn't sure if there was a simple command or method that I might be missing. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted August 4, 2016 Share Posted August 4, 2016 All you need to do is set up the mode and colours in the stack, perform a wait command (to ensure the screen mode has changed) and then write CS_ADVANCE (from constants.bas) into the #BACKTAB array at the screen positions you want the change to occur at. If there are cards in the foreground you'll have to add CS_ADVANCE to the card data thats already there. Quote Link to comment Share on other sites More sharing options...
dalves Posted August 4, 2016 Share Posted August 4, 2016 Thanks a bunch. I'll give that a shot. Quote Link to comment Share on other sites More sharing options...
dalves Posted August 4, 2016 Share Posted August 4, 2016 (edited) When I try to build the rom with the code as is, it says "Using array without previous DIM, autoassigning DIM (10) in line 6". I always hate asking newbie questions like this. Edited August 4, 2016 by dalves Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted August 4, 2016 Share Posted August 4, 2016 Its been included with IntyBASIC for a while now. What version are you using? Quote Link to comment Share on other sites More sharing options...
dalves Posted August 4, 2016 Share Posted August 4, 2016 I'm using IntyBASIC SDK 1.0.1. I tried downloading what appeared to be an updated version of the constants.bas and put it un the lib folder, but still get the same error. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted August 4, 2016 Share Posted August 4, 2016 You need the compiler that has the built in #BACKTAB array. You'll also have to update the prologue and epilogue files too. I'll find the post where I explained how to do all that. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted August 4, 2016 Share Posted August 4, 2016 Heres the instructions on how to patch the SDK to the latest one :- http://atariage.com/forums/topic/240526-introducing-the-intybasic-sdk/page-3?do=findComment&comment=3331569 Quote Link to comment Share on other sites More sharing options...
Kiwi Posted August 4, 2016 Share Posted August 4, 2016 poking byte data to the colorstack register will change the background color. example: POKE $28,$07POKE $29,$00 Makes sure it after a wait command. My kaboom clone game color cycle rapidly by changing the color stack value during the explosion scene. Quote Link to comment Share on other sites More sharing options...
dalves Posted August 4, 2016 Share Posted August 4, 2016 (edited) Thanks for the info. I've downloaded the files and will follow your instructions and see if that gets me up and running. Thanks again... (I just tried it and everything runs perfect now. Thanks so much for the help. ) Edited August 4, 2016 by dalves 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.