[Scummvm-git-logs] scummvm master -> 7d3022e73c18cb46c4b99a410988fc3c4d87cb05

neuromancer noreply at scummvm.org
Tue Jan 11 11:35:19 UTC 2022


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

Summary:
63b7a6b5a6 HYPNO: use CLUT8 instead of converting images and load palettes when necessary as well some fixes in spider
8fb12ce0cc HYPNO: use correct mouse pointers in spider
0e7a972f41 HYPNO: preserve difficulty in saves in spider
67e4d865dd HYPNO: fix matrix puzzle in spider
b0ae3313dc HYPNO: fix arcade crash in spider
ca758c2e02 HYPNO: fix crashes in cursor handling in spider
7d3022e73c HYPNO: palette and prefix fixes in spider


Commit: 63b7a6b5a689fd2db903ef75eacd8de2b2f1d4ac
    https://github.com/scummvm/scummvm/commit/63b7a6b5a689fd2db903ef75eacd8de2b2f1d4ac
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-11T12:34:59+01:00

Commit Message:
HYPNO: use CLUT8 instead of converting images and load palettes when necessary as well some fixes in spider

Changed paths:
    engines/hypno/actions.cpp
    engines/hypno/arcade.cpp
    engines/hypno/cursors.cpp
    engines/hypno/grammar.h
    engines/hypno/grammar_arc.cpp
    engines/hypno/grammar_arc.y
    engines/hypno/hypno.cpp
    engines/hypno/hypno.h
    engines/hypno/lexer_arc.cpp
    engines/hypno/spider/arcade.cpp
    engines/hypno/spider/hard.cpp
    engines/hypno/spider/spider.cpp
    engines/hypno/tokens_arc.h
    engines/hypno/video.cpp
    engines/hypno/wet/wet.cpp


diff --git a/engines/hypno/actions.cpp b/engines/hypno/actions.cpp
index adb79d44d7b..9900a03fde4 100644
--- a/engines/hypno/actions.cpp
+++ b/engines/hypno/actions.cpp
@@ -70,13 +70,16 @@ void HypnoEngine::runMenu(Hotspots hs) {
 		//	runMice(h, (Mice*) action);
 	}
 
-	//if (h.stype == "SINGLE_RUN")
-	//	loadImage("int_main/mainbutt.smk", 0, 0);
 	if (_conversation.empty()) {
 		if (h.flags[0] == "HINTS" || h.flags[1] == "HINTS" || h.flags[2] == "HINTS")
 			loadImage("int_main/hint1.smk", 0, 0, true);
-		else if (h.flags[0] == "AUTO_BUTTONS")
-			loadImage("int_main/resume.smk", 0, 0, true);
+		else if (h.flags[0] == "AUTO_BUTTONS") {
+			if (isDemo())
+				loadImage("int_main/resume.smk", 0, 0, true, false, 0);
+			else
+				loadImage("int_main/menu.smk", 0, 0, true, false, 0);
+		}
+
 	}
 }
 
@@ -114,19 +117,8 @@ void HypnoEngine::runMice(Mice *a) {
 }
 
 void HypnoEngine::runPalette(Palette *a) {
-	return; // remove when palette are working
-	Common::File *file = new Common::File();
-	Common::String path = convertPath(a->path);
-	if (!_prefixDir.empty())
-		path = _prefixDir + "/" + path;
-
-	if (!file->open(path))
-		error("unable to find video file %s", path.c_str());
-
-	debugC(1, kHypnoDebugScene, "Loading palette from %s", path.c_str());
-	byte *videoPalette = (byte*) malloc(file->size());
-	file->read(videoPalette, file->size());
-	g_system->getPaletteManager()->setPalette(videoPalette+8, 0, 256);
+	//return; // remove when palette are working
+	loadPalette(a->path);
 }
 
 void HypnoEngine::runEscape() {
@@ -179,7 +171,7 @@ void HypnoEngine::runPlay(Play *a) {
 
 void HypnoEngine::runAmbient(Ambient *a) {
 	if (a->flag == "/BITMAP") {
-		Graphics::Surface *frame = decodeFrame(a->path, a->frameNumber, true);
+		Graphics::Surface *frame = decodeFrame(a->path, a->frameNumber);
 		Graphics::Surface *sframe;
 		if (a->fullscreen)
 			sframe = frame->scale(_screenW, _screenH);
diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 6c36fa64cdf..6379ee681a7 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -109,13 +109,12 @@ void HypnoEngine::hitPlayer() {
 		if (_playerFrameIdx < _playerFrameSep)
 			_playerFrameIdx = _playerFrameSep;
 	} else {
-		uint32 red = _pixelFormat.ARGBToColor(1, 255, 0, 0);
-		_compositeSurface->fillRect(Common::Rect(0, 0, 640, 480), red);
+		uint32 c = 251; // red
+		_compositeSurface->fillRect(Common::Rect(0, 0, 640, 480), c);
 		drawScreen();
 	}
 	//if (!_hitSound.empty())
 	//	playSound(_soundPath + _hitSound, 1);
-
 }
 
 void HypnoEngine::runArcade(ArcadeShooting *arc) {
@@ -141,10 +140,8 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 	_skipLevel = false;
 
 	for (Frames::iterator it =_playerFrames.begin(); it != _playerFrames.end(); ++it) {
-		if ((*it)->getPixel(0, 0) == _pixelFormat.RGBToColor(0, 255, 255))
-			break; 
-		if ((*it)->getPixel(0, 0) == _pixelFormat.RGBToColor(0, 0, 255))
-			break; 
+		if ((*it)->getPixel(0, 0) == 255)
+			break;
 
 		_playerFrameSep++;
 	}
@@ -161,6 +158,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 
 	changeCursor("arcade");
 	playVideo(background);
+	loadPalette(arc->palette);
 	background.decoder->setRate(1.5);
 	bool shootingPrimary = false;
 	bool shootingSecondary = false;
@@ -282,6 +280,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 							s.video = new MVideo(it->animation, it->position, true, false, false);
 							playVideo(*s.video);
 							s.video->currentFrame = s.video->decoder->decodeNextFrame(); // Skip the first frame
+							loadPalette(s.video->decoder->getPalette(), s.paletteOffset, s.paletteSize);
 							_shoots.push_back(s);
 							playSound(_soundPath + arc->enemySound, 1);
 						}
diff --git a/engines/hypno/cursors.cpp b/engines/hypno/cursors.cpp
index 6530d6a48ab..5e92c86f081 100644
--- a/engines/hypno/cursors.cpp
+++ b/engines/hypno/cursors.cpp
@@ -120,8 +120,10 @@ void HypnoEngine::changeCursor(const Common::String &cursor) {
 }
 
 void HypnoEngine::changeCursor(const Common::String &cursor, uint32 n) {
-	Graphics::Surface *entry = decodeFrame(cursor, n, false);
-	CursorMan.replaceCursor(entry->getPixels(), entry->w, entry->h, 0, 0, 0);
+	byte *palette;
+	Graphics::Surface *entry = decodeFrame(cursor, n, &palette);
+	CursorMan.replaceCursor(entry->getPixels(), entry->w, entry->h, 0, 0, 0, &_pixelFormat);
+	CursorMan.replaceCursorPalette(palette, 0, 256);
 	entry->free();
 	delete entry;
 	CursorMan.showMouse(true);
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index 5c1d25f0bce..def302c7476 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -34,13 +34,28 @@
 
 namespace Hypno {
 
+typedef Common::String Filename;
+typedef Common::List<Filename> Filenames;
+
 class HypnoSmackerDecoder : public Video::SmackerDecoder {
 public:
 	bool loadStream(Common::SeekableReadStream *stream) override;
 };
 
-typedef Common::String Filename;
-typedef Common::List<Filename> Filenames;
+class MVideo {
+public:
+	MVideo(Filename, Common::Point, bool, bool, bool);
+	Filename path;
+	Common::Point position;
+	bool scaled;
+	bool transparent;
+	bool loop;
+	bool palette;
+	HypnoSmackerDecoder *decoder;
+	const Graphics::Surface *currentFrame;
+};
+
+typedef Common::Array<MVideo> Videos;
 
 enum HotspotType {
 	MakeMenu,
@@ -80,20 +95,6 @@ class Hotspot;
 typedef Common::Array<Hotspot> Hotspots;
 typedef Common::Array<Hotspots *> HotspotsStack;
 
-class MVideo {
-public:
-	MVideo(Filename, Common::Point, bool, bool, bool);
-	Filename path;
-	Common::Point position;
-	bool scaled;
-	bool transparent;
-	bool loop;
-	HypnoSmackerDecoder *decoder;
-	const Graphics::Surface *currentFrame;
-};
-
-typedef Common::Array<MVideo> Videos;
-
 class Hotspot {
 public:
 	Hotspot(HotspotType type_, Common::Rect rect_ = Common::Rect(0, 0, 0, 0)) {
@@ -352,6 +353,10 @@ public:
 	uint32 pointsToShoot;
 	uint32 attackWeight;
 
+	// Palette
+	uint32 paletteOffset;
+	uint32 paletteSize;
+
 	// Sounds
 	Filename deathSound;
 	Filename hitSound;
@@ -392,6 +397,7 @@ public:
 
 	Filename background;
 	Filename player;
+	Filename palette;
 	int health;
 	Shoots shoots;
 	ShootSequence shootSequence;
diff --git a/engines/hypno/grammar_arc.cpp b/engines/hypno/grammar_arc.cpp
index e1d43c7629c..07bb01af82f 100644
--- a/engines/hypno/grammar_arc.cpp
+++ b/engines/hypno/grammar_arc.cpp
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
+/* 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 Free Software Foundation, Inc.
+   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
    it under the terms of the GNU General Public License as published by
@@ -15,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
@@ -33,6 +34,10 @@
 /* C LALR(1) parser skeleton written by Richard Stallman, by
    simplifying the original so-called "semantic" parser.  */
 
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+   especially those whose name start with YY_ or yy_.  They are
+   private implementation details that can be changed or removed.  */
+
 /* All symbols defined below should begin with yy or YY, to avoid
    infringing on user name space.  This should be done even for local
    variables, as they might otherwise be expanded by user macros.
@@ -40,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.0.4"
+/* Bison version string.  */
+#define YYBISON_VERSION "3.8.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -66,12 +71,11 @@
 #define yyerror         HYPNO_ARC_error
 #define yydebug         HYPNO_ARC_debug
 #define yynerrs         HYPNO_ARC_nerrs
-
 #define yylval          HYPNO_ARC_lval
 #define yychar          HYPNO_ARC_char
 
-/* Copy the first part of user declarations.  */
-#line 28 "engines/hypno/grammar_arc.y" /* yacc.c:339  */
+/* First part of user prologue.  */
+#line 27 "engines/hypno/grammar_arc.y"
 
 
 #include "common/array.h"
@@ -97,144 +101,173 @@ int HYPNO_ARC_wrap() {
 using namespace Hypno;
 
 
-#line 101 "engines/hypno/grammar_arc.cpp" /* yacc.c:339  */
+#line 105 "engines/hypno/grammar_arc.cpp"
 
-# ifndef YY_NULLPTR
-#  if defined __cplusplus && 201103L <= __cplusplus
-#   define YY_NULLPTR nullptr
+# ifndef YY_CAST
+#  ifdef __cplusplus
+#   define YY_CAST(Type, Val) static_cast<Type> (Val)
+#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
 #  else
-#   define YY_NULLPTR 0
+#   define YY_CAST(Type, Val) ((Type) (Val))
+#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
 #  endif
 # endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* In a future release of Bison, this section will be replaced
-   by #include "tokens_arc.h".  */
-#ifndef YY_HYPNO_ARC_ENGINES_HYPNO_TOKENS_ARC_H_INCLUDED
-# define YY_HYPNO_ARC_ENGINES_HYPNO_TOKENS_ARC_H_INCLUDED
-/* Debug traces.  */
-#ifndef HYPNO_ARC_DEBUG
-# if defined YYDEBUG
-#if YYDEBUG
-#   define HYPNO_ARC_DEBUG 1
+# ifndef YY_NULLPTR
+#  if defined __cplusplus
+#   if 201103L <= __cplusplus
+#    define YY_NULLPTR nullptr
+#   else
+#    define YY_NULLPTR 0
+#   endif
 #  else
-#   define HYPNO_ARC_DEBUG 0
+#   define YY_NULLPTR ((void*)0)
 #  endif
-# else /* ! defined YYDEBUG */
-#  define HYPNO_ARC_DEBUG 0
-# endif /* ! defined YYDEBUG */
-#endif  /* ! defined HYPNO_ARC_DEBUG */
-#if HYPNO_ARC_DEBUG
-extern int HYPNO_ARC_debug;
-#endif
-
-/* Token type.  */
-#ifndef HYPNO_ARC_TOKENTYPE
-# define HYPNO_ARC_TOKENTYPE
-  enum HYPNO_ARC_tokentype
-  {
-    NAME = 258,
-    FILENAME = 259,
-    BNTOK = 260,
-    SNTOK = 261,
-    KNTOK = 262,
-    YXTOK = 263,
-    NUM = 264,
-    COMMENT = 265,
-    CTOK = 266,
-    DTOK = 267,
-    HTOK = 268,
-    HETOK = 269,
-    RETTOK = 270,
-    QTOK = 271,
-    ENCTOK = 272,
-    PTOK = 273,
-    FTOK = 274,
-    TTOK = 275,
-    TPTOK = 276,
-    ATOK = 277,
-    VTOK = 278,
-    OTOK = 279,
-    ONTOK = 280,
-    NTOK = 281,
-    RTOK = 282,
-    R0TOK = 283,
-    ITOK = 284,
-    JTOK = 285,
-    ZTOK = 286,
-    FNTOK = 287,
-    NONETOK = 288,
-    A0TOK = 289,
-    P0TOK = 290,
-    WTOK = 291,
-    XTOK = 292,
-    CB3TOK = 293,
-    C02TOK = 294
-  };
-#endif
-
-/* Value type.  */
-#if ! defined HYPNO_ARC_STYPE && ! defined HYPNO_ARC_STYPE_IS_DECLARED
+# endif
 
-union HYPNO_ARC_STYPE
+#include "tokens_arc.h"
+/* Symbol kind.  */
+enum yysymbol_kind_t
 {
-#line 54 "engines/hypno/grammar_arc.y" /* yacc.c:355  */
-
-	char *s; /* string value */
-	int i;	 /* integer value */
-
-#line 194 "engines/hypno/grammar_arc.cpp" /* yacc.c:355  */
+  YYSYMBOL_YYEMPTY = -2,
+  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
+  YYSYMBOL_YYerror = 1,                    /* error  */
+  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
+  YYSYMBOL_NAME = 3,                       /* NAME  */
+  YYSYMBOL_FILENAME = 4,                   /* FILENAME  */
+  YYSYMBOL_BNTOK = 5,                      /* BNTOK  */
+  YYSYMBOL_SNTOK = 6,                      /* SNTOK  */
+  YYSYMBOL_KNTOK = 7,                      /* KNTOK  */
+  YYSYMBOL_YXTOK = 8,                      /* YXTOK  */
+  YYSYMBOL_NUM = 9,                        /* NUM  */
+  YYSYMBOL_COMMENT = 10,                   /* COMMENT  */
+  YYSYMBOL_CTOK = 11,                      /* CTOK  */
+  YYSYMBOL_DTOK = 12,                      /* DTOK  */
+  YYSYMBOL_HTOK = 13,                      /* HTOK  */
+  YYSYMBOL_HETOK = 14,                     /* HETOK  */
+  YYSYMBOL_RETTOK = 15,                    /* RETTOK  */
+  YYSYMBOL_QTOK = 16,                      /* QTOK  */
+  YYSYMBOL_ENCTOK = 17,                    /* ENCTOK  */
+  YYSYMBOL_PTOK = 18,                      /* PTOK  */
+  YYSYMBOL_FTOK = 19,                      /* FTOK  */
+  YYSYMBOL_TTOK = 20,                      /* TTOK  */
+  YYSYMBOL_TPTOK = 21,                     /* TPTOK  */
+  YYSYMBOL_ATOK = 22,                      /* ATOK  */
+  YYSYMBOL_VTOK = 23,                      /* VTOK  */
+  YYSYMBOL_OTOK = 24,                      /* OTOK  */
+  YYSYMBOL_ONTOK = 25,                     /* ONTOK  */
+  YYSYMBOL_NTOK = 26,                      /* NTOK  */
+  YYSYMBOL_RTOK = 27,                      /* RTOK  */
+  YYSYMBOL_R0TOK = 28,                     /* R0TOK  */
+  YYSYMBOL_ITOK = 29,                      /* ITOK  */
+  YYSYMBOL_JTOK = 30,                      /* JTOK  */
+  YYSYMBOL_ZTOK = 31,                      /* ZTOK  */
+  YYSYMBOL_FNTOK = 32,                     /* FNTOK  */
+  YYSYMBOL_NONETOK = 33,                   /* NONETOK  */
+  YYSYMBOL_A0TOK = 34,                     /* A0TOK  */
+  YYSYMBOL_P0TOK = 35,                     /* P0TOK  */
+  YYSYMBOL_WTOK = 36,                      /* WTOK  */
+  YYSYMBOL_XTOK = 37,                      /* XTOK  */
+  YYSYMBOL_CB3TOK = 38,                    /* CB3TOK  */
+  YYSYMBOL_C02TOK = 39,                    /* C02TOK  */
+  YYSYMBOL_YYACCEPT = 40,                  /* $accept  */
+  YYSYMBOL_start = 41,                     /* start  */
+  YYSYMBOL_42_1 = 42,                      /* $@1  */
+  YYSYMBOL_header = 43,                    /* header  */
+  YYSYMBOL_hline = 44,                     /* hline  */
+  YYSYMBOL_enc = 45,                       /* enc  */
+  YYSYMBOL_body = 46,                      /* body  */
+  YYSYMBOL_bline = 47                      /* bline  */
 };
+typedef enum yysymbol_kind_t yysymbol_kind_t;
 
-typedef union HYPNO_ARC_STYPE HYPNO_ARC_STYPE;
-# define HYPNO_ARC_STYPE_IS_TRIVIAL 1
-# define HYPNO_ARC_STYPE_IS_DECLARED 1
-#endif
 
 
-extern HYPNO_ARC_STYPE HYPNO_ARC_lval;
 
-int HYPNO_ARC_parse (void);
+#ifdef short
+# undef short
+#endif
 
-#endif /* !YY_HYPNO_ARC_ENGINES_HYPNO_TOKENS_ARC_H_INCLUDED  */
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+   <limits.h> and (if available) <stdint.h> are included
+   so that the code can choose integer types of a good width.  */
 
-/* Copy the second part of user declarations.  */
+#ifndef __PTRDIFF_MAX__
+# include <limits.h> /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
+#  define YY_STDINT_H
+# endif
+#endif
 
-#line 211 "engines/hypno/grammar_arc.cpp" /* yacc.c:358  */
+/* Narrow types that promote to a signed type and that can represent a
+   signed or unsigned integer of at least N bits.  In tables they can
+   save space and decrease cache pressure.  Promoting to a signed type
+   helps avoid bugs in integer arithmetic.  */
 
-#ifdef short
-# undef short
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
+#else
+typedef signed char yytype_int8;
 #endif
 
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
 #else
-typedef unsigned char yytype_uint8;
+typedef short yytype_int16;
 #endif
 
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#else
-typedef signed char yytype_int8;
+/* 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
 
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#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 \
+       && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
 #else
-typedef unsigned short int yytype_uint16;
+typedef short yytype_uint8;
 #endif
 
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+       && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
 #else
-typedef short int yytype_int16;
+typedef int yytype_uint16;
+#endif
+
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+#  define YYPTRDIFF_T __PTRDIFF_TYPE__
+#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+#  ifndef ptrdiff_t
+#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  endif
+#  define YYPTRDIFF_T ptrdiff_t
+#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+#  define YYPTRDIFF_T long
+#  define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
 #endif
 
 #ifndef YYSIZE_T
@@ -242,15 +275,28 @@ typedef short int yytype_int16;
 #  define YYSIZE_T __SIZE_TYPE__
 # elif defined size_t
 #  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 #  define YYSIZE_T size_t
 # else
-#  define YYSIZE_T unsigned int
+#  define YYSIZE_T unsigned
 # endif
 #endif
 
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+#define YYSIZE_MAXIMUM                                  \
+  YY_CAST (YYPTRDIFF_T,                                 \
+           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
+            ? YYPTRDIFF_MAXIMUM                         \
+            : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
+
+
+/* Stored state numbers (used for stacks). */
+typedef yytype_uint8 yy_state_t;
+
+/* State numbers in computations.  */
+typedef int yy_state_fast_t;
 
 #ifndef YY_
 # if defined YYENABLE_NLS && YYENABLE_NLS
@@ -264,47 +310,43 @@ typedef short int yytype_int16;
 # endif
 #endif
 
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__                                               \
-      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
-     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-# else
-#  define YY_ATTRIBUTE(Spec) /* empty */
-# endif
-#endif
 
 #ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define YY_ATTRIBUTE_PURE
+# endif
 #endif
 
 #ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
-     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-#  define _Noreturn __declspec (noreturn)
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
 # else
-#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+#  define YY_ATTRIBUTE_UNUSED
 # endif
 #endif
 
 /* 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__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
-    _Pragma ("GCC diagnostic push") \
-    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+#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\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+# endif
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
     _Pragma ("GCC diagnostic pop")
 #else
 # define YY_INITIAL_VALUE(Value) Value
@@ -317,8 +359,22 @@ typedef short int yytype_int16;
 # define YY_INITIAL_VALUE(Value) /* Nothing. */
 #endif
 
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN                          \
+    _Pragma ("GCC diagnostic push")                            \
+    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END            \
+    _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
 
-#if ! defined yyoverflow || YYERROR_VERBOSE
+
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
+#if !defined yyoverflow
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
 
@@ -383,8 +439,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 # endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
+#endif /* !defined yyoverflow */
 
 #if (! defined yyoverflow \
      && (! defined __cplusplus \
@@ -393,17 +448,17 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  yytype_int16 yyss_alloc;
+  yy_state_t yyss_alloc;
   YYSTYPE yyvs_alloc;
 };
 
 /* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
 
 /* The size of an array large to enough to hold all stacks, each with
    N elements.  */
 # define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
       + YYSTACK_GAP_MAXIMUM)
 
 # define YYCOPY_NEEDED 1
@@ -416,11 +471,11 @@ union yyalloc
 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
     do                                                                  \
       {                                                                 \
-        YYSIZE_T yynewbytes;                                            \
+        YYPTRDIFF_T yynewbytes;                                         \
         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
         Stack = &yyptr->Stack_alloc;                                    \
-        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-        yyptr += yynewbytes / sizeof (*yyptr);                          \
+        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
       }                                                                 \
     while (0)
 
@@ -432,12 +487,12 @@ union yyalloc
 # ifndef YYCOPY
 #  if defined __GNUC__ && 1 < __GNUC__
 #   define YYCOPY(Dst, Src, Count) \
-      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
 #  else
 #   define YYCOPY(Dst, Src, Count)              \
       do                                        \
         {                                       \
-          YYSIZE_T yyi;                         \
+          YYPTRDIFF_T yyi;                      \
           for (yyi = 0; yyi < (Count); yyi++)   \
             (Dst)[yyi] = (Src)[yyi];            \
         }                                       \
@@ -460,17 +515,20 @@ union yyalloc
 /* YYNSTATES -- Number of states.  */
 #define YYNSTATES  134
 
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
-   by yylex, with out-of-bounds checking.  */
-#define YYUNDEFTOK  2
+/* YYMAXUTOK -- Last valid token kind.  */
 #define YYMAXUTOK   294
 
-#define YYTRANSLATE(YYX)                                                \
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, with out-of-bounds checking.  */
+#define YYTRANSLATE(YYX)                                \
+  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
+   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
+   : YYSYMBOL_YYUNDEF)
 
 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, without out-of-bounds checking.  */
-static const yytype_uint8 yytranslate[] =
+   as returned by yylex.  */
+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,
@@ -505,57 +563,59 @@ static const yytype_uint8 yytranslate[] =
 };
 
 #if HYPNO_ARC_DEBUG
-  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
-static const yytype_uint16 yyrline[] =
+/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
+static const yytype_int16 yyrline[] =
 {
-       0,    76,    76,    76,    77,    80,    81,    82,    85,    88,
-      89,    90,    91,    92,    93,    94,    95,   100,   105,   106,
-     110,   111,   115,   116,   130,   142,   143,   144,   149,   150,
-     153,   154,   155,   158,   163,   168,   173,   177,   181,   185,
-     189,   193,   197,   201,   205,   209,   213,   217,   221,   225,
-     229,   233,   237,   240,   244,   245,   246,   247,   252,   253,
-     256,   257,   260,   263,   267,   274,   275
+       0,    75,    75,    75,    76,    79,    80,    81,    84,    87,
+      88,    89,    90,    91,    92,    93,    94,    99,   104,   105,
+     109,   112,   116,   117,   131,   143,   144,   145,   150,   151,
+     154,   155,   156,   159,   164,   169,   174,   178,   182,   186,
+     190,   194,   198,   202,   206,   210,   214,   218,   222,   226,
+     230,   234,   238,   241,   245,   246,   247,   248,   253,   257,
+     260,   261,   264,   267,   271,   278,   279
 };
 #endif
 
-#if HYPNO_ARC_DEBUG || YYERROR_VERBOSE || 0
+/** Accessing symbol of state STATE.  */
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
+
+#if HYPNO_ARC_DEBUG || 0
+/* The user-facing name of the symbol whose (internal) number is
+   YYSYMBOL.  No bounds checking.  */
+static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
+
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
-  "$end", "error", "$undefined", "NAME", "FILENAME", "BNTOK", "SNTOK",
-  "KNTOK", "YXTOK", "NUM", "COMMENT", "CTOK", "DTOK", "HTOK", "HETOK",
-  "RETTOK", "QTOK", "ENCTOK", "PTOK", "FTOK", "TTOK", "TPTOK", "ATOK",
-  "VTOK", "OTOK", "ONTOK", "NTOK", "RTOK", "R0TOK", "ITOK", "JTOK", "ZTOK",
-  "FNTOK", "NONETOK", "A0TOK", "P0TOK", "WTOK", "XTOK", "CB3TOK", "C02TOK",
-  "$accept", "start", "$@1", "header", "hline", "enc", "body", "bline", YY_NULLPTR
+  "\"end of file\"", "error", "\"invalid token\"", "NAME", "FILENAME",
+  "BNTOK", "SNTOK", "KNTOK", "YXTOK", "NUM", "COMMENT", "CTOK", "DTOK",
+  "HTOK", "HETOK", "RETTOK", "QTOK", "ENCTOK", "PTOK", "FTOK", "TTOK",
+  "TPTOK", "ATOK", "VTOK", "OTOK", "ONTOK", "NTOK", "RTOK", "R0TOK",
+  "ITOK", "JTOK", "ZTOK", "FNTOK", "NONETOK", "A0TOK", "P0TOK", "WTOK",
+  "XTOK", "CB3TOK", "C02TOK", "$accept", "start", "$@1", "header", "hline",
+  "enc", "body", "bline", YY_NULLPTR
 };
-#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_uint16 yytoknum[] =
+static const char *
+yysymbol_name (yysymbol_kind_t yysymbol)
 {
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294
-};
-# endif
+  return yytname[yysymbol];
+}
+#endif
 
-#define YYPACT_NINF -37
+#define YYPACT_NINF (-37)
 
-#define yypact_value_is_default(Yystate) \
-  (!!((Yystate) == (-37)))
+#define yypact_value_is_default(Yyn) \
+  ((Yyn) == YYPACT_NINF)
 
-#define YYTABLE_NINF -1
+#define YYTABLE_NINF (-1)
 
-#define yytable_value_is_error(Yytable_value) \
+#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[] =
 {
       -3,   -37,    -3,     9,    57,   -37,   -37,     7,    13,     4,
@@ -574,10 +634,10 @@ static const yytype_int8 yypact[] =
      -37,   -37,   -37,   -37
 };
 
-  /* 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_uint8 yydefact[] =
+/* 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,     2,     0,     0,     7,     4,     1,     0,     0,     0,
        0,     0,     0,     7,     0,     0,     0,     0,     0,     0,
@@ -595,21 +655,21 @@ static const yytype_uint8 yydefact[] =
       54,    55,    53,    58
 };
 
-  /* YYPGOTO[NTERM-NUM].  */
+/* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
      -37,   122,   -37,    25,   -37,    33,   -36,   -37
 };
 
-  /* YYDEFGOTO[NTERM-NUM].  */
+/* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int8 yydefgoto[] =
 {
-      -1,     3,     4,    26,    27,    52,    89,    90
+       0,     3,     4,    26,    27,    52,    89,    90
 };
 
-  /* 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_uint8 yytable[] =
 {
       70,    71,    72,    39,   119,     1,    73,    74,    75,     6,
@@ -627,7 +687,7 @@ static const yytype_uint8 yytable[] =
      130,   131,   132,   133,     5,   127
 };
 
-static const yytype_uint8 yycheck[] =
+static const yytype_int8 yycheck[] =
 {
        5,     6,     7,     4,     4,     8,    11,    12,    13,     0,
       15,     4,    15,     9,    19,    38,    39,     4,    38,    24,
@@ -644,9 +704,9 @@ static const yytype_uint8 yycheck[] =
        9,     9,     9,     9,     2,    92
 };
 
-  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-     symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] =
+/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
+   state STATE-NUM.  */
+static const yytype_int8 yystos[] =
 {
        0,     8,    15,    41,    42,    41,     0,     5,     6,    11,
       12,    13,    14,    15,    16,    18,    19,    20,    21,    22,
@@ -664,8 +724,8 @@ static const yytype_uint8 yystos[] =
        9,     9,     9,     9
 };
 
-  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
+/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
+static const yytype_int8 yyr1[] =
 {
        0,    40,    42,    41,    41,    43,    43,    43,    44,    44,
       44,    44,    44,    44,    44,    44,    44,    44,    44,    44,
@@ -676,8 +736,8 @@ static const yytype_uint8 yyr1[] =
       47,    47,    47,    47,    47,    47,    47
 };
 
-  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
+/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
+static const yytype_int8 yyr2[] =
 {
        0,     2,     0,     7,     2,     2,     2,     0,     2,     2,
        2,     3,     3,     3,     3,     3,     4,     3,     3,     2,
@@ -689,39 +749,39 @@ static const yytype_uint8 yyr2[] =
 };
 
 
+enum { YYENOMEM = -2 };
+
 #define yyerrok         (yyerrstatus = 0)
-#define yyclearin       (yychar = YYEMPTY)
-#define YYEMPTY         (-2)
-#define YYEOF           0
+#define yyclearin       (yychar = HYPNO_ARC_EMPTY)
 
 #define YYACCEPT        goto yyacceptlab
 #define YYABORT         goto yyabortlab
 #define YYERROR         goto yyerrorlab
+#define YYNOMEM         goto yyexhaustedlab
 
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
-#define YYBACKUP(Token, Value)                                  \
-do                                                              \
-  if (yychar == YYEMPTY)                                        \
-    {                                                           \
-      yychar = (Token);                                         \
-      yylval = (Value);                                         \
-      YYPOPSTACK (yylen);                                       \
-      yystate = *yyssp;                                         \
-      goto yybackup;                                            \
-    }                                                           \
-  else                                                          \
-    {                                                           \
-      yyerror (YY_("syntax error: cannot back up")); \
-      YYERROR;                                                  \
-    }                                                           \
-while (0)
-
-/* Error token number */
-#define YYTERROR        1
-#define YYERRCODE       256
-
+#define YYBACKUP(Token, Value)                                    \
+  do                                                              \
+    if (yychar == HYPNO_ARC_EMPTY)                                        \
+      {                                                           \
+        yychar = (Token);                                         \
+        yylval = (Value);                                         \
+        YYPOPSTACK (yylen);                                       \
+        yystate = *yyssp;                                         \
+        goto yybackup;                                            \
+      }                                                           \
+    else                                                          \
+      {                                                           \
+        yyerror (YY_("syntax error: cannot back up")); \
+        YYERROR;                                                  \
+      }                                                           \
+  while (0)
+
+/* Backward compatibility with an undocumented macro.
+   Use HYPNO_ARC_error or HYPNO_ARC_UNDEF. */
+#define YYERRCODE HYPNO_ARC_UNDEF
 
 
 /* Enable debugging if requested.  */
@@ -738,55 +798,52 @@ 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, Type, Value, Location)                    \
+
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
 do {                                                                      \
   if (yydebug)                                                            \
     {                                                                     \
       YYFPRINTF (stderr, "%s ", Title);                                   \
       yy_symbol_print (stderr,                                            \
-                  Type, Value); \
+                  Kind, Value); \
       YYFPRINTF (stderr, "\n");                                           \
     }                                                                     \
 } while (0)
 
 
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT.  |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO.  |
+`-----------------------------------*/
 
 static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_value_print (FILE *yyo,
+                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
 {
-  FILE *yyo = yyoutput;
-  YYUSE (yyo);
+  FILE *yyoutput = yyo;
+  YY_USE (yyoutput);
   if (!yyvaluep)
     return;
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
-  YYUSE (yytype);
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+  YY_USE (yykind);
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO.  |
+`---------------------------*/
 
 static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_print (FILE *yyo,
+                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
 {
-  YYFPRINTF (yyoutput, "%s %s (",
-             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+  YYFPRINTF (yyo, "%s %s (",
+             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
 
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
-  YYFPRINTF (yyoutput, ")");
+  yy_symbol_value_print (yyo, yykind, yyvaluep);
+  YYFPRINTF (yyo, ")");
 }
 
 /*------------------------------------------------------------------.
@@ -795,7 +852,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 `------------------------------------------------------------------*/
 
 static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
 {
   YYFPRINTF (stderr, "Stack now");
   for (; yybottom <= yytop; yybottom++)
@@ -818,21 +875,21 @@ do {                                                            \
 `------------------------------------------------*/
 
 static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
+                 int yyrule)
 {
-  unsigned long int yylno = yyrline[yyrule];
+  int yylno = yyrline[yyrule];
   int yynrhs = yyr2[yyrule];
   int yyi;
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
              yyrule - 1, yylno);
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr,
-                       yystos[yyssp[yyi + 1 - yynrhs]],
-                       &(yyvsp[(yyi + 1) - (yynrhs)])
-                                              );
+                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
+                       &yyvsp[(yyi + 1) - (yynrhs)]);
       YYFPRINTF (stderr, "\n");
     }
 }
@@ -847,8 +904,8 @@ do {                                    \
    multiple parsers can coexist.  */
 int yydebug;
 #else /* !HYPNO_ARC_DEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YYDPRINTF(Args) ((void) 0)
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
 # define YY_STACK_PRINT(Bottom, Top)
 # define YY_REDUCE_PRINT(Rule)
 #endif /* !HYPNO_ARC_DEBUG */
@@ -871,249 +928,30 @@ int yydebug;
 #endif
 
 
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined __GLIBC__ && defined _STRING_H
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-static YYSIZE_T
-yystrlen (const char *yystr)
-{
-  YYSIZE_T yylen;
-  for (yylen = 0; yystr[yylen]; yylen++)
-    continue;
-  return yylen;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-{
-  char *yyd = yydest;
-  const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
 
-  return yyd - 1;
-}
-#  endif
-# endif
 
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
-  if (*yystr == '"')
-    {
-      YYSIZE_T yyn = 0;
-      char const *yyp = yystr;
-
-      for (;;)
-        switch (*++yyp)
-          {
-          case '\'':
-          case ',':
-            goto do_not_strip_quotes;
-
-          case '\\':
-            if (*++yyp != '\\')
-              goto do_not_strip_quotes;
-            /* Fall through.  */
-          default:
-            if (yyres)
-              yyres[yyn] = *yyp;
-            yyn++;
-            break;
-
-          case '"':
-            if (yyres)
-              yyres[yyn] = '\0';
-            return yyn;
-          }
-    do_not_strip_quotes: ;
-    }
 
-  if (! yyres)
-    return yystrlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
-   about the unexpected token YYTOKEN for the state stack whose top is
-   YYSSP.
-
-   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
-   not large enough to hold the message.  In that case, also set
-   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
-   required number of bytes is too large to store.  */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
-                yytype_int16 *yyssp, int yytoken)
-{
-  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
-  YYSIZE_T yysize = yysize0;
-  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-  /* Internationalized format string. */
-  const char *yyformat = YY_NULLPTR;
-  /* Arguments of yyformat. */
-  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-  /* Number of reported tokens (one for the "unexpected", one per
-     "expected"). */
-  int yycount = 0;
-
-  /* There are many possibilities here to consider:
-     - If this state is a consistent state with a default action, then
-       the only way this function was invoked is if the default action
-       is an error action.  In that case, don't check for expected
-       tokens because there are none.
-     - The only way there can be no lookahead present (in yychar) is if
-       this state is a consistent state with a default action.  Thus,
-       detecting the absence of a lookahead is sufficient to determine
-       that there is no unexpected or expected token to report.  In that
-       case, just report a simple "syntax error".
-     - Don't assume there isn't a lookahead just because this state is a
-       consistent state with a default action.  There might have been a
-       previous inconsistent state, consistent state with a non-default
-       action, or user semantic action that manipulated yychar.
-     - Of course, the expected token list depends on states to have
-       correct lookahead information, and it depends on the parser not
-       to perform extra reductions after fetching a lookahead from the
-       scanner and before detecting a syntax error.  Thus, state merging
-       (from LALR or IELR) and default reductions corrupt the expected
-       token list.  However, the list is correct for canonical LR with
-       one exception: it will still contain any token that will not be
-       accepted due to an error action in a later state.
-  */
-  if (yytoken != YYEMPTY)
-    {
-      int yyn = yypact[*yyssp];
-      yyarg[yycount++] = yytname[yytoken];
-      if (!yypact_value_is_default (yyn))
-        {
-          /* Start YYX at -YYN if negative to avoid negative indexes in
-             YYCHECK.  In other words, skip the first -YYN actions for
-             this state because they are default actions.  */
-          int yyxbegin = yyn < 0 ? -yyn : 0;
-          /* Stay within bounds of both yycheck and yytname.  */
-          int yychecklim = YYLAST - yyn + 1;
-          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-          int yyx;
-
-          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
-                && !yytable_value_is_error (yytable[yyx + yyn]))
-              {
-                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                  {
-                    yycount = 1;
-                    yysize = yysize0;
-                    break;
-                  }
-                yyarg[yycount++] = yytname[yyx];
-                {
-                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
-                  if (! (yysize <= yysize1
-                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                    return 2;
-                  yysize = yysize1;
-                }
-              }
-        }
-    }
-
-  switch (yycount)
-    {
-# define YYCASE_(N, S)                      \
-      case N:                               \
-        yyformat = S;                       \
-      break
-      YYCASE_(0, YY_("syntax error"));
-      YYCASE_(1, YY_("syntax error, unexpected %s"));
-      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
-      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
-      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
-      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
-    }
-
-  {
-    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
-    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-      return 2;
-    yysize = yysize1;
-  }
-
-  if (*yymsg_alloc < yysize)
-    {
-      *yymsg_alloc = 2 * yysize;
-      if (! (yysize <= *yymsg_alloc
-             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
-        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
-      return 1;
-    }
-
-  /* Avoid sprintf, as that infringes on the user's name space.
-     Don't have undefined behavior even if the translation
-     produced a string with the wrong number of "%s"s.  */
-  {
-    char *yyp = *yymsg;
-    int yyi = 0;
-    while ((*yyp = *yyformat) != '\0')
-      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
-        {
-          yyp += yytnamerr (yyp, yyarg[yyi++]);
-          yyformat += 2;
-        }
-      else
-        {
-          yyp++;
-          yyformat++;
-        }
-  }
-  return 0;
-}
-#endif /* YYERROR_VERBOSE */
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
 static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg,
+            yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
 {
-  YYUSE (yyvaluep);
+  YY_USE (yyvaluep);
   if (!yymsg)
     yymsg = "Deleting";
-  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
 
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  YYUSE (yytype);
+  YY_USE (yykind);
   YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
-
-
-/* The lookahead symbol.  */
+/* Lookahead token kind.  */
 int yychar;
 
 /* The semantic value of the lookahead symbol.  */
@@ -1122,6 +960,8 @@ YYSTYPE yylval;
 int yynerrs;
 
 
+
+
 /*----------.
 | yyparse.  |
 `----------*/
@@ -1129,43 +969,36 @@ int yynerrs;
 int
 yyparse (void)
 {
-    int yystate;
+    yy_state_fast_t yystate = 0;
     /* Number of tokens to shift before error messages enabled.  */
-    int yyerrstatus;
+    int yyerrstatus = 0;
 
-    /* The stacks and their tools:
-       'yyss': related to states.
-       'yyvs': related to semantic values.
-
-       Refer to the stacks through separate pointers, to allow yyoverflow
+    /* Refer to the stacks through separate pointers, to allow yyoverflow
        to reallocate them elsewhere.  */
 
-    /* The state stack.  */
-    yytype_int16 yyssa[YYINITDEPTH];
-    yytype_int16 *yyss;
-    yytype_int16 *yyssp;
+    /* Their size.  */
+    YYPTRDIFF_T yystacksize = YYINITDEPTH;
 
-    /* The semantic value stack.  */
-    YYSTYPE yyvsa[YYINITDEPTH];
-    YYSTYPE *yyvs;
-    YYSTYPE *yyvsp;
+    /* The state stack: array, bottom, top.  */
+    yy_state_t yyssa[YYINITDEPTH];
+    yy_state_t *yyss = yyssa;
+    yy_state_t *yyssp = yyss;
 
-    YYSIZE_T yystacksize;
+    /* The semantic value stack: array, bottom, top.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs = yyvsa;
+    YYSTYPE *yyvsp = yyvs;
 
   int yyn;
+  /* The return value of yyparse.  */
   int yyresult;
-  /* Lookahead token as an internal (translated) token number.  */
-  int yytoken = 0;
+  /* Lookahead symbol kind.  */
+  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
   /* The variables used to return semantic value and location from the
      action routines.  */
   YYSTYPE yyval;
 
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
+
 
 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
@@ -1173,71 +1006,75 @@ yyparse (void)
      Keep to zero when no symbol should be popped.  */
   int yylen = 0;
 
-  yyssp = yyss = yyssa;
-  yyvsp = yyvs = yyvsa;
-  yystacksize = YYINITDEPTH;
-
   YYDPRINTF ((stderr, "Starting parse\n"));
 
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY; /* Cause a token to be read.  */
+  yychar = HYPNO_ARC_EMPTY; /* Cause a token to be read.  */
+
   goto yysetstate;
 
+
 /*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
+| yynewstate -- push a new state, which is found in yystate.  |
 `------------------------------------------------------------*/
- yynewstate:
+yynewstate:
   /* In all cases, when you get here, the value and location stacks
      have just been pushed.  So pushing a state here evens the stacks.  */
   yyssp++;
 
- yysetstate:
-  *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yysetstate -- set current state (the top of the stack) to yystate.  |
+`--------------------------------------------------------------------*/
+yysetstate:
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+  YY_IGNORE_USELESS_CAST_BEGIN
+  *yyssp = YY_CAST (yy_state_t, yystate);
+  YY_IGNORE_USELESS_CAST_END
+  YY_STACK_PRINT (yyss, yyssp);
 
   if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+    YYNOMEM;
+#else
     {
       /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
+      YYPTRDIFF_T yysize = yyssp - yyss + 1;
 
-#ifdef yyoverflow
+# if defined yyoverflow
       {
         /* Give user a chance to reallocate the stack.  Use copies of
            these so that the &'s don't force the real ones into
            memory.  */
+        yy_state_t *yyss1 = yyss;
         YYSTYPE *yyvs1 = yyvs;
-        yytype_int16 *yyss1 = yyss;
 
         /* Each stack pointer address is followed by the size of the
            data in use in that stack, in bytes.  This used to be a
            conditional around just the two extra args, but that might
            be undefined if yyoverflow is a macro.  */
         yyoverflow (YY_("memory exhausted"),
-                    &yyss1, yysize * sizeof (*yyssp),
-                    &yyvs1, yysize * sizeof (*yyvsp),
+                    &yyss1, yysize * YYSIZEOF (*yyssp),
+                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
                     &yystacksize);
-
         yyss = yyss1;
         yyvs = yyvs1;
       }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-        goto yyexhaustedlab;
+        YYNOMEM;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
         yystacksize = YYMAXDEPTH;
 
       {
-        yytype_int16 *yyss1 = yyss;
+        yy_state_t *yyss1 = yyss;
         union yyalloc *yyptr =
-          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+          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
@@ -1245,30 +1082,31 @@ yyparse (void)
           YYSTACK_FREE (yyss1);
       }
 # endif
-#endif /* no yyoverflow */
 
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
 
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-                  (unsigned long int) yystacksize));
+      YY_IGNORE_USELESS_CAST_BEGIN
+      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+                  YY_CAST (long, yystacksize)));
+      YY_IGNORE_USELESS_CAST_END
 
       if (yyss + yystacksize - 1 <= yyssp)
         YYABORT;
     }
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
   if (yystate == YYFINAL)
     YYACCEPT;
 
   goto yybackup;
 
+
 /*-----------.
 | yybackup.  |
 `-----------*/
 yybackup:
-
   /* Do appropriate processing given the current state.  Read a
      lookahead token if we need one and don't already have one.  */
 
@@ -1279,18 +1117,29 @@ yybackup:
 
   /* Not known => get a lookahead token if don't already have one.  */
 
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-  if (yychar == YYEMPTY)
+  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
+  if (yychar == HYPNO_ARC_EMPTY)
     {
-      YYDPRINTF ((stderr, "Reading a token: "));
+      YYDPRINTF ((stderr, "Reading a token\n"));
       yychar = yylex ();
     }
 
-  if (yychar <= YYEOF)
+  if (yychar <= HYPNO_ARC_EOF)
     {
-      yychar = yytoken = YYEOF;
+      yychar = HYPNO_ARC_EOF;
+      yytoken = YYSYMBOL_YYEOF;
       YYDPRINTF ((stderr, "Now at end of input.\n"));
     }
+  else if (yychar == HYPNO_ARC_error)
+    {
+      /* The scanner already issued an error message, process directly
+         to error recovery.  But do not keep the error token as
+         lookahead, it is too special and may lead us to an endless
+         loop in error recovery. */
+      yychar = HYPNO_ARC_UNDEF;
+      yytoken = YYSYMBOL_YYerror;
+      goto yyerrlab1;
+    }
   else
     {
       yytoken = YYTRANSLATE (yychar);
@@ -1318,15 +1167,13 @@ yybackup:
 
   /* Shift the lookahead token.  */
   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the shifted token.  */
-  yychar = YYEMPTY;
-
   yystate = yyn;
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
   YY_IGNORE_MAYBE_UNINITIALIZED_END
 
+  /* Discard the shifted token.  */
+  yychar = HYPNO_ARC_EMPTY;
   goto yynewstate;
 
 
@@ -1341,7 +1188,7 @@ yydefault:
 
 
 /*-----------------------------.
-| yyreduce -- Do a reduction.  |
+| yyreduce -- do a reduction.  |
 `-----------------------------*/
 yyreduce:
   /* yyn is the number of a rule to reduce with.  */
@@ -1361,121 +1208,123 @@ yyreduce:
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 2:
-#line 76 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { g_parsedArc->mode = (yyvsp[0].s); }
-#line 1368 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 2: /* $@1: %empty  */
+#line 75 "engines/hypno/grammar_arc.y"
+             { g_parsedArc->mode = (yyvsp[0].s); }
+#line 1215 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 8:
-#line 85 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 8: /* hline: CTOK NUM  */
+#line 84 "engines/hypno/grammar_arc.y"
+                 {
 		g_parsedArc->id = (yyvsp[0].i); 
 		debugC(1, kHypnoDebugParser, "C %d", (yyvsp[0].i)); }
-#line 1376 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1223 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 9:
-#line 88 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "F %d", (yyvsp[0].i)); }
-#line 1382 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 9: /* hline: FTOK NUM  */
+#line 87 "engines/hypno/grammar_arc.y"
+                   { debugC(1, kHypnoDebugParser, "F %d", (yyvsp[0].i)); }
+#line 1229 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 10:
-#line 89 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "D %d", (yyvsp[0].i)); }
-#line 1388 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 10: /* hline: DTOK NUM  */
+#line 88 "engines/hypno/grammar_arc.y"
+                    { debugC(1, kHypnoDebugParser, "D %d", (yyvsp[0].i)); }
+#line 1235 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 11:
-#line 90 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "P %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1394 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 11: /* hline: PTOK NUM NUM  */
+#line 89 "engines/hypno/grammar_arc.y"
+                       { debugC(1, kHypnoDebugParser, "P %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1241 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 12:
-#line 91 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "A %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1400 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 12: /* hline: ATOK NUM NUM  */
+#line 90 "engines/hypno/grammar_arc.y"
+                       { debugC(1, kHypnoDebugParser, "A %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1247 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 13:
-#line 92 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "V %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1406 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 13: /* hline: VTOK NUM NUM  */
+#line 91 "engines/hypno/grammar_arc.y"
+                       { debugC(1, kHypnoDebugParser, "V %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1253 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 14:
-#line 93 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "O %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1412 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 14: /* hline: OTOK NUM NUM  */
+#line 92 "engines/hypno/grammar_arc.y"
+                       { debugC(1, kHypnoDebugParser, "O %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1259 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 15:
-#line 94 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "ON %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1418 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 15: /* hline: ONTOK NUM NUM  */
+#line 93 "engines/hypno/grammar_arc.y"
+                        { debugC(1, kHypnoDebugParser, "ON %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1265 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 16:
-#line 95 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 16: /* hline: TPTOK FILENAME NUM FILENAME  */
+#line 94 "engines/hypno/grammar_arc.y"
+                                      {
 		g_parsedArc->transitionVideo = (yyvsp[-2].s);
 		g_parsedArc->transitionTime = (yyvsp[-1].i);
 		debugC(1, kHypnoDebugParser, "Tp %s %d %s", (yyvsp[-2].s), (yyvsp[-1].i), (yyvsp[0].s)); 
 	}
-#line 1428 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1275 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 17:
-#line 100 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 17: /* hline: TTOK FILENAME NUM  */
+#line 99 "engines/hypno/grammar_arc.y"
+                            { 
 		g_parsedArc->transitionVideo = (yyvsp[-1].s);
 		g_parsedArc->transitionTime = (yyvsp[0].i);
 		debugC(1, kHypnoDebugParser, "T %s %d", (yyvsp[-1].s), (yyvsp[0].i)); 
 	}
-#line 1438 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1285 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 18:
-#line 105 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "T NONE %d", (yyvsp[0].i)); }
-#line 1444 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 18: /* hline: TTOK NONETOK NUM  */
+#line 104 "engines/hypno/grammar_arc.y"
+                           { debugC(1, kHypnoDebugParser, "T NONE %d", (yyvsp[0].i)); }
+#line 1291 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 19:
-#line 106 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 19: /* hline: NTOK FILENAME  */
+#line 105 "engines/hypno/grammar_arc.y"
+                         { 
 		g_parsedArc->background = (yyvsp[0].s); 
 		debugC(1, kHypnoDebugParser, "N %s", (yyvsp[0].s)); 
 	}
-#line 1453 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1300 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 20:
-#line 110 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "R %s", (yyvsp[0].s)); }
-#line 1459 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 20: /* hline: RTOK FILENAME  */
+#line 109 "engines/hypno/grammar_arc.y"
+                         {
+		g_parsedArc->palette = (yyvsp[0].s); 
+		debugC(1, kHypnoDebugParser, "R %s", (yyvsp[0].s)); }
+#line 1308 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 21:
-#line 111 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 21: /* hline: ITOK FILENAME  */
+#line 112 "engines/hypno/grammar_arc.y"
+                        { 
 		g_parsedArc->player = (yyvsp[0].s); 
 		debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s)); 
 		}
-#line 1468 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1317 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 22:
-#line 115 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "Q %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1474 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 22: /* hline: QTOK NUM NUM  */
+#line 116 "engines/hypno/grammar_arc.y"
+                       { debugC(1, kHypnoDebugParser, "Q %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1323 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 23:
-#line 116 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 23: /* hline: BNTOK FILENAME  */
+#line 117 "engines/hypno/grammar_arc.y"
+                         {
 		if (Common::String("B0") == (yyvsp[-1].s))
 			g_parsedArc->intros.push_back((yyvsp[0].s));
 		//else if (Common::String("B1") == $1) 
@@ -1489,12 +1338,12 @@ yyreduce:
 
 		debugC(1, kHypnoDebugParser, "BN %s", (yyvsp[0].s)); 
 	}
-#line 1493 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1342 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 24:
-#line 130 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 24: /* hline: SNTOK FILENAME enc  */
+#line 131 "engines/hypno/grammar_arc.y"
+                             {
 		if (Common::String("S0") == (yyvsp[-2].s))
 			g_parsedArc->music = (yyvsp[-1].s);
 		else if (Common::String("S1") == (yyvsp[-2].s))
@@ -1506,324 +1355,328 @@ yyreduce:
 
 		debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s)); 
 	}
-#line 1510 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1359 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 25:
-#line 142 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "HE %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1516 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 25: /* hline: HETOK C02TOK NUM NUM  */
+#line 143 "engines/hypno/grammar_arc.y"
+                               { debugC(1, kHypnoDebugParser, "HE %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1365 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 26:
-#line 143 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "HE %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1522 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 26: /* hline: HETOK CB3TOK NUM NUM  */
+#line 144 "engines/hypno/grammar_arc.y"
+                               { debugC(1, kHypnoDebugParser, "HE %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1371 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 27:
-#line 144 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 27: /* hline: HTOK CB3TOK NUM NUM  */
+#line 145 "engines/hypno/grammar_arc.y"
+                              {
 		debugC(1, kHypnoDebugParser, "H %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
 	}
-#line 1530 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1379 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 33:
-#line 158 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 33: /* bline: FNTOK FILENAME  */
+#line 159 "engines/hypno/grammar_arc.y"
+                      { 
 		shoot = new Shoot();
 		shoot->animation = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "FN %s", (yyvsp[0].s)); 
 	}
-#line 1540 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1389 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 34:
-#line 163 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 34: /* bline: FNTOK NONETOK  */
+#line 164 "engines/hypno/grammar_arc.y"
+                        { 
 		shoot = new Shoot();
 		shoot->animation = "NONE";
 		debugC(1, kHypnoDebugParser, "FN NONE"); 
 	}
-#line 1550 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1399 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 35:
-#line 168 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 35: /* bline: FTOK FILENAME  */
+#line 169 "engines/hypno/grammar_arc.y"
+                        { 
 		shoot = new Shoot();
 		shoot->animation = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "FN %s", (yyvsp[0].s)); 
 	}
-#line 1560 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1409 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 36:
-#line 173 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 36: /* bline: ITOK NAME  */
+#line 174 "engines/hypno/grammar_arc.y"
+                     { 
 		shoot->name = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s)); 
 	}
-#line 1569 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1418 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 37:
-#line 177 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {  // Workaround for NAME == B1
+  case 37: /* bline: ITOK BNTOK  */
+#line 178 "engines/hypno/grammar_arc.y"
+                      {  // Workaround for NAME == B1
 		shoot->name = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s)); 
 	}
-#line 1578 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1427 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 38:
-#line 181 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == A
+  case 38: /* bline: ITOK ATOK  */
+#line 182 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == A
 		shoot->name = "A";
 		debugC(1, kHypnoDebugParser, "I A"); 
 	}
-#line 1587 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1436 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 39:
-#line 185 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == C
+  case 39: /* bline: ITOK CTOK  */
+#line 186 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == C
 		shoot->name = "C";
 		debugC(1, kHypnoDebugParser, "I C"); 
 	}
-#line 1596 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1445 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 40:
-#line 189 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == D
+  case 40: /* bline: ITOK DTOK  */
+#line 190 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == D
 		shoot->name = "D";
 		debugC(1, kHypnoDebugParser, "I D"); 
 	}
-#line 1605 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1454 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 41:
-#line 193 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == F
+  case 41: /* bline: ITOK FTOK  */
+#line 194 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == F
 		shoot->name = "F";
 		debugC(1, kHypnoDebugParser, "I F"); 
 	}
-#line 1614 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1463 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 42:
-#line 197 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == H
+  case 42: /* bline: ITOK HTOK  */
+#line 198 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == H
 		shoot->name = "H";
 		debugC(1, kHypnoDebugParser, "I H"); 
 	}
-#line 1623 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1472 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 43:
-#line 201 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == I
+  case 43: /* bline: ITOK ITOK  */
+#line 202 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == I
 		shoot->name = "I";
 		debugC(1, kHypnoDebugParser, "I I"); 
 	}
-#line 1632 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1481 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 44:
-#line 205 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == I
+  case 44: /* bline: ITOK JTOK  */
+#line 206 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == I
 		shoot->name = "J";
 		debugC(1, kHypnoDebugParser, "I J"); 
 	}
-#line 1641 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1490 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 45:
-#line 209 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == N
+  case 45: /* bline: ITOK NTOK  */
+#line 210 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == N
 		shoot->name = "N";
 		debugC(1, kHypnoDebugParser, "I N"); 
 	}
-#line 1650 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1499 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 46:
-#line 213 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == O
+  case 46: /* bline: ITOK OTOK  */
+#line 214 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == O
 		shoot->name = "O";
 		debugC(1, kHypnoDebugParser, "I O"); 
 	}
-#line 1659 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1508 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 47:
-#line 217 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == P
+  case 47: /* bline: ITOK PTOK  */
+#line 218 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == P
 		shoot->name = "P";
 		debugC(1, kHypnoDebugParser, "I P"); 
 	}
-#line 1668 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1517 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 48:
-#line 221 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == Q
+  case 48: /* bline: ITOK QTOK  */
+#line 222 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == Q
 		shoot->name = "Q";
 		debugC(1, kHypnoDebugParser, "I Q"); 
 	}
-#line 1677 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1526 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 49:
-#line 225 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == R
+  case 49: /* bline: ITOK RTOK  */
+#line 226 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == R
 		shoot->name = "R";
 		debugC(1, kHypnoDebugParser, "I R"); 
 	}
-#line 1686 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1535 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 50:
-#line 229 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {  // Workaround for NAME == S1
+  case 50: /* bline: ITOK SNTOK  */
+#line 230 "engines/hypno/grammar_arc.y"
+                      {  // Workaround for NAME == S1
 		shoot->name = (yyvsp[0].s);
 		debugC(1, kHypnoDebugParser, "I %s", (yyvsp[0].s)); 
 	}
-#line 1695 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1544 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 51:
-#line 233 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { // Workaround for NAME == T
+  case 51: /* bline: ITOK TTOK  */
+#line 234 "engines/hypno/grammar_arc.y"
+                     { // Workaround for NAME == T
 		shoot->name = "T";
 		debugC(1, kHypnoDebugParser, "I T"); 
 	}
-#line 1704 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1553 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 52:
-#line 237 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 52: /* bline: JTOK NUM  */
+#line 238 "engines/hypno/grammar_arc.y"
+                    {
 		debugC(1, kHypnoDebugParser, "J %d", (yyvsp[0].i)); 
 	}
-#line 1712 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1561 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 53:
-#line 240 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 53: /* bline: A0TOK NUM NUM  */
+#line 241 "engines/hypno/grammar_arc.y"
+                        { 
 		shoot->position = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
 		debugC(1, kHypnoDebugParser, "A0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
 	}
-#line 1721 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1570 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 54:
-#line 244 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "R %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1727 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 54: /* bline: RTOK NUM NUM  */
+#line 245 "engines/hypno/grammar_arc.y"
+                        { debugC(1, kHypnoDebugParser, "R %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1576 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 55:
-#line 245 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "R0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1733 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 55: /* bline: R0TOK NUM NUM  */
+#line 246 "engines/hypno/grammar_arc.y"
+                         { debugC(1, kHypnoDebugParser, "R0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1582 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 56:
-#line 246 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "BN %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1739 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 56: /* bline: BNTOK NUM NUM  */
+#line 247 "engines/hypno/grammar_arc.y"
+                        { debugC(1, kHypnoDebugParser, "BN %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1588 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 57:
-#line 247 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 57: /* bline: KNTOK NUM NUM  */
+#line 248 "engines/hypno/grammar_arc.y"
+                        { 
 		//if (Common::String("K0") == $1)
 		shoot->explosionFrame = (yyvsp[0].i);
 		debugC(1, kHypnoDebugParser, "KN %d %d", (yyvsp[-1].i), (yyvsp[0].i));
 	}
-#line 1749 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1598 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 58:
-#line 252 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "P0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
-#line 1755 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 58: /* bline: P0TOK NUM NUM  */
+#line 253 "engines/hypno/grammar_arc.y"
+                        { 
+		shoot->paletteSize = (yyvsp[-1].i);
+		shoot->paletteOffset = (yyvsp[0].i);
+		debugC(1, kHypnoDebugParser, "P0 %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
+#line 1607 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 59:
-#line 253 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 59: /* bline: OTOK NUM NUM  */
+#line 257 "engines/hypno/grammar_arc.y"
+                       { 
 		debugC(1, kHypnoDebugParser, "O %d %d", (yyvsp[-1].i), (yyvsp[0].i)); 
 	}
-#line 1763 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1615 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 60:
-#line 256 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "C %d", (yyvsp[0].i)); }
-#line 1769 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 60: /* bline: CTOK NUM  */
+#line 260 "engines/hypno/grammar_arc.y"
+                    { debugC(1, kHypnoDebugParser, "C %d", (yyvsp[0].i)); }
+#line 1621 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 61:
-#line 257 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 61: /* bline: HTOK NUM  */
+#line 261 "engines/hypno/grammar_arc.y"
+                    {
 		shoot->attackFrame = (yyvsp[0].i); 
 		debugC(1, kHypnoDebugParser, "H %d", (yyvsp[0].i)); }
-#line 1777 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1629 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 62:
-#line 260 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 62: /* bline: WTOK NUM  */
+#line 264 "engines/hypno/grammar_arc.y"
+                    {
 		shoot->attackWeight = (yyvsp[0].i);  
 		debugC(1, kHypnoDebugParser, "W %d", (yyvsp[0].i)); }
-#line 1785 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1637 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 63:
-#line 263 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 63: /* bline: DTOK NUM  */
+#line 267 "engines/hypno/grammar_arc.y"
+                    {
 		shoot->pointsToShoot = (yyvsp[0].i);  
 		debugC(1, kHypnoDebugParser, "D %d", (yyvsp[0].i)); 
 	}
-#line 1794 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1646 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 64:
-#line 267 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { 
+  case 64: /* bline: SNTOK FILENAME enc  */
+#line 271 "engines/hypno/grammar_arc.y"
+                             { 
 		if (Common::String("S1") == (yyvsp[-2].s))
 			shoot->deathSound = (yyvsp[-1].s);
 		else if (Common::String("S2") == (yyvsp[-2].s))
 			shoot->hitSound = (yyvsp[-1].s);
 		 
 		debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s)); }
-#line 1806 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1658 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 65:
-#line 274 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    { debugC(1, kHypnoDebugParser, "N"); }
-#line 1812 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+  case 65: /* bline: NTOK  */
+#line 278 "engines/hypno/grammar_arc.y"
+               { debugC(1, kHypnoDebugParser, "N"); }
+#line 1664 "engines/hypno/grammar_arc.cpp"
     break;
 
-  case 66:
-#line 275 "engines/hypno/grammar_arc.y" /* yacc.c:1646  */
-    {
+  case 66: /* bline: ZTOK  */
+#line 279 "engines/hypno/grammar_arc.y"
+               {
 		g_parsedArc->shoots.push_back(*shoot); 
 		//delete shoot; 
 		//shoot = nullptr;
 		debugC(1, kHypnoDebugParser, "Z"); 
 	}
-#line 1823 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1675 "engines/hypno/grammar_arc.cpp"
     break;
 
 
-#line 1827 "engines/hypno/grammar_arc.cpp" /* yacc.c:1646  */
+#line 1679 "engines/hypno/grammar_arc.cpp"
+
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1837,25 +1690,23 @@ yyreduce:
      case of YYERROR or YYBACKUP, subsequent parser actions might lead
      to an incorrect destructor call or verbose syntax error message
      before the lookahead is translated.  */
-  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
 
   YYPOPSTACK (yylen);
   yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
 
   *++yyvsp = yyval;
 
   /* Now 'shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
+  {
+    const int yylhs = yyr1[yyn] - YYNTOKENS;
+    const int yyi = yypgoto[yylhs] + *yyssp;
+    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+               ? yytable[yyi]
+               : yydefgoto[yylhs]);
+  }
 
   goto yynewstate;
 
@@ -1866,66 +1717,30 @@ yyreduce:
 yyerrlab:
   /* Make sure we have latest lookahead translation.  See comments at
      user semantic actions for why this is necessary.  */
-  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
+  yytoken = yychar == HYPNO_ARC_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
   /* If not already recovering from an error, report this error.  */
   if (!yyerrstatus)
     {
       ++yynerrs;
-#if ! YYERROR_VERBOSE
       yyerror (YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
-                                        yyssp, yytoken)
-      {
-        char const *yymsgp = YY_("syntax error");
-        int yysyntax_error_status;
-        yysyntax_error_status = YYSYNTAX_ERROR;
-        if (yysyntax_error_status == 0)
-          yymsgp = yymsg;
-        else if (yysyntax_error_status == 1)
-          {
-            if (yymsg != yymsgbuf)
-              YYSTACK_FREE (yymsg);
-            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
-            if (!yymsg)
-              {
-                yymsg = yymsgbuf;
-                yymsg_alloc = sizeof yymsgbuf;
-                yysyntax_error_status = 2;
-              }
-            else
-              {
-                yysyntax_error_status = YYSYNTAX_ERROR;
-                yymsgp = yymsg;
-              }
-          }
-        yyerror (yymsgp);
-        if (yysyntax_error_status == 2)
-          goto yyexhaustedlab;
-      }
-# undef YYSYNTAX_ERROR
-#endif
     }
 
-
-
   if (yyerrstatus == 3)
     {
       /* If just tried and failed to reuse lookahead token after an
          error, discard it.  */
 
-      if (yychar <= YYEOF)
+      if (yychar <= HYPNO_ARC_EOF)
         {
           /* Return failure if at end of input.  */
-          if (yychar == YYEOF)
+          if (yychar == HYPNO_ARC_EOF)
             YYABORT;
         }
       else
         {
           yydestruct ("Error: discarding",
                       yytoken, &yylval);
-          yychar = YYEMPTY;
+          yychar = HYPNO_ARC_EMPTY;
         }
     }
 
@@ -1938,12 +1753,11 @@ yyerrlab:
 | yyerrorlab -- error raised explicitly by YYERROR.  |
 `---------------------------------------------------*/
 yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
+  /* Pacify compilers when the user code never invokes YYERROR and the
+     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.  */
@@ -1960,13 +1774,14 @@ yyerrorlab:
 yyerrlab1:
   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
+  /* Pop stack until we find a state that shifts the error token.  */
   for (;;)
     {
       yyn = yypact[yystate];
       if (!yypact_value_is_default (yyn))
         {
-          yyn += YYTERROR;
-          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+          yyn += YYSYMBOL_YYerror;
+          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
             {
               yyn = yytable[yyn];
               if (0 < yyn)
@@ -1980,7 +1795,7 @@ yyerrlab1:
 
 
       yydestruct ("Error: popping",
-                  yystos[yystate], yyvsp);
+                  YY_ACCESSING_SYMBOL (yystate), yyvsp);
       YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
@@ -1992,7 +1807,7 @@ yyerrlab1:
 
 
   /* Shift the error token.  */
-  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
 
   yystate = yyn;
   goto yynewstate;
@@ -2003,27 +1818,31 @@ yyerrlab1:
 `-------------------------------------*/
 yyacceptlab:
   yyresult = 0;
-  goto yyreturn;
+  goto yyreturnlab;
+
 
 /*-----------------------------------.
 | yyabortlab -- YYABORT comes here.  |
 `-----------------------------------*/
 yyabortlab:
   yyresult = 1;
-  goto yyreturn;
+  goto yyreturnlab;
 
-#if !defined yyoverflow || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
+
+/*-----------------------------------------------------------.
+| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
+`-----------------------------------------------------------*/
 yyexhaustedlab:
   yyerror (YY_("memory exhausted"));
   yyresult = 2;
-  /* Fall through.  */
-#endif
+  goto yyreturnlab;
+
 
-yyreturn:
-  if (yychar != YYEMPTY)
+/*----------------------------------------------------------.
+| yyreturnlab -- parsing is finished, clean up and return.  |
+`----------------------------------------------------------*/
+yyreturnlab:
+  if (yychar != HYPNO_ARC_EMPTY)
     {
       /* Make sure we have latest lookahead translation.  See comments at
          user semantic actions for why this is necessary.  */
@@ -2038,16 +1857,14 @@ yyreturn:
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
-                  yystos[*yyssp], yyvsp);
+                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
       YYPOPSTACK (1);
     }
 #ifndef yyoverflow
   if (yyss != yyssa)
     YYSTACK_FREE (yyss);
 #endif
-#if YYERROR_VERBOSE
-  if (yymsg != yymsgbuf)
-    YYSTACK_FREE (yymsg);
-#endif
+
   return yyresult;
 }
+
diff --git a/engines/hypno/grammar_arc.y b/engines/hypno/grammar_arc.y
index fa964c6b21d..702b7468805 100644
--- a/engines/hypno/grammar_arc.y
+++ b/engines/hypno/grammar_arc.y
@@ -106,7 +106,9 @@ hline: 	CTOK NUM {
 		g_parsedArc->background = $2; 
 		debugC(1, kHypnoDebugParser, "N %s", $2); 
 	}
-	| RTOK FILENAME  { debugC(1, kHypnoDebugParser, "R %s", $2); }
+	| RTOK FILENAME  {
+		g_parsedArc->palette = $2; 
+		debugC(1, kHypnoDebugParser, "R %s", $2); }
 	| ITOK FILENAME { 
 		g_parsedArc->player = $2; 
 		debugC(1, kHypnoDebugParser, "I %s", $2); 
@@ -248,7 +250,10 @@ bline: FNTOK FILENAME {
 		shoot->explosionFrame = $3;
 		debugC(1, kHypnoDebugParser, "KN %d %d", $2, $3);
 	}
-	| P0TOK NUM NUM { debugC(1, kHypnoDebugParser, "P0 %d %d", $2, $3); }
+	| P0TOK NUM NUM { 
+		shoot->paletteSize = $2;
+		shoot->paletteOffset = $3;
+		debugC(1, kHypnoDebugParser, "P0 %d %d", $2, $3); }
 	| OTOK NUM NUM { 
 		debugC(1, kHypnoDebugParser, "O %d %d", $2, $3); 
 	}
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 17daea303af..ccd19ff4664 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -46,16 +46,6 @@ Hotspots *g_parsedHots;
 ArcadeShooting *g_parsedArc;
 HypnoEngine *g_hypno;
 
-MVideo::MVideo(Common::String path_, Common::Point position_, bool transparent_, bool scaled_, bool loop_) {
-	decoder = nullptr;
-	currentFrame = nullptr;
-	path = path_;
-	position = position_;
-	scaled = scaled_;
-	transparent = transparent_;
-	loop = loop_;
-}
-
 HypnoEngine::HypnoEngine(OSystem *syst, const ADGameDescription *gd)
 	: Engine(syst), _gameDescription(gd), _image(nullptr),
 	  _compositeSurface(nullptr), _transparentColor(0),
@@ -128,10 +118,8 @@ Common::Error HypnoEngine::run() {
 	initGraphicsModes(modes);
 
 	// Initialize graphics
-	initGraphics(_screenW, _screenH, nullptr);
-	_pixelFormat = g_system->getScreenFormat();
-	if (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8())
-		return Common::kUnsupportedColorMode;
+	_pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
+	initGraphics(_screenW, _screenH, &_pixelFormat);
 
 	_compositeSurface = new Graphics::ManagedSurface();
 	_compositeSurface->create(_screenW, _screenH, _pixelFormat);
@@ -258,9 +246,17 @@ void HypnoEngine::runIntro(MVideo &video) {
 void HypnoEngine::runCode(Code *code) { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::showCredits() { error("Function \"%s\" not implemented", __FUNCTION__); }
 
-void HypnoEngine::loadImage(const Common::String &name, int x, int y, bool transparent, int frameNumber) {
+void HypnoEngine::loadImage(const Common::String &name, int x, int y, bool transparent, bool palette, int frameNumber) {
+
 	debugC(1, kHypnoDebugMedia, "%s(%s, %d, %d, %d)", __FUNCTION__, name.c_str(), x, y, transparent);
-	Graphics::Surface *surf = decodeFrame(name, frameNumber);
+	Graphics::Surface *surf;
+	if (palette) {
+		byte *array;
+		surf = decodeFrame(name, frameNumber, &array);
+		loadPalette(array, 0, 256);
+	} else 
+		surf = decodeFrame(name, frameNumber);
+	
 	drawImage(*surf, x, y, transparent);
 }
 
@@ -296,7 +292,7 @@ Common::File *HypnoEngine::fixSmackerHeader(Common::File *file) {
 	return file;
 }
 
-Graphics::Surface *HypnoEngine::decodeFrame(const Common::String &name, int n, bool convert) {
+Graphics::Surface *HypnoEngine::decodeFrame(const Common::String &name, int n, byte **palette) {
 	Common::File *file = new Common::File();
 	Common::String path = convertPath(name);
 	if (!_prefixDir.empty())
@@ -315,13 +311,11 @@ Graphics::Surface *HypnoEngine::decodeFrame(const Common::String &name, int n, b
 		vd.decodeNextFrame();
 
 	const Graphics::Surface *frame = vd.decodeNextFrame();
-	Graphics::Surface *rframe;
-	if (convert) {
-		rframe = frame->convertTo(_pixelFormat, vd.getPalette());
-	} else {
-		rframe = frame->convertTo(frame->format, vd.getPalette());
-		//rframe->create(frame->w, frame->h, frame->format);
-		//rframe->copyRectToSurface(frame->getPixels(), frame->pitch, 0, 0, frame->w, frame->h);
+	Graphics::Surface *rframe = frame->convertTo(frame->format, vd.getPalette());
+	if (palette != nullptr) {
+		byte *newPalette = (byte*) malloc(3*256); 
+		memcpy(newPalette, vd.getPalette(), 3*256);
+		*palette = newPalette;
 	}
 
 	return rframe;
@@ -360,7 +354,7 @@ void HypnoEngine::changeScreenMode(const Common::String &mode) {
 		_screenW = 640;
 		_screenH = 480;
 
-		initGraphics(_screenW, _screenH, nullptr);
+		initGraphics(_screenW, _screenH, &_pixelFormat);
 
 		_compositeSurface->free();
 		delete _compositeSurface;
@@ -375,7 +369,7 @@ void HypnoEngine::changeScreenMode(const Common::String &mode) {
 		_screenW = 320;
 		_screenH = 200;
 
-		initGraphics(_screenW, _screenH, nullptr);
+		initGraphics(_screenW, _screenH, &_pixelFormat);
 
 		_compositeSurface->free();
 		delete _compositeSurface;
@@ -383,38 +377,62 @@ void HypnoEngine::changeScreenMode(const Common::String &mode) {
 		_compositeSurface = new Graphics::ManagedSurface();
 		_compositeSurface->create(_screenW, _screenH, _pixelFormat);
 
-		_transparentColor = _pixelFormat.RGBToColor(0, 0, 0);
+		_transparentColor = 0; //_pixelFormat.RGBToColor(0, 0, 0);
 		_compositeSurface->setTransparentColor(_transparentColor);
 	} else
 		error("Unknown screen mode %s", mode.c_str());
 }
 
+void HypnoEngine::loadPalette(const Common::String &fname) {
+	Common::File *file = new Common::File();
+	Common::String path = convertPath(fname);
+	if (!_prefixDir.empty())
+		path = _prefixDir + "/" + path;
+
+	if (!file->open(path))
+		error("unable to find palette file %s", path.c_str());
+
+	debugC(1, kHypnoDebugMedia, "Loading palette from %s", path.c_str());
+	byte *videoPalette = (byte*) malloc(file->size());
+	file->read(videoPalette, file->size());
+	g_system->getPaletteManager()->setPalette(videoPalette+8, 0, 256);
+}
+
+void HypnoEngine::loadPalette(const byte *palette, uint32 offset, uint32 size) {
+	debugC(1, kHypnoDebugMedia, "Loading palette from byte array with offset %d and size %d", offset, size);
+	g_system->getPaletteManager()->setPalette(palette + 3*offset, offset, size);	
+}
+
 void HypnoEngine::updateScreen(MVideo &video) {
 	const Graphics::Surface *frame = video.decoder->decodeNextFrame();
 	video.currentFrame = frame;
 	if (frame->h == 0 || frame->w == 0 || video.decoder->getPalette() == nullptr)
 		return;
 
-	Graphics::Surface *sframe, *cframe;
+	bool dirtyPalette = video.decoder->hasDirtyPalette();
+	const byte *videoPalette = nullptr;
+	//bool fullscreen = video.scaled || (frame->h == _screenH && frame->w == _screenW);
+	if (video.scaled && (dirtyPalette || video.decoder->getCurFrame() <= 1)) {
+		videoPalette = video.decoder->getPalette();
+		g_system->getPaletteManager()->setPalette(videoPalette, 0, 256);
+	}
+
+	Graphics::Surface *sframe;
 
 	if (video.scaled) {
 		sframe = frame->scale(_screenW, _screenH);
-		cframe = sframe->convertTo(_pixelFormat, video.decoder->getPalette());
 	} else
-		cframe = frame->convertTo(_pixelFormat, video.decoder->getPalette());
+		sframe = (Graphics::Surface*) frame;
 
 	if (video.transparent)
-		_compositeSurface->transBlitFrom(*cframe, video.position, _transparentColor);
+		_compositeSurface->transBlitFrom(*sframe, video.position, _transparentColor);
 	else
-		_compositeSurface->blitFrom(*cframe, video.position);
+		_compositeSurface->blitFrom(*sframe, video.position);
 
 	if (video.scaled) {
 		sframe->free();
 		delete sframe;
 	}
-
-	cframe->free();
-	delete cframe;
 }
 
 void HypnoEngine::drawScreen() {
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index c26851312f2..42a1ddd54eb 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -135,10 +135,12 @@ public:
 	void skipVideo(MVideo &video);
 
 	Common::File *fixSmackerHeader(Common::File *file);
-	Graphics::Surface *decodeFrame(const Common::String &name, int frame, bool convert = true);
+	Graphics::Surface *decodeFrame(const Common::String &name, int frame, byte **palette = nullptr);
 	Frames decodeFrames(const Common::String &name);
-	void loadImage(const Common::String &file, int x, int y, bool transparent, int frameNumber = 0);
+	void loadImage(const Common::String &file, int x, int y, bool transparent, bool palette = false, int frameNumber = 0);
 	void drawImage(Graphics::Surface &image, int x, int y, bool transparent);
+	void loadPalette(const Common::String &fname);
+	void loadPalette(const byte *palette, uint32 offset, uint32 size);
 
 	// Cursors
 	Common::String _defaultCursor;
diff --git a/engines/hypno/lexer_arc.cpp b/engines/hypno/lexer_arc.cpp
index e6c1420edc2..12dca3e270d 100644
--- a/engines/hypno/lexer_arc.cpp
+++ b/engines/hypno/lexer_arc.cpp
@@ -1,6 +1,6 @@
-#line 2 "engines/hypno/lexer_arc.cpp"
+#line 1 "engines/hypno/lexer_arc.cpp"
 
-#line 4 "engines/hypno/lexer_arc.cpp"
+#line 3 "engines/hypno/lexer_arc.cpp"
 
 #define  YY_INT_ALIGNED short int
 
@@ -817,7 +817,7 @@ char *yytext;
  *
  */
 #define YY_NO_INPUT 1
-#line 33 "engines/hypno/lexer_arc.l"
+#line 32 "engines/hypno/lexer_arc.l"
 #define YY_NO_UNISTD_H
 #define FORBIDDEN_SYMBOL_ALLOW_ALL
 #define YYERROR_VERBOSE
@@ -826,8 +826,8 @@ char *yytext;
 #include "hypno/grammar.h"
 #include "hypno/tokens_arc.h"
 
-#line 831 "engines/hypno/lexer_arc.cpp"
-#line 832 "engines/hypno/lexer_arc.cpp"
+#line 829 "engines/hypno/lexer_arc.cpp"
+#line 830 "engines/hypno/lexer_arc.cpp"
 
 #define INITIAL 0
 
@@ -1042,9 +1042,9 @@ YY_DECL
 		}
 
 	{
-#line 43 "engines/hypno/lexer_arc.l"
+#line 42 "engines/hypno/lexer_arc.l"
 
-#line 1049 "engines/hypno/lexer_arc.cpp"
+#line 1047 "engines/hypno/lexer_arc.cpp"
 
 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
 		{
@@ -1109,216 +1109,216 @@ do_action:	/* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 44 "engines/hypno/lexer_arc.l"
+#line 43 "engines/hypno/lexer_arc.l"
 return NONETOK;
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 45 "engines/hypno/lexer_arc.l"
+#line 44 "engines/hypno/lexer_arc.l"
 return CTOK;
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 46 "engines/hypno/lexer_arc.l"
+#line 45 "engines/hypno/lexer_arc.l"
 return DTOK;
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 47 "engines/hypno/lexer_arc.l"
+#line 46 "engines/hypno/lexer_arc.l"
 return HETOK;
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 48 "engines/hypno/lexer_arc.l"
+#line 47 "engines/hypno/lexer_arc.l"
 return HTOK;
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 49 "engines/hypno/lexer_arc.l"
+#line 48 "engines/hypno/lexer_arc.l"
 return PTOK;
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 50 "engines/hypno/lexer_arc.l"
+#line 49 "engines/hypno/lexer_arc.l"
 return ATOK;
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 51 "engines/hypno/lexer_arc.l"
+#line 50 "engines/hypno/lexer_arc.l"
 return VTOK;
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 52 "engines/hypno/lexer_arc.l"
+#line 51 "engines/hypno/lexer_arc.l"
 return OTOK;
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 53 "engines/hypno/lexer_arc.l"
+#line 52 "engines/hypno/lexer_arc.l"
 return ONTOK;
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 54 "engines/hypno/lexer_arc.l"
+#line 53 "engines/hypno/lexer_arc.l"
 return NTOK;
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 55 "engines/hypno/lexer_arc.l"
+#line 54 "engines/hypno/lexer_arc.l"
 return RTOK;
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 56 "engines/hypno/lexer_arc.l"
+#line 55 "engines/hypno/lexer_arc.l"
 return R0TOK;
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 57 "engines/hypno/lexer_arc.l"
+#line 56 "engines/hypno/lexer_arc.l"
 return ITOK;
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 58 "engines/hypno/lexer_arc.l"
+#line 57 "engines/hypno/lexer_arc.l"
 return JTOK;
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 59 "engines/hypno/lexer_arc.l"
+#line 58 "engines/hypno/lexer_arc.l"
 return QTOK;
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 60 "engines/hypno/lexer_arc.l"
+#line 59 "engines/hypno/lexer_arc.l"
 return ZTOK;
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 61 "engines/hypno/lexer_arc.l"
+#line 60 "engines/hypno/lexer_arc.l"
 return WTOK;
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 62 "engines/hypno/lexer_arc.l"
+#line 61 "engines/hypno/lexer_arc.l"
 return XTOK;
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 63 "engines/hypno/lexer_arc.l"
+#line 62 "engines/hypno/lexer_arc.l"
 return TTOK;
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 64 "engines/hypno/lexer_arc.l"
+#line 63 "engines/hypno/lexer_arc.l"
 return TPTOK;
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 65 "engines/hypno/lexer_arc.l"
+#line 64 "engines/hypno/lexer_arc.l"
 return FNTOK;
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 66 "engines/hypno/lexer_arc.l"
+#line 65 "engines/hypno/lexer_arc.l"
 return FTOK;
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 67 "engines/hypno/lexer_arc.l"
+#line 66 "engines/hypno/lexer_arc.l"
 HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return SNTOK;
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 68 "engines/hypno/lexer_arc.l"
+#line 67 "engines/hypno/lexer_arc.l"
 return A0TOK;
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 69 "engines/hypno/lexer_arc.l"
+#line 68 "engines/hypno/lexer_arc.l"
 HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return BNTOK;
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 70 "engines/hypno/lexer_arc.l"
+#line 69 "engines/hypno/lexer_arc.l"
 return KNTOK;
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 71 "engines/hypno/lexer_arc.l"
+#line 70 "engines/hypno/lexer_arc.l"
 return P0TOK;
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 72 "engines/hypno/lexer_arc.l"
+#line 71 "engines/hypno/lexer_arc.l"
 HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return YXTOK;
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 73 "engines/hypno/lexer_arc.l"
+#line 72 "engines/hypno/lexer_arc.l"
 return ENCTOK;
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 74 "engines/hypno/lexer_arc.l"
+#line 73 "engines/hypno/lexer_arc.l"
 return ENCTOK;
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 75 "engines/hypno/lexer_arc.l"
+#line 74 "engines/hypno/lexer_arc.l"
 HYPNO_ARC_lval.i = atoi(HYPNO_ARC_text); return NUM;
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 76 "engines/hypno/lexer_arc.l"
+#line 75 "engines/hypno/lexer_arc.l"
 HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return NAME;
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 77 "engines/hypno/lexer_arc.l"
+#line 76 "engines/hypno/lexer_arc.l"
 HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return FILENAME;
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 78 "engines/hypno/lexer_arc.l"
+#line 77 "engines/hypno/lexer_arc.l"
 HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return FILENAME;
 	YY_BREAK
 case 36:
 /* rule 36 can match eol */
 YY_RULE_SETUP
-#line 79 "engines/hypno/lexer_arc.l"
+#line 78 "engines/hypno/lexer_arc.l"
 return RETTOK;
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 80 "engines/hypno/lexer_arc.l"
+#line 79 "engines/hypno/lexer_arc.l"
 return CB3TOK;
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 81 "engines/hypno/lexer_arc.l"
+#line 80 "engines/hypno/lexer_arc.l"
 return C02TOK;
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 82 "engines/hypno/lexer_arc.l"
+#line 81 "engines/hypno/lexer_arc.l"
 /* ignore comment */
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 83 "engines/hypno/lexer_arc.l"
+#line 82 "engines/hypno/lexer_arc.l"
 /* ignore whitespace */;
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 84 "engines/hypno/lexer_arc.l"
+#line 83 "engines/hypno/lexer_arc.l"
 debugC(1, Hypno::kHypnoDebugParser, "<no match: %c>", *yytext); return *yytext;
 	YY_BREAK
 case 42:
 YY_RULE_SETUP
-#line 85 "engines/hypno/lexer_arc.l"
+#line 84 "engines/hypno/lexer_arc.l"
 ECHO;
 	YY_BREAK
-#line 1323 "engines/hypno/lexer_arc.cpp"
+#line 1321 "engines/hypno/lexer_arc.cpp"
 case YY_STATE_EOF(INITIAL):
 	yyterminate();
 
@@ -2295,7 +2295,7 @@ void yyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 85 "engines/hypno/lexer_arc.l"
+#line 84 "engines/hypno/lexer_arc.l"
 
 
 namespace Hypno {
diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index 872a35fc1ef..6e189e31e57 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -34,7 +34,7 @@ static const int shootOriginIndex[9][2] = {
 	{41, 3}, {51, 3}, {65, 6}, {68, 9}, {71, 22}, {57, 20}, {37, 14}, {37, 11}, {57, 20}};
 
 void SpiderEngine::drawShoot(const Common::Point &target) {
-	uint32 c = _pixelFormat.RGBToColor(255, 255, 255);
+	uint32 c = 248; // white
 	uint32 ox = 0;
 	uint32 oy = 0;
 
@@ -180,14 +180,14 @@ void SpiderEngine::drawHealth() {
 
 	r = Common::Rect(256, 152 + d, 272, 174);
 	if (d >= 11)
-		c = _pixelFormat.RGBToColor(255, 0, 0);
+		c = 250; // green
 	else
-		c = _pixelFormat.RGBToColor(32, 208, 32);
+		c = 251; // red
 
 	_compositeSurface->fillRect(r, c);
 
 	r = Common::Rect(256, 152, 272, 174);
-	c = _pixelFormat.RGBToColor(0, 0, 255);
+	c = 252;  // blue
 	_compositeSurface->frameRect(r, c);
 
 	_font->drawString(_compositeSurface, "ENERGY", 248, 180, 38, c);
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index f12f8a0e8cd..77c6dbfa603 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -73,16 +73,16 @@ void SpiderEngine::runMatrix(Code *code) {
 	};
 	Common::Rect matrix(175, 96, 461, 385);
 	Common::Rect cell(0, 0, 27, 27);
-	uint32 activeColor = _pixelFormat.RGBToColor(0, 130, 0);
-	uint32 deactiveColor = _pixelFormat.RGBToColor(0, 0, 0);
+	uint32 activeColor = 2;
+	uint32 deactiveColor = 0;
 
 	MVideo *v;
 
 	if (isDemo()) {
-		loadImage("sixdemo/puz_matr/matrixbg.smk", 0, 0, false);
-		v = new MVideo("sixdemo/puz_matr/matintro.smk", Common::Point(0, 0), false, false, false);
+		loadImage("puz_matr/matrixbg.smk", 0, 0, false, true);
+		v = new MVideo("puz_matr/matintro.smk", Common::Point(0, 0), false, false, false);
 	} else {
-		loadImage("spider/puz_ally/matrixbg.smk", 0, 0, false);
+		loadImage("spider/puz_ally/matrixbg.smk", 0, 0, false, true);
 		v = new MVideo("spider/puz_ally/matintro.smk", Common::Point(0, 0), false, false, false);
 	}
 
@@ -284,11 +284,11 @@ void SpiderEngine::runNote(Code *code) {
 	if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
 		MVideo v("spider/int_ball/ppv007es.smk", Common::Point(0, 0), false, false, false);
 		runIntro(v);
-		loadImage("spider/int_ball/enote.smk", 0, 0, false);
+		loadImage("spider/int_ball/enote.smk", 0, 0, false, true);
 	} else { // hard
 		MVideo v("spider/int_ball/ppv007hs.smk", Common::Point(0, 0), false, false, false);
 		runIntro(v);
-		loadImage("spider/int_ball/hnote.smk", 0, 0, false);
+		loadImage("spider/int_ball/hnote.smk", 0, 0, false, true);
 	}
 	
 	while (!shouldQuit()) {
@@ -428,16 +428,16 @@ void SpiderEngine::runFusePanel(Code *code) {
 				_intros[intro] = true;
 			}
 
-			loadImage("spider/int_alof/fuserust.smk", 0, 0, false);
+			loadImage("spider/int_alof/fuserust.smk", 0, 0, false, true);
 		} else if (isFuseUnreadable)
-			loadImage("spider/int_alof/fuseclea.smk", 0, 0, false);
+			loadImage("spider/int_alof/fuseclea.smk", 0, 0, false, true);
 		else
-			loadImage("spider/int_alof/fuseread.smk", 0, 0, false);
+			loadImage("spider/int_alof/fuseread.smk", 0, 0, false, true);
 
 	} else {
 		isFuseRust = false;
 		isFuseUnreadable = false;
-		loadImage("spider/int_alof/fuse.smk", 0, 0, false);
+		loadImage("spider/int_alof/fuse.smk", 0, 0, false, true);
 	}
 
 	while (!shouldQuit()) {
@@ -462,13 +462,13 @@ void SpiderEngine::runFusePanel(Code *code) {
 					runIntro(v);
 					isFuseRust = false;
 					isFuseUnreadable = true;
-					loadImage("spider/int_alof/fuseclea.smk", 0, 0, false);
+					loadImage("spider/int_alof/fuseclea.smk", 0, 0, false, true);
 				} else if (isFuseUnreadable && _sceneState["GS_SWITCH9"]) {
 					MVideo v("spider/cine/spv032s.smk", Common::Point(0, 0), false, false, false);
 					runIntro(v);
 					isFuseRust = false;
 					isFuseUnreadable = false;
-					loadImage("spider/int_alof/fuseread.smk", 0, 0, false);
+					loadImage("spider/int_alof/fuseread.smk", 0, 0, false, true);
 				}
 
 				if (isFuseRust || isFuseUnreadable)
@@ -536,7 +536,7 @@ void SpiderEngine::runFileCabinet(Code *code) {
 
 	defaultCursor();
 	Common::Rect back(0, 446, 640, 480);
-	loadImage("spider/int_alof/combobg.smk", 0, 0, false);
+	loadImage("spider/int_alof/combobg.smk", 0, 0, false, true);
 	for (int i = 0; i < 6; i++) {
 		drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
 	}
@@ -569,7 +569,7 @@ void SpiderEngine::runFileCabinet(Code *code) {
 						comb[i] = (comb[i] + 1) % 10;
 				}
 
-				loadImage("spider/int_alof/combobg.smk", 0, 0, false);
+				loadImage("spider/int_alof/combobg.smk", 0, 0, false, true);
 				for (int i = 0; i < 6; i++) {
 					drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
 				}
@@ -584,7 +584,7 @@ void SpiderEngine::runFileCabinet(Code *code) {
 							comb[i] = comb[i] - 1;
 					}
 
-				loadImage("spider/int_alof/combobg.smk", 0, 0, false);
+				loadImage("spider/int_alof/combobg.smk", 0, 0, false, true);
 				for (int i = 0; i < 6; i++) {
 					drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
 				}
@@ -619,11 +619,11 @@ void SpiderEngine::runLock(Code *code) {
 	if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
 		MVideo v("spider/cine/spv051s.smk", Common::Point(0, 0), false, false, false);
 		runIntro(v);
-		loadImage("spider/factory/elockbg.smk", 0, 0, false);
+		loadImage("spider/factory/elockbg.smk", 0, 0, false, true);
 	} else {
 		MVideo v("spider/cine/spv051as.smk", Common::Point(0, 0), false, false, false);
 		runIntro(v);
-		loadImage("spider/factory/hlockbg.smk", 0, 0, false);
+		loadImage("spider/factory/hlockbg.smk", 0, 0, false, true);
 	}
 
 	Frames nums = decodeFrames("spider/factory/button.smk");
@@ -660,9 +660,9 @@ void SpiderEngine::runLock(Code *code) {
 				}
 
 				if (_sceneState["GS_PUZZLELEVEL"] == 0) // easy
-					loadImage("spider/factory/elockbg.smk", 0, 0, false);
+					loadImage("spider/factory/elockbg.smk", 0, 0, false, true);
 				else 
-					loadImage("spider/factory/hlockbg.smk", 0, 0, false);
+					loadImage("spider/factory/hlockbg.smk", 0, 0, false, true);
 
 				for (int i = 0; i < 5; i++) {
 					drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
@@ -730,11 +730,11 @@ void SpiderEngine::runFuseBox(Code *code) {
 	if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
 		MVideo v("spider/cine/ppv011es.smk", Common::Point(0, 0), false, false, false);
 		runIntro(v);
-		loadImage("spider/movie2/efusebg.smk", 0, 0, false);
+		loadImage("spider/movie2/efusebg.smk", 0, 0, false, true);
 	} else { // hard
 		MVideo v("spider/cine/ppv011hs.smk", Common::Point(0, 0), false, false, false);
 		runIntro(v);
-		loadImage("spider/movie2/hfusebg.smk", 0, 0, false);
+		loadImage("spider/movie2/hfusebg.smk", 0, 0, false, true);
 	}
 
 	Frames fuses = decodeFrames("spider/movie2/onoffuse.smk");
@@ -753,9 +753,9 @@ void SpiderEngine::runFuseBox(Code *code) {
 			case Common::EVENT_LBUTTONDOWN:
 				if (matrix.contains(mousePos)) {
 					if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
-						loadImage("spider/movie2/efusebg.smk", 0, 0, false);
+						loadImage("spider/movie2/efusebg.smk", 0, 0, false, true);
 					} else { // hard
-						loadImage("spider/movie2/hfusebg.smk", 0, 0, false);
+						loadImage("spider/movie2/hfusebg.smk", 0, 0, false, true);
 					}
 
 					debug("\nvdata:");
@@ -850,10 +850,12 @@ void SpiderEngine::showCredits() {
 		return;
 	}
 
-	changeScreenMode("640x480");
-	MVideo video("cine/credits.smk", Common::Point(0, 0), false, false, false);
-	runIntro(video);
-	_nextLevel = "mainmenu.mi_";
+	if (!isDemo()) { // No credits in demo
+		changeScreenMode("640x480");
+		MVideo video("cine/credits.smk", Common::Point(0, 0), false, false, false);
+		runIntro(video);
+		_nextLevel = "mainmenu.mi_";
+	}
 }
 
 } // End of namespace Hypno
\ No newline at end of file
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index cd839c7e156..85f19180bff 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -978,7 +978,7 @@ void SpiderEngine::loadAssetsDemo() {
 
 	Code *matrix = new Code();
 	matrix->name = "<puz_matr>";
-	matrix->intros.push_back("sixdemo/demo/aleyc01s.smk");
+	matrix->intros.push_back("demo/aleyc01s.smk");
 	matrix->levelIfWin = "sixdemo/mis/demo.mis";
 	matrix->levelIfLose = "sixdemo/mis/demo.mis";
 	_levels["<puz_matr>"] = matrix;
diff --git a/engines/hypno/tokens_arc.h b/engines/hypno/tokens_arc.h
index 5c05a00422f..e29be529382 100644
--- a/engines/hypno/tokens_arc.h
+++ b/engines/hypno/tokens_arc.h
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
+/* 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 Free Software Foundation, Inc.
+   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
    it under the terms of the GNU General Public License as published by
@@ -15,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
@@ -30,6 +31,10 @@
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+   especially those whose name start with YY_ or yy_.  They are
+   private implementation details that can be changed or removed.  */
+
 #ifndef YY_HYPNO_ARC_ENGINES_HYPNO_TOKENS_ARC_H_INCLUDED
 # define YY_HYPNO_ARC_ENGINES_HYPNO_TOKENS_ARC_H_INCLUDED
 /* Debug traces.  */
@@ -48,64 +53,68 @@
 extern int HYPNO_ARC_debug;
 #endif
 
-/* Token type.  */
+/* Token kinds.  */
 #ifndef HYPNO_ARC_TOKENTYPE
 # define HYPNO_ARC_TOKENTYPE
   enum HYPNO_ARC_tokentype
   {
-    NAME = 258,
-    FILENAME = 259,
-    BNTOK = 260,
-    SNTOK = 261,
-    KNTOK = 262,
-    YXTOK = 263,
-    NUM = 264,
-    COMMENT = 265,
-    CTOK = 266,
-    DTOK = 267,
-    HTOK = 268,
-    HETOK = 269,
-    RETTOK = 270,
-    QTOK = 271,
-    ENCTOK = 272,
-    PTOK = 273,
-    FTOK = 274,
-    TTOK = 275,
-    TPTOK = 276,
-    ATOK = 277,
-    VTOK = 278,
-    OTOK = 279,
-    ONTOK = 280,
-    NTOK = 281,
-    RTOK = 282,
-    R0TOK = 283,
-    ITOK = 284,
-    JTOK = 285,
-    ZTOK = 286,
-    FNTOK = 287,
-    NONETOK = 288,
-    A0TOK = 289,
-    P0TOK = 290,
-    WTOK = 291,
-    XTOK = 292,
-    CB3TOK = 293,
-    C02TOK = 294
+    HYPNO_ARC_EMPTY = -2,
+    HYPNO_ARC_EOF = 0,             /* "end of file"  */
+    HYPNO_ARC_error = 256,         /* error  */
+    HYPNO_ARC_UNDEF = 257,         /* "invalid token"  */
+    NAME = 258,                    /* NAME  */
+    FILENAME = 259,                /* FILENAME  */
+    BNTOK = 260,                   /* BNTOK  */
+    SNTOK = 261,                   /* SNTOK  */
+    KNTOK = 262,                   /* KNTOK  */
+    YXTOK = 263,                   /* YXTOK  */
+    NUM = 264,                     /* NUM  */
+    COMMENT = 265,                 /* COMMENT  */
+    CTOK = 266,                    /* CTOK  */
+    DTOK = 267,                    /* DTOK  */
+    HTOK = 268,                    /* HTOK  */
+    HETOK = 269,                   /* HETOK  */
+    RETTOK = 270,                  /* RETTOK  */
+    QTOK = 271,                    /* QTOK  */
+    ENCTOK = 272,                  /* ENCTOK  */
+    PTOK = 273,                    /* PTOK  */
+    FTOK = 274,                    /* FTOK  */
+    TTOK = 275,                    /* TTOK  */
+    TPTOK = 276,                   /* TPTOK  */
+    ATOK = 277,                    /* ATOK  */
+    VTOK = 278,                    /* VTOK  */
+    OTOK = 279,                    /* OTOK  */
+    ONTOK = 280,                   /* ONTOK  */
+    NTOK = 281,                    /* NTOK  */
+    RTOK = 282,                    /* RTOK  */
+    R0TOK = 283,                   /* R0TOK  */
+    ITOK = 284,                    /* ITOK  */
+    JTOK = 285,                    /* JTOK  */
+    ZTOK = 286,                    /* ZTOK  */
+    FNTOK = 287,                   /* FNTOK  */
+    NONETOK = 288,                 /* NONETOK  */
+    A0TOK = 289,                   /* A0TOK  */
+    P0TOK = 290,                   /* P0TOK  */
+    WTOK = 291,                    /* WTOK  */
+    XTOK = 292,                    /* XTOK  */
+    CB3TOK = 293,                  /* CB3TOK  */
+    C02TOK = 294                   /* C02TOK  */
   };
+  typedef enum HYPNO_ARC_tokentype HYPNO_ARC_token_kind_t;
 #endif
 
 /* Value type.  */
 #if ! defined HYPNO_ARC_STYPE && ! defined HYPNO_ARC_STYPE_IS_DECLARED
-
 union HYPNO_ARC_STYPE
 {
-#line 54 "engines/hypno/grammar_arc.y" /* yacc.c:1909  */
+#line 53 "engines/hypno/grammar_arc.y"
 
 	char *s; /* string value */
 	int i;	 /* integer value */
 
-#line 107 "engines/hypno/tokens_arc.h" /* yacc.c:1909  */
-};
+#line 116 "engines/hypno/tokens_arc.h"
 
+};
 typedef union HYPNO_ARC_STYPE HYPNO_ARC_STYPE;
 # define HYPNO_ARC_STYPE_IS_TRIVIAL 1
 # define HYPNO_ARC_STYPE_IS_DECLARED 1
@@ -114,6 +123,8 @@ typedef union HYPNO_ARC_STYPE HYPNO_ARC_STYPE;
 
 extern HYPNO_ARC_STYPE HYPNO_ARC_lval;
 
+
 int HYPNO_ARC_parse (void);
 
+
 #endif /* !YY_HYPNO_ARC_ENGINES_HYPNO_TOKENS_ARC_H_INCLUDED  */
diff --git a/engines/hypno/video.cpp b/engines/hypno/video.cpp
index f33836d02db..440c4b87ed8 100644
--- a/engines/hypno/video.cpp
+++ b/engines/hypno/video.cpp
@@ -24,6 +24,16 @@
 
 namespace Hypno {
 
+MVideo::MVideo(Common::String path_, Common::Point position_, bool transparent_, bool scaled_, bool loop_) {
+	decoder = nullptr;
+	currentFrame = nullptr;
+	path = path_;
+	position = position_;
+	scaled = scaled_;
+	transparent = transparent_;
+	loop = loop_;
+}
+
 bool HypnoSmackerDecoder::loadStream(Common::SeekableReadStream *stream) {
 	if (!SmackerDecoder::loadStream(stream))
 		return false;
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index e65d6c6c548..106cb1d8449 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -248,7 +248,7 @@ void WetEngine::runMainMenu(Code *code) {
 	Common::Event event;
 	_font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont);
 	uint32 c = _pixelFormat.RGBToColor(0, 252, 0);
-	Graphics::Surface *frame = decodeFrame("c_misc/menus.smk", 16, true);
+	Graphics::Surface *frame = decodeFrame("c_misc/menus.smk", 16);
 	Common::String _name = "";
 	drawImage(*frame, 0, 0, false);
 	_font->drawString(_compositeSurface, "ENTER NAME :", 48, 50, 100, c);


Commit: 8fb12ce0ccddf6e73d106b0fc299100429a96de0
    https://github.com/scummvm/scummvm/commit/8fb12ce0ccddf6e73d106b0fc299100429a96de0
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-11T12:34:59+01:00

Commit Message:
HYPNO: use correct mouse pointers in spider

Changed paths:
    engines/hypno/hypno.cpp
    engines/hypno/spider/spider.cpp


diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index ccd19ff4664..3f30a3b3679 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -135,7 +135,6 @@ Common::Error HypnoEngine::run() {
 	assert(!_nextLevel.empty());
 	while (!shouldQuit()) {
 		debug("nextLevel: %s", _nextLevel.c_str());
-		_defaultCursor = "";
 		_prefixDir = "";
 		_videosPlaying.clear();
 		if (!_nextLevel.empty()) {
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 85f19180bff..075b7cdc5ec 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -912,7 +912,7 @@ void SpiderEngine::loadAssetsFullGame() {
 	chip_lives_with_spiderman->intros.push_back("spider/cine/vrja003s.smk");
 	chip_lives_with_spiderman->intros.push_back("spider/cine/wins001s.smk");
 	_levels["<chip_lives_with_spiderman>"] = chip_lives_with_spiderman;
-
+	_defaultCursor = "mouse/cursor1.smk";
 	_nextLevel = "<start>";
 }
 


Commit: 0e7a972f41d42a6f852828fb2f3afe1051ea8554
    https://github.com/scummvm/scummvm/commit/0e7a972f41d42a6f852828fb2f3afe1051ea8554
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-11T12:34:59+01:00

Commit Message:
HYPNO: preserve difficulty in saves in spider

Changed paths:
    engines/hypno/spider/spider.cpp


diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 075b7cdc5ec..bc1f0f200ff 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -996,20 +996,22 @@ Common::String SpiderEngine::findNextLevel(const Transition *trans) {
 
 Common::Error SpiderEngine::loadGameStream(Common::SeekableReadStream *stream) {
 	// We don't want to continue with any sound from a previous game
-	//stopSound(true);
+	stopSound();
+	_sceneState["GS_PUZZLELEVEL"] = stream->readUint32LE();
+	_sceneState["GS_COMBATLEVEL"] = stream->readUint32LE();
 	_nextLevel = stream->readString();
-
 	return Common::kNoError;
 }
 
 Common::Error SpiderEngine::saveGameStream(Common::WriteStream *stream, bool isAutosave) {
-	//debugC(1, kDebugFunction, "saveGameStream(%d)", isAutosave);
 	if (isAutosave)
 		return Common::kNoError;
 
 	if (_checkpoint.empty())
 		error("Invalid checkpoint!");
 
+	stream->writeUint32LE(_sceneState["GS_PUZZLELEVEL"]);
+	stream->writeUint32LE(_sceneState["GS_COMBATLEVEL"]);
 	stream->writeString(_checkpoint);
 	stream->writeByte(0);
 	return Common::kNoError;


Commit: 67e4d865dd3a1bac3b1881f7d707b444419bd463
    https://github.com/scummvm/scummvm/commit/67e4d865dd3a1bac3b1881f7d707b444419bd463
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-11T12:35:00+01:00

Commit Message:
HYPNO: fix matrix puzzle in spider

Changed paths:
    engines/hypno/spider/hard.cpp
    engines/hypno/spider/spider.cpp


diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 77c6dbfa603..65ec12395db 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -82,8 +82,8 @@ void SpiderEngine::runMatrix(Code *code) {
 		loadImage("puz_matr/matrixbg.smk", 0, 0, false, true);
 		v = new MVideo("puz_matr/matintro.smk", Common::Point(0, 0), false, false, false);
 	} else {
-		loadImage("spider/puz_ally/matrixbg.smk", 0, 0, false, true);
-		v = new MVideo("spider/puz_ally/matintro.smk", Common::Point(0, 0), false, false, false);
+		loadImage("puz_ally/matrixbg.smk", 0, 0, false, true);
+		v = new MVideo("puz_ally/matintro.smk", Common::Point(0, 0), false, false, false);
 	}
 
 	playVideo(*v);
@@ -102,7 +102,7 @@ void SpiderEngine::runMatrix(Code *code) {
 				if (isDemo())
 					playSound("sixdemo/demo/sound.lib/matrix.raw", 1);
 				else
-					playSound("spider/sound.lib/matrix.raw", 1);
+					playSound("sound.lib/matrix.raw", 1);
 
 				if (matrix.contains(mousePos)) {
 					int x = (mousePos.x - 175) / 29;
@@ -134,7 +134,7 @@ void SpiderEngine::runMatrix(Code *code) {
 			if (isDemo())
 				playSound("sixdemo/demo/sound.lib/matrix_2.raw", 1);
 			else {
-				MVideo video("spider/cine/shv001s.smk", Common::Point(0, 0), false, false, false);
+				MVideo video("cine/shv001s.smk", Common::Point(0, 0), false, false, false);
 				runIntro(video);
 			}
 
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index bc1f0f200ff..52720dac935 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -255,8 +255,9 @@ void SpiderEngine::loadAssetsFullGame() {
 	// Hardcoded levels
 	Code *matrix = new Code();
 	matrix->name = "<puz_matr>";
-	matrix->intros.push_back("spider/cine/aleyc01s.smk");
+	matrix->intros.push_back("cine/aleyc01s.smk");
 	matrix->levelIfWin = "<trans_apt_2>";
+	matrix->prefix = "spider";
 	_levels["<puz_matr>"] = matrix;
 
 	// Transitions


Commit: b0ae3313dc1148b78e5959e8ff792eaed9077265
    https://github.com/scummvm/scummvm/commit/b0ae3313dc1148b78e5959e8ff792eaed9077265
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-11T12:35:00+01:00

Commit Message:
HYPNO: fix arcade crash in spider

Changed paths:
    engines/hypno/arcade.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 6379ee681a7..c16f984488c 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -130,7 +130,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 	_score = 0;
 	_health = arc->health;
 	_maxHealth = _health;
-	_defaultCursor = "arcade";
+	changeCursor("arcade");
 	_shoots.clear();
 	_playerFrames = decodeFrames(arc->player);
 	_playerFrameSep = 0;


Commit: ca758c2e02fca94360b8b05f62d7f10185bb9bb9
    https://github.com/scummvm/scummvm/commit/ca758c2e02fca94360b8b05f62d7f10185bb9bb9
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-11T12:35:00+01:00

Commit Message:
HYPNO: fix crashes in cursor handling in spider

Changed paths:
    engines/hypno/hypno.cpp
    engines/hypno/spider/hard.cpp
    engines/hypno/spider/spider.cpp


diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 3f30a3b3679..870dfad3620 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -140,6 +140,7 @@ Common::Error HypnoEngine::run() {
 		if (!_nextLevel.empty()) {
 			_currentLevel = findNextLevel(_nextLevel);
 			_nextLevel = "";
+			_arcadeMode = "";
 			runLevel(_currentLevel);
 		}
 	}
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 65ec12395db..6a09f58b6a9 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -852,7 +852,7 @@ void SpiderEngine::showCredits() {
 
 	if (!isDemo()) { // No credits in demo
 		changeScreenMode("640x480");
-		MVideo video("cine/credits.smk", Common::Point(0, 0), false, false, false);
+		MVideo video("cine/credits.smk", Common::Point(0, 0), false, true, false);
 		runIntro(video);
 		_nextLevel = "mainmenu.mi_";
 	}
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 52720dac935..530bcc52f41 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -58,6 +58,8 @@ void SpiderEngine::loadAssetsFullGame() {
 	//loadLib("", "c_misc/fonts.lib", true);
 	loadLib("spider/sound.lib/", "spider/c_misc/sound.lib", true);
 
+	_levels["<quit>"]->prefix = "spider";
+
 	Code *credits = new Code();
 	credits->name = "<credits>";
 	credits->prefix = prefix;


Commit: 7d3022e73c18cb46c4b99a410988fc3c4d87cb05
    https://github.com/scummvm/scummvm/commit/7d3022e73c18cb46c4b99a410988fc3c4d87cb05
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-11T12:35:00+01:00

Commit Message:
HYPNO: palette and prefix fixes in spider

Changed paths:
    engines/hypno/hypno.cpp
    engines/hypno/spider/hard.cpp
    engines/hypno/spider/spider.cpp
    engines/hypno/spider/talk.cpp


diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 870dfad3620..e3913721175 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -405,14 +405,15 @@ void HypnoEngine::loadPalette(const byte *palette, uint32 offset, uint32 size) {
 
 void HypnoEngine::updateScreen(MVideo &video) {
 	const Graphics::Surface *frame = video.decoder->decodeNextFrame();
+	bool dirtyPalette = video.decoder->hasDirtyPalette();
+
 	video.currentFrame = frame;
 	if (frame->h == 0 || frame->w == 0 || video.decoder->getPalette() == nullptr)
 		return;
 
-	bool dirtyPalette = video.decoder->hasDirtyPalette();
 	const byte *videoPalette = nullptr;
-	//bool fullscreen = video.scaled || (frame->h == _screenH && frame->w == _screenW);
-	if (video.scaled && (dirtyPalette || video.decoder->getCurFrame() <= 1)) {
+	if (video.scaled && dirtyPalette) {
+		debugC(1, kHypnoDebugMedia, "Updating palette at frame %d", video.decoder->getCurFrame());
 		videoPalette = video.decoder->getPalette();
 		g_system->getPaletteManager()->setPalette(videoPalette, 0, 256);
 	}
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 6a09f58b6a9..0a081668673 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -200,7 +200,6 @@ void SpiderEngine::checkMixture(Code *code) {
 	_nextLevel = "<after_bus_hard>";
 }
 
-
 void SpiderEngine::runNote(Code *code) {
 	const char alphaES[] = "abcdefghijklmnopqrstuvwxyz~";
 	const char alphaEN[] = "abcdefghijklmnopqrstuvwxyz";
@@ -383,14 +382,14 @@ void SpiderEngine::runNote(Code *code) {
 void SpiderEngine::runRecept(Code *code) {
 
 	if (!_sceneState["GS_SWITCH3"]) { // lights off
-		MVideo v("spider/cine/recdark.smk", Common::Point(0, 0), false, false, false);
+		MVideo v("cine/recdark.smk", Common::Point(0, 0), false, false, false);
 		runIntro(v);
 		_nextLevel = "int_roof.mi_";
 		return;
 	}
 	
 	if (_sceneState["GS_SWITCH2"]) { // camera on
-		MVideo v("spider/cine/iobs001s.smk", Common::Point(0, 0), false, true, false);
+		MVideo v("cine/iobs001s.smk", Common::Point(0, 0), false, true, false);
 		runIntro(v);
 		_nextLevel = "<over_apt_5>";
 		return;
@@ -617,16 +616,16 @@ void SpiderEngine::runLock(Code *code) {
 	Common::Rect act(345, 337, 537, 404);
 
 	if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
-		MVideo v("spider/cine/spv051s.smk", Common::Point(0, 0), false, false, false);
+		MVideo v("cine/spv051s.smk", Common::Point(0, 0), false, true, false);
 		runIntro(v);
-		loadImage("spider/factory/elockbg.smk", 0, 0, false, true);
+		loadImage("factory/elockbg.smk", 0, 0, false, true);
 	} else {
-		MVideo v("spider/cine/spv051as.smk", Common::Point(0, 0), false, false, false);
+		MVideo v("cine/spv051as.smk", Common::Point(0, 0), false, true, false);
 		runIntro(v);
-		loadImage("spider/factory/hlockbg.smk", 0, 0, false, true);
+		loadImage("factory/hlockbg.smk", 0, 0, false, true);
 	}
 
-	Frames nums = decodeFrames("spider/factory/button.smk");
+	Frames nums = decodeFrames("factory/button.smk");
 	if (nums.size() != 5)
 		error("Invalid number of colors: %d", nums.size());
 
@@ -635,7 +634,7 @@ void SpiderEngine::runLock(Code *code) {
 		drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
 	}
 
-	while (!shouldQuit()) {
+	while (!shouldQuit() && _nextLevel.empty()) {
 
 		while (g_system->getEventManager()->pollEvent(event)) {
 			mousePos = g_system->getEventManager()->getMousePos();
@@ -648,9 +647,10 @@ void SpiderEngine::runLock(Code *code) {
 
 			case Common::EVENT_LBUTTONDOWN:
 				if (act.contains(mousePos)) {
-					if (comb[0] == 1 && comb[1] == 1 && comb[2] == 1 && comb[3] == 1 && comb[4] == 1) {
+					if (_sceneState["GS_PUZZLELEVEL"] == 0 && comb[0] == 1 && comb[1] == 1 && comb[2] == 1 && comb[3] == 1 && comb[4] == 1) {
+					 	_nextLevel = code->levelIfWin;
+					} else if (_sceneState["GS_PUZZLELEVEL"] == 1 && comb[0] == 1 && comb[1] == 1 && comb[2] == 1 && comb[3] == 1 && comb[4] == 1) {
 					 	_nextLevel = code->levelIfWin;
-					 	return;
 					}
 				}
 
@@ -660,9 +660,9 @@ void SpiderEngine::runLock(Code *code) {
 				}
 
 				if (_sceneState["GS_PUZZLELEVEL"] == 0) // easy
-					loadImage("spider/factory/elockbg.smk", 0, 0, false, true);
+					loadImage("factory/elockbg.smk", 0, 0, false, true);
 				else 
-					loadImage("spider/factory/hlockbg.smk", 0, 0, false, true);
+					loadImage("factory/hlockbg.smk", 0, 0, false, true);
 
 				for (int i = 0; i < 5; i++) {
 					drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
@@ -728,18 +728,18 @@ void SpiderEngine::runFuseBox(Code *code) {
 	Common::Rect hcell(0, 0, 32, 8);
 
 	if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
-		MVideo v("spider/cine/ppv011es.smk", Common::Point(0, 0), false, false, false);
+		MVideo v("cine/ppv011es.smk", Common::Point(0, 0), false, true, false);
 		runIntro(v);
-		loadImage("spider/movie2/efusebg.smk", 0, 0, false, true);
+		loadImage("movie2/efusebg.smk", 0, 0, false, true);
 	} else { // hard
-		MVideo v("spider/cine/ppv011hs.smk", Common::Point(0, 0), false, false, false);
+		MVideo v("cine/ppv011hs.smk", Common::Point(0, 0), false, true, false);
 		runIntro(v);
-		loadImage("spider/movie2/hfusebg.smk", 0, 0, false, true);
+		loadImage("movie2/hfusebg.smk", 0, 0, false, true);
 	}
 
-	Frames fuses = decodeFrames("spider/movie2/onoffuse.smk");
+	Frames fuses = decodeFrames("movie2/onoffuse.smk");
 
-	while (!shouldQuit()) {
+	while (!shouldQuit() && _nextLevel.empty()) {
 
 		while (g_system->getEventManager()->pollEvent(event)) {
 			mousePos = g_system->getEventManager()->getMousePos();
@@ -753,9 +753,9 @@ void SpiderEngine::runFuseBox(Code *code) {
 			case Common::EVENT_LBUTTONDOWN:
 				if (matrix.contains(mousePos)) {
 					if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
-						loadImage("spider/movie2/efusebg.smk", 0, 0, false, true);
+						loadImage("movie2/efusebg.smk", 0, 0, false, true);
 					} else { // hard
-						loadImage("spider/movie2/hfusebg.smk", 0, 0, false, true);
+						loadImage("movie2/hfusebg.smk", 0, 0, false, true);
 					}
 
 					debug("\nvdata:");
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 530bcc52f41..10cfcd6a9fe 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -259,7 +259,7 @@ void SpiderEngine::loadAssetsFullGame() {
 	matrix->name = "<puz_matr>";
 	matrix->intros.push_back("cine/aleyc01s.smk");
 	matrix->levelIfWin = "<trans_apt_2>";
-	matrix->prefix = "spider";
+	matrix->prefix = prefix;
 	_levels["<puz_matr>"] = matrix;
 
 	// Transitions
@@ -291,10 +291,12 @@ void SpiderEngine::loadAssetsFullGame() {
 
 	Code *add_ingredient = new Code();
 	add_ingredient->name = "<add_ingredient>";
+	add_ingredient->prefix = prefix;
 	_levels["<add_ingredient>"] = add_ingredient;
 
 	Code *check_mixture = new Code();
 	check_mixture->name = "<check_mixture>";
+	check_mixture->prefix = prefix;
 	_levels["<check_mixture>"] = check_mixture;
 
 	loadSceneLevel("bushard2.mi_", "", prefix);
@@ -440,10 +442,12 @@ void SpiderEngine::loadAssetsFullGame() {
 	Code *fuse_panel = new Code();
 	fuse_panel->name = "<fuse_panel>";
 	fuse_panel->levelIfWin = "<boil_selector_2>";
+	fuse_panel->prefix = prefix;
 	_levels["<fuse_panel>"] = fuse_panel;
 
 	Code *office = new Code();
 	office->name = "<office>";
+	office->prefix = prefix;
 	_levels["<office>"] = office;
 	
 	cl = new ChangeLevel("<back_roof_1>");
@@ -470,6 +474,7 @@ void SpiderEngine::loadAssetsFullGame() {
 	Code *file_cabinet = new Code();
 	file_cabinet->name = "<file_cabinet>";
 	file_cabinet->levelIfWin = "<alveroff_selector>";
+	file_cabinet->prefix = prefix;
 	_levels["<file_cabinet>"] = file_cabinet;
 
 	loadSceneLevel("alverofh.mi_", "", prefix);
@@ -491,6 +496,7 @@ void SpiderEngine::loadAssetsFullGame() {
 
 	Code *recept = new Code();
 	recept->name = "<recept>";
+	recept->prefix = prefix;
 	_levels["<recept>"] = recept;
 
 	loadSceneLevel("recept.mi_", "", prefix);
@@ -556,6 +562,7 @@ void SpiderEngine::loadAssetsFullGame() {
 	_levels["c5h.mi_"]->levelIfLose = "<over_hob2>";
 	_levels["c5h.mi_"]->intros.push_back("cine/ctss001s.smk");
 	Transition *trans_apt_6 = new Transition("factory1.mi_");
+	trans_apt_6->intros.push_back("spider/cine/ctss002s.smk");
 	trans_apt_6->intros.push_back("spider/cine/apts06as.smk");
 	_levels["<trans_apt_6>"] = trans_apt_6;
 
@@ -565,6 +572,7 @@ void SpiderEngine::loadAssetsFullGame() {
 	Code *note = new Code();
 	note->name = "<note>";
 	note->levelIfWin = "coat.mi_";
+	note->prefix = prefix;
 	_levels["<note>"] = note;
 
 	loadSceneLevel("ball2.mi_", "balcony.mi_", prefix);
@@ -597,8 +605,9 @@ void SpiderEngine::loadAssetsFullGame() {
 
 	Code *lock = new Code();
 	lock->name = "<lock>";
-	lock->intros.push_back("spider/cine/rdss003s.smk");
+	lock->intros.push_back("cine/rdss003s.smk");
 	lock->levelIfWin = "movie2.mi_";
+	lock->prefix = prefix;
 	_levels["<lock>"] = lock;
 
 	loadSceneLevel("movie2.mi_", "decide5.mi_", prefix);
@@ -623,6 +632,7 @@ void SpiderEngine::loadAssetsFullGame() {
 	Code *fuse_box = new Code();
 	fuse_box->name = "<fuse_box>";
 	fuse_box->levelIfWin = "<trans_fuse_box>";
+	fuse_box->prefix = prefix;
 	_levels["<fuse_box>"] = fuse_box;
 
 	Transition *trans_fuse_box = new Transition("decide6.mi_");
diff --git a/engines/hypno/spider/talk.cpp b/engines/hypno/spider/talk.cpp
index 3be1e0f77fb..6aeecd8be96 100644
--- a/engines/hypno/spider/talk.cpp
+++ b/engines/hypno/spider/talk.cpp
@@ -26,6 +26,7 @@ namespace Hypno {
 
 void SpiderEngine::showConversation() {
 	debugC(1, kHypnoDebugScene, "Showing conversation");
+	defaultCursor();
 	uint32 x = 0;
 	uint32 y = 0;
 	Graphics::Surface *speaker = decodeFrame("dialog/speaker3.smk", 0);




More information about the Scummvm-git-logs mailing list