memory

package
v0.0.0-...-29c147f Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// pages
	// https://www.c64-wiki.com/wiki/Memory_Map
	ZeroPage          uint16 = 0x0000
	CartLoStartPage   uint16 = 0x8000
	CartLoEndPage     uint16 = 0x9F00
	BasicStartPage    uint16 = 0xa000
	BasicEndPage      uint16 = 0xbf00
	CartHi1StartPage  uint16 = 0xa000
	CartHi1EndPage    uint16 = 0xbf00
	CharStartPage     uint16 = 0xd000
	CharEndPage       uint16 = 0xdf00
	VICStartPage      uint16 = 0xd000
	VICEndPage        uint16 = 0xd300
	SIDStartPage      uint16 = 0xd400
	SIDEndPage        uint16 = 0xd700
	ColorRamStartPage uint16 = 0xd800
	ColorRamEndPage   uint16 = 0xdb00
	CIA1Page          uint16 = 0xdc00
	CIA2Page          uint16 = 0xdd00
	IO1Page           uint16 = 0xde00
	IO2Page           uint16 = 0xdf00
	KernalStartPage   uint16 = 0xe000
	KernalEndPage     uint16 = 0xff00
	CartHi2StartPage  uint16 = 0xe000
	CartHi2EndPage    uint16 = 0xff00

	// banking switching
	LORAM  byte = 1 << 0 // BIT0: Configures RAM or ROM at $A000-$BFFF for basic rom
	HIRAM  byte = 1 << 1 // BIT1: Configures RAM or ROM at $E000-$FFFF for kernal rom
	CHAREN byte = 1 << 2 // BIT2: Configures ROM or I/O at $D000-$DFFF for character rom

	// registers
	CpuPortRegister uint16 = 0x0001 // for banking switch
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BandMode

type BandMode uint8
const BandModeIO BandMode = 0
const BandModeRAM BandMode = 1
const BandModeROM BandMode = 2

type C64MemoryBus

type C64MemoryBus struct {
	// contains filtered or unexported fields
}

func NewC64Memory

func NewC64Memory(logger slog.Logger, cia1, cia2, vic c64.BasicIO) *C64MemoryBus

func (*C64MemoryBus) GetAddrBandMode

func (m *C64MemoryBus) GetAddrBandMode(addr uint16) BandMode

func (*C64MemoryBus) LoadRom

func (m *C64MemoryBus) LoadRom(path string, addr uint16, ram bool) error

func (*C64MemoryBus) Read

func (m *C64MemoryBus) Read(addr uint16) byte

func (*C64MemoryBus) ReadRom

func (m *C64MemoryBus) ReadRom(addr uint16) byte

func (*C64MemoryBus) ReadWord

func (m *C64MemoryBus) ReadWord(addr uint16) uint16

func (*C64MemoryBus) SetVIC

func (m *C64MemoryBus) SetVIC(vic c64.BasicIO)

func (*C64MemoryBus) VicRead

func (m *C64MemoryBus) VicRead(addr uint16) uint8

func (*C64MemoryBus) Write

func (m *C64MemoryBus) Write(addr uint16, v byte)

Jump to

Keyboard shortcuts

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