Documentation ¶
Overview ¶
Package macro implements an input system that processes instructions from a macro script.
The first line of the macro must be the string "gopher2600macro".
The macro language is very simple and does not implement any flow control except basic loops.
DO loopCt [loopName] ... LOOP
The 'loopName' parameter is optional. When a loop is named the current counter value can be referenced as a variable in some contexts (currently, this is the SCREENSHOT instruction only).
Loops can be nested.
The WAIT instruction will pause the execution of the macro for the specified number of frames. If no value is given for this the number of frames defaults to 60.
There are instructions that give basic control over the emulation (only left player joystick control and some panel operaitons).
LEFT, RIGHT, UP, DOWN, CENTRE, FIRE, NOFIRE, SELECT, RESET
There is also an instruction to initiate a screenshot. The macro system is therefore useful to automate the collation of screenshots in a repeatable manner.
SCREENSHOT [filename suffix]
The filename suffix parameter is optional. Without it the screenshot will be given the default but unique filename.
If the filename suffix parameter is given then the name of the screenshot will be the name of the cartridge plus the suffix. Spaces will be replaced with underscores.
In the context of the screenshot instruction, variables can referenced with the % symbol. For example, if a loop has been given the name "ct", then the following screenshot command could be written:
SCREENSHOT %ct
Any errors in a macro script will result in a log entry and the termination of the macro execution.
Lines can be commented by prefixing the line with two dashes (--). Leading and trailing white space is ignored.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GUI ¶
type GUI interface {
SetFeature(request gui.FeatureReq, args ...gui.FeatureReqData) error
}
type Input ¶
type Input interface {
PushEvent(ports.InputEvent) error
}
type Macro ¶
type Macro struct {
// contains filtered or unexported fields
}
Macro is a type that allows control of an emulation from a series of instructions
func (*Macro) NewFrame ¶
func (mcr *Macro) NewFrame(frameInfo television.FrameInfo) error
NewFrame implements the television.FrameTrigger interface
type TV ¶
type TV interface { AddFrameTrigger(f television.FrameTrigger) GetFrameInfo() television.FrameInfo }