The -ib file option takes a script file which is a series of commands, one per line. Here are the two poke commands in a file:
poke 3c00 45
poke 3fff 5b
If the file starts with #! then it will be recognized as a script and its commands will run if passed directly on the command line or dragged and dropped onto the main window.
On Linux and MacOS trs80gp can be used as a script processor using the usual #! (hash bang) file start. For example, if trs80gp is in /user/george/trs80gp then this script will launch it emulating the Color Computer and have the software keyboard and debugger start up.
#!/user/george/trs80gp -mc
postmsg debug
postmsg soft_keyboard
Unix only allows a single command line argument which we use up specifying
the model to emulate. A mechanism to provide more command line arguments
in this case is planned.
Generally speaking commands will alter the state of the emulator machine or the emulator itself. Here is a list of all the commands for reference each linked to their full description.
Changes the input mode for automated input.
Sends its arguments as automated input to the emulator (just like -i does on the command line). A single space is sent between each argument.
Waits for N frames to pass by before continuing. A frame is usually 1/60th of a second but varies depening on which emulator is running. Just like the -id command line option.
Load one or more program files into the emulator. This is essentially identical to the File → Load... menu.
Set one or more memory locations to the given values. If address-set can be a single memory location values are put there and in following addresses until they are used up. If it is a range then the values are repeated until the entire range is filled. If there are no values then the entire range is filled with zeros. The address-set can be multiple comma-separated ranges. Values may be hexadecimal or symbol names. By default data is put into the memory space view of the main processor. The optional argument can select different memory spaces like -ram for the main random access memory or -vram for the display.
poke 3c00 21 will put a ! in the top left of the Model 1
or 3 screen.
poke 3c00:3fff 21 will fill the screen with !.
poke -vram 0:200 41 will fill the top half of the screen with A
The same as the poke command except that two byte word values are poked into memory. These values will be poked with the correct endian for the CPU the TRS-80 uses. Little endian for Z-80, Z-180 and 8080, Big endian for 6800, 6803, 6809 and 68000.
The same as the poke command except that the strings are poked into memory. The strings can have escape codes such as \xFF.
poke -vram 0:3ff Hey!
fills the screen with Hey!
As with poke but the contents of one or more files are put into memory. The files are loaded as raw data unlike the load command which interprets /CMD files and other binary executable formats.
Sends a message to the user interface. Messages have various effects, usually popping up a dialog box or choosing a setting.
Ultimately this command should be replaced with sets of better controlled commands to trigger the various UI elements and settings. But it is too irresistable as it is easy to implement and powerful.
A full reference needs to be written up but some of the more useful ones are:
Load and run one or more program files on the emulator. This is essentially identical to the File → Run... menu.