Documentation
¶
Overview ¶
Package testcore is a tiny game written in Go: a square you move around a coloured field, a tone while a button is held, and a counter kept in save memory. It needs no third-party core or ROM, so the whole path from library to browser can be tested on any machine, including CI.
Index ¶
- Constants
- type Core
- func (c *Core) ApplyOptions(values map[string]string)
- func (c *Core) CheatReset()
- func (c *Core) CheatSet(index int, enabled bool, code string)
- func (c *Core) Close()
- func (c *Core) ControllerPorts() []engine.PortDevices
- func (c *Core) LoadGame(path string) (engine.AVInfo, error)
- func (c *Core) LoadState(b []byte) bool
- func (c *Core) Options() []engine.Option
- func (c *Core) Reset()
- func (c *Core) Run()
- func (c *Core) SaveRAM() []byte
- func (c *Core) SaveState() []byte
- func (c *Core) SetDevice(_ int, id uint32)
- func (c *Core) SetOption(key, value string) bool
- func (c *Core) SetOutput(video, audio, fastForward bool)
- func (c *Core) SystemInfo() engine.SystemInfo
Constants ¶
const ( Width = 256 Height = 224 Rate = 44100 FPS = 60 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// Ran counts every frame run, and Drawn those it was asked to draw.
Ran, Drawn int
// contains filtered or unexported fields
}
Core implements engine.Engine.
func (*Core) ApplyOptions ¶ added in v0.3.3
ApplyOptions sets what the runner was told at load: only what the core offers.
func (*Core) CheatReset ¶ added in v0.3.3
func (c *Core) CheatReset()
CheatReset forgets the cheats.
func (*Core) CheatSet ¶ added in v0.3.3
CheatSet takes codes of the form x=N, which hold the square at that place.
func (*Core) ControllerPorts ¶ added in v0.3.3
func (c *Core) ControllerPorts() []engine.PortDevices
ControllerPorts offers a choice of controller, as many real cores do.
func (*Core) LoadGame ¶
LoadGame reads the "ROM". Any non-empty file works: its checksum picks the colours, so two test games can be told apart.
func (*Core) Run ¶
func (c *Core) Run()
Run plays a frame. The save memory records what tests need to see arrive: bytes 0-3 count presses of Start by the first player and 4-7 by the sixth; byte 8 is the most fingers seen on the screen at once; bytes 10-11 the first player's accelerometer X, in hundredths of a metre a second squared. Select lights LED 0, and A rumbles the first player's strong motor while held.
func (*Core) SystemInfo ¶
func (c *Core) SystemInfo() engine.SystemInfo
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fakecore builds real shared libraries for tests of what happens when a core is added: one that works, and several that misbehave in the ways a hostile or broken file can.
|
Package fakecore builds real shared libraries for tests of what happens when a core is added: one that works, and several that misbehave in the ways a hostile or broken file can. |
|
cmd/fakecore
command
Command fakecore writes one of the test cores to a folder, for trying the custom core pages by hand without any third-party code:
|
Command fakecore writes one of the test cores to a folder, for trying the custom core pages by hand without any third-party code: |