bus

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: GPL-3.0, GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package bus defines the memory bus concept. For an explanation see the memory package documentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUBus

type CPUBus interface {
	Read(address uint16) (uint8, error)
	Write(address uint16, data uint8) error

	// implementations of ReadZeroPage may just pass the address onto the
	// Read() function and return, depending on what the implementation is
	// supposed to do. for the real vcs emulation however, a zero page read
	// has consequences
	ReadZeroPage(address uint8) (uint8, error)
}

CPUBus defines the operations for the memory system when accessed from the CPU All memory areas implement this interface because they are all accessible from the CPU (compare to ChipBus). The VCSMemory type also implements this interface and maps the read/write address to the correct memory area -- meaning that CPU access need not care which part of memory it is writing to

type ChipBus

type ChipBus interface {
	// ChipRead checks to see if the chip's memory area has been written to. if
	// it has the function returns true and an instance of ChipData
	ChipRead() (bool, ChipData)

	// ChipWrite writes the data to the chip memory
	ChipWrite(reg addresses.ChipRegister, data uint8)

	// LastReadRegister returns the register name of the last memory location
	// *read* by the CPU
	LastReadRegister() string
}

ChipBus defines the operations for the memory system when accessed from the VCS chips (TIA, RIOT). Only ChipMemory implements this interface.

type ChipData

type ChipData struct {
	// the canonical name of the chip register writter to
	Name string

	// the data value written to the chip register
	Value uint8
}

ChipData is returned by ChipBus.ChipRead()

type DebuggerBus

type DebuggerBus interface {
	Peek(address uint16) (uint8, error)
	Poke(address uint16, value uint8) error
}

DebuggerBus defines the meta-operations for all memory areas. Think of these functions as "debugging" functions, that is operations outside of the normal operation of the machine.

type InputDeviceBus

type InputDeviceBus interface {
	InputDeviceWrite(reg addresses.ChipRegister, data uint8, preserveBits uint8)
}

InputDeviceBus defines the operations for the memory system when accessed from parts of the emulation are peripheral to the operation of the machine. In practice, this includes the front panel in addition to joysticks, etc.

Jump to

Keyboard shortcuts

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