Jump to content
Sign in to follow this  
Schmutzpuppe

7800 zeropage handling

Recommended Posts

Don't forget the stack page

$0140 - $01FF is shadowed at $2140-$21FF and the stack grows bottom up (while ZP tends to be used top down).

Share this post


Link to post
Share on other sites

Thanks for the hint.

I don't find this kind of mapping very elegant the mapping should be in a row and at the beginning or end of the ram.

Well, guess that have technical reasons.

 

Matthias

Share this post


Link to post
Share on other sites

Actually, I think it's kinda cool. GCC had some interesting constraints they had to work with, then build workarounds into the MARIA chip.

 

Okay, start with the 2600, really with the 6507 & RIOT. The RIOT only has 128 bytes of RAM, and for the stack to work it has to be mapped to $0180 - $01FF. Zero page uses the same RAM, mapped to $0080 - $00FF; easy to do, just don't connect one of the address lines. This leaves $0000 - $007F for the TIA registers with easy access.

 

Fast forward to the 7800, which has 4K of fast RAM mapped to $1800-$27FF. Built into the MARIA chip is an address decoder which (along with some external logic) has to handle 2600 mode addressing and 7800 modes (ROM & cart).

 

For compatibility & sanity, the TIA registers are still mapped to $0000 - $001F, and the MARIA registers $0020 - $003F, leaving $0040-$00FF for RAM. For simplicity, this gets shadowed to $2040-$20FF, and the stack ($0140-$01FF) to $2140-$21FF (again, only one address line different).

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...