Jump to content
IGNORED

Hidden Control Register for Atari 7800


rropuma07

Recommended Posts

Hi guys, I'm new here, but my friends and I are designing a fully functioning Atari 7800 for a college class. Our design will be synthesized on an FPGA.

 

I've looked all over the internet and can't seem to solve my confusion over the Hidden Control Register. I first learned about it on Dan B's post here https://sites.google.com/site/atari7800wiki/7800-control-register

 

Seems pretty simple, but this explanation seems inconsistent with the BIOS code located here http://www.atarihq.com/danb/files/7800bios.asm

My understanding is that anytime a value is written to INPTCTRL, it is writing to the Control register.

 

Firstly, many times, the value #$16 is written to the control register, but I thought the control register was a four bit value. What is the purpose of writing a 5 bit value to a 4 bit register?

 

Secondly, during execution of the code located at LF7D4 (though the code is actually executed from the RIOT RAM as part of the Atari 2600 initialization), there are stores and loads to TIA registers even though the lock bit on the control register has not been set. This isn't consistent with the idea that the control register can be written by storing to any address from $00-$1F.

 

Lastly, the control register lock bit never really seems to be set. The only time I can find it set is at LF880, but that is when the self-test fails. I would expect the lock bit to be set in both Atari 2600 and 7800 initialization before we do an indirect jump to the start of the programmer's code. I suppose it's possible that the programmer is expected to set the lock bit, but it doesn't make much sense to require the programmer to do that.

 

Can anybody shed some light on these questions? If not, is there anyone I might be able to contact or any other forum I might be able to post to?

 

Cheers!

  • Like 1
Link to comment
Share on other sites

Hi guys, I'm new here, but my friends and I are designing a fully functioning Atari 7800 for a college class. Our design will be synthesized on an FPGA.

 

I've looked all over the internet and can't seem to solve my confusion over the Hidden Control Register. I first learned about it on Dan B's post here https://sites.google.com/site/atari7800wiki/7800-control-register

 

Seems pretty simple, but this explanation seems inconsistent with the BIOS code located here http://www.atarihq.com/danb/files/7800bios.asm

My understanding is that anytime a value is written to INPTCTRL, it is writing to the Control register.

 

Firstly, many times, the value #$16 is written to the control register, but I thought the control register was a four bit value. What is the purpose of writing a 5 bit value to a 4 bit register?

 

Secondly, during execution of the code located at LF7D4 (though the code is actually executed from the RIOT RAM as part of the Atari 2600 initialization), there are stores and loads to TIA registers even though the lock bit on the control register has not been set. This isn't consistent with the idea that the control register can be written by storing to any address from $00-$1F.

 

Lastly, the control register lock bit never really seems to be set. The only time I can find it set is at LF880, but that is when the self-test fails. I would expect the lock bit to be set in both Atari 2600 and 7800 initialization before we do an indirect jump to the start of the programmer's code. I suppose it's possible that the programmer is expected to set the lock bit, but it doesn't make much sense to require the programmer to do that.

 

Can anybody shed some light on these questions? If not, is there anyone I might be able to contact or any other forum I might be able to post to?

 

Cheers!

 

Looking at the schematics it appears that any writes to the TIA addresses go to both the control register and TIA, this would explain the writes to the TIA you are seeing. I am not sure why they are setting bit 4 ($10) when writing to the control register. Maybe this was something that was going to be used but they changed their minds. The lock bit would be set by this code before going into 2600 mode...

 

LF831: LDA #$FD

STA COLUPF

Link to comment
Share on other sites

Thanks for the quick reply Dan!

 

That explains a lot about what's happening in 2600 mode. I'm still not sure how the lock bit gets set in 7800 mode since the code that is executed before it jumps to the start of the cartridge is:

 

LF7B9: LDX #$16 ; finally, back to something important
STX INPTCTRL ; switch out bios and use reset vector
TXS ; on cart to start the game.
SED
JMP(LFFFC)

 

Unless the lock bit is set somewhere else, which wouldn't make sense because that would yield this write to the control register pointless.

Link to comment
Share on other sites

Thanks for the quick reply Dan!

 

That explains a lot about what's happening in 2600 mode. I'm still not sure how the lock bit gets set in 7800 mode since the code that is executed before it jumps to the start of the cartridge is:

 

LF7B9: LDX #$16 ; finally, back to something important

STX INPTCTRL ; switch out bios and use reset vector

TXS ; on cart to start the game.

SED

JMP(LFFFC)

 

Unless the lock bit is set somewhere else, which wouldn't make sense because that would yield this write to the control register pointless.

 

I took a look at the source code for a couple 7800 games and they all lock the system into 7800 mode at start up. This makes sense since the 2600 games obviously would not know to do this, but 7800 games would have been programmed to handle this.

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