Jump to content
Sign in to follow this  
debugger

Atari 7800/2600 technical information

Recommended Posts

After spending ages searching google, i'm still unable to find some information i need to do a project. In particular, i need to know small things about Atari 7800 (and 2600) like what values are into PC and SP when the console is powered up, as i think it's not possible to have a 0 value because in address 0 there are the TIA/Maria registers... Can anyone help, please? Another thing that confuses me is the address where bios rom and the cartridge are located... Bios ROM seems to be overlapping some of the cartridge space, so this means there's something like a page swapping feature in any place, but where and how it works?

 

Third and last one :) What format do have the cartridges? I mean, how data is stored? The console executes the cartridge game from the first byte or there are initial bytes with some obscure meaning? :)

 

A big thankyou in advance guys :)

 

Debugger

Share this post


Link to post
Share on other sites

Can't speak for the 7800, but the 2600 uses a standard 6502 (although it is missing 3 address lines and the interupt line). Page 7 of http://www.6502.org/datasheets/csg6500.pdf details the startup process. PC is loaded from FFFC & FFFD (LSB/MSB), loading SP is up to the cartridge. SP is hardwired to page 1 ($0100-$01FF), although the same RIOT RAM is used for both $0080-$00FF and $0180-$01FF.

Share this post


Link to post
Share on other sites

I'm not sure about the 7800 but the 2600's registers are totally

random at start up.

 

Third and last one  What format do have the cartridges? I mean, how data is stored? The console executes the cartridge game from the first byte or there are initial bytes with some obscure meaning?  

 

Oh I know this one for sure. First byte, no obscure header taking up

valuable (limited) ROM space. :D

Share this post


Link to post
Share on other sites
Another thing that confuses me is the address where bios rom and the cartridge are located... Bios ROM seems to be overlapping some of the cartridge space, so this means there's something like a page swapping feature in any place, but where and how it works?

 

Debugger

 

This is correct, the BIOS overlaps the cartridge space. The BIOS is really just a boot routine and serves no useful function once the game is running so it can be switched out. The switching is controlled by a special control register. I'll have to dig through my notes and find the details of this register.

 

Dan

Share this post


Link to post
Share on other sites

Nice to meet you guys, and thanks for your responses :)

 

Now i understand (more or less) how it's possible to boot for a game, so i can continue with my work; DanBoris thanks, i'm very very very interested in getting some more info about this register, i'll be very grateful if you can find anything :) EricBall, Happy_Dude, thanks to you too, now i'm a bit less confused... Booting from TIA/MARIA registers seemed a bit weird to me :D

 

BTW: Anyone knows if any 2600/7800 game made use of any of the undocumented 6502 opcodes? :)

 

Um... "SP is hardwired to page 1 ($0100-$01FF)" ?

 

There aren't (again) TIA/MARIA registers in this address? :?

Share this post


Link to post
Share on other sites

Hi Debugger!

 

BTW: Anyone knows if any 2600/7800 game made use of any of the undocumented 6502 opcodes? :)

 

None of the original library, but homebrews like Thrust & QB do.

 

Um... "SP is hardwired to page 1 ($0100-$01FF)"  ?

 

There aren't (again) TIA/MARIA registers in this address? :?

 

Actually it's not page 1, but the zeropage and yes, there's the TIA registers located. You can even do tricky stuff like writing to TIA registers with PHP :) But normally SP is set to $FF, using the same $80 bytes you have for your game data. Every JSR = 2 bytes less RAM...

 

Greetings,

Manuel

Share this post


Link to post
Share on other sites

@Manuel:

No, Eric is right. On the 6502/6507 CPU the stack is accessed at page 1 ($0100-$01FF). But the 2600 mirrors the TIA registers and the RIOT RAM at this page (and several others as well) too, putting something on the stack has the same effect as writing to the zero page.

 

 

@debugger:

The 7800 mode control register is called INPTCTRL and can be accessed at all addresses between $0000-$001F, but generally only address $0001 is used. Since this overlaps with the TIA registers, writing to INPTCTRL will always affect the TIA too. Only the first four bits of INPTCTRL are used. They are:

 

D0:

1 = lock mode (after this bit has been set high, no more mode changes can be done until the console gets turned off)



D1:

1 = enable MARIA (also enables system RAM)

0 = disable MARIA (only RIOT RAM is available)



D2:

0 = enable BIOS at $8000-$FFFF (actually NTSC only uses 4KB and PAL uses 16 KB)

1 = disable BIOS / enable cartridge



D3:

1 = enable TIA video pull-ups (video output is TIA instead of MARIA)

0 = disable TIA video pull-ups (video output is MARIA instead of TIA)

 

So, what is the secret project you are working on?

 

 

Ciao, Eckhard Stolberg

Share this post


Link to post
Share on other sites

Hi Eckhard,

 

@Manuel:

No, Eric is right. On the 6502/6507 CPU the stack is accessed at page 1 ($0100-$01FF). But the 2600 mirrors the TIA registers and the RIOT RAM at this page (and several others as well) too, putting something on the stack has the same effect as writing to the zero page.

 

Now I'm curious. If both the TIA and the RIOT RAM are mirrored on both pages, how can you be sure that the stack really is accessing page 1?

Just because this is where the stack is located in the C64? :)

 

Greetings,

Manuel

Share this post


Link to post
Share on other sites
Now I'm curious. If both the TIA and the RIOT RAM are mirrored on both pages, how can you be sure that the stack really is accessing page 1?

Just because this is where the stack is located in the C64? :)

 

Greetings,

    Manuel

 

Because it's hardwired to do that inside the 6502. When the the 6502 wants to access the stack it puts the address $0100 + SP onto the address bus, thus it always goes to page 1.

 

Dan

Share this post


Link to post
Share on other sites

Ok, thanks for all the responses, i think i know now all what i need to continue :) The only thing i don't fully understand is this stack/tia registers overlap, because it's fun to write to the registers pushing values, but this means that when i need to push something into the stack the console will become crazy, right? :)

 

Eckhard: The secret project is a secret thing :) I don't like vaporware at all, so i preffer to work on this before i tell anything to anyone because for now it does not work at all and i don't even know if i'll be able to do it ;)

 

Btw, i have another question, but as it's a totally different thing i'll make another thread for it :)

 

Debugger

Share this post


Link to post
Share on other sites

Oh, that's so unfair. At least give us a hint, so that we won't be too disappointed when we start making up our own theories about what you are doing and they don't turn out to be true in the end. ;)

 

Anyway. In the 256 bytes you can access through the stack there are 128 bytes of RAM. You just have to make sure that the stack pointer points to it when you want to store some data on the stack. The RAM is at $0080-$00FF (or $0180-$01FF if accessed through the stack).

 

 

Ciao, Eckhard Stolberg

Share this post


Link to post
Share on other sites

On the 2600 you only get 128 bytes of RAM. At $0040-$007F there is a mirror of the TIA registers. For the 7800 in MARIA mode you are right though. But there the RAM for the zeropage is different from the RAM for the stack. The MARIA and some TIA registers are still mirrored in the Stack area though, so that you can write to them by pushing something on the stack.

 

 

Ciao, Eckhard Stolberg

Share this post


Link to post
Share on other sites

>>

None of the original library, but homebrews like Thrust & QB do.

<<

 

Are you SURE no original 2600 titles used undocumented opcodes?

Share this post


Link to post
Share on other sites
Are you SURE no original 2600 titles used undocumented opcodes?

I'm quite sure. Before the latest release, the Stella emulator didn't support illegal opcodes. And AFAIK there where no old games that wouldn't work due to the missing support. :idea:

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...