[Scummvm-git-logs] scummvm master -> 668f8cbae5b7c1530dec725ba166ade8bb9a2ae0

neuromancer noreply at scummvm.org
Sat Nov 18 09:48:42 UTC 2023


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
269c0fafb1 FREESCAPE: use M_PI macro
1d0c1a4a07 FREESCAPE: refactored some code out of freescape.h
6255cbee2b PRIVATE: added support for the windows japanese release
668f8cbae5 NEWS: Mention Private Eye japanese support


Commit: 269c0fafb1400a1b4595f9573914d59e95b69780
    https://github.com/scummvm/scummvm/commit/269c0fafb1400a1b4595f9573914d59e95b69780
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-11-18T10:44:54+01:00

Commit Message:
FREESCAPE: use M_PI macro

Changed paths:
    engines/freescape/gfx_opengl.cpp


diff --git a/engines/freescape/gfx_opengl.cpp b/engines/freescape/gfx_opengl.cpp
index e74fec371e0..2ac513fd830 100644
--- a/engines/freescape/gfx_opengl.cpp
+++ b/engines/freescape/gfx_opengl.cpp
@@ -299,7 +299,7 @@ void OpenGLRenderer::renderPlayerShootBall(byte color, const Common::Point posit
 
 	glColor3ub(r, g, b);
 	int triangleAmount = 20;
-	float twicePi = 2.f * 3.1416f;
+	float twicePi = 2.f * M_PI;
 	float coef = (9 - frame) / 9.0;
 	float radius = (1 - coef) * 4.0;
 


Commit: 1d0c1a4a07811c23aefcbac4611a27527e052474
    https://github.com/scummvm/scummvm/commit/1d0c1a4a07811c23aefcbac4611a27527e052474
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-11-18T10:44:54+01:00

Commit Message:
FREESCAPE: refactored some code out of freescape.h

Changed paths:
    engines/freescape/detection.cpp
    engines/freescape/freescape.h
    engines/freescape/games/dark/dark.h
    engines/freescape/games/driller/driller.h


diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index 37ff1214c26..e70aa5ac127 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -22,6 +22,7 @@
 #include "freescape/freescape.h"
 #include "freescape/detection.h"
 
+#include "freescape/games/driller/driller.h"
 #include "freescape/games/eclipse/eclipse.h"
 
 namespace Freescape {
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index c068ca8ce04..c59ef03dac4 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -444,27 +444,6 @@ public:
 	Common::RandomSource *_rnd;
 };
 
-enum DrillerReleaseFlags {
-		GF_AMIGA_RETAIL = (1 << 0),
-		GF_AMIGA_BUDGET = (1 << 1),
-		GF_ZX_RETAIL = (1 << 2),
-		GF_ZX_BUDGET = (1 << 3),
-		GF_ZX_DISC = (1 << 4),
-		GF_CPC_RETAIL = (1 << 5),
-		GF_CPC_RETAIL2 = (1 << 6),
-		GF_CPC_BUDGET = (1 << 7),
-		GF_CPC_VIRTUALWORLDS = (1 << 8),
-		GF_ATARI_RETAIL = (1 << 9),
-		GF_ATARI_BUDGET = (1 << 10),
-		GF_AMIGA_MAGAZINE_DEMO = (1 << 11),
-		GF_ATARI_MAGAZINE_DEMO = (1 << 12),
-};
-
-struct ECD {
-	uint16 _area;
-	int _id;
-};
-
 class CastleEngine : public FreescapeEngine {
 public:
 	CastleEngine(OSystem *syst, const ADGameDescription *gd);
diff --git a/engines/freescape/games/dark/dark.h b/engines/freescape/games/dark/dark.h
index db6d924198a..c2ef4bdb764 100644
--- a/engines/freescape/games/dark/dark.h
+++ b/engines/freescape/games/dark/dark.h
@@ -32,6 +32,11 @@ enum {
 	kDarkEndingECDsDestroyed = 2,
 };
 
+struct ECD {
+	uint16 _area;
+	int _id;
+};
+
 class DarkEngine : public FreescapeEngine {
 public:
 	DarkEngine(OSystem *syst, const ADGameDescription *gd);
diff --git a/engines/freescape/games/driller/driller.h b/engines/freescape/games/driller/driller.h
index 617414078b3..7905b838b43 100644
--- a/engines/freescape/games/driller/driller.h
+++ b/engines/freescape/games/driller/driller.h
@@ -104,4 +104,20 @@ private:
 	Common::SeekableReadStream *decryptFileAtari(const Common::String filename);
 };
 
+enum DrillerReleaseFlags {
+		GF_AMIGA_RETAIL = (1 << 0),
+		GF_AMIGA_BUDGET = (1 << 1),
+		GF_ZX_RETAIL = (1 << 2),
+		GF_ZX_BUDGET = (1 << 3),
+		GF_ZX_DISC = (1 << 4),
+		GF_CPC_RETAIL = (1 << 5),
+		GF_CPC_RETAIL2 = (1 << 6),
+		GF_CPC_BUDGET = (1 << 7),
+		GF_CPC_VIRTUALWORLDS = (1 << 8),
+		GF_ATARI_RETAIL = (1 << 9),
+		GF_ATARI_BUDGET = (1 << 10),
+		GF_AMIGA_MAGAZINE_DEMO = (1 << 11),
+		GF_ATARI_MAGAZINE_DEMO = (1 << 12),
+};
+
 }
\ No newline at end of file


Commit: 6255cbee2bae07f45ad136fdb650ed06b8621551
    https://github.com/scummvm/scummvm/commit/6255cbee2bae07f45ad136fdb650ed06b8621551
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-11-18T10:44:54+01:00

Commit Message:
PRIVATE: added support for the windows japanese release

Changed paths:
    engines/private/detection.cpp
    engines/private/grammar.cpp
    engines/private/grammar.y
    engines/private/lexer.cpp
    engines/private/lexer.l
    engines/private/private.cpp
    engines/private/tokens.h


diff --git a/engines/private/detection.cpp b/engines/private/detection.cpp
index d16c5f61791..f0e13973dbd 100644
--- a/engines/private/detection.cpp
+++ b/engines/private/detection.cpp
@@ -178,6 +178,16 @@ static const ADGameDescription gameDescriptions[] = {
 		ADGF_NO_FLAGS,
 		GUIO1(GUIO_NOMIDI)
 	},
+	{
+		"private-eye",  // JP release
+		nullptr,
+		AD_ENTRY2s("pvteye.z", "f5fb6e89e98294a09ff21e72282b58dc", 239066,
+		   "intro.smk", "b8d15a522f896ccbe4539394b6b8ec8a", 7202836),
+		Common::JA_JPN,
+		Common::kPlatformWindows,
+		ADGF_NO_FLAGS,
+		GUIO1(GUIO_NOMIDI)
+	},
 	{
 		"private-eye", // MacOS release (US)
 		nullptr,
diff --git a/engines/private/grammar.cpp b/engines/private/grammar.cpp
index 9132d7cc546..daceff62ab3 100644
--- a/engines/private/grammar.cpp
+++ b/engines/private/grammar.cpp
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.7.2.  */
+/* A Bison parser, made by GNU Bison 3.8.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -45,11 +45,11 @@
    define necessary library symbols; they are noted "INFRINGES ON
    USER NAME SPACE" below.  */
 
-/* Identify Bison output.  */
-#define YYBISON 1
+/* Identify Bison output, and Bison version.  */
+#define YYBISON 30802
 
-/* Bison version.  */
-#define YYBISON_VERSION "3.7.2"
+/* Bison version string.  */
+#define YYBISON_VERSION "3.8.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -75,14 +75,14 @@
 #define yychar          PRIVATE_char
 
 /* First part of user prologue.  */
-#line 51 "engines/private/grammar.y"
+#line 50 "engines/private/grammar.y"
 
 
 #include "private/private.h"
 #include "private/grammar.h"
 
 #undef yyerror
-#define yyerror         PRIVATE_xerror
+#define yyerror	 PRIVATE_xerror
 
 #define code1(c1)       code(c1);
 #define code2(c1,c2)    code(c1); code(c2)
@@ -93,10 +93,9 @@ using namespace Gen;
 using namespace Settings;
 
 extern int PRIVATE_lex();
-//extern int PRIVATE_parse();
+extern int PRIVATE_parse();
 
 void PRIVATE_xerror(const char *str) {
-    assert(0);
 }
 
 int PRIVATE_wrap() {
@@ -151,36 +150,39 @@ enum yysymbol_kind_t
   YYSYMBOL_RECT = 15,                      /* RECT  */
   YYSYMBOL_GOTOTOK = 16,                   /* GOTOTOK  */
   YYSYMBOL_DEBUGTOK = 17,                  /* DEBUGTOK  */
-  YYSYMBOL_DEFINETOK = 18,                 /* DEFINETOK  */
-  YYSYMBOL_SETTINGTOK = 19,                /* SETTINGTOK  */
-  YYSYMBOL_RANDOMTOK = 20,                 /* RANDOMTOK  */
-  YYSYMBOL_21_ = 21,                       /* '{'  */
-  YYSYMBOL_22_ = 22,                       /* '}'  */
-  YYSYMBOL_23_ = 23,                       /* ','  */
-  YYSYMBOL_24_ = 24,                       /* ';'  */
-  YYSYMBOL_25_ = 25,                       /* '('  */
-  YYSYMBOL_26_ = 26,                       /* ')'  */
-  YYSYMBOL_27_ = 27,                       /* '!'  */
-  YYSYMBOL_28_ = 28,                       /* '+'  */
-  YYSYMBOL_29_ = 29,                       /* '<'  */
-  YYSYMBOL_30_ = 30,                       /* '>'  */
-  YYSYMBOL_31_ = 31,                       /* '%'  */
-  YYSYMBOL_YYACCEPT = 32,                  /* $accept  */
-  YYSYMBOL_lines = 33,                     /* lines  */
-  YYSYMBOL_line = 34,                      /* line  */
-  YYSYMBOL_debug = 35,                     /* debug  */
-  YYSYMBOL_statements = 36,                /* statements  */
-  YYSYMBOL_statement = 37,                 /* statement  */
-  YYSYMBOL_body = 38,                      /* body  */
-  YYSYMBOL_end = 39,                       /* end  */
-  YYSYMBOL_if = 40,                        /* if  */
-  YYSYMBOL_cond = 41,                      /* cond  */
-  YYSYMBOL_define = 42,                    /* define  */
-  YYSYMBOL_fcall = 43,                     /* fcall  */
-  YYSYMBOL_startp = 44,                    /* startp  */
-  YYSYMBOL_params = 45,                    /* params  */
-  YYSYMBOL_value = 46,                     /* value  */
-  YYSYMBOL_expr = 47                       /* expr  */
+  YYSYMBOL_EMITCODEONTOK = 18,             /* EMITCODEONTOK  */
+  YYSYMBOL_EMITCODEOFFTOK = 19,            /* EMITCODEOFFTOK  */
+  YYSYMBOL_RESETIDTOK = 20,                /* RESETIDTOK  */
+  YYSYMBOL_DEFINETOK = 21,                 /* DEFINETOK  */
+  YYSYMBOL_SETTINGTOK = 22,                /* SETTINGTOK  */
+  YYSYMBOL_RANDOMTOK = 23,                 /* RANDOMTOK  */
+  YYSYMBOL_24_ = 24,                       /* '{'  */
+  YYSYMBOL_25_ = 25,                       /* '}'  */
+  YYSYMBOL_26_ = 26,                       /* ','  */
+  YYSYMBOL_27_ = 27,                       /* ';'  */
+  YYSYMBOL_28_ = 28,                       /* '('  */
+  YYSYMBOL_29_ = 29,                       /* ')'  */
+  YYSYMBOL_30_ = 30,                       /* '!'  */
+  YYSYMBOL_31_ = 31,                       /* '+'  */
+  YYSYMBOL_32_ = 32,                       /* '<'  */
+  YYSYMBOL_33_ = 33,                       /* '>'  */
+  YYSYMBOL_34_ = 34,                       /* '%'  */
+  YYSYMBOL_YYACCEPT = 35,                  /* $accept  */
+  YYSYMBOL_lines = 36,                     /* lines  */
+  YYSYMBOL_line = 37,                      /* line  */
+  YYSYMBOL_debug = 38,                     /* debug  */
+  YYSYMBOL_statements = 39,                /* statements  */
+  YYSYMBOL_statement = 40,                 /* statement  */
+  YYSYMBOL_body = 41,                      /* body  */
+  YYSYMBOL_end = 42,                       /* end  */
+  YYSYMBOL_if = 43,                        /* if  */
+  YYSYMBOL_cond = 44,                      /* cond  */
+  YYSYMBOL_define = 45,                    /* define  */
+  YYSYMBOL_fcall = 46,                     /* fcall  */
+  YYSYMBOL_startp = 47,                    /* startp  */
+  YYSYMBOL_params = 48,                    /* params  */
+  YYSYMBOL_value = 49,                     /* value  */
+  YYSYMBOL_expr = 50                       /* expr  */
 };
 typedef enum yysymbol_kind_t yysymbol_kind_t;
 
@@ -224,6 +226,18 @@ typedef int_least16_t yytype_int16;
 typedef short yytype_int16;
 #endif
 
+/* Work around bug in HP-UX 11.23, which defines these macros
+   incorrectly for preprocessor constants.  This workaround can likely
+   be removed in 2023, as HPE has promised support for HP-UX 11.23
+   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
+   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
+#ifdef __hpux
+# undef UINT_LEAST8_MAX
+# undef UINT_LEAST16_MAX
+# define UINT_LEAST8_MAX 255
+# define UINT_LEAST16_MAX 65535
+#endif
+
 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
@@ -321,17 +335,23 @@ typedef int yy_state_fast_t;
 
 /* Suppress unused-variable warnings by "using" E.  */
 #if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
+# define YY_USE(E) ((void) (E))
 #else
-# define YYUSE(E) /* empty */
+# define YY_USE(E) /* empty */
 #endif
 
-#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
+#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
+# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
+#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
+    _Pragma ("GCC diagnostic push")                                     \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
+# else
+#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
     _Pragma ("GCC diagnostic push")                                     \
     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# endif
 # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
     _Pragma ("GCC diagnostic pop")
 #else
@@ -488,21 +508,21 @@ union yyalloc
 #endif /* !YYCOPY_NEEDED */
 
 /* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  9
+#define YYFINAL  12
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   125
+#define YYLAST   124
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  32
+#define YYNTOKENS  35
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  16
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  50
+#define YYNRULES  53
 /* YYNSTATES -- Number of states.  */
-#define YYNSTATES  113
+#define YYNSTATES  116
 
 /* YYMAXUTOK -- Last valid token kind.  */
-#define YYMAXUTOK   275
+#define YYMAXUTOK   278
 
 
 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
@@ -519,16 +539,16 @@ static const yytype_int8 yytranslate[] =
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,    27,     2,     2,     2,    31,     2,     2,
-      25,    26,     2,    28,    23,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,    24,
-      29,     2,    30,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    30,     2,     2,     2,    34,     2,     2,
+      28,    29,     2,    31,    26,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,    27,
+      32,     2,    33,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,    21,     2,    22,     2,     2,     2,     2,
+       2,     2,     2,    24,     2,    25,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -543,19 +563,19 @@ static const yytype_int8 yytranslate[] =
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,    18,    19,    20
+      15,    16,    17,    18,    19,    20,    21,    22,    23
 };
 
 #if PRIVATE_DEBUG
-  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
+/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,    96,    96,    97,   100,   101,   102,   106,   107,   110,
-     111,   114,   121,   122,   127,   135,   136,   139,   142,   145,
-     148,   149,   154,   158,   159,   162,   170,   171,   179,   182,
-     183,   184,   185,   186,   189,   190,   191,   192,   193,   194,
-     197,   198,   199,   200,   201,   202,   203,   204,   205,   206,
-     207
+       0,    95,    95,    96,    99,   100,   101,   102,   103,   104,
+     108,   109,   112,   113,   116,   123,   124,   129,   137,   138,
+     141,   144,   147,   150,   151,   156,   160,   161,   164,   172,
+     173,   181,   184,   185,   186,   187,   188,   191,   192,   193,
+     194,   195,   196,   199,   200,   201,   202,   203,   204,   205,
+     206,   207,   208,   209
 };
 #endif
 
@@ -573,11 +593,12 @@ static const char *const yytname[] =
 {
   "\"end of file\"", "error", "\"invalid token\"", "NAME", "STRING",
   "NUM", "LTE", "GTE", "NEQ", "EQ", "FALSETOK", "TRUETOK", "NULLTOK",
-  "IFTOK", "ELSETOK", "RECT", "GOTOTOK", "DEBUGTOK", "DEFINETOK",
-  "SETTINGTOK", "RANDOMTOK", "'{'", "'}'", "','", "';'", "'('", "')'",
-  "'!'", "'+'", "'<'", "'>'", "'%'", "$accept", "lines", "line", "debug",
-  "statements", "statement", "body", "end", "if", "cond", "define",
-  "fcall", "startp", "params", "value", "expr", YY_NULLPTR
+  "IFTOK", "ELSETOK", "RECT", "GOTOTOK", "DEBUGTOK", "EMITCODEONTOK",
+  "EMITCODEOFFTOK", "RESETIDTOK", "DEFINETOK", "SETTINGTOK", "RANDOMTOK",
+  "'{'", "'}'", "','", "';'", "'('", "')'", "'!'", "'+'", "'<'", "'>'",
+  "'%'", "$accept", "lines", "line", "debug", "statements", "statement",
+  "body", "end", "if", "cond", "define", "fcall", "startp", "params",
+  "value", "expr", YY_NULLPTR
 };
 
 static const char *
@@ -587,19 +608,7 @@ yysymbol_name (yysymbol_kind_t yysymbol)
 }
 #endif
 
-#ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
-   (internal) symbol number NUM (which must be that of a token).  */
-static const yytype_int16 yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   123,   125,    44,    59,    40,    41,    33,    43,    60,
-      62,    37
-};
-#endif
-
-#define YYPACT_NINF (-73)
+#define YYPACT_NINF (-75)
 
 #define yypact_value_is_default(Yyn) \
   ((Yyn) == YYPACT_NINF)
@@ -609,132 +618,132 @@ static const yytype_int16 yytoknum[] =
 #define yytable_value_is_error(Yyn) \
   0
 
-  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-     STATE-NUM.  */
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
 static const yytype_int8 yypact[] =
 {
-       8,   -11,    11,    12,    18,     8,    30,    22,    23,   -73,
-     -73,    24,    38,    42,    59,    30,   -73,    40,    39,    41,
-     -73,    54,    16,    58,    59,    56,    60,   -73,     5,   -73,
-     -73,    77,    61,    83,   -73,   -73,    19,    52,   -73,    62,
-     -73,     1,    65,   -73,    63,   -73,   -73,   -73,   -73,   -73,
-     -73,    67,    66,    29,    64,    59,   -73,   -73,    86,    41,
-      68,    71,    69,    73,    92,   -73,    93,   -73,    66,    66,
-      66,    66,    66,    66,    66,   -73,    78,    50,    76,     1,
-     -73,     1,    79,    70,   -73,   -73,   -73,   -73,   -73,   -73,
-     -73,   -73,    52,    98,   -73,   -73,    99,    80,   -73,    82,
-      84,   -73,   -73,   103,   104,    87,    85,   107,   -73,    88,
-      90,    42,   -73
+      67,   -10,   -75,   -75,   -75,    12,    19,    28,    67,    26,
+      13,    27,   -75,   -75,    17,     5,    36,    51,    26,   -75,
+      24,    30,    25,   -75,    37,     4,    49,    51,    50,    52,
+     -75,     6,   -75,   -75,    47,    53,    78,   -75,   -75,    15,
+      20,   -75,    54,   -75,     1,    64,   -75,    62,   -75,   -75,
+     -75,   -75,   -75,   -75,    66,    65,    40,    63,    51,   -75,
+     -75,    88,    25,    68,    69,    70,    71,    93,   -75,    95,
+     -75,    65,    65,    65,    65,    65,    65,    65,   -75,    76,
+      89,    79,     1,   -75,     1,    80,    73,   -75,   -75,   -75,
+     -75,   -75,   -75,   -75,   -75,    20,    97,   -75,   -75,    99,
+      81,   -75,    82,    83,   -75,   -75,   106,   107,    87,    85,
+     110,   -75,    90,    91,    36,   -75
 };
 
-  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
-     Performed when YYTABLE does not specify something else to do.  Zero
-     means the default is an error.  */
+/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE does not specify something else to do.  Zero
+   means the default is an error.  */
 static const yytype_int8 yydefact[] =
 {
-       0,     0,     0,     0,     0,     3,     7,     0,     0,     1,
-       2,     0,     0,    20,     9,     7,     4,    24,     0,     0,
-      18,     0,     0,     0,     9,     0,     0,     8,    20,     5,
-      28,     0,     0,     0,     6,    10,     0,     0,    12,     0,
-      23,    29,     0,    11,     0,    39,    38,    37,    35,    36,
-      34,     0,     0,    40,     0,     9,    15,    17,     0,    39,
-       0,    33,     0,    32,     0,    25,     0,    41,     0,     0,
-       0,     0,    49,     0,     0,    19,     0,    13,     0,    29,
-      27,    29,     0,     0,    47,    48,    43,    42,    44,    45,
-      46,    16,     0,     0,    30,    31,     0,     0,    17,     0,
-       0,    50,    14,     0,     0,     0,     0,     0,    26,     0,
-      22,    20,    21
+       0,     0,     5,     6,     7,     0,     0,     0,     3,    10,
+       0,     0,     1,     2,     0,     0,    23,    12,    10,     4,
+      27,     0,     0,    21,     0,     0,     0,    12,     0,     0,
+      11,    23,     8,    31,     0,     0,     0,     9,    13,     0,
+       0,    15,     0,    26,    32,     0,    14,     0,    42,    41,
+      40,    38,    39,    37,     0,     0,    43,     0,    12,    18,
+      20,     0,    42,     0,    36,     0,    35,     0,    28,     0,
+      44,     0,     0,     0,     0,    52,     0,     0,    22,     0,
+      16,     0,    32,    30,    32,     0,     0,    50,    51,    46,
+      45,    47,    48,    49,    19,     0,     0,    33,    34,     0,
+       0,    20,     0,     0,    53,    17,     0,     0,     0,     0,
+       0,    29,     0,    25,    23,    24
 };
 
-  /* YYPGOTO[NTERM-NUM].  */
+/* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
-     -73,   110,   -73,   101,   -21,   -36,    25,    20,   -73,   -73,
-     -28,   -39,   -73,   -72,   -20,    89
+     -75,   108,   -75,   100,   -24,   -39,    29,    21,   -75,   -75,
+     -31,   -42,   -75,   -74,   -14,    84
 };
 
-  /* YYDEFGOTO[NTERM-NUM].  */
+/* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int8 yydefgoto[] =
 {
-      -1,     4,     5,    12,    23,    24,    57,    77,    25,    37,
-      18,    26,    41,    62,    53,    63
+       0,     7,     8,    15,    26,    27,    60,    80,    28,    40,
+      21,    29,    44,    65,    56,    66
 };
 
-  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
-     positive, shift that token.  If negative, reduce the rule whose
-     number is the opposite.  If YYTABLE_NINF, syntax error.  */
+/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule whose
+   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 static const yytype_int8 yytable[] =
 {
-      40,    56,    61,    35,    59,    46,    47,    94,    17,    95,
-       6,    48,    49,    50,     7,     8,    21,    60,     9,    32,
-      39,    51,    45,    46,    47,     1,     2,     3,    52,    48,
-      49,    50,    67,    11,    76,    68,    69,    70,    71,    51,
-      61,    33,    61,    13,    14,    17,    52,    15,    84,    85,
-      86,    87,    88,    89,    90,    19,    56,    72,    73,    74,
-      16,    29,    19,    28,    92,    20,    30,    21,    22,    45,
-      46,    47,    20,    55,    21,    22,    48,    49,    50,    31,
-      34,    36,    42,   112,    38,    43,    44,    58,    64,    65,
-      75,    78,    66,    33,    79,    80,    81,    82,    83,    93,
-      91,    97,    96,    99,   100,   103,   101,   104,   105,   106,
-     107,   108,   109,   111,   110,    10,    27,    98,   102,     0,
-       0,     0,     0,     0,     0,    54
+      43,    59,    64,    38,    62,    49,    50,    35,    97,    20,
+      98,    51,    52,    53,     9,    10,    24,    63,    48,    49,
+      50,    42,    11,    22,    54,    51,    52,    53,    12,    14,
+      19,    55,    36,    23,    79,    24,    25,    16,    54,    20,
+      64,    70,    64,    18,    58,    55,    71,    72,    73,    74,
+      31,    17,    45,    33,    22,    32,    59,    87,    88,    89,
+      90,    91,    92,    93,    23,    34,    24,    25,    48,    49,
+      50,    75,    76,    77,    37,    51,    52,    53,    39,    41,
+      46,    47,    61,   115,     1,     2,     3,     4,     5,     6,
+      67,    68,    78,    81,    69,    82,    36,    84,    85,    83,
+      86,    94,   102,    95,   103,    96,    99,   100,   106,   107,
+     104,   108,   109,   110,   111,   112,    13,   114,    30,   113,
+       0,     0,   105,    57,   101
 };
 
 static const yytype_int8 yycheck[] =
 {
-      28,    37,    41,    24,     3,     4,     5,    79,     3,    81,
-      21,    10,    11,    12,     3,     3,    15,    16,     0,     3,
-      15,    20,     3,     4,     5,    17,    18,    19,    27,    10,
-      11,    12,    52,     3,    55,     6,     7,     8,     9,    20,
-      79,    25,    81,    21,    21,     3,    27,    23,    68,    69,
-      70,    71,    72,    73,    74,     3,    92,    28,    29,    30,
-      22,    22,     3,    23,    14,    13,    25,    15,    16,     3,
-       4,     5,    13,    21,    15,    16,    10,    11,    12,    25,
-      22,    25,     5,   111,    24,    24,     3,    25,    23,    26,
-      26,     5,    25,    25,    23,    26,    23,     5,     5,    23,
-      22,    31,    23,     5,     5,    23,    26,    23,     5,     5,
-      23,    26,     5,    23,    26,     5,    15,    92,    98,    -1,
-      -1,    -1,    -1,    -1,    -1,    36
+      31,    40,    44,    27,     3,     4,     5,     3,    82,     3,
+      84,    10,    11,    12,    24,     3,    15,    16,     3,     4,
+       5,    15,     3,     3,    23,    10,    11,    12,     0,     3,
+      25,    30,    28,    13,    58,    15,    16,    24,    23,     3,
+      82,    55,    84,    26,    24,    30,     6,     7,     8,     9,
+      26,    24,     5,    28,     3,    25,    95,    71,    72,    73,
+      74,    75,    76,    77,    13,    28,    15,    16,     3,     4,
+       5,    31,    32,    33,    25,    10,    11,    12,    28,    27,
+      27,     3,    28,   114,    17,    18,    19,    20,    21,    22,
+      26,    29,    29,     5,    28,    26,    28,    26,     5,    29,
+       5,    25,     5,    14,     5,    26,    26,    34,    26,    26,
+      29,     5,     5,    26,    29,     5,     8,    26,    18,    29,
+      -1,    -1,   101,    39,    95
 };
 
-  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-     symbol of state STATE-NUM.  */
+/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
+   state STATE-NUM.  */
 static const yytype_int8 yystos[] =
 {
-       0,    17,    18,    19,    33,    34,    21,     3,     3,     0,
-      33,     3,    35,    21,    21,    23,    22,     3,    42,     3,
-      13,    15,    16,    36,    37,    40,    43,    35,    23,    22,
-      25,    25,     3,    25,    22,    36,    25,    41,    24,    15,
-      42,    44,     5,    24,     3,     3,     4,     5,    10,    11,
-      12,    20,    27,    46,    47,    21,    37,    38,    25,     3,
-      16,    43,    45,    47,    23,    26,    25,    46,     6,     7,
-       8,     9,    28,    29,    30,    26,    36,    39,     5,    23,
-      26,    23,     5,     5,    46,    46,    46,    46,    46,    46,
-      46,    22,    14,    23,    45,    45,    23,    31,    38,     5,
-       5,    26,    39,    23,    23,     5,     5,    23,    26,     5,
-      26,    23,    42
+       0,    17,    18,    19,    20,    21,    22,    36,    37,    24,
+       3,     3,     0,    36,     3,    38,    24,    24,    26,    25,
+       3,    45,     3,    13,    15,    16,    39,    40,    43,    46,
+      38,    26,    25,    28,    28,     3,    28,    25,    39,    28,
+      44,    27,    15,    45,    47,     5,    27,     3,     3,     4,
+       5,    10,    11,    12,    23,    30,    49,    50,    24,    40,
+      41,    28,     3,    16,    46,    48,    50,    26,    29,    28,
+      49,     6,     7,     8,     9,    31,    32,    33,    29,    39,
+      42,     5,    26,    29,    26,     5,     5,    49,    49,    49,
+      49,    49,    49,    49,    25,    14,    26,    48,    48,    26,
+      34,    41,     5,     5,    29,    42,    26,    26,     5,     5,
+      26,    29,     5,    29,    26,    45
 };
 
-  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
 static const yytype_int8 yyr1[] =
 {
-       0,    32,    33,    33,    34,    34,    34,    35,    35,    36,
-      36,    37,    37,    37,    37,    38,    38,    39,    40,    41,
-      42,    42,    42,    42,    42,    43,    43,    43,    44,    45,
-      45,    45,    45,    45,    46,    46,    46,    46,    46,    46,
-      47,    47,    47,    47,    47,    47,    47,    47,    47,    47,
-      47
+       0,    35,    36,    36,    37,    37,    37,    37,    37,    37,
+      38,    38,    39,    39,    40,    40,    40,    40,    41,    41,
+      42,    43,    44,    45,    45,    45,    45,    45,    46,    46,
+      46,    47,    48,    48,    48,    48,    48,    49,    49,    49,
+      49,    49,    49,    50,    50,    50,    50,    50,    50,    50,
+      50,    50,    50,    50
 };
 
-  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
+/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
 static const yytype_int8 yyr2[] =
 {
-       0,     2,     2,     1,     4,     5,     5,     0,     3,     0,
-       2,     3,     2,     4,     7,     1,     3,     0,     1,     3,
-       0,    14,    12,     3,     1,     4,    10,     5,     0,     0,
-       3,     3,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     2,     3,     3,     3,     3,     3,     3,     3,     2,
-       5
+       0,     2,     2,     1,     4,     1,     1,     1,     5,     5,
+       0,     3,     0,     2,     3,     2,     4,     7,     1,     3,
+       0,     1,     3,     0,    14,    12,     3,     1,     4,    10,
+       5,     0,     0,     3,     3,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     2,     3,     3,     3,     3,     3,
+       3,     3,     2,     5
 };
 
 
@@ -746,6 +755,7 @@ enum { YYENOMEM = -2 };
 #define YYACCEPT        goto yyacceptlab
 #define YYABORT         goto yyabortlab
 #define YYERROR         goto yyerrorlab
+#define YYNOMEM         goto yyexhaustedlab
 
 
 #define YYRECOVERING()  (!!yyerrstatus)
@@ -786,10 +796,7 @@ do {                                            \
     YYFPRINTF Args;                             \
 } while (0)
 
-/* This macro is provided for backward compatibility. */
-# ifndef YY_LOCATION_PRINT
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
+
 
 
 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
@@ -813,15 +820,11 @@ yy_symbol_value_print (FILE *yyo,
                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
 {
   FILE *yyoutput = yyo;
-  YYUSE (yyoutput);
+  YY_USE (yyoutput);
   if (!yyvaluep)
     return;
-# ifdef YYPRINT
-  if (yykind < YYNTOKENS)
-    YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
-# endif
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  YYUSE (yykind);
+  YY_USE (yykind);
   YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
@@ -935,13 +938,13 @@ static void
 yydestruct (const char *yymsg,
             yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
 {
-  YYUSE (yyvaluep);
+  YY_USE (yyvaluep);
   if (!yymsg)
     yymsg = "Deleting";
   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
 
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  YYUSE (yykind);
+  YY_USE (yykind);
   YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
@@ -1004,6 +1007,7 @@ yyparse (void)
   YYDPRINTF ((stderr, "Starting parse\n"));
 
   yychar = PRIVATE_EMPTY; /* Cause a token to be read.  */
+
   goto yysetstate;
 
 
@@ -1029,7 +1033,7 @@ yysetstate:
 
   if (yyss + yystacksize - 1 <= yyssp)
 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
-    goto yyexhaustedlab;
+    YYNOMEM;
 #else
     {
       /* Get the current used size of the three stacks, in elements.  */
@@ -1057,7 +1061,7 @@ yysetstate:
 # else /* defined YYSTACK_RELOCATE */
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-        goto yyexhaustedlab;
+        YYNOMEM;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
         yystacksize = YYMAXDEPTH;
@@ -1068,7 +1072,7 @@ yysetstate:
           YY_CAST (union yyalloc *,
                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
         if (! yyptr)
-          goto yyexhaustedlab;
+          YYNOMEM;
         YYSTACK_RELOCATE (yyss_alloc, yyss);
         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 #  undef YYSTACK_RELOCATE
@@ -1090,6 +1094,7 @@ yysetstate:
     }
 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
+
   if (yystate == YYFINAL)
     YYACCEPT;
 
@@ -1202,299 +1207,317 @@ yyreduce:
   switch (yyn)
     {
   case 4: /* line: DEBUGTOK '{' debug '}'  */
+#line 99 "engines/private/grammar.y"
+                             { /* Not used in the game */ }
+#line 1213 "engines/private/grammar.cpp"
+    break;
+
+  case 5: /* line: EMITCODEONTOK  */
 #line 100 "engines/private/grammar.y"
-                                             { /* Not used in the game */ }
-#line 1207 "engines/private/grammar.cpp"
+                        { /* Unclear what this is */ }
+#line 1219 "engines/private/grammar.cpp"
     break;
 
-  case 5: /* line: DEFINETOK NAME '{' define '}'  */
+  case 6: /* line: EMITCODEOFFTOK  */
 #line 101 "engines/private/grammar.y"
-                                             { g_private->maps.installAll((yyvsp[-3].s)); }
-#line 1213 "engines/private/grammar.cpp"
+                         { /* Unclear what this is */ }
+#line 1225 "engines/private/grammar.cpp"
     break;
 
-  case 6: /* line: SETTINGTOK NAME '{' statements '}'  */
+  case 7: /* line: RESETIDTOK  */
 #line 102 "engines/private/grammar.y"
+                     { /* Unclear what this is */ }
+#line 1231 "engines/private/grammar.cpp"
+    break;
+
+  case 8: /* line: DEFINETOK NAME '{' define '}'  */
+#line 103 "engines/private/grammar.y"
+                                        { g_private->maps.installAll((yyvsp[-3].s)); }
+#line 1237 "engines/private/grammar.cpp"
+    break;
+
+  case 9: /* line: SETTINGTOK NAME '{' statements '}'  */
+#line 104 "engines/private/grammar.y"
                                              { g_setts->save((yyvsp[-3].s));
-                                               g_setts->init(); }
-#line 1220 "engines/private/grammar.cpp"
+					       g_setts->init(); }
+#line 1244 "engines/private/grammar.cpp"
     break;
 
-  case 9: /* statements: %empty  */
-#line 110 "engines/private/grammar.y"
+  case 12: /* statements: %empty  */
+#line 112 "engines/private/grammar.y"
                                { (yyval.inst) = g_vm->_progp; }
-#line 1226 "engines/private/grammar.cpp"
+#line 1250 "engines/private/grammar.cpp"
     break;
 
-  case 11: /* statement: GOTOTOK NAME ';'  */
-#line 114 "engines/private/grammar.y"
+  case 14: /* statement: GOTOTOK NAME ';'  */
+#line 116 "engines/private/grammar.y"
                             {
-        (yyval.inst) = g_vm->_progp;
-        code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-1].s)));
-        code2(constpush, (Inst) g_private->maps.constant(NUM, 1, nullptr));
-        code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
-        code1(funcpush);
-        }
-#line 1238 "engines/private/grammar.cpp"
+	(yyval.inst) = g_vm->_progp;
+	code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-1].s)));
+	code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL));
+	code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
+	code1(funcpush);
+	}
+#line 1262 "engines/private/grammar.cpp"
     break;
 
-  case 12: /* statement: fcall ';'  */
-#line 121 "engines/private/grammar.y"
-                            { (yyval.inst) = (yyvsp[-1].inst); }
-#line 1244 "engines/private/grammar.cpp"
+  case 15: /* statement: fcall ';'  */
+#line 123 "engines/private/grammar.y"
+                         { (yyval.inst) = (yyvsp[-1].inst); }
+#line 1268 "engines/private/grammar.cpp"
     break;
 
-  case 13: /* statement: if cond body end  */
-#line 122 "engines/private/grammar.y"
+  case 16: /* statement: if cond body end  */
+#line 124 "engines/private/grammar.y"
                            {
-                /* else-less if */
-                ((yyvsp[-3].inst))[1] = (Inst)(yyvsp[-1].inst);     /* thenpart */
-                ((yyvsp[-3].inst))[3] = (Inst)(yyvsp[0].inst);
-                }
-#line 1254 "engines/private/grammar.cpp"
+		/* else-less if */
+		((yyvsp[-3].inst))[1] = (Inst)(yyvsp[-1].inst);     /* thenpart */
+		((yyvsp[-3].inst))[3] = (Inst)(yyvsp[0].inst);
+		}
+#line 1278 "engines/private/grammar.cpp"
     break;
 
-  case 14: /* statement: if cond body end ELSETOK body end  */
-#line 127 "engines/private/grammar.y"
+  case 17: /* statement: if cond body end ELSETOK body end  */
+#line 129 "engines/private/grammar.y"
                                             {
-                /* if with else */
-                ((yyvsp[-6].inst))[1] = (Inst)(yyvsp[-4].inst);     /* thenpart */
-                ((yyvsp[-6].inst))[2] = (Inst)(yyvsp[-1].inst);     /* elsepart */
-                ((yyvsp[-6].inst))[3] = (Inst)(yyvsp[0].inst);
-                }
-#line 1265 "engines/private/grammar.cpp"
+		/* if with else */
+		((yyvsp[-6].inst))[1] = (Inst)(yyvsp[-4].inst);     /* thenpart */
+		((yyvsp[-6].inst))[2] = (Inst)(yyvsp[-1].inst);     /* elsepart */
+		((yyvsp[-6].inst))[3] = (Inst)(yyvsp[0].inst);
+		}
+#line 1289 "engines/private/grammar.cpp"
     break;
 
-  case 15: /* body: statement  */
-#line 135 "engines/private/grammar.y"
-                             { (yyval.inst) = (yyvsp[0].inst); }
-#line 1271 "engines/private/grammar.cpp"
+  case 18: /* body: statement  */
+#line 137 "engines/private/grammar.y"
+                        { (yyval.inst) = (yyvsp[0].inst); }
+#line 1295 "engines/private/grammar.cpp"
     break;
 
-  case 16: /* body: '{' statements '}'  */
-#line 136 "engines/private/grammar.y"
+  case 19: /* body: '{' statements '}'  */
+#line 138 "engines/private/grammar.y"
                              { (yyval.inst) = (yyvsp[-1].inst); }
-#line 1277 "engines/private/grammar.cpp"
+#line 1301 "engines/private/grammar.cpp"
     break;
 
-  case 17: /* end: %empty  */
-#line 139 "engines/private/grammar.y"
+  case 20: /* end: %empty  */
+#line 141 "engines/private/grammar.y"
                              { code1(STOP); (yyval.inst) = g_vm->_progp; }
-#line 1283 "engines/private/grammar.cpp"
+#line 1307 "engines/private/grammar.cpp"
     break;
 
-  case 18: /* if: IFTOK  */
-#line 142 "engines/private/grammar.y"
+  case 21: /* if: IFTOK  */
+#line 144 "engines/private/grammar.y"
           { (yyval.inst) = code1(ifcode); code3(STOP, STOP, STOP); }
-#line 1289 "engines/private/grammar.cpp"
+#line 1313 "engines/private/grammar.cpp"
     break;
 
-  case 19: /* cond: '(' expr ')'  */
-#line 145 "engines/private/grammar.y"
+  case 22: /* cond: '(' expr ')'  */
+#line 147 "engines/private/grammar.y"
                         { code1(STOP); (yyval.inst) = (yyvsp[-1].inst); }
-#line 1295 "engines/private/grammar.cpp"
+#line 1319 "engines/private/grammar.cpp"
     break;
 
-  case 21: /* define: NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' ',' define  */
-#line 149 "engines/private/grammar.y"
+  case 24: /* define: NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')' ',' define  */
+#line 151 "engines/private/grammar.y"
                                                                         {
-          Common::Rect *r = new Common::Rect((yyvsp[-9].sym)->u.val, (yyvsp[-7].sym)->u.val, (yyvsp[-5].sym)->u.val, (yyvsp[-3].sym)->u.val);
-          assert(r->isValidRect());
-          g_private->maps.defineSymbol((yyvsp[-13].s), r);
-          }
-#line 1305 "engines/private/grammar.cpp"
+	  Common::Rect *r = new Common::Rect((yyvsp[-9].sym)->u.val, (yyvsp[-7].sym)->u.val, (yyvsp[-5].sym)->u.val, (yyvsp[-3].sym)->u.val);
+	  assert(r->isValidRect());
+	  g_private->maps.defineSymbol((yyvsp[-13].s), r);
+	  }
+#line 1329 "engines/private/grammar.cpp"
     break;
 
-  case 22: /* define: NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')'  */
-#line 154 "engines/private/grammar.y"
+  case 25: /* define: NAME ',' RECT '(' NUM ',' NUM ',' NUM ',' NUM ')'  */
+#line 156 "engines/private/grammar.y"
                                                             {
-          Common::Rect *r = new Common::Rect((yyvsp[-7].sym)->u.val, (yyvsp[-5].sym)->u.val, (yyvsp[-3].sym)->u.val, (yyvsp[-1].sym)->u.val);
-          g_private->maps.defineSymbol((yyvsp[-11].s), r);
-          }
-#line 1314 "engines/private/grammar.cpp"
+	  Common::Rect *r = new Common::Rect((yyvsp[-7].sym)->u.val, (yyvsp[-5].sym)->u.val, (yyvsp[-3].sym)->u.val, (yyvsp[-1].sym)->u.val);
+	  g_private->maps.defineSymbol((yyvsp[-11].s), r);
+	  }
+#line 1338 "engines/private/grammar.cpp"
     break;
 
-  case 23: /* define: NAME ',' define  */
-#line 158 "engines/private/grammar.y"
-                          { g_private->maps.defineSymbol((yyvsp[-2].s), nullptr); }
-#line 1320 "engines/private/grammar.cpp"
+  case 26: /* define: NAME ',' define  */
+#line 160 "engines/private/grammar.y"
+                          { g_private->maps.defineSymbol((yyvsp[-2].s), NULL); }
+#line 1344 "engines/private/grammar.cpp"
     break;
 
-  case 24: /* define: NAME  */
-#line 159 "engines/private/grammar.y"
-                          { g_private->maps.defineSymbol((yyvsp[0].s), nullptr); }
-#line 1326 "engines/private/grammar.cpp"
+  case 27: /* define: NAME  */
+#line 161 "engines/private/grammar.y"
+                    { g_private->maps.defineSymbol((yyvsp[0].s), NULL); }
+#line 1350 "engines/private/grammar.cpp"
     break;
 
-  case 25: /* fcall: GOTOTOK '(' NAME ')'  */
-#line 162 "engines/private/grammar.y"
+  case 28: /* fcall: GOTOTOK '(' NAME ')'  */
+#line 164 "engines/private/grammar.y"
                                {
-                               (yyval.inst) = g_vm->_progp;
-                               code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-1].s)));
-                               code2(constpush, (Inst) g_private->maps.constant(NUM, 1, nullptr));
-                               code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
-                               code1(funcpush);
-                               }
-#line 1338 "engines/private/grammar.cpp"
+			       (yyval.inst) = g_vm->_progp;
+			       code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-1].s)));
+			       code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL));
+			       code2(strpush, (Inst) g_private->maps.constant(STRING, 0, "goto"));
+			       code1(funcpush);
+			       }
+#line 1362 "engines/private/grammar.cpp"
     break;
 
-  case 26: /* fcall: RECT '(' NUM ',' NUM ',' NUM ',' NUM ')'  */
-#line 170 "engines/private/grammar.y"
+  case 29: /* fcall: RECT '(' NUM ',' NUM ',' NUM ',' NUM ')'  */
+#line 172 "engines/private/grammar.y"
                                                    { (yyval.inst) = g_vm->_progp; }
-#line 1344 "engines/private/grammar.cpp"
+#line 1368 "engines/private/grammar.cpp"
     break;
 
-  case 27: /* fcall: NAME '(' startp params ')'  */
-#line 171 "engines/private/grammar.y"
+  case 30: /* fcall: NAME '(' startp params ')'  */
+#line 173 "engines/private/grammar.y"
                                       {
-                               (yyval.inst) = (yyvsp[-2].inst);
-                               code2(constpush, (Inst) g_private->maps.constant(NUM, (yyvsp[-1].narg), nullptr));
-                               code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-4].s)));
-                               code1(funcpush);
-                               }
-#line 1355 "engines/private/grammar.cpp"
+			       (yyval.inst) = (yyvsp[-2].inst);
+			       code2(constpush, (Inst) g_private->maps.constant(NUM, (yyvsp[-1].narg), NULL));
+			       code2(strpush, (Inst) g_private->maps.constant(STRING, 0, (yyvsp[-4].s)));
+			       code1(funcpush);
+			       }
+#line 1379 "engines/private/grammar.cpp"
     break;
 
-  case 28: /* startp: %empty  */
-#line 179 "engines/private/grammar.y"
+  case 31: /* startp: %empty  */
+#line 181 "engines/private/grammar.y"
                     { (yyval.inst) = g_vm->_progp; }
-#line 1361 "engines/private/grammar.cpp"
+#line 1385 "engines/private/grammar.cpp"
     break;
 
-  case 29: /* params: %empty  */
-#line 182 "engines/private/grammar.y"
+  case 32: /* params: %empty  */
+#line 184 "engines/private/grammar.y"
                             { (yyval.narg) = 0; }
-#line 1367 "engines/private/grammar.cpp"
+#line 1391 "engines/private/grammar.cpp"
     break;
 
-  case 30: /* params: fcall ',' params  */
-#line 183 "engines/private/grammar.y"
+  case 33: /* params: fcall ',' params  */
+#line 185 "engines/private/grammar.y"
                             { (yyval.narg) = (yyvsp[0].narg) + 1; }
-#line 1373 "engines/private/grammar.cpp"
+#line 1397 "engines/private/grammar.cpp"
     break;
 
-  case 31: /* params: expr ',' params  */
-#line 184 "engines/private/grammar.y"
+  case 34: /* params: expr ',' params  */
+#line 186 "engines/private/grammar.y"
                             { (yyval.narg) = (yyvsp[0].narg) + 1; }
-#line 1379 "engines/private/grammar.cpp"
+#line 1403 "engines/private/grammar.cpp"
     break;
 
-  case 32: /* params: expr  */
-#line 185 "engines/private/grammar.y"
-                      { (yyval.narg) = 1; }
-#line 1385 "engines/private/grammar.cpp"
+  case 35: /* params: expr  */
+#line 187 "engines/private/grammar.y"
+                { (yyval.narg) = 1; }
+#line 1409 "engines/private/grammar.cpp"
     break;
 
-  case 33: /* params: fcall  */
-#line 186 "engines/private/grammar.y"
+  case 36: /* params: fcall  */
+#line 188 "engines/private/grammar.y"
                       { (yyval.narg) = 1; }
-#line 1391 "engines/private/grammar.cpp"
+#line 1415 "engines/private/grammar.cpp"
     break;
 
-  case 34: /* value: NULLTOK  */
-#line 189 "engines/private/grammar.y"
-                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, nullptr)); }
-#line 1397 "engines/private/grammar.cpp"
+  case 37: /* value: NULLTOK  */
+#line 191 "engines/private/grammar.y"
+                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, NULL)); }
+#line 1421 "engines/private/grammar.cpp"
     break;
 
-  case 35: /* value: FALSETOK  */
-#line 190 "engines/private/grammar.y"
-                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, nullptr)); }
-#line 1403 "engines/private/grammar.cpp"
+  case 38: /* value: FALSETOK  */
+#line 192 "engines/private/grammar.y"
+                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 0, NULL)); }
+#line 1427 "engines/private/grammar.cpp"
     break;
 
-  case 36: /* value: TRUETOK  */
-#line 191 "engines/private/grammar.y"
-                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 1, nullptr)); }
-#line 1409 "engines/private/grammar.cpp"
+  case 39: /* value: TRUETOK  */
+#line 193 "engines/private/grammar.y"
+                   { code2(constpush, (Inst) g_private->maps.constant(NUM, 1, NULL)); }
+#line 1433 "engines/private/grammar.cpp"
     break;
 
-  case 37: /* value: NUM  */
-#line 192 "engines/private/grammar.y"
+  case 40: /* value: NUM  */
+#line 194 "engines/private/grammar.y"
                    { code2(constpush, (Inst)(yyvsp[0].sym)); }
-#line 1415 "engines/private/grammar.cpp"
+#line 1439 "engines/private/grammar.cpp"
     break;
 
-  case 38: /* value: STRING  */
-#line 193 "engines/private/grammar.y"
+  case 41: /* value: STRING  */
+#line 195 "engines/private/grammar.y"
                    { code2(strpush, (Inst)(yyvsp[0].sym)); }
-#line 1421 "engines/private/grammar.cpp"
+#line 1445 "engines/private/grammar.cpp"
     break;
 
-  case 39: /* value: NAME  */
-#line 194 "engines/private/grammar.y"
+  case 42: /* value: NAME  */
+#line 196 "engines/private/grammar.y"
                    { code1(varpush); code1((Inst) g_private->maps.lookupName((yyvsp[0].s))); code1(eval); }
-#line 1427 "engines/private/grammar.cpp"
+#line 1451 "engines/private/grammar.cpp"
     break;
 
-  case 40: /* expr: value  */
-#line 197 "engines/private/grammar.y"
-                          { (yyval.inst) = (yyvsp[0].inst); }
-#line 1433 "engines/private/grammar.cpp"
+  case 43: /* expr: value  */
+#line 199 "engines/private/grammar.y"
+                   { (yyval.inst) = (yyvsp[0].inst); }
+#line 1457 "engines/private/grammar.cpp"
     break;
 
-  case 41: /* expr: '!' value  */
-#line 198 "engines/private/grammar.y"
+  case 44: /* expr: '!' value  */
+#line 200 "engines/private/grammar.y"
                           { code1(negate); (yyval.inst) = (yyvsp[0].inst); }
-#line 1439 "engines/private/grammar.cpp"
+#line 1463 "engines/private/grammar.cpp"
     break;
 
-  case 42: /* expr: value EQ value  */
-#line 199 "engines/private/grammar.y"
+  case 45: /* expr: value EQ value  */
+#line 201 "engines/private/grammar.y"
                           { code1(eq); }
-#line 1445 "engines/private/grammar.cpp"
+#line 1469 "engines/private/grammar.cpp"
     break;
 
-  case 43: /* expr: value NEQ value  */
-#line 200 "engines/private/grammar.y"
+  case 46: /* expr: value NEQ value  */
+#line 202 "engines/private/grammar.y"
                           { code1(ne); }
-#line 1451 "engines/private/grammar.cpp"
+#line 1475 "engines/private/grammar.cpp"
     break;
 
-  case 44: /* expr: value '+' value  */
-#line 201 "engines/private/grammar.y"
+  case 47: /* expr: value '+' value  */
+#line 203 "engines/private/grammar.y"
                           { code1(add); }
-#line 1457 "engines/private/grammar.cpp"
+#line 1481 "engines/private/grammar.cpp"
     break;
 
-  case 45: /* expr: value '<' value  */
-#line 202 "engines/private/grammar.y"
+  case 48: /* expr: value '<' value  */
+#line 204 "engines/private/grammar.y"
                           { code1(lt); }
-#line 1463 "engines/private/grammar.cpp"
+#line 1487 "engines/private/grammar.cpp"
     break;
 
-  case 46: /* expr: value '>' value  */
-#line 203 "engines/private/grammar.y"
+  case 49: /* expr: value '>' value  */
+#line 205 "engines/private/grammar.y"
                           { code1(gt); }
-#line 1469 "engines/private/grammar.cpp"
+#line 1493 "engines/private/grammar.cpp"
     break;
 
-  case 47: /* expr: value LTE value  */
-#line 204 "engines/private/grammar.y"
+  case 50: /* expr: value LTE value  */
+#line 206 "engines/private/grammar.y"
                           { code1(le); }
-#line 1475 "engines/private/grammar.cpp"
+#line 1499 "engines/private/grammar.cpp"
     break;
 
-  case 48: /* expr: value GTE value  */
-#line 205 "engines/private/grammar.y"
+  case 51: /* expr: value GTE value  */
+#line 207 "engines/private/grammar.y"
                           { code1(ge); }
-#line 1481 "engines/private/grammar.cpp"
+#line 1505 "engines/private/grammar.cpp"
     break;
 
-  case 49: /* expr: value '+'  */
-#line 206 "engines/private/grammar.y"
+  case 52: /* expr: value '+'  */
+#line 208 "engines/private/grammar.y"
                           { (yyval.inst) = (yyvsp[-1].inst); }
-#line 1487 "engines/private/grammar.cpp"
+#line 1511 "engines/private/grammar.cpp"
     break;
 
-  case 50: /* expr: RANDOMTOK '(' NUM '%' ')'  */
-#line 207 "engines/private/grammar.y"
+  case 53: /* expr: RANDOMTOK '(' NUM '%' ')'  */
+#line 209 "engines/private/grammar.y"
                                     { code3(constpush, (Inst)(yyvsp[-2].sym), randbool); }
-#line 1493 "engines/private/grammar.cpp"
+#line 1517 "engines/private/grammar.cpp"
     break;
 
 
-#line 1497 "engines/private/grammar.cpp"
+#line 1521 "engines/private/grammar.cpp"
 
       default: break;
     }
@@ -1576,6 +1599,7 @@ yyerrorlab:
      label yyerrorlab therefore never appears in user code.  */
   if (0)
     YYERROR;
+  ++yynerrs;
 
   /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
@@ -1636,7 +1660,7 @@ yyerrlab1:
 `-------------------------------------*/
 yyacceptlab:
   yyresult = 0;
-  goto yyreturn;
+  goto yyreturnlab;
 
 
 /*-----------------------------------.
@@ -1644,24 +1668,22 @@ yyacceptlab:
 `-----------------------------------*/
 yyabortlab:
   yyresult = 1;
-  goto yyreturn;
+  goto yyreturnlab;
 
 
-#if !defined yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
+/*-----------------------------------------------------------.
+| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
+`-----------------------------------------------------------*/
 yyexhaustedlab:
   yyerror (YY_("memory exhausted"));
   yyresult = 2;
-  goto yyreturn;
-#endif
+  goto yyreturnlab;
 
 
-/*-------------------------------------------------------.
-| yyreturn -- parsing is finished, clean up and return.  |
-`-------------------------------------------------------*/
-yyreturn:
+/*----------------------------------------------------------.
+| yyreturnlab -- parsing is finished, clean up and return.  |
+`----------------------------------------------------------*/
+yyreturnlab:
   if (yychar != PRIVATE_EMPTY)
     {
       /* Make sure we have latest lookahead translation.  See comments at
diff --git a/engines/private/grammar.y b/engines/private/grammar.y
index eac0a3119fc..247c3587654 100644
--- a/engines/private/grammar.y
+++ b/engines/private/grammar.y
@@ -87,7 +87,7 @@ int PRIVATE_wrap() {
 %token<s> NAME
 %token<sym> STRING NUM
 %type <inst> body if startp cond end expr statements statement fcall value
-%token LTE GTE NEQ EQ FALSETOK TRUETOK NULLTOK IFTOK ELSETOK RECT GOTOTOK DEBUGTOK DEFINETOK SETTINGTOK RANDOMTOK
+%token LTE GTE NEQ EQ FALSETOK TRUETOK NULLTOK IFTOK ELSETOK RECT GOTOTOK DEBUGTOK EMITCODEONTOK EMITCODEOFFTOK RESETIDTOK DEFINETOK SETTINGTOK RANDOMTOK
 %type<narg> params
 
 %%
@@ -96,8 +96,11 @@ lines:   line lines
        | line
        ;
 
-line:     DEBUGTOK '{' debug '}'	     { /* Not used in the game */ }
-	| DEFINETOK NAME '{' define '}'      { g_private->maps.installAll($NAME); }
+line: DEBUGTOK '{' debug '}' { /* Not used in the game */ }
+	| EMITCODEONTOK { /* Unclear what this is */ }
+	| EMITCODEOFFTOK { /* Unclear what this is */ }
+	| RESETIDTOK { /* Unclear what this is */ }
+	| DEFINETOK NAME '{' define '}' { g_private->maps.installAll($NAME); }
 	| SETTINGTOK NAME '{' statements '}' { g_setts->save($NAME);
 					       g_setts->init(); }
 	;
diff --git a/engines/private/lexer.cpp b/engines/private/lexer.cpp
index 08c5e9347cf..38bdf2b5881 100644
--- a/engines/private/lexer.cpp
+++ b/engines/private/lexer.cpp
@@ -293,7 +293,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types. 
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -310,7 +310,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -421,10 +421,10 @@ extern FILE *yyin, *yyout;
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
-
+    
     #define YY_LESS_LINENO(n)
     #define YY_LINENO_REWIND_TO(ptr)
-
+    
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
@@ -438,7 +438,7 @@ extern FILE *yyin, *yyout;
 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
 		} \
 	while ( 0 )
-//#define unput(c) yyunput( c, (yytext_ptr)  )
+#define unput(c) yyunput( c, (yytext_ptr)  )
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
@@ -508,7 +508,7 @@ struct yy_buffer_state
 /* Stack of input buffers. */
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = nullptr; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
@@ -530,7 +530,7 @@ static int yy_n_chars;		/* number of characters read into yy_ch_buf */
 int yyleng;
 
 /* Points to current character in buffer. */
-static char *yy_c_buf_p = nullptr;
+static char *yy_c_buf_p = NULL;
 static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
@@ -587,7 +587,7 @@ void yyfree ( void *  );
 #define YY_SKIP_YYWRAP
 typedef flex_uint8_t YY_CHAR;
 
-FILE *yyin = nullptr, *yyout = nullptr;
+FILE *yyin = NULL, *yyout = NULL;
 
 typedef int yy_state_type;
 
@@ -614,8 +614,8 @@ static void yynoreturn yy_fatal_error ( const char* msg  );
 	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
 	(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 23
-#define YY_END_OF_BUFFER 24
+#define YY_NUM_RULES 26
+#define YY_END_OF_BUFFER 27
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -623,16 +623,20 @@ struct yy_trans_info
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static const flex_int16_t yy_accept[78] =
+static const flex_int16_t yy_accept[103] =
     {   0,
-        0,    0,   24,   22,   21,   20,   20,   22,   22,   22,
-       22,   18,   22,   22,   22,   17,   17,   17,   17,   17,
-       17,   17,   17,   17,   17,   21,   20,    4,    0,   19,
-       18,    1,    2,    5,    3,   17,   17,   17,   17,   17,
-       17,   17,   17,   17,    9,   17,    1,   17,   17,   17,
-       17,   17,   17,   17,   17,   17,   17,   17,   15,   12,
-       17,   14,   17,   17,   10,   11,   17,   13,   17,    6,
-       17,   17,   16,    7,   17,    8,    0
+        0,    0,   27,   25,   24,   23,   23,   25,   25,   25,
+       25,   21,   25,   25,   25,   20,   20,   20,   20,   20,
+       20,   20,   20,   20,   20,   20,   24,   23,    4,    0,
+       22,   21,    1,    2,    5,    3,   20,   20,   20,   20,
+       20,   20,   20,   20,   20,   20,   20,   12,   20,    1,
+       20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
+       20,   20,   20,   20,   18,   15,   20,   20,   17,   20,
+       20,   13,   14,   20,   20,   16,   20,   20,    6,   20,
+       20,   20,   19,   20,    7,   20,   20,   20,    8,   20,
+       20,   20,   20,   20,   10,   20,    9,   20,   20,   20,
+
+       11,    0
     } ;
 
 static const YY_CHAR yy_ec[256] =
@@ -643,14 +647,14 @@ static const YY_CHAR yy_ec[256] =
         1,    2,    5,    6,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    7,    1,    8,    9,    9,    9,
         9,    9,    9,    9,    9,    9,    9,    1,    1,   10,
-       11,   12,    1,    1,   13,   14,   15,   14,   16,   17,
-       14,   14,   14,   14,   14,   18,   14,   19,   14,   14,
-       14,   20,   21,   22,   23,   14,   14,   14,   14,   14,
-        1,    1,    1,    1,   14,    1,   24,   25,   14,   26,
-
-       27,   28,   29,   14,   30,   14,   14,   31,   32,   33,
-       34,   14,   14,   14,   35,   36,   37,   14,   14,   14,
-       14,   14,    1,   38,    1,    1,    1,    1,    1,    1,
+       11,   12,    1,    1,   13,   14,   15,   16,   17,   18,
+       14,   14,   19,   14,   14,   20,   14,   21,   22,   14,
+       14,   23,   24,   25,   26,   14,   14,   14,   14,   14,
+        1,    1,    1,    1,   14,    1,   27,   28,   14,   29,
+
+       30,   31,   32,   14,   33,   14,   14,   34,   35,   36,
+       37,   14,   14,   38,   39,   40,   41,   14,   14,   14,
+       14,   14,    1,   42,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -667,76 +671,91 @@ static const YY_CHAR yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-static const YY_CHAR yy_meta[39] =
+static const YY_CHAR yy_meta[43] =
     {   0,
         1,    1,    2,    3,    1,    1,    1,    1,    4,    1,
         1,    1,    4,    4,    4,    4,    4,    4,    4,    4,
         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
-        4,    4,    4,    4,    4,    4,    4,    1
+        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    1
     } ;
 
-static const flex_int16_t yy_base[81] =
+static const flex_int16_t yy_base[106] =
     {   0,
-        0,    0,  105,  106,  102,   36,   38,   92,   96,   92,
-       92,   90,   87,   86,   85,    0,   82,   71,   27,   73,
-       65,   60,   56,   61,   61,   83,   41,  106,   76,  106,
-       72,    0,  106,  106,  106,    0,   60,   59,   60,   40,
-       49,   21,   36,   34,    0,   33,    0,   47,   49,   44,
-       39,   48,   26,   32,   34,   26,   23,   42,    0,    0,
-       23,    0,   27,   22,    0,    0,   24,    0,   21,    0,
-       25,   17,    0,    0,   19,    0,  106,   79,   43,   83
+        0,    0,  133,  134,  130,   40,   42,  120,  124,  120,
+      120,  118,  115,  114,  113,    0,   88,  109,   95,   30,
+       97,   89,   84,   80,   85,   85,  112,   45,  134,  107,
+      134,  103,    0,  134,  134,  134,    0,   78,   90,   89,
+       93,   71,   67,   79,   22,   65,   63,    0,   62,    0,
+       61,   76,   79,   73,   68,   66,   76,   49,   56,   56,
+       48,   43,   66,   63,    0,    0,   42,   38,    0,   45,
+       40,    0,    0,   42,   37,    0,   38,   53,    0,   41,
+       34,   40,    0,   52,    0,   35,   36,   50,    0,   42,
+       26,   20,   21,   30,    0,   23,    0,   18,   25,   16,
+
+        0,  134,   87,   48,   91
     } ;
 
-static const flex_int16_t yy_def[81] =
+static const flex_int16_t yy_def[106] =
     {   0,
-       77,    1,   77,   77,   77,   77,   77,   77,   78,   77,
-       77,   77,   77,   77,   77,   79,   79,   79,   79,   79,
-       79,   79,   79,   79,   79,   77,   77,   77,   78,   77,
-       77,   80,   77,   77,   77,   79,   79,   79,   79,   79,
-       79,   79,   79,   79,   79,   79,   80,   79,   79,   79,
-       79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
-       79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
-       79,   79,   79,   79,   79,   79,    0,   77,   77,   77
+      102,    1,  102,  102,  102,  102,  102,  102,  103,  102,
+      102,  102,  102,  102,  102,  104,  104,  104,  104,  104,
+      104,  104,  104,  104,  104,  104,  102,  102,  102,  103,
+      102,  102,  105,  102,  102,  102,  104,  104,  104,  104,
+      104,  104,  104,  104,  104,  104,  104,  104,  104,  105,
+      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
+      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
+      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
+      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
+      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
+
+      104,    0,  102,  102,  102
     } ;
 
-static const flex_int16_t yy_nxt[145] =
+static const flex_int16_t yy_nxt[177] =
     {   0,
         4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
-       14,   15,   16,   16,   16,   16,   17,   16,   18,   19,
-       16,   20,   16,   16,   16,   21,   22,   16,   23,   24,
-       16,   16,   16,   16,   25,   16,   16,    7,   27,   27,
-       27,   27,   39,   27,   27,   53,   36,   76,   54,   75,
-       40,   74,   73,   72,   71,   70,   69,   68,   67,   66,
-       65,   64,   63,   62,   61,   60,   59,   58,   57,   56,
-       55,   52,   51,   27,   50,   27,   49,   48,   27,   29,
-       31,   30,   29,   47,   26,   47,   47,   46,   45,   44,
-       43,   42,   41,   38,   37,   35,   34,   33,   31,   32,
-
-       31,   30,   28,   26,   77,    3,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77
+       14,   15,   16,   16,   16,   16,   17,   18,   16,   16,
+       19,   16,   20,   16,   21,   16,   16,   16,   22,   23,
+       16,   24,   25,   16,   16,   16,   16,   16,   26,   16,
+       16,    7,   28,   28,   28,   28,   41,   28,   28,   58,
+       94,   37,   59,  101,  100,   95,   42,   99,   98,   43,
+       97,   96,   93,   92,   91,   90,   89,   88,   87,   86,
+       85,   84,   83,   82,   81,   80,   79,   78,   77,   76,
+       75,   28,   74,   28,   73,   72,   28,   30,   71,   70,
+       30,   50,   69,   50,   50,   68,   67,   66,   65,   64,
+
+       63,   62,   61,   60,   57,   56,   55,   54,   53,   52,
+       51,   32,   31,   27,   49,   48,   47,   46,   45,   44,
+       40,   39,   38,   36,   35,   34,   32,   33,   32,   31,
+       29,   27,  102,    3,  102,  102,  102,  102,  102,  102,
+      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
+      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
+      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
+      102,  102,  102,  102,  102,  102
     } ;
 
-static const flex_int16_t yy_chk[145] =
+static const flex_int16_t yy_chk[177] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    6,    6,
-        7,    7,   19,   27,   27,   42,   79,   75,   42,   72,
-       19,   71,   69,   67,   64,   63,   61,   58,   57,   56,
-       55,   54,   53,   52,   51,   50,   49,   48,   46,   44,
-       43,   41,   40,    6,   39,    7,   38,   37,   27,   78,
-       31,   29,   78,   80,   26,   80,   80,   25,   24,   23,
-       22,   21,   20,   18,   17,   15,   14,   13,   12,   11,
-
-       10,    9,    8,    5,    3,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    6,    6,    7,    7,   20,   28,   28,   45,
+       92,  104,   45,  100,   99,   92,   20,   98,   96,   20,
+       94,   93,   91,   90,   88,   87,   86,   84,   82,   81,
+       80,   78,   77,   75,   74,   71,   70,   68,   67,   64,
+       63,    6,   62,    7,   61,   60,   28,  103,   59,   58,
+      103,  105,   57,  105,  105,   56,   55,   54,   53,   52,
+
+       51,   49,   47,   46,   44,   43,   42,   41,   40,   39,
+       38,   32,   30,   27,   26,   25,   24,   23,   22,   21,
+       19,   18,   17,   15,   14,   13,   12,   11,   10,    9,
+        8,    5,    3,  102,  102,  102,  102,  102,  102,  102,
+      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
+      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
+      102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
+      102,  102,  102,  102,  102,  102
     } ;
 
 static yy_state_type yy_last_accepting_state;
@@ -795,8 +814,8 @@ using namespace Private;
 using namespace Gen;
 using namespace Settings;
 
-#line 790 "engines/private/lexer.cpp"
-#line 791 "engines/private/lexer.cpp"
+#line 817 "engines/private/lexer.cpp"
+#line 818 "engines/private/lexer.cpp"
 
 #define INITIAL 0
 
@@ -855,11 +874,9 @@ extern int yywrap ( void );
 #endif
 #endif
 
-//#ifndef YY_NO_UNPUT
-//
-//    static void yyunput ( int c, char *buf_ptr  );
-//
-//#endif
+#ifndef YY_NO_UNPUT
+    
+#endif
 
 #ifndef yytext_ptr
 static void yy_flex_strncpy ( char *, const char *, int );
@@ -985,7 +1002,7 @@ YY_DECL
 	yy_state_type yy_current_state;
 	char *yy_cp, *yy_bp;
 	int yy_act;
-
+    
 	if ( !(yy_init) )
 		{
 		(yy_init) = 1;
@@ -1013,9 +1030,9 @@ YY_DECL
 		}
 
 	{
-#line 43 "engines/private/lexer.l"
+#line 52 "engines/private/lexer.l"
 
-#line 1010 "engines/private/lexer.cpp"
+#line 1035 "engines/private/lexer.cpp"
 
 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
 		{
@@ -1042,13 +1059,13 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 78 )
+				if ( yy_current_state >= 103 )
 					yy_c = yy_meta[yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
 			++yy_cp;
 			}
-		while ( yy_current_state != 77 );
+		while ( yy_current_state != 102 );
 		yy_cp = (yy_last_accepting_cpos);
 		yy_current_state = (yy_last_accepting_state);
 
@@ -1070,121 +1087,136 @@ do_action:	/* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 44 "engines/private/lexer.l"
+#line 53 "engines/private/lexer.l"
 /* ignoring the comment */
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 45 "engines/private/lexer.l"
+#line 54 "engines/private/lexer.l"
 return LTE;
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 46 "engines/private/lexer.l"
+#line 55 "engines/private/lexer.l"
 return GTE;
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 47 "engines/private/lexer.l"
+#line 56 "engines/private/lexer.l"
 return NEQ;
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 48 "engines/private/lexer.l"
+#line 57 "engines/private/lexer.l"
 return EQ;
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 49 "engines/private/lexer.l"
+#line 58 "engines/private/lexer.l"
 return DEBUGTOK;
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 50 "engines/private/lexer.l"
+#line 59 "engines/private/lexer.l"
 return DEFINETOK;
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 51 "engines/private/lexer.l"
+#line 60 "engines/private/lexer.l"
 return SETTINGTOK;
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 52 "engines/private/lexer.l"
-return IFTOK;
+#line 61 "engines/private/lexer.l"
+return EMITCODEOFFTOK;
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 53 "engines/private/lexer.l"
-return ELSETOK;
+#line 62 "engines/private/lexer.l"
+return EMITCODEONTOK;
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 54 "engines/private/lexer.l"
-return GOTOTOK;
+#line 63 "engines/private/lexer.l"
+return RESETIDTOK;
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 55 "engines/private/lexer.l"
-return RECT;
+#line 64 "engines/private/lexer.l"
+return IFTOK;
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 56 "engines/private/lexer.l"
-return FALSETOK;
+#line 65 "engines/private/lexer.l"
+return ELSETOK;
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 57 "engines/private/lexer.l"
-return TRUETOK;
+#line 66 "engines/private/lexer.l"
+return GOTOTOK;
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 58 "engines/private/lexer.l"
-return NULLTOK;
+#line 67 "engines/private/lexer.l"
+return RECT;
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 59 "engines/private/lexer.l"
-return RANDOMTOK;
+#line 68 "engines/private/lexer.l"
+return FALSETOK;
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 60 "engines/private/lexer.l"
-PRIVATE_lval.s = scumm_strdup(PRIVATE_text); return NAME;
+#line 69 "engines/private/lexer.l"
+return TRUETOK;
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 61 "engines/private/lexer.l"
-PRIVATE_lval.sym = g_private->maps.constant(NUM, atoi(PRIVATE_text), nullptr); return NUM;
+#line 70 "engines/private/lexer.l"
+return NULLTOK;
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 62 "engines/private/lexer.l"
-PRIVATE_lval.sym = g_private->maps.constant(STRING, 0, scumm_strdup(PRIVATE_text)); return STRING;
+#line 71 "engines/private/lexer.l"
+return RANDOMTOK;
 	YY_BREAK
 case 20:
-/* rule 20 can match eol */
 YY_RULE_SETUP
-#line 63 "engines/private/lexer.l"
-/* ignore return */;
+#line 72 "engines/private/lexer.l"
+PRIVATE_lval.s = scumm_strdup(PRIVATE_text); return NAME;
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 64 "engines/private/lexer.l"
-/* ignore whitespace */;
+#line 73 "engines/private/lexer.l"
+PRIVATE_lval.sym = g_private->maps.constant(NUM, atoi(PRIVATE_text), NULL); return NUM;
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 65 "engines/private/lexer.l"
-return *yytext;
+#line 74 "engines/private/lexer.l"
+PRIVATE_lval.sym = g_private->maps.constant(STRING, 0, scumm_strdup(PRIVATE_text)); return STRING;
 	YY_BREAK
 case 23:
+/* rule 23 can match eol */
 YY_RULE_SETUP
-#line 66 "engines/private/lexer.l"
+#line 75 "engines/private/lexer.l"
+/* ignore return */;
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 76 "engines/private/lexer.l"
+/* ignore whitespace */;
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 77 "engines/private/lexer.l"
+return *yytext;
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 78 "engines/private/lexer.l"
 ECHO;
 	YY_BREAK
-#line 1179 "engines/private/lexer.cpp"
+#line 1219 "engines/private/lexer.cpp"
 case YY_STATE_EOF(INITIAL):
 	yyterminate();
 
@@ -1400,7 +1432,7 @@ static int yy_get_next_buffer (void)
 				}
 			else
 				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = nullptr;
+				b->yy_ch_buf = NULL;
 
 			if ( ! b->yy_ch_buf )
 				YY_FATAL_ERROR(
@@ -1468,7 +1500,7 @@ static int yy_get_next_buffer (void)
 {
 	yy_state_type yy_current_state;
 	char *yy_cp;
-
+    
 	yy_current_state = (yy_start);
 
 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1482,7 +1514,7 @@ static int yy_get_next_buffer (void)
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 78 )
+			if ( yy_current_state >= 103 )
 				yy_c = yy_meta[yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -1510,55 +1542,18 @@ static int yy_get_next_buffer (void)
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 78 )
+		if ( yy_current_state >= 103 )
 			yy_c = yy_meta[yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-	yy_is_jam = (yy_current_state == 77);
+	yy_is_jam = (yy_current_state == 102);
 
 		return yy_is_jam ? 0 : yy_current_state;
 }
 
-//#ifndef YY_NO_UNPUT
-//
-//    static void yyunput (int c, char * yy_bp )
-//{
-//	char *yy_cp;
-//
-//    yy_cp = (yy_c_buf_p);
-//
-//	/* undo effects of setting up yytext */
-//	*yy_cp = (yy_hold_char);
-//
-//	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-//		{ /* need to shift things up to make room */
-//		/* +2 for EOB chars. */
-//		int number_to_move = (yy_n_chars) + 2;
-//		char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-//					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-//		char *source =
-//				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-//
-//		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-//			*--dest = *--source;
-//
-//		yy_cp += (int) (dest - source);
-//		yy_bp += (int) (dest - source);
-//		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-//			(yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-//
-//		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-//			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-//		}
-//
-//	*--yy_cp = (char) c;
-//
-//	(yytext_ptr) = yy_bp;
-//	(yy_hold_char) = *yy_cp;
-//	(yy_c_buf_p) = yy_cp;
-//}
-//
-//#endif
+#ifndef YY_NO_UNPUT
+
+#endif
 
 #ifndef YY_NO_INPUT
 #ifdef __cplusplus
@@ -1569,7 +1564,7 @@ static int yy_get_next_buffer (void)
 
 {
 	int c;
-
+    
 	*(yy_c_buf_p) = (yy_hold_char);
 
 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1636,12 +1631,12 @@ static int yy_get_next_buffer (void)
 
 /** Immediately switch to a different input stream.
  * @param input_file A readable stream.
- *
+ * 
  * @note This function does not reset the start condition to @c INITIAL .
  */
     void yyrestart  (FILE * input_file )
 {
-
+    
 	if ( ! YY_CURRENT_BUFFER ){
         yyensure_buffer_stack ();
 		YY_CURRENT_BUFFER_LVALUE =
@@ -1654,11 +1649,11 @@ static int yy_get_next_buffer (void)
 
 /** Switch to a different input buffer.
  * @param new_buffer The new input buffer.
- *
+ * 
  */
     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
-
+    
 	/* TODO. We should be able to replace this entire function body
 	 * with
 	 *		yypop_buffer_state();
@@ -1698,13 +1693,13 @@ static void yy_load_buffer_state  (void)
 /** Allocate and initialize an input buffer state.
  * @param file A readable stream.
  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ * 
  * @return the allocated buffer state.
  */
     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
 {
 	YY_BUFFER_STATE b;
-
+    
 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@@ -1727,16 +1722,16 @@ static void yy_load_buffer_state  (void)
 
 /** Destroy the buffer.
  * @param b a buffer created with yy_create_buffer()
- *
+ * 
  */
     void yy_delete_buffer (YY_BUFFER_STATE  b )
 {
-
+    
 	if ( ! b )
 		return;
 
 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr;
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
 	if ( b->yy_is_our_buffer )
 		yyfree( (void *) b->yy_ch_buf  );
@@ -1752,7 +1747,7 @@ static void yy_load_buffer_state  (void)
 
 {
 	int oerrno = errno;
-
+    
 	yy_flush_buffer( b );
 
 	b->yy_input_file = file;
@@ -1768,13 +1763,13 @@ static void yy_load_buffer_state  (void)
     }
 
         b->yy_is_interactive = 0;
-
+    
 	errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ * 
  */
     void yy_flush_buffer (YY_BUFFER_STATE  b )
 {
@@ -1803,11 +1798,11 @@ static void yy_load_buffer_state  (void)
  *  the current state. This function will allocate the stack
  *  if necessary.
  *  @param new_buffer The new state.
- *
+ *  
  */
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 {
-    	if (new_buffer == nullptr)
+    	if (new_buffer == NULL)
 		return;
 
 	yyensure_buffer_stack();
@@ -1833,7 +1828,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 
 /** Removes and deletes the top of the stack, if present.
  *  The next element becomes the new top.
- *
+ *  
  */
 void yypop_buffer_state (void)
 {
@@ -1841,7 +1836,7 @@ void yypop_buffer_state (void)
 		return;
 
 	yy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = nullptr;
+	YY_CURRENT_BUFFER_LVALUE = NULL;
 	if ((yy_buffer_stack_top) > 0)
 		--(yy_buffer_stack_top);
 
@@ -1857,7 +1852,7 @@ void yypop_buffer_state (void)
 static void yyensure_buffer_stack (void)
 {
 	yy_size_t num_to_alloc;
-
+    
 	if (!(yy_buffer_stack)) {
 
 		/* First allocation is just for 2 elements, since we don't know if this
@@ -1900,18 +1895,18 @@ static void yyensure_buffer_stack (void)
 /** Setup the input buffer state to scan directly from a user-specified character buffer.
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
- *
+ * 
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 {
 	YY_BUFFER_STATE b;
-
+    
 	if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
 		/* They forgot to leave room for the EOB's. */
-		return nullptr;
+		return NULL;
 
 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
 	if ( ! b )
@@ -1920,7 +1915,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
 	b->yy_buf_pos = b->yy_ch_buf = base;
 	b->yy_is_our_buffer = 0;
-	b->yy_input_file = nullptr;
+	b->yy_input_file = NULL;
 	b->yy_n_chars = b->yy_buf_size;
 	b->yy_is_interactive = 0;
 	b->yy_at_bol = 1;
@@ -1935,14 +1930,14 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 /** Setup the input buffer state to scan a string. The next call to yylex() will
  * scan from a @e copy of @a str.
  * @param yystr a NUL-terminated string to scan
- *
+ * 
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
  *       yy_scan_bytes() instead.
  */
 YY_BUFFER_STATE yy_scan_string (const char * yystr )
 {
-
+    
 	return yy_scan_bytes( yystr, (int) strlen(yystr) );
 }
 
@@ -1950,7 +1945,7 @@ YY_BUFFER_STATE yy_scan_string (const char * yystr )
  * scan from a @e copy of @a bytes.
  * @param yybytes the byte buffer to scan
  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- *
+ * 
  * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len )
@@ -1959,7 +1954,7 @@ YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len )
 	char *buf;
 	yy_size_t n;
 	int i;
-
+    
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = (yy_size_t) (_yybytes_len + 2);
 	buf = (char *) yyalloc( n  );
@@ -2013,16 +2008,16 @@ static void yynoreturn yy_fatal_error (const char* msg )
 /* Accessor  methods (get/set functions) to struct members. */
 
 /** Get the current line number.
- *
+ * 
  */
 int yyget_lineno  (void)
 {
-
+    
     return yylineno;
 }
 
 /** Get the input stream.
- *
+ * 
  */
 FILE *yyget_in  (void)
 {
@@ -2030,7 +2025,7 @@ FILE *yyget_in  (void)
 }
 
 /** Get the output stream.
- *
+ * 
  */
 FILE *yyget_out  (void)
 {
@@ -2038,7 +2033,7 @@ FILE *yyget_out  (void)
 }
 
 /** Get the length of the current token.
- *
+ * 
  */
 int yyget_leng  (void)
 {
@@ -2046,7 +2041,7 @@ int yyget_leng  (void)
 }
 
 /** Get the current token.
- *
+ * 
  */
 
 char *yyget_text  (void)
@@ -2056,18 +2051,18 @@ char *yyget_text  (void)
 
 /** Set the current line number.
  * @param _line_number line number
- *
+ * 
  */
 void yyset_lineno (int  _line_number )
 {
-
+    
     yylineno = _line_number;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
  * @param _in_str A readable stream.
- *
+ * 
  * @see yy_switch_to_buffer
  */
 void yyset_in (FILE *  _in_str )
@@ -2096,10 +2091,10 @@ static int yy_init_globals (void)
      * This function is called from yylex_destroy(), so don't allocate here.
      */
 
-    (yy_buffer_stack) = nullptr;
+    (yy_buffer_stack) = NULL;
     (yy_buffer_stack_top) = 0;
     (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = nullptr;
+    (yy_c_buf_p) = NULL;
     (yy_init) = 0;
     (yy_start) = 0;
 
@@ -2108,8 +2103,8 @@ static int yy_init_globals (void)
     yyin = stdin;
     yyout = stdout;
 #else
-    yyin = nullptr;
-    yyout = nullptr;
+    yyin = NULL;
+    yyout = NULL;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
@@ -2121,17 +2116,17 @@ static int yy_init_globals (void)
 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
 int yylex_destroy  (void)
 {
-
+    
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		yy_delete_buffer( YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = nullptr;
+		YY_CURRENT_BUFFER_LVALUE = NULL;
 		yypop_buffer_state();
 	}
 
 	/* Destroy the stack itself. */
 	yyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = nullptr;
+	(yy_buffer_stack) = NULL;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
      * yylex() is called, initialization will occur. */
@@ -2147,7 +2142,7 @@ int yylex_destroy  (void)
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char* s1, const char * s2, int n )
 {
-
+		
 	int i;
 	for ( i = 0; i < n; ++i )
 		s1[i] = s2[i];
@@ -2172,7 +2167,7 @@ void *yyalloc (yy_size_t  size )
 
 void *yyrealloc  (void * ptr, yy_size_t  size )
 {
-
+		
 	/* The cast to (char *) in the following accommodates both
 	 * implementations that use char* generic pointers, and those
 	 * that use void* generic pointers.  It works with the latter
@@ -2190,20 +2185,20 @@ void yyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 66 "engines/private/lexer.l"
+#line 78 "engines/private/lexer.l"
 
 
 namespace Private {
 
 int parse(const char *code) {
-    g_setts->init();
-    YY_BUFFER_STATE bp;
-    yy_delete_buffer(YY_CURRENT_BUFFER);
-    bp = yy_scan_string(code);
-    yy_switch_to_buffer(bp);
-    PRIVATE_parse();
-    yy_delete_buffer(bp);
-    return 0;
+	g_setts->init();
+	YY_BUFFER_STATE bp;
+	yy_delete_buffer(YY_CURRENT_BUFFER);
+	bp = yy_scan_string(code);
+	yy_switch_to_buffer(bp);
+	PRIVATE_parse();
+	yy_delete_buffer(bp);
+	return 0;
 }
 
 } // End of namespace Private
diff --git a/engines/private/lexer.l b/engines/private/lexer.l
index 65ed85fa433..14e0aad9b77 100644
--- a/engines/private/lexer.l
+++ b/engines/private/lexer.l
@@ -21,6 +21,7 @@
 
 %option noyywrap
 %option noinput
+%option nounput
 %option never-interactive
 
 %option outfile="engines/private/lexer.cpp"
@@ -57,6 +58,9 @@ using namespace Settings;
 debug				    return DEBUGTOK;
 define				    return DEFINETOK;
 setting				    return SETTINGTOK;
+EmitCodeOff				return EMITCODEOFFTOK;
+EmitCodeOn				return EMITCODEONTOK;
+ResetIDCounter			return RESETIDTOK;
 if					    return IFTOK;
 else				    return ELSETOK;
 goto					return GOTOTOK;
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 71387f0d6ec..45c6cba37d1 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -49,8 +49,8 @@ extern int parse(const char *);
 
 PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
 	: Engine(syst), _gameDescription(gd), _image(nullptr), _videoDecoder(nullptr),
-	  _compositeSurface(nullptr), _transparentColor(0), _frameImage(nullptr), 
-	  _framePalette(nullptr), _maxNumberClicks(0), _sirenWarning(0), 
+	  _compositeSurface(nullptr), _transparentColor(0), _frameImage(nullptr),
+	  _framePalette(nullptr), _maxNumberClicks(0), _sirenWarning(0),
 	  _screenW(640), _screenH(480) {
 	_rnd = new Common::RandomSource("private");
 
@@ -233,7 +233,7 @@ Common::Error PrivateEngine::run() {
 	// Load the game frame once
 	byte *palette;
 	_frameImage = decodeImage(_framePath, nullptr);
-	_mframeImage = decodeImage(_framePath, &palette); 
+	_mframeImage = decodeImage(_framePath, &palette);
 
 	_framePalette = (byte *) malloc(3*256);
 	memcpy(_framePalette, palette, 3*256);
@@ -557,7 +557,7 @@ Common::String PrivateEngine::getPauseMovieSetting() {
 }
 
 Common::String PrivateEngine::getGoIntroSetting() {
-	if ((_language == Common::EN_USA || _language == Common::RU_RUS || _language == Common::KO_KOR) && _platform != Common::kPlatformMacintosh)
+	if ((_language == Common::EN_USA || _language == Common::RU_RUS || _language == Common::KO_KOR || _language == Common::JA_JPN) && _platform != Common::kPlatformMacintosh)
 		return "kGoIntro";
 
 	return "k1";
@@ -1400,9 +1400,9 @@ void PrivateEngine::drawScreen() {
 				drawScreenFrame(videoPalette);
 			}
 		}
-		
+
 		// No use of _compositeSurface, we write the frame directly to the screen in the expected position
-		g_system->copyRectToScreen(frame->getPixels(), frame->pitch, center.x, center.y, frame->w, frame->h);	
+		g_system->copyRectToScreen(frame->getPixels(), frame->pitch, center.x, center.y, frame->w, frame->h);
 	} else {
 		byte newPalette[256 * 3];
 		_compositeSurface->grabPalette(newPalette, 0, 256);
diff --git a/engines/private/tokens.h b/engines/private/tokens.h
index 76ecfb2f6f4..40b3b61d1ff 100644
--- a/engines/private/tokens.h
+++ b/engines/private/tokens.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.7.2.  */
+/* A Bison parser, made by GNU Bison 3.8.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -77,9 +77,12 @@ extern int PRIVATE_debug;
     RECT = 270,                    /* RECT  */
     GOTOTOK = 271,                 /* GOTOTOK  */
     DEBUGTOK = 272,                /* DEBUGTOK  */
-    DEFINETOK = 273,               /* DEFINETOK  */
-    SETTINGTOK = 274,              /* SETTINGTOK  */
-    RANDOMTOK = 275                /* RANDOMTOK  */
+    EMITCODEONTOK = 273,           /* EMITCODEONTOK  */
+    EMITCODEOFFTOK = 274,          /* EMITCODEOFFTOK  */
+    RESETIDTOK = 275,              /* RESETIDTOK  */
+    DEFINETOK = 276,               /* DEFINETOK  */
+    SETTINGTOK = 277,              /* SETTINGTOK  */
+    RANDOMTOK = 278                /* RANDOMTOK  */
   };
   typedef enum PRIVATE_tokentype PRIVATE_token_kind_t;
 #endif
@@ -88,15 +91,15 @@ extern int PRIVATE_debug;
 #if ! defined PRIVATE_STYPE && ! defined PRIVATE_STYPE_IS_DECLARED
 union PRIVATE_STYPE
 {
-#line 80 "engines/private/grammar.y"
+#line 79 "engines/private/grammar.y"
 
-        Private::Symbol *sym; /* symbol table pointer */
-        int (**inst)();       /* machine instruction */
-        char *s;              /* string value */
-        int *i;               /* integer value */
-        int narg;             /* auxiliary value to count function arguments */
+	Private::Symbol *sym; /* symbol table pointer */
+	int (**inst)();       /* machine instruction */
+	char *s;	      /* string value */
+	int *i;	       /* integer value */
+	int narg;	     /* auxiliary value to count function arguments */
 
-#line 100 "engines/private/tokens.h"
+#line 103 "engines/private/tokens.h"
 
 };
 typedef union PRIVATE_STYPE PRIVATE_STYPE;
@@ -107,6 +110,8 @@ typedef union PRIVATE_STYPE PRIVATE_STYPE;
 
 extern PRIVATE_STYPE PRIVATE_lval;
 
+
 int PRIVATE_parse (void);
 
+
 #endif /* !YY_PRIVATE_ENGINES_PRIVATE_TOKENS_H_INCLUDED  */


Commit: 668f8cbae5b7c1530dec725ba166ade8bb9a2ae0
    https://github.com/scummvm/scummvm/commit/668f8cbae5b7c1530dec725ba166ade8bb9a2ae0
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-11-18T10:44:54+01:00

Commit Message:
NEWS: Mention Private Eye japanese support

Changed paths:
    NEWS.md


diff --git a/NEWS.md b/NEWS.md
index ede98b6c185..bffb4a51042 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -51,6 +51,9 @@ For a more comprehensive changelog of the latest experimental code, see:
    - Added support for Chinese EOB2.
    - Added support for the PC-98 version of EOB2.
 
+ Private:
+   - Added support for the Japanese Windows release.
+
  SCUMM:
    - Added support for unpacked RuSCUMM patches for Russian localizations.
    - Allow usage of the official Monkey Island 1 Roland MT-32 patch with any




More information about the Scummvm-git-logs mailing list