memory

package
v0.0.0-...-a8aa549 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InterruptsEnabledAddress uint16 = 0xFFFF
	InterruptFlagsAddress    uint16 = 0xFF0F
)
View Source
const BOOT_ROM_SIZE = 0x0100
View Source
const MEM_SIZE = 0x10000
View Source
const ROM_SIZE = 0x08000
View Source
const STACK_END = 0xFFFF
View Source
const STACK_START = 0xFF00

Variables

This section is empty.

Functions

func NewControllerRegister

func NewControllerRegister() controllerRegister

func NewMemoryMapWithBytes

func NewMemoryMapWithBytes(bytes []byte) *memoryMap

Types

type ByteRegister

type ByteRegister interface {
	Read() byte
	Write(value byte)
}

type ClockSelect

type ClockSelect byte
var (
	Clock4k   ClockSelect = 0
	Clock262k ClockSelect = 1
	Clock65k  ClockSelect = 2
	Clock16k  ClockSelect = 3
)

func (ClockSelect) Countdown

func (s ClockSelect) Countdown() int

type Controller

type Controller struct {
	ControllerData   controllerRegister
	Divider          divRegister
	TimerCounter     simpleByteRegister
	TimerModulo      simpleByteRegister
	TimerController  timerController
	BootRomRegister  bootRomByteRegister
	LCDCFlags        register.LCDCFlags
	StatFlags        register.StatFlags
	SCY              simpleByteRegister
	SCX              simpleByteRegister
	LY               simpleByteRegister
	LYC              simpleByteRegister
	BGP              simpleByteRegister
	OBP0             simpleByteRegister
	OBP1             simpleByteRegister
	InterruptFlags   InterruptFlagsRegister
	InterruptEnabled InterruptEnabledRegister
	SerialOutput     string
	// contains filtered or unexported fields
}

func NewController

func NewController() Controller

func NewControllerWithBytes

func NewControllerWithBytes(bytes []byte) Controller

func (*Controller) LoadRomImage

func (c *Controller) LoadRomImage(filename string) error

func (*Controller) ReadAddr

func (c *Controller) ReadAddr(addr uint16) byte

func (*Controller) ReadAddrU16

func (c *Controller) ReadAddrU16(addr uint16) uint16

func (*Controller) ReadAll

func (c *Controller) ReadAll() []byte

func (*Controller) WriteAddr

func (c *Controller) WriteAddr(addr uint16, value byte)

func (*Controller) WriteAddrU16

func (c *Controller) WriteAddrU16(addr, value uint16)

type InterruptAddress

type InterruptAddress uint16

func GetIsrAddress

func GetIsrAddress(eif byte) (InterruptAddress, byte)

type InterruptEnabledRegister

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

func (*InterruptEnabledRegister) Read

func (r *InterruptEnabledRegister) Read() byte

func (*InterruptEnabledRegister) Write

func (r *InterruptEnabledRegister) Write(value byte)

type InterruptFlagsRegister

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

func (*InterruptFlagsRegister) JoypadPress

func (r *InterruptFlagsRegister) JoypadPress() bool

func (*InterruptFlagsRegister) JoypadPressInterrupt

func (r *InterruptFlagsRegister) JoypadPressInterrupt()

func (*InterruptFlagsRegister) LcdStatus

func (r *InterruptFlagsRegister) LcdStatus() bool

func (*InterruptFlagsRegister) LcdStatusInterrupt

func (r *InterruptFlagsRegister) LcdStatusInterrupt()

func (*InterruptFlagsRegister) Read

func (r *InterruptFlagsRegister) Read() byte
func (r *InterruptFlagsRegister) SerialLink() bool

func (*InterruptFlagsRegister) SerialLinkInterrupt

func (r *InterruptFlagsRegister) SerialLinkInterrupt()

func (*InterruptFlagsRegister) TimerOverflow

func (r *InterruptFlagsRegister) TimerOverflow() bool

func (*InterruptFlagsRegister) TimerOverflowInterrupt

func (r *InterruptFlagsRegister) TimerOverflowInterrupt()

func (*InterruptFlagsRegister) VBlank

func (r *InterruptFlagsRegister) VBlank() bool

func (*InterruptFlagsRegister) VBlankInterrupt

func (r *InterruptFlagsRegister) VBlankInterrupt()

func (*InterruptFlagsRegister) Write

func (r *InterruptFlagsRegister) Write(value byte)

Jump to

Keyboard shortcuts

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