architecture

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: 1 Imported by: 0

Documentation

Overview

Package architecture defines the Map type that is used to specify the differences in cartridge and ARM archtectures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARMArchitecture

type ARMArchitecture string

ARMArchitecture defines the features of the ARM core.

const (
	ARM7TDMI ARMArchitecture = "ARM7TDMI"
	ARMv7_M  ARMArchitecture = "ARMv7-M"
)

List of valid ARMArchitecture values.

type CartArchitecture

type CartArchitecture string

CartArchitecture defines the memory map for the ARM.

const (
	Harmony  CartArchitecture = "Harmony"
	PlusCart CartArchitecture = "PlusCart"
)

List of valid CartArchitecture values.

type MAMCR

type MAMCR uint32

MAMCR defines the state of the MAM.

const (
	MAMdisabled MAMCR = iota
	MAMpartial
	MAMfull
)

List of valid MAMCR values.

type Map

type Map struct {
	CartArchitecture CartArchitecture
	ARMArchitecture  ARMArchitecture

	// some ARM architectures allow misaligned accesses for some instructions
	MisalignedAccesses bool

	FlashOrigin uint32
	FlashMemtop uint32

	SRAMOrigin uint32
	SRAMMemtop uint32

	// the memory latency of the Flash memory block (in nanoseconds)
	FlashLatency float64

	// MAM
	HasMAM bool
	MAMCR  uint32
	MAMTIM uint32

	// PreferredMAMCR is the value that will be used when ARM MAM preferences
	// is set to driver. defaults to MAMfull and is intended to be altered by
	// the cartridge implementation before creating the ARM emulation
	PreferredMAMCR MAMCR

	HasTIMER     bool
	TIMERcontrol uint32
	TIMERvalue   uint32

	HasTIM2 bool
	TIM2CR1 uint32
	TIM2EGR uint32
	TIM2CNT uint32
	TIM2PSC uint32
	TIM2ARR uint32

	HasRNG bool
	RNGCR  uint32
	RNGSR  uint32
	RNGDR  uint32

	// the address below which a null access is considered to have happened
	NullAccessBoundary uint32

	// the value the is returned when an illegal memory address is read
	IllegalAccessValue uint32

	// the divisor to apply to the main clock when ticking the timers
	ClkDiv float32
}

Map of the differences between architectures. The differences are led by the cartridge architecture.

func NewMap

func NewMap(cart CartArchitecture) Map

NewMap is the preferred method of initialisation for the Map type.

func (*Map) IsFlash

func (mmap *Map) IsFlash(addr uint32) bool

IsFlash returns true if address is in flash memory range.

Jump to

Keyboard shortcuts

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