Add support for pgchip's magic number and ice block encoding

This commit is contained in:
Eevee (Evelyn Woods) 2021-01-01 17:11:11 -07:00
parent 0d35274d6a
commit aac1e09c72
2 changed files with 13 additions and 2 deletions

View File

@ -63,7 +63,7 @@ const TILE_ENCODING = {
0x35: 'bogus_player_burned', 0x35: 'bogus_player_burned',
0x36: 'wall_invisible', // unused 0x36: 'wall_invisible', // unused
0x37: 'wall_invisible', // unused 0x37: 'wall_invisible', // unused
0x38: 'wall_invisible', // unused 0x38: 'ice_block', // unused, but co-opted by pgchip
0x39: 'bogus_player_win', 0x39: 'bogus_player_win',
0x3a: 'bogus_player_win', 0x3a: 'bogus_player_win',
0x3b: 'bogus_player_win', 0x3b: 'bogus_player_win',
@ -352,6 +352,10 @@ export function parse_game(buf) {
// OK // OK
// TODO tile world convention, use lynx rules // TODO tile world convention, use lynx rules
} }
else if (magic === 0x0003aaac) {
// OK
// TODO add in ice block i guess???
}
else { else {
throw new Error(`Unrecognized magic number ${magic.toString(16)}`); throw new Error(`Unrecognized magic number ${magic.toString(16)}`);
} }

View File

@ -3137,7 +3137,14 @@ class Conductor {
stored_game = c2g.wrap_individual_level(buf); stored_game = c2g.wrap_individual_level(buf);
identifier = null; identifier = null;
} }
else if (magic === '\xac\xaa\x02\x00' || magic == '\xac\xaa\x02\x01') { else if (
// standard mscc DAT
magic === '\xac\xaa\x02\x00' ||
// tile world i think
magic === '\xac\xaa\x02\x01' ||
// pgchip, which adds ice blocks
magic === '\xac\xaa\x03\x00')
{
stored_game = dat.parse_game(buf); stored_game = dat.parse_game(buf);
} }
else if (magic === 'PK\x03\x04') { else if (magic === 'PK\x03\x04') {