This breaks save file compatibility for Daiakuji and Kaeru nyo Kuni nyo
Alice.
Due to an incorrect encryption code in ShArray.ChangeSecretArray, save
files were not interoperable with system3.9. (Even worse, this bug did
not affect the checksum calculation and did not cause a "corrupt save
file" error when a file saved with system3.9 was loaded with xsystem35
or vice versa.)
Fixes#41.
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.
In TT2, keyboard/gamepad navigation is implemented by moving the mouse
cursor using IZ command. It did not work in browsers where mouse cursor
could not be moved or when mouse movement was disabled from the menu.
Now IZ command updates the internal mouse coordinates even when the
cursor cannot be moved.
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.
System3.x uses the following bit expansion when converting RGB565 to
RGB888:
RRRRR GGGGGG BBBBB => RRRRRRRR GGGGGGGG BBBBBBBB
12345 123456 12345 12345123 12345612 12345123
However, SDL's blit functions use a slightly different mapping, so
sometimes expanded color did not match the color key specified in the CX
command.
To avoid this, convert to RGB888 by ourselves when drawing 16-bit CGs.
Now we use the same stack structure as System3.9. In order to maintain
the compatibility of save files, it is converted to/from the old layout
when saving/loading.
These commands accept 0-127 as valid window numbers, which were 1-128
before this change.
To maintain savedata compatibility, window positions are saved in the
order 1,...,127,0.
The length limit of string variables was removed a long time ago, but it
was recorded in save files.
Now the first argument of MZ0 is completely ignored (as in System3.9).
The maxlen field in the save file is set to a constant so that older
versions of xsystem35 can load it.