Jump to content
IGNORED

Screen output and the Grom


Recommended Posts

So, I was attempting to print out the entire GROM, up to the 240th card on the screen with this code.

 

 

CLS
X = 0
Y = 0
C = 0
WAIT
LOOP:
WAIT
PRINT AT SCREENPOS (X,Y) COLOR CS_WHITE, C
IF X >= 20 THEN GOTO NEXTLINE
X = X + 1
* C= C + 1

** IF C = 239 GOTO INFINITELOOP
GOTO LOOP

NEXTLINE:
X = 0
Y = Y + 1
GOTO LOOP

InfiniteLoop:
GOTO InfiniteLoop

What I get is a list of items from BACKSPACE to "=" in 8 different colors.

Intuitively, I believed that the GROM had a number assigned to each CARD in each color. I changes the line at * to "C = C +8" to some avail, I got the same pattern from GROM from BACKSPACE to "=" in only black, but the program only prints out to the point of "=" and no further.

Why? Is there another forum about accessing the GROM that I can be pointed to. I looked.

 

CARDLIST.rom

Edited by PlanetJanus
Link to comment
Share on other sites

The pictures in GROM and GRAM have no color information. They are literally 1 bit per pixel—on or off. Each BACKTAB location has information about what GROM or GRAM image to display, and information on how to assign a foreground color (the "on" pixels) and background color (the "off" pixels).

 

As for how the colors get assigned: The STIC has two display modes—color stack and foreground/background. In color stack mode, the foreground color comes from bits 0-2 of the BACKTAB entry, while the background color comes from the "color stack." In foreground/background mode, both the foreground and background colors are packed into thee BACKTAB entry; however, you're limited to just the first 64 pictures in GROM and GRAM.

 

If you search the programming forum here for "color stack", "cstk", "foreground/background" and "fgbg", you may find some more in-depth explanations. Also, if you have jzintv, you can look in doc/programming/stic.txt for some more details. I believe I put some material up at wiki.intellivision.us as well.

  • Like 1
Link to comment
Share on other sites

I'm not sure why, and Color Stack is not my forte, but rewritten like this I think your program does what you expect:

 

   CLS
    X = 0
    Y = 0
    C = 0
    WAIT
LOOP:
    WAIT
    PRINT AT SCREENPOS (X,Y), C*8 + CS_WHITE
    IF X >= 20 THEN GOTO NEXTLINE
    X = X + 1
    C= C + 1
    IF C = 239 GOTO INFINITELOOP
    GOTO LOOP
    
NEXTLINE:
       X = 0
       Y = Y + 1
       GOTO LOOP
 
InfiniteLoop:
    GOTO InfiniteLoop

Note that you multiply C by 8, since the lowest 3 bits contain foreground colour. I didn't get COLOR to work here, probably because you feed a numeric value that will contain 0 in the lowest three bits and overrides the COLOR statement. If you PRINT a string variable instead, it would work.

 

Actually you can obfuscate it the other way around:

 

PRINT AT SCREENPOS (X,Y) COLOR CS_WHITE + C*8," "

 

which is even harder to understand but at least you get to use the COLOR statement.

Edited by carlsson
  • Like 2
Link to comment
Share on other sites

Here's the documentation on this specific usage with an example. Since each grom card takes eight memory locations it should be in multiples of eight. Not sure why they add the 6. Don't know which graphics mode intybasic defaults but that shouldn't affect the grom card number other than limiting access to 64 cards in foreground/background mode.

------

PRINT [AT [expr],]expr[,expr]

Pokes a 12-bits value directly into the screen, which is useful for
variable things and GRAM cards.

For format information please check the STIC specification cited upwards
or the F parameter of the SPRITE statement.

This also increases the cursor position.

Example: Printing a digit in yellow:

PRINT (DIGIT+16)*8+6

Edited by mr_me
Link to comment
Share on other sites

Sorry, I misinterpreted the documentation. The number represents the first 12 bits of the backtab value. So the first three bits is the colour and the +6 is yellow. The x8 shifts the bits three positions and the grom card number is within the brackets. (As Carlsson explained)

Edited by mr_me
  • Like 1
Link to comment
Share on other sites

.PRINT [AT [expr],]expr[,expr]

.

.Pokes a 12-bits value directly into .the screen, which is useful for

.variable things and GRAM cards.

 

So, PRINT POKES into a position. This means that Position can also be seen by PEEK.

 

I think part of my confusion us that there are 4 levels to the screen.

 

The Background BACKTAB.

The Foreground BACKTAB.

The Layer at SCREENPOS.

And the SPRITE layer, that seems like a META layer in regards to interaction with other layers and governed by COL.

Edited by PlanetJanus
Link to comment
Share on other sites

Here's the jzintv documentation on intellivision graphics.

 

http://spatula-city.org/~im14u2c/intv/jzintv-1.0-beta3/doc/programming/stic.txt

 

The background is made of 12 rows of 20 cards each card is 8x8 pixels. The pixels that are on in each background card have the foreground colour and interact with sprites while the rest of the card has the background colour. Sprites can display in front or behind background pixels.

Edited by mr_me
  • 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...