LatchKeyKid Posted June 7, 2022 Share Posted June 7, 2022 Or is that strictly a hardware limited option via the toggle switch on consoles? I've been having trouble with color selection on my first hack due to limited experience (and the colors being interconnected in the code and beyond my abilities at the moment) and I realized that I might be able to achieve the B&W look I wanted with the B&W color scheme. Can you code a game to only run in that mode? 1 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 7, 2022 Share Posted June 7, 2022 Vice versa! It's the software, which checks the switch and chooses different colors. And it could be any switch or any other event. 3 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted June 7, 2022 Share Posted June 7, 2022 As Thomas mentions, it's 100% controlled by software. Early games read the state of the TV Type switch to decide between a color or a black & white palette for the game. This was done because B&W TVs were still in widespread use when the 2600 came out and sometimes a game's choice of colors didn't look that great when played on a B&W TV. As color TVs became more common games started to only use a color palette and either ignored the TV Type switch or repurposed it for other things, such as a pause feature. If you're interested in the coding details I show how an old game would read the the TV Type switch and select a color palette in Step 3 of my Collect Tutorial. In Step 8 I added the color-cycling effect that older games used to prevent burn-in when the game was not being played. 4 Quote Link to comment Share on other sites More sharing options...
LatchKeyKid Posted June 7, 2022 Author Share Posted June 7, 2022 Thanks to you both. I think I see in your code that you're selecting the colors based on the switch check result for color vs b&w which I'm not sure will work in my admittedly niche case. I'm trying to work on a Pitfall hack with limited knowledge of coding and I can't switch out some of the colors to a purely b&w scheme without causing glitches and/or interconnected color swaps due to the way the game was programmed (likely to save space on the 4k cartridge?). I did notice that in Stella when I change the output to B&W that certain those certain immutable colors work in that mode. Specifically, I can't change out the DARK_GREEN of Harry's pants when climbing because it causes a death glitch on closed pits. But if I run the game in B&W, the dark green is close enough to black that it doesn't matter. Can I force the output to display as B&W whether on CRT and emulation even when it's coded with the NTSC palatte? I hope I'm explaining that correctly. Quote Link to comment Share on other sites More sharing options...
alex_79 Posted June 7, 2022 Share Posted June 7, 2022 There's not a separate B&W mode that can be enabled or disabled. The video output is technically always in color. To get a B&W display you only use color values in the range $00-$0F (which are the 8 shades of grey from black to white) for everything on screen. BTW, "Pitfall!" reads the TV TYPE switch and displays in grayscale if it's in B&W position. (F4 in Stella). 2 Quote Link to comment Share on other sites More sharing options...
LatchKeyKid Posted June 7, 2022 Author Share Posted June 7, 2022 (edited) 46 minutes ago, alex_79 said: There's not a separate B&W mode that can be enabled or disabled. The video output is technically always in color. To get a B&W display you only use color values in the range $00-$0F (which are the 8 shades of grey from black to white) for everything on screen. BTW, "Pitfall!" reads the TV TYPE switch and displays in grayscale if it's in B&W position. (F4 in Stella). Thanks. That's the look I'm going for and also how I discovered that the "wrong" colors that I can't change could still work by pressing f4 in stella. I just didn't know if there was a way to force the emulator/TV to start in that greyscale mode via the game code without requiring the player to press f4 instead in Stella (and be forced to hook up to a B&W tv for actual console gaming). I'm just trying to get around the limitation of not being able to change certain colors without rewriting large portions of code (which I'm not knowledgeable enough to do) Edited June 7, 2022 by LatchKeyKid Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 7, 2022 Share Posted June 7, 2022 7 minutes ago, LatchKeyKid said: I just didn't know if there was a way to force the emulator/TV to start in that greyscale mode via the game code without requiring the player to press f4 instead in Stella (and be forced to hook up to a B&W tv for actual console gaming). Didn't or don't know? If the latter is true: RTFM Quote Link to comment Share on other sites More sharing options...
alex_79 Posted June 7, 2022 Share Posted June 7, 2022 52 minutes ago, LatchKeyKid said: and be forced to hook up to a B&W tv for actual console gaming You don't need a B&W TV, you only need to flip the TV TYPE switch on the console to B&W position (Which is what Stella emulates by pressing F4). Anyway, the code that reads the switch is the following: ldy #$ff ; 2 lda SWCHB ; 4 and #BW_MASK ; 2 bne .colorMode ; 2³ ldy #$0f ; 2 .colorMode: BW_MASK is a constant defined at the beginning of the disassembly: ; mask for SWCHB: BW_MASK = %1000 If you want the game to always display in grayscale, no matter the position of the TV TYPE switch, the simplest (not the best) way to do it is to change that to BW_MASK = 0 In this way the result of the instruction "and #BW_MASK" will always be zero. 2 Quote Link to comment Share on other sites More sharing options...
LatchKeyKid Posted June 8, 2022 Author Share Posted June 8, 2022 Thanks for all the advice, links, and especially the example code! I was looking through the blog examples as well as this resource http://problemkaputt.de/2k6specs.htm#videocolors but that simple line does the trick! I thematically actually wanted greyscale and that solves the issue of not being able to change the pants color to black without recoding as it defaults to black anyways! Quote Link to comment Share on other sites More sharing options...
Rastignac Posted June 12, 2022 Share Posted June 12, 2022 Note that the French SECAM 2600 has *hardware* B&W. All games can be put in B&W mode, even if game's code doesn't handle it. And the software can't read the real position of the switch (so you can't use it for something else: pause, etc). 1 2 Quote Link to comment Share on other sites More sharing options...
alex_79 Posted June 13, 2022 Share Posted June 13, 2022 20 hours ago, Rastignac said: And the software can't read the real position of the switch Yes, on SECAM consoles, the switch always appears to be in B&W position when the software reads it. This was done to ensure compatibility with old PAL games released before the SECAM console was introduced. Some of those games used the same brightness (but different colors) for the players with the switch set to COLOR, which translated in the same color in the SECAM palette, making the player undistinguishable. I wired a "software" TV TYPE switch on my SECAM console, in addition to the existing "hardware" one. I found it useful sometimes when running test roms that could use the switch for some purpose. And I can play "Secret Quest" with SECAM colors if I want!? The SECAM vcs doesn't have a channel select switch, but still has the hole for it (it was covered by a plastic plug in my console), so I put it there without having to modify the case. Here is how "Combat" looks like on a standard SECAM console (software switch in "B&W" position): And here with the software switch set to "COLOR" in my console: The two tanks cannot be distinguished in this case. 2 Quote Link to comment Share on other sites More sharing options...
LatchKeyKid Posted June 13, 2022 Author Share Posted June 13, 2022 If you have the inclination/interest/ability, I posted the hack that I used your code answer for over in the link below. I tried looking at it with Stella in PAL mode but I don't know if my (NTSC?) laptop display changed the colors to so much darker than the NTSC version or if the code is wrong. I tried changing the PAL colors to very light and it made no difference so I figured it might be my display instead. Thanks again! 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.