Documentation ¶
Overview ¶
Package cartridge fully implements loading of mapping of cartridge memory. Cartridge memory is memory that is peripheral to the VCS and can grow quite complex.
There are many different types of mapping scheme supported by the package.
Some cartridge types contain additional RAM but the main difference is how they map additional ROM into 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. An empty string or "AUTO" tells the cartridge system to make a best guess.
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" DPC (Pitfall2) "DPC" DPC+ "DPC+" 3E+ "3E+" Supercharger "AR"
Index ¶
- Constants
- type Cartridge
- func (cart *Cartridge) Attach(cartload cartridgeloader.Loader) error
- func (cart *Cartridge) CopyBanks() ([]mapper.BankContent, error)
- func (cart *Cartridge) Eject()
- func (cart *Cartridge) GetBank(addr uint16) mapper.BankInfo
- func (cart *Cartridge) GetCartHotspots() mapper.CartHotspotsBus
- func (cart *Cartridge) GetCoProcBus() mapper.CartCoProcBus
- func (cart *Cartridge) GetContainer() mapper.CartContainer
- func (cart *Cartridge) GetRAMbus() mapper.CartRAMbus
- func (cart *Cartridge) GetRegistersBus() mapper.CartRegistersBus
- func (cart *Cartridge) GetStaticBus() mapper.CartStaticBus
- func (cart *Cartridge) GetTapeBus() mapper.CartTapeBus
- func (cart *Cartridge) ID() string
- func (cart *Cartridge) IsEjected() bool
- func (cart *Cartridge) Listen(addr uint16, data uint8)
- func (cart *Cartridge) Mapping() string
- 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) Plumb()
- func (cart *Cartridge) Poke(addr uint16, data uint8) error
- func (cart *Cartridge) Read(addr uint16) (uint8, error)
- func (cart *Cartridge) Reset()
- func (cart *Cartridge) RewindBoundary() bool
- func (cart *Cartridge) Snapshot() *Cartridge
- func (cart *Cartridge) Step(clock float32)
- func (cart *Cartridge) String() string
- func (cart *Cartridge) Write(addr uint16, data uint8) error
- type DPCdataFetcher
- type DPCregisters
Constants ¶
const (
Ejected = "cartridge ejected"
)
Sentinal error returned if operation is on the ejected cartridge type.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cartridge ¶
type Cartridge struct { bus.DebugBus 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(prefs *preferences.Preferences) *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
How cartridges are mapped into the VCS's 4k space can differs dramatically. Much of the implementation details have been cribbed from Kevin Horton's "Cart Information" document [sizes.txt]. Other sources of information noted as appropriate.
func (*Cartridge) CopyBanks ¶ added in v0.7.1
func (cart *Cartridge) CopyBanks() ([]mapper.BankContent, error)
CopyBanks returns the sequence of banks in a cartridge. To return the next bank in the sequence, call the function with the instance of mapper.BankContent returned from the previous call. The end of the sequence is indicated by the nil value. Start a new iteration with the nil argument.
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 information for the specified address. See documentation for memorymap.Bank for more information.
func (*Cartridge) GetCartHotspots ¶ added in v0.7.1
func (cart *Cartridge) GetCartHotspots() mapper.CartHotspotsBus
GetCartHotspots returns interface to hotspots bus or nil if cartridge has no hotspots it wants to report.
func (*Cartridge) GetCoProcBus ¶ added in v0.8.0
func (cart *Cartridge) GetCoProcBus() mapper.CartCoProcBus
GetCoProcBus returns interface to coprocessor bus.
func (*Cartridge) GetContainer ¶ added in v0.7.1
func (cart *Cartridge) GetContainer() mapper.CartContainer
GetContainer returns interface to cartridge container or nil if cartridge is not in a container.
func (*Cartridge) GetRAMbus ¶ added in v0.2.1
func (cart *Cartridge) GetRAMbus() mapper.CartRAMbus
GetRAMbus returns interface to ram busor nil if catridge contains no RAM.
func (*Cartridge) GetRegistersBus ¶ added in v0.3.1
func (cart *Cartridge) GetRegistersBus() mapper.CartRegistersBus
GetRegistersBus returns interface to the registers of the cartridge or nil if cartridge has no registers.
func (*Cartridge) GetStaticBus ¶ added in v0.3.1
func (cart *Cartridge) GetStaticBus() mapper.CartStaticBus
GetStaticBus returns interface to the static area of the cartridge or nil if cartridge has no static area.
func (*Cartridge) GetTapeBus ¶ added in v0.7.1
func (cart *Cartridge) GetTapeBus() mapper.CartTapeBus
GetTapeBus returns interface to a tape bus or nil if catridge has no tape.
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) Mapping ¶ added in v0.10.1
Mapping returns a string summary of the mapping. ie. what banks are mapped in.
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) Read ¶
Read is an implementation of memory.CPUBus. Address should not be normalised.
func (*Cartridge) Reset ¶ added in v0.7.1
func (cart *Cartridge) Reset()
Reset volative contents of Cartridge.
func (*Cartridge) RewindBoundary ¶ added in v0.7.1
RewindBoundary returns true if the cartridge indicates that something has happened that should not be part of the rewind history. Returns false if cartridge mapper does not care about the rewind sub-system.
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 mapper.CartRegisters interface.
func (DPCregisters) String ¶ added in v0.2.1
func (r DPCregisters) String() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package harmony implements the Harmony cartridge.
|
Package harmony implements the Harmony cartridge. |
arm7tdmi
Package arm7tdmi imlplements the ARM7TDMI instruction set as defined in the ARM7TDMI Instruction Set Reference: http://www.ecs.csun.edu/~smirzaei/docs/ece425/arm7tdmi_instruction_set_reference.pdf For this project we only need to emulte the Thumb architecture.
|
Package arm7tdmi imlplements the ARM7TDMI instruction set as defined in the ARM7TDMI Instruction Set Reference: http://www.ecs.csun.edu/~smirzaei/docs/ece425/arm7tdmi_instruction_set_reference.pdf For this project we only need to emulte the Thumb architecture. |
callfn
Package Callfn facilitates the ARM CALLFN process common to both DPC+ and CDF* cartridge mappers.
|
Package Callfn facilitates the ARM CALLFN process common to both DPC+ and CDF* cartridge mappers. |
cdf
Package cdf implemnents the various CDF type cartridge mappers including CDFJ.
|
Package cdf implemnents the various CDF type cartridge mappers including CDFJ. |
dpcplus
Package dpcplus implements the DPC+ cartridge mapper.
|
Package dpcplus implements the DPC+ cartridge mapper. |
Package mapper contains the CartMapper interface.
|
Package mapper contains the CartMapper interface. |
Package moviecart implements the Movie Cart special cartridge type.
|
Package moviecart implements the Movie Cart special cartridge type. |
Package plusrom implements the PlusROM cartridge as developed by Wolfgang Stubig.
|
Package plusrom implements the PlusROM cartridge as developed by Wolfgang Stubig. |
Package supercharger implements the tape based cartridge format.
|
Package supercharger implements the tape based cartridge format. |