From aac1e09c72303b5a6de9bb9ce2b2dd6fe3805e77 Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Fri, 1 Jan 2021 17:11:11 -0700 Subject: [PATCH] Add support for pgchip's magic number and ice block encoding --- js/format-dat.js | 6 +++++- js/main.js | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/js/format-dat.js b/js/format-dat.js index f322448..d2fd493 100644 --- a/js/format-dat.js +++ b/js/format-dat.js @@ -63,7 +63,7 @@ const TILE_ENCODING = { 0x35: 'bogus_player_burned', 0x36: 'wall_invisible', // unused 0x37: 'wall_invisible', // unused - 0x38: 'wall_invisible', // unused + 0x38: 'ice_block', // unused, but co-opted by pgchip 0x39: 'bogus_player_win', 0x3a: 'bogus_player_win', 0x3b: 'bogus_player_win', @@ -352,6 +352,10 @@ export function parse_game(buf) { // OK // TODO tile world convention, use lynx rules } + else if (magic === 0x0003aaac) { + // OK + // TODO add in ice block i guess??? + } else { throw new Error(`Unrecognized magic number ${magic.toString(16)}`); } diff --git a/js/main.js b/js/main.js index 1125be1..0f6d6c9 100644 --- a/js/main.js +++ b/js/main.js @@ -3137,7 +3137,14 @@ class Conductor { stored_game = c2g.wrap_individual_level(buf); 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); } else if (magic === 'PK\x03\x04') {