Documentation ¶
Index ¶
- Constants
- Variables
- type APU
- func (apu *APU) ClockEnvelopes()
- func (apu *APU) ClockLengthCounters()
- func (apu *APU) ClockSweepUnits()
- func (apu *APU) Execute() (sample int16, haveSample bool)
- func (apu *APU) ExecuteFrameCounter()
- func (apu *APU) Fetch(address uint16) (value uint8)
- func (apu *APU) FetchUpdatedStatus() (value uint8)
- func (apu *APU) Mappings(which Mapping) (fetch, store []uint16)
- func (apu *APU) Reset()
- func (apu *APU) Sample() (sample int16)
- func (apu *APU) Store(address uint16, value uint8) (oldValue uint8)
- type Control
- type ControlFlag
- type DMA
- type DMC
- type DMCFlag
- type Divider
- type Envelope
- type FrameCounter
- type FrameCounterFlag
- type LinearCounter
- type MappableMemory
- type MappedMemory
- func (mem *MappedMemory) AddMappings(mappable MappableMemory, which Mapping) (err error)
- func (mem *MappedMemory) AddMirrors(mirrors map[uint32]uint32) (err error)
- func (mem *MappedMemory) Fetch(address uint16) (value uint8)
- func (mem *MappedMemory) Reset()
- func (mem *MappedMemory) Store(address uint16, value uint8) (oldValue uint8)
- type Mapping
- type Noise
- type NoiseFlag
- type Pulse
- func (pulse *Pulse) ClockDivider()
- func (pulse *Pulse) ClockEnvelope()
- func (pulse *Pulse) ClockLengthCounter()
- func (pulse *Pulse) ClockSequencer()
- func (pulse *Pulse) ClockSweepUnit()
- func (pulse *Pulse) Reset()
- func (pulse *Pulse) Sample() (sample int16)
- func (pulse *Pulse) SetEnabled(enabled bool)
- func (pulse *Pulse) Store(index uint16, value uint8) (oldValue uint8)
- func (pulse *Pulse) TargetPeriod() (target int16)
- type PulseFlag
- type RP2A03
- type Registers
- type Sequencer
- type Status
- type StatusFlag
- type SweepUnit
- type Triangle
- func (triangle *Triangle) ClockDivider()
- func (triangle *Triangle) ClockLengthCounter()
- func (triangle *Triangle) ClockLinearCounter()
- func (triangle *Triangle) ClockSequencer()
- func (triangle *Triangle) Reset()
- func (triangle *Triangle) Sample() (sample int16)
- func (triangle *Triangle) SetEnabled(enabled bool)
- func (triangle *Triangle) Store(index uint16, value uint8) (oldValue uint8)
- type TriangleFlag
Constants ¶
View Source
const ( LengthCounterHaltLinearCounterControl = 1 << iota LinearCounterLoad TriangleTimerLow TriangleLengthCounterLoad TriangleTimerHigh )
View Source
const NTSCCPUClockDivisor float32 = 3
View Source
const NoPending uint32 = 0xffffffff
View Source
const PALCPUClockDivisor float32 = 3.2
View Source
const (
UNMIRRORED uint32 = 0x10000
)
Variables ¶
View Source
var LengthCounterLUT [32]uint8 = [32]uint8{
0x0a, 0xfe, 0x14, 0x02,
0x28, 0x04, 0x50, 0x06,
0xa0, 0x08, 0x3c, 0x0a,
0x0e, 0x0c, 0x1a, 0x0e,
0x0c, 0x10, 0x18, 0x12,
0x30, 0x14, 0x60, 0x16,
0xc0, 0x18, 0x48, 0x1a,
0x10, 0x1c, 0x20, 0x1e,
}
Functions ¶
This section is empty.
Types ¶
type APU ¶
type APU struct { Muted bool `json:"-"` Registers Registers `json:"APURegisters"` Pulse1 Pulse Pulse2 Pulse Triangle Triangle Noise Noise DMC DMC FrameCounter FrameCounter Cycles uint64 TargetCycles uint64 StallCycles uint16 HipassStrong int64 HipassWeak int64 Interrupt func(state bool) `json:"-"` // contains filtered or unexported fields }
func (*APU) ClockEnvelopes ¶
func (apu *APU) ClockEnvelopes()
func (*APU) ClockLengthCounters ¶
func (apu *APU) ClockLengthCounters()
func (*APU) ClockSweepUnits ¶
func (apu *APU) ClockSweepUnits()
func (*APU) ExecuteFrameCounter ¶
func (apu *APU) ExecuteFrameCounter()
func (*APU) FetchUpdatedStatus ¶
type ControlFlag ¶
type ControlFlag uint8
const ( EnablePulseChannel1 ControlFlag = 1 << iota EnablePulseChannel2 EnableTriangle EnableNoise EnableDMC )
type DMA ¶
func (*DMA) PerformDMA ¶
type DMC ¶
type DMC struct { Muted bool `json:"-"` Enabled bool Registers [4]uint8 Interrupt func(state bool) `json:"-"` Memory m65go2.Memory `json:"-"` Address uint16 LengthCounter uint16 Buffer uint8 BufferEmpty bool Silence bool Divider Divider BitsRemaining uint8 Shift uint8 Output uint8 PeriodLUT [16]int16 `json:"-"` }
func (*DMC) ClockDivider ¶
func (*DMC) SetEnabled ¶
type FrameCounter ¶
func (*FrameCounter) Clock ¶
func (frameCounter *FrameCounter) Clock() (changed bool, newStep uint8)
func (*FrameCounter) Reset ¶
func (frameCounter *FrameCounter) Reset()
type FrameCounterFlag ¶
type FrameCounterFlag uint8
const ( IRQInhibit FrameCounterFlag = 1 << iota Mode )
type LinearCounter ¶
func (*LinearCounter) Clock ¶
func (linearCounter *LinearCounter) Clock() (counter uint8)
func (*LinearCounter) Reset ¶
func (linearCounter *LinearCounter) Reset()
type MappableMemory ¶
type MappedMemory ¶
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[uint32]uint32) (err error)
func (*MappedMemory) Fetch ¶
func (mem *MappedMemory) Fetch(address uint16) (value uint8)
func (*MappedMemory) Reset ¶
func (mem *MappedMemory) Reset()
type Noise ¶
type Noise struct { Muted bool `json:"-"` Enabled bool Registers [3]uint8 Envelope Envelope Divider Divider Shift uint16 LengthCounter uint8 LengthCounterLUT [32]uint8 `json:"-"` PeriodLUT [16]int16 `json:"-"` }
func (*Noise) ClockDivider ¶
func (noise *Noise) ClockDivider()
func (*Noise) ClockEnvelope ¶
func (noise *Noise) ClockEnvelope()
func (*Noise) ClockLengthCounter ¶
func (noise *Noise) ClockLengthCounter()
func (*Noise) SetEnabled ¶
type Pulse ¶
type Pulse struct { Muted bool `json:"-"` Enabled bool MinusOne bool Registers [4]uint8 Envelope Envelope SweepUnit SweepUnit Divider Divider Sequencer Sequencer SequencerLUT [8][]uint8 `json:"-"` LengthCounter uint8 LengthCounterLUT [32]uint8 `json:"-"` }
func (*Pulse) ClockDivider ¶
func (pulse *Pulse) ClockDivider()
func (*Pulse) ClockEnvelope ¶
func (pulse *Pulse) ClockEnvelope()
func (*Pulse) ClockLengthCounter ¶
func (pulse *Pulse) ClockLengthCounter()
func (*Pulse) ClockSequencer ¶
func (pulse *Pulse) ClockSequencer()
func (*Pulse) ClockSweepUnit ¶
func (pulse *Pulse) ClockSweepUnit()
func (*Pulse) SetEnabled ¶
func (*Pulse) TargetPeriod ¶
type RP2A03 ¶
type RP2A03 struct { *m65go2.M6502 *APU DMA *DMA Memory *MappedMemory `json:"RP2A03Memory"` }
type StatusFlag ¶
type StatusFlag uint8
const ( Pulse1LengthCounterNotZero StatusFlag = 1 << iota Pulse2LengthCounterNotZero TriangleLengthCounterNotZero NoiseLengthCounterNotZero DMCActive FrameInterrupt DMCInterrupt )
type Triangle ¶
type Triangle struct { Muted bool `json:"-"` Enabled bool Registers [3]uint8 Divider Divider LinearCounter LinearCounter Sequencer Sequencer LengthCounter uint8 LengthCounterLUT [32]uint8 `json:"-"` }
func (*Triangle) ClockDivider ¶
func (triangle *Triangle) ClockDivider()
func (*Triangle) ClockLengthCounter ¶
func (triangle *Triangle) ClockLengthCounter()
func (*Triangle) ClockLinearCounter ¶
func (triangle *Triangle) ClockLinearCounter()
func (*Triangle) ClockSequencer ¶
func (triangle *Triangle) ClockSequencer()
func (*Triangle) SetEnabled ¶
type TriangleFlag ¶
type TriangleFlag uint32
Click to show internal directories.
Click to hide internal directories.