guppy Posted August 29, 2016 Share Posted August 29, 2016 This is a pretty technical question I'm interested in learning about how the Atari 2600 TV type switch works. The color/b&w switch. From an emulation standpoint, how did the switch convert the colors to grays? I'm working on a little project that uses the Atari 2600 ntsc palette, and was interested in doing conversions of these colors to grayscale values. There are numerous ways to do it, and I would like to know how to do it the closest way to how the real hardware did it. For example, I can get the HSV values and drop the saturation to zero. Or I can average the values of rgb to create a grey. I'm really interested in how the Atari hardware did it, and the math that would accurately describe how the hardware did it. Appreciate any advice I can get... Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 29, 2016 Share Posted August 29, 2016 The game program itself reads the switch and selects different color values.Step 3 of my series Collect, which covers writing a 2K Atari game from scratch, covers that. Search for "When the macro CLEAN_START" and start reading from there. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted September 2, 2016 Share Posted September 2, 2016 Yes, entirely determined by the program...which is why the switch was used for different purposes in some games, or not even used at all. The Atari 7800's switch springs back to the upward position the same way that the Select and Reset switches do...so you might want to take this into account when writing your program. Quote Link to comment Share on other sites More sharing options...
Keatah Posted September 2, 2016 Share Posted September 2, 2016 But isn't the end result still a toggle? The software wouldn't know the difference if it's a mechanical or electronic latching switch. What purpose would it be to have to hold the b/w switch in position? Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted September 3, 2016 Share Posted September 3, 2016 Bit3 of SWCHB holds it's status...1 if in the up (color) position, 0 if down (B&W). Since it's redesigned to spring back up on the 7800, SWCHB.3 does not hold a zero unless you are physically holding the switch down. So the software needs to track it's changes if you are making a game to function on either console using that switch. Fortunately, the 7800 forces a short BIOS routine into user ram when the system is powered up...so the console type can be auto-detected on powerup by testing bytes in user ram (before executing a clean start routine) to check if it is holding those specific values. User ram is in a random state on a 2600. Quote Link to comment Share on other sites More sharing options...
Keatah Posted September 4, 2016 Share Posted September 4, 2016 So on like 2600 Miniature Golf or any of the early games, running on a 7800, the B/W switch is pretty much useless? Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted September 4, 2016 Share Posted September 4, 2016 ...unless you taped it down or hacked the program, yeah. Not so hard for a new program to avoid this problem. 1 Quote Link to comment Share on other sites More sharing options...
alex_79 Posted September 4, 2016 Share Posted September 4, 2016 A less elegant solution that still allows the switch to work in both consoles is to check when the bit goes to 0 and then back to 1. In the 7800, you just push and release the "PAUSE" button; in the 2600 you flip the "TV TYPE" switch to B/W and then back to COLOR. That's how the switch is read in "Secret Quest". Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted September 4, 2016 Share Posted September 4, 2016 What could have been done instead is to enter the pause routine if there is any change for the switch, and exit some other way (if the stick is moved, for example). But even autodetection + a branching routine only uses a couple dozen bytes of rom. 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.