Jump to content
IGNORED

reading non-readable tia registers


rbairos

Recommended Posts

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.

 

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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.

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