supercharger

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package supercharger implements the tape based cartridge format. The implementation is complex enough for it to be spread over more than one file and so for purposes of clarity it has been placed in its own package.

The supercharger is interfaced in the same way as other cartridge formats. The fastload mechanism however, requires special handling, which is unfortunate but unavoidable. It is worth summarising here:

As a result of a fast-load of a BIN file into supercharger memory, the supercharger package will return an error of type supercharger.FastLoaded

The FastLoaded error indicates an exception to the normal running of the emulation. For the loading to complete the error needs special handling. There are two places in Gopher2600 where this handling takes place. One is in the debugger.inputLoop() and the other in hardware.run() (the latter is called from the playmode package).

Wherever it is handled, the error should be caught and interpreted as a function and called, with a reference to the emulator's CPU, RAM and Timer.

Index

Constants

View Source
const MutliloadByteAddress = 0xfa

The address in VCS RAM of the multiload byte. Tapes will not load unless the encoded multibyte in the stream is the same as the value in this address.

Variables

This section is empty.

Functions

func NewSupercharger

func NewSupercharger(cartload cartridgeloader.Loader) (mapper.CartMapper, error)

NewSupercharger is the preferred method of initialisation for the Supercharger type.

Types

type FastLoad

type FastLoad struct {
	// contains filtered or unexported fields
}

FastLoad implements the Tape interface. It loads data from a binary file rather than a sound file.

On success it returns the FastLoaded error. This must be interpreted by the emulator driver and called with the arguments listed in the error type.

Format information for fast-loca binary rom mailing list post:

Subject: Re: [stella] Supercharger BIN format From: Eckhard Stolberg Date: Fri, 08 Jan 1999.

type FastLoaded

type FastLoaded func(*cpu.CPU, *vcs.RAM, *timer.Timer) error

FastLoaded defines the callback function that is sent to the core emulation along with the HookActionFastloadEnded action. The core emulation in turn calls this function to complete the supercharger fastload process.

type Registers

type Registers struct {
	Value uint8
	Delay int // 0=off, 1=trigger

	// the last value to be written to (not including fff8 writes)
	LastWriteValue   uint8
	LastWriteAddress uint16

	// config byte, raw value
	ConfigByte uint8

	// config byte broken into parts
	WriteDelay  int
	BankingMode int
	RAMwrite    bool
	ROMpower    bool
	// contains filtered or unexported fields
}

Registers implements the mapper.CartRegisters interface.

func (*Registers) Mapping added in v0.10.1

func (r *Registers) Mapping() string

Mapping is like string but just the bank information. we use this when building the mapper summary, the String() function is too verbose for that.

func (Registers) String

func (r Registers) String() string

type SoundLoad added in v0.7.1

type SoundLoad struct {
	// contains filtered or unexported fields
}

SoundLoad implements the Tape interface. It loads data from a sound file.

Compared to FastLoad this method is more 'authentic' and uses the BIOS correctly.

func (*SoundLoad) GetTapeState added in v0.7.1

func (tap *SoundLoad) GetTapeState() (bool, mapper.CartTapeState)

func (*SoundLoad) Rewind added in v0.7.1

func (tap *SoundLoad) Rewind()

Rewind implements the mapper.CartTapeBus interface.

func (*SoundLoad) SetTapeCounter added in v0.7.1

func (tap *SoundLoad) SetTapeCounter(c int)

SetTapeCounter implements the mapper.CartTapeBus interface.

type Supercharger

type Supercharger struct {
	// contains filtered or unexported fields
}

Supercharger represents a supercharger cartridge.

func (*Supercharger) CopyBanks added in v0.7.1

func (cart *Supercharger) CopyBanks() []mapper.BankContent

IterateBank implements the mapper.CartMapper interface.

func (*Supercharger) GetBank

func (cart *Supercharger) GetBank(addr uint16) mapper.BankInfo

GetBank implements the cartMapper interface.

func (*Supercharger) GetRAM

func (cart *Supercharger) GetRAM() []mapper.CartRAM

GetRAM implements the mapper.CartRAMBus interface.

func (Supercharger) GetRegisters

func (cart Supercharger) GetRegisters() mapper.CartRegisters

GetRegisters implements the mapper.CartDebugBus interface.

func (*Supercharger) GetTapeState added in v0.7.1

func (cart *Supercharger) GetTapeState() (bool, mapper.CartTapeState)

GetTapeState implements the mapper.CartTapeBus interface

Whether this does anything meaningful depends on the interal implementation of the 'tape' interface.

func (*Supercharger) ID

func (cart *Supercharger) ID() string

ID implements the cartMapper interface.

func (*Supercharger) Listen

func (cart *Supercharger) Listen(addr uint16, _ uint8)

Listen implements the cartMapper interface.

func (*Supercharger) Mapping added in v0.10.1

func (cart *Supercharger) Mapping() string

Mapping implements the mapper.CartMapper interface.

func (*Supercharger) NumBanks

func (cart *Supercharger) NumBanks() int

NumBanks implements the cartMapper interface.

func (*Supercharger) Patch

func (cart *Supercharger) Patch(_ int, _ uint8) error

Patch implements the cartMapper interface.

func (*Supercharger) Plumb added in v0.7.1

func (cart *Supercharger) Plumb()

Plumb implements the mapper.CartMapper interface.

func (*Supercharger) PutRAM

func (cart *Supercharger) PutRAM(bank int, idx int, data uint8)

PutRAM implements the mapper.CartRAMBus interface.

func (*Supercharger) PutRegister

func (cart *Supercharger) PutRegister(register string, data string)

PutRegister implements the mapper.CartDebugBus interface

the register argument must be one of the following and after the = sign, the type to which the data argument will be converted.

value = int
delay = int (0 ... 6)
ramwrite = bool
rompower = bool

note that PutRegister() will panic() if the register or data string is invalid.

func (*Supercharger) Read

func (cart *Supercharger) Read(fullAddr uint16, passive bool) (uint8, error)

Read implements the cartMapper interface.

func (*Supercharger) ReadHotspots added in v0.7.1

func (cart *Supercharger) ReadHotspots() map[uint16]mapper.CartHotspotInfo

ReadHotspots implements the mapper.CartHotspotsBus interface.

func (*Supercharger) Reset added in v0.7.1

func (cart *Supercharger) Reset(randSrc *rand.Rand)

Reset implements the mapper.CartMapper interface.

func (*Supercharger) Rewind added in v0.7.1

func (cart *Supercharger) Rewind()

Rewind implements the mapper.CartTapeBus interface

Whether this does anything meaningful depends on the interal implementation of the 'tape' interface.

func (*Supercharger) SetTapeCounter added in v0.7.1

func (cart *Supercharger) SetTapeCounter(c int)

SetTapeCounter implements the mapper.CartTapeBus interface

Whether this does anything meaningful depends on the interal implementation of the 'tape' interface.

func (*Supercharger) Snapshot added in v0.7.1

func (cart *Supercharger) Snapshot() mapper.CartMapper

Snapshot implements the mapper.CartMapper interface.

func (*Supercharger) Step

func (cart *Supercharger) Step(_ float32)

Step implements the cartMapper interface.

func (*Supercharger) Write

func (cart *Supercharger) Write(addr uint16, data uint8, passive bool, poke bool) error

Write implements the cartMapper interface.

func (*Supercharger) WriteHotspots added in v0.7.1

func (cart *Supercharger) WriteHotspots() map[uint16]mapper.CartHotspotInfo

WriteHotspots implements the mapper.CartHotspotsBus interface.

Jump to

Keyboard shortcuts

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