Jump to content
IGNORED

more colors per card?


CrazyBoss

Recommended Posts

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.

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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 :-

post-21935-0-71819400-1456606553_thumb.gif

  • Like 3
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 :-

attachicon.gifshot0000.gif

 

thanks. very nice example as usual.

Link to comment
Share on other sites

 

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!
Link to comment
Share on other sites

 

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 by DZ-Jay
  • Like 1
Link to comment
Share on other sites

  • 5 months later...

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

poking byte data to the colorstack register will change the background color.

 

example:

POKE $28,$07
POKE $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.

Link to comment
Share on other sites

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 by dalves
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...