memory

package
Version: v0.0.0-...-7cd2a6a Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Capacity the size of memory that a 6502 cpu can address
	Capacity = 65536

	// CpuMemoryCapacity is the size of memory that a NES CPU can address
	CpuMemoryCapacity = 2048
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CpuMemory

type CpuMemory [CpuMemoryCapacity]byte

func NewCpuMemory

func NewCpuMemory() *CpuMemory

func (*CpuMemory) Read

func (m *CpuMemory) Read(addr uint16) (value uint8)

func (*CpuMemory) Reset

func (m *CpuMemory) Reset()

func (*CpuMemory) Write

func (m *CpuMemory) Write(addr uint16, value uint8) (oldValue uint8)

type Memory

type Memory interface {
	Reset()
	Read(addr uint16) (value uint8)
	Write(addr uint16, value uint8) (oldValue uint8)
}

Memory interface definition

type PlainMemory

type PlainMemory [Capacity]uint8

PlainMemory 64KB of plain bytes

func NewPlainMemory

func NewPlainMemory() *PlainMemory

NewPlainMemory create and returns a plain memory reference

func (*PlainMemory) Read

func (m *PlainMemory) Read(addr uint16) (value uint8)

func (*PlainMemory) Reset

func (m *PlainMemory) Reset()

func (*PlainMemory) Write

func (m *PlainMemory) Write(addr uint16, value uint8) (oldValue uint8)

Source Files

Jump to

Keyboard shortcuts

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