Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyMemoryConfiguration()
- func InitApple2eROM()
- func InitIO()
- func InitRAM()
- func InitROM()
- func MapFirstHalfOfIO()
- func MapSecondHalfOfIO()
- func ReadIO(address uint16) uint8
- func ReadMemory(address uint16) uint8
- func SetCol80(value bool)
- func SetD000Bank(value int)
- func SetFakeAltZP(value bool)
- func SetFakeAuxMemoryRead(value bool)
- func SetFakeAuxMemoryWrite(value bool)
- func SetMemoryMode(mode uint8)
- func SetPage2(value bool)
- func SetStore80(value bool)
- func SetUpperRAMReadOnly(value bool)
- func SetUpperReadMappedToROM(value bool)
- func WipeRAM()
- func WriteIO(address uint16, value uint8)
- func WriteMemory(address uint16, value uint8)
Constants ¶
const RomPath = "apple2e.rom"
RomPath is a hardcoded path to an Apple //e ROM file that's loaded at startup
const StackPage = 1
StackPage is the location of the 6504 stack
Variables ¶
var ( D000Bank int // one maps to $c000, two maps to $d000 UsingExternalSlotRom bool // Which IO ROM is being used UpperReadMappedToROM bool // Do reads go to the RAM or ROM UpperRAMReadOnly bool // Is the upper RAM read only FakeAuxMemoryRead bool // Aux memory isn't implemented FakeAuxMemoryWrite bool // Aux memory isn't implemented FakeAltZP bool // Aux memory isn't implemented FakePage2 bool // Aux memory isn't implemented Col80 bool // 80 Column card is on (not implemented) Store80 bool // 80 Column card is on (not implemented) Page2 bool // Main memory Page2 is selected )
Memory mapping states
var PhysicalMemory struct { MainMemory [0x10000]uint8 // Main RAM UpperROM [0x3000]uint8 // $c000-$ffff ROM area RomC1 [0x1000]uint8 // First half of IO ROM RomC2 [0x1000]uint8 // Second half of IO ROM }
PhysicalMemory contains all the unmapped memory, ROM and RAM
var ReadPageTable [0x100][]uint8
ReadPageTable is the page table for reads
var VideoState struct { TextMode bool HiresMode bool Mixed bool }
VideoState has 3 booleans which determine the video configuration:
TextMode HiresMode Mixed
text 1 0 N/A lores + text 0 0 1 lores 0 0 0 hires N/A 1 0 hires + text N/A 1 1
var WritePageTable [0x100][]uint8
WritePageTable is the page table for writes
Functions ¶
func ApplyMemoryConfiguration ¶
func ApplyMemoryConfiguration()
ApplyMemoryConfiguration creates the page tables for current RAM, ROM and IO configuration
func InitApple2eROM ¶
func InitApple2eROM()
InitApple2eROM loads the ROM and inits the ROM page tables
func InitRAM ¶
func InitRAM()
InitRAM sets all default RAM memory settings and resets the page tables
func MapFirstHalfOfIO ¶
func MapFirstHalfOfIO()
MapFirstHalfOfIO maps 0xc100-0xcfff for reading from RomC1
func MapSecondHalfOfIO ¶
func MapSecondHalfOfIO()
MapSecondHalfOfIO map 0xc100-0xcfff for reading from RomC2
func SetCol80 ¶
func SetCol80(value bool)
SetCol80 sets an internal state to fake a missing 80 column card
func SetD000Bank ¶
func SetD000Bank(value int)
SetD000Bank sets the $d000 bank to map to $c000 or $d000 in the physical memory
func SetFakeAltZP ¶
func SetFakeAltZP(value bool)
SetFakeAltZP sets an internal state to fake a missing alternate zero page. Alternate zero page isn't implemented
func SetFakeAuxMemoryRead ¶
func SetFakeAuxMemoryRead(value bool)
SetFakeAuxMemoryRead sets an internal state to fake aux memory reads. Aux memory hasn't been implemented. If aux memory is selected, and a read is attempted, then nonsense must be returned.
func SetFakeAuxMemoryWrite ¶
func SetFakeAuxMemoryWrite(value bool)
SetFakeAuxMemoryWrite sets an internal state to fake aux memory writes. Aux memory hasn't been implemented. If aux memory is selected, and a write is attempted, then it must be ignored.
func SetMemoryMode ¶
func SetMemoryMode(mode uint8)
SetMemoryMode is used to set UpperRAMReadOnly, UpperReadMappedToROM and D000Bank number
func SetPage2 ¶
func SetPage2(value bool)
SetPage2 sets page1/page2 in text, lores or hires. This only works if the 80 column card is disabled since the 80 columns card has not yet nbeen implemented.
func SetStore80 ¶
func SetStore80(value bool)
SetStore80 sets an internal state to fake a missing 80 column card
func SetUpperRAMReadOnly ¶
func SetUpperRAMReadOnly(value bool)
SetUpperRAMReadOnly sets the upper RAM area to read only
func SetUpperReadMappedToROM ¶
func SetUpperReadMappedToROM(value bool)
SetUpperReadMappedToROM sets the upper area so that reads are done from the ROM if true or RAM if false
func WriteMemory ¶
WriteMemory writes to the ROM or RAM page table
Types ¶
This section is empty.