Add the compile-time SDL major version option and propagate it through
interface targets. Route SDL includes through C99 compatibility headers
while keeping SDL2 as the desktop and Emscripten default.
Define a dedicated `vmvar_t` type for values stored in variable pages
and propagate it through interfaces that expose those values. Keep the
type as int for now so this commit does not change runtime behavior.
This separates VM storage from ordinary int buffers and makes a later
conversion to 16-bit storage mechanically checkable.
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.
Surprisingly, 0 is a valid index of the string variables (used only in
Ouji-sama Lv1 as far as I know).
The original System 3.x saves str[0] in save files, but we continue to
save from str[1] for save data compatibility.
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).