Supercat 2600

Saturday, May 14, 2011

 

Easy Banking

The "Easy Banking" scheme is a memory-control design which allows the user to access up to 24K-30K of ROM and 6K of RAM (6K of ROM is copied to RAM on startup and is inaccessible thereafter) without any bank-switching instructions. There are a few restrictions on memory layout, but the memory access will be far smoother than with any other banking system.

The cartridge memory space is divided into sixteen 2K regions. Eight of these are called "code banks", and the other eight are "data banks". Code is only allowed to run in code banks, or in RIOT RAM from $0880-$08FF. The behavior of running code from any other address is unspecified. Data may be accessed from within the current running code bank, or from any data bank. The effect of accessing data from a code bank other than the current one, or accessing data from a code bank when running from RIOT RAM at $08xx, is unspecified.

One of the code banks will access the first 2K of RAM, which is on startup pre-loaded with ROM from $4000-$47FF; the other seven will access ROM from $0800-$3FFF. To jump from one bank to another, all one needs to to is use a JMP or JSR to the proper address, or do an RTS with the proper address on the stack. The only restriction is that target of a JMP or JSR instruction must not be a multiple of 2K away from either either last byte of the JMP or JSR instruction, nor the first byte of the next instruction, unless the target address is in the same bank as the JMP/JSR instruction itself. An RTS may be located anywhere except at the very last byte of a code area, and is allowed to return to any valid code location.

The first three data banks will access 6K of RAM, which is pre-loaded with ROM from $4000-$57FF. The remaining five data banks will access ROM from $5800 to $7FFF.

The RAM at $1000-$17FF, $3000-$37FF, and $5000-$57FF may be written using STA, STX, STY, or SAX instructions, using any supported addressing mode. The effect of other instructions is unspecified. Data written to RAM at $1000-$17FF will also appear 2K higher in the RAM code bank from $1800-$1FFF. Note that writing to addresses $1800-$1FFF is not supported; one must write to addresses $1000-$17FF.

**CODE ADDRESSES**
6507 Address ROM Address
1800-1FFF 4000-47FF+
3800-3FFF 0800-0FFF
5800-5FFF 1000-17FF
7800-7FFF 1800-1FFF
9800-9FFF 2000-27FF
B800-BFFF 2800-2FFF
D800-DFFF 3000-37FF
E800-FFFF 3800-3FFF

**DATA ADDRESSES**
6507 Address ROM Address
1000-17FF* 4000-47FF+
3000-37FF* 4800-4FFF+
5000-57FF* 5000-47FF+
7000-77FF 5800-4FFF
9000-97FF 6000-47FF
B000-B7FF 6800-4FFF
D000-D7FF 7000-47FF
F000-F7FF 7800-4FFF

(*) Address is writable
(+) Address is RAM which is initialized from ROM

Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

Archives

October 2010   May 2011  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]