mmu

package
v0.0.0-...-5899396 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const RomPath = "apple2e.rom"

RomPath is a hardcoded path to an Apple //e ROM file that's loaded at startup

View Source
const StackPage = 1

StackPage is the location of the 6504 stack

Variables

View Source
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

View Source
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

View Source
var ReadPageTable [0x100][]uint8

ReadPageTable is the page table for reads

View Source
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

View Source
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 InitIO

func InitIO()

InitIO resets all IO states

func InitRAM

func InitRAM()

InitRAM sets all default RAM memory settings and resets the page tables

func InitROM

func InitROM()

InitROM sets the upper memory area for reading from ROM

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 ReadIO

func ReadIO(address uint16) uint8

ReadIO does a read in the $c000-$c0ff area

func ReadMemory

func ReadMemory(address uint16) uint8

ReadMemory reads the ROM or RAM page table

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 WipeRAM

func WipeRAM()

WipeRAM wipes all the physical RAM

func WriteIO

func WriteIO(address uint16, value uint8)

WriteIO does a write in the $c000-$c0ff area

func WriteMemory

func WriteMemory(address uint16, value uint8)

WriteMemory writes to the ROM or RAM page table

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL