Jump to content
IGNORED

INTYBasic MODE & PRINT


Shalmezad

Recommended Posts

So, been playing around trying to figure this out, but haven't had too much luck.

Long story short, I'm trying to change the background color for some cards when I print them to the screen.

Now, I went through the manual, and got these bits of information:

For Foreground/Background mode, use $0000-$0007, and $0200 is bit 0 of background
color, $0400 is bit 1 of background color, $1000 is bit 2 of background color
and $2000 is bit 3 of background color. (check MODE statement below)

[...]

MODE 0,color1,color2,color3,color4
MODE 1

Allows to select the video mode (Color Stack mode or Foreground/Background mode)
this happens in the next video frame (WAIT)

Note you cannot use PRINT AT until WAIT has been used, because the color
variable is used to save data, after this COLOR will be reset to 7.

In Color Stack mode you can choose the four background colors available in range
0-15.


So, from what I can tell:
MODE 0 allows me to set the background colors available to me
PRINT "blah" AT SOME_POSITION COLOR <somecolor> will allow me to change the background color

But, haven't had too much luck. :skull:
COLOR $0200 led to some really funky characters.
COLOR $0400 led to different characters.
COLOR $1000 led to some funky blocks.

Don't suppose anyone has an example on how to use this? (or perhaps help explain how the PRINT statement works with colors?)

Thanks!

Link to comment
Share on other sites

So, been playing around trying to figure this out, but haven't had too much luck.

 

Long story short, I'm trying to change the background color for some cards when I print them to the screen.

 

Now, I went through the manual, and got these bits of information:

So, from what I can tell:

MODE 0 allows me to set the background colors available to me

PRINT "blah" AT SOME_POSITION COLOR <somecolor> will allow me to change the background color

 

But, haven't had too much luck. :skull:

COLOR $0200 led to some really funky characters.

COLOR $0400 led to different characters.

COLOR $1000 led to some funky blocks.

 

Don't suppose anyone has an example on how to use this? (or perhaps help explain how the PRINT statement works with colors?)

 

Thanks!

 

These color bits are intended for mode 1 where you can choose the 16 background colors for each card.

 

In mode 0 (Color Stack) the screen starts with a stack of colors, the first one provided, the next one is selected putting a bit in card as $2000 and successively for the other colors.

Link to comment
Share on other sites

Its possible to do it in colour stack mode by advancing the colour stack "pointer" but you are limited to 4 background colours and must cycle through them. You can have all 16 background colours in "MODE 1" (foreground background mode) but you can only use the first 64 GROM characters (which are punctuation, numbers and upper case letters) e.g.

 

    include "constants.bas"

    mode 1
    wait
    print at screenpos(0,0) color FG_BLUE+BG_CYAN, "HELLO"
loop:
    wait
    goto loop
That will print HELLO at position 0,0 on screen with blue text and cyan background. Check out constants.bas in the latest IntyBASIC for other FG_xxx and BG_xxx colours.
Link to comment
Share on other sites

MODE 0 is the colorstack mode and MODE 1 is the BG/FG mode.

To pick a COLOR via PRINT in colorstack mode. $1000 will turn on the pastel color bit, $0000-0007 will chose the primary colors, and $1000-1007 will pick the pastel colors. $2000 will advance the colorstack by one. $3000 will advance the colorstack by 1 and chose a pastel color.

Something like

 

MODE 0,0,1,2,3
print at 60 color $3002,"Helloworld" will be printed in orange with BLUE background. Any card after 60 will have blue background instead of black.

EDIT: I just recalled something, that will move the colorstack pointer 10 times.

print at 60 color $3002,"H"

print at 61 color $1002,"elloworld"

will advance the colorstack 1 time.

MODE 1 is a bit more complicated to set up and you don't access to the lower case letters and the additional GROM cards. I find this one to make the game a bit more colorful. I usually refer to http://wiki.intellivision.us/index.php?title=STICpage a lot to set up the tile information use as data to be poked in. Still works with the PRINT command though.

print at 105 color $1007, "LEVEL 1 \266" will print in white text on light gray.

Edited by Kiwi
Link to comment
Share on other sites

Alright, I think I'm starting to catch on, but still have few more questions.

 

So, let's say I have Mode 0,0,1,2,3 like in your example.

 

In theory (on phone so I can't test) I can:

PRINT AT 0 COLOR 0, "Blah" 'will be black

Then: PRINT AT 20 COLOR $3000, "Blah" 'will be blue

 

Now, let's say I wanted to print blah in black at position 40.

 

If I understand you correctly, I can increment the stack with $3000, but is it possible to increment it by 2 or possibly 3?

Link to comment
Share on other sites

MODE 0,0,1,2,3 will cycle black, blue, red, tan each time that a card have the colorstack bit on. MODE 0,(color1),(color2),(color3),(color4). This function set the byte address at $28,$29,$2A,$2B. You can poke the color value in those address to change the color.

example:

POKE $28,$03 set color stack to tan
POKE $29,$05 set color stack to green

 

If you want to change the red to black, you can order it like

MODE 0,0,1,0,3

Link to comment
Share on other sites

MODE 0,0,1,2,3 will cycle black, blue, red, tan each time that a card have the colorstack bit on. MODE 0,(color1),(color2),(color3),(color4). This function set the byte address at $28,$29,$2A,$2B. You can poke the color value in those address to change the color.

example:

POKE $28,$03 set color stack to tan

POKE $29,$05 set color stack to green

 

If you want to change the red to black, you can order it like

 

MODE 0,0,1,0,3

The pokes will only work if you do them within the remaining VBLANK time after a WAIT. If the IntyBASIC VBLANK handler isn't doing very much e.g. not filling GRAM with data, no scrolling and no music then they will appear to work.

 

Have a look at this example :-

 

	include "constants.bas"

loop:	
	mode 0,STACK_BLUE,STACK_RED,STACK_TAN,STACK_DARKGREEN
	wait
	
	REM Make sure we are out of VBLANK time.
	for #C=0 to 1000
	next #C
	
	REM Print the "TEST" string.
	print at screenpos(0,0) color CS_WHITE, "T"
	print at screenpos(1,0) color CS_ADVANCE+CS_WHITE, "E"
	print at screenpos(2,0) color CS_ADVANCE+CS_WHITE, "S"
	print at screenpos(3,0) color CS_ADVANCE+CS_WHITE, "T"

	REM Attempt to change the CS colours.
	POKE $28, STACK_TAN	' Set colour stack #1.
	POKE $29, STACK_GREEN	' Set colour stack #2.

	REM Print the ~"TEST" string.
	print at screenpos(0,1) color CS_ADVANCE+CS_WHITE, "T"
	print at screenpos(1,1) color CS_ADVANCE+CS_WHITE, "E"
	print at screenpos(2,1) color CS_ADVANCE+CS_WHITE, "S"
	print at screenpos(3,1) color CS_ADVANCE+CS_WHITE, "T"	
	
	goto loop
And you'll notice that the pokes don't take effect. Remove the "for..next" loop and they do.
Link to comment
Share on other sites

Alright, I think I'm starting to catch on, but still have few more questions.

 

So, let's say I have Mode 0,0,1,2,3 like in your example.

 

In theory (on phone so I can't test) I can:

PRINT AT 0 COLOR 0, "Blah" 'will be black

Then: PRINT AT 20 COLOR $3000, "Blah" 'will be blue

 

Now, let's say I wanted to print blah in black at position 40.

 

If I understand you correctly, I can increment the stack with $3000, but is it possible to increment it by 2 or possibly 3?

The stack can only be incremented once per card. One trick I use to advance it more than once is to use "reverse video": that is, reverse the bit patterns of the cards so that I can set the "background" color by using the Foreground color of the card.

 

For example, suppose you want to print two spaces consecutively, one in color stack color #0 and the other with stack color #2. First you print a space normally. Then for the next card, you advance the color stack. However, this is still not the color you need, so instead of printing a space with stack color #1, you print a solid block with a foreground color matching what you want. On the next card, you can advance the stack again, landing you in the correct color #2. The end result is two cards with the right pattern and using the "correct" colour.

 

Most of the GROM cards are symmetrical geometric shapes, which have reverse counter parties (except the letters, symbols, and numbers). If using custom GRAM cards, you'll have to create your own custom cards in reverse video, as needed.

 

Recall, you don't need to do the reverse video all throughout, just in the interim cards until you reach the desired stack point.

 

Doing this trick allows you to use the color stack to great effect. :)

 

dZ.

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