Documentation
¶
Index ¶
- func Close()
- func DetectRegionFromPath(path string) int
- func ExtractAndStoreROM(srcPath, destDir string) (string, error)
- func FrameHeight() int
- func FrameStride() int
- func FrameWidth() int
- func GetAudioData() []byte
- func GetCRC32FromPath(path string) int64
- func GetFPS() int
- func GetFrameData() []byte
- func HasSRAM() bool
- func HasSaveStates() bool
- func Init(path string, regionCode int) bool
- func LoadSRAM(data []byte)
- func LoadState(data []byte) bool
- func PrepareSRAM()
- func Region() int
- func RegisterFactory(f coreif.CoreFactory)
- func RunFrame()
- func SRAMByte(i int) int
- func SRAMLen() int
- func SaveState() bool
- func SetInput(player int, buttons int)
- func SetOption(key string, value string)
- func Start()
- func StateByte(i int) int
- func StateLen() int
- func SystemInfoJSON() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectRegionFromPath ¶
DetectRegionFromPath detects the region for a ROM file (0=NTSC, 1=PAL). Creates a temporary emulator to read timing, then discards it.
func ExtractAndStoreROM ¶
ExtractAndStoreROM extracts a ROM from an archive, calculates its CRC32, and stores it as {CRC32}.{first extension} in destDir. Returns JSON with "crc" (hex string) and "name" (ROM filename without extension).
func FrameStride ¶
func FrameStride() int
FrameStride returns the framebuffer stride in bytes per row.
func GetAudioData ¶
func GetAudioData() []byte
GetAudioData returns audio as int16 stereo PCM little-endian bytes.
func GetCRC32FromPath ¶
GetCRC32FromPath calculates the CRC32 checksum of a ROM file. Returns -1 on error.
func GetFPS ¶
func GetFPS() int
GetFPS returns the frames per second for the current emulator state.
func GetFrameData ¶
func GetFrameData() []byte
GetFrameData returns the frame buffer for the active display area.
func HasSRAM ¶
func HasSRAM() bool
HasSRAM returns whether the current ROM uses battery-backed save.
func HasSaveStates ¶
func HasSaveStates() bool
HasSaveStates returns whether the emulator supports save states.
func Init ¶
Init creates an emulator from a ROM file path. regionCode is ignored; video standard is handled internally by each core. Returns true on success.
func Region ¶
func Region() int
Region returns the current region (0=NTSC, 1=PAL). Derived from FPS: <= 50 = PAL, else NTSC.
func RegisterFactory ¶
func RegisterFactory(f coreif.CoreFactory)
RegisterFactory sets the CoreFactory. Called by core's init().
func Start ¶ added in v0.3.0
func Start()
Start finalizes emulator state after all options are applied. Must be called after SetOption and before the first RunFrame.
func SystemInfoJSON ¶
func SystemInfoJSON() string
SystemInfoJSON returns the system info as a JSON string. CoreOptionCategory values are serialized as display strings.
Types ¶
This section is empty.