preferences

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: GPL-3.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package preferences (sub-package of the hardware package) coordinates the options for all variations in hardware operation. For example, whether to start the hardware in an unknown, or random, state.

Index

Constants

View Source
const MAMDriver = -1

Indicators that the ARM should put the MAM into the mode inidcated by the emulated driver for the cartridge mapper.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARMPreferences added in v0.12.1

type ARMPreferences struct {

	// the specific model of ARM to use. this will affect things like memory
	// addressing for cartridge formats that use the ARM.
	//
	// NOTE: this may be superceded in the future to allow for more flexibility
	Model prefs.String

	// whether the ARM coprocessor (as found in Harmony cartridges) executes
	// instantly
	Immediate prefs.Bool

	// a value of MAMDriver says to use the driver supplied MAM value. any
	// other value "forces" the MAM setting on Thumb program execution.
	MAM prefs.Int

	// abort Thumb program is it tries to access memory that does not exist.
	// for example: reading from Flash memory above the 32k memtop (for 32k
	// ROMs)
	AbortOnIllegalMem prefs.Bool
	// contains filtered or unexported fields
}

func (*ARMPreferences) Load added in v0.16.0

func (p *ARMPreferences) Load() error

Load current arm preference from disk.

func (*ARMPreferences) Save added in v0.16.0

func (p *ARMPreferences) Save() error

Save current arm preferences to disk.

func (*ARMPreferences) SetDefaults added in v0.16.0

func (p *ARMPreferences) SetDefaults()

SetDefaults reverts all settings to default values.

func (*ARMPreferences) String added in v0.16.0

func (p *ARMPreferences) String() string

type LiveRevisionPreferences added in v0.16.0

type LiveRevisionPreferences struct {
	// The names of the preference fields match the Bug enumerations. These
	// values are updated automatically when the corresponding Dsk* field is
	// updated.
	LateVDELGRP0     bool
	LateVDELGRP1     bool
	LateRESPx        bool
	EarlyScancounter bool
	LatePFx          bool
	LateCOLUPF       bool
	LostMOTCK        bool
	RESPxHBLANK      bool
}

LiveRevisionPrefrences encapsulates the current revision values.

type PlusROMPreferences added in v0.16.0

type PlusROMPreferences struct {
	Nick prefs.String
	ID   prefs.String

	// is true if the default nick/id are being used
	NewInstallation bool
	// contains filtered or unexported fields
}

func (*PlusROMPreferences) Load added in v0.16.0

func (p *PlusROMPreferences) Load() error

Load plusrom preferences from disk.

func (*PlusROMPreferences) Save added in v0.16.0

func (p *PlusROMPreferences) Save() error

Save current plusrom preferences to disk.

func (*PlusROMPreferences) SetDefaults added in v0.16.0

func (p *PlusROMPreferences) SetDefaults()

SetDefaults reverts all settings to default values.

type Preferences

type Preferences struct {

	// initialise hardware to unknown state after reset
	RandomState prefs.Bool

	// unused pins when reading TIA/RIOT registers take the value of the last
	// value on the bus. if RandomPins is true then the values of the unusued
	// pins are randomised. this is the equivalent of the Stella option "drive
	// unused pins randomly on a read/peek"
	RandomPins prefs.Bool

	// preferences used by the ARM sub-system
	ARM *ARMPreferences

	// preferences used by PlusROM cartridges
	PlusROM *PlusROMPreferences

	// preferences used by the TIA package in order to emulate different
	// revisions of the TIA chip
	Revision *RevisionPreferences
	// contains filtered or unexported fields
}

Preferences defines and collates all the preference values used by the emulation.

func NewPreferences

func NewPreferences() (*Preferences, error)

NewPreferences is the preferred method of initialisation for the Preferences type.

func (*Preferences) Load

func (p *Preferences) Load() error

Load current hardware preference from disk.

func (*Preferences) Save

func (p *Preferences) Save() error

Save current hardware preferences to disk.

func (*Preferences) SetDefaults added in v0.12.1

func (p *Preferences) SetDefaults()

SetDefaults reverts all settings to default values.

func (*Preferences) String

func (p *Preferences) String() string

type RevisionPreferences added in v0.16.0

type RevisionPreferences struct {

	// Disk copies of preferences
	LateVDELGRP0     prefs.Bool
	LateVDELGRP1     prefs.Bool
	LateRESPx        prefs.Bool
	EarlyScancounter prefs.Bool
	LatePFx          prefs.Bool
	LateCOLUPF       prefs.Bool
	LostMOTCK        prefs.Bool
	RESPxHBLANK      prefs.Bool
	// contains filtered or unexported fields
}

RevisionPreferences defines the details of the TIA revisins.

For performance critical situations, access these prefence values via the results of the Live() function. This provides a copy of the preferences that are goroutine safe and without performance overhead.

func (*RevisionPreferences) Live added in v0.16.0

Live returns a copy of the live revision preference values

func (*RevisionPreferences) Load added in v0.16.0

func (p *RevisionPreferences) Load() error

Load revision preferences from disk.

func (*RevisionPreferences) Save added in v0.16.0

func (p *RevisionPreferences) Save() error

Save current revision preferences to disk.

func (*RevisionPreferences) SetDefaults added in v0.16.0

func (p *RevisionPreferences) SetDefaults()

SetDefaults reverts all settings to default values.

Jump to

Keyboard shortcuts

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