preferences

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: 4 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) execute
	// instantly or if the cycle accurate steppint is attempted
	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
}

type Preferences

type Preferences struct {

	// random values generated in the hardware package should use the following
	// number source
	RandSrc *rand.Rand

	// the number used to seed RandSrc
	RandSeed int64

	// 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

	// ARM preferences are contained in their own type so they can be passed
	// easily to the ARM subsystem
	ARM ARMPreferences
	// contains filtered or unexported fields
}

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

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) Reseed

func (p *Preferences) Reseed(seed int64)

Reseed initialises the random number generator. Use a seed value of 0 to initialise with the current time.

func (*Preferences) Reset

func (p *Preferences) Reset() error

Reset all hardware preferences to the default values.

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

Jump to

Keyboard shortcuts

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