First Spear Posted April 24, 2018 Share Posted April 24, 2018 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 Quote Link to comment Share on other sites More sharing options...
carlsson Posted April 24, 2018 Share Posted April 24, 2018 (edited) 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 April 24, 2018 by carlsson 3 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.