rp2ago3

package module
v0.0.0-...-109f3ed Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2014 License: GPL-2.0 Imports: 3 Imported by: 1

README

rp2ago3

An RP 2A03 simulator written in Go

NOTE: This repository is no longer being updated, please see nintengo.

Documentation

Index

Constants

View Source
const NTSC_CLOCK_RATE time.Duration = 187 * time.Nanosecond // 21.477272MHz / 4 = 5.369318MHz
View Source
const NTSC_CPU_CLOCK_DIVISOR uint16 = 3
View Source
const PAL_CLOCK_RATE time.Duration = 187 * time.Nanosecond // 26.601712MHz / 5 = 5.3203424MHz
View Source
const PAL_CPU_CLOCK_DIVISOR uint16 = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type APU

type APU struct {
	Registers Registers
}

func NewAPU

func NewAPU() *APU

func (*APU) Fetch

func (apu *APU) Fetch(address uint16) (value uint8)

func (*APU) Mappings

func (apu *APU) Mappings(which Mapping) (fetch, store []uint16)

func (*APU) Reset

func (apu *APU) Reset()

func (*APU) Store

func (apu *APU) Store(address uint16, value uint8) (oldValue uint8)

type Control

type Control uint8

type DMA

type DMA struct {
	Memory m65go2.Memory
	// contains filtered or unexported fields
}

func NewDMA

func NewDMA(memory m65go2.Memory) *DMA

func (*DMA) Fetch

func (dma *DMA) Fetch(address uint16) (value uint8)

func (*DMA) Mappings

func (dma *DMA) Mappings(which Mapping) (fetch, store []uint16)

func (*DMA) PerformDMA

func (dma *DMA) PerformDMA() (cycles uint16)

func (*DMA) Reset

func (dma *DMA) Reset()

func (*DMA) Store

func (dma *DMA) Store(address uint16, value uint8) (oldValue uint8)

type DMCChannel

type DMCChannel [4]uint8

type FrameCounter

type FrameCounter uint8

type MappableMemory

type MappableMemory interface {
	m65go2.Memory
	Mappings(which Mapping) (fetch, store []uint16)
}

type MappedMemory

type MappedMemory struct {
	m65go2.Memory
	// contains filtered or unexported fields
}

func NewMappedMemory

func NewMappedMemory(base m65go2.Memory) *MappedMemory

func (*MappedMemory) AddMappings

func (mem *MappedMemory) AddMappings(mappable MappableMemory, which Mapping) (err error)

func (*MappedMemory) AddMirrors

func (mem *MappedMemory) AddMirrors(mirrors map[uint16]uint16) (err error)

func (*MappedMemory) Fetch

func (mem *MappedMemory) Fetch(address uint16) (value uint8)

func (*MappedMemory) Reset

func (mem *MappedMemory) Reset()

func (*MappedMemory) Store

func (mem *MappedMemory) Store(address uint16, value uint8) (oldValue uint8)

type Mapping

type Mapping uint8
const (
	CPU Mapping = iota
	PPU
)

type NoiseChannel

type NoiseChannel [3]uint8

type PulseChannel

type PulseChannel [4]uint8

type RP2A03

type RP2A03 struct {
	*m65go2.M6502
	*APU

	Memory *MappedMemory
	// contains filtered or unexported fields
}

func NewRP2A03

func NewRP2A03() *RP2A03

func (*RP2A03) Reset

func (cpu *RP2A03) Reset()

func (*RP2A03) Run

func (cpu *RP2A03) Run() (err error)

type Registers

type Registers struct {
	Pulse1       PulseChannel
	Pulse2       PulseChannel
	Triangle     TriangleChannel
	Noise        NoiseChannel
	Dmc          DMCChannel
	Control      Control
	Status       Status
	FrameCounter FrameCounter
}

type Status

type Status uint8

type TriangleChannel

type TriangleChannel [3]uint8

Jump to

Keyboard shortcuts

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