Documentation
¶
Overview ¶
Package cartridge fully implements loading of mapping of cartridge memory.
There are many different types of cartridge most of which are supported by the package. Some cartridge types contain additional RAM but the main difference is how they map additional ROM to the relatively small address space available for cartridges in the VCS. This is called bank-switching. All of these differences are handled transparently by the package.
Currently supported cartridge types are listed below. The strings in quotation marks are the identifiers that should be used to specify a particular mapping in the Mapping field of cartridgeloader.Loader:
Atari 2k "2k" Atari 4k "4k" Atari 8k "F8" Atari 16k "F6" Atari 32k "F4" CBS case "FA" M-Network "E7" Parker Bros "E0" Tigervision "3F"
Index ¶
- type Cartridge
- func (cart *Cartridge) Attach(cartload cartridgeloader.Loader) error
- func (cart *Cartridge) Eject()
- func (cart Cartridge) GetBank(addr uint16) int
- func (cart Cartridge) GetDebugBus() bus.CartDebugBus
- func (cart Cartridge) GetRAMbus() bus.CartRAMbus
- func (cart Cartridge) ID() string
- func (cart *Cartridge) Initialise()
- func (cart *Cartridge) IsEjected() bool
- func (cart Cartridge) Listen(addr uint16, data uint8)
- func (cart Cartridge) NumBanks() int
- func (cart *Cartridge) Patch(offset int, data uint8) error
- func (cart *Cartridge) Peek(addr uint16) (uint8, error)
- func (cart *Cartridge) Poke(addr uint16, data uint8) error
- func (cart *Cartridge) Read(addr uint16) (uint8, error)
- func (cart *Cartridge) RestoreState(state interface{}) error
- func (cart *Cartridge) SaveState() interface{}
- func (cart *Cartridge) SetBank(addr uint16, bank int) error
- func (cart Cartridge) Step()
- func (cart Cartridge) String() string
- func (cart *Cartridge) Write(addr uint16, data uint8) error
- type DPCdataFetcher
- type DPCregisters
- type DPCstatic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cartridge ¶
type Cartridge struct { bus.DebuggerBus bus.CPUBus Filename string Hash string // contains filtered or unexported fields }
Cartridge defines the information and operations for a VCS cartridge
func NewCartridge ¶
func NewCartridge() *Cartridge
NewCartridge is the preferred method of initialisation for the cartridge type
func (*Cartridge) Attach ¶
func (cart *Cartridge) Attach(cartload cartridgeloader.Loader) error
Attach the cartridge loader to the VCS and make available the data to the CPU bus
func (*Cartridge) Eject ¶
func (cart *Cartridge) Eject()
Eject removes memory from cartridge space and unlike the real hardware, attaches a bank of empty memory - for convenience of the debugger
func (Cartridge) GetBank ¶
GetBank returns the current bank number for the specified address
Address must be a normlised cartridge address.
func (Cartridge) GetDebugBus ¶ added in v0.2.1
func (cart Cartridge) GetDebugBus() bus.CartDebugBus
GetDebugBus returns interface to the debugging bus to the cartridge.
func (Cartridge) GetRAMbus ¶ added in v0.2.1
func (cart Cartridge) GetRAMbus() bus.CartRAMbus
GetRAMbus returns an array of bus.CartRAM or nil if catridge contains no RAM
func (Cartridge) Listen ¶
Listen for data at the specified address.
The VCS cartridge port is wired up to all 13 address lines of the 6507. Under normal operation, the chip-select line is used by the cartridge to know when to put data on the data bus. If it's not "on" then the cartridge does nothing.
However, the option is there to "listen" on the address bus. Notably the tigervision (3F) mapping listens for address 0x003f, which is in the TIA address space. When this address is triggered, the tigervision cartridge will use whatever is on the data bus to switch banks.
func (*Cartridge) Patch ¶
Patch writes to cartridge memory. Offset is measured from the start of cartridge memory. It differs from Poke in that respect
func (*Cartridge) Peek ¶
Peek is an implementation of memory.DebuggerBus. Address must be normalised.
func (*Cartridge) Poke ¶
Poke is an implementation of memory.DebuggerBus. Address must be normalised.
func (*Cartridge) RestoreState ¶
RestoreState retuns the state of the cartridge to a previously known state
func (*Cartridge) SaveState ¶
func (cart *Cartridge) SaveState() interface{}
SaveState notes and returns the current state of the cartridge (RAM contents, selected bank)
func (*Cartridge) SetBank ¶
SetBank maps the specified address such that it references the specified bank. For many cart mappers this just means switching banks for the entire cartridge. Address must be normalised.
NOTE: For some cartridge types, the specific address is not important
type DPCdataFetcher ¶ added in v0.2.1
type DPCdataFetcher struct { Low byte Hi byte Top byte Bottom byte // is the Low byte in the window between top and bottom Flag bool // music mode only used by data fetchers 4-7 MusicMode bool OSCclock bool }
DPCdataFetcher represents a single DPC data fetcher
type DPCregisters ¶ added in v0.2.1
type DPCregisters struct { Fetcher [8]DPCdataFetcher // the current random number value RNG uint8 }
DPCregisters implements the bus.CartRegisters interface
func (DPCregisters) String ¶ added in v0.2.1
func (r DPCregisters) String() string
String implements the bus.CartDebugBus interface