Jump to content
IGNORED

Bank switching scheme for multicart bootloader


Recommended Posts

Hello all,

 

I'm a newbie in Atari 2600 programming though I have 30y of experience on programming at various levels, and experience with different ASMs and hardware.

 

Currently I decided to get back to electronics design, and wanted to revive my old 2600. My plan is to have a very simple multicart with a GAL and a flash eprom (I know there are ready made solution like Uno cart and harmony, but I'm doing this for fun).

 

I spotted a possible issue in the bootloader for the carts. My current hardware can theoretically handle 128 (7 bits) banks of 4kbytes, so I can load up to 127 4k minicarts (or 63x8k or even 16x32k, doesn't matter). 

The problem is that an assumption of the most basic bank switching scheme (F4/F8 styles) is that there's sort of continuity between the code in the old and new bank. We don't want that at PC+1 after the bank switching we execute garbage code or data.

The bootloader code should, after selecting the cartridge to load, perform the bank switching and jump to the reset vector, either by jmp or rts.

And loading any "non-bank-aware" code can't provide this assumption. There can be no rts or jmp in the context of the new bank.

So my idea was to load the bank switching code in RAM, starting at some address at the bottom of the ram (opposite the stack), then jump in ram and perform the reset from that, avoiding the code pollution due to the bank switching.

 

Would that work? Is there any previous experience with this?

Or am I missing anything obvious ?

 

Thank you in advance!

 

kind regards

 

F.

Link to comment
Share on other sites

Ok, I guess I had to check more carefully the documentation. Here http://kevtris.org/files/sizes.txt I found this:

 

Quote
Notes about menued carts:  These are very intresting!  They consist of
several games in seperate banks of a 16K F6 bankswitched ROM.  There's a
very slick looking menu that comes up displaying the co's logo (HES), and
to press the fire button.  After doing so, the user is given a choice of
what game to play.  The choices are actually written out onto the screen in
hi-res text!  You highlight the desired game and hit the button.  The tech
behind it is pretty simple, yet clever.  On startup, the bank is pointed to
the menu system's bank, and then is run just like any other F6 cart.  The
games are stored in seperate banks, or the upper 2K of a 4K block with the
lower 2K being the menuing program.  When the user selects a game, a small
'stub' of code is written to RAM then executed; this stub is usually 
something like this:

0080:   LDA $1FF8   ;change banks
0083:   JMP $1000   ;run game

 

That answers to my quetsion. Thanks anyway.

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