Documentation ¶
Overview ¶
// +build !sdl,!apudebug,!js
I think that the bridge is meant for network connections; at least that is what the "packet" and encoding indicates to me. Probably not relevant for my use case
todo: move the interface and all other nineveh files out of the nes package and into a new nineveh package
Index ¶
- Constants
- Variables
- type ANROM
- func (anrom *ANROM) Fetch(address uint16) (value uint8)
- func (anrom *ANROM) Mappings(which rp2ago3.Mapping) (fetch, store []uint16)
- func (anrom *ANROM) Reset()
- func (anrom *ANROM) Store(address uint16, value uint8) (oldValue uint8)
- func (anrom *ANROM) String() string
- func (anrom *ANROM) Tables() (t0, t1, t2, t3 int)
- type ANROMRegisters
- type Audio
- type AudioRecordEvent
- type AudioRecorder
- type AudioStopEvent
- type Azul3DVideo
- func (video *Azul3DVideo) AddImageToRecording(colors []uint8)
- func (video *Azul3DVideo) Events() chan Event
- func (video *Azul3DVideo) Input() chan []uint8
- func (video *Azul3DVideo) OutputRunRecording(outputFileName string)
- func (video *Azul3DVideo) OutputScreenImage(colors []uint8)
- func (video *Azul3DVideo) Run()
- func (video *Azul3DVideo) SetCaption(caption string)
- type Bridge
- type Button
- type CNROM
- type CNROMRegisters
- type CPUDecodeEvent
- type ControlFlag
- type Controller
- type ControllerEvent
- type Controllers
- func (ctrls *Controllers) Fetch(address uint16) (value uint8)
- func (ctrls *Controllers) KeyDown(controller int, btn Button)
- func (ctrls *Controllers) KeyIsDown(controller int, btn Button) bool
- func (ctrls *Controllers) KeyUp(controller int, btn Button)
- func (ctrls *Controllers) Mappings(which rp2ago3.Mapping) (fetch, store []uint16)
- func (ctrls *Controllers) Reset()
- func (ctrls *Controllers) Store(address uint16, value uint8) (oldValue uint8)
- func (ctrls *Controllers) ValidKeyDown(controller int, btn Button) (valid bool)
- type EmulatorInterface
- func (emulatorinterface *EmulatorInterface) Act(btn int) (reward float32)
- func (emulatorinterface *EmulatorInterface) Close()
- func (emulatorinterface *EmulatorInterface) EndRecording(outputFileName string)
- func (emulatorinterface *EmulatorInterface) IsGameOver() bool
- func (emulatorinterface *EmulatorInterface) Observe() (colors []uint8)
- func (emulatorinterface *EmulatorInterface) OpenToStart()
- func (emulatorinterface *EmulatorInterface) Reset()
- func (emulatorinterface *EmulatorInterface) Start()
- type Event
- type FPS
- type FPSEvent
- type FrameEvent
- type GIFRecorder
- type HeadlessVideo
- func (video *HeadlessVideo) AddImageToRecording(colors []uint8)
- func (video *HeadlessVideo) Events() chan Event
- func (video *HeadlessVideo) GetScreenImage(colors []uint8) (frame *image.Paletted)
- func (video *HeadlessVideo) Input() chan []uint8
- func (video *HeadlessVideo) OutputRunRecording(outputFileName string)
- func (video *HeadlessVideo) OutputScreenImage(colors []uint8)
- func (video *HeadlessVideo) Run()
- func (video *HeadlessVideo) SetCaption(caption string)
- type HeartbeatEvent
- type JPEGRecorder
- type LoadStateEvent
- type MMC1
- func (mmc1 *MMC1) Fetch(address uint16) (value uint8)
- func (mmc1 *MMC1) Mappings(which rp2ago3.Mapping) (fetch, store []uint16)
- func (mmc1 *MMC1) Reset()
- func (mmc1 *MMC1) Store(address uint16, value uint8) (oldValue uint8)
- func (mmc1 *MMC1) String() string
- func (mmc1 *MMC1) Tables() (t0, t1, t2, t3 int)
- type MMC1Mirroring
- type MMC1Registers
- type MMC2
- func (mmc2 *MMC2) Fetch(address uint16) (value uint8)
- func (mmc2 *MMC2) Mappings(which rp2ago3.Mapping) (fetch, store []uint16)
- func (mmc2 *MMC2) Reset()
- func (mmc2 *MMC2) Store(address uint16, value uint8) (oldValue uint8)
- func (mmc2 *MMC2) String() string
- func (mmc2 *MMC2) Tables() (t0, t1, t2, t3 int)
- type MMC2Registers
- type MMC3
- func (mmc3 *MMC3) Fetch(address uint16) (value uint8)
- func (mmc3 *MMC3) Mappings(which rp2ago3.Mapping) (fetch, store []uint16)
- func (mmc3 *MMC3) Reset()
- func (mmc3 *MMC3) Store(address uint16, value uint8) (oldValue uint8)
- func (mmc3 *MMC3) String() string
- func (mmc3 *MMC3) Tables() (t0, t1, t2, t3 int)
- type MMC3BankSelectFlag
- type MMC3Registers
- type MuteDMCEvent
- type MuteEvent
- type MuteNoiseEvent
- type MutePulse1Event
- type MutePulse2Event
- type MuteTriangleEvent
- type NES
- func (nes *NES) GetCastlevaniaScore() (score float32)
- func (nes *NES) GetDonkeyKongScore() (score float32)
- func (nes *NES) GetMarioBrothersScore() (score float32)
- func (nes *NES) LoadState()
- func (nes *NES) LoadStateFromReader(reader io.ReaderAt, size int64) (err error)
- func (nes *NES) Pause() RunState
- func (nes *NES) ProcessToFrame() (colors []uint8, cycleCount uint16, err error)
- func (nes *NES) Reset()
- func (nes *NES) Run() (err error)
- func (nes *NES) RunState() RunState
- func (nes *NES) SaveState()
- func (nes *NES) SaveStateToWriter(writer io.Writer) (err error)
- type NROM
- type Options
- type PPUDecodeEvent
- type PRGBankFlag
- type Packet
- type PauseEvent
- type PauseRequest
- type QuitEvent
- type ROM
- type ROMFile
- type RecordEvent
- type Recorder
- type Region
- type ResetEvent
- type RunState
- type SampleEvent
- type SavePatternTablesEvent
- type SaveStateEvent
- type ShowBackgroundEvent
- type ShowSpritesEvent
- type StopEvent
- type UNROM
- type UNROMRegisters
- type Video
- type WAVRecorder
Constants ¶
const ( EvGlobal uint = 1 << iota EvMaster EvSlave )
const ( DefaultFPSNTSC float64 = 60.0988 DefaultFPSPAL float64 = 50.0070 )
Variables ¶
var Azul3DPalette []color.RGBA = []color.RGBA{ color.RGBA{0x66, 0x66, 0x66, 0xff}, color.RGBA{0x00, 0x2A, 0x88, 0xff}, color.RGBA{0x14, 0x12, 0xA7, 0xff}, color.RGBA{0x3B, 0x00, 0xA4, 0xff}, color.RGBA{0x5C, 0x00, 0x7E, 0xff}, color.RGBA{0x6E, 0x00, 0x40, 0xff}, color.RGBA{0x6C, 0x06, 0x00, 0xff}, color.RGBA{0x56, 0x1D, 0x00, 0xff}, color.RGBA{0x33, 0x35, 0x00, 0xff}, color.RGBA{0x0B, 0x48, 0x00, 0xff}, color.RGBA{0x00, 0x52, 0x00, 0xff}, color.RGBA{0x00, 0x4F, 0x08, 0xff}, color.RGBA{0x00, 0x40, 0x4D, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xAD, 0xAD, 0xAD, 0xff}, color.RGBA{0x15, 0x5F, 0xD9, 0xff}, color.RGBA{0x42, 0x40, 0xFF, 0xff}, color.RGBA{0x75, 0x27, 0xFE, 0xff}, color.RGBA{0xA0, 0x1A, 0xCC, 0xff}, color.RGBA{0xB7, 0x1E, 0x7B, 0xff}, color.RGBA{0xB5, 0x31, 0x20, 0xff}, color.RGBA{0x99, 0x4E, 0x00, 0xff}, color.RGBA{0x6B, 0x6D, 0x00, 0xff}, color.RGBA{0x38, 0x87, 0x00, 0xff}, color.RGBA{0x0C, 0x93, 0x00, 0xff}, color.RGBA{0x00, 0x8F, 0x32, 0xff}, color.RGBA{0x00, 0x7C, 0x8D, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xFF, 0xFE, 0xFF, 0xff}, color.RGBA{0x64, 0xB0, 0xFF, 0xff}, color.RGBA{0x92, 0x90, 0xFF, 0xff}, color.RGBA{0xC6, 0x76, 0xFF, 0xff}, color.RGBA{0xF3, 0x6A, 0xFF, 0xff}, color.RGBA{0xFE, 0x6E, 0xCC, 0xff}, color.RGBA{0xFE, 0x81, 0x70, 0xff}, color.RGBA{0xEA, 0x9E, 0x22, 0xff}, color.RGBA{0xBC, 0xBE, 0x00, 0xff}, color.RGBA{0x88, 0xD8, 0x00, 0xff}, color.RGBA{0x5C, 0xE4, 0x30, 0xff}, color.RGBA{0x45, 0xE0, 0x82, 0xff}, color.RGBA{0x48, 0xCD, 0xDE, 0xff}, color.RGBA{0x4F, 0x4F, 0x4F, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xFF, 0xFE, 0xFF, 0xff}, color.RGBA{0xC0, 0xDF, 0xFF, 0xff}, color.RGBA{0xD3, 0xD2, 0xFF, 0xff}, color.RGBA{0xE8, 0xC8, 0xFF, 0xff}, color.RGBA{0xFB, 0xC2, 0xFF, 0xff}, color.RGBA{0xFE, 0xC4, 0xEA, 0xff}, color.RGBA{0xFE, 0xCC, 0xC5, 0xff}, color.RGBA{0xF7, 0xD8, 0xA5, 0xff}, color.RGBA{0xE4, 0xE5, 0x94, 0xff}, color.RGBA{0xCF, 0xEF, 0x96, 0xff}, color.RGBA{0xBD, 0xF4, 0xAB, 0xff}, color.RGBA{0xB3, 0xF3, 0xCC, 0xff}, color.RGBA{0xB5, 0xEB, 0xF2, 0xff}, color.RGBA{0xB8, 0xB8, 0xB8, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, }
var HeadlessPalette []color.Color = []color.Color{ color.RGBA{0x66, 0x66, 0x66, 0xff}, color.RGBA{0x00, 0x2A, 0x88, 0xff}, color.RGBA{0x14, 0x12, 0xA7, 0xff}, color.RGBA{0x3B, 0x00, 0xA4, 0xff}, color.RGBA{0x5C, 0x00, 0x7E, 0xff}, color.RGBA{0x6E, 0x00, 0x40, 0xff}, color.RGBA{0x6C, 0x06, 0x00, 0xff}, color.RGBA{0x56, 0x1D, 0x00, 0xff}, color.RGBA{0x33, 0x35, 0x00, 0xff}, color.RGBA{0x0B, 0x48, 0x00, 0xff}, color.RGBA{0x00, 0x52, 0x00, 0xff}, color.RGBA{0x00, 0x4F, 0x08, 0xff}, color.RGBA{0x00, 0x40, 0x4D, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xAD, 0xAD, 0xAD, 0xff}, color.RGBA{0x15, 0x5F, 0xD9, 0xff}, color.RGBA{0x42, 0x40, 0xFF, 0xff}, color.RGBA{0x75, 0x27, 0xFE, 0xff}, color.RGBA{0xA0, 0x1A, 0xCC, 0xff}, color.RGBA{0xB7, 0x1E, 0x7B, 0xff}, color.RGBA{0xB5, 0x31, 0x20, 0xff}, color.RGBA{0x99, 0x4E, 0x00, 0xff}, color.RGBA{0x6B, 0x6D, 0x00, 0xff}, color.RGBA{0x38, 0x87, 0x00, 0xff}, color.RGBA{0x0C, 0x93, 0x00, 0xff}, color.RGBA{0x00, 0x8F, 0x32, 0xff}, color.RGBA{0x00, 0x7C, 0x8D, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xFF, 0xFE, 0xFF, 0xff}, color.RGBA{0x64, 0xB0, 0xFF, 0xff}, color.RGBA{0x92, 0x90, 0xFF, 0xff}, color.RGBA{0xC6, 0x76, 0xFF, 0xff}, color.RGBA{0xF3, 0x6A, 0xFF, 0xff}, color.RGBA{0xFE, 0x6E, 0xCC, 0xff}, color.RGBA{0xFE, 0x81, 0x70, 0xff}, color.RGBA{0xEA, 0x9E, 0x22, 0xff}, color.RGBA{0xBC, 0xBE, 0x00, 0xff}, color.RGBA{0x88, 0xD8, 0x00, 0xff}, color.RGBA{0x5C, 0xE4, 0x30, 0xff}, color.RGBA{0x45, 0xE0, 0x82, 0xff}, color.RGBA{0x48, 0xCD, 0xDE, 0xff}, color.RGBA{0x4F, 0x4F, 0x4F, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xFF, 0xFE, 0xFF, 0xff}, color.RGBA{0xC0, 0xDF, 0xFF, 0xff}, color.RGBA{0xD3, 0xD2, 0xFF, 0xff}, color.RGBA{0xE8, 0xC8, 0xFF, 0xff}, color.RGBA{0xFB, 0xC2, 0xFF, 0xff}, color.RGBA{0xFE, 0xC4, 0xEA, 0xff}, color.RGBA{0xFE, 0xCC, 0xC5, 0xff}, color.RGBA{0xF7, 0xD8, 0xA5, 0xff}, color.RGBA{0xE4, 0xE5, 0x94, 0xff}, color.RGBA{0xCF, 0xEF, 0x96, 0xff}, color.RGBA{0xBD, 0xF4, 0xAB, 0xff}, color.RGBA{0xB3, 0xF3, 0xCC, 0xff}, color.RGBA{0xB5, 0xEB, 0xF2, 0xff}, color.RGBA{0xB8, 0xB8, 0xB8, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, }
var RGBAPalette []color.Color = []color.Color{ color.RGBA{0x66, 0x66, 0x66, 0xff}, color.RGBA{0x00, 0x2A, 0x88, 0xff}, color.RGBA{0x14, 0x12, 0xA7, 0xff}, color.RGBA{0x3B, 0x00, 0xA4, 0xff}, color.RGBA{0x5C, 0x00, 0x7E, 0xff}, color.RGBA{0x6E, 0x00, 0x40, 0xff}, color.RGBA{0x6C, 0x06, 0x00, 0xff}, color.RGBA{0x56, 0x1D, 0x00, 0xff}, color.RGBA{0x33, 0x35, 0x00, 0xff}, color.RGBA{0x0B, 0x48, 0x00, 0xff}, color.RGBA{0x00, 0x52, 0x00, 0xff}, color.RGBA{0x00, 0x4F, 0x08, 0xff}, color.RGBA{0x00, 0x40, 0x4D, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xAD, 0xAD, 0xAD, 0xff}, color.RGBA{0x15, 0x5F, 0xD9, 0xff}, color.RGBA{0x42, 0x40, 0xFF, 0xff}, color.RGBA{0x75, 0x27, 0xFE, 0xff}, color.RGBA{0xA0, 0x1A, 0xCC, 0xff}, color.RGBA{0xB7, 0x1E, 0x7B, 0xff}, color.RGBA{0xB5, 0x31, 0x20, 0xff}, color.RGBA{0x99, 0x4E, 0x00, 0xff}, color.RGBA{0x6B, 0x6D, 0x00, 0xff}, color.RGBA{0x38, 0x87, 0x00, 0xff}, color.RGBA{0x0C, 0x93, 0x00, 0xff}, color.RGBA{0x00, 0x8F, 0x32, 0xff}, color.RGBA{0x00, 0x7C, 0x8D, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xFF, 0xFE, 0xFF, 0xff}, color.RGBA{0x64, 0xB0, 0xFF, 0xff}, color.RGBA{0x92, 0x90, 0xFF, 0xff}, color.RGBA{0xC6, 0x76, 0xFF, 0xff}, color.RGBA{0xF3, 0x6A, 0xFF, 0xff}, color.RGBA{0xFE, 0x6E, 0xCC, 0xff}, color.RGBA{0xFE, 0x81, 0x70, 0xff}, color.RGBA{0xEA, 0x9E, 0x22, 0xff}, color.RGBA{0xBC, 0xBE, 0x00, 0xff}, color.RGBA{0x88, 0xD8, 0x00, 0xff}, color.RGBA{0x5C, 0xE4, 0x30, 0xff}, color.RGBA{0x45, 0xE0, 0x82, 0xff}, color.RGBA{0x48, 0xCD, 0xDE, 0xff}, color.RGBA{0x4F, 0x4F, 0x4F, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0xFF, 0xFE, 0xFF, 0xff}, color.RGBA{0xC0, 0xDF, 0xFF, 0xff}, color.RGBA{0xD3, 0xD2, 0xFF, 0xff}, color.RGBA{0xE8, 0xC8, 0xFF, 0xff}, color.RGBA{0xFB, 0xC2, 0xFF, 0xff}, color.RGBA{0xFE, 0xC4, 0xEA, 0xff}, color.RGBA{0xFE, 0xCC, 0xC5, 0xff}, color.RGBA{0xF7, 0xD8, 0xA5, 0xff}, color.RGBA{0xE4, 0xE5, 0x94, 0xff}, color.RGBA{0xCF, 0xEF, 0x96, 0xff}, color.RGBA{0xBD, 0xF4, 0xAB, 0xff}, color.RGBA{0xB3, 0xF3, 0xCC, 0xff}, color.RGBA{0xB5, 0xEB, 0xF2, 0xff}, color.RGBA{0xB8, 0xB8, 0xB8, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0x00, 0xff}, }
Functions ¶
This section is empty.
Types ¶
type ANROMRegisters ¶
type ANROMRegisters struct {
BankSelect uint8
}
func (*ANROMRegisters) Reset ¶
func (reg *ANROMRegisters) Reset()
type AudioRecordEvent ¶
type AudioRecordEvent struct{}
func (*AudioRecordEvent) Flag ¶
func (e *AudioRecordEvent) Flag() uint
func (*AudioRecordEvent) Process ¶
func (e *AudioRecordEvent) Process(nes *NES)
func (*AudioRecordEvent) String ¶
func (e *AudioRecordEvent) String() string
type AudioRecorder ¶
type AudioRecorder interface { Input() chan int16 Record() Stop() Quit() Run() }
type AudioStopEvent ¶
type AudioStopEvent struct{}
func (*AudioStopEvent) Flag ¶
func (e *AudioStopEvent) Flag() uint
func (*AudioStopEvent) Process ¶
func (e *AudioStopEvent) Process(nes *NES)
func (*AudioStopEvent) String ¶
func (e *AudioStopEvent) String() string
type Azul3DVideo ¶
type Azul3DVideo struct {
// contains filtered or unexported fields
}
func (*Azul3DVideo) AddImageToRecording ¶
func (video *Azul3DVideo) AddImageToRecording(colors []uint8)
func (*Azul3DVideo) Events ¶
func (video *Azul3DVideo) Events() chan Event
func (*Azul3DVideo) Input ¶
func (video *Azul3DVideo) Input() chan []uint8
func (*Azul3DVideo) OutputRunRecording ¶
func (video *Azul3DVideo) OutputRunRecording(outputFileName string)
func (*Azul3DVideo) OutputScreenImage ¶
func (video *Azul3DVideo) OutputScreenImage(colors []uint8)
Blank methods, used by the headless video, but not actually needed by the display
func (*Azul3DVideo) Run ¶
func (video *Azul3DVideo) Run()
func (*Azul3DVideo) SetCaption ¶
func (video *Azul3DVideo) SetCaption(caption string)
type CNROMRegisters ¶
type CNROMRegisters struct {
BankSelect uint8
}
func (*CNROMRegisters) Reset ¶
func (reg *CNROMRegisters) Reset()
type CPUDecodeEvent ¶
type CPUDecodeEvent struct{}
func (*CPUDecodeEvent) Flag ¶
func (e *CPUDecodeEvent) Flag() uint
func (*CPUDecodeEvent) Process ¶
func (e *CPUDecodeEvent) Process(nes *NES)
func (*CPUDecodeEvent) String ¶
func (e *CPUDecodeEvent) String() string
type ControlFlag ¶
type ControlFlag uint8
const ( Mirroring ControlFlag = 1 << iota PRGRomBankMode CHRRomBankMode )
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
type ControllerEvent ¶
func (*ControllerEvent) Flag ¶
func (e *ControllerEvent) Flag() uint
func (*ControllerEvent) Process ¶
func (e *ControllerEvent) Process(nes *NES)
func (*ControllerEvent) String ¶
func (e *ControllerEvent) String() string
type Controllers ¶
type Controllers struct {
// contains filtered or unexported fields
}
func NewControllers ¶
func NewControllers() *Controllers
func (*Controllers) Fetch ¶
func (ctrls *Controllers) Fetch(address uint16) (value uint8)
func (*Controllers) KeyDown ¶
func (ctrls *Controllers) KeyDown(controller int, btn Button)
func (*Controllers) KeyIsDown ¶
func (ctrls *Controllers) KeyIsDown(controller int, btn Button) bool
func (*Controllers) KeyUp ¶
func (ctrls *Controllers) KeyUp(controller int, btn Button)
func (*Controllers) Mappings ¶
func (ctrls *Controllers) Mappings(which rp2ago3.Mapping) (fetch, store []uint16)
func (*Controllers) Reset ¶
func (ctrls *Controllers) Reset()
func (*Controllers) Store ¶
func (ctrls *Controllers) Store(address uint16, value uint8) (oldValue uint8)
func (*Controllers) ValidKeyDown ¶
func (ctrls *Controllers) ValidKeyDown(controller int, btn Button) (valid bool)
type EmulatorInterface ¶
type EmulatorInterface struct {
// contains filtered or unexported fields
}
func NewEmulatorInterface ¶
func NewEmulatorInterface(filename string, frameSkipRate int, options *Options) (emulatorinterface *EmulatorInterface)
todo: frame skip rate as a settable value
func (*EmulatorInterface) Act ¶
func (emulatorinterface *EmulatorInterface) Act(btn int) (reward float32)
Method to input actions
func (*EmulatorInterface) Close ¶
func (emulatorinterface *EmulatorInterface) Close()
todo: determine if this is being used, delete if it is not
func (*EmulatorInterface) EndRecording ¶
func (emulatorinterface *EmulatorInterface) EndRecording(outputFileName string)
func (*EmulatorInterface) IsGameOver ¶
func (emulatorinterface *EmulatorInterface) IsGameOver() bool
func (*EmulatorInterface) Observe ¶
func (emulatorinterface *EmulatorInterface) Observe() (colors []uint8)
func (*EmulatorInterface) OpenToStart ¶
func (emulatorinterface *EmulatorInterface) OpenToStart()
Loads the starting state of the selected game
func (*EmulatorInterface) Reset ¶
func (emulatorinterface *EmulatorInterface) Reset()
todo: determine if this is being used, delete if it is not
func (*EmulatorInterface) Start ¶
func (emulatorinterface *EmulatorInterface) Start()
Runs the emulator for a human user
type FrameEvent ¶
type FrameEvent struct {
Colors []uint8
}
func (*FrameEvent) Flag ¶
func (e *FrameEvent) Flag() uint
func (*FrameEvent) Process ¶
func (e *FrameEvent) Process(nes *NES)
At this point, the "frame event" is pretty wildly mangled. Going to need to do some finagling if I want this system to be human controllable
func (*FrameEvent) String ¶
func (e *FrameEvent) String() string
type GIFRecorder ¶
type GIFRecorder struct {
// contains filtered or unexported fields
}
func NewGIFRecorder ¶
func NewGIFRecorder() (video *GIFRecorder, err error)
func (*GIFRecorder) Input ¶
func (video *GIFRecorder) Input() chan []uint8
func (*GIFRecorder) Quit ¶
func (video *GIFRecorder) Quit()
func (*GIFRecorder) Record ¶
func (video *GIFRecorder) Record()
func (*GIFRecorder) Run ¶
func (video *GIFRecorder) Run()
func (*GIFRecorder) Stop ¶
func (video *GIFRecorder) Stop()
type HeadlessVideo ¶
type HeadlessVideo struct {
// contains filtered or unexported fields
}
func NewHeadlessVideo ¶
func (*HeadlessVideo) AddImageToRecording ¶
func (video *HeadlessVideo) AddImageToRecording(colors []uint8)
func (*HeadlessVideo) Events ¶
func (video *HeadlessVideo) Events() chan Event
func (*HeadlessVideo) GetScreenImage ¶
func (video *HeadlessVideo) GetScreenImage(colors []uint8) (frame *image.Paletted)
func (*HeadlessVideo) Input ¶
func (video *HeadlessVideo) Input() chan []uint8
func (*HeadlessVideo) OutputRunRecording ¶
func (video *HeadlessVideo) OutputRunRecording(outputFileName string)
func (*HeadlessVideo) OutputScreenImage ¶
func (video *HeadlessVideo) OutputScreenImage(colors []uint8)
func (*HeadlessVideo) Run ¶
func (video *HeadlessVideo) Run()
func (*HeadlessVideo) SetCaption ¶
func (video *HeadlessVideo) SetCaption(caption string)
type HeartbeatEvent ¶
type HeartbeatEvent struct{}
func (*HeartbeatEvent) Flag ¶
func (e *HeartbeatEvent) Flag() uint
func (*HeartbeatEvent) Process ¶
func (e *HeartbeatEvent) Process(nes *NES)
func (*HeartbeatEvent) String ¶
func (e *HeartbeatEvent) String() string
type JPEGRecorder ¶
type JPEGRecorder struct {
// contains filtered or unexported fields
}
func NewJPEGRecorder ¶
func NewJPEGRecorder() (video *JPEGRecorder, err error)
func (*JPEGRecorder) Input ¶
func (video *JPEGRecorder) Input() chan []uint8
func (*JPEGRecorder) Quit ¶
func (video *JPEGRecorder) Quit()
func (*JPEGRecorder) Record ¶
func (video *JPEGRecorder) Record()
func (*JPEGRecorder) Run ¶
func (video *JPEGRecorder) Run()
func (*JPEGRecorder) Stop ¶
func (video *JPEGRecorder) Stop()
type LoadStateEvent ¶
type LoadStateEvent struct {
Data []byte
}
func (*LoadStateEvent) Flag ¶
func (e *LoadStateEvent) Flag() uint
func (*LoadStateEvent) Process ¶
func (e *LoadStateEvent) Process(nes *NES)
func (*LoadStateEvent) String ¶
func (e *LoadStateEvent) String() string
type MMC1 ¶
type MMC1 struct { *ROMFile Registers MMC1Registers }
type MMC1Mirroring ¶
type MMC1Mirroring uint8
const ( OneScreenLowerBank MMC1Mirroring = iota OneScreenUpperBank Vertical Horizontal )
type MMC1Registers ¶
type MMC1Registers struct { Load uint8 Control uint8 CHRBank0 uint8 CHRBank1 uint8 PRGBank uint8 Shift uint8 ShiftCount uint8 }
func (*MMC1Registers) Reset ¶
func (reg *MMC1Registers) Reset()
type MMC2 ¶
type MMC2 struct { *ROMFile Registers MMC2Registers }
type MMC2Registers ¶
type MMC2Registers struct { PRGBank uint8 CHRBank0 uint8 CHRBank1 uint8 CHRBank2 uint8 CHRBank3 uint8 Mirroring uint8 Latch0 uint8 Latch1 uint8 }
func (*MMC2Registers) Reset ¶
func (reg *MMC2Registers) Reset()
type MMC3 ¶
type MMC3 struct { *ROMFile Registers MMC3Registers }
type MMC3BankSelectFlag ¶
type MMC3BankSelectFlag uint8
const ( BankRegister MMC3BankSelectFlag = 1 << iota PRGROMBankMode CHRA12Inversion )
type MMC3Registers ¶
type MMC3Registers struct { BankSelect uint8 BankData uint8 Mirroring uint8 PRGRAMProtect uint8 IRQLatch uint8 IRQReload bool IRQEnable bool IRQCounter uint8 CHRBank1 uint8 CHRBank2 uint8 CHRBank3 uint8 CHRBank4 uint8 CHRBank5 uint8 CHRBank6 uint8 PRGBankLow uint8 PRGBankHigh uint8 }
func (*MMC3Registers) Reset ¶
func (reg *MMC3Registers) Reset()
type MuteDMCEvent ¶
type MuteDMCEvent struct{}
func (*MuteDMCEvent) Flag ¶
func (e *MuteDMCEvent) Flag() uint
func (*MuteDMCEvent) Process ¶
func (e *MuteDMCEvent) Process(nes *NES)
func (*MuteDMCEvent) String ¶
func (e *MuteDMCEvent) String() string
type MuteNoiseEvent ¶
type MuteNoiseEvent struct{}
func (*MuteNoiseEvent) Flag ¶
func (e *MuteNoiseEvent) Flag() uint
func (*MuteNoiseEvent) Process ¶
func (e *MuteNoiseEvent) Process(nes *NES)
func (*MuteNoiseEvent) String ¶
func (e *MuteNoiseEvent) String() string
type MutePulse1Event ¶
type MutePulse1Event struct{}
func (*MutePulse1Event) Flag ¶
func (e *MutePulse1Event) Flag() uint
func (*MutePulse1Event) Process ¶
func (e *MutePulse1Event) Process(nes *NES)
func (*MutePulse1Event) String ¶
func (e *MutePulse1Event) String() string
type MutePulse2Event ¶
type MutePulse2Event struct{}
func (*MutePulse2Event) Flag ¶
func (e *MutePulse2Event) Flag() uint
func (*MutePulse2Event) Process ¶
func (e *MutePulse2Event) Process(nes *NES)
func (*MutePulse2Event) String ¶
func (e *MutePulse2Event) String() string
type MuteTriangleEvent ¶
type MuteTriangleEvent struct{}
func (*MuteTriangleEvent) Flag ¶
func (e *MuteTriangleEvent) Flag() uint
func (*MuteTriangleEvent) Process ¶
func (e *MuteTriangleEvent) Process(nes *NES)
func (*MuteTriangleEvent) String ¶
func (e *MuteTriangleEvent) String() string
type NES ¶
type NES struct { GameName string Paused bool CPU *rp2ago3.RP2A03 CPUDivisor float32 PPU *rp2cgo2.RP2C02 PPUQuota float32 ROM ROM DefaultFPS float64 Tick uint64 // contains filtered or unexported fields }
func NewNESFromReader ¶
func (*NES) GetCastlevaniaScore ¶
functions for Castlevania
func (*NES) GetDonkeyKongScore ¶
func (*NES) GetMarioBrothersScore ¶
Worth noting that the formula for score recovery is close to identical in both Mario Brothers and Castlevania
func (*NES) LoadState ¶
func (nes *NES) LoadState()
todo: create variant of method which enables opening of specific files
func (*NES) LoadStateFromReader ¶
func (*NES) ProcessToFrame ¶
todo: cyclecount return is for debugging and should be removed
type PPUDecodeEvent ¶
type PPUDecodeEvent struct{}
func (*PPUDecodeEvent) Flag ¶
func (e *PPUDecodeEvent) Flag() uint
func (*PPUDecodeEvent) Process ¶
func (e *PPUDecodeEvent) Process(nes *NES)
func (*PPUDecodeEvent) String ¶
func (e *PPUDecodeEvent) String() string
type PRGBankFlag ¶
type PRGBankFlag uint8
const ( PRGBankSelect PRGBankFlag = 1 << iota PRGRAMChipEnable )
type PauseEvent ¶
type PauseEvent struct { Request PauseRequest Changed chan bool }
func (*PauseEvent) Flag ¶
func (e *PauseEvent) Flag() uint
func (*PauseEvent) Process ¶
func (e *PauseEvent) Process(nes *NES)
func (*PauseEvent) String ¶
func (e *PauseEvent) String() string
type ROM ¶
type ROM interface { rp2ago3.MappableMemory Region() Region String() string GameName() string LoadBattery() SaveBattery() (err error) GetROMFile() *ROMFile }
type ROMFile ¶
type ROMFile struct { Gamename string PRGBanks uint16 CHRBanks uint16 Mirroring rp2cgo2.Mirroring Battery bool Trainer bool FourScreen bool VSCart bool Mapper uint8 RAMBanks uint8 RegionFlag Region TrainerData []uint8 WRAMBanks [][]uint8 ROMBanks [][]uint8 VROMBanks [][]uint8 // contains filtered or unexported fields }
func NewROMFile ¶
func (*ROMFile) GetROMFile ¶
func (*ROMFile) LoadBattery ¶
func (romf *ROMFile) LoadBattery()
func (*ROMFile) SaveBattery ¶
type RecordEvent ¶
type RecordEvent struct{}
func (*RecordEvent) Flag ¶
func (e *RecordEvent) Flag() uint
func (*RecordEvent) Process ¶
func (e *RecordEvent) Process(nes *NES)
func (*RecordEvent) String ¶
func (e *RecordEvent) String() string
type ResetEvent ¶
type ResetEvent struct{}
func (*ResetEvent) Flag ¶
func (e *ResetEvent) Flag() uint
func (*ResetEvent) Process ¶
func (e *ResetEvent) Process(nes *NES)
func (*ResetEvent) String ¶
func (e *ResetEvent) String() string
type SampleEvent ¶
type SampleEvent struct {
Sample int16
}
func (*SampleEvent) Flag ¶
func (e *SampleEvent) Flag() uint
func (*SampleEvent) Process ¶
func (e *SampleEvent) Process(nes *NES)
func (*SampleEvent) String ¶
func (e *SampleEvent) String() string
type SavePatternTablesEvent ¶
type SavePatternTablesEvent struct{}
func (*SavePatternTablesEvent) Flag ¶
func (e *SavePatternTablesEvent) Flag() uint
func (*SavePatternTablesEvent) Process ¶
func (e *SavePatternTablesEvent) Process(nes *NES)
func (*SavePatternTablesEvent) String ¶
func (e *SavePatternTablesEvent) String() string
type SaveStateEvent ¶
type SaveStateEvent struct{}
func (*SaveStateEvent) Flag ¶
func (e *SaveStateEvent) Flag() uint
func (*SaveStateEvent) Process ¶
func (e *SaveStateEvent) Process(nes *NES)
func (*SaveStateEvent) String ¶
func (e *SaveStateEvent) String() string
type ShowBackgroundEvent ¶
type ShowBackgroundEvent struct{}
func (*ShowBackgroundEvent) Flag ¶
func (e *ShowBackgroundEvent) Flag() uint
func (*ShowBackgroundEvent) Process ¶
func (e *ShowBackgroundEvent) Process(nes *NES)
func (*ShowBackgroundEvent) String ¶
func (e *ShowBackgroundEvent) String() string
type ShowSpritesEvent ¶
type ShowSpritesEvent struct{}
func (*ShowSpritesEvent) Flag ¶
func (e *ShowSpritesEvent) Flag() uint
func (*ShowSpritesEvent) Process ¶
func (e *ShowSpritesEvent) Process(nes *NES)
func (*ShowSpritesEvent) String ¶
func (e *ShowSpritesEvent) String() string
type UNROMRegisters ¶
type UNROMRegisters struct {
BankSelect uint8
}
func (*UNROMRegisters) Reset ¶
func (reg *UNROMRegisters) Reset()
type WAVRecorder ¶
type WAVRecorder struct {
// contains filtered or unexported fields
}
func NewWAVRecorder ¶
func NewWAVRecorder() (wr *WAVRecorder, err error)
func (*WAVRecorder) Input ¶
func (wr *WAVRecorder) Input() chan int16
func (*WAVRecorder) Quit ¶
func (wr *WAVRecorder) Quit()
func (*WAVRecorder) Record ¶
func (wr *WAVRecorder) Record()
func (*WAVRecorder) Run ¶
func (wr *WAVRecorder) Run()
func (*WAVRecorder) Stop ¶
func (wr *WAVRecorder) Stop()