Jump to content
IGNORED

IntyBASIC Magic Numbers for Colors?


Recommended Posts

I have these two lines of code to put something on the backtab, and then set the color.
I want to put it into one line; can anyone (1) condense the code and (2) point me to a reference so I can understand more?


#BACKTAB(#varc) = $0807 + (#vara* 4 + #varb) * 8
#BACKTAB(#varc) = (#BACKTAB(#varc) AND NOT $0007) + CS_TAN
Link to comment
Share on other sites

Since you refer to CS_TAN, I suppose that means you're operating in Color Stack mode.

    13   12   11   10    9    8    7    6    5    4    3    2    1    0   
  +----+----+----+----+----+----+----+----+----+----+----+----+----+----+ 
  |Adv |FG  |GRAM|   Card # (0-255 for GROM,             |   FG Color   | 
  |CS  |Bit3|GROM|           0-63 for GRAM)              |   Bits 0-2   | 
  +----+----+----+----+----+----+----+----+----+----+----+----+----+----+ 



Bits 14-15 are not used.

$0807 equals Adv CS = 0, FG Bit 3 = 0, GRAM/GROM = 1, Card # = GRAM 0, FG Color = 7 (binary 111, equals CS_WHITE)

To that you add #vara * 4 + #varb, multiplied by 8 so it selects a GRAM card insteaf of affecting the colour. Finally you set FG Color to CS_TAN = $0003 (binary 011)

I would say that if this one liner should do the same thing:

#BACKTAB(#varc) = $0800 + (#vara * 4 + #varb) * 8 + CS_TAN

See also this reference: http://wiki.intellivision.us/index.php?title=STIC

Edited by carlsson
  • Like 3
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...
 Share

  • Recently Browsing   0 members

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