Jump to content
IGNORED

Can you force the 2600 games to run in B&W via code?


Recommended Posts

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?

  • Like 1
Link to comment
Share on other sites

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.

  • Like 4
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

  • Like 2
Link to comment
Share on other sites

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 by LatchKeyKid
Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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!?

IMG_20220613_115431.thumb.jpg.afb6922d2827fbf34a1cac97daf75a8b.jpg

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.

IMG_20220613_115446.thumb.jpg.39d2cba93427ebc613855b5f152c70a9.jpg


Here is how "Combat" looks like on a standard SECAM console (software switch in "B&W" position):

IMG_20220613_120558.thumb.jpg.73eb1d66cbe8342f5b1dae0423269334.jpg

 

And here with the software switch set to "COLOR" in my console:

IMG_20220613_120607.thumb.jpg.740251ee35548e26d9dcb6ce2ac88abb.jpg

The two tanks cannot be distinguished in this case.

 

 

  • Like 2
Link to comment
Share on other sites

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!

 

 

  • Like 1
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...
  • Recently Browsing   0 members

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