diff options
Diffstat (limited to 'engines')
26 files changed, 1351 insertions, 1147 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 60c8d1f3ef..b293a8e9e5 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -173,6 +173,7 @@ int AgiEngine::agiInit() { #endif _keyHoldMode = false; + _keyHoldModeLastKey = Common::KEYCODE_INVALID; _game.mouseFence.setWidth(0); // Reset @@ -423,6 +424,7 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas _inventory = nullptr; _keyHoldMode = false; + _keyHoldModeLastKey = Common::KEYCODE_INVALID; _artificialDelayCurrentRoom = 0; _artificialDelayCurrentPicture = 0; diff --git a/engines/agi/agi.h b/engines/agi/agi.h index b8c30e9d5c..2b62f9757a 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -27,6 +27,7 @@ #include "common/error.h" #include "common/util.h" #include "common/file.h" +#include "common/keyboard.h" #include "common/rect.h" #include "common/rendermode.h" #include "common/stack.h" @@ -936,6 +937,7 @@ public: int getDirection(int16 objX, int16 objY, int16 destX, int16 destY, int16 stepSize); bool _keyHoldMode; + Common::KeyCode _keyHoldModeLastKey; // Keyboard int doPollKeyboard(); diff --git a/engines/agi/appleIIgs_timedelay_overwrite.h b/engines/agi/appleIIgs_timedelay_overwrite.h index c24d7cb5bd..06b94bf3fc 100644 --- a/engines/agi/appleIIgs_timedelay_overwrite.h +++ b/engines/agi/appleIIgs_timedelay_overwrite.h @@ -28,46 +28,50 @@ namespace Agi { struct AgiAppleIIgsDelayOverwriteRoomEntry { int16 fromRoom; int16 toRoom; - int16 timeDelayOverwrite; // time delay here is like on PC, so 0 - unlimited, 1 - 20 cycles, 2 - 10 cycles - bool onlyWhenPlayerNotInControl; + int16 activePictureNr; // resource number of current active background picture + int16 timeDelayOverwrite; // time delay here is like on PC + // so 0 - unlimited, 1 - 20 cycles, 2 - 10 cycles, -1 means do not touch speed set by scripts + bool onlyWhenPlayerNotInControl; // only sets spee, when play is not in control }; struct AgiAppleIIgsDelayOverwriteGameEntry { uint32 gameId; - int16 defaultTimeDelayOverwrite; // time delay here is like on PC, so 0 - unlimited, 1 - 20 cycles, 2 - 10 cycles - const AgiAppleIIgsDelayOverwriteRoomEntry *roomTable; + int16 defaultTimeDelayOverwrite; // time delay here is like on PC + // so 0 - unlimited, 1 - 20 cycles, 2 - 10 cycles, -1 means do not touch speed set by scripts + const AgiAppleIIgsDelayOverwriteRoomEntry *roomTable; // pointer to room table (optional) }; static const AgiAppleIIgsDelayOverwriteRoomEntry appleIIgsDelayOverwriteKQ4[] = { - { 120, 121, -1, true }, // Part of the intro: Graham gets his hat, throws it and breaks down, don't touch speed (3 is set) - { 128, 128, -1, true }, // Part of the intro: first actual room for gameplay, but during intro, don't touch speed (3 is set) - { 92, 92, -1, true }, // Part of caught by gargoyle w/ Lolotte cutscene (3 is set) + { 120, 121, -1, -1, true }, // Part of the intro: Graham gets his hat, throws it and breaks down, don't touch speed (3 is set) + { 128, 128, -1, -1, true }, // Part of the intro: first actual room for gameplay, but during intro, don't touch speed (3 is set) + { 92, 92, -1, -1, true }, // Part of caught by gargoyle w/ Lolotte cutscene (3 is set) // room 54 sets the speed for a short time to 3 right after entering "clean" command. It doesn't seem to hurt that we switch it down to 2 // room 92 is dual use, part of cutscenes, part of gameplay, that's why we only stop touching it, when player is not in control - { 135, 135, -1, true }, // Part of ending cutscene. Don't touch speed (3 is set) - { -1, -1, -1, false } + { 135, 135, -1, -1, true }, // Part of ending cutscene. Don't touch speed (3 is set) + { -1, -1, -1, -1, false } }; static const AgiAppleIIgsDelayOverwriteRoomEntry appleIIgsDelayOverwriteMH1[] = { - //{ 153, 153, 2, false }, // Intro w/ credits - //{ 104, 104, 2, false }, // Intro cutscene - //{ 117, 117, 2, false }, // Intro cutscene (ego waking up) - { 114, 114, -1, false }, // interactive MAD map - { 124, 125, -1, false }, // MAD during intro (tracking), seem to work properly at given speed - { 132, 133, -1, false }, // MAD day 2 intro (tracking) - { 137, 137, -1, false }, // Night Club 4th arcade game - game sets speed to 7 - { 115, 116, -1, false }, // MAD day 3 intro (tracking) - { 148, 148, -1, false }, // day 3: arcade sequence under pawn shop (game sets speed to 6) - { 103, 103, -1, false }, // MAD day 4 intro (tracking) - { 105, 105, -1, false }, // day 4 tracking mini game right at the start (game sets speed to 3) - { 107, 107, -1, false }, // MAD day 4 intro (tracking) - { 112, 112, -1, false }, // MAD day 4 intro (tracking) - { -1, -1, -1, false } + //{ 153, 153, -1, 2, false }, // Intro w/ credits + //{ 104, 104, -1, 2, false }, // Intro cutscene + //{ 117, 117, -1, 2, false }, // Intro cutscene (ego waking up) + { 114, 114, -1, -1, false }, // interactive MAD map + { 124, 125, -1, -1, false }, // MAD during intro (tracking), seem to work properly at given speed + { 132, 133, -1, -1, false }, // MAD day 2 intro (tracking) + { 137, 137, 17, -1, false }, // Night Club 4th arcade game - game sets speed to 7, needs to run that slow to be playable + { 137, 137, -1, 4, false }, // Night Club first few arcade games - game sets speed to 0, we need to fix it + { 115, 116, -1, -1, false }, // MAD day 3 intro (tracking) + { 148, 148, -1, -1, false }, // day 3: arcade sequence under pawn shop (game sets speed to 6) + { 103, 103, -1, -1, false }, // MAD day 4 intro (tracking) + { 105, 105, -1, -1, false }, // day 4 tracking mini game right at the start (game sets speed to 3) + { 107, 107, -1, -1, false }, // MAD day 4 intro (tracking) + { 112, 112, -1, -1, false }, // MAD day 4 intro (tracking) + { -1, -1, -1, -1, false } }; static const AgiAppleIIgsDelayOverwriteRoomEntry appleIIgsDelayOverwriteSQ2[] = { - { 1, 1, -1, false }, // Intro: space ship entering space port, don't touch speed - { -1, -1, -1, false } + { 1, 1, -1, -1, false }, // Intro: space ship entering space port, don't touch speed + { -1, -1, -1, -1, false } }; static const AgiAppleIIgsDelayOverwriteGameEntry appleIIgsDelayOverwriteGameTable[] = { diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 4148306de2..d09a9501d6 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -377,19 +377,22 @@ int AgiEngine::playGame() { // Now check, if we got a time delay overwrite entry for current room if (appleIIgsDelayOverwrite->roomTable) { byte curRoom = getVar(VM_VAR_CURRENT_ROOM); + int16 curPictureNr = _picture->getResourceNr(); appleIIgsDelayRoomOverwrite = appleIIgsDelayOverwrite->roomTable; while (appleIIgsDelayRoomOverwrite->fromRoom >= 0) { if ((appleIIgsDelayRoomOverwrite->fromRoom <= curRoom) && (appleIIgsDelayRoomOverwrite->toRoom >= curRoom)) { - if (appleIIgsDelayRoomOverwrite->onlyWhenPlayerNotInControl) { - if (_game.playerControl) { - // Player is actually currently in control? -> then skip this entry - appleIIgsDelayRoomOverwrite++; - continue; + if ((appleIIgsDelayRoomOverwrite->activePictureNr == curPictureNr) || (appleIIgsDelayRoomOverwrite->activePictureNr == -1)) { + if (appleIIgsDelayRoomOverwrite->onlyWhenPlayerNotInControl) { + if (_game.playerControl) { + // Player is actually currently in control? -> then skip this entry + appleIIgsDelayRoomOverwrite++; + continue; + } } + timeDelayOverwrite = appleIIgsDelayRoomOverwrite->timeDelayOverwrite; + break; } - timeDelayOverwrite = appleIIgsDelayRoomOverwrite->timeDelayOverwrite; - break; } appleIIgsDelayRoomOverwrite++; } diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index 7ed67949b5..8fb49fdf02 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -247,6 +247,29 @@ void AgiEngine::processScummVMEvents() { default: break; } + + switch (event.kbd.keycode) { + case Common::KEYCODE_LEFT: + case Common::KEYCODE_RIGHT: + case Common::KEYCODE_UP: + case Common::KEYCODE_DOWN: + case Common::KEYCODE_HOME: + case Common::KEYCODE_END: + case Common::KEYCODE_PAGEUP: + case Common::KEYCODE_PAGEDOWN: + case Common::KEYCODE_KP4: + case Common::KEYCODE_KP6: + case Common::KEYCODE_KP8: + case Common::KEYCODE_KP2: + case Common::KEYCODE_KP9: + case Common::KEYCODE_KP3: + case Common::KEYCODE_KP7: + case Common::KEYCODE_KP1: + _keyHoldModeLastKey = event.kbd.keycode; + break; + default: + break; + } } if (key) keyEnqueue(key); @@ -255,8 +278,12 @@ void AgiEngine::processScummVMEvents() { case Common::EVENT_KEYUP: if (_keyHoldMode) { // Original AGI actually created direction events in here - // We don't do that, that's why we create a stationary event instead, which will - // result in a direction change to 0 in handleController(). + // but only in case the last pressed cursor key was released, in other cases it did nothing. + // So when you pressed and held down left and then pressed up, and then released left, + // direction wouldn't be changed at all. + // + // We don't create direction events in here, that's why we create a stationary event instead, + // which will result in a direction change to 0 in handleController(). switch (event.kbd.keycode) { case Common::KEYCODE_LEFT: case Common::KEYCODE_RIGHT: @@ -274,7 +301,9 @@ void AgiEngine::processScummVMEvents() { case Common::KEYCODE_KP3: case Common::KEYCODE_KP7: case Common::KEYCODE_KP1: - keyEnqueue(AGI_KEY_STATIONARY); + if (_keyHoldModeLastKey == event.kbd.keycode) { + keyEnqueue(AGI_KEY_STATIONARY); + } break; default: break; diff --git a/engines/agi/picture.h b/engines/agi/picture.h index dfc505d8d0..2cb5bfabc8 100644 --- a/engines/agi/picture.h +++ b/engines/agi/picture.h @@ -64,6 +64,8 @@ class PictureMgr { public: PictureMgr(AgiBase *agi, GfxMgr *gfx); + int16 getResourceNr() { return _resourceNr; }; + private: void draw_xCorner(bool skipOtherCoords = false); void yCorner(bool skipOtherCoords = false); diff --git a/engines/director/director.cpp b/engines/director/director.cpp index d9bf8cd0cc..4806b57cdf 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -139,7 +139,7 @@ Common::Error DirectorEngine::run() { if (getPlatform() == Common::kPlatformWindows) { _sharedCastFile = "SHARDCST.MMM"; } else { - if (getVersion() < 3) + if (getVersion() < 4) _sharedCastFile = "Shared Cast"; else _sharedCastFile = "Shared.dir"; diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index 7ab69c025d..ee32cf06e5 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -887,8 +887,6 @@ void Lingo::c_repeatwithcode(void) { if (!g_lingo->_returning) g_lingo->_pc = end; /* next stmt */ - - delete counter; } void Lingo::c_exitRepeat(void) { @@ -1065,11 +1063,24 @@ void Lingo::call(Common::String name, int nargs) { } if (sym->type == BLTIN || sym->type == FBLTIN) { - if (sym->u.bltin == b_factory) + if (sym->u.bltin == b_factory) { g_lingo->factoryCall(name, nargs); - else + } else { + int stackSize = _stack.size() - nargs; + (*sym->u.bltin)(nargs); + int stackNewSize = _stack.size(); + + if (sym->type == FBLTIN) { + if (stackNewSize - stackSize != 1) + warning("built-in function %s did not return value", name.c_str()); + } else { + if (stackNewSize - stackSize != 0) + warning("built-in procedure %s returned extra %d values", name.c_str(), stackNewSize - stackSize); + } + } + return; } diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index a6dc3f0c5e..4bd85905c9 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -20,13 +20,16 @@ * */ -#include "director/lingo/lingo.h" -#include "common/file.h" #include "audio/decoders/wave.h" +#include "common/file.h" +#include "common/macresman.h" #include "common/util.h" + +#include "graphics/macgui/macwindowmanager.h" + +#include "director/lingo/lingo.h" #include "director/lingo/lingo-gr.h" #include "director/sound.h" -#include "graphics/macgui/macwindowmanager.h" namespace Director { @@ -180,8 +183,16 @@ void Lingo::func_goto(Datum &frame, Datum &movie) { Common::File file; if (!file.open(*movie.u.s)) { - warning("Movie %s does not exist", movie.u.s->c_str()); - return; + if (_vm->getPlatform() == Common::kPlatformMacintosh) { + Common::MacResManager resMan; + if (!resMan.open(*movie.u.s)) { + warning("Movie %s does not exist", movie.u.s->c_str()); + return; + } + } else { + warning("Movie %s does not exist", movie.u.s->c_str()); + return; + } } _vm->_nextMovie = *movie.u.s; diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp index f59cae743a..f32f171c07 100644 --- a/engines/director/lingo/lingo-gr.cpp +++ b/engines/director/lingo/lingo-gr.cpp @@ -87,68 +87,69 @@ FBLTIN = 276, FBLTINNOARGS = 277, FBLTINONEARG = 278, - ID = 279, - STRING = 280, - HANDLER = 281, - SYMBOL = 282, - ENDCLAUSE = 283, - tPLAYACCEL = 284, - tDOWN = 285, - tELSE = 286, - tNLELSIF = 287, - tEXIT = 288, - tFRAME = 289, - tGLOBAL = 290, - tGO = 291, - tIF = 292, - tINTO = 293, - tLOOP = 294, - tMACRO = 295, - tMOVIE = 296, - tNEXT = 297, - tOF = 298, - tPREVIOUS = 299, - tPUT = 300, - tREPEAT = 301, - tSET = 302, - tTHEN = 303, - tTO = 304, - tWHEN = 305, - tWITH = 306, - tWHILE = 307, - tNLELSE = 308, - tFACTORY = 309, - tMETHOD = 310, - tOPEN = 311, - tPLAY = 312, - tDONE = 313, - tINSTANCE = 314, - tGE = 315, - tLE = 316, - tGT = 317, - tLT = 318, - tEQ = 319, - tNEQ = 320, - tAND = 321, - tOR = 322, - tNOT = 323, - tMOD = 324, - tAFTER = 325, - tBEFORE = 326, - tCONCAT = 327, - tCONTAINS = 328, - tSTARTS = 329, - tCHAR = 330, - tITEM = 331, - tLINE = 332, - tWORD = 333, - tSPRITE = 334, - tINTERSECTS = 335, - tWITHIN = 336, - tTELL = 337, - tPROPERTY = 338, - tON = 339, - tME = 340 + FBLTINARGLIST = 279, + ID = 280, + STRING = 281, + HANDLER = 282, + SYMBOL = 283, + ENDCLAUSE = 284, + tPLAYACCEL = 285, + tDOWN = 286, + tELSE = 287, + tNLELSIF = 288, + tEXIT = 289, + tFRAME = 290, + tGLOBAL = 291, + tGO = 292, + tIF = 293, + tINTO = 294, + tLOOP = 295, + tMACRO = 296, + tMOVIE = 297, + tNEXT = 298, + tOF = 299, + tPREVIOUS = 300, + tPUT = 301, + tREPEAT = 302, + tSET = 303, + tTHEN = 304, + tTO = 305, + tWHEN = 306, + tWITH = 307, + tWHILE = 308, + tNLELSE = 309, + tFACTORY = 310, + tMETHOD = 311, + tOPEN = 312, + tPLAY = 313, + tDONE = 314, + tINSTANCE = 315, + tGE = 316, + tLE = 317, + tGT = 318, + tLT = 319, + tEQ = 320, + tNEQ = 321, + tAND = 322, + tOR = 323, + tNOT = 324, + tMOD = 325, + tAFTER = 326, + tBEFORE = 327, + tCONCAT = 328, + tCONTAINS = 329, + tSTARTS = 330, + tCHAR = 331, + tITEM = 332, + tLINE = 333, + tWORD = 334, + tSPRITE = 335, + tINTERSECTS = 336, + tWITHIN = 337, + tTELL = 338, + tPROPERTY = 339, + tON = 340, + tME = 341 }; #endif /* Tokens. */ @@ -173,68 +174,69 @@ #define FBLTIN 276 #define FBLTINNOARGS 277 #define FBLTINONEARG 278 -#define ID 279 -#define STRING 280 -#define HANDLER 281 -#define SYMBOL 282 -#define ENDCLAUSE 283 -#define tPLAYACCEL 284 -#define tDOWN 285 -#define tELSE 286 -#define tNLELSIF 287 -#define tEXIT 288 -#define tFRAME 289 -#define tGLOBAL 290 -#define tGO 291 -#define tIF 292 -#define tINTO 293 -#define tLOOP 294 -#define tMACRO 295 -#define tMOVIE 296 -#define tNEXT 297 -#define tOF 298 -#define tPREVIOUS 299 -#define tPUT 300 -#define tREPEAT 301 -#define tSET 302 -#define tTHEN 303 -#define tTO 304 -#define tWHEN 305 -#define tWITH 306 -#define tWHILE 307 -#define tNLELSE 308 -#define tFACTORY 309 -#define tMETHOD 310 -#define tOPEN 311 -#define tPLAY 312 -#define tDONE 313 -#define tINSTANCE 314 -#define tGE 315 -#define tLE 316 -#define tGT 317 -#define tLT 318 -#define tEQ 319 -#define tNEQ 320 -#define tAND 321 -#define tOR 322 -#define tNOT 323 -#define tMOD 324 -#define tAFTER 325 -#define tBEFORE 326 -#define tCONCAT 327 -#define tCONTAINS 328 -#define tSTARTS 329 -#define tCHAR 330 -#define tITEM 331 -#define tLINE 332 -#define tWORD 333 -#define tSPRITE 334 -#define tINTERSECTS 335 -#define tWITHIN 336 -#define tTELL 337 -#define tPROPERTY 338 -#define tON 339 -#define tME 340 +#define FBLTINARGLIST 279 +#define ID 280 +#define STRING 281 +#define HANDLER 282 +#define SYMBOL 283 +#define ENDCLAUSE 284 +#define tPLAYACCEL 285 +#define tDOWN 286 +#define tELSE 287 +#define tNLELSIF 288 +#define tEXIT 289 +#define tFRAME 290 +#define tGLOBAL 291 +#define tGO 292 +#define tIF 293 +#define tINTO 294 +#define tLOOP 295 +#define tMACRO 296 +#define tMOVIE 297 +#define tNEXT 298 +#define tOF 299 +#define tPREVIOUS 300 +#define tPUT 301 +#define tREPEAT 302 +#define tSET 303 +#define tTHEN 304 +#define tTO 305 +#define tWHEN 306 +#define tWITH 307 +#define tWHILE 308 +#define tNLELSE 309 +#define tFACTORY 310 +#define tMETHOD 311 +#define tOPEN 312 +#define tPLAY 313 +#define tDONE 314 +#define tINSTANCE 315 +#define tGE 316 +#define tLE 317 +#define tGT 318 +#define tLT 319 +#define tEQ 320 +#define tNEQ 321 +#define tAND 322 +#define tOR 323 +#define tNOT 324 +#define tMOD 325 +#define tAFTER 326 +#define tBEFORE 327 +#define tCONCAT 328 +#define tCONTAINS 329 +#define tSTARTS 330 +#define tCHAR 331 +#define tITEM 332 +#define tLINE 333 +#define tWORD 334 +#define tSPRITE 335 +#define tINTERSECTS 336 +#define tWITHIN 337 +#define tTELL 338 +#define tPROPERTY 339 +#define tON 340 +#define tME 341 @@ -302,7 +304,7 @@ typedef union YYSTYPE Common::Array<double> *arr; } /* Line 193 of yacc.c. */ -#line 306 "engines/director/lingo/lingo-gr.cpp" +#line 308 "engines/director/lingo/lingo-gr.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -315,7 +317,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 319 "engines/director/lingo/lingo-gr.cpp" +#line 321 "engines/director/lingo/lingo-gr.cpp" #ifdef short # undef short @@ -528,22 +530,22 @@ union yyalloc #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 119 +#define YYFINAL 123 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1668 +#define YYLAST 1818 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 101 +#define YYNTOKENS 102 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 43 /* YYNRULES -- Number of rules. */ -#define YYNRULES 158 +#define YYNRULES 161 /* YYNRULES -- Number of states. */ -#define YYNSTATES 346 +#define YYNSTATES 355 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 340 +#define YYMAXUTOK 341 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -552,15 +554,15 @@ union yyalloc static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 93, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 94, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 92, 87, 2, - 94, 95, 90, 88, 100, 89, 2, 91, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 93, 88, 2, + 95, 96, 91, 89, 101, 90, 2, 92, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 97, 86, 96, 2, 2, 2, 2, 2, 2, 2, + 98, 87, 97, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 98, 2, 99, 2, 2, 2, 2, 2, 2, + 2, 99, 2, 100, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -585,7 +587,7 @@ static const yytype_uint8 yytranslate[] = 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85 + 85, 86 }; #if YYDEBUG @@ -599,82 +601,84 @@ static const yytype_uint16 yyprhs[] = 131, 142, 153, 160, 171, 182, 183, 187, 190, 192, 195, 197, 204, 206, 213, 215, 219, 223, 226, 230, 232, 234, 235, 236, 237, 240, 243, 247, 249, 251, - 253, 255, 257, 259, 262, 267, 269, 271, 274, 276, - 280, 284, 288, 292, 296, 300, 304, 308, 312, 316, - 320, 324, 327, 331, 335, 339, 343, 346, 349, 353, - 357, 362, 367, 372, 379, 384, 391, 396, 403, 408, - 415, 418, 420, 422, 425, 427, 430, 433, 436, 438, - 441, 444, 446, 449, 454, 461, 466, 469, 473, 475, - 479, 481, 485, 487, 491, 494, 497, 500, 503, 507, - 510, 513, 515, 519, 522, 525, 528, 532, 535, 536, - 540, 541, 550, 553, 554, 563, 564, 565, 576, 577, - 579, 583, 588, 589, 592, 593, 595, 599, 601 + 253, 255, 257, 259, 262, 265, 270, 275, 277, 279, + 282, 284, 288, 292, 296, 300, 304, 308, 312, 316, + 320, 324, 328, 332, 335, 339, 343, 347, 351, 354, + 357, 361, 365, 370, 375, 380, 387, 392, 399, 404, + 411, 416, 423, 426, 428, 430, 433, 435, 438, 441, + 444, 446, 449, 452, 454, 457, 462, 467, 474, 479, + 482, 486, 488, 492, 494, 498, 500, 504, 507, 510, + 513, 516, 520, 523, 526, 528, 532, 535, 538, 541, + 545, 548, 549, 553, 554, 563, 566, 567, 576, 577, + 578, 589, 590, 592, 596, 601, 602, 605, 606, 608, + 612, 614 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 102, 0, -1, 102, 103, 104, -1, 104, -1, 1, - 103, -1, 93, -1, -1, 134, -1, 141, -1, 107, - -1, 45, 124, 38, 24, -1, 45, 124, 70, 124, - -1, 45, 124, 71, 124, -1, 47, 24, 86, 124, - -1, 47, 12, 86, 124, -1, 47, 13, 124, 86, - 124, -1, 47, 24, 49, 124, -1, 47, 12, 49, - 124, -1, 47, 13, 124, 49, 124, -1, 124, -1, - 125, -1, 106, -1, 108, -1, 115, 94, 114, 95, - 121, 120, 28, -1, 116, 86, 124, 120, 49, 124, - 120, 121, 120, 28, -1, 116, 86, 124, 120, 30, - 49, 124, 120, 121, 120, 28, -1, 122, 106, 120, - -1, 123, 124, 103, 121, 120, 28, -1, 123, 124, - 49, 124, -1, 117, 114, 48, 103, 121, 120, 28, - -1, 117, 114, 48, 103, 121, 120, 53, 121, 120, - 28, -1, 117, 114, 48, 103, 121, 120, 119, 110, - 120, 28, -1, 117, 114, 48, 119, 106, 120, -1, - 117, 114, 48, 119, 106, 120, 53, 119, 106, 120, - -1, 117, 114, 48, 119, 106, 120, 111, 120, 109, - 120, -1, -1, 53, 119, 106, -1, 110, 113, -1, - 113, -1, 111, 112, -1, 112, -1, 118, 114, 48, - 119, 107, 120, -1, 111, -1, 118, 114, 48, 119, - 121, 120, -1, 124, -1, 124, 86, 124, -1, 94, - 114, 95, -1, 46, 52, -1, 46, 51, 24, -1, - 37, -1, 32, -1, -1, -1, -1, 121, 103, -1, - 121, 107, -1, 50, 24, 48, -1, 82, -1, 11, - -1, 14, -1, 27, -1, 25, -1, 22, -1, 23, - 124, -1, 24, 94, 142, 95, -1, 24, -1, 12, - -1, 13, 124, -1, 105, -1, 124, 88, 124, -1, - 124, 89, 124, -1, 124, 90, 124, -1, 124, 91, - 124, -1, 124, 69, 124, -1, 124, 96, 124, -1, - 124, 97, 124, -1, 124, 65, 124, -1, 124, 60, - 124, -1, 124, 61, 124, -1, 124, 66, 124, -1, - 124, 67, 124, -1, 68, 124, -1, 124, 87, 124, - -1, 124, 72, 124, -1, 124, 73, 124, -1, 124, - 74, 124, -1, 88, 124, -1, 89, 124, -1, 94, - 124, 95, -1, 98, 142, 99, -1, 79, 124, 80, - 124, -1, 79, 124, 81, 124, -1, 75, 124, 43, - 124, -1, 75, 124, 49, 124, 43, 124, -1, 76, - 124, 43, 124, -1, 76, 124, 49, 124, 43, 124, - -1, 77, 124, 43, 124, -1, 77, 124, 49, 124, - 43, 124, -1, 78, 124, 43, 124, -1, 78, 124, - 49, 124, 43, 124, -1, 45, 124, -1, 129, -1, - 132, -1, 33, 46, -1, 33, -1, 35, 126, -1, - 83, 127, -1, 59, 128, -1, 16, -1, 18, 124, - -1, 17, 124, -1, 17, -1, 19, 143, -1, 85, - 94, 24, 95, -1, 85, 94, 24, 100, 142, 95, - -1, 56, 124, 51, 124, -1, 56, 124, -1, 20, - 24, 142, -1, 24, -1, 126, 100, 24, -1, 24, - -1, 127, 100, 24, -1, 24, -1, 128, 100, 24, - -1, 36, 39, -1, 36, 42, -1, 36, 44, -1, - 36, 130, -1, 36, 130, 131, -1, 36, 131, -1, - 34, 124, -1, 124, -1, 43, 41, 124, -1, 41, - 124, -1, 57, 58, -1, 57, 130, -1, 57, 130, - 131, -1, 57, 131, -1, -1, 29, 133, 142, -1, - -1, 40, 24, 135, 119, 139, 103, 140, 121, -1, - 54, 24, -1, -1, 55, 24, 136, 119, 139, 103, - 140, 121, -1, -1, -1, 84, 24, 137, 119, 138, - 139, 103, 140, 121, 28, -1, -1, 24, -1, 139, - 100, 24, -1, 139, 103, 100, 24, -1, -1, 24, - 143, -1, -1, 124, -1, 142, 100, 124, -1, 124, - -1, 143, 100, 124, -1 + 103, 0, -1, 103, 104, 105, -1, 105, -1, 1, + 104, -1, 94, -1, -1, 135, -1, 142, -1, 108, + -1, 46, 125, 39, 25, -1, 46, 125, 71, 125, + -1, 46, 125, 72, 125, -1, 48, 25, 87, 125, + -1, 48, 12, 87, 125, -1, 48, 13, 125, 87, + 125, -1, 48, 25, 50, 125, -1, 48, 12, 50, + 125, -1, 48, 13, 125, 50, 125, -1, 125, -1, + 126, -1, 107, -1, 109, -1, 116, 95, 115, 96, + 122, 121, 29, -1, 117, 87, 125, 121, 50, 125, + 121, 122, 121, 29, -1, 117, 87, 125, 121, 31, + 50, 125, 121, 122, 121, 29, -1, 123, 107, 121, + -1, 124, 125, 104, 122, 121, 29, -1, 124, 125, + 50, 125, -1, 118, 115, 49, 104, 122, 121, 29, + -1, 118, 115, 49, 104, 122, 121, 54, 122, 121, + 29, -1, 118, 115, 49, 104, 122, 121, 120, 111, + 121, 29, -1, 118, 115, 49, 120, 107, 121, -1, + 118, 115, 49, 120, 107, 121, 54, 120, 107, 121, + -1, 118, 115, 49, 120, 107, 121, 112, 121, 110, + 121, -1, -1, 54, 120, 107, -1, 111, 114, -1, + 114, -1, 112, 113, -1, 113, -1, 119, 115, 49, + 120, 108, 121, -1, 112, -1, 119, 115, 49, 120, + 122, 121, -1, 125, -1, 125, 87, 125, -1, 95, + 115, 96, -1, 47, 53, -1, 47, 52, 25, -1, + 38, -1, 33, -1, -1, -1, -1, 122, 104, -1, + 122, 108, -1, 51, 25, 49, -1, 83, -1, 11, + -1, 14, -1, 28, -1, 26, -1, 22, -1, 23, + 125, -1, 24, 144, -1, 24, 95, 144, 96, -1, + 25, 95, 143, 96, -1, 25, -1, 12, -1, 13, + 125, -1, 106, -1, 125, 89, 125, -1, 125, 90, + 125, -1, 125, 91, 125, -1, 125, 92, 125, -1, + 125, 70, 125, -1, 125, 97, 125, -1, 125, 98, + 125, -1, 125, 66, 125, -1, 125, 61, 125, -1, + 125, 62, 125, -1, 125, 67, 125, -1, 125, 68, + 125, -1, 69, 125, -1, 125, 88, 125, -1, 125, + 73, 125, -1, 125, 74, 125, -1, 125, 75, 125, + -1, 89, 125, -1, 90, 125, -1, 95, 125, 96, + -1, 99, 143, 100, -1, 80, 125, 81, 125, -1, + 80, 125, 82, 125, -1, 76, 125, 44, 125, -1, + 76, 125, 50, 125, 44, 125, -1, 77, 125, 44, + 125, -1, 77, 125, 50, 125, 44, 125, -1, 78, + 125, 44, 125, -1, 78, 125, 50, 125, 44, 125, + -1, 79, 125, 44, 125, -1, 79, 125, 50, 125, + 44, 125, -1, 46, 125, -1, 130, -1, 133, -1, + 34, 47, -1, 34, -1, 36, 127, -1, 84, 128, + -1, 60, 129, -1, 16, -1, 18, 125, -1, 17, + 125, -1, 17, -1, 19, 144, -1, 19, 95, 144, + 96, -1, 86, 95, 25, 96, -1, 86, 95, 25, + 101, 143, 96, -1, 57, 125, 52, 125, -1, 57, + 125, -1, 20, 25, 143, -1, 25, -1, 127, 101, + 25, -1, 25, -1, 128, 101, 25, -1, 25, -1, + 129, 101, 25, -1, 37, 40, -1, 37, 43, -1, + 37, 45, -1, 37, 131, -1, 37, 131, 132, -1, + 37, 132, -1, 35, 125, -1, 125, -1, 44, 42, + 125, -1, 42, 125, -1, 58, 59, -1, 58, 131, + -1, 58, 131, 132, -1, 58, 132, -1, -1, 30, + 134, 143, -1, -1, 41, 25, 136, 120, 140, 104, + 141, 122, -1, 55, 25, -1, -1, 56, 25, 137, + 120, 140, 104, 141, 122, -1, -1, -1, 85, 25, + 138, 120, 139, 140, 104, 141, 122, 29, -1, -1, + 25, -1, 140, 101, 25, -1, 140, 104, 101, 25, + -1, -1, 25, 144, -1, -1, 125, -1, 143, 101, + 125, -1, 125, -1, 144, 101, 125, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -686,16 +690,17 @@ static const yytype_uint16 yyrline[] = 267, 279, 291, 301, 311, 323, 324, 327, 328, 331, 332, 335, 343, 344, 352, 353, 354, 357, 360, 367, 374, 382, 385, 388, 389, 390, 393, 399, 403, 404, - 407, 410, 413, 416, 419, 422, 426, 433, 439, 440, + 407, 410, 413, 416, 419, 420, 421, 424, 428, 435, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 473, 474, 475, 476, 477, 479, 480, 481, 482, 485, - 488, 491, 494, 495, 496, 497, 498, 499, 502, 503, - 506, 507, 510, 511, 522, 523, 524, 525, 528, 531, - 536, 537, 540, 541, 544, 545, 548, 551, 554, 554, - 584, 584, 590, 593, 593, 598, 599, 598, 609, 610, - 611, 612, 615, 619, 627, 628, 629, 632, 633 + 471, 472, 475, 476, 477, 478, 479, 481, 482, 483, + 484, 487, 490, 493, 497, 498, 499, 500, 501, 502, + 503, 506, 507, 510, 511, 514, 515, 526, 527, 528, + 529, 532, 535, 540, 541, 544, 545, 548, 549, 552, + 555, 558, 558, 588, 588, 594, 597, 597, 602, 603, + 602, 613, 614, 615, 616, 619, 623, 631, 632, 633, + 636, 637 }; #endif @@ -708,24 +713,24 @@ static const char *const yytname[] = "POINT", "RECT", "ARRAY", "OBJECT", "INT", "THEENTITY", "THEENTITYWITHID", "FLOAT", "BLTIN", "BLTINNOARGS", "BLTINNOARGSORONE", "BLTINONEARG", "BLTINARGLIST", "TWOWORDBUILTIN", "FBLTIN", - "FBLTINNOARGS", "FBLTINONEARG", "ID", "STRING", "HANDLER", "SYMBOL", - "ENDCLAUSE", "tPLAYACCEL", "tDOWN", "tELSE", "tNLELSIF", "tEXIT", - "tFRAME", "tGLOBAL", "tGO", "tIF", "tINTO", "tLOOP", "tMACRO", "tMOVIE", - "tNEXT", "tOF", "tPREVIOUS", "tPUT", "tREPEAT", "tSET", "tTHEN", "tTO", - "tWHEN", "tWITH", "tWHILE", "tNLELSE", "tFACTORY", "tMETHOD", "tOPEN", - "tPLAY", "tDONE", "tINSTANCE", "tGE", "tLE", "tGT", "tLT", "tEQ", "tNEQ", - "tAND", "tOR", "tNOT", "tMOD", "tAFTER", "tBEFORE", "tCONCAT", - "tCONTAINS", "tSTARTS", "tCHAR", "tITEM", "tLINE", "tWORD", "tSPRITE", - "tINTERSECTS", "tWITHIN", "tTELL", "tPROPERTY", "tON", "tME", "'='", - "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "'\\n'", "'('", "')'", "'>'", - "'<'", "'['", "']'", "','", "$accept", "program", "nl", "programline", - "asgn", "stmtoneliner", "stmt", "ifstmt", "elsestmtoneliner", - "elseifstmt", "elseifstmtoneliner", "elseifstmtoneliner1", "elseifstmt1", - "cond", "repeatwhile", "repeatwith", "if", "elseif", "begin", "end", - "stmtlist", "when", "tell", "expr", "proc", "globallist", "propertylist", - "instancelist", "gotofunc", "gotoframe", "gotomovie", "playfunc", "@1", - "defn", "@2", "@3", "@4", "@5", "argdef", "argstore", "macro", "arglist", - "nonemptyarglist", 0 + "FBLTINNOARGS", "FBLTINONEARG", "FBLTINARGLIST", "ID", "STRING", + "HANDLER", "SYMBOL", "ENDCLAUSE", "tPLAYACCEL", "tDOWN", "tELSE", + "tNLELSIF", "tEXIT", "tFRAME", "tGLOBAL", "tGO", "tIF", "tINTO", "tLOOP", + "tMACRO", "tMOVIE", "tNEXT", "tOF", "tPREVIOUS", "tPUT", "tREPEAT", + "tSET", "tTHEN", "tTO", "tWHEN", "tWITH", "tWHILE", "tNLELSE", + "tFACTORY", "tMETHOD", "tOPEN", "tPLAY", "tDONE", "tINSTANCE", "tGE", + "tLE", "tGT", "tLT", "tEQ", "tNEQ", "tAND", "tOR", "tNOT", "tMOD", + "tAFTER", "tBEFORE", "tCONCAT", "tCONTAINS", "tSTARTS", "tCHAR", "tITEM", + "tLINE", "tWORD", "tSPRITE", "tINTERSECTS", "tWITHIN", "tTELL", + "tPROPERTY", "tON", "tME", "'='", "'&'", "'+'", "'-'", "'*'", "'/'", + "'%'", "'\\n'", "'('", "')'", "'>'", "'<'", "'['", "']'", "','", + "$accept", "program", "nl", "programline", "asgn", "stmtoneliner", + "stmt", "ifstmt", "elsestmtoneliner", "elseifstmt", "elseifstmtoneliner", + "elseifstmtoneliner1", "elseifstmt1", "cond", "repeatwhile", + "repeatwith", "if", "elseif", "begin", "end", "stmtlist", "when", "tell", + "expr", "proc", "globallist", "propertylist", "instancelist", "gotofunc", + "gotoframe", "gotomovie", "playfunc", "@1", "defn", "@2", "@3", "@4", + "@5", "argdef", "argstore", "macro", "arglist", "nonemptyarglist", 0 }; #endif @@ -742,31 +747,32 @@ static const yytype_uint16 yytoknum[] = 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 61, 38, 43, 45, - 42, 47, 37, 10, 40, 41, 62, 60, 91, 93, - 44 + 335, 336, 337, 338, 339, 340, 341, 61, 38, 43, + 45, 42, 47, 37, 10, 40, 41, 62, 60, 91, + 93, 44 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 101, 102, 102, 102, 103, 104, 104, 104, 104, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 106, - 106, 107, 107, 107, 107, 107, 107, 107, 107, 108, - 108, 108, 108, 108, 108, 109, 109, 110, 110, 111, - 111, 112, 113, 113, 114, 114, 114, 115, 116, 117, - 118, 119, 120, 121, 121, 121, 122, 123, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 0, 102, 103, 103, 103, 104, 105, 105, 105, 105, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, + 107, 108, 108, 108, 108, 108, 108, 108, 108, 109, + 109, 109, 109, 109, 109, 110, 110, 111, 111, 112, + 112, 113, 114, 114, 115, 115, 115, 116, 117, 118, + 119, 120, 121, 122, 122, 122, 123, 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, - 127, 127, 128, 128, 129, 129, 129, 129, 129, 129, - 130, 130, 131, 131, 132, 132, 132, 132, 133, 132, - 135, 134, 134, 136, 134, 137, 138, 134, 139, 139, - 139, 139, 140, 141, 142, 142, 142, 143, 143 + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 127, 127, 128, 128, 129, 129, 130, 130, 130, + 130, 130, 130, 131, 131, 132, 132, 133, 133, 133, + 133, 134, 133, 136, 135, 135, 137, 135, 138, 139, + 135, 140, 140, 140, 140, 141, 142, 143, 143, 143, + 144, 144 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -778,16 +784,17 @@ static const yytype_uint8 yyr2[] = 10, 10, 6, 10, 10, 0, 3, 2, 1, 2, 1, 6, 1, 6, 1, 3, 3, 2, 3, 1, 1, 0, 0, 0, 2, 2, 3, 1, 1, 1, - 1, 1, 1, 2, 4, 1, 1, 2, 1, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 3, 3, 3, 3, 2, 2, 3, 3, - 4, 4, 4, 6, 4, 6, 4, 6, 4, 6, - 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, - 2, 1, 2, 4, 6, 4, 2, 3, 1, 3, - 1, 3, 1, 3, 2, 2, 2, 2, 3, 2, - 2, 1, 3, 2, 2, 2, 3, 2, 0, 3, - 0, 8, 2, 0, 8, 0, 0, 10, 0, 1, - 3, 4, 0, 2, 0, 1, 3, 1, 3 + 1, 1, 1, 2, 2, 4, 4, 1, 1, 2, + 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, + 3, 3, 4, 4, 4, 6, 4, 6, 4, 6, + 4, 6, 2, 1, 1, 2, 1, 2, 2, 2, + 1, 2, 2, 1, 2, 4, 4, 6, 4, 2, + 3, 1, 3, 1, 3, 1, 3, 2, 2, 2, + 2, 3, 2, 2, 1, 3, 2, 2, 2, 3, + 2, 0, 3, 0, 8, 2, 0, 8, 0, 0, + 10, 0, 1, 3, 4, 0, 2, 0, 1, 3, + 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -795,103 +802,105 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 58, 66, 0, 59, 108, 111, 0, 0, - 0, 62, 0, 65, 61, 60, 138, 104, 0, 0, - 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, - 0, 0, 0, 0, 154, 0, 3, 68, 21, 9, - 22, 0, 0, 0, 0, 0, 19, 20, 101, 102, - 7, 8, 5, 4, 65, 0, 67, 110, 109, 157, - 112, 154, 63, 154, 153, 154, 103, 118, 105, 0, - 124, 0, 125, 0, 126, 131, 127, 129, 140, 100, - 0, 47, 0, 0, 0, 0, 142, 143, 116, 134, - 135, 137, 122, 107, 81, 0, 0, 0, 0, 0, - 120, 106, 145, 0, 86, 87, 0, 155, 0, 1, - 6, 0, 0, 0, 0, 44, 52, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 154, 0, 0, 117, 155, 0, - 139, 0, 130, 133, 0, 128, 51, 0, 0, 0, - 48, 0, 0, 0, 0, 0, 56, 51, 0, 136, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 51, 0, 88, 89, 0, 2, 0, 52, - 0, 0, 51, 0, 26, 0, 53, 77, 78, 76, - 79, 80, 73, 83, 84, 85, 82, 69, 70, 71, - 72, 74, 75, 158, 64, 119, 132, 148, 10, 11, - 12, 17, 14, 0, 0, 16, 13, 148, 115, 123, - 92, 0, 94, 0, 96, 0, 98, 0, 90, 91, - 121, 146, 113, 154, 156, 53, 0, 46, 53, 0, - 45, 28, 52, 149, 0, 18, 15, 0, 0, 0, - 0, 0, 148, 0, 52, 0, 0, 52, 52, 54, - 55, 0, 0, 152, 152, 93, 95, 97, 99, 0, - 114, 0, 0, 52, 51, 32, 27, 150, 0, 53, - 53, 152, 23, 52, 53, 29, 53, 0, 50, 51, - 52, 40, 0, 151, 141, 144, 53, 53, 52, 52, - 52, 42, 38, 0, 0, 39, 35, 0, 0, 52, - 0, 0, 37, 0, 0, 52, 51, 52, 51, 147, - 0, 24, 30, 31, 51, 33, 0, 34, 0, 25, - 53, 36, 52, 52, 41, 43 + 0, 0, 58, 68, 0, 59, 110, 113, 0, 0, + 0, 62, 0, 0, 67, 61, 60, 141, 106, 0, + 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, + 0, 0, 0, 0, 0, 157, 0, 3, 70, 21, + 9, 22, 0, 0, 0, 0, 0, 19, 20, 103, + 104, 7, 8, 5, 4, 67, 0, 69, 112, 111, + 0, 160, 114, 157, 63, 0, 64, 157, 156, 157, + 105, 121, 107, 0, 127, 0, 128, 0, 129, 134, + 130, 132, 143, 102, 0, 47, 0, 0, 0, 0, + 145, 146, 119, 137, 138, 140, 125, 109, 83, 0, + 0, 0, 0, 0, 123, 108, 148, 0, 88, 89, + 0, 158, 0, 1, 6, 0, 0, 0, 0, 44, + 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 157, 0, + 160, 0, 0, 120, 0, 158, 0, 142, 0, 133, + 136, 0, 131, 51, 0, 0, 0, 48, 0, 0, + 0, 0, 0, 56, 51, 0, 139, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 0, 90, 91, 0, 2, 0, 52, 0, 0, 51, + 0, 26, 0, 53, 79, 80, 78, 81, 82, 75, + 85, 86, 87, 84, 71, 72, 73, 74, 76, 77, + 115, 161, 65, 66, 122, 135, 151, 10, 11, 12, + 17, 14, 0, 0, 16, 13, 151, 118, 126, 94, + 0, 96, 0, 98, 0, 100, 0, 92, 93, 124, + 149, 116, 157, 159, 53, 0, 46, 53, 0, 45, + 28, 52, 152, 0, 18, 15, 0, 0, 0, 0, + 0, 151, 0, 52, 0, 0, 52, 52, 54, 55, + 0, 0, 155, 155, 95, 97, 99, 101, 0, 117, + 0, 0, 52, 51, 32, 27, 153, 0, 53, 53, + 155, 23, 52, 53, 29, 53, 0, 50, 51, 52, + 40, 0, 154, 144, 147, 53, 53, 52, 52, 52, + 42, 38, 0, 0, 39, 35, 0, 0, 52, 0, + 0, 37, 0, 0, 52, 51, 52, 51, 150, 0, + 24, 30, 31, 51, 33, 0, 34, 0, 25, 53, + 36, 52, 52, 41, 43 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 45, 269, 46, 47, 48, 270, 50, 327, 310, - 311, 301, 312, 124, 51, 52, 53, 302, 217, 194, - 252, 54, 55, 56, 57, 78, 111, 103, 58, 86, - 87, 59, 75, 60, 156, 167, 182, 262, 254, 289, - 61, 149, 70 + -1, 46, 278, 47, 48, 49, 279, 51, 336, 319, + 320, 310, 321, 128, 52, 53, 54, 311, 226, 201, + 261, 55, 56, 57, 58, 82, 115, 107, 59, 90, + 91, 60, 79, 61, 163, 174, 189, 271, 263, 298, + 62, 156, 72 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -264 +#define YYPACT_NINF -272 static const yytype_int16 yypact[] = { - 330, -86, -264, -264, 928, -264, -264, 928, 928, 928, - -3, -264, 928, 967, -264, -264, -264, -21, 7, 849, - -264, 31, 928, 38, 40, 37, 43, 59, 928, 888, - 61, 928, 928, 928, 928, 928, 928, -264, 63, 69, - 3, 928, 928, 928, 928, 2, -264, -264, -264, -264, - -264, 4, 13, 1007, 770, 928, 1571, -264, -264, -264, - -264, -264, -264, -264, 6, 928, 1571, 1571, 1571, 1571, - 5, 928, 1571, 928, 5, 928, -264, -264, 9, 928, - -264, 928, -264, 62, -264, 1571, 32, -264, -264, 1042, - 80, -264, -48, 928, -45, 64, -264, -264, 1406, -264, - 32, -264, -264, 10, -57, 1075, 1108, 1141, 1174, 1439, - -264, 11, -264, 83, -57, -57, 1505, 1571, -8, -264, - 418, 1007, 928, 1007, 65, 1538, -264, 1339, 928, 928, - 928, 928, 928, 928, 928, 928, 928, 928, 928, 928, - 928, 928, 928, 928, 928, 1042, 928, 14, 1505, -78, - 14, 91, 1571, 1571, 928, -264, -264, 92, 928, 928, - -264, 928, 928, 1373, 928, 928, -264, -264, 928, -264, - 93, 928, 928, 928, 928, 928, 928, 928, 928, 928, - 928, 97, -264, -30, -264, -264, 928, -264, 30, 1571, - 33, 1472, -86, 928, -264, 928, -264, 123, 123, 123, - -57, -57, -57, 1571, 123, 123, 229, 238, 238, -57, - -57, 1571, 1571, 1571, -264, -264, 1571, 102, -264, 1571, - 1571, 1571, 1571, 928, 928, 1571, 1571, 102, 1571, -264, - 1571, 1207, 1571, 1240, 1571, 1273, 1571, 1306, 1571, 1571, - -264, -264, -264, 928, 1571, -264, 29, -264, -264, 770, - 1571, 1571, 594, -264, -12, 1571, 1571, -12, 928, 928, - 928, 928, 102, -16, 594, 78, 928, 594, -264, -264, - -264, 118, 124, 49, 49, 1571, 1571, 1571, 1571, -12, - -264, 125, 928, 1571, -2, -5, -264, -264, 127, -264, - -264, 49, -264, 1571, -264, -264, -264, 122, -264, -264, - 122, -264, 1007, -264, 594, 594, -264, -264, 594, 594, - 122, 122, -264, 1007, 770, -264, 103, 109, 506, 594, - 130, 133, -264, 136, 119, -264, -264, -264, -264, -264, - 140, -264, -264, -264, -264, -264, 770, -264, 682, -264, - 682, -264, -264, 594, -264, -264 + 339, -52, -272, -272, 962, -272, -272, 962, 962, 1000, + 37, -272, 962, 1059, 1097, -272, -272, -272, 34, 66, + 864, -272, 72, 962, 41, 57, 77, 81, 90, 962, + 903, 97, 962, 962, 962, 962, 962, 962, -272, 98, + 100, -41, 962, 962, 962, 962, 2, -272, -272, -272, + -272, -272, 36, -21, 1156, 784, 962, 1720, -272, -272, + -272, -272, -272, -272, -272, 59, 962, 1720, 1720, 1720, + 962, 1720, 31, 962, 1720, 962, 31, 962, 31, 962, + -272, -272, 51, 962, -272, 962, -272, 113, -272, 1720, + 43, -272, -272, 1191, 131, -272, -47, 962, -39, 108, + -272, -272, 1555, -272, 43, -272, -272, 58, -48, 1224, + 1257, 1290, 1323, 1588, -272, 60, -272, 133, -48, -48, + 1654, 1720, 29, -272, 428, 1156, 962, 1156, 111, 1687, + -272, 1488, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 1191, + 1654, -73, 962, 62, -69, 1654, 7, 62, 139, 1720, + 1720, 962, -272, -272, 140, 962, 962, -272, 962, 962, + 1522, 962, 962, -272, -272, 962, -272, 143, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 146, -272, + 8, -272, -272, 962, -272, 78, 1720, 79, 1621, -52, + 962, -272, 962, -272, 22, 22, 22, -48, -48, -48, + 1720, 22, 22, 147, 238, 238, -48, -48, 1720, 1720, + -272, 1720, -272, -272, -272, 1720, 164, -272, 1720, 1720, + 1720, 1720, 962, 962, 1720, 1720, 164, 1720, -272, 1720, + 1356, 1720, 1389, 1720, 1422, 1720, 1455, 1720, 1720, -272, + -272, -272, 962, 1720, -272, -9, -272, -272, 784, 1720, + 1720, 606, -272, -22, 1720, 1720, -22, 962, 962, 962, + 962, 164, 20, 606, 141, 962, 606, -272, -272, -272, + 161, 168, 94, 94, 1720, 1720, 1720, 1720, -22, -272, + 167, 962, 1720, -3, 6, -272, -272, 172, -272, -272, + 94, -272, 1720, -272, -272, -272, 165, -272, -272, 165, + -272, 1156, -272, 606, 606, -272, -272, 606, 606, 165, + 165, -272, 1156, 784, -272, 145, 151, 517, 606, 175, + 176, -272, 177, 159, -272, -272, -272, -272, -272, 180, + -272, -272, -272, -272, -272, 784, -272, 695, -272, 695, + -272, -272, 606, -272, -272 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -264, -264, 23, 51, -264, -51, 0, -264, -264, -264, - -103, -242, -127, -105, -264, -264, -264, -248, -96, -19, - -188, -264, -264, 1, -264, -264, -264, -264, -264, 155, - -23, -264, -264, -264, -264, -264, -264, -264, -215, -263, - -264, -25, 172 + -272, -272, 19, 86, -272, -51, 0, -272, -272, -272, + -83, -221, -107, -109, -272, -272, -272, -242, -116, -18, + -198, -272, -272, 1, -272, -272, -272, -272, -272, 186, + -29, -272, -272, -272, -272, -272, -272, -272, -219, -271, + -272, -26, -7 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -901,344 +910,374 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -7 static const yytype_int16 yytable[] = { - 49, 161, 119, 126, 164, 66, 101, 62, 67, 68, - 69, 290, 257, 72, 69, 134, 188, 214, 190, 118, - 85, 71, 186, 89, 63, 76, 295, 298, 306, 98, - 85, 77, 104, 105, 106, 107, 108, 109, 162, 142, - 143, 165, 114, 115, 116, 117, 147, 279, 299, 313, - 150, 296, 92, 93, 125, 88, 127, 264, 315, 265, - 267, 95, 313, 155, 94, 242, 145, 96, 120, 315, - 243, 227, 117, 81, 148, 83, 117, 169, 266, 280, - 152, 62, 153, 97, 186, 102, 241, 110, 272, 90, - 91, 185, 186, 112, 163, 62, 249, 113, 121, 122, - 144, 304, 305, 154, 160, 146, 308, 183, 309, 151, - 170, 181, 166, 192, 186, 215, 218, 229, 318, 319, - 49, 240, 125, 189, 191, 245, 253, 282, 247, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 117, 286, 213, 287, 288, - 196, 303, 343, 292, 298, 216, 326, 328, 331, 219, - 220, 332, 221, 222, 333, 225, 226, 334, 339, 228, - 246, 187, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 300, 322, 100, 74, 0, 244, 297, 131, - 132, 0, 133, 0, 250, 134, 251, 317, 268, 0, - 0, 0, 0, 314, 0, 0, 0, 0, 324, 0, - 137, 138, 139, 140, 141, 248, 0, 0, 263, 142, - 143, 0, 0, 0, 255, 256, 0, 0, 0, 0, - 336, 0, 338, 271, 0, 0, 0, 0, 340, 0, - 0, 0, 0, 0, 117, 281, 0, 0, 284, 285, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 275, - 276, 277, 278, 325, 294, 0, 0, 283, 0, 0, - 0, 0, 0, 0, 307, 0, 0, 273, 0, 0, - 274, 316, 0, 293, 0, 341, 0, 0, 0, 320, - 321, 323, 0, 0, 0, 131, 132, 0, 133, 0, - 330, 134, 291, 125, 131, 132, 335, 133, 337, 0, - 134, 0, 0, 0, 125, 0, 0, 138, 139, 140, - 141, 0, 0, 344, 345, 142, 143, 0, 140, 141, - -6, 1, 0, 0, 142, 143, 0, 0, 342, 0, - 342, 2, 3, 4, 5, 0, 6, 7, 8, 9, - 10, 0, 11, 12, 13, 14, 0, 15, 0, 16, - 0, 0, 0, 17, 0, 18, 19, 20, 0, 0, - 21, 0, 0, 0, 0, 22, 23, 24, 0, 0, - 25, 0, 0, 0, 26, 27, 28, 29, 0, 30, - 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, - 0, 0, 0, 0, 0, 32, 33, 34, 35, 36, - 0, 0, 37, 38, 39, 40, 0, 0, 41, 42, - 0, 0, 0, -6, 43, 0, 0, 0, 44, 2, + 50, 105, 123, 168, 130, 67, 76, 78, 68, 69, + 71, 171, 299, 74, 71, 71, 195, 266, 197, 122, + 64, 89, 274, 220, 93, 138, 304, 222, 152, 315, + 102, 89, 152, 108, 109, 110, 111, 112, 113, 307, + 169, 275, 63, 118, 119, 120, 121, 153, 172, 146, + 147, 305, 288, 157, 117, 129, 273, 131, 236, 276, + 308, 162, 73, 151, 322, 124, 126, 149, 154, 96, + 97, 150, 63, 250, 121, 176, 150, 322, 155, 281, + 121, 80, 98, 258, 159, 85, 160, 87, 324, 135, + 136, 81, 137, 94, 95, 138, 63, 92, 170, 324, + 313, 314, 99, 223, 251, 317, 100, 318, 193, 252, + 141, 142, 143, 144, 145, 101, 289, 327, 328, 146, + 147, 193, 106, 114, 50, 116, 129, 196, 198, 192, + 193, 125, 152, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 121, + 203, 352, 158, 221, 148, 161, 167, 173, 190, 177, + 199, 188, 225, 193, 224, 227, 228, 229, 238, 230, + 231, 249, 234, 235, 254, 256, 237, 306, 255, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 262, + 295, 291, 323, 296, 253, 297, 301, 312, 307, 335, + 337, 259, 326, 260, 340, 341, 342, 277, 343, 348, + 194, 309, 331, 333, 135, 136, 104, 137, 257, 345, + 138, 347, 0, 0, 0, 0, 272, 349, 0, 0, + 0, 0, 0, 264, 265, 0, 142, 143, 144, 145, + 0, 0, 0, 280, 146, 147, 0, 0, 0, 0, + 0, 0, 0, 121, 0, 290, 0, 0, 293, 294, + 0, 0, 0, 0, 0, 0, 0, 0, 284, 285, + 286, 287, 334, 0, 303, 0, 292, 0, 0, 0, + 0, 0, 282, 0, 316, 283, 0, 0, 0, 0, + 0, 325, 302, 0, 350, 0, 0, 0, 0, 329, + 330, 332, 0, 0, 0, 135, 136, 300, 137, 0, + 339, 138, 129, 0, 0, 0, 344, 0, 346, 0, + 0, 0, 0, 129, 0, 0, 0, 0, 0, 144, + 145, 0, 0, 353, 354, 146, 147, 0, 0, -6, + 1, 0, 0, 0, 0, 0, 0, 351, 0, 351, + 2, 3, 4, 5, 0, 6, 7, 8, 9, 10, + 0, 11, 12, 13, 14, 15, 0, 16, 0, 17, + 0, 0, 0, 18, 0, 19, 20, 21, 0, 0, + 22, 0, 0, 0, 0, 23, 24, 25, 0, 0, + 26, 0, 0, 0, 27, 28, 29, 30, 0, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 33, 34, 35, 36, 37, + 0, 0, 38, 39, 40, 41, 0, 0, 42, 43, + 0, 0, 0, -6, 44, 0, 0, 0, 45, 2, 3, 4, 5, 0, 6, 7, 8, 9, 10, 0, - 11, 12, 13, 14, 0, 15, 0, 16, 0, 0, - 0, 17, 0, 18, 19, 20, 0, 0, 21, 0, - 0, 0, 0, 22, 23, 24, 0, 0, 25, 0, - 0, 0, 26, 27, 28, 29, 0, 30, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, - 0, 0, 0, 32, 33, 34, 35, 36, 0, 0, - 37, 38, 39, 40, 0, 0, 41, 42, 0, 0, - 0, 0, 43, 0, 0, 0, 44, 2, 3, 4, + 11, 12, 13, 14, 15, 0, 16, 0, 17, 0, + 0, 0, 18, 0, 19, 20, 21, 0, 0, 22, + 0, 0, 0, 0, 23, 24, 25, 0, 0, 26, + 0, 0, 0, 27, 28, 29, 30, 0, 31, 0, + 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, + 0, 0, 0, 0, 33, 34, 35, 36, 37, 0, + 0, 38, 39, 40, 41, 0, 0, 42, 43, 0, + 0, 0, 0, 44, 0, 0, 0, 45, 2, 3, + 4, 5, 0, 6, 7, 8, 9, 10, 0, 11, + 12, 13, 65, 15, 0, 16, 338, 17, 0, 0, + 0, 18, 0, 19, 20, 21, 0, 0, 0, 0, + 0, 0, 0, 23, 24, 25, 0, 0, 26, 0, + 0, 0, 0, 0, 29, 30, 0, 31, 0, 0, + 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, + 0, 0, 0, 33, 34, 35, 36, 37, 0, 0, + 38, 39, 0, 41, 0, 0, 42, 43, 0, 0, + 0, 63, 44, 0, 0, 0, 45, 2, 3, 4, 5, 0, 6, 7, 8, 9, 10, 0, 11, 12, - 64, 14, 0, 15, 329, 16, 0, 0, 0, 17, - 0, 18, 19, 20, 0, 0, 0, 0, 0, 0, - 0, 22, 23, 24, 0, 0, 25, 0, 0, 0, - 0, 0, 28, 29, 0, 30, 0, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, - 0, 32, 33, 34, 35, 36, 0, 0, 37, 38, - 0, 40, 0, 0, 41, 42, 0, 0, 0, 62, - 43, 0, 0, 0, 44, 2, 3, 4, 5, 0, - 6, 7, 8, 9, 10, 0, 11, 12, 64, 14, - 0, 15, 0, 16, 0, 0, 0, 17, 0, 18, - 19, 20, 0, 0, 0, 0, 0, 0, 0, 22, - 23, 24, 0, 0, 25, 0, 0, 0, 0, 0, - 28, 29, 0, 30, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 0, 0, 0, 0, 32, - 33, 34, 35, 36, 0, 0, 37, 38, 0, 40, - 0, 0, 41, 42, 0, 0, 0, 62, 43, 0, - 0, 0, 44, 2, 3, 4, 5, 0, 6, 7, - 8, 9, 10, 0, 11, 12, 64, 14, 0, 15, - 0, 16, 0, 0, 0, 17, 0, 18, 19, 20, - 0, 0, 0, 0, 0, 0, 0, 22, 23, 24, - 0, 0, 25, 0, 0, 0, 0, 0, 28, 29, - 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, - 31, 0, 0, 0, 0, 0, 0, 32, 33, 34, - 35, 36, 0, 0, 37, 38, 0, 40, 0, 0, - 41, 42, 0, 0, 0, 0, 43, 0, 0, 0, - 44, 2, 3, 4, 5, 0, 6, 7, 8, 9, - 10, 0, 11, 12, 64, 14, 0, 15, 0, 16, - 0, 0, 0, 17, 0, 18, 19, 0, 0, 0, - 0, 0, 0, 0, 0, 22, 0, 24, 0, 0, - 0, 0, 0, 0, 0, 0, 28, 29, 0, 30, - 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, - 0, 0, 0, 0, 0, 32, 33, 34, 35, 36, - 0, 0, 0, 38, 0, 40, 0, 0, 41, 42, - 2, 3, 4, 5, 43, 0, 0, 0, 44, 0, - 0, 11, 12, 64, 14, 0, 15, 0, 0, 0, - 0, 0, 0, 79, 0, 0, 0, 0, 80, 0, - 81, 82, 83, 84, 65, 0, 24, 0, 0, 2, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, - 11, 12, 64, 14, 0, 15, 0, 31, 0, 0, - 0, 0, 79, 0, 32, 33, 34, 35, 36, 81, - 0, 83, 0, 65, 0, 24, 0, 41, 42, 2, - 3, 4, 5, 43, 0, 0, 99, 44, 0, 0, - 11, 12, 64, 14, 0, 15, 31, 0, 0, 0, - 0, 0, 0, 32, 33, 34, 35, 36, 0, 0, - 0, 0, 0, 65, 0, 24, 41, 42, 2, 3, - 4, 5, 43, 0, 0, 0, 44, 0, 0, 11, - 12, 64, 14, 0, 15, 0, 31, 0, 0, 0, - 0, 0, 0, 32, 33, 34, 35, 36, 0, 0, - 0, 0, 65, 0, 24, 0, 41, 42, 2, 3, - 4, 5, 43, 0, 0, 0, 44, 0, 0, 11, - 12, 64, 14, 0, 15, 31, 0, 0, 0, 0, - 0, 0, 32, 33, 34, 35, 36, 0, 0, 0, - 0, 0, 65, 0, 24, 41, 42, 0, 0, 0, - 0, 73, 0, 0, 0, 44, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, - 157, 0, 32, 33, 34, 35, 36, 0, 0, 0, - 0, 0, 0, 0, 0, 41, 42, 0, 0, 0, - 0, 123, 128, 129, 0, 44, 0, 130, 131, 132, - 0, 133, 158, 159, 134, 135, 136, 0, 171, 0, - 0, 0, 0, 0, 172, 0, 0, 0, 0, 137, - 138, 139, 140, 141, 0, 128, 129, 0, 142, 143, - 130, 131, 132, 0, 133, 0, 0, 134, 135, 136, - 0, 173, 0, 0, 0, 0, 0, 174, 0, 0, - 0, 0, 137, 138, 139, 140, 141, 0, 128, 129, - 0, 142, 143, 130, 131, 132, 0, 133, 0, 0, - 134, 135, 136, 0, 175, 0, 0, 0, 0, 0, - 176, 0, 0, 0, 0, 137, 138, 139, 140, 141, - 0, 128, 129, 0, 142, 143, 130, 131, 132, 0, - 133, 0, 0, 134, 135, 136, 0, 177, 0, 0, - 0, 0, 0, 178, 0, 0, 0, 0, 137, 138, - 139, 140, 141, 0, 128, 129, 0, 142, 143, 130, - 131, 132, 0, 133, 0, 0, 134, 135, 136, 0, - 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 137, 138, 139, 140, 141, 0, 128, 129, 0, - 142, 143, 130, 131, 132, 0, 133, 0, 0, 134, - 135, 136, 0, 259, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 137, 138, 139, 140, 141, 0, - 128, 129, 0, 142, 143, 130, 131, 132, 0, 133, - 0, 0, 134, 135, 136, 0, 260, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 137, 138, 139, - 140, 141, 0, 128, 129, 0, 142, 143, 130, 131, - 132, 0, 133, 0, 0, 134, 135, 136, 0, 261, + 13, 65, 15, 0, 16, 0, 17, 0, 0, 0, + 18, 0, 19, 20, 21, 0, 0, 0, 0, 0, + 0, 0, 23, 24, 25, 0, 0, 26, 0, 0, + 0, 0, 0, 29, 30, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, + 0, 0, 33, 34, 35, 36, 37, 0, 0, 38, + 39, 0, 41, 0, 0, 42, 43, 0, 0, 0, + 63, 44, 0, 0, 0, 45, 2, 3, 4, 5, + 0, 6, 7, 8, 9, 10, 0, 11, 12, 13, + 65, 15, 0, 16, 0, 17, 0, 0, 0, 18, + 0, 19, 20, 21, 0, 0, 0, 0, 0, 0, + 0, 23, 24, 25, 0, 0, 26, 0, 0, 0, + 0, 0, 29, 30, 0, 31, 0, 0, 0, 0, + 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, + 0, 33, 34, 35, 36, 37, 0, 0, 38, 39, + 0, 41, 0, 0, 42, 43, 0, 0, 0, 0, + 44, 0, 0, 0, 45, 2, 3, 4, 5, 0, + 6, 7, 8, 9, 10, 0, 11, 12, 13, 65, + 15, 0, 16, 0, 17, 0, 0, 0, 18, 0, + 19, 20, 0, 0, 0, 0, 0, 0, 0, 0, + 23, 0, 25, 0, 0, 0, 0, 0, 0, 0, + 0, 29, 30, 0, 31, 0, 0, 0, 0, 0, + 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, + 33, 34, 35, 36, 37, 0, 0, 0, 39, 0, + 41, 0, 0, 42, 43, 2, 3, 4, 5, 44, + 0, 0, 0, 45, 0, 0, 11, 12, 13, 65, + 15, 0, 16, 0, 0, 0, 0, 0, 0, 83, + 0, 0, 0, 0, 84, 0, 85, 86, 87, 88, + 66, 0, 25, 0, 2, 3, 4, 5, 0, 0, + 0, 0, 0, 0, 0, 11, 12, 13, 65, 15, + 0, 16, 0, 32, 0, 0, 0, 0, 83, 0, + 33, 34, 35, 36, 37, 85, 0, 87, 0, 66, + 0, 25, 0, 42, 43, 0, 0, 0, 0, 44, + 0, 0, 103, 45, 0, 0, 0, 0, 0, 0, + 0, 0, 32, 2, 3, 4, 5, 0, 0, 33, + 34, 35, 36, 37, 11, 12, 13, 65, 15, 0, + 16, 0, 42, 43, 0, 0, 0, 0, 44, 0, + 0, 0, 45, 0, 0, 0, 0, 0, 66, 0, + 25, 2, 3, 4, 5, 0, 0, 0, 0, 0, + 0, 0, 11, 12, 13, 65, 15, 0, 16, 0, + 0, 32, 0, 0, 0, 0, 0, 0, 33, 34, + 35, 36, 37, 0, 0, 0, 66, 0, 25, 0, + 0, 42, 43, 0, 0, 0, 0, 44, 0, 0, + 0, 45, 0, 0, 0, 0, 0, 0, 0, 32, + 2, 3, 4, 5, 0, 0, 33, 34, 35, 36, + 37, 11, 12, 13, 65, 15, 0, 16, 0, 42, + 43, 0, 0, 0, 0, 70, 0, 0, 0, 45, + 0, 0, 0, 0, 0, 66, 0, 25, 2, 3, + 4, 5, 0, 0, 0, 0, 0, 0, 0, 11, + 12, 13, 65, 15, 0, 16, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 33, 34, 35, 36, 37, + 0, 0, 0, 66, 0, 25, 0, 0, 42, 43, + 0, 0, 0, 0, 75, 0, 0, 0, 45, 0, + 0, 0, 0, 0, 0, 0, 32, 2, 3, 4, + 5, 0, 0, 33, 34, 35, 36, 37, 11, 12, + 13, 65, 15, 0, 16, 0, 42, 43, 0, 0, + 0, 0, 77, 0, 0, 0, 45, 0, 0, 0, + 0, 0, 66, 0, 25, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, + 164, 0, 33, 34, 35, 36, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 42, 43, 0, 0, 0, + 0, 127, 132, 133, 0, 45, 0, 134, 135, 136, + 0, 137, 165, 166, 138, 139, 140, 0, 178, 0, + 0, 0, 0, 0, 179, 0, 0, 0, 0, 141, + 142, 143, 144, 145, 0, 132, 133, 0, 146, 147, + 134, 135, 136, 0, 137, 0, 0, 138, 139, 140, + 0, 180, 0, 0, 0, 0, 0, 181, 0, 0, + 0, 0, 141, 142, 143, 144, 145, 0, 132, 133, + 0, 146, 147, 134, 135, 136, 0, 137, 0, 0, + 138, 139, 140, 0, 182, 0, 0, 0, 0, 0, + 183, 0, 0, 0, 0, 141, 142, 143, 144, 145, + 0, 132, 133, 0, 146, 147, 134, 135, 136, 0, + 137, 0, 0, 138, 139, 140, 0, 184, 0, 0, + 0, 0, 0, 185, 0, 0, 0, 0, 141, 142, + 143, 144, 145, 0, 132, 133, 0, 146, 147, 134, + 135, 136, 0, 137, 0, 0, 138, 139, 140, 0, + 267, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 141, 142, 143, 144, 145, 0, 132, 133, 0, + 146, 147, 134, 135, 136, 0, 137, 0, 0, 138, + 139, 140, 0, 268, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 141, 142, 143, 144, 145, 0, + 132, 133, 0, 146, 147, 134, 135, 136, 0, 137, + 0, 0, 138, 139, 140, 0, 269, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 141, 142, 143, + 144, 145, 0, 132, 133, 0, 146, 147, 134, 135, + 136, 0, 137, 0, 0, 138, 139, 140, 0, 270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 137, 138, 139, 140, 141, 0, 128, 129, 0, 142, - 143, 130, 131, 132, 0, 133, 0, 0, 134, 135, - 136, 0, 0, 0, 0, 0, 0, 0, 195, 0, - 0, 0, 0, 137, 138, 139, 140, 141, 0, 128, - 129, 0, 142, 143, 130, 131, 132, 0, 133, 0, - 0, 134, 135, 136, 0, 0, 0, 0, 0, 0, - 0, 0, 223, 0, 0, 0, 137, 138, 139, 140, - 141, 0, 62, 128, 129, 142, 143, 0, 130, 131, - 132, 0, 133, 0, 0, 134, 135, 136, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 168, 0, 224, - 137, 138, 139, 140, 141, 0, 128, 129, 0, 142, - 143, 130, 131, 132, 0, 133, 0, 0, 134, 135, - 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 137, 138, 139, 140, 141, 0, 128, - 129, 0, 142, 143, 130, 131, 132, 0, 133, 0, - 0, 134, 135, 136, 0, 0, 0, 0, 0, 179, - 180, 0, 0, 0, 0, 0, 137, 138, 139, 140, - 141, 0, 128, 129, 0, 142, 143, 130, 131, 132, - 0, 133, 0, 0, 134, 135, 136, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 193, 137, - 138, 139, 140, 141, 0, 128, 129, 184, 142, 143, - 130, 131, 132, 0, 133, 0, 0, 134, 135, 136, + 141, 142, 143, 144, 145, 0, 132, 133, 0, 146, + 147, 134, 135, 136, 0, 137, 0, 0, 138, 139, + 140, 0, 0, 0, 0, 0, 0, 0, 202, 0, + 0, 0, 0, 141, 142, 143, 144, 145, 0, 132, + 133, 0, 146, 147, 134, 135, 136, 0, 137, 0, + 0, 138, 139, 140, 0, 0, 0, 0, 0, 0, + 0, 0, 232, 0, 0, 0, 141, 142, 143, 144, + 145, 0, 63, 132, 133, 146, 147, 0, 134, 135, + 136, 0, 137, 0, 0, 138, 139, 140, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 175, 0, 233, + 141, 142, 143, 144, 145, 0, 132, 133, 0, 146, + 147, 134, 135, 136, 0, 137, 0, 0, 138, 139, + 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 141, 142, 143, 144, 145, 0, 132, + 133, 0, 146, 147, 134, 135, 136, 0, 137, 0, + 0, 138, 139, 140, 0, 0, 0, 0, 0, 186, + 187, 0, 0, 0, 0, 0, 141, 142, 143, 144, + 145, 0, 132, 133, 0, 146, 147, 134, 135, 136, + 0, 137, 0, 0, 138, 139, 140, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 200, 141, + 142, 143, 144, 145, 0, 132, 133, 191, 146, 147, + 134, 135, 136, 0, 137, 0, 0, 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 137, 138, 139, 140, 141, 0, 128, 129, - 184, 142, 143, 130, 131, 132, 0, 133, 0, 0, - 134, 135, 136, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 193, 137, 138, 139, 140, 141, - 0, 128, 129, 0, 142, 143, 130, 131, 132, 0, - 133, 0, 0, 134, 135, 136, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 137, 138, - 139, 140, 141, 0, 0, 0, 0, 142, 143 + 0, 0, 141, 142, 143, 144, 145, 0, 132, 133, + 191, 146, 147, 134, 135, 136, 0, 137, 0, 0, + 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 200, 141, 142, 143, 144, 145, + 0, 132, 133, 0, 146, 147, 134, 135, 136, 0, + 137, 0, 0, 138, 139, 140, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, + 143, 144, 145, 0, 0, 0, 0, 146, 147 }; static const yytype_int16 yycheck[] = { - 0, 49, 0, 54, 49, 4, 29, 93, 7, 8, - 9, 274, 227, 12, 13, 72, 121, 95, 123, 44, - 19, 24, 100, 22, 1, 46, 28, 32, 291, 28, - 29, 24, 31, 32, 33, 34, 35, 36, 86, 96, - 97, 86, 41, 42, 43, 44, 71, 262, 53, 297, - 75, 53, 12, 13, 53, 24, 55, 245, 300, 30, - 248, 24, 310, 86, 24, 95, 65, 24, 45, 311, - 100, 167, 71, 41, 73, 43, 75, 100, 49, 95, - 79, 93, 81, 24, 100, 24, 182, 24, 100, 51, - 52, 99, 100, 24, 93, 93, 192, 94, 94, 86, - 94, 289, 290, 41, 24, 100, 294, 24, 296, 100, - 100, 100, 48, 48, 100, 24, 24, 24, 306, 307, - 120, 24, 121, 122, 123, 95, 24, 49, 95, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 28, 146, 24, 100, - 127, 24, 340, 28, 32, 154, 53, 48, 28, 158, - 159, 28, 161, 162, 28, 164, 165, 48, 28, 168, - 189, 120, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 285, 310, 29, 13, -1, 186, 284, 66, - 67, -1, 69, -1, 193, 72, 195, 302, 249, -1, - -1, -1, -1, 299, -1, -1, -1, -1, 313, -1, - 87, 88, 89, 90, 91, 192, -1, -1, 243, 96, - 97, -1, -1, -1, 223, 224, -1, -1, -1, -1, - 326, -1, 328, 252, -1, -1, -1, -1, 334, -1, - -1, -1, -1, -1, 243, 264, -1, -1, 267, 268, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 258, - 259, 260, 261, 314, 283, -1, -1, 266, -1, -1, - -1, -1, -1, -1, 293, -1, -1, 254, -1, -1, - 257, 300, -1, 282, -1, 336, -1, -1, -1, 308, - 309, 310, -1, -1, -1, 66, 67, -1, 69, -1, - 319, 72, 279, 302, 66, 67, 325, 69, 327, -1, - 72, -1, -1, -1, 313, -1, -1, 88, 89, 90, - 91, -1, -1, 342, 343, 96, 97, -1, 90, 91, - 0, 1, -1, -1, 96, 97, -1, -1, 338, -1, - 340, 11, 12, 13, 14, -1, 16, 17, 18, 19, - 20, -1, 22, 23, 24, 25, -1, 27, -1, 29, - -1, -1, -1, 33, -1, 35, 36, 37, -1, -1, - 40, -1, -1, -1, -1, 45, 46, 47, -1, -1, - 50, -1, -1, -1, 54, 55, 56, 57, -1, 59, - -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, - -1, -1, -1, -1, -1, 75, 76, 77, 78, 79, - -1, -1, 82, 83, 84, 85, -1, -1, 88, 89, - -1, -1, -1, 93, 94, -1, -1, -1, 98, 11, + 0, 30, 0, 50, 55, 4, 13, 14, 7, 8, + 9, 50, 283, 12, 13, 14, 125, 236, 127, 45, + 1, 20, 31, 96, 23, 73, 29, 96, 101, 300, + 29, 30, 101, 32, 33, 34, 35, 36, 37, 33, + 87, 50, 94, 42, 43, 44, 45, 73, 87, 97, + 98, 54, 271, 79, 95, 54, 254, 56, 174, 257, + 54, 90, 25, 70, 306, 46, 87, 66, 75, 12, + 13, 70, 94, 189, 73, 104, 75, 319, 77, 101, + 79, 47, 25, 199, 83, 42, 85, 44, 309, 67, + 68, 25, 70, 52, 53, 73, 94, 25, 97, 320, + 298, 299, 25, 96, 96, 303, 25, 305, 101, 101, + 88, 89, 90, 91, 92, 25, 96, 315, 316, 97, + 98, 101, 25, 25, 124, 25, 125, 126, 127, 100, + 101, 95, 101, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 131, 349, 101, 152, 95, 42, 25, 49, 25, 101, + 49, 101, 161, 101, 25, 25, 165, 166, 25, 168, + 169, 25, 171, 172, 96, 96, 175, 293, 196, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 25, + 29, 50, 308, 25, 193, 101, 29, 25, 33, 54, + 49, 200, 311, 202, 29, 29, 29, 258, 49, 29, + 124, 294, 319, 322, 67, 68, 30, 70, 199, 335, + 73, 337, -1, -1, -1, -1, 252, 343, -1, -1, + -1, -1, -1, 232, 233, -1, 89, 90, 91, 92, + -1, -1, -1, 261, 97, 98, -1, -1, -1, -1, + -1, -1, -1, 252, -1, 273, -1, -1, 276, 277, + -1, -1, -1, -1, -1, -1, -1, -1, 267, 268, + 269, 270, 323, -1, 292, -1, 275, -1, -1, -1, + -1, -1, 263, -1, 302, 266, -1, -1, -1, -1, + -1, 309, 291, -1, 345, -1, -1, -1, -1, 317, + 318, 319, -1, -1, -1, 67, 68, 288, 70, -1, + 328, 73, 311, -1, -1, -1, 334, -1, 336, -1, + -1, -1, -1, 322, -1, -1, -1, -1, -1, 91, + 92, -1, -1, 351, 352, 97, 98, -1, -1, 0, + 1, -1, -1, -1, -1, -1, -1, 347, -1, 349, + 11, 12, 13, 14, -1, 16, 17, 18, 19, 20, + -1, 22, 23, 24, 25, 26, -1, 28, -1, 30, + -1, -1, -1, 34, -1, 36, 37, 38, -1, -1, + 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, + 51, -1, -1, -1, 55, 56, 57, 58, -1, 60, + -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, + -1, -1, -1, -1, -1, 76, 77, 78, 79, 80, + -1, -1, 83, 84, 85, 86, -1, -1, 89, 90, + -1, -1, -1, 94, 95, -1, -1, -1, 99, 11, 12, 13, 14, -1, 16, 17, 18, 19, 20, -1, - 22, 23, 24, 25, -1, 27, -1, 29, -1, -1, - -1, 33, -1, 35, 36, 37, -1, -1, 40, -1, - -1, -1, -1, 45, 46, 47, -1, -1, 50, -1, - -1, -1, 54, 55, 56, 57, -1, 59, -1, -1, - -1, -1, -1, -1, -1, -1, 68, -1, -1, -1, - -1, -1, -1, 75, 76, 77, 78, 79, -1, -1, - 82, 83, 84, 85, -1, -1, 88, 89, -1, -1, - -1, -1, 94, -1, -1, -1, 98, 11, 12, 13, + 22, 23, 24, 25, 26, -1, 28, -1, 30, -1, + -1, -1, 34, -1, 36, 37, 38, -1, -1, 41, + -1, -1, -1, -1, 46, 47, 48, -1, -1, 51, + -1, -1, -1, 55, 56, 57, 58, -1, 60, -1, + -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, + -1, -1, -1, -1, 76, 77, 78, 79, 80, -1, + -1, 83, 84, 85, 86, -1, -1, 89, 90, -1, + -1, -1, -1, 95, -1, -1, -1, 99, 11, 12, + 13, 14, -1, 16, 17, 18, 19, 20, -1, 22, + 23, 24, 25, 26, -1, 28, 29, 30, -1, -1, + -1, 34, -1, 36, 37, 38, -1, -1, -1, -1, + -1, -1, -1, 46, 47, 48, -1, -1, 51, -1, + -1, -1, -1, -1, 57, 58, -1, 60, -1, -1, + -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, + -1, -1, -1, 76, 77, 78, 79, 80, -1, -1, + 83, 84, -1, 86, -1, -1, 89, 90, -1, -1, + -1, 94, 95, -1, -1, -1, 99, 11, 12, 13, 14, -1, 16, 17, 18, 19, 20, -1, 22, 23, - 24, 25, -1, 27, 28, 29, -1, -1, -1, 33, - -1, 35, 36, 37, -1, -1, -1, -1, -1, -1, - -1, 45, 46, 47, -1, -1, 50, -1, -1, -1, - -1, -1, 56, 57, -1, 59, -1, -1, -1, -1, - -1, -1, -1, -1, 68, -1, -1, -1, -1, -1, - -1, 75, 76, 77, 78, 79, -1, -1, 82, 83, - -1, 85, -1, -1, 88, 89, -1, -1, -1, 93, - 94, -1, -1, -1, 98, 11, 12, 13, 14, -1, + 24, 25, 26, -1, 28, -1, 30, -1, -1, -1, + 34, -1, 36, 37, 38, -1, -1, -1, -1, -1, + -1, -1, 46, 47, 48, -1, -1, 51, -1, -1, + -1, -1, -1, 57, 58, -1, 60, -1, -1, -1, + -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, + -1, -1, 76, 77, 78, 79, 80, -1, -1, 83, + 84, -1, 86, -1, -1, 89, 90, -1, -1, -1, + 94, 95, -1, -1, -1, 99, 11, 12, 13, 14, + -1, 16, 17, 18, 19, 20, -1, 22, 23, 24, + 25, 26, -1, 28, -1, 30, -1, -1, -1, 34, + -1, 36, 37, 38, -1, -1, -1, -1, -1, -1, + -1, 46, 47, 48, -1, -1, 51, -1, -1, -1, + -1, -1, 57, 58, -1, 60, -1, -1, -1, -1, + -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, + -1, 76, 77, 78, 79, 80, -1, -1, 83, 84, + -1, 86, -1, -1, 89, 90, -1, -1, -1, -1, + 95, -1, -1, -1, 99, 11, 12, 13, 14, -1, 16, 17, 18, 19, 20, -1, 22, 23, 24, 25, - -1, 27, -1, 29, -1, -1, -1, 33, -1, 35, - 36, 37, -1, -1, -1, -1, -1, -1, -1, 45, - 46, 47, -1, -1, 50, -1, -1, -1, -1, -1, - 56, 57, -1, 59, -1, -1, -1, -1, -1, -1, - -1, -1, 68, -1, -1, -1, -1, -1, -1, 75, - 76, 77, 78, 79, -1, -1, 82, 83, -1, 85, - -1, -1, 88, 89, -1, -1, -1, 93, 94, -1, - -1, -1, 98, 11, 12, 13, 14, -1, 16, 17, - 18, 19, 20, -1, 22, 23, 24, 25, -1, 27, - -1, 29, -1, -1, -1, 33, -1, 35, 36, 37, - -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, - -1, -1, 50, -1, -1, -1, -1, -1, 56, 57, - -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, - 68, -1, -1, -1, -1, -1, -1, 75, 76, 77, - 78, 79, -1, -1, 82, 83, -1, 85, -1, -1, - 88, 89, -1, -1, -1, -1, 94, -1, -1, -1, - 98, 11, 12, 13, 14, -1, 16, 17, 18, 19, - 20, -1, 22, 23, 24, 25, -1, 27, -1, 29, - -1, -1, -1, 33, -1, 35, 36, -1, -1, -1, - -1, -1, -1, -1, -1, 45, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, 56, 57, -1, 59, - -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, - -1, -1, -1, -1, -1, 75, 76, 77, 78, 79, - -1, -1, -1, 83, -1, 85, -1, -1, 88, 89, - 11, 12, 13, 14, 94, -1, -1, -1, 98, -1, - -1, 22, 23, 24, 25, -1, 27, -1, -1, -1, - -1, -1, -1, 34, -1, -1, -1, -1, 39, -1, - 41, 42, 43, 44, 45, -1, 47, -1, -1, 11, - 12, 13, 14, -1, -1, -1, -1, -1, -1, -1, - 22, 23, 24, 25, -1, 27, -1, 68, -1, -1, - -1, -1, 34, -1, 75, 76, 77, 78, 79, 41, - -1, 43, -1, 45, -1, 47, -1, 88, 89, 11, - 12, 13, 14, 94, -1, -1, 58, 98, -1, -1, - 22, 23, 24, 25, -1, 27, 68, -1, -1, -1, - -1, -1, -1, 75, 76, 77, 78, 79, -1, -1, - -1, -1, -1, 45, -1, 47, 88, 89, 11, 12, - 13, 14, 94, -1, -1, -1, 98, -1, -1, 22, - 23, 24, 25, -1, 27, -1, 68, -1, -1, -1, - -1, -1, -1, 75, 76, 77, 78, 79, -1, -1, - -1, -1, 45, -1, 47, -1, 88, 89, 11, 12, - 13, 14, 94, -1, -1, -1, 98, -1, -1, 22, - 23, 24, 25, -1, 27, 68, -1, -1, -1, -1, - -1, -1, 75, 76, 77, 78, 79, -1, -1, -1, - -1, -1, 45, -1, 47, 88, 89, -1, -1, -1, - -1, 94, -1, -1, -1, 98, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 68, -1, -1, -1, -1, - 38, -1, 75, 76, 77, 78, 79, -1, -1, -1, - -1, -1, -1, -1, -1, 88, 89, -1, -1, -1, - -1, 94, 60, 61, -1, 98, -1, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, -1, 43, -1, - -1, -1, -1, -1, 49, -1, -1, -1, -1, 87, - 88, 89, 90, 91, -1, 60, 61, -1, 96, 97, - 65, 66, 67, -1, 69, -1, -1, 72, 73, 74, - -1, 43, -1, -1, -1, -1, -1, 49, -1, -1, - -1, -1, 87, 88, 89, 90, 91, -1, 60, 61, - -1, 96, 97, 65, 66, 67, -1, 69, -1, -1, - 72, 73, 74, -1, 43, -1, -1, -1, -1, -1, - 49, -1, -1, -1, -1, 87, 88, 89, 90, 91, - -1, 60, 61, -1, 96, 97, 65, 66, 67, -1, - 69, -1, -1, 72, 73, 74, -1, 43, -1, -1, - -1, -1, -1, 49, -1, -1, -1, -1, 87, 88, - 89, 90, 91, -1, 60, 61, -1, 96, 97, 65, - 66, 67, -1, 69, -1, -1, 72, 73, 74, -1, - 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 87, 88, 89, 90, 91, -1, 60, 61, -1, - 96, 97, 65, 66, 67, -1, 69, -1, -1, 72, - 73, 74, -1, 43, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 87, 88, 89, 90, 91, -1, - 60, 61, -1, 96, 97, 65, 66, 67, -1, 69, - -1, -1, 72, 73, 74, -1, 43, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, - 90, 91, -1, 60, 61, -1, 96, 97, 65, 66, - 67, -1, 69, -1, -1, 72, 73, 74, -1, 43, + 26, -1, 28, -1, 30, -1, -1, -1, 34, -1, + 36, 37, -1, -1, -1, -1, -1, -1, -1, -1, + 46, -1, 48, -1, -1, -1, -1, -1, -1, -1, + -1, 57, 58, -1, 60, -1, -1, -1, -1, -1, + -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, + 76, 77, 78, 79, 80, -1, -1, -1, 84, -1, + 86, -1, -1, 89, 90, 11, 12, 13, 14, 95, + -1, -1, -1, 99, -1, -1, 22, 23, 24, 25, + 26, -1, 28, -1, -1, -1, -1, -1, -1, 35, + -1, -1, -1, -1, 40, -1, 42, 43, 44, 45, + 46, -1, 48, -1, 11, 12, 13, 14, -1, -1, + -1, -1, -1, -1, -1, 22, 23, 24, 25, 26, + -1, 28, -1, 69, -1, -1, -1, -1, 35, -1, + 76, 77, 78, 79, 80, 42, -1, 44, -1, 46, + -1, 48, -1, 89, 90, -1, -1, -1, -1, 95, + -1, -1, 59, 99, -1, -1, -1, -1, -1, -1, + -1, -1, 69, 11, 12, 13, 14, -1, -1, 76, + 77, 78, 79, 80, 22, 23, 24, 25, 26, -1, + 28, -1, 89, 90, -1, -1, -1, -1, 95, -1, + -1, -1, 99, -1, -1, -1, -1, -1, 46, -1, + 48, 11, 12, 13, 14, -1, -1, -1, -1, -1, + -1, -1, 22, 23, 24, 25, 26, -1, 28, -1, + -1, 69, -1, -1, -1, -1, -1, -1, 76, 77, + 78, 79, 80, -1, -1, -1, 46, -1, 48, -1, + -1, 89, 90, -1, -1, -1, -1, 95, -1, -1, + -1, 99, -1, -1, -1, -1, -1, -1, -1, 69, + 11, 12, 13, 14, -1, -1, 76, 77, 78, 79, + 80, 22, 23, 24, 25, 26, -1, 28, -1, 89, + 90, -1, -1, -1, -1, 95, -1, -1, -1, 99, + -1, -1, -1, -1, -1, 46, -1, 48, 11, 12, + 13, 14, -1, -1, -1, -1, -1, -1, -1, 22, + 23, 24, 25, 26, -1, 28, -1, -1, 69, -1, + -1, -1, -1, -1, -1, 76, 77, 78, 79, 80, + -1, -1, -1, 46, -1, 48, -1, -1, 89, 90, + -1, -1, -1, -1, 95, -1, -1, -1, 99, -1, + -1, -1, -1, -1, -1, -1, 69, 11, 12, 13, + 14, -1, -1, 76, 77, 78, 79, 80, 22, 23, + 24, 25, 26, -1, 28, -1, 89, 90, -1, -1, + -1, -1, 95, -1, -1, -1, 99, -1, -1, -1, + -1, -1, 46, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 87, 88, 89, 90, 91, -1, 60, 61, -1, 96, - 97, 65, 66, 67, -1, 69, -1, -1, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, 49, -1, - -1, -1, -1, 87, 88, 89, 90, 91, -1, 60, - 61, -1, 96, 97, 65, 66, 67, -1, 69, -1, - -1, 72, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, 49, -1, -1, -1, 87, 88, 89, 90, - 91, -1, 93, 60, 61, 96, 97, -1, 65, 66, - 67, -1, 69, -1, -1, 72, 73, 74, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 51, -1, 86, - 87, 88, 89, 90, 91, -1, 60, 61, -1, 96, - 97, 65, 66, 67, -1, 69, -1, -1, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 87, 88, 89, 90, 91, -1, 60, - 61, -1, 96, 97, 65, 66, 67, -1, 69, -1, - -1, 72, 73, 74, -1, -1, -1, -1, -1, 80, - 81, -1, -1, -1, -1, -1, 87, 88, 89, 90, - 91, -1, 60, 61, -1, 96, 97, 65, 66, 67, - -1, 69, -1, -1, 72, 73, 74, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 86, 87, - 88, 89, 90, 91, -1, 60, 61, 95, 96, 97, - 65, 66, 67, -1, 69, -1, -1, 72, 73, 74, + -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, + 39, -1, 76, 77, 78, 79, 80, -1, -1, -1, + -1, -1, -1, -1, -1, 89, 90, -1, -1, -1, + -1, 95, 61, 62, -1, 99, -1, 66, 67, 68, + -1, 70, 71, 72, 73, 74, 75, -1, 44, -1, + -1, -1, -1, -1, 50, -1, -1, -1, -1, 88, + 89, 90, 91, 92, -1, 61, 62, -1, 97, 98, + 66, 67, 68, -1, 70, -1, -1, 73, 74, 75, + -1, 44, -1, -1, -1, -1, -1, 50, -1, -1, + -1, -1, 88, 89, 90, 91, 92, -1, 61, 62, + -1, 97, 98, 66, 67, 68, -1, 70, -1, -1, + 73, 74, 75, -1, 44, -1, -1, -1, -1, -1, + 50, -1, -1, -1, -1, 88, 89, 90, 91, 92, + -1, 61, 62, -1, 97, 98, 66, 67, 68, -1, + 70, -1, -1, 73, 74, 75, -1, 44, -1, -1, + -1, -1, -1, 50, -1, -1, -1, -1, 88, 89, + 90, 91, 92, -1, 61, 62, -1, 97, 98, 66, + 67, 68, -1, 70, -1, -1, 73, 74, 75, -1, + 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 88, 89, 90, 91, 92, -1, 61, 62, -1, + 97, 98, 66, 67, 68, -1, 70, -1, -1, 73, + 74, 75, -1, 44, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 88, 89, 90, 91, 92, -1, + 61, 62, -1, 97, 98, 66, 67, 68, -1, 70, + -1, -1, 73, 74, 75, -1, 44, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 88, 89, 90, + 91, 92, -1, 61, 62, -1, 97, 98, 66, 67, + 68, -1, 70, -1, -1, 73, 74, 75, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 87, 88, 89, 90, 91, -1, 60, 61, - 95, 96, 97, 65, 66, 67, -1, 69, -1, -1, - 72, 73, 74, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 86, 87, 88, 89, 90, 91, - -1, 60, 61, -1, 96, 97, 65, 66, 67, -1, - 69, -1, -1, 72, 73, 74, -1, -1, -1, -1, + 88, 89, 90, 91, 92, -1, 61, 62, -1, 97, + 98, 66, 67, 68, -1, 70, -1, -1, 73, 74, + 75, -1, -1, -1, -1, -1, -1, -1, 50, -1, + -1, -1, -1, 88, 89, 90, 91, 92, -1, 61, + 62, -1, 97, 98, 66, 67, 68, -1, 70, -1, + -1, 73, 74, 75, -1, -1, -1, -1, -1, -1, + -1, -1, 50, -1, -1, -1, 88, 89, 90, 91, + 92, -1, 94, 61, 62, 97, 98, -1, 66, 67, + 68, -1, 70, -1, -1, 73, 74, 75, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 52, -1, 87, + 88, 89, 90, 91, 92, -1, 61, 62, -1, 97, + 98, 66, 67, 68, -1, 70, -1, -1, 73, 74, + 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 88, 89, 90, 91, 92, -1, 61, + 62, -1, 97, 98, 66, 67, 68, -1, 70, -1, + -1, 73, 74, 75, -1, -1, -1, -1, -1, 81, + 82, -1, -1, -1, -1, -1, 88, 89, 90, 91, + 92, -1, 61, 62, -1, 97, 98, 66, 67, 68, + -1, 70, -1, -1, 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 87, 88, - 89, 90, 91, -1, -1, -1, -1, 96, 97 + 89, 90, 91, 92, -1, 61, 62, 96, 97, 98, + 66, 67, 68, -1, 70, -1, -1, 73, 74, 75, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 88, 89, 90, 91, 92, -1, 61, 62, + 96, 97, 98, 66, 67, 68, -1, 70, -1, -1, + 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 87, 88, 89, 90, 91, 92, + -1, 61, 62, -1, 97, 98, 66, 67, 68, -1, + 70, -1, -1, 73, 74, 75, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 88, 89, + 90, 91, 92, -1, -1, -1, -1, 97, 98 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1246,40 +1285,41 @@ static const yytype_int16 yycheck[] = static const yytype_uint8 yystos[] = { 0, 1, 11, 12, 13, 14, 16, 17, 18, 19, - 20, 22, 23, 24, 25, 27, 29, 33, 35, 36, - 37, 40, 45, 46, 47, 50, 54, 55, 56, 57, - 59, 68, 75, 76, 77, 78, 79, 82, 83, 84, - 85, 88, 89, 94, 98, 102, 104, 105, 106, 107, - 108, 115, 116, 117, 122, 123, 124, 125, 129, 132, - 134, 141, 93, 103, 24, 45, 124, 124, 124, 124, - 143, 24, 124, 94, 143, 133, 46, 24, 126, 34, - 39, 41, 42, 43, 44, 124, 130, 131, 24, 124, - 51, 52, 12, 13, 24, 24, 24, 24, 124, 58, - 130, 131, 24, 128, 124, 124, 124, 124, 124, 124, - 24, 127, 24, 94, 124, 124, 124, 124, 142, 0, - 103, 94, 86, 94, 114, 124, 106, 124, 60, 61, - 65, 66, 67, 69, 72, 73, 74, 87, 88, 89, - 90, 91, 96, 97, 94, 124, 100, 142, 124, 142, - 142, 100, 124, 124, 41, 131, 135, 38, 70, 71, - 24, 49, 86, 124, 49, 86, 48, 136, 51, 131, - 100, 43, 49, 43, 49, 43, 49, 43, 49, 80, - 81, 100, 137, 24, 95, 99, 100, 104, 114, 124, - 114, 124, 48, 86, 120, 49, 103, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 95, 24, 124, 119, 24, 124, - 124, 124, 124, 49, 86, 124, 124, 119, 124, 24, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 24, 119, 95, 100, 124, 95, 120, 95, 103, 119, - 124, 124, 121, 24, 139, 124, 124, 139, 43, 43, - 43, 43, 138, 142, 121, 30, 49, 121, 106, 103, - 107, 120, 100, 103, 103, 124, 124, 124, 124, 139, - 95, 120, 49, 124, 120, 120, 28, 24, 100, 140, - 140, 103, 28, 124, 120, 28, 53, 119, 32, 53, - 111, 112, 118, 24, 121, 121, 140, 120, 121, 121, - 110, 111, 113, 118, 119, 112, 120, 114, 121, 121, - 120, 120, 113, 120, 114, 106, 53, 109, 48, 28, - 120, 28, 28, 28, 48, 120, 119, 120, 119, 28, - 119, 106, 107, 121, 120, 120 + 20, 22, 23, 24, 25, 26, 28, 30, 34, 36, + 37, 38, 41, 46, 47, 48, 51, 55, 56, 57, + 58, 60, 69, 76, 77, 78, 79, 80, 83, 84, + 85, 86, 89, 90, 95, 99, 103, 105, 106, 107, + 108, 109, 116, 117, 118, 123, 124, 125, 126, 130, + 133, 135, 142, 94, 104, 25, 46, 125, 125, 125, + 95, 125, 144, 25, 125, 95, 144, 95, 144, 134, + 47, 25, 127, 35, 40, 42, 43, 44, 45, 125, + 131, 132, 25, 125, 52, 53, 12, 13, 25, 25, + 25, 25, 125, 59, 131, 132, 25, 129, 125, 125, + 125, 125, 125, 125, 25, 128, 25, 95, 125, 125, + 125, 125, 143, 0, 104, 95, 87, 95, 115, 125, + 107, 125, 61, 62, 66, 67, 68, 70, 73, 74, + 75, 88, 89, 90, 91, 92, 97, 98, 95, 125, + 125, 144, 101, 143, 144, 125, 143, 143, 101, 125, + 125, 42, 132, 136, 39, 71, 72, 25, 50, 87, + 125, 50, 87, 49, 137, 52, 132, 101, 44, 50, + 44, 50, 44, 50, 44, 50, 81, 82, 101, 138, + 25, 96, 100, 101, 105, 115, 125, 115, 125, 49, + 87, 121, 50, 104, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 96, 125, 96, 96, 25, 125, 120, 25, 125, 125, + 125, 125, 50, 87, 125, 125, 120, 125, 25, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 25, + 120, 96, 101, 125, 96, 121, 96, 104, 120, 125, + 125, 122, 25, 140, 125, 125, 140, 44, 44, 44, + 44, 139, 143, 122, 31, 50, 122, 107, 104, 108, + 121, 101, 104, 104, 125, 125, 125, 125, 140, 96, + 121, 50, 125, 121, 121, 29, 25, 101, 141, 141, + 104, 29, 125, 121, 29, 54, 120, 33, 54, 112, + 113, 119, 25, 122, 122, 141, 121, 122, 122, 111, + 112, 114, 119, 120, 113, 121, 115, 122, 122, 121, + 121, 114, 121, 115, 107, 54, 110, 49, 29, 121, + 29, 29, 29, 49, 121, 120, 121, 120, 29, 120, + 107, 108, 122, 121, 121 }; #define yyerrok (yyerrstatus = 0) @@ -2492,34 +2532,44 @@ yyreduce: case 62: #line 413 "engines/director/lingo/lingo-gr.y" { - (yyval.code) = g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->u.func); + g_lingo->codeFunc((yyvsp[(1) - (1)].s), 0); delete (yyvsp[(1) - (1)].s); ;} break; case 63: #line 416 "engines/director/lingo/lingo-gr.y" { - g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (2)].s)]->u.func); + g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1); delete (yyvsp[(1) - (2)].s); ;} break; case 64: #line 419 "engines/director/lingo/lingo-gr.y" + { g_lingo->codeFunc((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].narg)); ;} + break; + + case 65: +#line 420 "engines/director/lingo/lingo-gr.y" + { g_lingo->codeFunc((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].narg)); ;} + break; + + case 66: +#line 421 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->codeFunc((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].narg)); delete (yyvsp[(1) - (4)].s); ;} break; - case 65: -#line 422 "engines/director/lingo/lingo-gr.y" + case 67: +#line 424 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_eval); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;} break; - case 66: -#line 426 "engines/director/lingo/lingo-gr.y" + case 68: +#line 428 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->codeConst(0); // Put dummy id g_lingo->code1(g_lingo->c_theentitypush); @@ -2529,8 +2579,8 @@ yyreduce: g_lingo->code2(e, f); ;} break; - case 67: -#line 433 "engines/director/lingo/lingo-gr.y" + case 69: +#line 435 "engines/director/lingo/lingo-gr.y" { (yyval.code) = g_lingo->code1(g_lingo->c_theentitypush); inst e = 0, f = 0; @@ -2539,346 +2589,352 @@ yyreduce: g_lingo->code2(e, f); ;} break; - case 69: -#line 440 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_add); ;} - break; - - case 70: -#line 441 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_sub); ;} - break; - case 71: #line 442 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_mul); ;} + { g_lingo->code1(g_lingo->c_add); ;} break; case 72: #line 443 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_div); ;} + { g_lingo->code1(g_lingo->c_sub); ;} break; case 73: #line 444 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_mod); ;} + { g_lingo->code1(g_lingo->c_mul); ;} break; case 74: #line 445 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_gt); ;} + { g_lingo->code1(g_lingo->c_div); ;} break; case 75: #line 446 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_lt); ;} + { g_lingo->code1(g_lingo->c_mod); ;} break; case 76: #line 447 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_neq); ;} + { g_lingo->code1(g_lingo->c_gt); ;} break; case 77: #line 448 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_ge); ;} + { g_lingo->code1(g_lingo->c_lt); ;} break; case 78: #line 449 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_le); ;} + { g_lingo->code1(g_lingo->c_neq); ;} break; case 79: #line 450 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_and); ;} + { g_lingo->code1(g_lingo->c_ge); ;} break; case 80: #line 451 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_or); ;} + { g_lingo->code1(g_lingo->c_le); ;} break; case 81: #line 452 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_not); ;} + { g_lingo->code1(g_lingo->c_and); ;} break; case 82: #line 453 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_ampersand); ;} + { g_lingo->code1(g_lingo->c_or); ;} break; case 83: #line 454 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_concat); ;} + { g_lingo->code1(g_lingo->c_not); ;} break; case 84: #line 455 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_contains); ;} + { g_lingo->code1(g_lingo->c_ampersand); ;} break; case 85: #line 456 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_starts); ;} + { g_lingo->code1(g_lingo->c_concat); ;} break; case 86: #line 457 "engines/director/lingo/lingo-gr.y" - { (yyval.code) = (yyvsp[(2) - (2)].code); ;} + { g_lingo->code1(g_lingo->c_contains); ;} break; case 87: #line 458 "engines/director/lingo/lingo-gr.y" - { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;} + { g_lingo->code1(g_lingo->c_starts); ;} break; case 88: #line 459 "engines/director/lingo/lingo-gr.y" - { (yyval.code) = (yyvsp[(2) - (3)].code); ;} + { (yyval.code) = (yyvsp[(2) - (2)].code); ;} break; case 89: #line 460 "engines/director/lingo/lingo-gr.y" - { (yyval.code) = g_lingo->codeArray((yyvsp[(2) - (3)].narg)); ;} + { (yyval.code) = (yyvsp[(2) - (2)].code); g_lingo->code1(g_lingo->c_negate); ;} break; case 90: #line 461 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_intersects); ;} + { (yyval.code) = (yyvsp[(2) - (3)].code); ;} break; case 91: #line 462 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_within); ;} + { (yyval.code) = g_lingo->codeArray((yyvsp[(2) - (3)].narg)); ;} break; case 92: #line 463 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_charOf); ;} + { g_lingo->code1(g_lingo->c_intersects); ;} break; case 93: #line 464 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_charToOf); ;} + { g_lingo->code1(g_lingo->c_within); ;} break; case 94: #line 465 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_itemOf); ;} + { g_lingo->code1(g_lingo->c_charOf); ;} break; case 95: #line 466 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_itemToOf); ;} + { g_lingo->code1(g_lingo->c_charToOf); ;} break; case 96: #line 467 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_lineOf); ;} + { g_lingo->code1(g_lingo->c_itemOf); ;} break; case 97: #line 468 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_lineToOf); ;} + { g_lingo->code1(g_lingo->c_itemToOf); ;} break; case 98: #line 469 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_wordOf); ;} + { g_lingo->code1(g_lingo->c_lineOf); ;} break; case 99: #line 470 "engines/director/lingo/lingo-gr.y" - { g_lingo->code1(g_lingo->c_wordToOf); ;} + { g_lingo->code1(g_lingo->c_lineToOf); ;} break; case 100: -#line 473 "engines/director/lingo/lingo-gr.y" +#line 471 "engines/director/lingo/lingo-gr.y" + { g_lingo->code1(g_lingo->c_wordOf); ;} + break; + + case 101: +#line 472 "engines/director/lingo/lingo-gr.y" + { g_lingo->code1(g_lingo->c_wordToOf); ;} + break; + + case 102: +#line 475 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_printtop); ;} break; - case 103: -#line 476 "engines/director/lingo/lingo-gr.y" + case 105: +#line 478 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_exitRepeat); ;} break; - case 104: -#line 477 "engines/director/lingo/lingo-gr.y" + case 106: +#line 479 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); ;} break; - case 108: -#line 482 "engines/director/lingo/lingo-gr.y" + case 110: +#line 484 "engines/director/lingo/lingo-gr.y" { - g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->u.func); + g_lingo->codeFunc((yyvsp[(1) - (1)].s), 0); delete (yyvsp[(1) - (1)].s); ;} break; - case 109: -#line 485 "engines/director/lingo/lingo-gr.y" + case 111: +#line 487 "engines/director/lingo/lingo-gr.y" { - g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (2)].s)]->u.func); + g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1); delete (yyvsp[(1) - (2)].s); ;} break; - case 110: -#line 488 "engines/director/lingo/lingo-gr.y" + case 112: +#line 490 "engines/director/lingo/lingo-gr.y" { - g_lingo->code1(g_lingo->_builtins[*(yyvsp[(1) - (2)].s)]->u.func); + g_lingo->codeFunc((yyvsp[(1) - (2)].s), 1); delete (yyvsp[(1) - (2)].s); ;} break; - case 111: -#line 491 "engines/director/lingo/lingo-gr.y" + case 113: +#line 493 "engines/director/lingo/lingo-gr.y" { - g_lingo->code2(g_lingo->c_voidpush, g_lingo->_builtins[*(yyvsp[(1) - (1)].s)]->u.func); + g_lingo->code1(g_lingo->c_voidpush); + g_lingo->codeFunc((yyvsp[(1) - (1)].s), 1); delete (yyvsp[(1) - (1)].s); ;} break; - case 112: -#line 494 "engines/director/lingo/lingo-gr.y" + case 114: +#line 497 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFunc((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].narg)); ;} break; - case 113: -#line 495 "engines/director/lingo/lingo-gr.y" + case 115: +#line 498 "engines/director/lingo/lingo-gr.y" + { g_lingo->codeFunc((yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].narg)); ;} + break; + + case 116: +#line 499 "engines/director/lingo/lingo-gr.y" { g_lingo->codeMe((yyvsp[(3) - (4)].s), 0); ;} break; - case 114: -#line 496 "engines/director/lingo/lingo-gr.y" + case 117: +#line 500 "engines/director/lingo/lingo-gr.y" { g_lingo->codeMe((yyvsp[(3) - (6)].s), (yyvsp[(5) - (6)].narg)); ;} break; - case 115: -#line 497 "engines/director/lingo/lingo-gr.y" + case 118: +#line 501 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_open); ;} break; - case 116: -#line 498 "engines/director/lingo/lingo-gr.y" + case 119: +#line 502 "engines/director/lingo/lingo-gr.y" { g_lingo->code2(g_lingo->c_voidpush, g_lingo->c_open); ;} break; - case 117: -#line 499 "engines/director/lingo/lingo-gr.y" + case 120: +#line 503 "engines/director/lingo/lingo-gr.y" { Common::String s(*(yyvsp[(1) - (3)].s)); s += '-'; s += *(yyvsp[(2) - (3)].s); g_lingo->codeFunc(&s, (yyvsp[(3) - (3)].narg)); ;} break; - case 118: -#line 502 "engines/director/lingo/lingo-gr.y" + case 121: +#line 506 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_global); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;} break; - case 119: -#line 503 "engines/director/lingo/lingo-gr.y" + case 122: +#line 507 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_global); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;} break; - case 120: -#line 506 "engines/director/lingo/lingo-gr.y" + case 123: +#line 510 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_property); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;} break; - case 121: -#line 507 "engines/director/lingo/lingo-gr.y" + case 124: +#line 511 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_property); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;} break; - case 122: -#line 510 "engines/director/lingo/lingo-gr.y" + case 125: +#line 514 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_instance); g_lingo->codeString((yyvsp[(1) - (1)].s)->c_str()); delete (yyvsp[(1) - (1)].s); ;} break; - case 123: -#line 511 "engines/director/lingo/lingo-gr.y" + case 126: +#line 515 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_instance); g_lingo->codeString((yyvsp[(3) - (3)].s)->c_str()); delete (yyvsp[(3) - (3)].s); ;} break; - case 124: -#line 522 "engines/director/lingo/lingo-gr.y" + case 127: +#line 526 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoloop); ;} break; - case 125: -#line 523 "engines/director/lingo/lingo-gr.y" + case 128: +#line 527 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotonext); ;} break; - case 126: -#line 524 "engines/director/lingo/lingo-gr.y" + case 129: +#line 528 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_gotoprevious); ;} break; - case 127: -#line 525 "engines/director/lingo/lingo-gr.y" + case 130: +#line 529 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(1); g_lingo->code1(g_lingo->c_goto); ;} break; - case 128: -#line 528 "engines/director/lingo/lingo-gr.y" + case 131: +#line 532 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(3); g_lingo->code1(g_lingo->c_goto); ;} break; - case 129: -#line 531 "engines/director/lingo/lingo-gr.y" + case 132: +#line 535 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(2); g_lingo->code1(g_lingo->c_goto); ;} break; - case 134: -#line 544 "engines/director/lingo/lingo-gr.y" + case 137: +#line 548 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_playdone); ;} break; - case 135: -#line 545 "engines/director/lingo/lingo-gr.y" + case 138: +#line 549 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(1); g_lingo->code1(g_lingo->c_play); ;} break; - case 136: -#line 548 "engines/director/lingo/lingo-gr.y" + case 139: +#line 552 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(3); g_lingo->code1(g_lingo->c_play); ;} break; - case 137: -#line 551 "engines/director/lingo/lingo-gr.y" + case 140: +#line 555 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(2); g_lingo->code1(g_lingo->c_play); ;} break; - case 138: -#line 554 "engines/director/lingo/lingo-gr.y" + case 141: +#line 558 "engines/director/lingo/lingo-gr.y" { g_lingo->codeSetImmediate(true); ;} break; - case 139: -#line 554 "engines/director/lingo/lingo-gr.y" + case 142: +#line 558 "engines/director/lingo/lingo-gr.y" { g_lingo->codeSetImmediate(false); g_lingo->codeFunc((yyvsp[(1) - (3)].s), (yyvsp[(3) - (3)].narg)); ;} break; - case 140: -#line 584 "engines/director/lingo/lingo-gr.y" + case 143: +#line 588 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;} break; - case 141: -#line 585 "engines/director/lingo/lingo-gr.y" + case 144: +#line 589 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); @@ -2886,38 +2942,38 @@ yyreduce: g_lingo->_indef = false; ;} break; - case 142: -#line 590 "engines/director/lingo/lingo-gr.y" + case 145: +#line 594 "engines/director/lingo/lingo-gr.y" { g_lingo->codeFactory(*(yyvsp[(2) - (2)].s)); ;} break; - case 143: -#line 593 "engines/director/lingo/lingo-gr.y" + case 146: +#line 597 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; ;} break; - case 144: -#line 594 "engines/director/lingo/lingo-gr.y" + case 147: +#line 598 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_procret); g_lingo->define(*(yyvsp[(2) - (8)].s), (yyvsp[(4) - (8)].code), (yyvsp[(5) - (8)].narg) + 1, &g_lingo->_currentFactory); g_lingo->_indef = false; ;} break; - case 145: -#line 598 "engines/director/lingo/lingo-gr.y" + case 148: +#line 602 "engines/director/lingo/lingo-gr.y" { g_lingo->_indef = true; g_lingo->_currentFactory.clear(); ;} break; - case 146: -#line 599 "engines/director/lingo/lingo-gr.y" + case 149: +#line 603 "engines/director/lingo/lingo-gr.y" { g_lingo->_ignoreMe = true; ;} break; - case 147: -#line 599 "engines/director/lingo/lingo-gr.y" + case 150: +#line 603 "engines/director/lingo/lingo-gr.y" { g_lingo->codeConst(0); // Push fake value on stack g_lingo->code1(g_lingo->c_procret); @@ -2929,33 +2985,33 @@ yyreduce: ;} break; - case 148: -#line 609 "engines/director/lingo/lingo-gr.y" + case 151: +#line 613 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 149: -#line 610 "engines/director/lingo/lingo-gr.y" + case 152: +#line 614 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(1) - (1)].s)); (yyval.narg) = 1; ;} break; - case 150: -#line 611 "engines/director/lingo/lingo-gr.y" + case 153: +#line 615 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(3) - (3)].s)); (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; - case 151: -#line 612 "engines/director/lingo/lingo-gr.y" + case 154: +#line 616 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArg((yyvsp[(4) - (4)].s)); (yyval.narg) = (yyvsp[(1) - (4)].narg) + 1; ;} break; - case 152: -#line 615 "engines/director/lingo/lingo-gr.y" + case 155: +#line 619 "engines/director/lingo/lingo-gr.y" { g_lingo->codeArgStore(); ;} break; - case 153: -#line 619 "engines/director/lingo/lingo-gr.y" + case 156: +#line 623 "engines/director/lingo/lingo-gr.y" { g_lingo->code1(g_lingo->c_call); g_lingo->codeString((yyvsp[(1) - (2)].s)->c_str()); @@ -2964,34 +3020,34 @@ yyreduce: g_lingo->code1(numpar); ;} break; - case 154: -#line 627 "engines/director/lingo/lingo-gr.y" + case 157: +#line 631 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 0; ;} break; - case 155: -#line 628 "engines/director/lingo/lingo-gr.y" + case 158: +#line 632 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; - case 156: -#line 629 "engines/director/lingo/lingo-gr.y" + case 159: +#line 633 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; - case 157: -#line 632 "engines/director/lingo/lingo-gr.y" + case 160: +#line 636 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = 1; ;} break; - case 158: -#line 633 "engines/director/lingo/lingo-gr.y" + case 161: +#line 637 "engines/director/lingo/lingo-gr.y" { (yyval.narg) = (yyvsp[(1) - (3)].narg) + 1; ;} break; /* Line 1267 of yacc.c. */ -#line 2995 "engines/director/lingo/lingo-gr.cpp" +#line 3051 "engines/director/lingo/lingo-gr.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -3205,6 +3261,6 @@ yyreturn: } -#line 636 "engines/director/lingo/lingo-gr.y" +#line 640 "engines/director/lingo/lingo-gr.y" diff --git a/engines/director/lingo/lingo-gr.h b/engines/director/lingo/lingo-gr.h index 2c4b95c3a6..0bd75956d2 100644 --- a/engines/director/lingo/lingo-gr.h +++ b/engines/director/lingo/lingo-gr.h @@ -60,68 +60,69 @@ FBLTIN = 276, FBLTINNOARGS = 277, FBLTINONEARG = 278, - ID = 279, - STRING = 280, - HANDLER = 281, - SYMBOL = 282, - ENDCLAUSE = 283, - tPLAYACCEL = 284, - tDOWN = 285, - tELSE = 286, - tNLELSIF = 287, - tEXIT = 288, - tFRAME = 289, - tGLOBAL = 290, - tGO = 291, - tIF = 292, - tINTO = 293, - tLOOP = 294, - tMACRO = 295, - tMOVIE = 296, - tNEXT = 297, - tOF = 298, - tPREVIOUS = 299, - tPUT = 300, - tREPEAT = 301, - tSET = 302, - tTHEN = 303, - tTO = 304, - tWHEN = 305, - tWITH = 306, - tWHILE = 307, - tNLELSE = 308, - tFACTORY = 309, - tMETHOD = 310, - tOPEN = 311, - tPLAY = 312, - tDONE = 313, - tINSTANCE = 314, - tGE = 315, - tLE = 316, - tGT = 317, - tLT = 318, - tEQ = 319, - tNEQ = 320, - tAND = 321, - tOR = 322, - tNOT = 323, - tMOD = 324, - tAFTER = 325, - tBEFORE = 326, - tCONCAT = 327, - tCONTAINS = 328, - tSTARTS = 329, - tCHAR = 330, - tITEM = 331, - tLINE = 332, - tWORD = 333, - tSPRITE = 334, - tINTERSECTS = 335, - tWITHIN = 336, - tTELL = 337, - tPROPERTY = 338, - tON = 339, - tME = 340 + FBLTINARGLIST = 279, + ID = 280, + STRING = 281, + HANDLER = 282, + SYMBOL = 283, + ENDCLAUSE = 284, + tPLAYACCEL = 285, + tDOWN = 286, + tELSE = 287, + tNLELSIF = 288, + tEXIT = 289, + tFRAME = 290, + tGLOBAL = 291, + tGO = 292, + tIF = 293, + tINTO = 294, + tLOOP = 295, + tMACRO = 296, + tMOVIE = 297, + tNEXT = 298, + tOF = 299, + tPREVIOUS = 300, + tPUT = 301, + tREPEAT = 302, + tSET = 303, + tTHEN = 304, + tTO = 305, + tWHEN = 306, + tWITH = 307, + tWHILE = 308, + tNLELSE = 309, + tFACTORY = 310, + tMETHOD = 311, + tOPEN = 312, + tPLAY = 313, + tDONE = 314, + tINSTANCE = 315, + tGE = 316, + tLE = 317, + tGT = 318, + tLT = 319, + tEQ = 320, + tNEQ = 321, + tAND = 322, + tOR = 323, + tNOT = 324, + tMOD = 325, + tAFTER = 326, + tBEFORE = 327, + tCONCAT = 328, + tCONTAINS = 329, + tSTARTS = 330, + tCHAR = 331, + tITEM = 332, + tLINE = 333, + tWORD = 334, + tSPRITE = 335, + tINTERSECTS = 336, + tWITHIN = 337, + tTELL = 338, + tPROPERTY = 339, + tON = 340, + tME = 341 }; #endif /* Tokens. */ @@ -146,68 +147,69 @@ #define FBLTIN 276 #define FBLTINNOARGS 277 #define FBLTINONEARG 278 -#define ID 279 -#define STRING 280 -#define HANDLER 281 -#define SYMBOL 282 -#define ENDCLAUSE 283 -#define tPLAYACCEL 284 -#define tDOWN 285 -#define tELSE 286 -#define tNLELSIF 287 -#define tEXIT 288 -#define tFRAME 289 -#define tGLOBAL 290 -#define tGO 291 -#define tIF 292 -#define tINTO 293 -#define tLOOP 294 -#define tMACRO 295 -#define tMOVIE 296 -#define tNEXT 297 -#define tOF 298 -#define tPREVIOUS 299 -#define tPUT 300 -#define tREPEAT 301 -#define tSET 302 -#define tTHEN 303 -#define tTO 304 -#define tWHEN 305 -#define tWITH 306 -#define tWHILE 307 -#define tNLELSE 308 -#define tFACTORY 309 -#define tMETHOD 310 -#define tOPEN 311 -#define tPLAY 312 -#define tDONE 313 -#define tINSTANCE 314 -#define tGE 315 -#define tLE 316 -#define tGT 317 -#define tLT 318 -#define tEQ 319 -#define tNEQ 320 -#define tAND 321 -#define tOR 322 -#define tNOT 323 -#define tMOD 324 -#define tAFTER 325 -#define tBEFORE 326 -#define tCONCAT 327 -#define tCONTAINS 328 -#define tSTARTS 329 -#define tCHAR 330 -#define tITEM 331 -#define tLINE 332 -#define tWORD 333 -#define tSPRITE 334 -#define tINTERSECTS 335 -#define tWITHIN 336 -#define tTELL 337 -#define tPROPERTY 338 -#define tON 339 -#define tME 340 +#define FBLTINARGLIST 279 +#define ID 280 +#define STRING 281 +#define HANDLER 282 +#define SYMBOL 283 +#define ENDCLAUSE 284 +#define tPLAYACCEL 285 +#define tDOWN 286 +#define tELSE 287 +#define tNLELSIF 288 +#define tEXIT 289 +#define tFRAME 290 +#define tGLOBAL 291 +#define tGO 292 +#define tIF 293 +#define tINTO 294 +#define tLOOP 295 +#define tMACRO 296 +#define tMOVIE 297 +#define tNEXT 298 +#define tOF 299 +#define tPREVIOUS 300 +#define tPUT 301 +#define tREPEAT 302 +#define tSET 303 +#define tTHEN 304 +#define tTO 305 +#define tWHEN 306 +#define tWITH 307 +#define tWHILE 308 +#define tNLELSE 309 +#define tFACTORY 310 +#define tMETHOD 311 +#define tOPEN 312 +#define tPLAY 313 +#define tDONE 314 +#define tINSTANCE 315 +#define tGE 316 +#define tLE 317 +#define tGT 318 +#define tLT 319 +#define tEQ 320 +#define tNEQ 321 +#define tAND 322 +#define tOR 323 +#define tNOT 324 +#define tMOD 325 +#define tAFTER 326 +#define tBEFORE 327 +#define tCONCAT 328 +#define tCONTAINS 329 +#define tSTARTS 330 +#define tCHAR 331 +#define tITEM 332 +#define tLINE 333 +#define tWORD 334 +#define tSPRITE 335 +#define tINTERSECTS 336 +#define tWITHIN 337 +#define tTELL 338 +#define tPROPERTY 339 +#define tON 340 +#define tME 341 @@ -225,7 +227,7 @@ typedef union YYSTYPE Common::Array<double> *arr; } /* Line 1529 of yacc.c. */ -#line 229 "engines/director/lingo/lingo-gr.hpp" +#line 231 "engines/director/lingo/lingo-gr.hpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index ee4d8db4c3..1e3c721f08 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -92,7 +92,7 @@ void checkEnd(Common::String *token, const char *expect, bool required) { %token<e> THEENTITY THEENTITYWITHID %token<f> FLOAT %token<s> BLTIN BLTINNOARGS BLTINNOARGSORONE BLTINONEARG BLTINARGLIST TWOWORDBUILTIN -%token<s> FBLTIN FBLTINNOARGS FBLTINONEARG +%token<s> FBLTIN FBLTINNOARGS FBLTINONEARG FBLTINARGLIST %token<s> ID STRING HANDLER SYMBOL %token<s> ENDCLAUSE tPLAYACCEL %token tDOWN tELSE tNLELSIF tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO @@ -411,11 +411,13 @@ expr: INT { $$ = g_lingo->codeConst($1); } $$ = g_lingo->code1(g_lingo->c_stringpush); g_lingo->codeString($1->c_str()); } | FBLTINNOARGS { - $$ = g_lingo->code1(g_lingo->_builtins[*$1]->u.func); + g_lingo->codeFunc($1, 0); delete $1; } | FBLTINONEARG expr { - g_lingo->code1(g_lingo->_builtins[*$1]->u.func); + g_lingo->codeFunc($1, 1); delete $1; } + | FBLTINARGLIST nonemptyarglist { g_lingo->codeFunc($1, $2); } + | FBLTINARGLIST '(' nonemptyarglist ')' { g_lingo->codeFunc($1, $3); } | ID '(' arglist ')' { $$ = g_lingo->codeFunc($1, $3); delete $1; } @@ -480,18 +482,20 @@ proc: tPUT expr { g_lingo->code1(g_lingo->c_printtop); } | tPROPERTY propertylist | tINSTANCE instancelist | BLTINNOARGS { - g_lingo->code1(g_lingo->_builtins[*$1]->u.func); + g_lingo->codeFunc($1, 0); delete $1; } | BLTINONEARG expr { - g_lingo->code1(g_lingo->_builtins[*$1]->u.func); + g_lingo->codeFunc($1, 1); delete $1; } | BLTINNOARGSORONE expr { - g_lingo->code1(g_lingo->_builtins[*$1]->u.func); + g_lingo->codeFunc($1, 1); delete $1; } | BLTINNOARGSORONE { - g_lingo->code2(g_lingo->c_voidpush, g_lingo->_builtins[*$1]->u.func); + g_lingo->code1(g_lingo->c_voidpush); + g_lingo->codeFunc($1, 1); delete $1; } - | BLTINARGLIST nonemptyarglist { g_lingo->codeFunc($1, $2); } + | BLTINARGLIST nonemptyarglist { g_lingo->codeFunc($1, $2); } + | BLTINARGLIST '(' nonemptyarglist ')' { g_lingo->codeFunc($1, $3); } | tME '(' ID ')' { g_lingo->codeMe($3, 0); } | tME '(' ID ',' arglist ')' { g_lingo->codeMe($3, $5); } | tOPEN expr tWITH expr { g_lingo->code1(g_lingo->c_open); } diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index 97ade7d01d..66199ecaa1 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -1526,14 +1526,14 @@ YY_RULE_SETUP else if (g_lingo->_builtins[yytext]->maxArgs == 1) return BLTINNOARGSORONE; else - return BLTINARGLIST; + return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST; } else if (g_lingo->_builtins[yytext]->nargs == 1 && g_lingo->_builtins[yytext]->maxArgs == 1) { return type == BLTIN ? BLTINONEARG : FBLTINONEARG; } else if (g_lingo->_builtins[yytext]->nargs == -1) { - return BLTINARGLIST; + return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST; } else { - return BLTINARGLIST; + return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST; } } } diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index 99cc21225a..93b57a079a 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -303,14 +303,14 @@ whitespace [\t ] else if (g_lingo->_builtins[yytext]->maxArgs == 1) return BLTINNOARGSORONE; else - return BLTINARGLIST; + return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST; } else if (g_lingo->_builtins[yytext]->nargs == 1 && g_lingo->_builtins[yytext]->maxArgs == 1) { return type == BLTIN ? BLTINONEARG : FBLTINONEARG; } else if (g_lingo->_builtins[yytext]->nargs == -1) { - return BLTINARGLIST; + return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST; } else { - return BLTINARGLIST; + return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST; } } } diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index ceaadd5088..49c7b0b14c 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -87,7 +87,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, GF_PACKED, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -104,7 +104,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformDOS, GF_PACKED, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -121,7 +121,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformDOS, GF_PACKED, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -138,7 +138,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformDOS, GF_PACKED, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -151,7 +151,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformDOS, GF_PACKED, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -168,7 +168,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformDOS, GF_PACKED, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -181,7 +181,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformDOS, GF_PACKED, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -198,7 +198,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformDOS, GF_PACKED, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -213,7 +213,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -226,7 +226,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -239,7 +239,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -252,7 +252,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -265,7 +265,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -278,7 +278,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, @@ -291,7 +291,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GUIO_LINKSPEECHTOSFX) }, }, diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index c879a83db7..5265324d91 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -325,6 +325,8 @@ public: virtual ~DrasculaEngine(); virtual bool hasFeature(EngineFeature f) const; + virtual void syncSoundSettings(); + Common::RandomSource *_rnd; const DrasculaGameDescription *_gameDescription; uint32 getFeatures() const; @@ -488,7 +490,7 @@ public: void addKeyToBuffer(Common::KeyState& key); void flushKeyBuffer(); void selectVerb(int); - void updateVolume(Audio::Mixer::SoundType soundType, int prevVolume); + int updateVolume(int prevVolume, int prevVolumeY); void volumeControls(); bool saveLoadScreen(); diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 09ff3c6429..dfe012a2ef 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -196,6 +196,11 @@ void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int width, dest += xdes + ydes * 320; src += xorg + yorg * 320; + assert(xorg >= 0); + assert(yorg >= 0); + assert(xorg + width <= 320); + assert(yorg + height <= 200); + int ptr = 0; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 62ec796678..70916caffe 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -34,13 +34,48 @@ namespace Drascula { -void DrasculaEngine::updateVolume(Audio::Mixer::SoundType soundType, int prevVolume) { - int vol = _mixer->getVolumeForSoundType(soundType) / 16; - if (_mouseY < prevVolume && vol < 15) - vol++; - if (_mouseY > prevVolume && vol > 0) - vol--; - _mixer->setVolumeForSoundType(soundType, vol * 16); +void DrasculaEngine::syncSoundSettings() { + // Sync the engine with the config manager + + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + // We need to handle the speech mute separately here. This is because the + // engine code should be able to rely on all speech sounds muted when the + // user specified subtitles only mode, which results in "speech_mute" to + // be set to "true". The global mute setting has precedence over the + // speech mute setting though. + bool speechMute = mute; + if (!speechMute) + speechMute = ConfMan.getBool("speech_mute"); + + _mixer->muteSoundType(Audio::Mixer::kPlainSoundType, mute); + _mixer->muteSoundType(Audio::Mixer::kSFXSoundType, mute); + _mixer->muteSoundType(Audio::Mixer::kSpeechSoundType, speechMute); + _mixer->muteSoundType(Audio::Mixer::kMusicSoundType, mute); + + int voiceVolume = ConfMan.getInt("speech_volume"); + int musicVolume = ConfMan.getInt("music_volume"); + // If the music and voice volume are correct, don't change anything. + // Otherwise compute the master volume using an approximation of sqrt(max) * 16 which would result in the master + // volume being the same value as the max of music and voice. + if (_mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType) != voiceVolume || _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) != musicVolume) { + int masterVolume = MAX(musicVolume, voiceVolume) * 2 / 3 + 86; + _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, masterVolume); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, voiceVolume); + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, voiceVolume); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, musicVolume); + } +} + +int DrasculaEngine::updateVolume(int prevVolume, int prevVolumeY) { + prevVolumeY += 10; + if (_mouseY < prevVolumeY && prevVolume < 15) + prevVolume++; + if (_mouseY > prevVolumeY && prevVolume > 0) + prevVolume--; + return prevVolume; } void DrasculaEngine::volumeControls() { @@ -53,10 +88,22 @@ void DrasculaEngine::volumeControls() { setCursor(kCursorCrosshair); showCursor(); + // The engine has three volume controls: master, SFx/Speech and Music. + // ScummVM doesn't have a master volume, so we abuse the kPlainSoundType to store it. + // In drascula, we only use the kMusicSoundType and kSpeechSoundType to play sounds. + // For consistency with the ScummVM options dialog we also set the kSFXSoundType volume + // to the same value as the kMusicSoundType value, but we don't actually use it. + + // The engines uses masterVolume, voiceVolume and musicVolume between 0 and 15. + // We store in the mixer: + // - masterVolume * 16 in kPlainSoundType + // - (masterVolume + 1) * (voiceVolume + 1) - 1 in both kSpeechSoundType and kSFXSoundType + // - (masterVolume + 1) * (musicVolume + 1) - 1 in kMusicSoundType + while (!shouldQuit()) { int masterVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16), 0, 15); - int voiceVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType) / 16), 0, 15); - int musicVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16), 0, 15); + int voiceVolume = CLIP(((_mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType) + 1) / (masterVolume + 1) - 1), 0, 15); + int musicVolume = CLIP(((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) + 1) / (masterVolume + 1) - 1), 0, 15); int masterVolumeY = 72 + 61 - masterVolume * 4; int voiceVolumeY = 72 + 61 - voiceVolume * 4; @@ -87,16 +134,25 @@ void DrasculaEngine::volumeControls() { if (_leftMouseButton == 1) { delay(100); if (_mouseX > 80 && _mouseX < 121) { - updateVolume(Audio::Mixer::kPlainSoundType, masterVolumeY); + masterVolume = updateVolume(masterVolume, masterVolumeY); + _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, masterVolume * 16); } - if (_mouseX > 136 && _mouseX < 178) { - updateVolume(Audio::Mixer::kSpeechSoundType, voiceVolumeY); - } + if (_mouseX > 136 && _mouseX < 178) + voiceVolume = updateVolume(voiceVolume, voiceVolumeY); - if (_mouseX > 192 && _mouseX < 233) { - updateVolume(Audio::Mixer::kMusicSoundType, musicVolumeY); - } + if (_mouseX > 192 && _mouseX < 233) + musicVolume = updateVolume(musicVolume, musicVolumeY); + + voiceVolume = (masterVolume + 1) * (voiceVolume + 1) - 1; + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, voiceVolume); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, voiceVolume); + ConfMan.setInt("speech_volume", voiceVolume); + ConfMan.setInt("sfx_volume", voiceVolume); + + musicVolume = (masterVolume + 1) * (musicVolume + 1) - 1; + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, musicVolume); + ConfMan.setInt("music_volume", musicVolume); } } diff --git a/engines/titanic/sound/audio_buffer.cpp b/engines/titanic/sound/audio_buffer.cpp index aa4bb8ca7f..029e7f0d9c 100644 --- a/engines/titanic/sound/audio_buffer.cpp +++ b/engines/titanic/sound/audio_buffer.cpp @@ -46,14 +46,14 @@ byte *CAudioBuffer::getEnd() { return _flag ? &_buffer[0] : &_buffer[_buffer.size() / 2]; } -uint16 *CAudioBuffer::getReadPtr() { +int16 *CAudioBuffer::getReadPtr() { byte *ptr = getBegin(); - return (uint16 *)(ptr + (_buffer.size() / 2 - _readBytesLeft)); + return (int16 *)(ptr + (_buffer.size() / 2 - _readBytesLeft)); } -uint16 *CAudioBuffer::getWritePtr() { +int16 *CAudioBuffer::getWritePtr() { byte *ptr = getEnd(); - return (uint16 *)(ptr + (_buffer.size() / 2 - _writeBytesLeft)); + return (int16 *)(ptr + (_buffer.size() / 2 - _writeBytesLeft)); } void CAudioBuffer::advanceRead(int size) { diff --git a/engines/titanic/sound/audio_buffer.h b/engines/titanic/sound/audio_buffer.h index 32a5790e57..54dd807250 100644 --- a/engines/titanic/sound/audio_buffer.h +++ b/engines/titanic/sound/audio_buffer.h @@ -64,7 +64,7 @@ public: /** * Gets a pointer to the start of previously written data */ - uint16 *getReadPtr(); + int16 *getReadPtr(); /** * Returns the number of bytes that can be read @@ -80,7 +80,7 @@ public: * Gets a pointer to the remainder of the audio buffer that * can be written to */ - uint16 *getWritePtr(); + int16 *getWritePtr(); /** * Returns how many bytes can be written before hitting the diff --git a/engines/titanic/sound/music_object.cpp b/engines/titanic/sound/music_object.cpp index 1f840790b9..d12b6eb403 100644 --- a/engines/titanic/sound/music_object.cpp +++ b/engines/titanic/sound/music_object.cpp @@ -21,45 +21,21 @@ */ #include "titanic/sound/music_object.h" +#include "titanic/titanic.h" #include "common/util.h" namespace Titanic { -static const char *const DATA[4] = { - "64,^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|8,^^^^ 5:A///|64,/|/|/|/|/|/|/" - "|/|/|/|/|/|/|/|/|/|^|^|^|^|^|^|^|^|^|16, ^B//|64,/|/|/|/|^|16,^C/" - "/|64,/|/|/|/|", - "2:8,^^^^B//a|//g//B//|g///B//a|//g//A//|B//^C//b|//a//a//|BCb/b//" - "a|//g//A//|g/+f/D//c|//b//gA/|g/^^C//C|//C//a//|BCb////a|//g//g//" - "|g/g//B/a|/g//////|//^^B//a|//g//B//|g///B//a|//g//B//|g//^C//b|/" - "/a//a//|BCb/b//a|//g//B//|g/+f/D//c|//b//gA/|g/^^C//C|//C//a//|BC" - "b////a|//g//g//|g/g//B/a|/g//////|3:^^B//a//|g//A//g/|/^B//a//|g/" - "/A//B/|b^ 3:C//b//|a//g//+f/|+fG/G/GA/|B/a/g///|B///+f//G|G/G/+f/" - "G/|^^e//d//|c//b//gA|g/B//a//|g//g//g/|g//B/a/g|//////^^|^^Ga///G" - "|////////|////////|////////|", - "2:8,^^^^^^D/|/E//E//E|/d//^^d/|/E//E//E|/E//^^G/|/d//d//d|/^^^^^d" - "/|/E//E//E|/d/^^^E/|/E//d/+F/|bD^^^^G/|/e//e//e|^^^^^^d/|/E//E//E" - "|//d///d/|//b/////|^^^^^^D/|/E//E//E|/d//^^d/|/E//E//E|/E//^^G/|/" - "d//d//d|/^^^^^d/|/E//E//E|/d/^^^E/|/E//d/d/|d/^^^^G/|/e//e//e|^^^" - "^^^d/|/E//E//E|//d///d/|//b/////|3:D///c//b|//b//b//|D///c//b|//b" - "//g//|E///d//c|//b//a//|aB/B/BC/|D/c/b///|^^^D//DE|/E/E/d/d|//E/g" - "//g|//g//d//|^^^^g//E|//E//E//|d///d///|b///////|// 3:Db///C|///b" - "/// 5:A|64,/|/|/|/|/|/|/|/|", - "2:8,^^G//+f//|e//e//e/|//G//+f//|e//e//+F/|G/a//g//|+f//+f//+f/|/" - "/G//+F//|e//e//e/|//B//a//|g//e///d|//c//b//|a//a//a/|+f/G// 2:+F" - "//|e//e//C/|//b/g/+f/|//G/////|^^G//+f//|e//e//e/|//G//+f//|e//e/" - "/e/|//a//g//|+f//+f//+f/|//G//+F//|e//e//e/|//B//a//|g//e///d|/ " - "2:dC//b//|a//a//a/|+f/G//+F//|e//e//C/|//b/g/+f/|//G/////|d//d//d" - "/|/E//E//d|d//d//E/|/+F//G//b|a//a//a/|/D//D// 3:D|//g/g//D|/d/G/" - "///|^^b//b//|b//ba/B/|c//B//a/|/g//+f//+f|G//+F//e/|/c//C///|b/g/" - "+f///|G///////|G///////|C///////|////////|////////|" -}; - -/*------------------------------------------------------------------------*/ - CMusicObject::CMusicObject(int index) { - assert(index >= 0 && index <= 3); - CMusicParser parser(DATA[index]); + // Read in the list of parser strings + Common::SeekableReadStream *res = g_vm->_filesManager->getResource("MUSIC/PARSER"); + Common::StringArray parserStrings; + while (res->pos() < res->size()) + parserStrings.push_back(readStringFromStream(res)); + delete res; + + // Set up a new parser with the desired string + CMusicParser parser(parserStrings[index].c_str()); // Count how many encoded values there are CValuePair r; @@ -68,11 +44,13 @@ CMusicObject::CMusicObject(int index) { ++count; assert(count > 0); + // Read in the values to the array _data.resize(count); parser.reset(); for (int idx = 0; idx < count; ++idx) parser.parse(_data[idx]); + // Figure out the range of values in the array _minVal = 0x7FFFFFFF; int maxVal = -0x7FFFFFFF; diff --git a/engines/titanic/sound/music_room_handler.cpp b/engines/titanic/sound/music_room_handler.cpp index c99370f4ac..01d074c388 100644 --- a/engines/titanic/sound/music_room_handler.cpp +++ b/engines/titanic/sound/music_room_handler.cpp @@ -205,11 +205,11 @@ void CMusicRoomHandler::updateAudio() { _audioBuffer->enterCriticalSection(); int size = _audioBuffer->getWriteBytesLeft(); int count; - uint16 *ptr; + int16 *ptr; if (size > 0) { // Null out the destination write area - uint16 *audioPtr = _audioBuffer->getWritePtr(); + int16 *audioPtr = _audioBuffer->getWritePtr(); Common::fill(audioPtr, audioPtr + size / sizeof(uint16), 0); for (int instrIdx = 0; instrIdx < 4; ++instrIdx) { diff --git a/engines/titanic/sound/music_wave.cpp b/engines/titanic/sound/music_wave.cpp index 11458642df..f6ea612537 100644 --- a/engines/titanic/sound/music_wave.cpp +++ b/engines/titanic/sound/music_wave.cpp @@ -269,7 +269,7 @@ void CMusicWave::setSize(uint total) { _count = 0; } -int CMusicWave::read(uint16 *ptr, uint size) { +int CMusicWave::read(int16 *ptr, uint size) { if (!_size) return 0; @@ -278,17 +278,17 @@ int CMusicWave::read(uint16 *ptr, uint size) { if (_waveIndex != -1) { // Lock the specified wave file for access - const uint16 *data = _items[_waveIndex]._waveFile->lock(); + const int16 *data = _items[_waveIndex]._waveFile->lock(); assert(data); - const uint16 *src = data; + const int16 *src = data; // Loop through merging data from the wave file into the dest buffer - for (uint idx = 0; idx < (size / sizeof(uint16)); ++idx, _readPos += _readIncrement) { + for (uint idx = 0; idx < (size / sizeof(int16)); ++idx, _readPos += _readIncrement) { uint srcPos = _readPos >> 8; if (srcPos >= _count) break; - uint16 val = READ_LE_UINT16(src + srcPos); + int16 val = READ_LE_UINT16(src + srcPos); *ptr++ += val; } diff --git a/engines/titanic/sound/music_wave.h b/engines/titanic/sound/music_wave.h index 5d205259ee..f3782574ec 100644 --- a/engines/titanic/sound/music_wave.h +++ b/engines/titanic/sound/music_wave.h @@ -120,7 +120,7 @@ public: * If there is any wave file currently specified, reads it in * and merges it into the supplied buffer */ - int read(uint16 *ptr, uint size); + int read(int16 *ptr, uint size); /** * Figure out which wave file to use next diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp index e49c44d76d..a4cd9d3e3f 100644 --- a/engines/titanic/sound/wave_file.cpp +++ b/engines/titanic/sound/wave_file.cpp @@ -29,22 +29,56 @@ namespace Titanic { -CWaveFile::CWaveFile() : _soundManager(nullptr), _audioStream(nullptr), +/** + * This creates a ScummVM audio stream around a CAudioBuffer buffer, + * allowing for streaming audio output for the music room music + */ +class AudioBufferStream : public Audio::SeekableAudioStream { +private: + CAudioBuffer *_audioBuffer; +public: + AudioBufferStream(CAudioBuffer *audioBuffer) : _audioBuffer(audioBuffer) {} + + virtual int readBuffer(int16 *buffer, const int numSamples); + virtual bool isStereo() const { return false; } + virtual bool endOfData() const; + virtual int getRate() const { return 22050; } + virtual Audio::Timestamp getLength() const { return Audio::Timestamp(); } + virtual bool seek(const Audio::Timestamp &where) { return false; } +}; + +int AudioBufferStream::readBuffer(int16 *buffer, const int numSamples) { + _audioBuffer->enterCriticalSection(); + int samplesToRead = MIN((const int)numSamples, (const int)(_audioBuffer->getBytesToRead() / sizeof(uint16))); + + const int16 *src = _audioBuffer->getReadPtr(); + Common::copy(src, src + samplesToRead, buffer); + _audioBuffer->advanceRead(samplesToRead * 2); + + _audioBuffer->leaveCriticalSection(); + return samplesToRead; +} + +bool AudioBufferStream::endOfData() const { + return _audioBuffer->_disabled; +} + +/*------------------------------------------------------------------------*/ + +CWaveFile::CWaveFile() : _audioStream(nullptr), _waveData(nullptr), _waveSize(0), _dataSize(0), _headerSize(0), - _rate(0), _flags(0), _soundType(Audio::Mixer::kPlainSoundType) { + _rate(0), _flags(0), _wavType(0), _soundType(Audio::Mixer::kPlainSoundType) { setup(); } -CWaveFile::CWaveFile(QSoundManager *owner) : _soundManager(owner), _audioStream(nullptr), +CWaveFile::CWaveFile(QSoundManager *owner) : _audioStream(nullptr), _waveData(nullptr), _waveSize(0), _dataSize(0), _headerSize(0), - _rate(0), _flags(0), _soundType(Audio::Mixer::kPlainSoundType) { + _rate(0), _flags(0), _wavType(0), _soundType(Audio::Mixer::kPlainSoundType) { setup(); } void CWaveFile::setup() { _loadMode = LOADMODE_SCUMMVM; - _field4 = 0; - _field14 = 1; _dataSize = 0; _audioBuffer = nullptr; _disposeAudioBuffer = DisposeAfterUse::NO; @@ -53,7 +87,7 @@ void CWaveFile::setup() { CWaveFile::~CWaveFile() { if (_audioStream) { - _soundManager->soundFreed(_soundHandle); + //_soundManager->soundFreed(_soundHandle); delete _audioStream; } @@ -83,11 +117,11 @@ bool CWaveFile::loadSound(const CString &name) { return false; Common::SeekableReadStream *stream = file.readStream(); - uint size = stream->size(); - byte *data = new byte[size]; - stream->read(data, size); + uint wavSize = stream->size(); + byte *data = new byte[wavSize]; + stream->read(data, wavSize); - load(data, size); + load(data, wavSize); _soundType = Audio::Mixer::kSFXSoundType; return true; } @@ -113,12 +147,12 @@ bool CWaveFile::loadMusic(const CString &name) { return false; Common::SeekableReadStream *stream = file.readStream(); - uint size = stream->size(); - byte *data = new byte[size]; - stream->read(data, size); + uint wavSize = stream->size(); + byte *data = new byte[wavSize]; + stream->read(data, wavSize); delete stream; - load(data, size); + load(data, wavSize); _soundType = Audio::Mixer::kMusicSoundType; return true; } @@ -127,18 +161,18 @@ bool CWaveFile::loadMusic(CAudioBuffer *buffer, DisposeAfterUse::Flag disposeAft _audioBuffer = buffer; _disposeAudioBuffer = disposeAfterUse; _loadMode = LOADMODE_AUDIO_BUFFER; - _field14 = 0; + _audioStream = new AudioBufferStream(_audioBuffer); return true; } -void CWaveFile::load(byte *data, uint size) { +void CWaveFile::load(byte *data, uint dataSize) { _waveData = data; - _waveSize = size; + _waveSize = dataSize; // Parse the wave header - Common::MemoryReadStream wavStream(data, size, DisposeAfterUse::NO); - Audio::loadWAVFromStream(wavStream, _dataSize, _rate, _flags); + Common::MemoryReadStream wavStream(data, dataSize, DisposeAfterUse::NO); + Audio::loadWAVFromStream(wavStream, _dataSize, _rate, _flags, &_wavType); _headerSize = wavStream.pos(); } @@ -164,19 +198,25 @@ void CWaveFile::reset() { audioStream()->rewind(); } -const uint16 *CWaveFile::lock() { +const int16 *CWaveFile::lock() { + enum { kWaveFormatPCM = 1 }; + switch (_loadMode) { case LOADMODE_SCUMMVM: + // Sanity checking that only raw 16-bit LE 22Khz waves can be locked assert(_waveData && _rate == 22050); assert(_flags == (Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_16BITS)); - return (uint16 *)(_waveData + _headerSize); + assert(_wavType == kWaveFormatPCM); + + // Return a pointer to the data section of the wave file + return (const int16 *)(_waveData + _headerSize); default: return nullptr; } } -void CWaveFile::unlock(const uint16 *ptr) { +void CWaveFile::unlock(const int16 *ptr) { // No implementation needed in ScummVM } diff --git a/engines/titanic/sound/wave_file.h b/engines/titanic/sound/wave_file.h index b5303205c0..6bd18989b9 100644 --- a/engines/titanic/sound/wave_file.h +++ b/engines/titanic/sound/wave_file.h @@ -43,9 +43,8 @@ private: int _headerSize; int _rate; byte _flags; - QSoundManager *_soundManager; + uint16 _wavType; Audio::SeekableAudioStream *_audioStream; - Audio::SoundHandle _soundHandle; private: /** * Handles setup of fields shared by the constructors @@ -55,13 +54,11 @@ private: /** * Gets passed the raw data for the wave file */ - void load(byte *data, uint size); + void load(byte *data, uint dataSize); public: Audio::Mixer::SoundType _soundType; LoadMode _loadMode; - int _field4; - int _field14; CAudioBuffer *_audioBuffer; DisposeAfterUse::Flag _disposeAudioBuffer; int _channel; @@ -127,12 +124,12 @@ public: /** * Lock sound data for access */ - const uint16 *lock(); + const int16 *lock(); /** * Unlock sound data after a prior call to lock */ - void unlock(const uint16 *ptr); + void unlock(const int16 *ptr); }; } // End of namespace Titanic |