supercharger

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: 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 package supports both loading from a sound file (supporting most WAV and MP3 files) or from a "fastload" file.

Tape loading "events" are handled through the notifications.Notify interface.

When loading from a sound file, Supercharger events can be ignored if so desired but for fastload files, the emulator needs to help the Supercharger mapper. See the playmode package reference implementation for details.

Mutliload tapes are supported from both sound file and fastload binaries. In the case of sound files the audio must be in a single file.

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(env *environment.Environment, 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.

func (*FastLoad) Fastload added in v0.30.0

func (fl *FastLoad) Fastload(mc *cpu.CPU, ram *vcs.RAM, tmr *timer.Timer) error

Fastload implements the mapper.CartSuperChargerFastLoad interface.

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) MappedBanks added in v0.15.0

func (r *Registers) MappedBanks() string

MappedBanks 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) Access added in v0.20.0

func (cart *Supercharger) Access(addr uint16, peek bool) (uint8, uint8, error)

Access implements the mapper.CartMapper interface.

func (*Supercharger) AccessPassive added in v0.20.0

func (cart *Supercharger) AccessPassive(addr uint16, _ uint8) error

AccessPassive implements the mapper.CartMapper interface.

func (*Supercharger) AccessVolatile added in v0.20.0

func (cart *Supercharger) AccessVolatile(addr uint16, data uint8, _ bool) error

AccessVolatile implements the mapper.CartMapper interface.

func (*Supercharger) CopyBanks added in v0.7.1

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

IterateBank implements the mapper.CartMapper interface.

func (*Supercharger) Fastload added in v0.30.0

func (cart *Supercharger) Fastload(mc *cpu.CPU, ram *vcs.RAM, tmr *timer.Timer) error

Fastload implements the mapper.CartSuperChargerFastLoad interface.

func (*Supercharger) GetBank

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

GetBank implements the mapper.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.CartRegistersBus 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 mapper.CartMapper interface.

func (*Supercharger) MappedBanks added in v0.15.0

func (cart *Supercharger) MappedBanks() string

MappedBanks implements the mapper.CartMapper interface.

func (*Supercharger) NumBanks

func (cart *Supercharger) NumBanks() int

NumBanks implements the mapper.CartMapper interface.

func (*Supercharger) Plumb added in v0.7.1

func (cart *Supercharger) Plumb(env *environment.Environment)

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.CartRegistersBus 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) 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()

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 mapper.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