This implements "xsystem35.palette" custom request and
"xsystem35.paletteChanged" custom event.
The "xsystem35.palette" request retrieves the color values of the AGS
palette.
interface PaletteRequest extends Request {
command: 'xsystem35.palette';
}
interface PaletteResponse extends Response {
body: {
/**
* A number that increases each time the palette changes.
*/
version: number;
/**
* 256 element array containing color values in 0xRRGGBB format.
*/
palette: number[];
};
}
The "xsystem35.paletteChanged" event indicates that the AGS palette has
changed.
interface PaletteChangedEvent extends Event {
event: 'xsystem35.paletteChanged';
body: {
/**
* A number that increases each time the palette changes.
*/
version: number;
};
}
DAP clients can know if the received value is up to date by comparing
the `version` values of paletteChanged and PaletteResponse.
So that you can move around the window while the game is paused.
Now DAP messages read from stdin are once posted to the SDL message
queue, and then inserted into the debugger command queue in the main
thread.
If -debug_dap flag is given, xsystem35 speaks the Debug Adapter Protocol
(https://microsoft.github.io/debug-adapter-protocol/) via stdin/stdout.
This enables xsystem35 to work as a backend of VS Code's Debugger (and
possibly other debuggers that support DAP).
If -debug option is specified, xsystem35 enables built-in debugger. It
optionally loads debug information from *SA.ALD.symbols file (generated
by xsys35c), and drops into a debugger REPL.
Currently the debugger supports:
- Simple breakpoints
- Backtrace
- Single-step execution (step into / step over)
- Printing variables
Also, when the debugger is enabled SIGINT breaks execution and enters a
REPL.