WIP
You are here:

QuickBank

QuickBank is a quick and easy way to support XE-style banks in the Atari 8-bit. The memory swapped out by the available banks is always located at $4000 to $7FFF. Including Bank to QuickOS uses only a very tiny amount of memory because all of the heavy lifting for it is handled in the initialization.

 

Do realize that in some cases, ANTIC may be selectably enabled, is always disabled, or is always enabled. It is up to the calling code to choose when to wait for vertical blanks before switching or manipulating banks.

 

This also does not enable swapping banks that are a part of the main memory, even with memory upgrades, such as the RAMBO 256K upgrade, that allow this to occur. Those "banks" are not treated as valid banks and are not included. Each bank will be additional memory beyond the base 64KB of memory available to the XL and higher systems.

 

The bank values used here may not necessarily reflect the order they are in the hardware. Instead, the banks are listed from 0 to one less than QuickBank::NumBank. The corresponding PORTB value is handled internally.

 

At this time, this supports up to 64 banks controlled by PORTB, supporting up to 1088KB. The OS toggle bit and the bank toggle bit are both assumed to always be available. Megaram bank bits (at $D600) are not supported at this time. When and if they do get supported, it will be an option in the Quick Bank configuration since they will require very different code to track.

 

Functions

 

Sets which bank is active.

Clears the active bank, returning the memory to standard RAM.

Toggles whether ANTIC is also affected by bank swapping. This only does something if the installed memory supports it.

 

Zero Page Values

 

None used

 

Values

Don't modify these values.

 

QuickBank::Flags

Details about the banks.

 

Available flags values:

QUICKBANK_FLAGS::MayToggleANTIC

Set if ANTIC may be toggled on or off.

QUICKBANK_FLAGS::EnableANTIC

Set if ANTIC is enabled with the bank swapping. If MayToggleANTIC is clear, this value specifies whether ANTIC is always enabled or disabled.

This is bit 6 so BIT and BVS/BVC may be used.

QUICKBANK_FLAGS::UsingBank

Set if a bank is currently active. See ActiveBank.

This is bit 7 so BIT and BMI/BPL may be used.

QuickBank::NumBank

Byte, The number of 16KB banks available. 0 for none such as on an 800XL, 4 for a 130XE, etc.

QuickBank::ActiveBank

Byte, The active bank. This only means anything if the QUICKBANK_FLAGS::UsingBank flag is set in QuickBank::Flags since otherwise, a bank is not in use.

 

Internal Values

Don't modify these values.

 

QuickBank::StaticBits

Byte, The value to OR bank bit values to when setting PORTB.

QuickBank::PORTBShadow

Byte, A shadow register for PIA's PORTB.

QuickBank::BankList

Address, A pointer to the data for controlling banks.