+rbairos Posted February 23, 2019 Share Posted February 23, 2019 What specifically happens when you try to read a color register for example?I know the values aren't returned, but does it reliably return $00 or $FF, or is it an unstable value?Im wondering if something like DEC COLUP0 would work to set it to $00 for example whenyour A,X,Y registers aren't available?Thanks. Quote Link to comment Share on other sites More sharing options...
RevEng Posted February 23, 2019 Share Posted February 23, 2019 On most 2600 consoles, the value returned by reading from a write register (i.e. from a floating bus) is the last value on the bus. I.e. the last byte in the opcode. This means on the 2600 that "lda 0" will act as "lda #0", except for some small (but not insignificant) percentage of consoles. No idea if using DEC adds some wrinkles to the above info. 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 23, 2019 Share Posted February 23, 2019 Huh...that would be an easy mistake to miss, in that case. I wonder if there are any released games that have "lda 0" by mistake, leading to some incompatibilities on some consoles? Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted February 23, 2019 Share Posted February 23, 2019 What specifically happens when you try to read a color register for example? I know the values aren't returned, but does it reliably return $00 or $FF, or is it an unstable value? Im wondering if something like DEC COLUP0 would work to set it to $00 for example when your A,X,Y registers aren't available? Thanks. The way the memory map works DEC COLUP0 would read CXBLPF, decrease by 1, and then write that value to COLUP0. Only bit 7 of CXBLPF is used, so the other bits might be whatever is floating on the bus. Here is a document I got somewhere years ago on the memory map. GoodTIAMemoryMap.txt 1 Quote Link to comment Share on other sites More sharing options...
RevEng Posted February 23, 2019 Share Posted February 23, 2019 Huh...that would be an easy mistake to miss, in that case. I wonder if there are any released games that have "lda 0" by mistake, leading to some incompatibilities on some consoles? Yes, it's a VERY easy mistake to make and miss. Haunted House does this. In it's player positioning routine it does a "SBC $0F" instead of "SBC #$0F". I made a similar mistake in 21 Blue, and didn't realize it until one of the testers asked why the score was messed up - his was one of the oddball consoles. It's easier to catch if you run stella with the "-dev.tiadriven 1" argument. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted February 23, 2019 Share Posted February 23, 2019 This means on the 2600 that "lda 0" will act as "lda #0", except for some small (but not insignificant) percentage of consoles. LDA 0 = LDA CXM0P Quote Link to comment Share on other sites More sharing options...
RevEng Posted February 24, 2019 Share Posted February 24, 2019 LDA 0 = LDA CXM0P Yeah, fair enough. The top two bits aren't floating, though likely enough to be clear. The rest of the bits will reflect the last value on the bus. 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.