+Gemintronic Posted April 25, 2014 Share Posted April 25, 2014 So, I noticed the color values always go up by 2 for NTSC: $46 $48 $4A etc.. I was wondering if this would make snatching the first bit as a seperate bitwise variable safe? dim bgcolor = a def hastreasure=bgcolor{0} Do real Atari 2600's on real TVs freak out when a color is $47 instead of $46? Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 25, 2014 Share Posted April 25, 2014 The lsb is ignored/unused in the hardware registers, so with a RAM shadow you could use the bit for other purposes. Not as handy as the msb of course since 6502 can easily test it with a single instruction, plus the N flag usually reflects it's state after many operations. If you wanted to use the msb in assembly, easy enough, you could just adjust your colour value stores, then when copying to the hardware registers, e.g. LDA SCOLUBK ASL A STA COLUBK 1 Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted April 26, 2014 Share Posted April 26, 2014 (edited) Or you could shift the byte right, moving the lowest bit into the carry flag, and branch to one routine or another depending on whether carry is set. That way the color data can be used as-is for color purposes, but you can still use the lowest bit for some other on/off variable. In fact, I think that might be how batari Basic tests the lowest bit when you use it as a bit variable-- by shifting the byte right and then checking the carry flag. Edited April 26, 2014 by SeaGtGruff Quote Link to comment Share on other sites More sharing options...
iesposta Posted April 26, 2014 Share Posted April 26, 2014 If you are doing: dim bgcolor = a aren't you setting the bits of "a" as opposed to the bits of the color register ? If you can just set the LSB of a register without using your variables, that would be extra bits. The DPC+ Kernel has 35 bytes for variables. I learned you can add three more bits from the unused bits of SWCHB. Maybe we can add more bits from the ignored color register bits? How many registers have ignored bits? COLUBK, COLUPF, PF0 ???????? Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted April 26, 2014 Share Posted April 26, 2014 (edited) There's a big difference between data bytes and registers. If a register doesn't use a particular bit, that bit isn't just ignored by the register-- it doesn't exist. In other words, the TIA color registers contain only 7 bits. So you can use any ignored bits for other things in the data, but that doesn't mean there are extra bits in the registers that can be used for storage. Anyway, the TIA registers are either read-only or write-only, so even if the ignored bits did exist in the registers themselves, you wouldn't be able to store anything in them and then read them back. PS-- SWCHB is a 6532/RIOT register, not a TIA register, which is why the unused bits are available for storage-- the SWCHB register has 8 bits, and you can read from it or write to it depending on how you've set the control bits. Edited April 26, 2014 by SeaGtGruff 1 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.