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 in the cartridgeloader package.
Index ¶
- Variables
- type Cartridge
- func (cart *Cartridge) AccessPassive(addr uint16, data uint8) error
- func (cart *Cartridge) Attach(cartload cartridgeloader.Loader) error
- func (cart *Cartridge) BusStuff() (uint8, bool)
- func (cart *Cartridge) CoProcExecutionState() coprocessor.CoProcExecutionState
- func (cart *Cartridge) CommandExtension(extension string) *commandline.Commands
- func (cart *Cartridge) ContainerID() string
- func (cart *Cartridge) CopyBanks() ([]mapper.BankContent, error)
- func (cart *Cartridge) Eject()
- func (cart *Cartridge) GetBank(addr uint16) mapper.BankInfo
- func (cart *Cartridge) GetCartHotspotsBus() mapper.CartHotspotsBus
- func (cart *Cartridge) GetCartLabelsBus() mapper.CartLabelsBus
- func (cart *Cartridge) GetCoProc() coprocessor.CartCoProc
- func (cart *Cartridge) GetCoProcBus() coprocessor.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) GetSuperchargerFastLoad() mapper.CartSuperChargerFastLoad
- func (cart *Cartridge) GetTapeBus() mapper.CartTapeBus
- func (cart *Cartridge) ID() string
- func (cart *Cartridge) IsEjected() bool
- func (cart *Cartridge) MappedBanks() string
- func (cart *Cartridge) NumBanks() int
- func (cart *Cartridge) ParseCommand(w io.Writer, command string) error
- func (cart *Cartridge) Patch(offset int, data uint8) error
- func (cart *Cartridge) Peek(addr uint16) (uint8, error)
- func (cart *Cartridge) Plumb(env *environment.Environment, fromDifferentEmulation bool)
- func (cart *Cartridge) Poke(addr uint16, data uint8) error
- func (cart *Cartridge) ROMDump() (string, error)
- func (cart *Cartridge) Read(addr uint16) (uint8, uint8, error)
- func (cart *Cartridge) Reset()
- func (cart *Cartridge) RewindBoundary() bool
- func (cart *Cartridge) SetBank(bank string) error
- func (cart *Cartridge) SetYieldHook(hook coprocessor.CartYieldHook)
- 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 ¶
This section is empty.
Variables ¶
var Ejected = errors.New("cartridge ejected")
sentinal error returned if operation is on the ejected cartridge type.
Functions ¶
This section is empty.
Types ¶
type Cartridge ¶
type Cartridge struct { // filename/hash taken from cartridgeloader. choosing not to keep a // reference to the cartridge loader itself. Filename string ShortName string Hash string // contains filtered or unexported fields }
Cartridge defines the information and operations for a VCS cartridge.
func NewCartridge ¶
func NewCartridge(env *environment.Environment) *Cartridge
NewCartridge is the preferred method of initialisation for the cartridge type.
func (*Cartridge) AccessPassive ¶ added in v0.20.0
AccessPassive is called so that the cartridge can respond to changes to the address and data bus even when the data bus is not addressed to the cartridge.
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, regardless of the chip-select line, the address and data buses can be monitored for activity.
Notably the tigervision (3F) mapper monitors and waits 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.
Similarly, the CBS (FA) mapper will switch banks on cartridge addresses 1ff8 to 1ffa (and mirrors) but only if the data bus has the low bit set to one.
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) CoProcExecutionState ¶ added in v0.25.0
func (cart *Cartridge) CoProcExecutionState() coprocessor.CoProcExecutionState
CoProcExecutionState implements the coprocessor.CartCoProcBus interface
If cartridge does not have a coprocessor then an empty instance of mapper.CoProcExecutionState is returned
func (*Cartridge) CommandExtension ¶ added in v0.35.0
func (cart *Cartridge) CommandExtension(extension string) *commandline.Commands
CommandExtension returns an instance of commandline.Commands suitable for commandline tab-completion. Implements commandline.Extension interface
func (*Cartridge) ContainerID ¶ added in v0.15.0
Container returns the cartridge continer ID. If the cartridge is not in a container the empty string is returned.
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) GetCartHotspotsBus ¶ added in v0.17.0
func (cart *Cartridge) GetCartHotspotsBus() mapper.CartHotspotsBus
GetCartHotspotsBus returns interface to hotspots bus or nil if cartridge has no hotspots it wants to report.
func (*Cartridge) GetCartLabelsBus ¶ added in v0.17.0
func (cart *Cartridge) GetCartLabelsBus() mapper.CartLabelsBus
GetCartHotspots returns interface to hotspots bus or nil if cartridge has no hotspots it wants to report.
func (*Cartridge) GetCoProc ¶ added in v0.19.3
func (cart *Cartridge) GetCoProc() coprocessor.CartCoProc
GetCoProc returns interface to the coprocessor interface or nil if no coprocessor is available on the cartridge.
func (*Cartridge) GetCoProcBus ¶ added in v0.8.0
func (cart *Cartridge) GetCoProcBus() coprocessor.CartCoProcBus
GetCoProcBus returns interface to the coprocessor interface or nil if no coprocessor is available on the cartridge.
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) GetSuperchargerFastLoad ¶ added in v0.30.0
func (cart *Cartridge) GetSuperchargerFastLoad() mapper.CartSuperChargerFastLoad
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) MappedBanks ¶ added in v0.15.0
MappedBanks returns a string summary of the mapping. ie. what banks are mapped in.
func (*Cartridge) ParseCommand ¶ added in v0.35.0
ParseCommand forwards a terminal command to the mapper
func (*Cartridge) Plumb ¶ added in v0.7.1
func (cart *Cartridge) Plumb(env *environment.Environment, fromDifferentEmulation bool)
Plumb makes sure everything is ship-shape after a rewind event.
The fromDifferentEmulation indicates that the State has been created by a different VCS emulation than the one being plumbed into.
See mapper.PlumbFromDifferentEmulation for how this affects mapper implementations.
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.
func (*Cartridge) SetYieldHook ¶ added in v0.20.0
func (cart *Cartridge) SetYieldHook(hook coprocessor.CartYieldHook)
SetYieldHook implements the coprocessor.CartCoProcBus interface.
func (*Cartridge) Step ¶ added in v0.2.1
Step should be called every CPU cycle. The attached cartridge may or may not change its state as a result. In fact, very few cartridges care about this.
func (*Cartridge) String ¶
String returns a summary of the cartridge, it's mapper and any containers.
For just the filename use the Filename field or the ShortName field. Filename includes the path.
For just the mapping use the ID() function and for just the container ID use the ContainerID() function.
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 ¶
- cartridge.go
- doc.go
- fingerprint.go
- mapper_3e.go
- mapper_3eplus.go
- mapper_atari.go
- mapper_atari_bf.go
- mapper_atari_ef.go
- mapper_atari_jane.go
- mapper_atari_wf8.go
- mapper_cbs.go
- mapper_commavid.go
- mapper_df.go
- mapper_dpc.go
- mapper_ejected.go
- mapper_fa2.go
- mapper_mnetwork.go
- mapper_parkerbros.go
- mapper_scabs.go
- mapper_superbank.go
- mapper_tigervision.go
- mapper_ua.go
- mapper_wickstead_design.go
Directories ¶
Path | Synopsis |
---|---|
Package ace implements the ACE cartridge mapper.
|
Package ace implements the ACE cartridge mapper. |
Package arm imlplements the ARM7TDMI instruction set as defined in the ARM7TDMI Instruction Set Reference:
|
Package arm imlplements the ARM7TDMI instruction set as defined in the ARM7TDMI Instruction Set Reference: |
architecture
Package architecture defines the Map type that is used to specify the differences in cartridge and ARM archtectures.
|
Package architecture defines the Map type that is used to specify the differences in cartridge and ARM archtectures. |
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. |
peripherals
Package peripherals implements the optional modules that can make up the ARM processor.
|
Package peripherals implements the optional modules that can make up the ARM processor. |
Package cdf implemnents the various CDF type cartridge mappers including CDFJ.
|
Package cdf implemnents the various CDF type cartridge mappers including CDFJ. |
Package dpcplus implements the DPC+ cartridge mapper.
|
Package dpcplus implements the DPC+ cartridge mapper. |
Package ace implements the ELF cartridge mapper.
|
Package ace implements the ELF 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. |
plusnet
Package plusnet contains details of the PlusNET protocol.
|
Package plusnet contains details of the PlusNET protocol. |
Package supercharger implements the tape based cartridge format.
|
Package supercharger implements the tape based cartridge format. |