chipbus

package
v0.30.0 Latest Latest
Warning

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

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

Documentation

Overview

Package chipbus defines the operations, addresses and symbols that are required by the TIA and RIOT chips when updated values in memory.

Another way to think of this is: the operations, etc. that are required to interface with the VCS memory from the perspective of the TIA and RIOT chips.

It also defines the operations required by the TIA and RIOT chips in order to respond to changes made by the CPU.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangedRegister

type ChangedRegister struct {
	// the address of the register
	Address uint16

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

	// registers are changed via the CPU bus and so the name is a
	// cpubus.Register and not a chipbus.Register
	//
	// of the register is not named then the change is non-effective. the
	// RIOT/TIA implementation should log such an event
	Register cpubus.Register
}

ChangedRegister packages together the name of the chip register that has been changed by the CPU along with the new value.

type Memory

type Memory interface {
	// ChipHasChanged 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
	ChipHasChanged() (ChangedRegister, bool)

	// ChipWrite writes the data to the chip memory
	ChipWrite(reg Register, data uint8)

	// ChipRefer reads the data from chip memory. It returns the value that the
	// CPU will see.
	//
	// Should be used in preference to keeping a local copy of the written
	// value in the TIA/RIOT implementation.
	ChipRefer(reg Register) uint8

	// LastReadAddress returns true and the address of the last read by the
	// CPU. Returns false if no read has taken place since the last call to the
	// funtion.
	//
	// Only used by the RIOT timer.
	LastReadAddress() (bool, uint16)
}

Memory defines the operations for the memory system when accessed from the VCS chips (TIA, RIOT).

type Register

type Register int

Register specifies the offset of a chip register in the chip memory areas. It is used in contexts where a register is required, as opposed to an address.

const (
	CXM0P Register = iota
	CXM1P
	CXP0FB
	CXP1FB
	CXM0FB
	CXM1FB
	CXBLPF
	CXPPMM
	INPT0
	INPT1
	INPT2
	INPT3
	INPT4
	INPT5
)

TIA registers

These value are used by the emulator to specify known addresses. For example, when writing collision information we know we need the CXM0P register. these named values make the code more readable

const (
	SWCHA Register = iota
	SWACNT
	SWCHB
	SWBCNT
	INTIM
	TIMINT
)

RIOT registers

These value are used by the emulator to specify known addresses. For example, the timer updates itself every cycle and stores time remaining value in the INTIM register.

Jump to

Keyboard shortcuts

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