aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorcraigsc2020-01-11 12:08:21 -0800
committercraigsc2020-01-11 12:08:21 -0800
commit3dd4fb16f017a8eab5c6c11fd119a397b457866e (patch)
tree5b80b5c5038d8577c2d674a5a4742b335deca515 /engines/director
parentf9f81ea9baecb714f26cf1c17a1b0ae58431467b (diff)
parent5893672b80f00fced33c42e63471d68ba47d7dd4 (diff)
downloadscummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.tar.gz
scummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.tar.bz2
scummvm-rg350-3dd4fb16f017a8eab5c6c11fd119a397b457866e.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/cast.cpp69
-rw-r--r--engines/director/cast.h10
-rw-r--r--engines/director/detection.cpp1
-rw-r--r--engines/director/detection_tables.h18
-rw-r--r--engines/director/director.cpp72
-rw-r--r--engines/director/director.h19
-rw-r--r--engines/director/frame.cpp107
-rw-r--r--engines/director/frame.h56
-rw-r--r--engines/director/graphics.cpp505
-rw-r--r--engines/director/images.cpp1
-rw-r--r--engines/director/lingo/lingo-builtins.cpp16
-rw-r--r--engines/director/lingo/lingo-bytecode.cpp170
-rw-r--r--engines/director/lingo/lingo-codegen.cpp7
-rw-r--r--engines/director/lingo/lingo-events.cpp24
-rw-r--r--engines/director/lingo/lingo-gr.cpp654
-rw-r--r--engines/director/lingo/lingo-gr.y4
-rw-r--r--engines/director/lingo/lingo-lex.cpp579
-rw-r--r--engines/director/lingo/lingo-lex.l10
-rw-r--r--engines/director/lingo/lingo-the.cpp54
-rw-r--r--engines/director/lingo/lingo-the.h1
-rw-r--r--engines/director/lingo/lingo.cpp12
-rw-r--r--engines/director/lingo/tests/lingotests (renamed from engines/director/lingo/tests/lingotests.lingo)0
-rw-r--r--engines/director/lingo/tests/the.lingo2
-rw-r--r--engines/director/resource.cpp28
-rw-r--r--engines/director/score.cpp107
-rw-r--r--engines/director/score.h2
-rw-r--r--engines/director/sprite.cpp3
-rw-r--r--engines/director/types.h67
28 files changed, 1633 insertions, 965 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 8ec151cb1b..8e547f0471 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -21,6 +21,7 @@
*/
#include "common/substream.h"
+#include "graphics/surface.h"
#include "director/director.h"
#include "director/cachedmactext.h"
@@ -30,6 +31,17 @@
namespace Director {
+Cast::Cast() {
+ _type = kCastTypeNull;
+ _surface = nullptr;
+
+ _modified = true;
+}
+
+Cast::~Cast() {
+ delete _surface;
+}
+
BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version) {
_type = kCastBitmap;
@@ -63,13 +75,16 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16
_initialRect = Score::readRect(stream);
_boundingRect = Score::readRect(stream);
- _regX = stream.readUint16();
_regY = stream.readUint16();
+ _regX = stream.readUint16();
_bitsPerPixel = stream.readUint16();
if (_bitsPerPixel == 0)
_bitsPerPixel = 1;
+ if (_bitsPerPixel == 1)
+ _pitch *= 8;
+
int tail = 0;
while (!stream.eos()) {
@@ -103,7 +118,6 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16
stream.readUint32();
}
- _modified = 0;
_tag = castTag;
}
@@ -114,7 +128,8 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
_gutterSize = kSizeNone;
_boxShadow = kSizeNone;
- _flags1 = 0;
+ _flags = 0;
+ _textFlags = 0;
_fontId = 0;
_fontSize = 12;
_textType = kTextTypeFixed;
@@ -124,7 +139,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
_palinfo1 = _palinfo2 = _palinfo3 = 0;
if (version <= 3) {
- _flags1 = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled
+ _flags = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled
_borderSize = static_cast<SizeType>(stream.readByte());
_gutterSize = static_cast<SizeType>(stream.readByte());
_boxShadow = static_cast<SizeType>(stream.readByte());
@@ -138,7 +153,6 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
uint16 pad3;
uint16 pad4 = 0;
uint16 totalTextHeight;
- byte flags = 0;
if (version == 2) {
pad2 = stream.readUint16();
@@ -150,15 +164,9 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
pad3 = stream.readUint16();
_textShadow = static_cast<SizeType>(stream.readByte());
- flags = stream.readByte();
- if (flags & 0x1)
- _textFlags.push_back(kTextFlagEditable);
- if (flags & 0x2)
- _textFlags.push_back(kTextFlagAutoTab);
- if (flags & 0x4)
- _textFlags.push_back(kTextFlagDoNotWrap);
- if (flags & 0xf8)
- warning("Unprocessed text cast flags: %x", flags & 0xf8);
+ _textFlags = stream.readByte();
+ if (_textFlags & 0xf8)
+ warning("Unprocessed text cast flags: %x", _textFlags & 0xf8);
totalTextHeight = stream.readUint16();
} else {
@@ -170,9 +178,9 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
}
debugC(2, kDebugLoading, "TextCast(): flags1: %d, border: %d gutter: %d shadow: %d pad1: %x align: %04x",
- _flags1, _borderSize, _gutterSize, _boxShadow, pad1, _textAlign);
+ _flags, _borderSize, _gutterSize, _boxShadow, pad1, _textAlign);
debugC(2, kDebugLoading, "TextCast(): rgb: 0x%04x 0x%04x 0x%04x, pad2: %x pad3: %d pad4: %d shadow: %d flags: %d totHeight: %d",
- _palinfo1, _palinfo2, _palinfo3, pad2, pad3, pad4, _textShadow, flags, totalTextHeight);
+ _palinfo1, _palinfo2, _palinfo3, pad2, pad3, pad4, _textShadow, _textFlags, totalTextHeight);
if (debugChannelSet(2, kDebugLoading)) {
_initialRect.debugPrint(2, "TextCast(): rect:");
}
@@ -226,10 +234,10 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
stream.readUint16();
}
- _modified = 0;
-
_cachedMacText = new CachedMacText(this, version, -1, g_director->_wm);
// TODO Destroy me
+
+ _modified = false;
}
void TextCast::importStxt(const Stxt *stxt) {
@@ -276,8 +284,8 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
_shapeType = static_cast<ShapeType>(stream.readByte());
_initialRect = Score::readRect(stream);
_pattern = stream.readUint16BE();
- _fgCol = 0xff - (uint8)stream.readByte();
- _bgCol = 0xff - (uint8)stream.readByte();
+ _fgCol = (127 - stream.readByte()) & 0xff; // -128 -> 0, 127 -> 256
+ _bgCol = (127 - stream.readByte()) & 0xff;
_fillType = stream.readByte();
_ink = static_cast<InkType>(_fillType & 0x3f);
_lineThickness = stream.readByte();
@@ -308,7 +316,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
_lineThickness = 1;
_lineDirection = 0;
}
- _modified = 0;
+ _modified = false;
debugC(3, kDebugLoading, "ShapeCast: fl: %x unk1: %x type: %d pat: %d fg: %d bg: %d fill: %d thick: %d dir: %d",
flags, unk1, _shapeType, _pattern, _fgCol, _bgCol, _fillType, _lineThickness, _lineDirection);
@@ -332,7 +340,6 @@ ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextC
_buttonType = static_cast<ButtonType>(stream.readUint16BE());
}
- _modified = 0;
}
ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
@@ -341,15 +348,26 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
if (version < 4) {
error("Unhandled Script cast");
} else if (version == 4) {
- stream.readByte();
- stream.readByte();
+ byte unk1 = stream.readByte();
+ byte type = stream.readByte();
+
+ switch (type) {
+ case 1:
+ _scriptType = kScoreScript;
+ break;
+ case 3:
+ _scriptType = kMovieScript;
+ break;
+ default:
+ error("ScriptCast: Unprocessed script type: %d", type);
+ }
_initialRect = Score::readRect(stream);
_boundingRect = Score::readRect(stream);
_id = stream.readUint32();
- debugC(4, kDebugLoading, "CASt: Script id: %d", _id);
+ debugC(4, kDebugLoading, "CASt: Script id: %d type: %s (%d) unk1: %d", _id, scriptType2str(_scriptType), type, unk1);
stream.readByte(); // There should be no more data
assert(stream.eos());
@@ -366,7 +384,6 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
// WIP need to complete this!
}
- _modified = 0;
}
RTECast::RTECast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version) {
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 03767ecea2..5123ef8034 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -42,6 +42,9 @@ class CachedMacText;
class Cast {
public:
+ Cast();
+ virtual ~Cast();
+
CastType _type;
Common::Rect _initialRect;
Common::Rect _boundingRect;
@@ -49,7 +52,7 @@ public:
const Graphics::Surface *_surface;
- byte _modified;
+ bool _modified;
};
class BitmapCast : public Cast {
@@ -92,14 +95,14 @@ public:
SizeType _gutterSize;
SizeType _boxShadow;
- byte _flags1;
+ byte _flags;
uint32 _fontId;
uint16 _fontSize;
TextType _textType;
TextAlignType _textAlign;
SizeType _textShadow;
byte _textSlant;
- Common::Array<TextFlag> _textFlags;
+ byte _textFlags;
uint16 _palinfo1, _palinfo2, _palinfo3;
Common::String _ftext;
@@ -121,6 +124,7 @@ public:
ScriptCast(Common::ReadStreamEndian &stream, uint16 version);
uint32 _id;
+ ScriptType _scriptType;
};
class RTECast : public TextCast {
diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index f282bddd6d..378c287e0e 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -71,6 +71,7 @@ bool DirectorEngine::hasFeature(EngineFeature f) const {
static const PlainGameDescriptor directorGames[] = {
{ "director", "Macromedia Director Game" },
{ "directortest", "Macromedia Director Test Target" },
+ { "directortest-all", "Macromedia Director All Movies Test Target" },
{ "theapartment", "The Apartment, Interactive demo" },
{ "gundam0079", "Gundam 0079: The War for Earth" },
{ "jewels", "Jewels of the Oracle" },
diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index 3458a2c5e3..8ca09a45f6 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -33,11 +33,12 @@ namespace Director {
#define WINDEMO(t,e,f,m,s,v) GENGAME_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_DEMO,v)
static const DirectorGameDescription gameDescriptions[] = {
+ // Execute all *.lingo files in game directory
{
{
"directortest",
"",
- AD_ENTRY1("lingotests.lingo", 0),
+ AD_ENTRY1("lingotests", 0),
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
@@ -47,6 +48,21 @@ static const DirectorGameDescription gameDescriptions[] = {
4
},
+ // Executa all movies in directory
+ {
+ {
+ "directortest-all",
+ "",
+ AD_ENTRY1("lingotests-all", 0),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_NO_FLAGS,
+ GUIO1(GUIO_NOASPECT)
+ },
+ GID_TESTALL,
+ 4
+ },
+
// Generic D3 Mac entry
MACGAME("director", "", "D3-mac", 0, -1, 3),
// Generic D4 Mac entry
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 464b24c7a4..e82088e877 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -61,6 +61,9 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
// Setup mixer
syncSoundSettings();
+ // Load Palettes
+ loadPalettes();
+
// Load Patterns
loadPatterns();
@@ -145,6 +148,8 @@ Common::Error DirectorEngine::run() {
_lingo->runTests();
return Common::kNoError;
+ } else if (getGameID() == GID_TESTALL) {
+ enqueueAllMovies();
}
// FIXME
@@ -171,19 +176,28 @@ Common::Error DirectorEngine::run() {
loadSharedCastsFrom(_currentPath + _sharedCastFile);
debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\nObtaining score name\n");
- loadInitialMovie(getEXEName());
+
+ if (getGameID() == GID_TESTALL) {
+ _nextMovie = getNextMovieFromQueue();
+ loadInitialMovie(_nextMovie.movie);
+ } else {
+ loadInitialMovie(getEXEName());
+ }
_currentScore->setArchive(_mainArchive);
- debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
- debug(0, "@@@@ Score name '%s'", _currentScore->getMacName().c_str());
- debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
bool loop = true;
while (loop) {
loop = false;
- _currentScore->loadArchive();
+ if (_currentScore) {
+ debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ debug(0, "@@@@ Score name '%s'", _currentScore->getMacName().c_str());
+ debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+
+ _currentScore->loadArchive();
+ }
// If we came in a loop, then skip as requested
if (!_nextMovie.frameS.empty()) {
@@ -196,17 +210,24 @@ Common::Error DirectorEngine::run() {
_nextMovie.frameI = -1;
}
- debugC(1, kDebugEvents, "Starting playback of score '%s'", _currentScore->getMacName().c_str());
+ if (!debugChannelSet(-1, kDebugLingoCompileOnly) && _currentScore) {
+ debugC(1, kDebugEvents, "Starting playback of score '%s'", _currentScore->getMacName().c_str());
- _currentScore->startLoop();
+ _currentScore->startLoop();
- debugC(1, kDebugEvents, "Finished playback of score '%s'", _currentScore->getMacName().c_str());
+ debugC(1, kDebugEvents, "Finished playback of score '%s'", _currentScore->getMacName().c_str());
+ }
+
+ if (getGameID() == GID_TESTALL) {
+ _nextMovie = getNextMovieFromQueue();
+ }
// If a loop was requested, do it
if (!_nextMovie.movie.empty()) {
_lingo->restartLingo();
delete _currentScore;
+ _currentScore = nullptr;
_currentPath = getPath(_nextMovie.movie, _currentPath);
@@ -217,6 +238,11 @@ Common::Error DirectorEngine::run() {
if (!mov) {
warning("nextMovie: No score is loaded");
+ if (getGameID() == GID_TESTALL) {
+ loop = true;
+ continue;
+ }
+
return Common::kNoError;
}
@@ -273,4 +299,34 @@ Common::HashMap<Common::String, Score *> *DirectorEngine::scanMovies(const Commo
return nameMap;
}
+void DirectorEngine::enqueueAllMovies() {
+ Common::FSNode dir(ConfMan.get("path"));
+ Common::FSList files;
+ dir.getChildren(files, Common::FSNode::kListFilesOnly);
+
+ for (Common::FSList::const_iterator file = files.begin(); file != files.end(); ++file)
+ _movieQueue.push_back((*file).getName());
+
+ Common::sort(_movieQueue.begin(), _movieQueue.end());
+
+ debug(1, "=========> Enqueued %d movies", _movieQueue.size());
+}
+
+MovieReference DirectorEngine::getNextMovieFromQueue() {
+ MovieReference res;
+
+ if (_movieQueue.empty())
+ return res;
+
+ res.movie = _movieQueue.front();
+
+ debug(0, "=======================================");
+ debug(0, "=========> Next movie is %s", res.movie.c_str());
+ debug(0, "=======================================");
+
+ _movieQueue.remove_at(0);
+
+ return res;
+}
+
} // End of namespace Director
diff --git a/engines/director/director.h b/engines/director/director.h
index 344d53a84f..0648d1c1d6 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -25,6 +25,7 @@
#include "common/random.h"
#include "common/rect.h"
+#include "common/str-array.h"
#include "common/hashmap.h"
#include "engines/engine.h"
@@ -47,7 +48,8 @@ namespace Director {
enum DirectorGameID {
GID_GENERIC,
- GID_TEST
+ GID_TEST,
+ GID_TESTALL
};
class Archive;
@@ -80,7 +82,11 @@ struct MovieReference {
MovieReference() { frameI = -1; }
};
-extern byte defaultPalette[768];
+struct PaletteV4 {
+ int id;
+ byte *palette;
+ int length;
+};
class DirectorEngine : public ::Engine {
public:
@@ -101,8 +107,10 @@ public:
Score *getCurrentScore() const { return _currentScore; }
Score *getSharedScore() const { return _sharedScore; }
Common::String getCurrentPath() const { return _currentPath; }
+ void setPalette(int id);
void setPalette(byte *palette, uint16 count);
bool hasFeature(EngineFeature f) const;
+ void loadPalettes();
const byte *getPalette() const { return _currentPalette; }
uint16 getPaletteColorCount() const { return _currentPaletteLength; }
void loadSharedCastsFrom(Common::String filename);
@@ -172,15 +180,22 @@ private:
Graphics::MacPatterns _director3Patterns;
Graphics::MacPatterns _director3QuickDrawPatterns;
+ Common::HashMap<int, PaletteV4 *> _director4Palettes;
+
Common::String _sharedCastFile;
bool _draggingSprite;
uint16 _draggingSpriteId;
Common::Point _draggingSpritePos;
+ Common::StringArray _movieQueue;
+
private:
void testFontScaling();
void testFonts();
+
+ void enqueueAllMovies();
+ MovieReference getNextMovieFromQueue();
};
extern DirectorEngine *g_director;
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 24a0be8f00..880842f20a 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -197,8 +197,13 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
sprite._scriptId = stream->readByte();
sprite._spriteType = stream->readByte();
sprite._enabled = sprite._spriteType != 0;
- sprite._foreColor = 0xff - (uint8)stream->readByte();
- sprite._backColor = 0xff - (uint8)stream->readByte();
+ if (_vm->getVersion() >= 4) {
+ sprite._foreColor = 0xff - (uint8)stream->readByte();
+ sprite._backColor = 0xff - (uint8)stream->readByte();
+ } else {
+ sprite._foreColor = (127 - stream->readByte()) & 0xff; // -128 -> 0, 127 -> 256
+ sprite._backColor = (127 - stream->readByte()) & 0xff;
+ }
sprite._flags = stream->readUint16();
sprite._ink = static_cast<InkType>(sprite._flags & 0x3f);
@@ -208,7 +213,7 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
else
sprite._trails = 0;
- sprite._lineSize = (sprite._flags >> 8) & 0x03;
+ sprite._lineSize = ((sprite._flags >> 8) & 0x07);
sprite._castId = stream->readUint16();
sprite._startPoint.y = stream->readUint16();
@@ -605,7 +610,7 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
}
} else {
if (!_vm->getCurrentScore()->_loadedCast->contains(_sprites[i]->_castId)) {
- if (!_vm->getSharedScore()->_loadedCast->contains(_sprites[i]->_castId)) {
+ if (!_vm->getSharedScore() || !_vm->getSharedScore()->_loadedCast->contains(_sprites[i]->_castId)) {
debugC(1, kDebugImages, "Frame::renderSprites(): Cast id %d not found", _sprites[i]->_castId);
continue;
} else {
@@ -664,7 +669,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
byte spriteType = sp->_spriteType;
byte foreColor = sp->_foreColor;
byte backColor = sp->_backColor;
- int lineSize = sp->_lineSize - 1;
+ int lineSize = sp->_lineSize;
if (spriteType == kCastMemberSprite && sp->_cast != NULL) {
switch (sp->_cast->_type) {
case kCastShape:
@@ -688,7 +693,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
}
foreColor = sc->_fgCol;
backColor = sc->_bgCol;
- lineSize = sc->_lineThickness - 1;
+ lineSize = sc->_lineThickness;
ink = sc->_ink;
// shapes should be rendered with transparency by default
if (ink == kInkTypeCopy) {
@@ -702,6 +707,9 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
}
}
+ // for outlined shapes, line thickness of 1 means invisible.
+ lineSize -= 1;
+
Common::Rect shapeRect = Common::Rect(sp->_startPoint.x,
sp->_startPoint.y,
sp->_startPoint.x + sp->_width,
@@ -711,42 +719,55 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
tmpSurface.create(shapeRect.width(), shapeRect.height(), Graphics::PixelFormat::createFormatCLUT8());
tmpSurface.clear(255);
- // No minus one on the pattern here! MacPlotData will do that for us!
- //Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), 1, 1, sp->_backColor);
- Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), sp->getPattern(), lineSize, backColor);
- Common::Rect fillRect(MAX((int)shapeRect.width() - lineSize, 0), MAX((int)shapeRect.height() - lineSize, 0));
+ // Draw fill
+ Common::Rect fillRect((int)shapeRect.width(), (int)shapeRect.height());
+ Graphics::MacPlotData plotFill(&tmpSurface, &_vm->getPatterns(), sp->getPattern(), -shapeRect.left, -shapeRect.top, 1, backColor);
switch (spriteType) {
case kRectangleSprite:
- Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &plotFill);
break;
case kRoundedRectangleSprite:
- Graphics::drawRoundRect(fillRect, 4, foreColor, true, Graphics::macDrawPixel, &pd);
+ Graphics::drawRoundRect(fillRect, 12, foreColor, true, Graphics::macDrawPixel, &plotFill);
break;
case kOvalSprite:
- Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, true, Graphics::macDrawPixel, &pd);
+ Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, true, Graphics::macDrawPixel, &plotFill);
+ break;
+ case kCastMemberSprite: // Face kit D3
+ Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &plotFill);
+ break;
+ default:
break;
+ }
+
+ // Draw stroke
+ Common::Rect strokeRect(MAX((int)shapeRect.width() - lineSize, 0), MAX((int)shapeRect.height() - lineSize, 0));
+ Graphics::MacPlotData plotStroke(&tmpSurface, &_vm->getPatterns(), 1, -shapeRect.left, -shapeRect.top, lineSize, backColor);
+ switch (spriteType) {
case kLineTopBottomSprite:
- Graphics::drawLine(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawLine(strokeRect.left, strokeRect.top, strokeRect.right, strokeRect.bottom, foreColor, Graphics::macDrawPixel, &plotStroke);
break;
case kLineBottomTopSprite:
- Graphics::drawLine(fillRect.left, fillRect.bottom, fillRect.right, fillRect.top, foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawLine(strokeRect.left, strokeRect.bottom, strokeRect.right, strokeRect.top, foreColor, Graphics::macDrawPixel, &plotStroke);
break;
+ case kRectangleSprite:
+ // fall through
case kOutlinedRectangleSprite: // this is actually a mouse-over shape? I don't think it's a real button.
- //Graphics::drawRect(fillRect, sp->_foreColor, Graphics::macDrawPixel, &pd);
- tmpSurface.fillRect(Common::Rect(shapeRect.width(), shapeRect.height()), (_vm->getCurrentScore()->_currentMouseDownSpriteId == spriteId ? 0 : 0xff));
+ Graphics::drawRect(strokeRect, foreColor, Graphics::macDrawPixel, &plotStroke);
+ //tmpSurface.fillRect(Common::Rect(shapeRect.width(), shapeRect.height()), (_vm->getCurrentScore()->_currentMouseDownSpriteId == spriteId ? 0 : 0xff));
break;
+ case kRoundedRectangleSprite:
+ // fall through
case kOutlinedRoundedRectangleSprite:
- Graphics::drawRoundRect(fillRect, 4, foreColor, false, Graphics::macDrawPixel, &pd);
+ Graphics::drawRoundRect(strokeRect, 12, foreColor, false, Graphics::macDrawPixel, &plotStroke);
break;
+ case kOvalSprite:
+ // fall through
case kOutlinedOvalSprite:
- Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, false, Graphics::macDrawPixel, &pd);
- break;
- case kCastMemberSprite: // Face kit D3
- Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawEllipse(strokeRect.left, strokeRect.top, strokeRect.right, strokeRect.bottom, foreColor, false, Graphics::macDrawPixel, &plotStroke);
break;
default:
- warning("Frame::renderShape(): Unhandled sprite type: %d", sp->_spriteType);
+ break;
}
addDrawRect(spriteId, shapeRect);
@@ -766,9 +787,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
int height = button->_initialRect.height();
int width = button->_initialRect.width() + 3;
- Common::Rect textRect(0, 0, width, height);
- // pass the rect of the button into the label.
- renderText(surface, spriteId, &textRect);
+ bool invert = spriteId == _vm->getCurrentScore()->_currentMouseDownSpriteId;
// TODO: review all cases to confirm if we should use text height.
// height = textRect.height();
@@ -784,8 +803,9 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
break;
case kTypeButton: {
_rect = Common::Rect(x, y, x + width, y + height + 3);
- Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 1, Graphics::kColorWhite);
- Graphics::drawRoundRect(_rect, 4, 0, false, Graphics::macDrawPixel, &pd);
+ Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 0, 0, 1, invert ? Graphics::kColorBlack : Graphics::kColorWhite);
+
+ Graphics::drawRoundRect(_rect, 4, 0, invert, Graphics::macDrawPixel, &pd);
addDrawRect(spriteId, _rect);
}
break;
@@ -796,9 +816,13 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
warning("renderButton: Unknown buttonType");
break;
}
+
+ Common::Rect textRect(0, 0, width, height);
+ // pass the rect of the button into the label.
+ renderText(surface, spriteId, &textRect);
}
-void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textSize) {
+void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textRect) {
TextCast *textCast = (TextCast*)_sprites[spriteId]->_cast;
int x = _sprites[spriteId]->_startPoint.x; // +rectLeft;
@@ -807,10 +831,10 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
int width;
if (_vm->getVersion() >= 4) {
- if (textSize == NULL)
+ if (textRect == NULL)
width = textCast->_initialRect.right;
else {
- width = textSize->width();
+ width = textRect->width();
}
} else {
width = textCast->_initialRect.width(); //_sprites[spriteId]->_width;
@@ -829,11 +853,11 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
Graphics::MacFont *macFont = new Graphics::MacFont(textCast->_fontId, textCast->_fontSize, textCast->_textSlant);
- debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s' text: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str(), Common::toPrintable(textCast->_ftext).c_str());
+ debugC(3, kDebugText, "renderText: sprite: %d x: %d y: %d w: %d h: %d font: '%s' text: '%s'", spriteId, x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str(), Common::toPrintable(textCast->_ftext).c_str());
uint16 boxShadow = (uint16)textCast->_boxShadow;
uint16 borderSize = (uint16)textCast->_borderSize;
- if (textSize != NULL)
+ if (textRect != NULL)
borderSize = 0;
uint16 padding = (uint16)textCast->_gutterSize;
uint16 textShadow = (uint16)textCast->_textShadow;
@@ -848,14 +872,14 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
return;
height = textSurface->h;
- if (textSize != NULL) {
+ if (textRect != NULL) {
// TODO: this offset could be due to incorrect fonts loaded!
- textSize->bottom = height + textCast->_cachedMacText->getLineCount();
+ textRect->bottom = height + textCast->_cachedMacText->getLineCount();
}
uint16 textX = 0, textY = 0;
- if (textSize == NULL) {
+ if (textRect == NULL) {
if (borderSize > 0) {
if (_vm->getVersion() <= 3)
height++;
@@ -901,11 +925,11 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
Graphics::ManagedSurface textWithFeatures(width + (borderSize * 2) + boxShadow + textShadow, height + borderSize + boxShadow + textShadow);
textWithFeatures.fillRect(Common::Rect(textWithFeatures.w, textWithFeatures.h), 0xff);
- if (textSize == NULL && boxShadow > 0) {
+ if (textRect == NULL && boxShadow > 0) {
textWithFeatures.fillRect(Common::Rect(boxShadow, boxShadow, textWithFeatures.w + boxShadow, textWithFeatures.h), 0);
}
- if (textSize == NULL && borderSize != kSizeNone) {
+ if (textRect == NULL && borderSize != kSizeNone) {
for (int bb = 0; bb < borderSize; bb++) {
Common::Rect borderRect(bb, bb, textWithFeatures.w - bb - boxShadow - textShadow, textWithFeatures.h - bb - boxShadow - textShadow);
textWithFeatures.fillRect(borderRect, 0xff);
@@ -918,7 +942,12 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
textWithFeatures.transBlitFrom(textSurface->rawSurface(), Common::Point(textX, textY), 0xff);
- inkBasedBlit(surface, textWithFeatures, _sprites[spriteId]->_ink, Common::Rect(x, y, x + width, y + height));
+ InkType ink = _sprites[spriteId]->_ink;
+
+ if (spriteId == _vm->getCurrentScore()->_currentMouseDownSpriteId)
+ ink = kInkTypeReverse;
+
+ inkBasedBlit(surface, textWithFeatures, ink, Common::Rect(x, y, x + width, y + height));
}
void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics::Surface &spriteSurface, InkType ink, Common::Rect drawRect) {
diff --git a/engines/director/frame.h b/engines/director/frame.h
index 25192af05e..970e8a4cc2 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -46,62 +46,6 @@ enum {
kChannelDataSize = (25 * 50)
};
-enum TransitionType {
- kTransNone,
- kTransWipeRight,
- kTransWipeLeft,
- kTransWipeDown,
- kTransWipeUp,
- kTransCenterOutHorizontal,
- kTransEdgesInHorizontal,
- kTransCenterOutVertical,
- kTransEdgesInVertical,
- kTransCenterOutSquare,
- kTransEdgesInSquare,
- kTransPushLeft,
- kTransPushRight,
- kTransPushDown,
- kTransPushUp,
- kTransRevealUp,
- kTransRevealUpRight,
- kTransRevealRight,
- kTransRevealDown,
- kTransRevealDownRight,
- kTransRevealDownLeft,
- kTransRevealLeft,
- kTransRevealUpLeft,
- kTransDissolvePixelsFast,
- kTransDissolveBoxyRects,
- kTransDissolveBoxySquares,
- kTransDissolvePatterns,
- kTransRandomRows,
- kTransRandomColumns,
- kTransCoverDown,
- kTransCoverDownLeft,
- kTransCoverDownRight,
- kTransCoverLeft,
- kTransCoverRight,
- kTransCoverUp,
- kTransCoverUpLeft,
- kTransCoverUpRight,
- kTransTypeVenitianBlind,
- kTransTypeCheckerboard,
- kTransTypeStripsBottomBuildLeft,
- kTransTypeStripsBottomBuildRight,
- kTransTypeStripsLeftBuildDown,
- kTransTypeStripsLeftBuildUp,
- kTransTypeStripsRightBuildDown,
- kTransTypeStripsRightBuildUp,
- kTransTypeStripsTopBuildLeft,
- kTransTypeStripsTopBuildRight,
- kTransZoomOpen,
- kTransZoomClose,
- kTransVerticalBinds,
- kTransDissolveBitsTrans,
- kTransDissolvePixels,
- kTransDissolveBits
-};
-
struct PaletteInfo {
uint8 firstColor;
uint8 lastColor;
diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp
index b1030d09ce..0ee1928b8d 100644
--- a/engines/director/graphics.cpp
+++ b/engines/director/graphics.cpp
@@ -31,8 +31,7 @@
namespace Director {
-// Referred as extern
-byte defaultPalette[768] = {
+static byte macPalette[768] = {
0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, // 0 (0x00)
0x55, 0x55, 0x55, 0x77, 0x77, 0x77, 0x88, 0x88, 0x88, 0xaa, 0xaa, 0xaa, // 4 (0x04)
0xbb, 0xbb, 0xbb, 0xdd, 0xdd, 0xdd, 0xee, 0xee, 0xee, 0x00, 0x00, 0x11, // 8 (0x08)
@@ -99,6 +98,488 @@ byte defaultPalette[768] = {
0xff, 0xff, 0x66, 0xff, 0xff, 0x99, 0xff, 0xff, 0xcc, 0xff, 0xff, 0xff // 252 (0xfc)
};
+static byte rainbowPalette[768] = {
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x30, 0x30, 0x30, // 0 (0x00)
+ 0x40, 0x40, 0x40, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, // 4 (0x04)
+ 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, 0xb0, // 8 (0x08)
+ 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, // 12 (0x0c)
+ 0x00, 0x72, 0xff, 0x00, 0x79, 0xff, 0x00, 0x7f, 0xff, 0x00, 0x85, 0xff, // 16 (0x10)
+ 0x00, 0x8c, 0xff, 0x00, 0x92, 0xff, 0x00, 0x99, 0xff, 0x00, 0x9f, 0xff, // 20 (0x14)
+ 0x00, 0xa5, 0xff, 0x00, 0xac, 0xff, 0x00, 0xb2, 0xff, 0x00, 0xb8, 0xff, // 24 (0x18)
+ 0x00, 0xbf, 0xff, 0x00, 0xc5, 0xff, 0x00, 0xcc, 0xff, 0x00, 0xd2, 0xff, // 28 (0x1c)
+ 0x00, 0xd8, 0xff, 0x00, 0xdf, 0xff, 0x00, 0xe5, 0xff, 0x00, 0xeb, 0xff, // 32 (0x20)
+ 0x00, 0xf2, 0xff, 0x00, 0xf8, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xf8, // 36 (0x24)
+ 0x00, 0xff, 0xf2, 0x00, 0xff, 0xeb, 0x00, 0xff, 0xe5, 0x00, 0xff, 0xdf, // 40 (0x28)
+ 0x00, 0xff, 0xd8, 0x00, 0xff, 0xd2, 0x00, 0xff, 0xcc, 0x00, 0xff, 0xc5, // 44 (0x2c)
+ 0x00, 0xff, 0xbf, 0x00, 0xff, 0xb8, 0x00, 0xff, 0xb2, 0x00, 0xff, 0xac, // 48 (0x30)
+ 0x00, 0xff, 0xa5, 0x00, 0xff, 0x9f, 0x00, 0xff, 0x99, 0x00, 0xff, 0x92, // 52 (0x34)
+ 0x00, 0xff, 0x8c, 0x00, 0xff, 0x85, 0x00, 0xff, 0x7f, 0x00, 0xff, 0x79, // 56 (0x38)
+ 0x00, 0xff, 0x72, 0x00, 0xff, 0x6c, 0x00, 0xff, 0x66, 0x00, 0xff, 0x5f, // 60 (0x3c)
+ 0x00, 0xff, 0x59, 0x00, 0xff, 0x52, 0x00, 0xff, 0x4c, 0x00, 0xff, 0x46, // 64 (0x40)
+ 0x00, 0xff, 0x3f, 0x00, 0xff, 0x39, 0x00, 0xff, 0x33, 0x00, 0xff, 0x2c, // 68 (0x44)
+ 0x00, 0xff, 0x26, 0x00, 0xff, 0x1f, 0x00, 0xff, 0x19, 0x00, 0xff, 0x13, // 72 (0x48)
+ 0x00, 0xff, 0x0c, 0x00, 0xff, 0x06, 0x00, 0xff, 0x00, 0x06, 0xff, 0x00, // 76 (0x4c)
+ 0x0c, 0xff, 0x00, 0x13, 0xff, 0x00, 0x19, 0xff, 0x00, 0x1f, 0xff, 0x00, // 80 (0x50)
+ 0x26, 0xff, 0x00, 0x2c, 0xff, 0x00, 0x33, 0xff, 0x00, 0x39, 0xff, 0x00, // 84 (0x54)
+ 0x3f, 0xff, 0x00, 0x46, 0xff, 0x00, 0x4c, 0xff, 0x00, 0x52, 0xff, 0x00, // 88 (0x58)
+ 0x59, 0xff, 0x00, 0x5f, 0xff, 0x00, 0x66, 0xff, 0x00, 0x6c, 0xff, 0x00, // 92 (0x5c)
+ 0x72, 0xff, 0x00, 0x79, 0xff, 0x00, 0x7f, 0xff, 0x00, 0x85, 0xff, 0x00, // 96 (0x60)
+ 0x8c, 0xff, 0x00, 0x92, 0xff, 0x00, 0x99, 0xff, 0x00, 0x9f, 0xff, 0x00, // 100 (0x64)
+ 0xa5, 0xff, 0x00, 0xac, 0xff, 0x00, 0xb2, 0xff, 0x00, 0xb8, 0xff, 0x00, // 104 (0x68)
+ 0xbf, 0xff, 0x00, 0xc5, 0xff, 0x00, 0xcc, 0xff, 0x00, 0xd2, 0xff, 0x00, // 108 (0x6c)
+ 0xd8, 0xff, 0x00, 0xdf, 0xff, 0x00, 0xe5, 0xff, 0x00, 0xeb, 0xff, 0x00, // 112 (0x70)
+ 0xf2, 0xff, 0x00, 0xf8, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xf8, 0x00, // 116 (0x74)
+ 0xff, 0xf2, 0x00, 0xff, 0xeb, 0x00, 0xff, 0xe5, 0x00, 0xff, 0xdf, 0x00, // 120 (0x78)
+ 0xff, 0xd8, 0x00, 0xff, 0xd2, 0x00, 0xff, 0xcc, 0x00, 0xff, 0xc5, 0x00, // 124 (0x7c)
+ 0xff, 0xbf, 0x00, 0xff, 0xb8, 0x00, 0xff, 0xb2, 0x00, 0xff, 0xac, 0x00, // 128 (0x80)
+ 0xff, 0xa5, 0x00, 0xff, 0x9f, 0x00, 0xff, 0x99, 0x00, 0xff, 0x92, 0x00, // 132 (0x84)
+ 0xff, 0x8c, 0x00, 0xff, 0x85, 0x00, 0xff, 0x7f, 0x00, 0xff, 0x79, 0x00, // 136 (0x88)
+ 0xff, 0x72, 0x00, 0xff, 0x6c, 0x00, 0xff, 0x66, 0x00, 0xff, 0x5f, 0x00, // 140 (0x8c)
+ 0xff, 0x59, 0x00, 0xff, 0x52, 0x00, 0xff, 0x4c, 0x00, 0xff, 0x46, 0x00, // 144 (0x90)
+ 0xff, 0x3f, 0x00, 0xff, 0x39, 0x00, 0xff, 0x33, 0x00, 0xff, 0x2c, 0x00, // 148 (0x94)
+ 0xff, 0x26, 0x00, 0xff, 0x1f, 0x00, 0xff, 0x19, 0x00, 0xff, 0x13, 0x00, // 152 (0x98)
+ 0xff, 0x0c, 0x00, 0xff, 0x06, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x06, // 156 (0x9c)
+ 0xff, 0x00, 0x0c, 0xff, 0x00, 0x13, 0xff, 0x00, 0x19, 0xff, 0x00, 0x1f, // 160 (0xa0)
+ 0xff, 0x00, 0x26, 0xff, 0x00, 0x2c, 0xff, 0x00, 0x33, 0xff, 0x00, 0x39, // 164 (0xa4)
+ 0xff, 0x00, 0x3f, 0xff, 0x00, 0x46, 0xff, 0x00, 0x4c, 0xff, 0x00, 0x52, // 168 (0xa8)
+ 0xff, 0x00, 0x59, 0xff, 0x00, 0x5f, 0xff, 0x00, 0x66, 0xff, 0x00, 0x6c, // 172 (0xac)
+ 0xff, 0x00, 0x72, 0xff, 0x00, 0x79, 0xff, 0x00, 0x7f, 0xff, 0x00, 0x85, // 176 (0xb0)
+ 0xff, 0x00, 0x8c, 0xff, 0x00, 0x92, 0xff, 0x00, 0x99, 0xff, 0x00, 0x9f, // 180 (0xb4)
+ 0xff, 0x00, 0xa5, 0xff, 0x00, 0xac, 0xff, 0x00, 0xb2, 0xff, 0x00, 0xb8, // 184 (0xb8)
+ 0xff, 0x00, 0xbf, 0xff, 0x00, 0xc5, 0xff, 0x00, 0xcc, 0xff, 0x00, 0xd2, // 188 (0xbc)
+ 0xff, 0x00, 0xd8, 0xff, 0x00, 0xdf, 0xff, 0x00, 0xe5, 0xff, 0x00, 0xeb, // 192 (0xc0)
+ 0xff, 0x00, 0xf2, 0xff, 0x00, 0xf8, 0xff, 0x00, 0xff, 0xf8, 0x00, 0xff, // 196 (0xc4)
+ 0xf2, 0x00, 0xff, 0xeb, 0x00, 0xff, 0xe5, 0x00, 0xff, 0xdf, 0x00, 0xff, // 200 (0xc8)
+ 0xd8, 0x00, 0xff, 0xd2, 0x00, 0xff, 0xcc, 0x00, 0xff, 0xc5, 0x00, 0xff, // 204 (0xcc)
+ 0xbf, 0x00, 0xff, 0xb8, 0x00, 0xff, 0xb2, 0x00, 0xff, 0xac, 0x00, 0xff, // 208 (0xd0)
+ 0xa5, 0x00, 0xff, 0x9f, 0x00, 0xff, 0x99, 0x00, 0xff, 0x92, 0x00, 0xff, // 212 (0xd4)
+ 0x8c, 0x00, 0xff, 0x85, 0x00, 0xff, 0x7f, 0x00, 0xff, 0x79, 0x00, 0xff, // 216 (0xd8)
+ 0x72, 0x00, 0xff, 0x6c, 0x00, 0xff, 0x66, 0x00, 0xff, 0x5f, 0x00, 0xff, // 220 (0xdc)
+ 0x59, 0x00, 0xff, 0x52, 0x00, 0xff, 0x4c, 0x00, 0xff, 0x46, 0x00, 0xff, // 224 (0xe0)
+ 0x3f, 0x00, 0xff, 0x39, 0x00, 0xff, 0x33, 0x00, 0xff, 0x2c, 0x00, 0xff, // 228 (0xe4)
+ 0x26, 0x00, 0xff, 0x1f, 0x00, 0xff, 0x19, 0x00, 0xff, 0x13, 0x00, 0xff, // 232 (0xe8)
+ 0x0c, 0x00, 0xff, 0x06, 0x00, 0xff, 0x00, 0x03, 0xff, 0x00, 0x0a, 0xff, // 236 (0xec)
+ 0x00, 0x10, 0xff, 0x00, 0x17, 0xff, 0x00, 0x1d, 0xff, 0x00, 0x23, 0xff, // 240 (0xf0)
+ 0x00, 0x2a, 0xff, 0x00, 0x30, 0xff, 0x00, 0x36, 0xff, 0x00, 0x3d, 0xff, // 244 (0xf4)
+ 0x00, 0x43, 0xff, 0x00, 0x4a, 0xff, 0x00, 0x50, 0xff, 0x00, 0x56, 0xff, // 248 (0xf8)
+ 0x00, 0x5d, 0xff, 0x00, 0x63, 0xff, 0x00, 0x69, 0xff, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte grayscalePalette[768] = {
+ 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, // 0 (0x00)
+ 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, // 4 (0x04)
+ 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, // 8 (0x08)
+ 0x0c, 0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, // 12 (0x0c)
+ 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, // 16 (0x10)
+ 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, // 20 (0x14)
+ 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b, 0x1b, // 24 (0x18)
+ 0x1c, 0x1c, 0x1c, 0x1d, 0x1d, 0x1d, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, // 28 (0x1c)
+ 0x20, 0x20, 0x20, 0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x23, 0x23, 0x23, // 32 (0x20)
+ 0x24, 0x24, 0x24, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26, 0x27, 0x27, 0x27, // 36 (0x24)
+ 0x28, 0x28, 0x28, 0x29, 0x29, 0x29, 0x2a, 0x2a, 0x2a, 0x2b, 0x2b, 0x2b, // 40 (0x28)
+ 0x2c, 0x2c, 0x2c, 0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, // 44 (0x2c)
+ 0x30, 0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x33, // 48 (0x30)
+ 0x34, 0x34, 0x34, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36, 0x37, 0x37, 0x37, // 52 (0x34)
+ 0x38, 0x38, 0x38, 0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b, 0x3b, // 56 (0x38)
+ 0x3c, 0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e, 0x3f, 0x3f, 0x3f, // 60 (0x3c)
+ 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x43, 0x43, 0x43, // 64 (0x40)
+ 0x44, 0x44, 0x44, 0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47, 0x47, // 68 (0x44)
+ 0x48, 0x48, 0x48, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a, 0x4b, 0x4b, 0x4b, // 72 (0x48)
+ 0x4c, 0x4c, 0x4c, 0x4d, 0x4d, 0x4d, 0x4e, 0x4e, 0x4e, 0x4f, 0x4f, 0x4f, // 76 (0x4c)
+ 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53, 0x53, // 80 (0x50)
+ 0x54, 0x54, 0x54, 0x55, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0x57, 0x57, // 84 (0x54)
+ 0x58, 0x58, 0x58, 0x59, 0x59, 0x59, 0x5a, 0x5a, 0x5a, 0x5b, 0x5b, 0x5b, // 88 (0x58)
+ 0x5c, 0x5c, 0x5c, 0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f, 0x5f, // 92 (0x5c)
+ 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62, 0x63, 0x63, 0x63, // 96 (0x60)
+ 0x64, 0x64, 0x64, 0x65, 0x65, 0x65, 0x66, 0x66, 0x66, 0x67, 0x67, 0x67, // 100 (0x64)
+ 0x68, 0x68, 0x68, 0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b, 0x6b, // 104 (0x68)
+ 0x6c, 0x6c, 0x6c, 0x6d, 0x6d, 0x6d, 0x6e, 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, // 108 (0x6c)
+ 0x70, 0x70, 0x70, 0x71, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73, 0x73, // 112 (0x70)
+ 0x74, 0x74, 0x74, 0x75, 0x75, 0x75, 0x76, 0x76, 0x76, 0x77, 0x77, 0x77, // 116 (0x74)
+ 0x78, 0x78, 0x78, 0x79, 0x79, 0x79, 0x7a, 0x7a, 0x7a, 0x7b, 0x7b, 0x7b, // 120 (0x78)
+ 0x7c, 0x7c, 0x7c, 0x7d, 0x7d, 0x7d, 0x7e, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, // 124 (0x7c)
+ 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x82, 0x82, 0x82, 0x83, 0x83, 0x83, // 128 (0x80)
+ 0x84, 0x84, 0x84, 0x85, 0x85, 0x85, 0x86, 0x86, 0x86, 0x87, 0x87, 0x87, // 132 (0x84)
+ 0x88, 0x88, 0x88, 0x89, 0x89, 0x89, 0x8a, 0x8a, 0x8a, 0x8b, 0x8b, 0x8b, // 136 (0x88)
+ 0x8c, 0x8c, 0x8c, 0x8d, 0x8d, 0x8d, 0x8e, 0x8e, 0x8e, 0x8f, 0x8f, 0x8f, // 140 (0x8c)
+ 0x90, 0x90, 0x90, 0x91, 0x91, 0x91, 0x92, 0x92, 0x92, 0x93, 0x93, 0x93, // 144 (0x90)
+ 0x94, 0x94, 0x94, 0x95, 0x95, 0x95, 0x96, 0x96, 0x96, 0x97, 0x97, 0x97, // 148 (0x94)
+ 0x98, 0x98, 0x98, 0x99, 0x99, 0x99, 0x9a, 0x9a, 0x9a, 0x9b, 0x9b, 0x9b, // 152 (0x98)
+ 0x9c, 0x9c, 0x9c, 0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f, 0x9f, // 156 (0x9c)
+ 0xa0, 0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, // 160 (0xa0)
+ 0xa4, 0xa4, 0xa4, 0xa5, 0xa5, 0xa5, 0xa6, 0xa6, 0xa6, 0xa7, 0xa7, 0xa7, // 164 (0xa4)
+ 0xa8, 0xa8, 0xa8, 0xa9, 0xa9, 0xa9, 0xaa, 0xaa, 0xaa, 0xab, 0xab, 0xab, // 168 (0xa8)
+ 0xac, 0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae, 0xaf, 0xaf, 0xaf, // 172 (0xac)
+ 0xb0, 0xb0, 0xb0, 0xb1, 0xb1, 0xb1, 0xb2, 0xb2, 0xb2, 0xb3, 0xb3, 0xb3, // 176 (0xb0)
+ 0xb4, 0xb4, 0xb4, 0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7, 0xb7, // 180 (0xb4)
+ 0xb8, 0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xba, 0xba, 0xba, 0xbb, 0xbb, 0xbb, // 184 (0xb8)
+ 0xbc, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe, 0xbe, 0xbf, 0xbf, 0xbf, // 188 (0xbc)
+ 0xc0, 0xc0, 0xc0, 0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3, 0xc3, // 192 (0xc0)
+ 0xc4, 0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6, 0xc7, 0xc7, 0xc7, // 196 (0xc4)
+ 0xc8, 0xc8, 0xc8, 0xc9, 0xc9, 0xc9, 0xca, 0xca, 0xca, 0xcb, 0xcb, 0xcb, // 200 (0xc8)
+ 0xcc, 0xcc, 0xcc, 0xcd, 0xcd, 0xcd, 0xce, 0xce, 0xce, 0xcf, 0xcf, 0xcf, // 204 (0xcc)
+ 0xd0, 0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2, 0xd3, 0xd3, 0xd3, // 208 (0xd0)
+ 0xd4, 0xd4, 0xd4, 0xd5, 0xd5, 0xd5, 0xd6, 0xd6, 0xd6, 0xd7, 0xd7, 0xd7, // 212 (0xd4)
+ 0xd8, 0xd8, 0xd8, 0xd9, 0xd9, 0xd9, 0xda, 0xda, 0xda, 0xdb, 0xdb, 0xdb, // 216 (0xd8)
+ 0xdc, 0xdc, 0xdc, 0xdd, 0xdd, 0xdd, 0xde, 0xde, 0xde, 0xdf, 0xdf, 0xdf, // 220 (0xdc)
+ 0xe0, 0xe0, 0xe0, 0xe1, 0xe1, 0xe1, 0xe2, 0xe2, 0xe2, 0xe3, 0xe3, 0xe3, // 224 (0xe0)
+ 0xe4, 0xe4, 0xe4, 0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7, 0xe7, // 228 (0xe4)
+ 0xe8, 0xe8, 0xe8, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea, 0xeb, 0xeb, 0xeb, // 232 (0xe8)
+ 0xec, 0xec, 0xec, 0xed, 0xed, 0xed, 0xee, 0xee, 0xee, 0xef, 0xef, 0xef, // 236 (0xec)
+ 0xf0, 0xf0, 0xf0, 0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3, 0xf3, // 240 (0xf0)
+ 0xf4, 0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6, 0xf7, 0xf7, 0xf7, // 244 (0xf4)
+ 0xf8, 0xf8, 0xf8, 0xf9, 0xf9, 0xf9, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, // 248 (0xf8)
+ 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte pastelsPalette[768] = {
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x30, 0x30, 0x30, // 0 (0x00)
+ 0x40, 0x40, 0x40, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, // 4 (0x04)
+ 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, 0xb0, // 8 (0x08)
+ 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, // 12 (0x0c)
+ 0xe4, 0xe4, 0xee, 0xd9, 0xd9, 0xed, 0xcd, 0xcd, 0xec, 0xc2, 0xc2, 0xeb, // 16 (0x10)
+ 0xb6, 0xb6, 0xea, 0xab, 0xab, 0xe9, 0x9f, 0x9f, 0xe8, 0x94, 0x94, 0xe7, // 20 (0x14)
+ 0x88, 0x88, 0xe6, 0x7d, 0x7d, 0xe5, 0x71, 0x71, 0xe4, 0x66, 0x66, 0xe3, // 24 (0x18)
+ 0x5a, 0x5a, 0xe2, 0x4f, 0x4f, 0xe1, 0x44, 0x44, 0xe0, 0x50, 0x45, 0xdc, // 28 (0x1c)
+ 0x5c, 0x45, 0xd8, 0x68, 0x46, 0xd4, 0x74, 0x46, 0xd0, 0x7f, 0x46, 0xcc, // 32 (0x20)
+ 0x8b, 0x47, 0xc8, 0x97, 0x47, 0xc4, 0xa3, 0x48, 0xc1, 0xaf, 0x48, 0xbd, // 36 (0x24)
+ 0xba, 0x48, 0xb9, 0xc6, 0x49, 0xb5, 0xd2, 0x49, 0xb1, 0xde, 0x4a, 0xad, // 40 (0x28)
+ 0xea, 0x4a, 0xa9, 0xf6, 0x4b, 0xa6, 0xf4, 0x4b, 0x9f, 0xf3, 0x4b, 0x99, // 44 (0x2c)
+ 0xf2, 0x4b, 0x93, 0xf1, 0x4b, 0x8d, 0xf0, 0x4b, 0x87, 0xef, 0x4b, 0x81, // 48 (0x30)
+ 0xee, 0x4b, 0x7b, 0xec, 0x4b, 0x74, 0xeb, 0x4b, 0x6e, 0xea, 0x4b, 0x68, // 52 (0x34)
+ 0xe9, 0x4b, 0x62, 0xe8, 0x4b, 0x5c, 0xe7, 0x4b, 0x56, 0xe6, 0x4b, 0x50, // 56 (0x38)
+ 0xe5, 0x4b, 0x4a, 0xe7, 0x57, 0x49, 0xe9, 0x62, 0x49, 0xea, 0x6d, 0x49, // 60 (0x3c)
+ 0xec, 0x79, 0x49, 0xed, 0x84, 0x49, 0xef, 0x8f, 0x49, 0xf0, 0x9b, 0x49, // 64 (0x40)
+ 0xf2, 0xa6, 0x49, 0xf3, 0xb1, 0x49, 0xf5, 0xbd, 0x49, 0xf6, 0xc8, 0x49, // 68 (0x44)
+ 0xf8, 0xd3, 0x49, 0xf9, 0xdf, 0x49, 0xfb, 0xea, 0x49, 0xfd, 0xf6, 0x49, // 72 (0x48)
+ 0xf4, 0xec, 0x48, 0xec, 0xe2, 0x48, 0xe4, 0xd9, 0x48, 0xdc, 0xcf, 0x48, // 76 (0x4c)
+ 0xd4, 0xc5, 0x48, 0xcc, 0xbc, 0x48, 0xc4, 0xb2, 0x48, 0xbc, 0xa8, 0x48, // 80 (0x50)
+ 0xb4, 0x9f, 0x48, 0xac, 0x95, 0x48, 0xa4, 0x8b, 0x48, 0x9c, 0x82, 0x48, // 84 (0x54)
+ 0x94, 0x78, 0x48, 0x8c, 0x6e, 0x48, 0x84, 0x65, 0x48, 0x7f, 0x68, 0x49, // 88 (0x58)
+ 0x7b, 0x6b, 0x4a, 0x77, 0x6e, 0x4a, 0x72, 0x70, 0x4b, 0x6e, 0x73, 0x4b, // 92 (0x5c)
+ 0x6a, 0x76, 0x4c, 0x66, 0x79, 0x4c, 0x61, 0x7b, 0x4d, 0x5d, 0x7e, 0x4d, // 96 (0x60)
+ 0x59, 0x81, 0x4e, 0x55, 0x84, 0x4e, 0x50, 0x86, 0x4f, 0x4c, 0x89, 0x4f, // 100 (0x64)
+ 0x48, 0x8c, 0x50, 0x44, 0x8f, 0x51, 0x46, 0x93, 0x52, 0x48, 0x97, 0x52, // 104 (0x68)
+ 0x49, 0x9b, 0x52, 0x4b, 0x9f, 0x52, 0x4c, 0xa3, 0x52, 0x4e, 0xa7, 0x52, // 108 (0x6c)
+ 0x4f, 0xab, 0x52, 0x51, 0xaf, 0x52, 0x52, 0xb3, 0x52, 0x54, 0xb7, 0x52, // 112 (0x70)
+ 0x55, 0xbb, 0x52, 0x57, 0xbf, 0x52, 0x58, 0xc3, 0x52, 0x5a, 0xc7, 0x52, // 116 (0x74)
+ 0x5c, 0xcb, 0x53, 0x5a, 0xca, 0x5e, 0x59, 0xc9, 0x68, 0x57, 0xc9, 0x73, // 120 (0x78)
+ 0x56, 0xc8, 0x7d, 0x55, 0xc8, 0x87, 0x53, 0xc7, 0x92, 0x52, 0xc6, 0x9c, // 124 (0x7c)
+ 0x50, 0xc6, 0xa7, 0x4f, 0xc5, 0xb1, 0x4e, 0xc5, 0xbb, 0x4c, 0xc4, 0xc6, // 128 (0x80)
+ 0x4b, 0xc3, 0xd0, 0x49, 0xc3, 0xdb, 0x48, 0xc2, 0xe5, 0x47, 0xc2, 0xf0, // 132 (0x84)
+ 0x46, 0xb9, 0xee, 0x46, 0xb1, 0xed, 0x46, 0xa9, 0xec, 0x46, 0xa0, 0xeb, // 136 (0x88)
+ 0x46, 0x98, 0xea, 0x45, 0x90, 0xe9, 0x45, 0x87, 0xe8, 0x45, 0x7f, 0xe7, // 140 (0x8c)
+ 0x45, 0x77, 0xe6, 0x45, 0x6e, 0xe5, 0x44, 0x66, 0xe4, 0x44, 0x5e, 0xe3, // 144 (0x90)
+ 0x44, 0x55, 0xe2, 0x44, 0x4d, 0xe1, 0x44, 0x45, 0xe0, 0x48, 0x44, 0xdd, // 148 (0x94)
+ 0x4b, 0x44, 0xdb, 0x4f, 0x44, 0xd9, 0x52, 0x44, 0xd6, 0x55, 0x44, 0xd4, // 152 (0x98)
+ 0x59, 0x44, 0xd2, 0x5c, 0x44, 0xcf, 0x60, 0x44, 0xcd, 0x63, 0x44, 0xcb, // 156 (0x9c)
+ 0x66, 0x44, 0xc8, 0x6a, 0x44, 0xc6, 0x6d, 0x44, 0xc4, 0x71, 0x44, 0xc1, // 160 (0xa0)
+ 0x74, 0x44, 0xbf, 0x78, 0x44, 0xbd, 0x81, 0x45, 0xbb, 0x89, 0x45, 0xb9, // 164 (0xa4)
+ 0x91, 0x46, 0xb8, 0x9a, 0x46, 0xb6, 0xa2, 0x46, 0xb5, 0xaa, 0x47, 0xb3, // 168 (0xa8)
+ 0xb3, 0x47, 0xb2, 0xbb, 0x48, 0xb0, 0xc3, 0x48, 0xaf, 0xcc, 0x48, 0xad, // 172 (0xac)
+ 0xd4, 0x49, 0xac, 0xdc, 0x49, 0xaa, 0xe5, 0x4a, 0xa9, 0xed, 0x4a, 0xa7, // 176 (0xb0)
+ 0xf6, 0x4b, 0xa6, 0xf2, 0x49, 0x9f, 0xee, 0x47, 0x98, 0xea, 0x45, 0x91, // 180 (0xb4)
+ 0xe6, 0x43, 0x8b, 0xe2, 0x41, 0x84, 0xde, 0x3f, 0x7d, 0xda, 0x3d, 0x76, // 184 (0xb8)
+ 0xd6, 0x3b, 0x70, 0xd2, 0x39, 0x69, 0xce, 0x37, 0x62, 0xca, 0x35, 0x5b, // 188 (0xbc)
+ 0xc6, 0x33, 0x55, 0xc2, 0x31, 0x4e, 0xbe, 0x2f, 0x47, 0xba, 0x2d, 0x41, // 192 (0xc0)
+ 0xbd, 0x2f, 0x42, 0xc0, 0x31, 0x43, 0xc3, 0x33, 0x43, 0xc6, 0x35, 0x44, // 196 (0xc4)
+ 0xc8, 0x37, 0x44, 0xcb, 0x39, 0x45, 0xce, 0x3b, 0x45, 0xd1, 0x3d, 0x46, // 200 (0xc8)
+ 0xd4, 0x3f, 0x46, 0xd6, 0x41, 0x47, 0xd9, 0x43, 0x47, 0xdc, 0x45, 0x48, // 204 (0xcc)
+ 0xdf, 0x47, 0x48, 0xe2, 0x49, 0x49, 0xe5, 0x4b, 0x4a, 0xe7, 0x50, 0x49, // 208 (0xd0)
+ 0xe9, 0x54, 0x49, 0xea, 0x58, 0x49, 0xec, 0x5d, 0x48, 0xee, 0x61, 0x48, // 212 (0xd4)
+ 0xef, 0x65, 0x48, 0xf1, 0x6a, 0x48, 0xf3, 0x6e, 0x47, 0xf4, 0x72, 0x47, // 216 (0xd8)
+ 0xf6, 0x77, 0x47, 0xf8, 0x7b, 0x47, 0xf9, 0x7f, 0x46, 0xfb, 0x84, 0x46, // 220 (0xdc)
+ 0xfd, 0x88, 0x46, 0xff, 0x8d, 0x46, 0xfe, 0x94, 0x47, 0xfe, 0x9b, 0x47, // 224 (0xe0)
+ 0xfe, 0xa2, 0x47, 0xfe, 0xa9, 0x47, 0xfe, 0xb0, 0x47, 0xfd, 0xb7, 0x47, // 228 (0xe4)
+ 0xfd, 0xbe, 0x47, 0xfd, 0xc4, 0x47, 0xfd, 0xcb, 0x47, 0xfd, 0xd2, 0x47, // 232 (0xe8)
+ 0xfc, 0xd9, 0x47, 0xfc, 0xe0, 0x47, 0xfc, 0xe7, 0x47, 0xfc, 0xee, 0x47, // 236 (0xec)
+ 0xfc, 0xf5, 0x48, 0xfd, 0xf6, 0x55, 0xfd, 0xf7, 0x61, 0xfd, 0xf7, 0x6d, // 240 (0xf0)
+ 0xfd, 0xf8, 0x79, 0xfd, 0xf8, 0x85, 0xfd, 0xf9, 0x91, 0xfd, 0xfa, 0x9d, // 244 (0xf4)
+ 0xfe, 0xfa, 0xaa, 0xfe, 0xfb, 0xb6, 0xfe, 0xfb, 0xc2, 0xfe, 0xfc, 0xce, // 248 (0xf8)
+ 0xfe, 0xfd, 0xda, 0xfe, 0xfd, 0xe6, 0xfe, 0xfe, 0xf2, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte vividPalette[768] = {
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x30, 0x30, 0x30, // 0 (0x00)
+ 0x40, 0x40, 0x40, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, // 4 (0x04)
+ 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, 0xb0, // 8 (0x08)
+ 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, // 12 (0x0c)
+ 0xe0, 0xe0, 0xee, 0xd0, 0xd0, 0xec, 0xc0, 0xc0, 0xea, 0xb0, 0xb0, 0xe8, // 16 (0x10)
+ 0xa0, 0xa0, 0xe6, 0x90, 0x90, 0xe4, 0x80, 0x80, 0xe2, 0x70, 0x70, 0xe1, // 20 (0x14)
+ 0x60, 0x60, 0xdf, 0x50, 0x50, 0xdd, 0x40, 0x40, 0xdb, 0x30, 0x30, 0xd9, // 24 (0x18)
+ 0x20, 0x20, 0xd7, 0x10, 0x10, 0xd5, 0x00, 0x00, 0xd4, 0x10, 0x00, 0xce, // 28 (0x1c)
+ 0x20, 0x01, 0xc9, 0x30, 0x01, 0xc4, 0x40, 0x02, 0xbe, 0x50, 0x02, 0xb9, // 32 (0x20)
+ 0x60, 0x03, 0xb4, 0x70, 0x03, 0xae, 0x81, 0x04, 0xa9, 0x91, 0x04, 0xa4, // 36 (0x24)
+ 0xa1, 0x05, 0x9e, 0xb1, 0x05, 0x99, 0xc1, 0x06, 0x94, 0xd1, 0x06, 0x8e, // 40 (0x28)
+ 0xe1, 0x07, 0x89, 0xf2, 0x08, 0x84, 0xf0, 0x07, 0x7b, 0xef, 0x07, 0x73, // 44 (0x2c)
+ 0xed, 0x07, 0x6a, 0xec, 0x07, 0x62, 0xea, 0x07, 0x5a, 0xe9, 0x07, 0x51, // 48 (0x30)
+ 0xe7, 0x07, 0x49, 0xe6, 0x07, 0x40, 0xe4, 0x07, 0x38, 0xe3, 0x07, 0x30, // 52 (0x34)
+ 0xe1, 0x07, 0x27, 0xe0, 0x07, 0x1f, 0xde, 0x07, 0x16, 0xdd, 0x07, 0x0e, // 56 (0x38)
+ 0xdc, 0x07, 0x06, 0xdf, 0x17, 0x05, 0xe1, 0x27, 0x05, 0xe3, 0x36, 0x05, // 60 (0x3c)
+ 0xe5, 0x46, 0x05, 0xe7, 0x56, 0x05, 0xe9, 0x65, 0x05, 0xeb, 0x75, 0x05, // 64 (0x40)
+ 0xed, 0x85, 0x05, 0xef, 0x94, 0x05, 0xf1, 0xa4, 0x05, 0xf3, 0xb4, 0x05, // 68 (0x44)
+ 0xf5, 0xc3, 0x05, 0xf7, 0xd3, 0x05, 0xf9, 0xe3, 0x05, 0xfc, 0xf3, 0x05, // 72 (0x48)
+ 0xf0, 0xe5, 0x04, 0xe5, 0xd8, 0x04, 0xda, 0xcb, 0x04, 0xcf, 0xbd, 0x04, // 76 (0x4c)
+ 0xc4, 0xb0, 0x04, 0xb9, 0xa3, 0x04, 0xae, 0x95, 0x04, 0xa3, 0x88, 0x04, // 80 (0x50)
+ 0x98, 0x7b, 0x04, 0x8d, 0x6d, 0x04, 0x82, 0x60, 0x04, 0x77, 0x53, 0x04, // 84 (0x54)
+ 0x6c, 0x45, 0x04, 0x61, 0x38, 0x04, 0x56, 0x2b, 0x04, 0x50, 0x2f, 0x05, // 88 (0x58)
+ 0x4a, 0x33, 0x06, 0x44, 0x36, 0x07, 0x3f, 0x3a, 0x07, 0x39, 0x3e, 0x08, // 92 (0x5c)
+ 0x33, 0x41, 0x09, 0x2d, 0x45, 0x0a, 0x28, 0x49, 0x0a, 0x22, 0x4c, 0x0b, // 96 (0x60)
+ 0x1c, 0x50, 0x0c, 0x16, 0x54, 0x0d, 0x11, 0x57, 0x0d, 0x0b, 0x5b, 0x0e, // 100 (0x64)
+ 0x05, 0x5f, 0x0f, 0x00, 0x63, 0x10, 0x02, 0x69, 0x11, 0x04, 0x6f, 0x11, // 104 (0x68)
+ 0x06, 0x74, 0x11, 0x08, 0x7a, 0x11, 0x0a, 0x7f, 0x11, 0x0c, 0x85, 0x11, // 108 (0x6c)
+ 0x0e, 0x8a, 0x11, 0x10, 0x90, 0x12, 0x12, 0x95, 0x12, 0x14, 0x9b, 0x12, // 112 (0x70)
+ 0x16, 0xa0, 0x12, 0x18, 0xa6, 0x12, 0x1a, 0xab, 0x12, 0x1c, 0xb1, 0x12, // 116 (0x74)
+ 0x1f, 0xb7, 0x13, 0x1d, 0xb6, 0x22, 0x1b, 0xb5, 0x30, 0x19, 0xb4, 0x3e, // 120 (0x78)
+ 0x17, 0xb3, 0x4d, 0x15, 0xb3, 0x5b, 0x13, 0xb2, 0x69, 0x11, 0xb1, 0x77, // 124 (0x7c)
+ 0x0f, 0xb0, 0x86, 0x0d, 0xaf, 0x94, 0x0b, 0xaf, 0xa2, 0x09, 0xae, 0xb0, // 128 (0x80)
+ 0x07, 0xad, 0xbf, 0x05, 0xac, 0xcd, 0x03, 0xab, 0xdb, 0x02, 0xab, 0xea, // 132 (0x84)
+ 0x01, 0x9f, 0xe8, 0x01, 0x94, 0xe7, 0x01, 0x88, 0xe5, 0x01, 0x7d, 0xe4, // 136 (0x88)
+ 0x01, 0x72, 0xe2, 0x01, 0x66, 0xe1, 0x01, 0x5b, 0xdf, 0x00, 0x4f, 0xde, // 140 (0x8c)
+ 0x00, 0x44, 0xdc, 0x00, 0x39, 0xdb, 0x00, 0x2d, 0xd9, 0x00, 0x22, 0xd8, // 144 (0x90)
+ 0x00, 0x16, 0xd6, 0x00, 0x0b, 0xd5, 0x00, 0x00, 0xd4, 0x04, 0x00, 0xd0, // 148 (0x94)
+ 0x09, 0x00, 0xcd, 0x0d, 0x00, 0xca, 0x12, 0x00, 0xc7, 0x16, 0x00, 0xc4, // 152 (0x98)
+ 0x1b, 0x00, 0xc1, 0x20, 0x00, 0xbe, 0x24, 0x00, 0xba, 0x29, 0x00, 0xb7, // 156 (0x9c)
+ 0x2d, 0x00, 0xb4, 0x32, 0x00, 0xb1, 0x37, 0x00, 0xae, 0x3b, 0x00, 0xab, // 160 (0xa0)
+ 0x40, 0x00, 0xa8, 0x45, 0x00, 0xa5, 0x51, 0x00, 0xa2, 0x5c, 0x01, 0xa0, // 164 (0xa4)
+ 0x68, 0x01, 0x9e, 0x73, 0x02, 0x9c, 0x7f, 0x02, 0x9a, 0x8a, 0x03, 0x97, // 168 (0xa8)
+ 0x96, 0x03, 0x95, 0xa1, 0x04, 0x93, 0xad, 0x04, 0x91, 0xb8, 0x05, 0x8f, // 172 (0xac)
+ 0xc4, 0x05, 0x8c, 0xcf, 0x06, 0x8a, 0xdb, 0x06, 0x88, 0xe6, 0x07, 0x86, // 176 (0xb0)
+ 0xf2, 0x08, 0x84, 0xed, 0x07, 0x7c, 0xe8, 0x06, 0x75, 0xe3, 0x06, 0x6e, // 180 (0xb4)
+ 0xde, 0x05, 0x67, 0xda, 0x05, 0x60, 0xd5, 0x04, 0x58, 0xd0, 0x04, 0x51, // 184 (0xb8)
+ 0xcb, 0x03, 0x4a, 0xc6, 0x03, 0x43, 0xc2, 0x02, 0x3c, 0xbd, 0x02, 0x34, // 188 (0xbc)
+ 0xb8, 0x01, 0x2d, 0xb3, 0x01, 0x26, 0xae, 0x00, 0x1f, 0xaa, 0x00, 0x18, // 192 (0xc0)
+ 0xae, 0x00, 0x16, 0xb1, 0x00, 0x15, 0xb4, 0x01, 0x14, 0xb8, 0x01, 0x13, // 196 (0xc4)
+ 0xbb, 0x02, 0x12, 0xbe, 0x02, 0x10, 0xc1, 0x03, 0x0f, 0xc5, 0x03, 0x0e, // 200 (0xc8)
+ 0xc8, 0x04, 0x0d, 0xcb, 0x04, 0x0c, 0xce, 0x05, 0x0a, 0xd2, 0x05, 0x09, // 204 (0xcc)
+ 0xd5, 0x06, 0x08, 0xd8, 0x06, 0x07, 0xdc, 0x07, 0x06, 0xdf, 0x0e, 0x05, // 208 (0xd0)
+ 0xe1, 0x14, 0x05, 0xe3, 0x1a, 0x05, 0xe6, 0x20, 0x04, 0xe8, 0x26, 0x04, // 212 (0xd4)
+ 0xea, 0x2c, 0x04, 0xec, 0x32, 0x03, 0xef, 0x38, 0x03, 0xf1, 0x3e, 0x03, // 216 (0xd8)
+ 0xf3, 0x44, 0x02, 0xf5, 0x4a, 0x02, 0xf8, 0x50, 0x02, 0xfa, 0x56, 0x01, // 220 (0xdc)
+ 0xfc, 0x5c, 0x01, 0xff, 0x63, 0x01, 0xfe, 0x6d, 0x02, 0xfe, 0x76, 0x02, // 224 (0xe0)
+ 0xfe, 0x80, 0x02, 0xfd, 0x89, 0x02, 0xfd, 0x93, 0x02, 0xfd, 0x9c, 0x02, // 228 (0xe4)
+ 0xfd, 0xa6, 0x02, 0xfc, 0xaf, 0x03, 0xfc, 0xb9, 0x03, 0xfc, 0xc2, 0x03, // 232 (0xe8)
+ 0xfc, 0xcc, 0x03, 0xfb, 0xd5, 0x03, 0xfb, 0xdf, 0x03, 0xfb, 0xe8, 0x03, // 236 (0xec)
+ 0xfb, 0xf2, 0x04, 0xfc, 0xf3, 0x15, 0xfc, 0xf4, 0x26, 0xfc, 0xf5, 0x36, // 240 (0xf0)
+ 0xfc, 0xf6, 0x47, 0xfc, 0xf6, 0x58, 0xfd, 0xf7, 0x68, 0xfd, 0xf8, 0x79, // 244 (0xf4)
+ 0xfd, 0xf9, 0x8a, 0xfd, 0xfa, 0x9a, 0xfd, 0xfa, 0xab, 0xfe, 0xfb, 0xbc, // 248 (0xf8)
+ 0xfe, 0xfc, 0xcc, 0xfe, 0xfd, 0xdd, 0xfe, 0xfe, 0xee, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte ntscPalette[768] = {
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x30, 0x30, 0x30, // 0 (0x00)
+ 0x40, 0x40, 0x40, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, // 4 (0x04)
+ 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, 0xb0, // 8 (0x08)
+ 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, // 12 (0x0c)
+ 0xe0, 0xe3, 0xef, 0xd1, 0xd7, 0xee, 0xc2, 0xca, 0xed, 0xb3, 0xbe, 0xec, // 16 (0x10)
+ 0xa4, 0xb2, 0xec, 0x95, 0xa5, 0xeb, 0x86, 0x99, 0xea, 0x77, 0x8c, 0xe9, // 20 (0x14)
+ 0x68, 0x80, 0xe9, 0x59, 0x74, 0xe8, 0x4a, 0x67, 0xe7, 0x3b, 0x5b, 0xe6, // 24 (0x18)
+ 0x2c, 0x4f, 0xe6, 0x1d, 0x42, 0xe5, 0x0f, 0x36, 0xe4, 0x00, 0x29, 0xe3, // 28 (0x1c)
+ 0x00, 0x27, 0xd9, 0x00, 0x25, 0xcc, 0x00, 0x23, 0xbf, 0x00, 0x20, 0xb2, // 32 (0x20)
+ 0x00, 0x1e, 0xa5, 0x00, 0x1c, 0x98, 0x00, 0x19, 0x8b, 0x00, 0x17, 0x7e, // 36 (0x24)
+ 0x00, 0x14, 0x71, 0x00, 0x12, 0x64, 0x00, 0x10, 0x57, 0x00, 0x0d, 0x4a, // 40 (0x28)
+ 0x00, 0x0b, 0x3d, 0x00, 0x08, 0x30, 0x00, 0x06, 0x23, 0x00, 0x04, 0x16, // 44 (0x2c)
+ 0x06, 0x00, 0x0c, 0x0e, 0x01, 0x1a, 0x15, 0x02, 0x27, 0x1c, 0x03, 0x35, // 48 (0x30)
+ 0x24, 0x04, 0x42, 0x2b, 0x05, 0x50, 0x32, 0x06, 0x5d, 0x3a, 0x07, 0x6b, // 52 (0x34)
+ 0x41, 0x08, 0x78, 0x49, 0x09, 0x86, 0x50, 0x0a, 0x93, 0x57, 0x0b, 0xa1, // 56 (0x38)
+ 0x5f, 0x0c, 0xae, 0x66, 0x0d, 0xbc, 0x6d, 0x0e, 0xc9, 0x75, 0x0f, 0xd7, // 60 (0x3c)
+ 0x78, 0x19, 0xd7, 0x7d, 0x23, 0xd8, 0x83, 0x2d, 0xda, 0x88, 0x36, 0xdc, // 64 (0x40)
+ 0x8d, 0x40, 0xdd, 0x93, 0x4a, 0xdf, 0x98, 0x53, 0xe1, 0x9e, 0x5d, 0xe3, // 68 (0x44)
+ 0xa3, 0x67, 0xe4, 0xa8, 0x70, 0xe6, 0xae, 0x7a, 0xe8, 0xb3, 0x84, 0xe9, // 72 (0x48)
+ 0xb9, 0x8d, 0xeb, 0xbe, 0x97, 0xed, 0xc3, 0xa1, 0xef, 0xc9, 0xaa, 0xf0, // 76 (0x4c)
+ 0xe7, 0xad, 0xc3, 0xe3, 0xa1, 0xb8, 0xdf, 0x95, 0xad, 0xdb, 0x8a, 0xa2, // 80 (0x50)
+ 0xd7, 0x7e, 0x97, 0xd4, 0x73, 0x8c, 0xd0, 0x67, 0x81, 0xcc, 0x5c, 0x76, // 84 (0x54)
+ 0xc8, 0x50, 0x6b, 0xc4, 0x45, 0x60, 0xc1, 0x39, 0x55, 0xbd, 0x2e, 0x4a, // 88 (0x58)
+ 0xb9, 0x22, 0x3f, 0xb5, 0x17, 0x35, 0xb1, 0x0b, 0x2a, 0xa2, 0x16, 0x2f, // 92 (0x5c)
+ 0xa2, 0x16, 0x2f, 0x96, 0x14, 0x2b, 0x8b, 0x13, 0x28, 0x7f, 0x11, 0x25, // 96 (0x60)
+ 0x73, 0x0f, 0x21, 0x68, 0x0e, 0x1e, 0x5c, 0x0c, 0x1a, 0x51, 0x0b, 0x17, // 100 (0x64)
+ 0x45, 0x09, 0x14, 0x39, 0x07, 0x10, 0x2e, 0x06, 0x0d, 0x22, 0x04, 0x0a, // 104 (0x68)
+ 0x17, 0x03, 0x06, 0x17, 0x00, 0x04, 0x0b, 0x00, 0x02, 0x00, 0x00, 0x00, // 108 (0x6c)
+ 0x00, 0x00, 0x00, 0x0e, 0x05, 0x01, 0x1d, 0x09, 0x03, 0x2b, 0x0e, 0x05, // 112 (0x70)
+ 0x3a, 0x13, 0x07, 0x48, 0x18, 0x09, 0x57, 0x1d, 0x0b, 0x65, 0x22, 0x0c, // 116 (0x74)
+ 0x74, 0x27, 0x0e, 0x82, 0x2c, 0x10, 0x91, 0x31, 0x12, 0x9f, 0x36, 0x14, // 120 (0x78)
+ 0xae, 0x3b, 0x16, 0xbc, 0x40, 0x17, 0xcb, 0x45, 0x19, 0xd9, 0x4a, 0x1b, // 124 (0x7c)
+ 0xd9, 0x4e, 0x20, 0xd9, 0x54, 0x29, 0xd9, 0x5b, 0x31, 0xd9, 0x61, 0x3a, // 128 (0x80)
+ 0xd9, 0x68, 0x42, 0xd9, 0x6e, 0x4b, 0xd9, 0x75, 0x53, 0xd9, 0x7b, 0x5c, // 132 (0x84)
+ 0xd9, 0x82, 0x65, 0xd9, 0x88, 0x6d, 0xd9, 0x8f, 0x76, 0xd9, 0x95, 0x7e, // 136 (0x88)
+ 0xd9, 0x9c, 0x87, 0xd9, 0xa2, 0x8f, 0xd9, 0xa9, 0x98, 0xd9, 0xaf, 0xa1, // 140 (0x8c)
+ 0xf5, 0xee, 0x90, 0xf2, 0xeb, 0x87, 0xef, 0xe8, 0x7f, 0xeb, 0xe5, 0x76, // 144 (0x90)
+ 0xe8, 0xe2, 0x6d, 0xe5, 0xdf, 0x64, 0xe2, 0xdc, 0x5b, 0xdf, 0xd9, 0x52, // 148 (0x94)
+ 0xdb, 0xd6, 0x4a, 0xd8, 0xd3, 0x41, 0xd5, 0xd0, 0x38, 0xd2, 0xcd, 0x2f, // 152 (0x98)
+ 0xcf, 0xca, 0x26, 0xcb, 0xc7, 0x1d, 0xc8, 0xc4, 0x15, 0xc5, 0xc0, 0x0c, // 156 (0x9c)
+ 0xbf, 0xbb, 0x0b, 0xb3, 0xaf, 0x0b, 0xa7, 0xa3, 0x0a, 0x9b, 0x97, 0x09, // 160 (0xa0)
+ 0x8f, 0x8b, 0x08, 0x83, 0x80, 0x08, 0x77, 0x74, 0x07, 0x6a, 0x68, 0x06, // 164 (0xa4)
+ 0x5e, 0x5c, 0x05, 0x52, 0x50, 0x05, 0x46, 0x44, 0x04, 0x3a, 0x39, 0x03, // 168 (0xa8)
+ 0x2e, 0x2d, 0x02, 0x22, 0x21, 0x02, 0x16, 0x15, 0x01, 0x0a, 0x09, 0x00, // 172 (0xac)
+ 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x28, 0x00, // 176 (0xb0)
+ 0x00, 0x35, 0x00, 0x00, 0x42, 0x00, 0x00, 0x50, 0x00, 0x00, 0x5d, 0x00, // 180 (0xb4)
+ 0x00, 0x6b, 0x00, 0x00, 0x78, 0x00, 0x00, 0x85, 0x01, 0x00, 0x93, 0x01, // 184 (0xb8)
+ 0x00, 0xa0, 0x01, 0x00, 0xae, 0x01, 0x00, 0xbb, 0x01, 0x01, 0xc8, 0x01, // 188 (0xbc)
+ 0x01, 0xda, 0x01, 0x0c, 0xdc, 0x0e, 0x18, 0xdd, 0x1a, 0x24, 0xdf, 0x26, // 192 (0xc0)
+ 0x30, 0xe0, 0x32, 0x3b, 0xe2, 0x3f, 0x47, 0xe4, 0x4b, 0x53, 0xe5, 0x57, // 196 (0xc4)
+ 0x5f, 0xe7, 0x63, 0x6b, 0xe8, 0x70, 0x76, 0xea, 0x7c, 0x82, 0xec, 0x88, // 200 (0xc8)
+ 0x8e, 0xed, 0x94, 0x9a, 0xef, 0xa1, 0xa5, 0xf0, 0xad, 0xb1, 0xf2, 0xb9, // 204 (0xcc)
+ 0xb3, 0xd1, 0xd5, 0xa9, 0xd0, 0xd5, 0x9f, 0xcf, 0xd5, 0x95, 0xce, 0xd5, // 208 (0xd0)
+ 0x8b, 0xcd, 0xd5, 0x81, 0xcc, 0xd5, 0x77, 0xcb, 0xd5, 0x6d, 0xca, 0xd5, // 212 (0xd4)
+ 0x63, 0xc9, 0xd5, 0x59, 0xc8, 0xd5, 0x4f, 0xc7, 0xd5, 0x45, 0xc6, 0xd5, // 216 (0xd8)
+ 0x3b, 0xc5, 0xd5, 0x30, 0xc4, 0xd5, 0x26, 0xc3, 0xd5, 0x1c, 0xc2, 0xd5, // 220 (0xdc)
+ 0x30, 0x4b, 0xc2, 0x29, 0x52, 0xa3, 0x21, 0x58, 0x84, 0x19, 0x5b, 0x65, // 224 (0xe0)
+ 0x1b, 0x6c, 0x55, 0x21, 0x83, 0x49, 0x27, 0x9a, 0x3c, 0x2d, 0xb1, 0x2d, // 228 (0xe4)
+ 0x46, 0xb7, 0x2f, 0x60, 0xbd, 0x31, 0x79, 0xc3, 0x33, 0x93, 0xc8, 0x35, // 232 (0xe8)
+ 0xac, 0xce, 0x37, 0xc6, 0xd4, 0x38, 0xe3, 0xdd, 0x3c, 0xdc, 0xc9, 0x3b, // 236 (0xec)
+ 0xd5, 0xb5, 0x3a, 0xcf, 0xa1, 0x39, 0xc8, 0x8d, 0x37, 0xc1, 0x7a, 0x36, // 240 (0xf0)
+ 0xba, 0x66, 0x35, 0xb4, 0x53, 0x33, 0xb0, 0x4f, 0x37, 0xac, 0x4b, 0x3a, // 244 (0xf4)
+ 0xa9, 0x47, 0x3e, 0xa5, 0x43, 0x41, 0xa1, 0x3d, 0x42, 0x9a, 0x30, 0x44, // 248 (0xf8)
+ 0x7b, 0x28, 0x52, 0x5d, 0x21, 0x5f, 0x59, 0x2b, 0x85, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte metallicPalette[768] = {
+ 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x33, 0x33, 0x33, // 0 (0x00)
+ 0x44, 0x44, 0x44, 0x55, 0x55, 0x55, 0x66, 0x66, 0x66, 0x77, 0x77, 0x77, // 4 (0x04)
+ 0x88, 0x88, 0x88, 0x99, 0x99, 0x99, 0xaa, 0xaa, 0xaa, 0xbb, 0xbb, 0xbb, // 8 (0x08)
+ 0xcc, 0xcc, 0xcc, 0xdd, 0xdd, 0xdd, 0xee, 0xee, 0xee, 0xff, 0xff, 0xff, // 12 (0x0c)
+ 0xf1, 0xf1, 0xf1, 0xe2, 0xe2, 0xe2, 0xd3, 0xd3, 0xd3, 0xc4, 0xc4, 0xc4, // 16 (0x10)
+ 0xb5, 0xb5, 0xb5, 0xa6, 0xa6, 0xa6, 0x97, 0x97, 0x97, 0x88, 0x88, 0x88, // 20 (0x14)
+ 0x79, 0x79, 0x79, 0x6a, 0x6a, 0x6a, 0x5c, 0x5c, 0x5c, 0x4d, 0x4d, 0x4d, // 24 (0x18)
+ 0x3e, 0x3e, 0x3e, 0x2f, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x11, 0x11, 0x11, // 28 (0x1c)
+ 0x00, 0x0f, 0x55, 0x0e, 0x1e, 0x61, 0x1d, 0x2c, 0x6c, 0x2c, 0x3a, 0x77, // 32 (0x20)
+ 0x3b, 0x48, 0x83, 0x4a, 0x56, 0x8e, 0x58, 0x65, 0x99, 0x67, 0x73, 0xa5, // 36 (0x24)
+ 0x76, 0x81, 0xb0, 0x85, 0x8f, 0xbb, 0x94, 0x9d, 0xc7, 0xa3, 0xac, 0xd2, // 40 (0x28)
+ 0xb1, 0xba, 0xdd, 0xc0, 0xc8, 0xe9, 0xcf, 0xd6, 0xf4, 0xde, 0xe5, 0xff, // 44 (0x2c)
+ 0xd0, 0xd7, 0xf5, 0xc2, 0xca, 0xea, 0xb4, 0xbd, 0xe0, 0xa6, 0xaf, 0xd5, // 48 (0x30)
+ 0x98, 0xa2, 0xca, 0x8a, 0x95, 0xc0, 0x7d, 0x87, 0xb5, 0x6f, 0x7a, 0xaa, // 52 (0x34)
+ 0x61, 0x6d, 0xa0, 0x53, 0x5f, 0x95, 0x45, 0x52, 0x8a, 0x37, 0x45, 0x80, // 56 (0x38)
+ 0x29, 0x37, 0x75, 0x1b, 0x2a, 0x6a, 0x0d, 0x1d, 0x60, 0x00, 0x0f, 0x55, // 60 (0x3c)
+ 0x03, 0x30, 0x03, 0x0f, 0x3e, 0x10, 0x1c, 0x4c, 0x1c, 0x28, 0x5a, 0x28, // 64 (0x40)
+ 0x34, 0x67, 0x35, 0x41, 0x75, 0x41, 0x4d, 0x83, 0x4d, 0x5a, 0x91, 0x5a, // 68 (0x44)
+ 0x66, 0x9f, 0x66, 0x72, 0xad, 0x72, 0x7f, 0xba, 0x7f, 0x8b, 0xc8, 0x8b, // 72 (0x48)
+ 0x97, 0xd6, 0x97, 0xa4, 0xe4, 0xa4, 0xb0, 0xf2, 0xb0, 0xbc, 0xff, 0xbc, // 76 (0x4c)
+ 0xb1, 0xf2, 0xb1, 0xa5, 0xe6, 0xa5, 0x9a, 0xd9, 0x9a, 0x8e, 0xcc, 0x8e, // 80 (0x50)
+ 0x82, 0xbf, 0x83, 0x77, 0xb2, 0x77, 0x6b, 0xa5, 0x6b, 0x60, 0x98, 0x60, // 84 (0x54)
+ 0x54, 0x8b, 0x54, 0x49, 0x7e, 0x49, 0x3d, 0x71, 0x3d, 0x31, 0x64, 0x31, // 88 (0x58)
+ 0x26, 0x57, 0x26, 0x1a, 0x4a, 0x1a, 0x0f, 0x3d, 0x0f, 0x03, 0x30, 0x03, // 92 (0x5c)
+ 0x76, 0x55, 0x12, 0x80, 0x5d, 0x1c, 0x8a, 0x66, 0x26, 0x93, 0x6e, 0x2f, // 96 (0x60)
+ 0x9d, 0x77, 0x39, 0xa7, 0x7f, 0x43, 0xb1, 0x88, 0x4c, 0xbb, 0x91, 0x56, // 100 (0x64)
+ 0xc5, 0x99, 0x5f, 0xce, 0xa2, 0x69, 0xd8, 0xaa, 0x73, 0xe2, 0xb3, 0x7c, // 104 (0x68)
+ 0xec, 0xbb, 0x86, 0xf6, 0xc4, 0x8f, 0xff, 0xd8, 0xb1, 0xff, 0xe1, 0xc2, // 108 (0x6c)
+ 0xff, 0xd5, 0xab, 0xff, 0xcc, 0x99, 0xf6, 0xc4, 0x8f, 0xec, 0xbb, 0x86, // 112 (0x70)
+ 0xe2, 0xb3, 0x7c, 0xd8, 0xaa, 0x73, 0xce, 0xa2, 0x69, 0xc5, 0x99, 0x5f, // 116 (0x74)
+ 0xbb, 0x91, 0x56, 0xb1, 0x88, 0x4c, 0xa7, 0x7f, 0x43, 0x9d, 0x77, 0x39, // 120 (0x78)
+ 0x93, 0x6e, 0x2f, 0x8a, 0x66, 0x26, 0x80, 0x5d, 0x1c, 0x76, 0x55, 0x12, // 124 (0x7c)
+ 0x44, 0x26, 0x19, 0x4f, 0x31, 0x23, 0x5b, 0x3c, 0x2d, 0x66, 0x48, 0x37, // 128 (0x80)
+ 0x71, 0x53, 0x41, 0x7d, 0x5e, 0x4b, 0x88, 0x69, 0x55, 0x93, 0x74, 0x5f, // 132 (0x84)
+ 0x9f, 0x80, 0x69, 0xaa, 0x8b, 0x73, 0xb5, 0x96, 0x7d, 0xc1, 0xa1, 0x87, // 136 (0x88)
+ 0xcc, 0xac, 0x91, 0xd7, 0xb8, 0x9b, 0xe3, 0xc3, 0xa5, 0xee, 0xd1, 0xb4, // 140 (0x8c)
+ 0xe3, 0xc6, 0xaa, 0xd9, 0xbb, 0xa1, 0xce, 0xb1, 0x97, 0xc3, 0xa6, 0x8d, // 144 (0x90)
+ 0xb9, 0x9b, 0x83, 0xae, 0x91, 0x7a, 0xa4, 0x86, 0x70, 0x99, 0x7b, 0x66, // 148 (0x94)
+ 0x8e, 0x71, 0x5d, 0x84, 0x66, 0x53, 0x79, 0x5b, 0x49, 0x6f, 0x51, 0x40, // 152 (0x98)
+ 0x64, 0x46, 0x36, 0x59, 0x3b, 0x2c, 0x4f, 0x31, 0x22, 0x44, 0x26, 0x19, // 156 (0x9c)
+ 0x51, 0x20, 0x1f, 0x5d, 0x2c, 0x2c, 0x68, 0x38, 0x38, 0x74, 0x44, 0x45, // 160 (0xa0)
+ 0x7f, 0x50, 0x51, 0x8b, 0x5c, 0x5d, 0x97, 0x67, 0x6a, 0xa2, 0x73, 0x76, // 164 (0xa4)
+ 0xae, 0x7f, 0x83, 0xba, 0x8b, 0x8f, 0xc5, 0x97, 0x9b, 0xd1, 0xa3, 0xa8, // 168 (0xa8)
+ 0xdd, 0xaf, 0xb4, 0xe8, 0xbb, 0xc1, 0xf4, 0xc6, 0xcd, 0xff, 0xd2, 0xda, // 172 (0xac)
+ 0xf5, 0xc7, 0xce, 0xea, 0xbc, 0xc2, 0xdf, 0xb1, 0xb7, 0xd4, 0xa6, 0xab, // 176 (0xb0)
+ 0xc9, 0x9b, 0x9f, 0xbe, 0x90, 0x94, 0xb3, 0x84, 0x88, 0xa8, 0x79, 0x7c, // 180 (0xb4)
+ 0x9d, 0x6e, 0x71, 0x92, 0x63, 0x65, 0x87, 0x58, 0x59, 0x7d, 0x4d, 0x4e, // 184 (0xb8)
+ 0x72, 0x42, 0x42, 0x67, 0x37, 0x37, 0x5c, 0x2b, 0x2b, 0x51, 0x20, 0x1f, // 188 (0xbc)
+ 0x44, 0x2a, 0x5c, 0x4e, 0x36, 0x67, 0x59, 0x41, 0x71, 0x64, 0x4c, 0x7b, // 192 (0xc0)
+ 0x6f, 0x58, 0x85, 0x79, 0x63, 0x8f, 0x84, 0x6e, 0x99, 0x8f, 0x7a, 0xa3, // 196 (0xc4)
+ 0x99, 0x85, 0xad, 0xa4, 0x90, 0xb7, 0xaf, 0x9c, 0xc1, 0xb9, 0xa7, 0xcb, // 200 (0xc8)
+ 0xc4, 0xb2, 0xd6, 0xcf, 0xbe, 0xe0, 0xda, 0xc9, 0xea, 0xe4, 0xd4, 0xf4, // 204 (0xcc)
+ 0xda, 0xca, 0xea, 0xd0, 0xbf, 0xe1, 0xc6, 0xb4, 0xd7, 0xbc, 0xaa, 0xce, // 208 (0xd0)
+ 0xb2, 0x9f, 0xc4, 0xa8, 0x94, 0xbb, 0x9e, 0x8a, 0xb2, 0x94, 0x7f, 0xa8, // 212 (0xd4)
+ 0x8a, 0x75, 0x9f, 0x80, 0x6a, 0x95, 0x76, 0x5f, 0x8c, 0x6c, 0x55, 0x82, // 216 (0xd8)
+ 0x62, 0x4a, 0x79, 0x58, 0x3f, 0x6f, 0x4e, 0x35, 0x66, 0x44, 0x2a, 0x5c, // 220 (0xdc)
+ 0x63, 0x73, 0xbc, 0x58, 0x6d, 0xa5, 0x4e, 0x67, 0x8e, 0x43, 0x61, 0x76, // 224 (0xe0)
+ 0x38, 0x5a, 0x5f, 0x4a, 0x7d, 0x5f, 0x58, 0x94, 0x63, 0x66, 0xab, 0x66, // 228 (0xe4)
+ 0x76, 0xb1, 0x69, 0x85, 0xb7, 0x6d, 0x96, 0xbd, 0x70, 0xa6, 0xc3, 0x74, // 232 (0xe8)
+ 0xb6, 0xc8, 0x77, 0xc7, 0xce, 0x7b, 0xdd, 0xda, 0x83, 0xd0, 0xbe, 0x7b, // 236 (0xec)
+ 0xc9, 0xb0, 0x77, 0xc2, 0xa2, 0x73, 0xbb, 0x94, 0x6f, 0xb4, 0x86, 0x6b, // 240 (0xf0)
+ 0xae, 0x79, 0x67, 0xaa, 0x73, 0x65, 0xa6, 0x6f, 0x66, 0xa3, 0x6d, 0x68, // 244 (0xf4)
+ 0x9f, 0x6c, 0x6a, 0x9b, 0x66, 0x69, 0x94, 0x58, 0x63, 0x75, 0x47, 0x5e, // 248 (0xf8)
+ 0x58, 0x37, 0x59, 0x5f, 0x42, 0x6c, 0x66, 0x4c, 0x80, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+static byte winPalette[768] = {
+ 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xbf, 0x00, 0xbf, 0xbf, 0x00, // 0 (0x00)
+ 0x00, 0x00, 0xbf, 0xbf, 0x00, 0xbf, 0x00, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0, // 4 (0x04)
+ 0xc0, 0xdc, 0xc0, 0xa4, 0xc8, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0x99, // 8 (0x08)
+ 0x99, 0xd4, 0x99, 0x99, 0xd4, 0xff, 0xff, 0xcc, 0xff, 0xff, 0x99, 0x99, // 12 (0x0c)
+ 0x22, 0x22, 0x30, 0x00, 0x00, 0x11, 0x00, 0x00, 0x22, 0x00, 0x00, 0x44, // 16 (0x10)
+ 0x00, 0x00, 0x55, 0x00, 0x00, 0x77, 0x00, 0x00, 0x88, 0x00, 0x00, 0xaa, // 20 (0x14)
+ 0x00, 0x00, 0xdd, 0x00, 0x00, 0xee, 0x00, 0x11, 0x00, 0x00, 0x22, 0x00, // 24 (0x18)
+ 0x00, 0x44, 0x00, 0x00, 0x55, 0x00, 0x00, 0x77, 0x00, 0x00, 0x88, 0x00, // 28 (0x1c)
+ 0x00, 0xaa, 0x00, 0x00, 0xdd, 0x00, 0x00, 0xee, 0x00, 0x11, 0x00, 0x00, // 32 (0x20)
+ 0x22, 0x00, 0x00, 0x44, 0x00, 0x00, 0x55, 0x00, 0x00, 0x77, 0x00, 0x00, // 36 (0x24)
+ 0x90, 0x00, 0x00, 0xaa, 0x00, 0x00, 0xdd, 0x00, 0x00, 0xee, 0x00, 0x00, // 40 (0x28)
+ 0x00, 0x00, 0x33, 0x00, 0x00, 0x66, 0x00, 0x00, 0x99, 0x00, 0x00, 0xcc, // 44 (0x2c)
+ 0x00, 0x33, 0x00, 0x00, 0x33, 0x33, 0x00, 0x33, 0x66, 0x00, 0x33, 0xa1, // 48 (0x30)
+ 0x00, 0x33, 0xcc, 0x00, 0x33, 0xff, 0x00, 0x66, 0x00, 0x00, 0x66, 0x33, // 52 (0x34)
+ 0x00, 0x66, 0x66, 0x00, 0x66, 0x99, 0x00, 0x66, 0xcc, 0x00, 0x66, 0xff, // 56 (0x38)
+ 0x00, 0x99, 0x00, 0x00, 0x99, 0x33, 0x00, 0x99, 0x66, 0x00, 0x99, 0x99, // 60 (0x3c)
+ 0x00, 0x99, 0xcc, 0x00, 0x99, 0xff, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0x33, // 64 (0x40)
+ 0x00, 0xcc, 0x66, 0x00, 0xcc, 0x99, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xff, // 68 (0x44)
+ 0x00, 0xff, 0x33, 0x00, 0xff, 0x66, 0x00, 0xff, 0x99, 0x00, 0xff, 0xcc, // 72 (0x48)
+ 0x33, 0x00, 0x00, 0x33, 0x00, 0x33, 0x33, 0x00, 0x66, 0x33, 0x00, 0x99, // 76 (0x4c)
+ 0x33, 0x00, 0xcc, 0x33, 0x00, 0xff, 0x33, 0x33, 0x00, 0x33, 0x33, 0x3b, // 80 (0x50)
+ 0x33, 0x33, 0x66, 0x33, 0x33, 0x99, 0x33, 0x33, 0xcc, 0x33, 0x33, 0xff, // 84 (0x54)
+ 0x33, 0x66, 0x00, 0x33, 0x6e, 0x33, 0x33, 0x66, 0x66, 0x33, 0x66, 0x99, // 88 (0x58)
+ 0x33, 0x66, 0xcc, 0x33, 0x66, 0xff, 0x33, 0x99, 0x00, 0x33, 0x99, 0x33, // 92 (0x5c)
+ 0x33, 0x99, 0x66, 0x33, 0x99, 0x99, 0x33, 0x99, 0xcc, 0x33, 0x99, 0xff, // 96 (0x60)
+ 0x33, 0xcc, 0x00, 0x33, 0xcc, 0x33, 0x33, 0xcc, 0x66, 0x33, 0xcc, 0x99, // 100 (0x64)
+ 0x33, 0xcc, 0xcc, 0x33, 0xcc, 0xff, 0x33, 0xff, 0x00, 0x33, 0xff, 0x33, // 104 (0x68)
+ 0x33, 0xff, 0x66, 0x33, 0xff, 0x99, 0x33, 0xff, 0xcc, 0x33, 0xff, 0xff, // 108 (0x6c)
+ 0x66, 0x00, 0x00, 0x66, 0x00, 0x33, 0x66, 0x00, 0x66, 0x66, 0x00, 0x99, // 112 (0x70)
+ 0x66, 0x00, 0xcc, 0x66, 0x00, 0xff, 0x66, 0x33, 0x00, 0x66, 0x33, 0x33, // 116 (0x74)
+ 0x66, 0x33, 0x66, 0x66, 0x33, 0x99, 0x66, 0x33, 0xcc, 0x66, 0x33, 0xff, // 120 (0x78)
+ 0x66, 0x66, 0x00, 0x66, 0x66, 0x33, 0x66, 0x66, 0x66, 0x66, 0x66, 0x99, // 124 (0x7c)
+ 0x66, 0x66, 0xcc, 0x66, 0x66, 0xff, 0x66, 0x99, 0x00, 0x66, 0x99, 0x33, // 128 (0x80)
+ 0x66, 0x99, 0x66, 0x66, 0x99, 0x99, 0x66, 0x99, 0xcc, 0x66, 0x99, 0xff, // 132 (0x84)
+ 0x66, 0xcc, 0x00, 0x66, 0xcc, 0x33, 0x66, 0xcc, 0x66, 0x66, 0xcc, 0x99, // 136 (0x88)
+ 0x66, 0xcc, 0xcc, 0x66, 0xcc, 0xff, 0x66, 0xff, 0x00, 0x66, 0xff, 0x33, // 140 (0x8c)
+ 0x66, 0xff, 0x66, 0x66, 0xff, 0x99, 0x66, 0xff, 0xcc, 0x66, 0xff, 0xff, // 144 (0x90)
+ 0x99, 0x00, 0x00, 0x99, 0x00, 0x33, 0x99, 0x00, 0x66, 0x99, 0x00, 0x99, // 148 (0x94)
+ 0x99, 0x00, 0xcc, 0x99, 0x00, 0xff, 0x99, 0x33, 0x00, 0x99, 0x33, 0x33, // 152 (0x98)
+ 0x99, 0x33, 0x66, 0x99, 0x33, 0x99, 0x99, 0x33, 0xcc, 0x99, 0x33, 0xff, // 156 (0x9c)
+ 0xa1, 0x66, 0x00, 0x99, 0x66, 0x33, 0x99, 0x66, 0x66, 0x99, 0x66, 0x99, // 160 (0xa0)
+ 0x99, 0x66, 0xcc, 0x99, 0x66, 0xff, 0x99, 0x99, 0x00, 0x99, 0x99, 0x33, // 164 (0xa4)
+ 0x99, 0x99, 0x66, 0x99, 0x99, 0x99, 0x99, 0x99, 0xcc, 0x99, 0x99, 0xff, // 168 (0xa8)
+ 0x99, 0xcc, 0x00, 0x99, 0xcc, 0x33, 0x99, 0xcc, 0x66, 0x99, 0xcc, 0x99, // 172 (0xac)
+ 0x99, 0xcc, 0xcc, 0x99, 0xcc, 0xff, 0x99, 0xff, 0x00, 0x99, 0xff, 0x33, // 176 (0xb0)
+ 0x99, 0xff, 0x66, 0x99, 0xff, 0x99, 0x99, 0xff, 0xcc, 0x99, 0xff, 0xff, // 180 (0xb4)
+ 0xcc, 0x00, 0x00, 0xcc, 0x00, 0x33, 0xcc, 0x00, 0x66, 0xcc, 0x00, 0x99, // 184 (0xb8)
+ 0xcc, 0x00, 0xcc, 0xd4, 0x08, 0xff, 0xcc, 0x33, 0x00, 0xcc, 0x33, 0x33, // 188 (0xbc)
+ 0xcc, 0x33, 0x66, 0xcc, 0x33, 0x99, 0xcc, 0x33, 0xcc, 0xcc, 0x33, 0xff, // 192 (0xc0)
+ 0xcc, 0x66, 0x00, 0xcc, 0x66, 0x33, 0xcc, 0x66, 0x66, 0xcc, 0x66, 0x99, // 196 (0xc4)
+ 0xcc, 0x66, 0xcc, 0xcc, 0x66, 0xff, 0xcc, 0x99, 0x00, 0xcc, 0x99, 0x33, // 200 (0xc8)
+ 0xcc, 0x99, 0x66, 0xcc, 0x99, 0x99, 0xcc, 0x99, 0xcc, 0xcc, 0x99, 0xff, // 204 (0xcc)
+ 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x33, 0xcc, 0xcc, 0x66, 0xcc, 0xcc, 0x99, // 208 (0xd0)
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xff, 0x00, 0xcc, 0xff, 0x33, // 212 (0xd4)
+ 0xcc, 0xff, 0x66, 0xcc, 0xff, 0x99, 0xcc, 0xff, 0xcc, 0xcc, 0xff, 0xff, // 216 (0xd8)
+ 0xff, 0x00, 0x33, 0xff, 0x00, 0x66, 0xff, 0x00, 0x99, 0xff, 0x00, 0xcc, // 220 (0xdc)
+ 0xff, 0x33, 0x00, 0xff, 0x33, 0x33, 0xff, 0x33, 0x66, 0xff, 0x33, 0x99, // 224 (0xe0)
+ 0xff, 0x33, 0xcc, 0xff, 0x33, 0xff, 0xff, 0x66, 0x00, 0xff, 0x66, 0x33, // 228 (0xe4)
+ 0xff, 0x66, 0x66, 0xff, 0x66, 0x99, 0xff, 0x66, 0xcc, 0xff, 0x66, 0xff, // 232 (0xe8)
+ 0xff, 0x99, 0x00, 0xdd, 0xdd, 0xdd, 0xff, 0x99, 0xcc, 0xff, 0xcc, 0x66, // 236 (0xec)
+ 0x88, 0x00, 0x00, 0xcc, 0x00, 0xff, 0x00, 0x33, 0x99, 0x33, 0x66, 0x33, // 240 (0xf0)
+ 0x99, 0x66, 0x00, 0x33, 0x33, 0x33, 0xff, 0xfb, 0xf0, 0xa0, 0xa0, 0xa4, // 244 (0xf4)
+ 0x80, 0x80, 0x80, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, // 248 (0xf8)
+ 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff // 252 (0xfc)
+};
+
+
+static PaletteV4 director4Palettes[] = {
+ {-1, macPalette, 256},
+ {-2, rainbowPalette, 256},
+ {-3, grayscalePalette, 256},
+ {-4, pastelsPalette, 256},
+ {-5, vividPalette, 256},
+ {-6, ntscPalette, 256},
+ {-7, metallicPalette, 256},
+ {-101, winPalette, 256},
+ {0, nullptr, 0}
+};
+
static byte director3Patterns[][8] = {
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
@@ -231,7 +712,23 @@ Graphics::MacPatterns &DirectorEngine::getPatterns() {
return _director3QuickDrawPatterns;
}
+void DirectorEngine::loadPalettes() {
+ for (PaletteV4 *pal = director4Palettes; pal->id != 0; pal++) {
+ _director4Palettes[pal->id] = pal;
+ }
+}
+
+void DirectorEngine::setPalette(int id) {
+ if (!_director4Palettes.contains(id)) {
+ warning("setPalette(): no palette with matching id %d", id);
+ return;
+ }
+ PaletteV4 *pal = _director4Palettes[id];
+ setPalette(pal->palette, pal->length);
+}
+
void DirectorEngine::setPalette(byte *palette, uint16 count) {
+ _system->getPaletteManager()->setPalette(palette, 0, count);
_currentPalette = palette;
_currentPaletteLength = count;
@@ -245,7 +742,7 @@ void DirectorEngine::testFontScaling() {
int h = 480;
initGraphics(w, h);
- _system->getPaletteManager()->setPalette(defaultPalette, 0, 256);
+ _system->getPaletteManager()->setPalette(macPalette, 0, 256);
Graphics::ManagedSurface surface;
@@ -311,7 +808,7 @@ void DirectorEngine::testFonts() {
Common::MacResManager *fontFile = new Common::MacResManager();
if (!fontFile->open(fontName))
- error("Could not open %s as a resource fork", fontName.c_str());
+ error("testFonts(): Could not open %s as a resource fork", fontName.c_str());
Common::MacResIDArray fonds = fontFile->getResIDArray(MKTAG('F','O','N','D'));
if (fonds.size() > 0) {
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 10d73accc1..bff1a6a7fc 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -149,6 +149,7 @@ BITDDecoder::~BITDDecoder() {
}
void BITDDecoder::destroy() {
+ delete _surface;
_surface = 0;
delete[] _palette;
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 861dc0a2d3..e02ac63e6f 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -146,7 +146,7 @@ static struct BuiltinProto {
// Misc
{ "alert", LB::b_alert, 1, 1, false, 2, BLTIN }, // D2 c
{ "birth", LB::b_birth, -1,0, false, 4, FBLTIN }, // D4 f
- { "clearGlobals", LB::b_clearGlobals, 0, 0, false, 4, BLTIN }, // D4 c
+ { "clearGlobals", LB::b_clearGlobals, 0, 0, false, 3, BLTIN }, // D3.1 c
{ "cursor", LB::b_cursor, 1, 1, false, 2, BLTIN }, // D2 c
{ "framesToHMS", LB::b_framesToHMS, 4, 4, false, 3, FBLTIN }, // D3 f
{ "HMStoFrames", LB::b_HMStoFrames, 4, 4, false, 3, FBLTIN }, // D3 f
@@ -161,7 +161,7 @@ static struct BuiltinProto {
{ "constrainV", LB::b_constrainV, 2, 2, true, 2, FBLTIN }, // D2 f
{ "copyToClipBoard",LB::b_copyToClipBoard,1,1, false, 4, BLTIN }, // D4 c
{ "duplicate", LB::b_duplicate, 1, 2, false, 4, BLTIN }, // D4 c
- { "editableText", LB::b_editableText, 0, 0, false, 2, BLTIN }, // D2
+ { "editableText", LB::b_editableText, 0, 0, false, 2, BLTIN }, // D2, FIXME: the field in D4+
{ "erase", LB::b_erase, 1, 1, false, 4, BLTIN }, // D4 c
{ "findEmpty", LB::b_findEmpty, 1, 1, true, 4, FBLTIN }, // D4 f
// go // D2
@@ -170,18 +170,18 @@ static struct BuiltinProto {
{ "label", LB::b_label, 1, 1, true, 2, FBLTIN }, // D2 f
{ "marker", LB::b_marker, 1, 1, true, 2, FBLTIN }, // D2 f
{ "move", LB::b_move, 1, 2, false, 4, BLTIN }, // D4 c
- { "moveableSprite", LB::b_moveableSprite,0, 0, false, 2, BLTIN }, // D2
+ { "moveableSprite", LB::b_moveableSprite,0, 0, false, 2, BLTIN }, // D2, FIXME: the field in D4+
{ "pasteClipBoardInto",LB::b_pasteClipBoardInto,1,1,false,4,BLTIN },// D4 c
{ "puppetPalette", LB::b_puppetPalette, -1,0, false, 2, BLTIN }, // D2 c
{ "puppetSound", LB::b_puppetSound, -1,0, false, 2, BLTIN }, // D2 c
{ "puppetSprite", LB::b_puppetSprite, -1,0, false, 2, BLTIN }, // D2 c
{ "puppetTempo", LB::b_puppetTempo, 1, 1, false, 2, BLTIN }, // D2 c
{ "puppetTransition",LB::b_puppetTransition,-1,0,false,2, BLTIN }, // D2 c
- { "ramNeeded", LB::b_ramNeeded, 2, 2, true, 4, FBLTIN }, // D4 f
+ { "ramNeeded", LB::b_ramNeeded, 2, 2, true, 3, FBLTIN }, // D3.1 f
{ "rollOver", LB::b_rollOver, 1, 1, true, 2, FBLTIN }, // D2 f
{ "spriteBox", LB::b_spriteBox, -1,0, false, 2, BLTIN }, // D2 c
- { "unLoad", LB::b_unLoad, 0, 2, false, 4, BLTIN }, // D4 c
- { "unLoadCast", LB::b_unLoadCast, 0, 2, false, 4, BLTIN }, // D4 c
+ { "unLoad", LB::b_unLoad, 0, 2, false, 3, BLTIN }, // D3.1 c
+ { "unLoadCast", LB::b_unLoadCast, 0, 2, false, 3, BLTIN }, // D3.1 c
{ "updateStage", LB::b_updateStage, 0, 0, false, 2, BLTIN }, // D2 c
{ "zoomBox", LB::b_zoomBox, -1,0, false, 2, BLTIN }, // D2 c
// Point
@@ -193,7 +193,7 @@ static struct BuiltinProto {
{ "union", LB::b_union, 2, 2, true, 4, FBLTIN }, // D4 f
// Sound
{ "beep", LB::b_beep, 0, 1, false, 2, BLTIN }, // D2
- { "mci", LB::b_mci, 1, 1, false, 4, BLTIN }, // D4 c
+ { "mci", LB::b_mci, 1, 1, false, 3, BLTIN }, // D3.1 c
{ "mciwait", LB::b_mciwait, 1, 1, false, 4, BLTIN }, // D4 c
{ "sound-close", LB::b_soundClose, 1, 1, false, 4, BLTIN }, // D4 c
{ "sound-fadeIn", LB::b_soundFadeIn, 1, 2, false, 3, BLTIN }, // D3 c
@@ -495,6 +495,8 @@ void LB::b_hilite(int nargs) {
void LB::b_length(int nargs) {
Datum d = g_lingo->pop();
+ if (d.type == REFERENCE)
+ d.toString();
if (d.type != STRING)
error("Incorrect type for 'length' function: %s", d.type2str());
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index da5da4481d..5a71233c01 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -85,7 +85,7 @@ static LingoV4Bytecode lingoV4[] = {
};
static LingoV4TheEntity lingoV4TheEntity[] = {
- { 0x00, 0x00, kTheFloatPrecision, kTheNOField, false, kTEANOArgs },
+ { 0x00, 0x00, kTheFloatPrecision, kTheNOField, true, kTEANOArgs },
{ 0x00, 0x01, kTheMouseDownScript, kTheNOField, true, kTEANOArgs },
{ 0x00, 0x02, kTheMouseUpScript, kTheNOField, true, kTEANOArgs },
{ 0x00, 0x03, kTheKeyDownScript, kTheNOField, true, kTEANOArgs },
@@ -252,56 +252,52 @@ void LC::cb_v4theentitypush() {
int bank = g_lingo->readInt();
Datum firstArg = g_lingo->pop();
+ firstArg.toInt();
Datum result;
result.u.s = NULL;
result.type = VOID;
- if (firstArg.type == INT) {
- int key = (bank << 8) + firstArg.u.i;
- if (g_lingo->_lingoV4TheEntity.contains(key)) {
- debugC(3, kDebugLingoExec, "cb_v4theentitypush: mapping 0x%02x, 0x%02x", bank, firstArg.u.i);
- int entity = g_lingo->_lingoV4TheEntity[key]->entity;
- int field = g_lingo->_lingoV4TheEntity[key]->field;
- switch (g_lingo->_lingoV4TheEntity[key]->type) {
- case kTEANOArgs:
- {
- Datum id;
- id.u.s = NULL;
- id.type = VOID;
- debugC(3, kDebugLingoExec, "cb_v4theentitypush: calling getTheEntity(0x%02x, NULL, 0x%02x)", entity, field);
- result = g_lingo->getTheEntity(entity, id, field);
- }
- break;
- case kTEAItemId:
- {
- Datum id = g_lingo->pop();
- debugC(3, kDebugLingoExec, "cb_v4theentitypush: calling getTheEntity(0x%02x, id, 0x%02x)", entity, field);
- result = g_lingo->getTheEntity(entity, id, field);
- }
- break;
- case kTEAString:
- {
- /*Datum stringArg = */g_lingo->pop();
- warning("cb_v4theentitypush: STUB: kTEAString");
- }
- break;
- case kTEAMenuIdItemId:
- {
- /*Datum menuId = */g_lingo->pop();
- /*Datum itemId = */g_lingo->pop();
- warning("cb_v4theentitypush: STUB: kTEAMenuIdItemId");
- }
- break;
- default:
- warning("cb_v4theentitypush: unknown call type %d", g_lingo->_lingoV4TheEntity[key]->type);
- break;
+ int key = (bank << 8) + firstArg.u.i;
+ if (g_lingo->_lingoV4TheEntity.contains(key)) {
+ debugC(3, kDebugLingoExec, "cb_v4theentitypush: mapping 0x%02x, 0x%02x", bank, firstArg.u.i);
+ int entity = g_lingo->_lingoV4TheEntity[key]->entity;
+ int field = g_lingo->_lingoV4TheEntity[key]->field;
+ switch (g_lingo->_lingoV4TheEntity[key]->type) {
+ case kTEANOArgs:
+ {
+ Datum id;
+ id.u.s = NULL;
+ id.type = VOID;
+ debugC(3, kDebugLingoExec, "cb_v4theentitypush: calling getTheEntity(0x%02x, NULL, 0x%02x)", entity, field);
+ result = g_lingo->getTheEntity(entity, id, field);
}
- } else {
- warning("cb_v4theentitypush: unhandled mapping 0x%02x 0x%02x", bank, firstArg.u.i);
+ break;
+ case kTEAItemId:
+ {
+ Datum id = g_lingo->pop();
+ debugC(3, kDebugLingoExec, "cb_v4theentitypush: calling getTheEntity(0x%02x, id, 0x%02x)", entity, field);
+ result = g_lingo->getTheEntity(entity, id, field);
+ }
+ break;
+ case kTEAString:
+ {
+ /*Datum stringArg = */g_lingo->pop();
+ warning("cb_v4theentitypush: STUB: kTEAString");
+ }
+ break;
+ case kTEAMenuIdItemId:
+ {
+ /*Datum menuId = */g_lingo->pop();
+ /*Datum itemId = */g_lingo->pop();
+ warning("cb_v4theentitypush: STUB: kTEAMenuIdItemId");
+ }
+ break;
+ default:
+ warning("cb_v4theentitypush: unknown call type %d", g_lingo->_lingoV4TheEntity[key]->type);
+ break;
}
-
} else {
- warning("cb_v4theentitypush: first arg should be of type INT, not %s", firstArg.type2str());
+ warning("cb_v4theentitypush: unhandled mapping 0x%02x 0x%02x", bank, firstArg.u.i);
}
g_lingo->push(result);
@@ -342,61 +338,57 @@ void LC::cb_v4theentityassign() {
int bank = g_lingo->readInt();
Datum firstArg = g_lingo->pop();
+ firstArg.toInt();
Datum value = g_lingo->pop();
Datum result;
result.u.s = NULL;
result.type = VOID;
- if (firstArg.type == INT) {
- int key = (bank << 8) + firstArg.u.i;
- if (g_lingo->_lingoV4TheEntity.contains(key)) {
- debugC(3, kDebugLingoExec, "cb_v4theentityassign: mapping 0x%02x, 0x%02x", bank, firstArg.u.i);
- if (g_lingo->_lingoV4TheEntity[key]->writable) {
- int entity = g_lingo->_lingoV4TheEntity[key]->entity;
- int field = g_lingo->_lingoV4TheEntity[key]->field;
- switch (g_lingo->_lingoV4TheEntity[key]->type) {
- case kTEANOArgs:
- {
- Datum id;
- id.u.s = NULL;
- id.type = VOID;
- debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(0x%02x, NULL, 0x%02x, value)", entity, field);
- g_lingo->setTheEntity(entity, id, field, value);
- }
- break;
- case kTEAItemId:
- {
- Datum id = g_lingo->pop();
- debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(0x%02x, id, 0x%02x, value)", entity, field);
- g_lingo->setTheEntity(entity, id, field, value);
- }
- break;
- case kTEAString:
- {
- /*Datum stringArg = */g_lingo->pop();
- warning("cb_v4theentityassign: STUB: kTEAString");
- }
- break;
- case kTEAMenuIdItemId:
- {
- /*Datum menuId = */g_lingo->pop();
- /*Datum itemId = */g_lingo->pop();
- warning("cb_v4theentityassign: STUB: kTEAMenuIdItemId");
- }
- break;
- default:
- warning("cb_v4theentityassign: unknown call type %d", g_lingo->_lingoV4TheEntity[key]->type);
- break;
+ int key = (bank << 8) + firstArg.u.i;
+ if (g_lingo->_lingoV4TheEntity.contains(key)) {
+ debugC(3, kDebugLingoExec, "cb_v4theentityassign: mapping 0x%02x, 0x%02x", bank, firstArg.u.i);
+ if (g_lingo->_lingoV4TheEntity[key]->writable) {
+ int entity = g_lingo->_lingoV4TheEntity[key]->entity;
+ int field = g_lingo->_lingoV4TheEntity[key]->field;
+ switch (g_lingo->_lingoV4TheEntity[key]->type) {
+ case kTEANOArgs:
+ {
+ Datum id;
+ id.u.s = NULL;
+ id.type = VOID;
+ debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(0x%02x, NULL, 0x%02x, value)", entity, field);
+ g_lingo->setTheEntity(entity, id, field, value);
}
- } else {
- warning("cb_v4theentityassign: non-writable mapping 0x%02x 0x%02x", bank, firstArg.u.i);
+ break;
+ case kTEAItemId:
+ {
+ Datum id = g_lingo->pop();
+ debugC(3, kDebugLingoExec, "cb_v4theentityassign: calling setTheEntity(0x%02x, id, 0x%02x, value)", entity, field);
+ g_lingo->setTheEntity(entity, id, field, value);
+ }
+ break;
+ case kTEAString:
+ {
+ /*Datum stringArg = */g_lingo->pop();
+ warning("cb_v4theentityassign: STUB: kTEAString");
+ }
+ break;
+ case kTEAMenuIdItemId:
+ {
+ /*Datum menuId = */g_lingo->pop();
+ /*Datum itemId = */g_lingo->pop();
+ warning("cb_v4theentityassign: STUB: kTEAMenuIdItemId");
+ }
+ break;
+ default:
+ warning("cb_v4theentityassign: unknown call type %d", g_lingo->_lingoV4TheEntity[key]->type);
+ break;
}
} else {
- warning("cb_v4theentityassign: unhandled mapping 0x%02x 0x%02x", bank, firstArg.u.i);
+ warning("cb_v4theentityassign: non-writable mapping 0x%02x 0x%02x", bank, firstArg.u.i);
}
-
} else {
- warning("cb_v4theentityassign: first arg should be of type INT, not %s", firstArg.type2str());
+ warning("cb_v4theentityassign: unhandled mapping 0x%02x 0x%02x", bank, firstArg.u.i);
}
}
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 9077e9d6ad..4d15f964b0 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -242,7 +242,12 @@ Symbol *Lingo::define(Common::String &name, int nargs, ScriptData *code) {
// we don't want to be here. The getHandler call should have used the EntityId and the result
// should have been unique!
warning("Redefining handler '%s'", name.c_str());
- delete sym->u.defn;
+
+ // Do not attempt to remove code from built-ins
+ if (sym->type == HANDLER)
+ delete sym->u.defn;
+ else
+ sym->type = HANDLER;
}
sym->u.defn = code;
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index fe64b80e29..ab3b62aa50 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -34,9 +34,9 @@ struct EventHandlerType {
const char *name;
} static const eventHandlerDescs[] = {
{ kEventPrepareMovie, "prepareMovie" },
- { kEventStartMovie, "startMovie" }, // D3?
- { kEventStepMovie, "stepMovie" }, // D3?
- { kEventStopMovie, "stopMovie" }, // D3?
+ { kEventStartMovie, "startMovie" }, // D3
+ { kEventStepMovie, "stepMovie" }, // D3
+ { kEventStopMovie, "stopMovie" }, // D3
{ kEventNew, "newSprite" },
{ kEventBeginSprite, "beginSprite" },
@@ -44,7 +44,7 @@ struct EventHandlerType {
{ kEventEnterFrame, "enterFrame" }, // D4
{ kEventPrepareFrame, "prepareFrame" },
- { kEventIdle, "idle" },
+ { kEventIdle, "idle" }, // D3
{ kEventStepFrame, "stepFrame"},
{ kEventExitFrame, "exitFrame" }, // D4
@@ -58,8 +58,8 @@ struct EventHandlerType {
{ kEventKeyUp, "keyUp" }, // D4
{ kEventKeyDown, "keyDown" }, // D2 w D4 (as when from D2)
- { kEventMouseUp, "mouseUp" }, // D2 w D3?
- { kEventMouseDown, "mouseDown" }, // D2 w D3?
+ { kEventMouseUp, "mouseUp" }, // D2 w D3
+ { kEventMouseDown, "mouseDown" }, // D2 w D3
{ kEventRightMouseDown, "rightMouseDown" },
{ kEventRightMouseUp, "rightMouseUp" },
{ kEventMouseEnter, "mouseEnter" },
@@ -200,8 +200,9 @@ void Lingo::runMovieScript(LEvent event) {
if (_dontPassEvent)
return;
- for (uint i = 0; i < _scriptContexts[kMovieScript].size(); i++) {
- processEvent(event, kMovieScript, i);
+ for (ScriptContextHash::iterator it = _scriptContexts[kMovieScript].begin();
+ it != _scriptContexts[kMovieScript].end(); ++it) {
+ processEvent(event, kMovieScript, it->_key);
// TODO: How do know which script handles the message?
}
debugC(9, kDebugEvents, "STUB: processEvent(event, kMovieScript, ?)");
@@ -243,12 +244,13 @@ void Lingo::processFrameEvent(LEvent event) {
void Lingo::processGenericEvent(LEvent event) {
// Movie Script
int id = -1;
- if (event == kEventStart || event == kEventPrepareMovie)
+ if (event == kEventStart || event == kEventPrepareMovie ||
+ event == kEventStartMovie || event == kEventStopMovie)
id = 0;
else
- warning("STUB: processGenericEvent called for something else than kEventStart or kEventPrepareMovie, additional logic probably needed");
+ warning("STUB: processGenericEvent called for unprocessed event, additional logic probably needed");
- processEvent(event, kMovieScript, id);
+ runMovieScript(event);
}
void Lingo::processSpriteEvent(LEvent event) {
diff --git a/engines/director/lingo/lingo-gr.cpp b/engines/director/lingo/lingo-gr.cpp
index d4448546ee..0eaeab1e62 100644
--- a/engines/director/lingo/lingo-gr.cpp
+++ b/engines/director/lingo/lingo-gr.cpp
@@ -552,7 +552,7 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 126
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 1638
+#define YYLAST 1598
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 107
@@ -561,7 +561,7 @@ union yyalloc
/* YYNRULES -- Number of rules. */
#define YYNRULES 160
/* YYNRULES -- Number of states. */
-#define YYNSTATES 343
+#define YYNSTATES 342
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
@@ -642,7 +642,7 @@ static const yytype_int16 yyrhs[] =
30, -1, 52, 128, 45, 129, -1, 52, 128, 74,
128, -1, 52, 128, 75, 128, -1, 54, 30, 68,
128, -1, 54, 15, 68, 128, -1, 54, 30, 56,
- 128, -1, 54, 15, 56, 128, -1, 54, 16, 128,
+ 128, -1, 54, 15, 56, 128, -1, 54, 16, 127,
56, 128, -1, 54, 16, 127, 68, 128, -1, 54,
37, 56, 128, -1, 145, -1, 128, -1, 130, -1,
145, -1, 128, -1, 130, -1, 117, -1, 111, -1,
@@ -661,7 +661,7 @@ static const yytype_int16 yyrhs[] =
113, -1, 57, 30, 55, -1, 86, -1, 12, -1,
17, -1, 33, -1, 31, -1, 30, -1, 127, -1,
129, -1, 25, -1, 26, 128, -1, 27, 146, -1,
- 30, 102, 146, 103, -1, 15, -1, 16, 128, -1,
+ 30, 102, 146, 103, -1, 15, -1, 16, 127, -1,
37, -1, 110, -1, 128, 96, 128, -1, 128, 97,
128, -1, 128, 98, 128, -1, 128, 99, 128, -1,
128, 73, 128, -1, 128, 94, 128, -1, 128, 93,
@@ -828,7 +828,7 @@ static const yytype_uint8 yydefact[] =
51, 0, 0, 101, 0, 0, 0, 156, 0, 3,
66, 26, 7, 27, 0, 0, 0, 0, 0, 57,
20, 58, 21, 104, 105, 6, 45, 19, 4, 56,
- 0, 64, 113, 112, 157, 115, 156, 60, 61, 56,
+ 64, 56, 0, 113, 112, 157, 115, 156, 60, 61,
102, 156, 159, 155, 156, 45, 106, 119, 108, 125,
0, 126, 0, 127, 128, 130, 139, 103, 0, 41,
0, 0, 0, 0, 0, 141, 117, 133, 134, 136,
@@ -838,33 +838,33 @@ static const yytype_uint8 yydefact[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 147, 156, 0, 0, 118,
157, 0, 0, 138, 147, 0, 132, 0, 129, 45,
- 0, 0, 0, 42, 0, 0, 57, 0, 0, 0,
- 0, 50, 0, 135, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 87, 88, 2,
- 47, 46, 0, 31, 46, 0, 47, 76, 77, 74,
- 75, 78, 79, 71, 82, 83, 84, 73, 72, 81,
- 67, 68, 69, 70, 148, 0, 158, 62, 160, 0,
- 120, 131, 147, 8, 9, 10, 11, 15, 13, 0,
- 0, 14, 12, 18, 116, 124, 91, 0, 93, 0,
- 95, 0, 97, 0, 89, 90, 122, 99, 156, 46,
- 0, 47, 0, 33, 46, 154, 0, 154, 0, 17,
- 16, 0, 0, 0, 0, 0, 48, 49, 0, 0,
- 0, 46, 0, 0, 0, 47, 149, 47, 154, 92,
- 94, 96, 98, 100, 28, 0, 46, 36, 46, 32,
- 150, 145, 143, 47, 46, 47, 44, 46, 36, 0,
- 0, 151, 140, 47, 46, 45, 0, 37, 46, 45,
- 40, 152, 144, 46, 0, 47, 34, 0, 0, 0,
- 0, 29, 46, 47, 46, 153, 30, 0, 46, 0,
- 35, 38, 39
+ 0, 0, 0, 42, 0, 0, 0, 0, 0, 0,
+ 50, 0, 135, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 87, 88, 2, 47,
+ 46, 0, 31, 46, 0, 47, 76, 77, 74, 75,
+ 78, 79, 71, 82, 83, 84, 73, 72, 81, 67,
+ 68, 69, 70, 148, 0, 158, 62, 160, 0, 120,
+ 131, 147, 8, 9, 10, 11, 15, 13, 0, 0,
+ 14, 12, 18, 116, 124, 91, 0, 93, 0, 95,
+ 0, 97, 0, 89, 90, 122, 99, 156, 46, 0,
+ 47, 0, 33, 46, 154, 0, 154, 0, 16, 17,
+ 0, 0, 0, 0, 0, 48, 49, 0, 0, 0,
+ 46, 0, 0, 0, 47, 149, 47, 154, 92, 94,
+ 96, 98, 100, 28, 0, 46, 36, 46, 32, 150,
+ 145, 143, 47, 46, 47, 44, 46, 36, 0, 0,
+ 151, 140, 47, 46, 45, 0, 37, 46, 45, 40,
+ 152, 144, 46, 0, 47, 34, 0, 0, 0, 0,
+ 29, 46, 47, 46, 153, 30, 0, 46, 0, 35,
+ 38, 39
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 48, 49, 50, 51, 131, 277, 53, 307, 308,
- 132, 54, 55, 56, 309, 155, 200, 259, 57, 58,
+ -1, 48, 49, 50, 51, 131, 276, 53, 306, 307,
+ 132, 54, 55, 56, 308, 155, 199, 258, 57, 58,
59, 60, 61, 62, 88, 119, 111, 63, 95, 64,
- 84, 65, 169, 85, 66, 225, 322, 285, 67, 161,
+ 84, 65, 169, 85, 66, 224, 321, 284, 67, 161,
83
};
@@ -873,50 +873,50 @@ static const yytype_int16 yydefgoto[] =
#define YYPACT_NINF -268
static const yytype_int16 yypact[] =
{
- 316, -42, -268, -268, 976, -268, -268, 976, 976, 976,
- 21, -268, 976, 976, 57, 1009, -268, -268, -268, -268,
- -268, 15, 40, 854, -268, 55, 976, -38, 41, 64,
- 71, 976, 915, 80, 976, 976, 976, 976, 976, 976,
- -268, 81, 82, 11, 976, 976, 976, 976, 2, -268,
- -268, -268, -268, -268, 976, 46, 976, 680, 976, -268,
- 1526, -268, -268, -268, -268, -268, -268, -268, -268, 13,
- 976, 1526, 1526, 1526, 1526, 10, 976, 1526, 10, -268,
- -268, 976, 1526, 12, 976, -268, -268, -268, 14, -268,
- 976, -268, 69, -268, 1062, -268, -268, 1048, 89, -268,
- -31, 976, 36, 65, 72, -268, 1420, -268, 1062, -268,
- -268, 18, -268, 1098, 1132, 1166, 1200, 1492, -268, 20,
- -268, 100, -268, -268, 1454, 3, -268, 407, 1526, 976,
- 1526, -268, -268, 976, 1526, -268, -268, 1370, 976, 976,
- 976, 976, 976, 976, 976, 976, 976, 976, 976, 976,
- 976, 976, 976, 976, 976, 101, 976, 1048, 976, 10,
- 1454, -27, 976, 10, 101, 102, 1526, 976, -268, -268,
- 77, 976, 976, -268, 976, 976, 83, 1406, 976, 976,
- 976, -268, 976, -268, 103, 976, 976, 976, 976, 976,
- 976, 976, 976, 976, 976, 125, -10, -268, -268, -268,
- -268, 1526, 104, -268, 1526, 976, -268, -50, -50, -50,
- -50, 1539, 1539, -268, -34, -50, -50, -50, -50, -34,
- -15, -15, -268, -268, -268, -77, 1526, -268, 1526, -46,
- -268, 1526, 101, -268, -268, 1526, 1526, 1526, -50, 976,
- 976, 1526, -50, 1526, 1526, -268, 1526, 1234, 1526, 1268,
- 1526, 1302, 1526, 1336, 1526, 1526, -268, -268, 976, 589,
- -20, -268, 105, 1526, 589, 50, 127, 50, -6, -50,
- 1526, 976, 976, 976, 976, -1, -268, -268, 70, 106,
- 976, 589, 771, 73, 134, -268, -268, -268, 50, 1526,
- 1526, 1526, 1526, -268, -268, 976, 1526, 126, -268, -268,
- -268, 498, 589, -268, 1526, -268, -268, 130, 126, 976,
- -23, 142, 589, -268, 589, -268, 90, -268, 1526, -268,
- -268, -268, 67, 589, 107, -268, -268, 136, 771, 162,
- 108, -268, 589, -268, -268, -268, -268, 110, 589, 112,
- -268, -268, -268
+ 312, -79, -268, -268, 73, -268, -268, 972, 972, 972,
+ 5, -268, 972, 972, 73, 1005, -268, -268, -268, -268,
+ -268, -36, 46, 850, -268, 62, 972, -13, 65, 71,
+ 79, 972, 911, 81, 972, 972, 972, 972, 972, 972,
+ -268, 82, 83, -76, 972, 972, 972, 972, 9, -268,
+ -268, -268, -268, -268, 972, 47, 972, 676, 972, -268,
+ 1486, -268, -268, -268, -268, -268, -268, -268, -268, -268,
+ -268, 12, 972, 1486, 1486, 1486, 10, 972, 1486, 10,
+ -268, 972, 1486, 11, 972, -268, -268, -268, 17, -268,
+ 972, -268, 76, -268, 1058, -268, -268, 1044, 88, -268,
+ -14, 73, 7, 69, 72, -268, 1380, -268, 1058, -268,
+ -268, 22, -268, 1094, 1128, 1162, 1196, 1452, -268, 23,
+ -268, 100, -268, -268, 1414, -44, -268, 403, 1486, 972,
+ 1486, -268, -268, 972, 1486, -268, -268, 1366, 972, 972,
+ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972,
+ 972, 972, 972, 972, 972, 120, 972, 1044, 972, 10,
+ 1414, -88, 972, 10, 120, 122, 1486, 972, -268, -268,
+ 70, 972, 972, -268, 972, 972, 26, 972, 972, 972,
+ -268, 972, -268, 123, 972, 972, 972, 972, 972, 972,
+ 972, 972, 972, 972, 124, -10, -268, -268, -268, -268,
+ 1486, 101, -268, 1486, 972, -268, -40, -40, -40, -40,
+ 1499, 1499, -268, -30, -40, -40, -40, -40, -30, -1,
+ -1, -268, -268, -268, -53, 1486, -268, 1486, -17, -268,
+ 1486, 120, -268, -268, 1486, 1486, 1486, -40, 972, 972,
+ 1486, -40, 1486, 1486, -268, 1486, 1230, 1486, 1264, 1486,
+ 1298, 1486, 1332, 1486, 1486, -268, -268, 972, 585, -4,
+ -268, 102, 1486, 585, 52, 129, 52, -15, 1486, -40,
+ 972, 972, 972, 972, 2, -268, -268, 75, 105, 972,
+ 585, 767, 77, 132, -268, -268, -268, 52, 1486, 1486,
+ 1486, 1486, -268, -268, 972, 1486, 133, -268, -268, -268,
+ 494, 585, -268, 1486, -268, -268, 136, 133, 972, -26,
+ 157, 585, -268, 585, -268, 98, -268, 1486, -268, -268,
+ -268, 57, 585, 99, -268, -268, 138, 767, 161, 103,
+ -268, 585, -268, -268, -268, -268, 106, 585, 108, -268,
+ -268, -268
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -268, -268, 76, -268, -267, -268, 1, -268, -114, -268,
- -268, -268, -268, 147, -268, -78, -8, -108, -268, -268,
- -2, -4, 37, 149, -268, -268, -268, -268, -19, -268,
- -268, -268, -268, -268, -268, -150, -268, -250, 151, -3,
+ -268, -268, 68, -268, -267, -268, 21, -268, -108, -268,
+ -268, -268, -268, 144, -268, -81, -11, -84, -268, -268,
+ 6, -7, 33, 147, -268, -268, -268, -268, -21, -268,
+ -268, -268, -268, -268, -268, -152, -268, -243, 148, -6,
-268
};
@@ -927,132 +927,135 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -6
static const yytype_int16 yytable[] =
{
- 71, 52, 126, 72, 73, 74, 75, 164, 77, 74,
- 78, 82, 80, 109, 229, 298, 319, 287, 279, 94,
- 98, 99, 97, 144, 265, 174, 145, 106, 108, 266,
- 112, 113, 114, 115, 116, 117, 280, 175, 303, 144,
- 122, 123, 124, 74, 125, 150, 151, 152, 153, 154,
- 128, 76, 130, 134, 137, 267, 100, 101, 144, 68,
- 266, 334, 151, 152, 153, 154, 157, 320, 86, 2,
- 87, 102, 74, 159, 5, 168, 227, 160, 103, 158,
- 74, 163, 268, 153, 154, 96, 166, 79, 16, 183,
- 17, 232, 178, 257, 104, 288, 258, 177, 264, 176,
- 266, 105, 293, 127, 179, 158, 14, 233, 198, 158,
- 110, 118, 120, 121, 129, 156, 158, 167, 162, 173,
- 165, 180, 202, 203, 184, 201, 195, 181, 52, 204,
- 196, 224, 230, 245, 207, 208, 209, 210, 211, 212,
- 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
- 223, 239, 74, 281, 226, 256, 284, 286, 228, 261,
- 282, 294, 295, 231, 300, 299, 306, 235, 236, 315,
- 237, 238, 321, 329, 241, 242, 243, 301, 244, 302,
- 326, 246, 247, 248, 249, 250, 251, 252, 253, 254,
- 255, 333, 335, 260, 317, 312, 262, 314, 331, 336,
- 340, 263, 342, 199, 133, 323, 135, 234, 136, 0,
- 0, 0, 0, 0, 0, 0, 0, 332, 0, 0,
- 0, 0, 0, 0, 0, 338, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 269, 270, 325, 0, 0,
- 0, 328, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 278, 0, 0, 74, 275, 283, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 289, 290, 291,
- 292, 0, 0, 297, 0, 0, 296, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 305, 0,
- 310, 304, 0, 0, 0, 0, 313, 0, 0, 316,
- 0, 0, 0, 0, 0, 318, 324, 0, 0, 0,
- 327, 0, 0, 0, 0, 330, -5, 1, 0, 0,
- 0, 0, 0, 0, 337, 0, 339, 0, 2, 0,
- 341, 3, 4, 5, 0, 6, 7, 8, 9, 10,
+ 73, 74, 75, 76, 164, 78, 75, 79, 82, 126,
+ 70, 109, 228, 318, 297, 226, 94, 86, 158, 97,
+ 80, 52, 68, 286, 106, 108, 121, 112, 113, 114,
+ 115, 116, 117, 144, 278, 77, 145, 122, 123, 124,
+ 75, 125, 174, 144, 302, 98, 99, 128, 264, 130,
+ 134, 137, 279, 265, 175, 150, 151, 152, 153, 154,
+ 333, 197, 158, 177, 319, 157, 151, 152, 153, 154,
+ 75, 159, 144, 168, 160, 178, 87, 75, 163, 267,
+ 100, 101, 238, 166, 266, 2, 287, 182, 231, 265,
+ 5, 265, 96, 256, 239, 102, 257, 153, 154, 14,
+ 232, 104, 103, 69, 16, 292, 17, 176, 158, 105,
+ 127, 110, 118, 120, 156, 129, 158, 162, 173, 201,
+ 202, 263, 200, 165, 167, 179, 203, 180, 183, 194,
+ 195, 206, 207, 208, 209, 210, 211, 212, 213, 214,
+ 215, 216, 217, 218, 219, 220, 221, 222, 52, 75,
+ 223, 225, 229, 244, 255, 227, 260, 281, 283, 285,
+ 230, 294, 299, 328, 234, 235, 293, 236, 237, 298,
+ 240, 241, 242, 305, 243, 314, 280, 245, 246, 247,
+ 248, 249, 250, 251, 252, 253, 254, 320, 325, 259,
+ 330, 334, 261, 332, 335, 198, 339, 262, 341, 316,
+ 300, 133, 301, 233, 135, 136, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 311, 0,
+ 313, 0, 0, 0, 0, 0, 0, 0, 322, 0,
+ 0, 268, 269, 324, 0, 0, 0, 327, 0, 0,
+ 331, 0, 0, 0, 0, 0, 0, 277, 337, 0,
+ 75, 274, 282, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 288, 289, 290, 291, 0, 0, 296,
+ 0, 0, 295, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 304, 0, 309, 303, 0, 0,
+ 0, 0, 312, 0, 0, 315, 0, 0, 0, 0,
+ 0, 317, 323, 0, 0, 0, 326, 0, 0, 0,
+ 0, 329, -5, 1, 0, 0, 0, 0, 0, 0,
+ 336, 0, 338, 0, 2, 0, 340, 3, 4, 5,
+ 0, 6, 7, 8, 9, 10, 0, 11, 12, 13,
+ 0, 14, 15, 16, 0, 17, 0, 18, 19, 20,
+ 0, 0, 0, 21, 22, 23, 24, 0, 0, 25,
+ 0, 0, 0, 0, 26, 27, 28, 0, 0, 29,
+ 0, 0, 0, 30, 31, 32, 0, 33, 0, 0,
+ 0, 0, 0, 0, 34, 0, 0, 0, 0, 0,
+ 0, 35, 36, 37, 38, 39, 0, 0, 40, 41,
+ 42, 43, 0, 0, 0, 0, 0, 0, 44, 45,
+ 0, 0, 0, -5, 46, 2, 47, 0, 3, 4,
+ 5, 0, 6, 7, 8, 9, 10, 0, 11, 12,
+ 13, 0, 14, 15, 16, 0, 17, 0, 18, 19,
+ 20, 0, 0, 0, 21, 22, 23, 24, 0, 0,
+ 25, 0, 0, 0, 0, 26, 27, 28, 0, 0,
+ 29, 0, 0, 0, 30, 31, 32, 0, 33, 0,
+ 0, 0, 0, 0, 0, 34, 0, 0, 0, 0,
+ 0, 0, 35, 36, 37, 38, 39, 0, 0, 40,
+ 41, 42, 43, 0, 0, 0, 0, 0, 0, 44,
+ 45, 0, 0, 0, 0, 46, 2, 47, 0, 3,
+ 4, 5, 0, 6, 7, 8, 9, 10, 0, 11,
+ 12, 13, 0, 14, 15, 16, 0, 17, 310, 18,
+ 0, 20, 0, 0, 0, 21, 22, 23, 24, 0,
+ 0, 0, 0, 0, 0, 0, 26, 27, 28, 0,
+ 0, 29, 0, 0, 0, 0, 31, 32, 0, 33,
+ 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
+ 0, 0, 0, 35, 36, 37, 38, 39, 0, 0,
+ 40, 41, 0, 43, 0, 0, 0, 0, 0, 0,
+ 44, 45, 0, 0, 0, 275, 46, 2, 47, 0,
+ 3, 4, 5, 0, 6, 7, 8, 9, 10, 0,
+ 11, 12, 13, 0, 14, 15, 16, 0, 17, 0,
+ 18, 0, 20, 0, 0, 0, 21, 22, 23, 24,
+ 0, 0, 0, 0, 0, 0, 0, 26, 27, 28,
+ 0, 0, 29, 0, 0, 0, 0, 31, 32, 0,
+ 33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 0, 0, 0, 35, 36, 37, 38, 39, 0,
+ 0, 40, 41, 0, 43, 0, 0, 0, 0, 0,
+ 0, 44, 45, 0, 0, 0, 275, 46, 2, 47,
+ 0, 3, 4, 5, 0, 6, 7, 8, 9, 10,
0, 11, 12, 13, 0, 14, 15, 16, 0, 17,
- 0, 18, 19, 20, 0, 0, 0, 21, 22, 23,
- 24, 0, 0, 25, 0, 0, 0, 0, 26, 27,
- 28, 0, 0, 29, 0, 0, 0, 30, 31, 32,
+ 0, 18, 0, 20, 0, 0, 0, 21, 22, 23,
+ 24, 0, 0, 0, 0, 0, 0, 0, 26, 0,
+ 28, 0, 0, 0, 0, 0, 0, 0, 31, 32,
0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
0, 0, 0, 0, 0, 35, 36, 37, 38, 39,
- 0, 0, 40, 41, 42, 43, 0, 0, 0, 0,
- 0, 0, 44, 45, 0, 0, 0, -5, 46, 2,
+ 0, 0, 0, 41, 0, 43, 0, 0, 0, 0,
+ 0, 0, 44, 45, 0, 0, 0, 0, 46, 2,
47, 0, 3, 4, 5, 0, 6, 7, 8, 9,
10, 0, 11, 12, 13, 0, 14, 15, 16, 0,
- 17, 0, 18, 19, 20, 0, 0, 0, 21, 22,
- 23, 24, 0, 0, 25, 0, 0, 0, 0, 26,
- 27, 28, 0, 0, 29, 0, 0, 0, 30, 31,
+ 17, 0, 18, 0, 20, 0, 0, 0, 21, 22,
+ 23, 0, 0, 0, 0, 0, 0, 0, 0, 26,
+ 0, 28, 0, 0, 0, 0, 0, 0, 0, 31,
32, 0, 33, 0, 0, 0, 0, 0, 0, 34,
0, 0, 0, 0, 0, 0, 35, 36, 37, 38,
- 39, 0, 0, 40, 41, 42, 43, 0, 0, 0,
- 0, 0, 0, 44, 45, 0, 0, 0, 0, 46,
- 2, 47, 0, 3, 4, 5, 0, 6, 7, 8,
- 9, 10, 0, 11, 12, 13, 0, 14, 15, 16,
- 0, 17, 311, 18, 0, 20, 0, 0, 0, 21,
- 22, 23, 24, 0, 0, 0, 0, 0, 0, 0,
- 26, 27, 28, 0, 0, 29, 0, 0, 0, 0,
- 31, 32, 0, 33, 0, 0, 0, 0, 0, 0,
- 34, 0, 0, 0, 0, 0, 0, 35, 36, 37,
- 38, 39, 0, 0, 40, 41, 0, 43, 0, 0,
- 0, 0, 0, 0, 44, 45, 0, 0, 0, 276,
- 46, 2, 47, 0, 3, 4, 5, 0, 6, 7,
- 8, 9, 10, 0, 11, 12, 13, 0, 14, 15,
- 16, 0, 17, 0, 18, 0, 20, 0, 0, 0,
- 21, 22, 23, 24, 0, 0, 0, 0, 0, 0,
- 0, 26, 27, 28, 0, 0, 29, 0, 0, 0,
- 0, 31, 32, 0, 33, 0, 0, 0, 0, 0,
- 0, 34, 0, 0, 0, 0, 0, 0, 35, 36,
- 37, 38, 39, 0, 0, 40, 41, 0, 43, 0,
- 0, 0, 0, 0, 0, 44, 45, 0, 0, 0,
- 276, 46, 2, 47, 0, 3, 4, 5, 0, 6,
- 7, 8, 9, 10, 0, 11, 12, 13, 0, 14,
- 15, 16, 0, 17, 0, 18, 0, 20, 0, 0,
- 0, 21, 22, 23, 24, 0, 0, 0, 0, 0,
- 0, 0, 26, 0, 28, 0, 0, 0, 0, 0,
- 0, 0, 31, 32, 0, 33, 0, 0, 0, 0,
- 0, 0, 34, 0, 0, 0, 0, 0, 0, 35,
- 36, 37, 38, 39, 0, 0, 0, 41, 0, 43,
- 0, 0, 0, 0, 0, 0, 44, 45, 0, 0,
- 0, 0, 46, 2, 47, 0, 3, 4, 5, 0,
- 6, 7, 8, 9, 10, 0, 11, 12, 13, 0,
- 14, 15, 16, 0, 17, 0, 18, 0, 20, 0,
- 0, 0, 21, 22, 23, 0, 0, 0, 0, 0,
- 0, 0, 0, 26, 0, 28, 0, 0, 0, 0,
- 0, 0, 0, 31, 32, 0, 33, 0, 0, 0,
- 0, 0, 0, 34, 0, 0, 0, 0, 0, 0,
- 35, 36, 37, 38, 39, 0, 0, 0, 41, 0,
- 43, 0, 0, 0, 0, 0, 2, 44, 45, 3,
- 4, 5, 0, 46, 0, 47, 0, 0, 0, 11,
- 12, 13, 0, 14, 69, 16, 0, 17, 0, 0,
- 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
- 89, 0, 90, 91, 92, 93, 70, 0, 28, 0,
+ 39, 0, 0, 0, 41, 0, 43, 0, 0, 0,
+ 0, 0, 2, 44, 45, 3, 4, 5, 0, 46,
+ 0, 47, 0, 0, 0, 11, 12, 13, 0, 14,
+ 71, 16, 0, 17, 0, 0, 0, 20, 0, 0,
+ 0, 0, 0, 0, 0, 0, 89, 0, 90, 91,
+ 92, 93, 72, 0, 28, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 34, 2, 0, 0,
- 3, 4, 5, 35, 36, 37, 38, 39, 0, 0,
- 11, 12, 13, 43, 14, 69, 16, 0, 17, 0,
- 44, 45, 20, 0, 0, 0, 46, 0, 47, 0,
- 0, 0, 0, 90, 0, 92, 0, 70, 0, 28,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 107,
- 0, 0, 0, 0, 0, 0, 0, 34, 2, 0,
- 0, 3, 4, 5, 35, 36, 37, 38, 39, 0,
- 0, 11, 12, 13, 43, 14, 69, 16, 0, 17,
- 0, 44, 45, 20, 0, 0, 0, 46, 0, 47,
- 0, 2, 0, 0, 3, 4, 5, 0, 70, 0,
- 28, 0, 0, 0, 11, 12, 13, 0, 14, 69,
- 16, 0, 17, 0, 0, 0, 20, 0, 34, 0,
- 0, 0, 0, 0, 0, 35, 36, 37, 38, 39,
- 0, 70, 0, 28, 0, 43, 0, 0, 0, 0,
- 0, 0, 44, 45, 0, 0, 0, 0, 46, 0,
- 47, 34, 0, 0, 0, 0, 0, 0, 35, 36,
- 37, 38, 39, 170, 0, 0, 0, 0, 43, 0,
- 0, 0, 0, 0, 0, 44, 45, 0, 0, 0,
- 90, 81, 92, 47, 138, 139, 140, 141, 142, 143,
- 0, 144, 171, 172, 145, 146, 147, 0, 138, 139,
- 140, 141, 142, 143, 0, 144, 0, 0, 145, 146,
- 147, 148, 149, 150, 151, 152, 153, 154, 185, 0,
- 0, 0, 0, 0, 186, 148, 149, 150, 151, 152,
- 153, 154, 0, 0, 138, 139, 140, 141, 142, 143,
+ 0, 0, 34, 2, 0, 0, 3, 4, 5, 35,
+ 36, 37, 38, 39, 0, 0, 11, 12, 13, 43,
+ 14, 71, 16, 0, 17, 0, 44, 45, 20, 0,
+ 0, 0, 46, 0, 47, 0, 0, 0, 0, 90,
+ 0, 92, 0, 72, 0, 28, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 107, 0, 0, 0, 0,
+ 0, 0, 0, 34, 2, 0, 0, 3, 4, 5,
+ 35, 36, 37, 38, 39, 0, 0, 11, 12, 13,
+ 43, 14, 71, 16, 0, 17, 0, 44, 45, 20,
+ 0, 0, 0, 46, 0, 47, 0, 2, 0, 0,
+ 3, 4, 5, 0, 72, 0, 28, 0, 0, 0,
+ 11, 12, 13, 0, 14, 71, 16, 0, 17, 0,
+ 0, 0, 20, 0, 34, 0, 0, 0, 0, 0,
+ 0, 35, 36, 37, 38, 39, 0, 72, 0, 28,
+ 0, 43, 0, 0, 0, 0, 0, 0, 44, 45,
+ 0, 0, 0, 0, 46, 0, 47, 34, 0, 0,
+ 0, 0, 0, 0, 35, 36, 37, 38, 39, 170,
+ 0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
+ 0, 44, 45, 0, 0, 0, 90, 81, 92, 47,
+ 138, 139, 140, 141, 142, 143, 0, 144, 171, 172,
+ 145, 146, 147, 0, 138, 139, 140, 141, 142, 143,
+ 0, 144, 0, 0, 145, 146, 147, 148, 149, 150,
+ 151, 152, 153, 154, 184, 0, 0, 0, 0, 0,
+ 185, 148, 149, 150, 151, 152, 153, 154, 0, 0,
+ 138, 139, 140, 141, 142, 143, 0, 144, 0, 0,
+ 145, 146, 147, 0, 0, 0, 0, 0, 186, 0,
+ 0, 0, 0, 0, 187, 0, 0, 148, 149, 150,
+ 151, 152, 153, 154, 138, 139, 140, 141, 142, 143,
0, 144, 0, 0, 145, 146, 147, 0, 0, 0,
- 0, 0, 187, 0, 0, 0, 0, 0, 188, 0,
+ 0, 0, 188, 0, 0, 0, 0, 0, 189, 0,
0, 148, 149, 150, 151, 152, 153, 154, 138, 139,
140, 141, 142, 143, 0, 144, 0, 0, 145, 146,
- 147, 0, 0, 0, 0, 0, 189, 0, 0, 0,
- 0, 0, 190, 0, 0, 148, 149, 150, 151, 152,
+ 147, 0, 0, 0, 0, 0, 190, 0, 0, 0,
+ 0, 0, 191, 0, 0, 148, 149, 150, 151, 152,
153, 154, 138, 139, 140, 141, 142, 143, 0, 144,
0, 0, 145, 146, 147, 0, 0, 0, 0, 0,
- 191, 0, 0, 0, 0, 0, 192, 0, 0, 148,
+ 270, 0, 0, 0, 0, 0, 0, 0, 0, 148,
149, 150, 151, 152, 153, 154, 138, 139, 140, 141,
142, 143, 0, 144, 0, 0, 145, 146, 147, 0,
0, 0, 0, 0, 271, 0, 0, 0, 0, 0,
@@ -1065,26 +1068,19 @@ static const yytype_int16 yytable[] =
0, 0, 273, 0, 0, 0, 0, 0, 0, 0,
0, 148, 149, 150, 151, 152, 153, 154, 138, 139,
140, 141, 142, 143, 0, 144, 0, 0, 145, 146,
- 147, 0, 0, 0, 0, 0, 274, 0, 0, 0,
- 0, 0, 0, 0, 0, 148, 149, 150, 151, 152,
- 153, 154, 138, 139, 140, 141, 142, 143, 0, 144,
- 0, 0, 145, 146, 147, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 205, 0, 0, 148,
- 149, 150, 151, 152, 153, 154, 138, 139, 140, 141,
- 142, 143, 0, 144, 0, 0, 145, 146, 147, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 240, 148, 149, 150, 151, 152, 153, 154,
- 0, 206, 138, 139, 140, 141, 142, 143, 182, 144,
+ 147, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 204, 0, 0, 148, 149, 150, 151, 152,
+ 153, 154, 138, 139, 140, 141, 142, 143, 181, 144,
0, 0, 145, 146, 147, 0, 138, 139, 140, 141,
142, 143, 0, 144, 0, 0, 145, 146, 147, 148,
- 149, 150, 151, 152, 153, 154, 0, 0, 0, 0,
+ 149, 150, 151, 152, 153, 154, 0, 205, 0, 0,
0, 0, 0, 148, 149, 150, 151, 152, 153, 154,
138, 139, 140, 141, 142, 143, 0, 144, 0, 0,
145, 146, 147, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 148, 149, 150,
- 151, 152, 153, 154, 0, 0, 0, 197, 138, 139,
+ 151, 152, 153, 154, 0, 0, 0, 196, 138, 139,
140, 141, 142, 143, 0, 144, 0, 0, 145, 146,
- 147, 0, 0, 0, 0, 0, 193, 194, 0, 0,
+ 147, 0, 0, 0, 0, 0, 192, 193, 0, 0,
0, 0, 0, 0, 0, 148, 149, 150, 151, 152,
153, 154, 138, 139, 140, 141, 142, 143, 0, 144,
0, 0, 145, 146, 147, 138, 139, 140, 141, 0,
@@ -1095,123 +1091,126 @@ static const yytype_int16 yytable[] =
static const yytype_int16 yycheck[] =
{
- 4, 0, 0, 7, 8, 9, 9, 85, 12, 13,
- 13, 15, 14, 32, 164, 282, 39, 267, 38, 23,
- 58, 59, 26, 73, 101, 56, 76, 31, 32, 106,
- 34, 35, 36, 37, 38, 39, 56, 68, 288, 73,
- 44, 45, 46, 47, 47, 95, 96, 97, 98, 99,
- 54, 30, 56, 57, 58, 101, 15, 16, 73, 101,
- 106, 328, 96, 97, 98, 99, 70, 90, 53, 12,
- 30, 30, 76, 76, 17, 94, 103, 81, 37, 106,
- 84, 84, 232, 98, 99, 30, 90, 30, 31, 108,
- 33, 169, 56, 103, 30, 101, 106, 101, 206, 101,
- 106, 30, 103, 101, 68, 106, 29, 30, 105, 106,
- 30, 30, 30, 102, 68, 102, 106, 48, 106, 30,
- 106, 56, 130, 131, 106, 129, 106, 55, 127, 133,
- 30, 30, 30, 30, 138, 139, 140, 141, 142, 143,
- 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
- 154, 68, 156, 261, 158, 30, 106, 30, 162, 55,
- 55, 91, 56, 167, 30, 92, 40, 171, 172, 39,
- 174, 175, 30, 106, 178, 179, 180, 285, 182, 287,
- 90, 185, 186, 187, 188, 189, 190, 191, 192, 193,
- 194, 55, 30, 201, 308, 303, 204, 305, 91, 91,
- 90, 205, 90, 127, 57, 313, 57, 170, 57, -1,
- -1, -1, -1, -1, -1, -1, -1, 325, -1, -1,
- -1, -1, -1, -1, -1, 333, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 239, 240, 315, -1, -1,
- -1, 319, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 259, -1, -1, 258, 258, 264, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 271, 272, 273,
- 274, -1, -1, 281, -1, -1, 280, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 296, -1,
- 298, 295, -1, -1, -1, -1, 304, -1, -1, 307,
- -1, -1, -1, -1, -1, 309, 314, -1, -1, -1,
- 318, -1, -1, -1, -1, 323, 0, 1, -1, -1,
- -1, -1, -1, -1, 332, -1, 334, -1, 12, -1,
- 338, 15, 16, 17, -1, 19, 20, 21, 22, 23,
+ 7, 8, 9, 9, 85, 12, 13, 13, 15, 0,
+ 4, 32, 164, 39, 281, 103, 23, 53, 106, 26,
+ 14, 0, 101, 266, 31, 32, 102, 34, 35, 36,
+ 37, 38, 39, 73, 38, 30, 76, 44, 45, 46,
+ 47, 47, 56, 73, 287, 58, 59, 54, 101, 56,
+ 57, 58, 56, 106, 68, 95, 96, 97, 98, 99,
+ 327, 105, 106, 56, 90, 72, 96, 97, 98, 99,
+ 77, 77, 73, 94, 81, 68, 30, 84, 84, 231,
+ 15, 16, 56, 90, 101, 12, 101, 108, 169, 106,
+ 17, 106, 30, 103, 68, 30, 106, 98, 99, 29,
+ 30, 30, 37, 30, 31, 103, 33, 101, 106, 30,
+ 101, 30, 30, 30, 102, 68, 106, 106, 30, 130,
+ 131, 205, 129, 106, 48, 56, 133, 55, 106, 106,
+ 30, 138, 139, 140, 141, 142, 143, 144, 145, 146,
+ 147, 148, 149, 150, 151, 152, 153, 154, 127, 156,
+ 30, 158, 30, 30, 30, 162, 55, 55, 106, 30,
+ 167, 56, 30, 106, 171, 172, 91, 174, 175, 92,
+ 177, 178, 179, 40, 181, 39, 260, 184, 185, 186,
+ 187, 188, 189, 190, 191, 192, 193, 30, 90, 200,
+ 91, 30, 203, 55, 91, 127, 90, 204, 90, 307,
+ 284, 57, 286, 170, 57, 57, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 302, -1,
+ 304, -1, -1, -1, -1, -1, -1, -1, 312, -1,
+ -1, 238, 239, 314, -1, -1, -1, 318, -1, -1,
+ 324, -1, -1, -1, -1, -1, -1, 258, 332, -1,
+ 257, 257, 263, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 270, 271, 272, 273, -1, -1, 280,
+ -1, -1, 279, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 295, -1, 297, 294, -1, -1,
+ -1, -1, 303, -1, -1, 306, -1, -1, -1, -1,
+ -1, 308, 313, -1, -1, -1, 317, -1, -1, -1,
+ -1, 322, 0, 1, -1, -1, -1, -1, -1, -1,
+ 331, -1, 333, -1, 12, -1, 337, 15, 16, 17,
+ -1, 19, 20, 21, 22, 23, -1, 25, 26, 27,
+ -1, 29, 30, 31, -1, 33, -1, 35, 36, 37,
+ -1, -1, -1, 41, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, -1, 52, 53, 54, -1, -1, 57,
+ -1, -1, -1, 61, 62, 63, -1, 65, -1, -1,
+ -1, -1, -1, -1, 72, -1, -1, -1, -1, -1,
+ -1, 79, 80, 81, 82, 83, -1, -1, 86, 87,
+ 88, 89, -1, -1, -1, -1, -1, -1, 96, 97,
+ -1, -1, -1, 101, 102, 12, 104, -1, 15, 16,
+ 17, -1, 19, 20, 21, 22, 23, -1, 25, 26,
+ 27, -1, 29, 30, 31, -1, 33, -1, 35, 36,
+ 37, -1, -1, -1, 41, 42, 43, 44, -1, -1,
+ 47, -1, -1, -1, -1, 52, 53, 54, -1, -1,
+ 57, -1, -1, -1, 61, 62, 63, -1, 65, -1,
+ -1, -1, -1, -1, -1, 72, -1, -1, -1, -1,
+ -1, -1, 79, 80, 81, 82, 83, -1, -1, 86,
+ 87, 88, 89, -1, -1, -1, -1, -1, -1, 96,
+ 97, -1, -1, -1, -1, 102, 12, 104, -1, 15,
+ 16, 17, -1, 19, 20, 21, 22, 23, -1, 25,
+ 26, 27, -1, 29, 30, 31, -1, 33, 34, 35,
+ -1, 37, -1, -1, -1, 41, 42, 43, 44, -1,
+ -1, -1, -1, -1, -1, -1, 52, 53, 54, -1,
+ -1, 57, -1, -1, -1, -1, 62, 63, -1, 65,
+ -1, -1, -1, -1, -1, -1, 72, -1, -1, -1,
+ -1, -1, -1, 79, 80, 81, 82, 83, -1, -1,
+ 86, 87, -1, 89, -1, -1, -1, -1, -1, -1,
+ 96, 97, -1, -1, -1, 101, 102, 12, 104, -1,
+ 15, 16, 17, -1, 19, 20, 21, 22, 23, -1,
+ 25, 26, 27, -1, 29, 30, 31, -1, 33, -1,
+ 35, -1, 37, -1, -1, -1, 41, 42, 43, 44,
+ -1, -1, -1, -1, -1, -1, -1, 52, 53, 54,
+ -1, -1, 57, -1, -1, -1, -1, 62, 63, -1,
+ 65, -1, -1, -1, -1, -1, -1, 72, -1, -1,
+ -1, -1, -1, -1, 79, 80, 81, 82, 83, -1,
+ -1, 86, 87, -1, 89, -1, -1, -1, -1, -1,
+ -1, 96, 97, -1, -1, -1, 101, 102, 12, 104,
+ -1, 15, 16, 17, -1, 19, 20, 21, 22, 23,
-1, 25, 26, 27, -1, 29, 30, 31, -1, 33,
- -1, 35, 36, 37, -1, -1, -1, 41, 42, 43,
- 44, -1, -1, 47, -1, -1, -1, -1, 52, 53,
- 54, -1, -1, 57, -1, -1, -1, 61, 62, 63,
+ -1, 35, -1, 37, -1, -1, -1, 41, 42, 43,
+ 44, -1, -1, -1, -1, -1, -1, -1, 52, -1,
+ 54, -1, -1, -1, -1, -1, -1, -1, 62, 63,
-1, 65, -1, -1, -1, -1, -1, -1, 72, -1,
-1, -1, -1, -1, -1, 79, 80, 81, 82, 83,
- -1, -1, 86, 87, 88, 89, -1, -1, -1, -1,
- -1, -1, 96, 97, -1, -1, -1, 101, 102, 12,
+ -1, -1, -1, 87, -1, 89, -1, -1, -1, -1,
+ -1, -1, 96, 97, -1, -1, -1, -1, 102, 12,
104, -1, 15, 16, 17, -1, 19, 20, 21, 22,
23, -1, 25, 26, 27, -1, 29, 30, 31, -1,
- 33, -1, 35, 36, 37, -1, -1, -1, 41, 42,
- 43, 44, -1, -1, 47, -1, -1, -1, -1, 52,
- 53, 54, -1, -1, 57, -1, -1, -1, 61, 62,
+ 33, -1, 35, -1, 37, -1, -1, -1, 41, 42,
+ 43, -1, -1, -1, -1, -1, -1, -1, -1, 52,
+ -1, 54, -1, -1, -1, -1, -1, -1, -1, 62,
63, -1, 65, -1, -1, -1, -1, -1, -1, 72,
-1, -1, -1, -1, -1, -1, 79, 80, 81, 82,
- 83, -1, -1, 86, 87, 88, 89, -1, -1, -1,
- -1, -1, -1, 96, 97, -1, -1, -1, -1, 102,
- 12, 104, -1, 15, 16, 17, -1, 19, 20, 21,
- 22, 23, -1, 25, 26, 27, -1, 29, 30, 31,
- -1, 33, 34, 35, -1, 37, -1, -1, -1, 41,
- 42, 43, 44, -1, -1, -1, -1, -1, -1, -1,
- 52, 53, 54, -1, -1, 57, -1, -1, -1, -1,
- 62, 63, -1, 65, -1, -1, -1, -1, -1, -1,
- 72, -1, -1, -1, -1, -1, -1, 79, 80, 81,
- 82, 83, -1, -1, 86, 87, -1, 89, -1, -1,
- -1, -1, -1, -1, 96, 97, -1, -1, -1, 101,
- 102, 12, 104, -1, 15, 16, 17, -1, 19, 20,
- 21, 22, 23, -1, 25, 26, 27, -1, 29, 30,
- 31, -1, 33, -1, 35, -1, 37, -1, -1, -1,
- 41, 42, 43, 44, -1, -1, -1, -1, -1, -1,
- -1, 52, 53, 54, -1, -1, 57, -1, -1, -1,
- -1, 62, 63, -1, 65, -1, -1, -1, -1, -1,
- -1, 72, -1, -1, -1, -1, -1, -1, 79, 80,
- 81, 82, 83, -1, -1, 86, 87, -1, 89, -1,
- -1, -1, -1, -1, -1, 96, 97, -1, -1, -1,
- 101, 102, 12, 104, -1, 15, 16, 17, -1, 19,
- 20, 21, 22, 23, -1, 25, 26, 27, -1, 29,
- 30, 31, -1, 33, -1, 35, -1, 37, -1, -1,
- -1, 41, 42, 43, 44, -1, -1, -1, -1, -1,
- -1, -1, 52, -1, 54, -1, -1, -1, -1, -1,
- -1, -1, 62, 63, -1, 65, -1, -1, -1, -1,
- -1, -1, 72, -1, -1, -1, -1, -1, -1, 79,
- 80, 81, 82, 83, -1, -1, -1, 87, -1, 89,
- -1, -1, -1, -1, -1, -1, 96, 97, -1, -1,
- -1, -1, 102, 12, 104, -1, 15, 16, 17, -1,
- 19, 20, 21, 22, 23, -1, 25, 26, 27, -1,
- 29, 30, 31, -1, 33, -1, 35, -1, 37, -1,
- -1, -1, 41, 42, 43, -1, -1, -1, -1, -1,
- -1, -1, -1, 52, -1, 54, -1, -1, -1, -1,
- -1, -1, -1, 62, 63, -1, 65, -1, -1, -1,
- -1, -1, -1, 72, -1, -1, -1, -1, -1, -1,
- 79, 80, 81, 82, 83, -1, -1, -1, 87, -1,
- 89, -1, -1, -1, -1, -1, 12, 96, 97, 15,
- 16, 17, -1, 102, -1, 104, -1, -1, -1, 25,
- 26, 27, -1, 29, 30, 31, -1, 33, -1, -1,
- -1, 37, -1, -1, -1, -1, -1, -1, -1, -1,
- 46, -1, 48, 49, 50, 51, 52, -1, 54, -1,
+ 83, -1, -1, -1, 87, -1, 89, -1, -1, -1,
+ -1, -1, 12, 96, 97, 15, 16, 17, -1, 102,
+ -1, 104, -1, -1, -1, 25, 26, 27, -1, 29,
+ 30, 31, -1, 33, -1, -1, -1, 37, -1, -1,
+ -1, -1, -1, -1, -1, -1, 46, -1, 48, 49,
+ 50, 51, 52, -1, 54, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 72, 12, -1, -1,
- 15, 16, 17, 79, 80, 81, 82, 83, -1, -1,
- 25, 26, 27, 89, 29, 30, 31, -1, 33, -1,
- 96, 97, 37, -1, -1, -1, 102, -1, 104, -1,
- -1, -1, -1, 48, -1, 50, -1, 52, -1, 54,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 64,
- -1, -1, -1, -1, -1, -1, -1, 72, 12, -1,
- -1, 15, 16, 17, 79, 80, 81, 82, 83, -1,
- -1, 25, 26, 27, 89, 29, 30, 31, -1, 33,
- -1, 96, 97, 37, -1, -1, -1, 102, -1, 104,
- -1, 12, -1, -1, 15, 16, 17, -1, 52, -1,
- 54, -1, -1, -1, 25, 26, 27, -1, 29, 30,
- 31, -1, 33, -1, -1, -1, 37, -1, 72, -1,
- -1, -1, -1, -1, -1, 79, 80, 81, 82, 83,
- -1, 52, -1, 54, -1, 89, -1, -1, -1, -1,
- -1, -1, 96, 97, -1, -1, -1, -1, 102, -1,
- 104, 72, -1, -1, -1, -1, -1, -1, 79, 80,
- 81, 82, 83, 45, -1, -1, -1, -1, 89, -1,
- -1, -1, -1, -1, -1, 96, 97, -1, -1, -1,
- 48, 102, 50, 104, 66, 67, 68, 69, 70, 71,
- -1, 73, 74, 75, 76, 77, 78, -1, 66, 67,
- 68, 69, 70, 71, -1, 73, -1, -1, 76, 77,
- 78, 93, 94, 95, 96, 97, 98, 99, 50, -1,
- -1, -1, -1, -1, 56, 93, 94, 95, 96, 97,
- 98, 99, -1, -1, 66, 67, 68, 69, 70, 71,
+ -1, -1, 72, 12, -1, -1, 15, 16, 17, 79,
+ 80, 81, 82, 83, -1, -1, 25, 26, 27, 89,
+ 29, 30, 31, -1, 33, -1, 96, 97, 37, -1,
+ -1, -1, 102, -1, 104, -1, -1, -1, -1, 48,
+ -1, 50, -1, 52, -1, 54, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 64, -1, -1, -1, -1,
+ -1, -1, -1, 72, 12, -1, -1, 15, 16, 17,
+ 79, 80, 81, 82, 83, -1, -1, 25, 26, 27,
+ 89, 29, 30, 31, -1, 33, -1, 96, 97, 37,
+ -1, -1, -1, 102, -1, 104, -1, 12, -1, -1,
+ 15, 16, 17, -1, 52, -1, 54, -1, -1, -1,
+ 25, 26, 27, -1, 29, 30, 31, -1, 33, -1,
+ -1, -1, 37, -1, 72, -1, -1, -1, -1, -1,
+ -1, 79, 80, 81, 82, 83, -1, 52, -1, 54,
+ -1, 89, -1, -1, -1, -1, -1, -1, 96, 97,
+ -1, -1, -1, -1, 102, -1, 104, 72, -1, -1,
+ -1, -1, -1, -1, 79, 80, 81, 82, 83, 45,
+ -1, -1, -1, -1, 89, -1, -1, -1, -1, -1,
+ -1, 96, 97, -1, -1, -1, 48, 102, 50, 104,
+ 66, 67, 68, 69, 70, 71, -1, 73, 74, 75,
+ 76, 77, 78, -1, 66, 67, 68, 69, 70, 71,
+ -1, 73, -1, -1, 76, 77, 78, 93, 94, 95,
+ 96, 97, 98, 99, 50, -1, -1, -1, -1, -1,
+ 56, 93, 94, 95, 96, 97, 98, 99, -1, -1,
+ 66, 67, 68, 69, 70, 71, -1, 73, -1, -1,
+ 76, 77, 78, -1, -1, -1, -1, -1, 50, -1,
+ -1, -1, -1, -1, 56, -1, -1, 93, 94, 95,
+ 96, 97, 98, 99, 66, 67, 68, 69, 70, 71,
-1, 73, -1, -1, 76, 77, 78, -1, -1, -1,
-1, -1, 50, -1, -1, -1, -1, -1, 56, -1,
-1, 93, 94, 95, 96, 97, 98, 99, 66, 67,
@@ -1220,7 +1219,7 @@ static const yytype_int16 yycheck[] =
-1, -1, 56, -1, -1, 93, 94, 95, 96, 97,
98, 99, 66, 67, 68, 69, 70, 71, -1, 73,
-1, -1, 76, 77, 78, -1, -1, -1, -1, -1,
- 50, -1, -1, -1, -1, -1, 56, -1, -1, 93,
+ 50, -1, -1, -1, -1, -1, -1, -1, -1, 93,
94, 95, 96, 97, 98, 99, 66, 67, 68, 69,
70, 71, -1, 73, -1, -1, 76, 77, 78, -1,
-1, -1, -1, -1, 50, -1, -1, -1, -1, -1,
@@ -1233,19 +1232,12 @@ static const yytype_int16 yycheck[] =
-1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
-1, 93, 94, 95, 96, 97, 98, 99, 66, 67,
68, 69, 70, 71, -1, 73, -1, -1, 76, 77,
- 78, -1, -1, -1, -1, -1, 50, -1, -1, -1,
- -1, -1, -1, -1, -1, 93, 94, 95, 96, 97,
- 98, 99, 66, 67, 68, 69, 70, 71, -1, 73,
- -1, -1, 76, 77, 78, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 56, -1, -1, 93,
- 94, 95, 96, 97, 98, 99, 66, 67, 68, 69,
- 70, 71, -1, 73, -1, -1, 76, 77, 78, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 56, 93, 94, 95, 96, 97, 98, 99,
- -1, 101, 66, 67, 68, 69, 70, 71, 58, 73,
+ 78, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 56, -1, -1, 93, 94, 95, 96, 97,
+ 98, 99, 66, 67, 68, 69, 70, 71, 58, 73,
-1, -1, 76, 77, 78, -1, 66, 67, 68, 69,
70, 71, -1, 73, -1, -1, 76, 77, 78, 93,
- 94, 95, 96, 97, 98, 99, -1, -1, -1, -1,
+ 94, 95, 96, 97, 98, 99, -1, 101, -1, -1,
-1, -1, -1, 93, 94, 95, 96, 97, 98, 99,
66, 67, 68, 69, 70, 71, -1, 73, -1, -1,
76, 77, 78, -1, -1, -1, -1, -1, -1, -1,
@@ -1272,7 +1264,7 @@ static const yytype_uint8 yystos[] =
86, 87, 88, 89, 96, 97, 102, 104, 108, 109,
110, 111, 113, 114, 118, 119, 120, 125, 126, 127,
128, 129, 130, 134, 136, 138, 141, 145, 101, 30,
- 52, 128, 128, 128, 128, 146, 30, 128, 146, 30,
+ 127, 30, 52, 128, 128, 128, 146, 30, 128, 146,
127, 102, 128, 147, 137, 140, 53, 30, 131, 46,
48, 49, 50, 51, 128, 135, 30, 128, 58, 59,
15, 16, 30, 37, 30, 30, 128, 64, 128, 135,
@@ -1282,24 +1274,24 @@ static const yytype_uint8 yystos[] =
68, 69, 70, 71, 73, 76, 77, 78, 93, 94,
95, 96, 97, 98, 99, 122, 102, 128, 106, 146,
128, 146, 106, 146, 122, 106, 128, 48, 135, 139,
- 45, 74, 75, 30, 56, 68, 127, 128, 56, 68,
- 56, 55, 58, 135, 106, 50, 56, 50, 56, 50,
- 56, 50, 56, 84, 85, 106, 30, 103, 105, 109,
- 123, 128, 123, 123, 128, 56, 101, 128, 128, 128,
+ 45, 74, 75, 30, 56, 68, 127, 56, 68, 56,
+ 55, 58, 135, 106, 50, 56, 50, 56, 50, 56,
+ 50, 56, 84, 85, 106, 30, 103, 105, 109, 123,
+ 128, 123, 123, 128, 56, 101, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 30, 142, 128, 103, 128, 142,
- 30, 128, 122, 30, 129, 128, 128, 128, 128, 68,
- 56, 128, 128, 128, 128, 30, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 30, 103, 106, 124,
- 123, 55, 123, 128, 124, 101, 106, 101, 142, 128,
- 128, 50, 50, 50, 50, 146, 101, 113, 123, 38,
- 56, 124, 55, 123, 106, 144, 30, 144, 101, 128,
- 128, 128, 128, 103, 91, 56, 128, 123, 111, 92,
- 30, 124, 124, 144, 128, 123, 40, 115, 116, 121,
- 123, 34, 124, 123, 124, 39, 123, 115, 128, 39,
- 90, 30, 143, 124, 123, 122, 90, 123, 122, 106,
- 123, 91, 124, 55, 111, 30, 91, 123, 124, 123,
- 90, 123, 90
+ 128, 128, 128, 30, 142, 128, 103, 128, 142, 30,
+ 128, 122, 30, 129, 128, 128, 128, 128, 56, 68,
+ 128, 128, 128, 128, 30, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 30, 103, 106, 124, 123,
+ 55, 123, 128, 124, 101, 106, 101, 142, 128, 128,
+ 50, 50, 50, 50, 146, 101, 113, 123, 38, 56,
+ 124, 55, 123, 106, 144, 30, 144, 101, 128, 128,
+ 128, 128, 103, 91, 56, 128, 123, 111, 92, 30,
+ 124, 124, 144, 128, 123, 40, 115, 116, 121, 123,
+ 34, 124, 123, 124, 39, 123, 115, 128, 39, 90,
+ 30, 143, 124, 123, 122, 90, 123, 122, 106, 123,
+ 91, 124, 55, 111, 30, 91, 123, 124, 123, 90,
+ 123, 90
};
#define yyerrok (yyerrstatus = 0)
@@ -2985,7 +2977,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
-#line 2989 "engines/director/lingo/lingo-gr.cpp"
+#line 2981 "engines/director/lingo/lingo-gr.cpp"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y
index a818cf41fe..668c52f178 100644
--- a/engines/director/lingo/lingo-gr.y
+++ b/engines/director/lingo/lingo-gr.y
@@ -176,7 +176,7 @@ asgn: tPUT expr tINTO ID {
g_lingo->codeInt($2[0]);
g_lingo->codeInt($2[1]);
$$ = $4; }
- | tSET THEENTITYWITHID expr tTO expr {
+ | tSET THEENTITYWITHID simpleexpr tTO expr {
g_lingo->code1(LC::c_swap);
g_lingo->code1(LC::c_theentityassign);
g_lingo->codeInt($2[0]);
@@ -405,7 +405,7 @@ expr: simpleexpr { $$ = $1; }
WRITE_UINT32(&e, $1[0]);
WRITE_UINT32(&f, $1[1]);
g_lingo->code2(e, f); }
- | THEENTITYWITHID expr {
+ | THEENTITYWITHID simpleexpr {
$$ = g_lingo->code1(LC::c_theentitypush);
inst e = 0, f = 0;
WRITE_UINT32(&e, $1[0]);
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp
index b6f9e63e06..8c192ada77 100644
--- a/engines/director/lingo/lingo-lex.cpp
+++ b/engines/director/lingo/lingo-lex.cpp
@@ -364,8 +364,8 @@ static void yy_fatal_error (yyconst char msg[] );
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 76
-#define YY_END_OF_BUFFER 77
+#define YY_NUM_RULES 75
+#define YY_END_OF_BUFFER 76
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -373,43 +373,42 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[314] =
+static yyconst flex_int16_t yy_accept[307] =
{ 0,
- 0, 0, 77, 75, 4, 73, 73, 75, 75, 75,
- 72, 72, 72, 71, 72, 68, 72, 69, 69, 69,
- 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
- 69, 69, 69, 69, 75, 3, 3, 69, 4, 73,
- 0, 0, 0, 74, 5, 67, 2, 70, 71, 66,
- 64, 65, 69, 69, 69, 69, 69, 69, 69, 69,
- 69, 69, 69, 22, 13, 69, 69, 69, 69, 69,
- 69, 69, 69, 69, 35, 36, 69, 38, 69, 69,
- 69, 69, 69, 69, 69, 69, 69, 57, 69, 69,
- 69, 1, 3, 3, 0, 69, 5, 2, 70, 69,
-
- 7, 69, 69, 69, 69, 69, 69, 16, 69, 69,
- 0, 69, 69, 69, 69, 69, 69, 69, 31, 69,
- 69, 34, 69, 69, 69, 69, 44, 69, 46, 69,
- 69, 69, 69, 69, 69, 69, 69, 0, 69, 69,
- 69, 9, 69, 11, 12, 15, 0, 18, 69, 0,
- 69, 69, 25, 26, 27, 28, 69, 69, 69, 33,
- 37, 40, 69, 69, 69, 69, 69, 48, 0, 56,
- 61, 69, 59, 63, 0, 69, 6, 69, 69, 0,
- 16, 69, 21, 69, 69, 29, 69, 32, 0, 69,
- 69, 69, 69, 69, 69, 55, 55, 55, 55, 55,
-
- 62, 69, 0, 69, 8, 69, 0, 16, 19, 0,
- 69, 69, 69, 0, 69, 69, 69, 45, 58, 47,
- 0, 0, 55, 55, 55, 55, 60, 0, 69, 69,
- 14, 0, 69, 69, 0, 30, 0, 69, 69, 69,
- 0, 0, 0, 0, 55, 55, 55, 55, 0, 17,
- 10, 0, 23, 69, 30, 30, 0, 69, 42, 43,
- 0, 0, 0, 55, 55, 55, 55, 17, 0, 69,
- 30, 0, 41, 0, 0, 0, 0, 55, 0, 55,
- 0, 24, 39, 54, 53, 54, 0, 0, 55, 0,
- 0, 0, 20, 53, 0, 0, 0, 0, 0, 49,
-
- 0, 0, 50, 51, 0, 51, 0, 53, 0, 53,
- 0, 52, 0
+ 0, 0, 76, 74, 4, 72, 72, 74, 74, 74,
+ 71, 71, 71, 70, 71, 67, 71, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 74, 3, 3, 68, 4, 72,
+ 0, 0, 0, 73, 5, 66, 2, 69, 70, 65,
+ 63, 64, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 22, 13, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 35, 36, 68, 38, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 56, 68, 68,
+ 68, 1, 3, 3, 0, 68, 5, 2, 69, 68,
+
+ 7, 68, 68, 68, 68, 68, 68, 16, 68, 68,
+ 0, 68, 68, 68, 68, 68, 68, 68, 31, 68,
+ 68, 34, 68, 68, 68, 68, 44, 68, 46, 68,
+ 68, 68, 68, 68, 68, 68, 68, 0, 68, 68,
+ 68, 9, 68, 11, 12, 15, 0, 18, 68, 0,
+ 68, 68, 25, 26, 27, 28, 68, 68, 68, 33,
+ 37, 40, 68, 68, 68, 68, 68, 48, 0, 55,
+ 60, 68, 58, 62, 0, 68, 6, 68, 68, 0,
+ 16, 68, 21, 68, 68, 29, 68, 32, 0, 68,
+ 68, 68, 68, 68, 68, 54, 54, 54, 54, 61,
+
+ 68, 0, 68, 8, 68, 0, 16, 19, 0, 68,
+ 68, 68, 0, 68, 68, 68, 45, 57, 47, 0,
+ 0, 54, 54, 54, 59, 0, 68, 68, 14, 0,
+ 68, 68, 0, 30, 0, 68, 68, 68, 0, 0,
+ 0, 0, 54, 54, 54, 0, 17, 10, 0, 23,
+ 68, 30, 30, 0, 68, 42, 43, 0, 0, 0,
+ 54, 54, 54, 17, 0, 68, 30, 0, 41, 0,
+ 0, 0, 54, 0, 54, 0, 24, 39, 53, 52,
+ 53, 54, 0, 0, 0, 20, 52, 0, 0, 0,
+ 0, 0, 0, 49, 50, 0, 50, 0, 52, 0,
+
+ 52, 0, 0, 51, 51, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -455,18 +454,18 @@ static yyconst flex_int32_t yy_meta[66] =
5, 5, 5, 5, 1
} ;
-static yyconst flex_int16_t yy_base[330] =
+static yyconst flex_int16_t yy_base[323] =
{ 0,
- 0, 64, 436, 834, 68, 834, 834, 72, 428, 0,
- 834, 406, 390, 55, 63, 834, 365, 59, 59, 59,
+ 0, 64, 485, 800, 68, 800, 800, 72, 474, 0,
+ 800, 427, 419, 55, 63, 800, 365, 59, 59, 59,
55, 63, 0, 64, 75, 70, 100, 77, 110, 102,
- 98, 129, 128, 131, 83, 166, 187, 293, 191, 834,
- 195, 144, 320, 834, 0, 834, 0, 305, 160, 834,
- 834, 834, 0, 66, 131, 156, 162, 74, 173, 149,
+ 98, 129, 128, 131, 83, 166, 187, 293, 191, 800,
+ 195, 144, 320, 800, 0, 800, 0, 305, 160, 800,
+ 800, 800, 0, 66, 131, 156, 162, 74, 173, 149,
167, 180, 156, 91, 0, 174, 193, 172, 186, 198,
184, 200, 183, 188, 0, 0, 203, 0, 211, 208,
192, 210, 209, 215, 233, 228, 236, 0, 238, 231,
- 234, 834, 290, 294, 271, 225, 0, 0, 223, 237,
+ 234, 800, 290, 294, 271, 225, 0, 0, 223, 237,
0, 246, 244, 243, 243, 251, 260, 213, 250, 268,
268, 270, 286, 282, 266, 283, 282, 284, 0, 292,
@@ -474,68 +473,68 @@ static yyconst flex_int16_t yy_base[330] =
295, 303, 346, 307, 326, 307, 337, 177, 147, 328,
329, 0, 341, 0, 0, 269, 361, 0, 347, 337,
348, 335, 0, 0, 0, 0, 339, 340, 350, 0,
- 0, 371, 347, 357, 362, 339, 346, 0, 412, 0,
- 0, 363, 362, 0, 107, 91, 0, 374, 375, 405,
- 0, 375, 406, 387, 384, 0, 386, 0, 422, 403,
- 389, 388, 393, 402, 395, 449, 462, 456, 466, 472,
-
- 0, 403, 86, 79, 0, 404, 413, 0, 0, 473,
- 418, 459, 481, 451, 462, 449, 452, 0, 0, 0,
- 495, 468, 497, 491, 519, 531, 0, 42, 20, 476,
- 834, 485, 491, 504, 530, 0, 509, 507, 504, 499,
- 542, 528, 524, 525, 554, 555, 564, 575, 18, 0,
- 0, 544, 0, 532, 0, 0, 540, 551, 0, 0,
- 544, 579, 555, 585, 595, 599, 610, 834, 565, 560,
- 0, 587, 0, 593, 617, 600, 622, 627, 623, 645,
- 605, 0, 834, 834, 0, 834, 643, 612, 659, 660,
- 616, 673, 834, 0, 669, 681, 683, 687, 632, 689,
-
- 693, 658, 694, 702, 704, 708, 710, 717, 675, 726,
- 577, 834, 834, 767, 769, 772, 775, 781, 786, 791,
- 793, 798, 803, 806, 809, 814, 817, 822, 827
+ 0, 371, 347, 357, 362, 339, 346, 0, 382, 0,
+ 0, 374, 375, 0, 107, 91, 0, 380, 377, 404,
+ 0, 380, 410, 379, 376, 0, 394, 0, 416, 398,
+ 392, 390, 389, 407, 399, 439, 450, 456, 454, 0,
+
+ 416, 86, 79, 0, 421, 415, 0, 0, 468, 432,
+ 446, 470, 432, 449, 441, 443, 0, 0, 0, 479,
+ 459, 493, 495, 515, 0, 42, 20, 448, 800, 454,
+ 470, 488, 517, 0, 506, 505, 479, 489, 525, 514,
+ 512, 510, 539, 559, 560, 18, 0, 0, 526, 0,
+ 504, 0, 0, 519, 523, 0, 0, 519, 570, 539,
+ 571, 575, 585, 800, 555, 550, 0, 565, 0, 567,
+ 595, 568, 599, 610, 600, 577, 0, 800, 800, 0,
+ 800, 614, 620, 581, 631, 800, 0, 632, 624, 633,
+ 599, 642, 621, 637, 652, 668, 673, 677, 679, 658,
+
+ 692, 612, 667, 800, 800, 800, 733, 735, 738, 741,
+ 747, 752, 757, 759, 764, 769, 772, 775, 780, 783,
+ 788, 793
} ;
-static yyconst flex_int16_t yy_def[330] =
+static yyconst flex_int16_t yy_def[323] =
{ 0,
- 313, 1, 313, 313, 313, 313, 313, 313, 314, 315,
- 313, 313, 313, 313, 313, 313, 313, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 313, 313, 313, 316, 313, 313,
- 313, 313, 314, 313, 317, 313, 318, 313, 313, 313,
- 313, 313, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 313, 313, 313, 313, 316, 317, 318, 313, 316,
-
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 313, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 313, 316, 316,
- 316, 316, 316, 316, 316, 316, 319, 316, 316, 313,
- 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
- 316, 316, 316, 316, 316, 316, 316, 316, 320, 316,
- 316, 316, 316, 316, 313, 316, 316, 316, 316, 313,
- 321, 316, 313, 316, 316, 316, 316, 316, 313, 316,
- 316, 316, 316, 316, 316, 320, 320, 320, 320, 320,
-
- 316, 316, 313, 316, 316, 316, 313, 321, 316, 313,
- 316, 316, 322, 313, 316, 316, 316, 316, 316, 316,
- 313, 313, 320, 320, 320, 320, 316, 313, 316, 316,
- 313, 313, 316, 316, 323, 324, 313, 316, 316, 316,
- 313, 313, 313, 313, 320, 320, 320, 320, 313, 316,
- 316, 313, 316, 316, 325, 324, 313, 316, 316, 316,
- 313, 313, 313, 320, 320, 320, 320, 313, 313, 316,
- 325, 313, 316, 313, 326, 313, 313, 320, 313, 320,
- 313, 316, 313, 313, 327, 313, 313, 313, 320, 313,
- 313, 313, 313, 327, 313, 313, 313, 313, 313, 326,
-
- 313, 313, 326, 313, 313, 326, 328, 329, 313, 329,
- 313, 313, 0, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313
+ 306, 1, 306, 306, 306, 306, 306, 306, 307, 308,
+ 306, 306, 306, 306, 306, 306, 306, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 306, 306, 306, 309, 306, 306,
+ 306, 306, 307, 306, 310, 306, 311, 306, 306, 306,
+ 306, 306, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 306, 306, 306, 306, 309, 310, 311, 306, 309,
+
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 306, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 306, 309, 309,
+ 309, 309, 309, 309, 309, 309, 312, 309, 309, 306,
+ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 313, 309,
+ 309, 309, 309, 309, 306, 309, 309, 309, 309, 306,
+ 314, 309, 306, 309, 309, 309, 309, 309, 306, 309,
+ 309, 309, 309, 309, 309, 313, 313, 313, 313, 309,
+
+ 309, 306, 309, 309, 309, 306, 314, 309, 306, 309,
+ 309, 315, 306, 309, 309, 309, 309, 309, 309, 306,
+ 306, 313, 313, 313, 309, 306, 309, 309, 306, 306,
+ 309, 309, 316, 317, 306, 309, 309, 309, 306, 306,
+ 306, 306, 313, 313, 313, 306, 309, 309, 306, 309,
+ 309, 318, 317, 306, 309, 309, 309, 306, 306, 306,
+ 313, 313, 313, 306, 306, 309, 318, 306, 309, 306,
+ 319, 306, 313, 306, 313, 306, 309, 306, 306, 320,
+ 306, 313, 306, 306, 306, 306, 320, 306, 306, 306,
+ 306, 306, 306, 319, 306, 306, 319, 321, 322, 306,
+
+ 322, 306, 306, 306, 306, 0, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306
} ;
-static yyconst flex_int16_t yy_nxt[900] =
+static yyconst flex_int16_t yy_nxt[866] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 11,
13, 4, 14, 15, 16, 17, 18, 19, 20, 21,
@@ -545,16 +544,16 @@ static yyconst flex_int16_t yy_nxt[900] =
26, 27, 28, 29, 30, 23, 31, 32, 33, 23,
23, 34, 23, 23, 35, 36, 48, 49, 37, 39,
40, 40, 41, 41, 40, 40, 41, 50, 51, 56,
- 54, 268, 57, 250, 59, 92, 92, 55, 58, 60,
- 63, 61, 111, 64, 68, 111, 65, 73, 249, 69,
+ 54, 264, 57, 247, 59, 92, 92, 55, 58, 60,
+ 63, 61, 111, 64, 68, 111, 65, 73, 246, 69,
100, 62, 104, 66, 56, 54, 74, 57, 59, 67,
38, 55, 58, 60, 63, 61, 70, 64, 82, 68,
71, 65, 73, 69, 100, 62, 104, 66, 79, 72,
- 74, 75, 42, 67, 80, 229, 42, 81, 76, 228,
- 77, 70, 78, 82, 204, 71, 92, 92, 86, 83,
+ 74, 75, 42, 67, 80, 227, 42, 81, 76, 226,
+ 77, 70, 78, 82, 203, 71, 92, 92, 86, 83,
101, 87, 79, 72, 89, 90, 75, 88, 80, 84,
- 91, 81, 76, 85, 77, 203, 78, 93, 40, 40,
+ 91, 81, 76, 85, 77, 202, 78, 93, 40, 40,
94, 48, 49, 86, 83, 101, 87, 102, 103, 89,
90, 88, 107, 84, 91, 110, 108, 85, 94, 40,
40, 94, 39, 40, 40, 41, 41, 40, 40, 41,
@@ -578,67 +577,63 @@ static yyconst flex_int16_t yy_nxt[900] =
169, 167, 172, 168, 42, 173, 174, 179, 42, 171,
177, 178, 147, 182, 184, 147, 183, 185, 186, 187,
188, 191, 189, 194, 170, 189, 172, 192, 193, 52,
- 195, 174, 179, 201, 177, 178, 202, 190, 182, 184,
- 183, 185, 186, 187, 205, 188, 191, 194, 170, 206,
-
- 47, 209, 192, 193, 195, 213, 180, 210, 201, 180,
- 210, 202, 190, 169, 46, 211, 169, 212, 216, 205,
- 217, 215, 219, 189, 206, 209, 189, 218, 220, 207,
- 213, 227, 230, 44, 231, 313, 233, 313, 197, 211,
- 198, 212, 216, 214, 217, 199, 215, 219, 200, 313,
- 221, 218, 220, 221, 207, 227, 230, 221, 222, 231,
- 221, 233, 197, 221, 198, 222, 221, 221, 214, 199,
- 221, 222, 200, 221, 210, 222, 221, 210, 223, 234,
- 238, 222, 235, 237, 239, 235, 240, 242, 226, 313,
- 313, 224, 221, 53, 232, 221, 241, 225, 221, 241,
-
- 222, 221, 244, 223, 234, 238, 222, 237, 239, 251,
- 240, 253, 242, 226, 242, 224, 313, 252, 246, 232,
- 221, 225, 254, 221, 243, 257, 244, 258, 222, 244,
- 245, 235, 221, 251, 235, 221, 253, 259, 260, 242,
- 222, 252, 246, 241, 261, 262, 241, 254, 243, 263,
- 257, 247, 258, 244, 245, 221, 221, 248, 221, 221,
- 269, 259, 260, 222, 222, 221, 270, 272, 221, 261,
- 262, 243, 265, 222, 263, 247, 221, 273, 274, 221,
- 275, 248, 276, 275, 222, 269, 277, 313, 264, 277,
- 270, 272, 281, 282, 222, 243, 221, 265, 266, 221,
-
- 279, 273, 274, 279, 222, 312, 276, 283, 222, 313,
- 267, 221, 264, 284, 221, 278, 281, 282, 275, 222,
- 286, 275, 266, 287, 290, 293, 287, 290, 221, 312,
- 280, 221, 283, 295, 267, 313, 222, 297, 284, 313,
- 278, 242, 242, 313, 287, 286, 292, 287, 313, 292,
- 293, 288, 291, 304, 222, 280, 244, 244, 295, 289,
- 296, 290, 297, 296, 290, 313, 242, 242, 222, 313,
- 300, 313, 288, 300, 298, 288, 291, 298, 304, 305,
- 244, 244, 301, 289, 303, 301, 313, 303, 298, 291,
- 300, 298, 242, 300, 301, 303, 288, 301, 303, 311,
-
- 242, 313, 299, 306, 305, 307, 306, 244, 307, 306,
- 302, 307, 306, 291, 307, 244, 299, 242, 309, 313,
- 313, 309, 302, 313, 311, 242, 299, 309, 313, 294,
- 309, 244, 313, 313, 302, 313, 313, 313, 294, 244,
- 299, 313, 313, 313, 313, 313, 302, 313, 313, 313,
- 285, 313, 313, 313, 313, 313, 313, 294, 313, 313,
- 313, 313, 313, 313, 313, 313, 294, 43, 43, 313,
- 43, 43, 43, 45, 45, 53, 53, 53, 97, 97,
- 97, 98, 98, 313, 98, 98, 98, 181, 313, 313,
- 181, 181, 196, 313, 313, 196, 208, 208, 208, 236,
-
- 313, 236, 236, 236, 255, 313, 313, 255, 255, 256,
- 256, 256, 271, 271, 271, 285, 313, 313, 285, 285,
- 294, 294, 294, 308, 313, 313, 308, 308, 310, 313,
- 310, 310, 310, 3, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313
-
+ 195, 174, 179, 169, 177, 178, 169, 190, 182, 184,
+ 183, 185, 186, 187, 200, 188, 191, 194, 170, 201,
+
+ 204, 205, 192, 193, 195, 180, 208, 210, 180, 211,
+ 197, 209, 190, 212, 209, 198, 214, 189, 199, 200,
+ 189, 215, 216, 217, 201, 204, 205, 218, 206, 47,
+ 208, 210, 219, 211, 197, 46, 229, 213, 212, 198,
+ 220, 214, 199, 220, 225, 215, 216, 217, 221, 228,
+ 231, 220, 218, 206, 220, 220, 219, 220, 220, 221,
+ 220, 229, 213, 221, 235, 221, 232, 236, 225, 209,
+ 224, 233, 209, 228, 233, 231, 237, 238, 240, 44,
+ 239, 248, 53, 239, 306, 222, 249, 223, 235, 230,
+ 250, 232, 236, 242, 220, 224, 220, 220, 240, 220,
+
+ 237, 238, 221, 240, 221, 248, 251, 306, 241, 222,
+ 249, 223, 256, 242, 230, 250, 220, 242, 233, 220,
+ 243, 233, 254, 240, 221, 255, 239, 244, 257, 239,
+ 258, 251, 241, 259, 260, 306, 256, 242, 266, 306,
+ 220, 245, 265, 220, 243, 306, 268, 254, 221, 269,
+ 255, 244, 257, 270, 241, 258, 261, 306, 259, 260,
+ 220, 220, 266, 220, 220, 245, 272, 265, 221, 221,
+ 268, 271, 220, 269, 271, 220, 274, 270, 241, 274,
+ 221, 261, 276, 277, 221, 278, 220, 279, 281, 220,
+ 272, 273, 306, 262, 221, 263, 271, 286, 306, 271,
+
+ 220, 285, 289, 220, 285, 275, 276, 277, 221, 221,
+ 278, 283, 279, 281, 283, 288, 273, 262, 288, 263,
+ 295, 283, 286, 221, 283, 294, 306, 289, 294, 240,
+ 275, 282, 290, 292, 290, 290, 292, 290, 294, 284,
+ 304, 294, 296, 292, 242, 295, 292, 306, 306, 284,
+ 240, 240, 306, 297, 240, 282, 297, 306, 306, 306,
+ 291, 293, 291, 284, 304, 242, 242, 296, 242, 298,
+ 306, 293, 298, 284, 297, 240, 240, 297, 298, 306,
+ 300, 298, 302, 300, 291, 293, 291, 303, 305, 242,
+ 242, 287, 306, 300, 306, 293, 300, 306, 306, 306,
+
+ 306, 306, 306, 306, 287, 306, 306, 302, 306, 306,
+ 306, 303, 306, 305, 306, 306, 306, 280, 306, 287,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 287, 43, 43, 306, 43, 43, 43, 45,
+ 45, 53, 53, 53, 97, 97, 97, 98, 98, 306,
+ 98, 98, 98, 181, 306, 306, 181, 181, 196, 306,
+ 306, 196, 207, 207, 207, 234, 306, 234, 234, 234,
+ 252, 306, 306, 252, 252, 253, 253, 253, 267, 267,
+ 267, 280, 306, 306, 280, 280, 287, 287, 287, 299,
+ 306, 306, 299, 299, 301, 306, 301, 301, 301, 3,
+
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306
} ;
-static yyconst flex_int16_t yy_chk[900] =
+static yyconst flex_int16_t yy_chk[866] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -648,13 +643,13 @@ static yyconst flex_int16_t yy_chk[900] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 14, 14, 2, 5,
5, 5, 5, 8, 8, 8, 8, 15, 15, 19,
- 18, 249, 20, 229, 21, 35, 35, 18, 20, 22,
- 24, 22, 64, 24, 26, 64, 25, 28, 228, 26,
+ 18, 246, 20, 227, 21, 35, 35, 18, 20, 22,
+ 24, 22, 64, 24, 26, 64, 25, 28, 226, 26,
54, 22, 58, 25, 19, 18, 28, 20, 21, 25,
2, 18, 20, 22, 24, 22, 27, 24, 31, 26,
27, 25, 28, 26, 54, 22, 58, 25, 30, 27,
- 28, 29, 5, 25, 30, 204, 8, 30, 29, 203,
+ 28, 29, 5, 25, 30, 203, 8, 30, 29, 202,
29, 27, 29, 31, 176, 27, 42, 42, 33, 32,
55, 33, 30, 27, 34, 34, 29, 33, 30, 32,
34, 30, 29, 32, 29, 175, 29, 36, 36, 36,
@@ -681,64 +676,60 @@ static yyconst flex_int16_t yy_chk[900] =
133, 131, 135, 132, 93, 136, 137, 143, 94, 134,
140, 141, 147, 149, 151, 147, 150, 152, 157, 158,
159, 163, 162, 166, 133, 162, 135, 164, 165, 17,
- 167, 137, 143, 172, 140, 141, 173, 162, 149, 151,
- 150, 152, 157, 158, 178, 159, 163, 166, 133, 179,
-
- 13, 182, 164, 165, 167, 187, 180, 183, 172, 180,
- 183, 173, 162, 169, 12, 184, 169, 185, 191, 178,
- 192, 190, 194, 189, 179, 182, 189, 193, 195, 180,
- 187, 202, 206, 9, 207, 3, 211, 0, 169, 184,
- 169, 185, 191, 189, 192, 169, 190, 194, 169, 0,
- 196, 193, 195, 196, 180, 202, 206, 198, 196, 207,
- 198, 211, 169, 197, 169, 198, 197, 199, 189, 169,
- 199, 197, 169, 200, 210, 199, 200, 210, 197, 212,
- 215, 200, 213, 214, 216, 213, 217, 222, 200, 0,
- 0, 198, 224, 213, 210, 224, 221, 199, 223, 221,
-
- 224, 223, 222, 197, 212, 215, 223, 214, 216, 230,
- 217, 233, 222, 200, 221, 198, 0, 232, 224, 210,
- 225, 199, 234, 225, 221, 237, 222, 238, 225, 221,
- 223, 235, 226, 230, 235, 226, 233, 239, 240, 221,
- 226, 232, 224, 241, 242, 243, 241, 234, 221, 244,
- 237, 225, 238, 221, 223, 245, 246, 226, 245, 246,
- 252, 239, 240, 245, 246, 247, 254, 257, 247, 242,
- 243, 241, 246, 247, 244, 225, 248, 258, 261, 248,
- 262, 226, 263, 262, 248, 252, 264, 0, 245, 264,
- 254, 257, 269, 270, 264, 241, 265, 246, 247, 265,
-
- 266, 258, 261, 266, 265, 311, 263, 272, 266, 0,
- 248, 267, 245, 274, 267, 265, 269, 270, 275, 267,
- 276, 275, 247, 277, 279, 281, 277, 279, 278, 311,
- 267, 278, 272, 288, 248, 0, 278, 291, 274, 0,
- 265, 277, 279, 0, 287, 276, 280, 287, 0, 280,
- 281, 277, 279, 299, 280, 267, 277, 279, 288, 278,
- 289, 290, 291, 289, 290, 0, 277, 279, 289, 0,
- 295, 0, 287, 295, 292, 277, 279, 292, 299, 302,
- 277, 279, 296, 278, 297, 296, 0, 297, 298, 290,
- 300, 298, 292, 300, 301, 303, 287, 301, 303, 309,
-
- 296, 0, 292, 304, 302, 305, 304, 292, 305, 306,
- 296, 307, 306, 290, 307, 296, 298, 292, 308, 0,
- 0, 308, 301, 0, 309, 296, 292, 310, 0, 308,
- 310, 292, 0, 0, 296, 0, 0, 0, 310, 296,
- 298, 0, 0, 0, 0, 0, 301, 0, 0, 0,
- 307, 0, 0, 0, 0, 0, 0, 308, 0, 0,
- 0, 0, 0, 0, 0, 0, 310, 314, 314, 0,
- 314, 314, 314, 315, 315, 316, 316, 316, 317, 317,
- 317, 318, 318, 0, 318, 318, 318, 319, 0, 0,
- 319, 319, 320, 0, 0, 320, 321, 321, 321, 322,
-
- 0, 322, 322, 322, 323, 0, 0, 323, 323, 324,
- 324, 324, 325, 325, 325, 326, 0, 0, 326, 326,
- 327, 327, 327, 328, 0, 0, 328, 328, 329, 0,
- 329, 329, 329, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
- 313, 313, 313, 313, 313, 313, 313, 313, 313
-
+ 167, 137, 143, 169, 140, 141, 169, 162, 149, 151,
+ 150, 152, 157, 158, 172, 159, 163, 166, 133, 173,
+
+ 178, 179, 164, 165, 167, 180, 182, 184, 180, 185,
+ 169, 183, 162, 187, 183, 169, 190, 189, 169, 172,
+ 189, 191, 192, 193, 173, 178, 179, 194, 180, 13,
+ 182, 184, 195, 185, 169, 12, 206, 189, 187, 169,
+ 196, 190, 169, 196, 201, 191, 192, 193, 196, 205,
+ 210, 197, 194, 180, 197, 199, 195, 198, 199, 197,
+ 198, 206, 189, 199, 213, 198, 211, 214, 201, 209,
+ 199, 212, 209, 205, 212, 210, 215, 216, 221, 9,
+ 220, 228, 212, 220, 3, 197, 230, 198, 213, 209,
+ 231, 211, 214, 221, 222, 199, 223, 222, 220, 223,
+
+ 215, 216, 222, 221, 223, 228, 232, 0, 220, 197,
+ 230, 198, 237, 220, 209, 231, 224, 221, 233, 224,
+ 222, 233, 235, 220, 224, 236, 239, 223, 238, 239,
+ 240, 232, 220, 241, 242, 0, 237, 220, 251, 0,
+ 243, 224, 249, 243, 222, 0, 254, 235, 243, 255,
+ 236, 223, 238, 258, 239, 240, 243, 0, 241, 242,
+ 244, 245, 251, 244, 245, 224, 260, 249, 244, 245,
+ 254, 259, 261, 255, 259, 261, 262, 258, 239, 262,
+ 261, 243, 265, 266, 262, 268, 263, 270, 272, 263,
+ 260, 261, 0, 244, 263, 245, 271, 276, 0, 271,
+
+ 273, 275, 284, 273, 275, 263, 265, 266, 273, 275,
+ 268, 274, 270, 272, 274, 282, 261, 244, 282, 245,
+ 291, 283, 276, 282, 283, 289, 0, 284, 289, 274,
+ 263, 273, 285, 288, 290, 285, 288, 290, 294, 274,
+ 302, 294, 293, 292, 274, 291, 292, 0, 0, 283,
+ 285, 288, 0, 295, 274, 273, 295, 0, 0, 0,
+ 285, 288, 290, 274, 302, 285, 288, 293, 274, 296,
+ 0, 292, 296, 283, 297, 285, 288, 297, 298, 0,
+ 299, 298, 300, 299, 285, 288, 290, 300, 303, 285,
+ 288, 299, 0, 301, 0, 292, 301, 0, 0, 0,
+
+ 0, 0, 0, 0, 301, 0, 0, 300, 0, 0,
+ 0, 300, 0, 303, 0, 0, 0, 298, 0, 299,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 301, 307, 307, 0, 307, 307, 307, 308,
+ 308, 309, 309, 309, 310, 310, 310, 311, 311, 0,
+ 311, 311, 311, 312, 0, 0, 312, 312, 313, 0,
+ 0, 313, 314, 314, 314, 315, 0, 315, 315, 315,
+ 316, 0, 0, 316, 316, 317, 317, 317, 318, 318,
+ 318, 319, 0, 0, 319, 319, 320, 320, 320, 321,
+ 0, 0, 321, 321, 322, 0, 322, 322, 322, 306,
+
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
+ 306, 306, 306, 306, 306
} ;
static yy_state_type yy_last_accepting_state;
@@ -827,7 +818,7 @@ static int checkImmediate(int token) {
return token;
}
-#line 831 "engines/director/lingo/lingo-lex.cpp"
+#line 822 "engines/director/lingo/lingo-lex.cpp"
#define INITIAL 0
@@ -1013,7 +1004,7 @@ YY_DECL
#line 87 "engines/director/lingo/lingo-lex.l"
-#line 1017 "engines/director/lingo/lingo-lex.cpp"
+#line 1008 "engines/director/lingo/lingo-lex.cpp"
if ( !(yy_init) )
{
@@ -1067,13 +1058,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 314 )
+ if ( yy_current_state >= 307 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_current_state != 313 );
+ while ( yy_current_state != 306 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
@@ -1367,7 +1358,7 @@ YY_RULE_SETUP
{
count();
- yylval.e[0] = g_lingo->_theEntities["last"]->entity;
+ yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity;
yylval.e[1] = 0; // No field
return THEENTITYWITHID;
@@ -1379,26 +1370,14 @@ YY_RULE_SETUP
{
count();
- yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity;
- yylval.e[1] = 0; // No field
-
- return THEENTITYWITHID;
- }
- YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 182 "engines/director/lingo/lingo-lex.l"
-{
- count();
-
yylval.s = new Common::String("value");
return FBLTINONEARG;
}
YY_BREAK
-case 52:
+case 51:
YY_RULE_SETUP
-#line 189 "engines/director/lingo/lingo-lex.l"
+#line 181 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1423,9 +1402,9 @@ YY_RULE_SETUP
error("LEXER: Unhandled chunk expression '%s'", yylval.s->c_str());
}
YY_BREAK
-case 53:
+case 52:
YY_RULE_SETUP
-#line 212 "engines/director/lingo/lingo-lex.l"
+#line 204 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1480,9 +1459,9 @@ YY_RULE_SETUP
warning("LEXER: Unhandled the entity '%s', field '%s'", ptr, field.c_str());
}
YY_BREAK
-case 54:
+case 53:
YY_RULE_SETUP
-#line 265 "engines/director/lingo/lingo-lex.l"
+#line 257 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1515,9 +1494,9 @@ YY_RULE_SETUP
return THEENTITY;
}
YY_BREAK
-case 55:
+case 54:
YY_RULE_SETUP
-#line 296 "engines/director/lingo/lingo-lex.l"
+#line 288 "engines/director/lingo/lingo-lex.l"
{
count();
@@ -1538,74 +1517,74 @@ YY_RULE_SETUP
warning("LEXER: Unhandled the entity '%s'", ptr);
}
YY_BREAK
-case 56:
+case 55:
YY_RULE_SETUP
-#line 315 "engines/director/lingo/lingo-lex.l"
+#line 307 "engines/director/lingo/lingo-lex.l"
{ count(); return tTHEN; }
YY_BREAK
-case 57:
+case 56:
YY_RULE_SETUP
-#line 316 "engines/director/lingo/lingo-lex.l"
+#line 308 "engines/director/lingo/lingo-lex.l"
{ count(); return tTO; }
YY_BREAK
-case 58:
+case 57:
YY_RULE_SETUP
-#line 317 "engines/director/lingo/lingo-lex.l"
+#line 309 "engines/director/lingo/lingo-lex.l"
{ count(); return tSPRITE; }
YY_BREAK
-case 59:
+case 58:
YY_RULE_SETUP
-#line 318 "engines/director/lingo/lingo-lex.l"
+#line 310 "engines/director/lingo/lingo-lex.l"
{ count(); return tWITH; }
YY_BREAK
-case 60:
+case 59:
YY_RULE_SETUP
-#line 319 "engines/director/lingo/lingo-lex.l"
+#line 311 "engines/director/lingo/lingo-lex.l"
{ count(); return tWITHIN; }
YY_BREAK
-case 61:
+case 60:
YY_RULE_SETUP
-#line 320 "engines/director/lingo/lingo-lex.l"
+#line 312 "engines/director/lingo/lingo-lex.l"
{ count(); return tWHEN; }
YY_BREAK
-case 62:
+case 61:
YY_RULE_SETUP
-#line 321 "engines/director/lingo/lingo-lex.l"
+#line 313 "engines/director/lingo/lingo-lex.l"
{ count(); return tWHILE; }
YY_BREAK
-case 63:
+case 62:
YY_RULE_SETUP
-#line 322 "engines/director/lingo/lingo-lex.l"
+#line 314 "engines/director/lingo/lingo-lex.l"
{ count(); return tWORD; }
YY_BREAK
-case 64:
+case 63:
YY_RULE_SETUP
-#line 324 "engines/director/lingo/lingo-lex.l"
+#line 316 "engines/director/lingo/lingo-lex.l"
{ count(); return tNEQ; }
YY_BREAK
-case 65:
+case 64:
YY_RULE_SETUP
-#line 325 "engines/director/lingo/lingo-lex.l"
+#line 317 "engines/director/lingo/lingo-lex.l"
{ count(); return tGE; }
YY_BREAK
-case 66:
+case 65:
YY_RULE_SETUP
-#line 326 "engines/director/lingo/lingo-lex.l"
+#line 318 "engines/director/lingo/lingo-lex.l"
{ count(); return tLE; }
YY_BREAK
-case 67:
+case 66:
YY_RULE_SETUP
-#line 327 "engines/director/lingo/lingo-lex.l"
+#line 319 "engines/director/lingo/lingo-lex.l"
{ count(); return tCONCAT; }
YY_BREAK
-case 68:
+case 67:
YY_RULE_SETUP
-#line 328 "engines/director/lingo/lingo-lex.l"
+#line 320 "engines/director/lingo/lingo-lex.l"
{ count(); return tEQ; }
YY_BREAK
-case 69:
+case 68:
YY_RULE_SETUP
-#line 330 "engines/director/lingo/lingo-lex.l"
+#line 322 "engines/director/lingo/lingo-lex.l"
{
count();
yylval.s = new Common::String(yytext);
@@ -1661,43 +1640,43 @@ YY_RULE_SETUP
return ID;
}
YY_BREAK
-case 70:
+case 69:
YY_RULE_SETUP
-#line 384 "engines/director/lingo/lingo-lex.l"
+#line 376 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.f = atof(yytext); return FLOAT; }
YY_BREAK
-case 71:
+case 70:
YY_RULE_SETUP
-#line 385 "engines/director/lingo/lingo-lex.l"
+#line 377 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
YY_BREAK
-case 72:
+case 71:
YY_RULE_SETUP
-#line 386 "engines/director/lingo/lingo-lex.l"
+#line 378 "engines/director/lingo/lingo-lex.l"
{ count(); return *yytext; }
YY_BREAK
-case 73:
-/* rule 73 can match eol */
+case 72:
+/* rule 72 can match eol */
YY_RULE_SETUP
-#line 387 "engines/director/lingo/lingo-lex.l"
+#line 379 "engines/director/lingo/lingo-lex.l"
{ count(); return '\n'; }
YY_BREAK
-case 74:
+case 73:
YY_RULE_SETUP
-#line 388 "engines/director/lingo/lingo-lex.l"
+#line 380 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
YY_BREAK
-case 75:
+case 74:
YY_RULE_SETUP
-#line 389 "engines/director/lingo/lingo-lex.l"
+#line 381 "engines/director/lingo/lingo-lex.l"
{ count(); }
YY_BREAK
-case 76:
+case 75:
YY_RULE_SETUP
-#line 391 "engines/director/lingo/lingo-lex.l"
+#line 383 "engines/director/lingo/lingo-lex.l"
ECHO;
YY_BREAK
-#line 1701 "engines/director/lingo/lingo-lex.cpp"
+#line 1680 "engines/director/lingo/lingo-lex.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1991,7 +1970,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 314 )
+ if ( yy_current_state >= 307 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -2019,11 +1998,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 314 )
+ if ( yy_current_state >= 307 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 313);
+ yy_is_jam = (yy_current_state == 306);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -2657,7 +2636,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 391 "engines/director/lingo/lingo-lex.l"
+#line 383 "engines/director/lingo/lingo-lex.l"
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l
index fc554259a9..cb07b80a95 100644
--- a/engines/director/lingo/lingo-lex.l
+++ b/engines/director/lingo/lingo-lex.l
@@ -163,14 +163,6 @@ whitespace [\t ]
(?i:set) { count(); return tSET; }
(?i:starts) { count(); return tSTARTS; }
(?i:tell) { count(); return tTELL; }
-(?i:the[ \t]+last[\t ]+of[\t ]+) {
- count();
-
- yylval.e[0] = g_lingo->_theEntities["last"]->entity;
- yylval.e[1] = 0; // No field
-
- return THEENTITYWITHID;
- }
(?i:the[ \t]+sqrt[\t ]+of[\t ]+) {
count();
@@ -186,7 +178,7 @@ whitespace [\t ]
return FBLTINONEARG;
}
-(?i:the[ \t]+number[\t ]+of[\t ]+[[:alpha:]]+[\t ]in) {
+(?i:the[ \t]+number[\t ]+of[\t ]+[[:alpha:]]+[\t ](in|of)) {
count();
const char *ptr = &yytext[4]; // Skip 'the '
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index c46f360c64..79ea2f2866 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -41,7 +41,6 @@ TheEntity entities[] = {
{ kTheCast, "cast", true, 2 }, // D2
{ kTheCastMembers, "castmembers", false, 3 }, // D3
{ kTheCenterStage, "centerStage", false, 2 }, // D2 p
- { kTheChars, "chars", false, 3 }, // D3
{ kTheCheckBoxAccess, "checkBoxAccess", false, 2 }, // D2 p
{ kTheCheckBoxType, "checkBoxType", false, 2 }, // D2 p
{ kTheClickLoc, "clickLoc", false, 4 }, // D4 function
@@ -64,7 +63,6 @@ TheEntity entities[] = {
{ kTheFreeBytes, "freeBytes", false, 2 }, // D2 f
{ kTheFullColorPermit, "fullColorPermit", false, 2 }, // D2 p
{ kTheImageDirect, "imageDirect", false, 2 }, // D2 p
- { kTheItems, "items", false, 3 }, // D3
{ kTheItemDelimiter, "itemDelimiter", false, 4 }, // D4 p
{ kTheKey, "key", false, 2 }, // D2 f
{ kTheKeyCode, "keyCode", false, 2 }, // D2 f
@@ -76,12 +74,10 @@ TheEntity entities[] = {
{ kTheLastFrame, "lastFrame", false, 4 }, // D4 p
{ kTheLastKey, "lastKey", false, 2 }, // D2 f
{ kTheLastRoll, "lastRoll", false, 2 }, // D2 f
- { kTheLines, "lines", false, 3 }, // D3
{ kTheMachineType, "machineType", false, 2 }, // D2 f
- { kTheMaxInteger, "maxInteger", false, 4 }, // D4 f
+ { kTheMaxInteger, "maxInteger", false, 3 }, // D3.1 f
{ kTheMemorySize, "memorySize", false, 2 }, // D2 f
{ kTheMenu, "menu", true, 3 }, // D3 p
- { kTheMenus, "menus", false, 3 }, // D3 p
{ kTheMenuItem, "menuitem", true, 3 }, // D3 p
{ kTheMenuItems, "menuitems", false, 3 }, // D3 f
{ kTheMouseCast, "mouseCast", false, 3 }, // D3 f
@@ -100,20 +96,21 @@ TheEntity entities[] = {
{ kTheMovieFileSize, "movieFileSize", false, 4 }, // D4 f
{ kTheMovieName, "movieName", false, 4 }, // D4 f
{ kTheMoviePath, "moviePath", false, 4 }, // D4 f
- { kTheMultiSound, "multiSound", false, 4 }, // D4 p
+ { kTheMultiSound, "multiSound", false, 3 }, // D3.1 f
{ kTheOptionDown, "optionDown", false, 2 }, // D2 f
{ kTheParamCount, "paramCount", false, 4 }, // D4 f
{ kThePathName, "pathName", false, 2 }, // D2 f
{ kThePauseState, "pauseState", false, 2 }, // D2 f
+ { kThePi, "pi", false, 4 }, // D4 f
{ kThePerFrameHook, "perFrameHook", false, 2 }, // D2 p
{ kThePreloadEventAbort,"preloadEventAbort",false, 4 }, // D4 p
{ kThePreLoadRAM, "preLoadRAM", false, 4 }, // D4 p
- { kTheQuickTimePresent, "quickTimePresent", false, 4 }, // D4 f
+ { kTheQuickTimePresent, "quickTimePresent", false, 3 }, // D3.1 f
{ kTheRandomSeed, "randomSeed", false, 4 }, // D4 p
{ kTheResult, "result", false, 2 }, // D2 f
{ kTheRightMouseDown, "rightMouseDown", false, 5 }, // D5 f
{ kTheRightMouseUp, "rightMouseUp", false, 5 }, // D5 f
- { kTheRomanLingo, "romanLingo", false, 4 }, // D4 p
+ { kTheRomanLingo, "romanLingo", false, 3 }, // D3.1 p
{ kTheSearchCurrentFolder,"searchCurrentFolder",false,4 },// D4 f
{ kTheSearchPath, "searchPath", false, 4 }, // D4 f
{ kTheSelection, "selection", false, 2 }, // D2 f
@@ -147,7 +144,6 @@ TheEntity entities[] = {
{ kTheUpdateMovieEnabled,"updateMovieEnabled",false,4 },// D4 p
{ kTheWindow, "window", true, 4 }, // D4
{ kTheWindowList, "windowList", false, 4 }, // D4 p
- { kTheWords, "words", false, 3 }, // D3
{ kTheNOEntity, NULL, false, 0 }
};
@@ -168,21 +164,16 @@ TheEntityField fields[] = {
{ kTheSprite, "locH", kTheLocH, 2 },// D2 p
{ kTheSprite, "locV", kTheLocV, 2 },// D2 p
{ kTheSprite, "moveableSprite",kTheMoveableSprite,4 },// D4 p
- { kTheSprite, "movieRate", kTheMovieRate, 4 },// D4 P
- { kTheSprite, "movieTime", kTheMovieTime, 4 },// D4 P
{ kTheSprite, "pattern", kThePattern, 2 },// D2 p
{ kTheSprite, "puppet", kThePuppet, 2 },// D2 p
{ kTheSprite, "right", kTheRight, 2 },// D2 p
{ kTheSprite, "scoreColor", kTheScoreColor, 4 },// D4 p
{ kTheSprite, "scriptNum", kTheScriptNum, 4 },// D4 p
- { kTheSprite, "startTime", kTheStartTime, 4 },// D4 p
{ kTheSprite, "stretch", kTheStrech, 2 },// D2 p
- { kTheSprite, "stopTime", kTheStopTime, 4 },// D4 p
{ kTheSprite, "top", kTheTop, 2 },// D2 p
- { kTheSprite, "trails", kTheTrails, 4 },// D4 p
+ { kTheSprite, "trails", kTheTrails, 3 },// D3.1 p
{ kTheSprite, "type", kTheType, 2 },// D2 p
{ kTheSprite, "visible", kTheVisible, 4 },// D4 p
- { kTheSprite, "volume", kTheVolume, 4 },// D4 p
{ kTheSprite, "width", kTheWidth, 2 },// D2 p
// Common cast fields
@@ -204,16 +195,21 @@ TheEntityField fields[] = {
// Digital video fields
{ kTheCast, "center", kTheCenter, 4 },// D4 p
- { kTheCast, "controller", kTheController, 4 },// D4 p
+ { kTheCast, "controller", kTheController, 3 },// D3.1 p
{ kTheCast, "crop", kTheCrop, 4 },// D4 p
- { kTheCast, "directToStage",kTheDirectToStage,4 },// D4 p
- { kTheCast, "duration", kTheDuration, 4 },// D4 p
+ { kTheCast, "directToStage",kTheDirectToStage,3 },// D3.1 p
+ { kTheCast, "duration", kTheDuration, 3 },// D3.1 p
{ kTheCast, "frameRate", kTheFrameRate, 4 },// D4 p
- { kTheCast, "loop", kTheLoop, 4 },// D4 p
+ { kTheCast, "loop", kTheLoop, 3 },// D3.1 p
+ { kTheSprite, "movieRate", kTheMovieRate, 3 },// D3.1 P
+ { kTheSprite, "movieTime", kTheMovieTime, 3 },// D3.1 P
{ kTheCast, "pausedAtStart",kThePausedAtStart,4 },// D4 p
- { kTheCast, "preLoad", kThePreLoad, 4 },// D4 p
- { kTheCast, "sound", kTheSound, 4 },// D4 p // 0-1 off-on
+ { kTheCast, "preLoad", kThePreLoad, 3 },// D3.1 p
+ { kTheCast, "sound", kTheSound, 3 },// D3.1 p // 0-1 off-on
+ { kTheSprite, "startTime", kTheStartTime, 3 },// D3.1 p
+ { kTheSprite, "stopTime", kTheStopTime, 3 },// D3.1 p
{ kTheCast, "video", kTheVideo, 4 },// D4 p
+ { kTheSprite, "volume", kTheVolume, 3 },// D3.1 p
// Bitmap fields
{ kTheCast, "depth", kTheDepth, 4 },// D4 p
@@ -251,16 +247,6 @@ TheEntityField fields[] = {
{ kTheMenu, "name", kTheName, 3 },// D3 p
{ kTheCastMembers, "number", kTheNumber, 3 },// D3 p
- { kTheChars, "number", kTheNumber, 3 },// D3 p
- { kTheChars, "last", kTheLast, 4 },// D4 f
- { kTheItems, "number", kTheNumber, 3 },// D3 p
- { kTheItems, "last", kTheLast, 4 },// D4 f
- { kTheLines, "number", kTheNumber, 3 },// D3 p
- { kTheLines, "last", kTheLast, 4 },// D4 f
- { kTheMenuItems,"number", kTheNumber, 3 },// D3 p
- { kTheMenus, "number", kTheNumber, 3 },// D3 p
- { kTheWords, "number", kTheNumber, 3 },// D3 p
- { kTheWords, "last", kTheLast, 4 },// D4 f
{ kTheDate, "short", kTheShort, 3 },// D3 f
{ kTheDate, "long", kTheLong, 3 },// D3 f
@@ -538,6 +524,10 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d.type = INT;
d.u.i = _vm->getCurrentScore()->_mouseIsDown;
break;
+ case kThePi:
+ d.type = FLOAT;
+ d.u.f = M_PI;
+ break;
default:
warning("Lingo::getTheEntity(): Unprocessed getting field %d of entity %d", field, entity);
d.type = VOID;
@@ -685,8 +675,6 @@ Datum Lingo::getTheCast(Datum &id1, int field) {
}
return d;
- } else {
- warning("Lingo::getTheCast(): The cast %d found", id);
}
castType = _vm->getCurrentScore()->_loadedCast->getVal(id)->_type;
diff --git a/engines/director/lingo/lingo-the.h b/engines/director/lingo/lingo-the.h
index c4306d4416..9857adb9d9 100644
--- a/engines/director/lingo/lingo-the.h
+++ b/engines/director/lingo/lingo-the.h
@@ -99,6 +99,7 @@ enum TheEntityType {
kThePathName,
kThePauseState,
kThePerFrameHook,
+ kThePi,
kThePreloadEventAbort,
kThePreLoadRAM,
kTheQuickTimePresent,
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 03533babe6..8935614242 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -301,9 +301,13 @@ int Datum::toInt() {
switch (type) {
case REFERENCE:
toString();
+ // fallthrough
case STRING:
u.i = atoi(u.s->c_str());
break;
+ case VOID:
+ u.i = 0;
+ break;
case INT:
// no-op
break;
@@ -323,9 +327,13 @@ double Datum::toFloat() {
switch (type) {
case REFERENCE:
toString();
+ // fallthrough
case STRING:
u.f = atof(u.s->c_str());
break;
+ case VOID:
+ u.f = 0.0;
+ break;
case INT:
u.f = (double)u.i;
break;
@@ -516,13 +524,13 @@ void Lingo::printAllVars() {
for (SymbolHash::iterator i = _localvars->begin(); i != _localvars->end(); ++i) {
debugN("%s, ", (*i)._key.c_str());
}
- debug("");
+ debugN("\n");
debugN(" Global vars: ");
for (SymbolHash::iterator i = _globalvars.begin(); i != _globalvars.end(); ++i) {
debugN("%s, ", (*i)._key.c_str());
}
- debug("");
+ debugN("\n");
}
} // End of namespace Director
diff --git a/engines/director/lingo/tests/lingotests.lingo b/engines/director/lingo/tests/lingotests
index e69de29bb2..e69de29bb2 100644
--- a/engines/director/lingo/tests/lingotests.lingo
+++ b/engines/director/lingo/tests/lingotests
diff --git a/engines/director/lingo/tests/the.lingo b/engines/director/lingo/tests/the.lingo
index 088502e2a1..bdb56b5f46 100644
--- a/engines/director/lingo/tests/the.lingo
+++ b/engines/director/lingo/tests/the.lingo
@@ -26,3 +26,5 @@ set the windowtype of BlastWindow to 5
set the bottom of x to originV + (the number of lines in someText) * 16
set the bottom of x to originV + (the number of words in someText) * 16
+
+put the number of words of field 1 into field 5
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 4d5f9a9cd4..d0f802a715 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -63,8 +63,13 @@ Archive *DirectorEngine::openMainArchive(const Common::String movie) {
_mainArchive = createArchive();
- if (!_mainArchive->openFile(movie))
- error("Could not open '%s'", movie.c_str());
+ if (!_mainArchive->openFile(movie)) {
+ delete _mainArchive;
+ _mainArchive = nullptr;
+
+ warning("openMainArchive(): Could not open '%s'", movie.c_str());
+ return nullptr;
+ }
return _mainArchive;
}
@@ -256,14 +261,21 @@ void DirectorEngine::clearSharedCast() {
delete _sharedScore;
+ _sharedScore = nullptr;
+
delete _sharedDIB;
delete _sharedSTXT;
delete _sharedSound;
delete _sharedBMP;
+
+ _sharedDIB = nullptr;
+ _sharedSTXT = nullptr;
+ _sharedSound = nullptr;
+ _sharedBMP = nullptr;
}
void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
- if (_sharedScore) {
+ if (_sharedScore && _sharedScore->_movieArchive) {
if (_sharedScore->_movieArchive->getFileName().equalsIgnoreCase(filename))
return;
}
@@ -272,10 +284,6 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
Archive *shardcst = createArchive();
- debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
- debug(0, "@@@@ Loading Shared cast '%s'", filename.c_str());
- debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
-
_sharedDIB = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>;
_sharedSTXT = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>;
_sharedSound = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>;
@@ -284,11 +292,15 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
if (!shardcst->openFile(filename)) {
warning("No shared cast %s", filename.c_str());
- _sharedScore = new Score(this);
+ delete shardcst;
return;
}
+ debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ debug(0, "@@@@ Loading Shared cast '%s'", filename.c_str());
+ debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+
_sharedScore = new Score(this);
_sharedScore->setArchive(shardcst);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 1eb1dcebe6..9f4bbc7b5d 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -50,7 +50,8 @@ const char *scriptTypes[] = {
"SpriteScript",
"FrameScript",
"CastScript",
- "GlobalScript"
+ "GlobalScript",
+ "ScoreScript"
};
const char *scriptType2str(ScriptType scr) {
@@ -66,9 +67,9 @@ const char *scriptType2str(ScriptType scr) {
Score::Score(DirectorEngine *vm) {
_vm = vm;
- _surface = new Graphics::ManagedSurface;
- _trailSurface = new Graphics::ManagedSurface;
- _backSurface = new Graphics::ManagedSurface;
+ _surface = nullptr;
+ _trailSurface = nullptr;
+ _backSurface = nullptr;
_lingo = _vm->getLingo();
_soundManager = _vm->getSoundManager();
_currentMouseDownSpriteId = 0;
@@ -97,8 +98,8 @@ Score::Score(DirectorEngine *vm) {
_movieArchive = nullptr;
- _loadedStxts = new Common::HashMap<int, const Stxt *>();
- _loadedCast = new Common::HashMap<int, Cast *>();
+ _loadedStxts = nullptr;
+ _loadedCast = nullptr;
}
void Score::setArchive(Archive *archive) {
@@ -123,14 +124,12 @@ void Score::loadArchive() {
if (clutList.size() == 0) {
warning("CLUT resource not found, using default Mac palette");
- g_system->getPaletteManager()->setPalette(defaultPalette, 0, 256);
- _vm->setPalette(defaultPalette, 256);
+ _vm->setPalette(-1);
} else {
Common::SeekableSubReadStreamEndian *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]);
debugC(2, kDebugLoading, "****** Loading Palette CLUT");
loadPalette(*pal);
- g_system->getPaletteManager()->setPalette(_vm->getPalette(), 0, _vm->getPaletteColorCount());
}
// Font Directory
@@ -222,6 +221,9 @@ void Score::loadArchive() {
}
Common::Array<uint16> cast = _movieArchive->getResourceIDList(MKTAG('C', 'A', 'S', 't'));
+ if (!_loadedCast)
+ _loadedCast = new Common::HashMap<int, Cast *>();
+
if (cast.size() > 0) {
debugC(2, kDebugLoading, "****** Loading %d CASt resources", cast.size());
@@ -254,6 +256,9 @@ void Score::loadArchive() {
// Now process STXTs
Common::Array<uint16> stxt = _movieArchive->getResourceIDList(MKTAG('S','T','X','T'));
debugC(2, kDebugLoading, "****** Loading %d STXT resources", stxt.size());
+
+ _loadedStxts = new Common::HashMap<int, const Stxt *>();
+
for (Common::Array<uint16>::iterator iterator = stxt.begin(); iterator != stxt.end(); ++iterator) {
_loadedStxts->setVal(*iterator,
new Stxt(*_movieArchive->getResource(MKTAG('S','T','X','T'), *iterator)));
@@ -357,13 +362,13 @@ void Score::loadSpriteImages(bool isSharedCast) {
Score::~Score() {
- if (_surface)
+ if (_surface && _surface->w)
_surface->free();
- if (_trailSurface)
+ if (_trailSurface && _trailSurface->w)
_trailSurface->free();
- if (_backSurface)
+ if (_backSurface && _backSurface->w)
_backSurface->free();
delete _backSurface;
@@ -511,6 +516,9 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
void Score::loadConfig(Common::SeekableSubReadStreamEndian &stream) {
debugC(1, kDebugLoading, "****** Loading Config VWCF");
+ if (debugChannelSet(5, kDebugLoading))
+ stream.hexdump(stream.size());
+
uint16 len = stream.readUint16();
uint16 ver1 = stream.readUint16();
_movieRect = Score::readRect(stream);
@@ -534,13 +542,29 @@ void Score::loadConfig(Common::SeekableSubReadStreamEndian &stream) {
uint16 stageColorG = stream.readUint16();
uint16 stageColorB = stream.readUint16();
+ for (int i = 0; i < 0x0b; i++) {
+ stream.readByte();
+ }
+
+ if (_vm->getVersion() >= 4) {
+ for (int i = 0; i < 0x16; i++) {
+ stream.readByte();
+ }
+
+ int palette = (int16)stream.readUint16();
+ _vm->setPalette(palette - 1);
+
+ for (int i = 0; i < 0x08; i++) {
+ stream.readByte();
+ }
+ }
+
debugC(1, kDebugLoading, "Score::loadConfig(): len: %d, ver: %d, framerate: %d, light: %d, unk: %d, font: %d, size: %d"
", style: %d", len, ver1, _currentFrameRate, lightswitch, unk1, commentFont, commentSize, commentStyle);
debugC(1, kDebugLoading, "Score::loadConfig(): stagecolor: %d, depth: %d, color: %d, rgb: 0x%04x 0x%04x 0x%04x",
_stageColor, bitdepth, color, stageColorR, stageColorG, stageColorB);
if (debugChannelSet(1, kDebugLoading))
_movieRect.debugPrint(1, "Score::loadConfig(): Movie rect: ");
- debugC(1, kDebugLoading, "Score::loadConfig(): %d bytes left", stream.size() - stream.pos());
}
void Score::readVersion(uint32 rid) {
@@ -553,6 +577,8 @@ void Score::readVersion(uint32 rid) {
void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
debugC(1, kDebugLoading, "****** Loading Cast rects VWCR. start: %d, end: %d", _castArrayStart, _castArrayEnd);
+ _loadedCast = new Common::HashMap<int, Cast *>();
+
for (uint16 id = _castArrayStart; id <= _castArrayEnd; id++) {
byte size = stream.readByte();
if (size == 0)
@@ -598,7 +624,7 @@ void Score::setSpriteCasts() {
if (castId == 0)
continue;
- if (_vm->getSharedScore() != nullptr && _vm->getSharedScore()->_loadedCast->contains(castId)) {
+ if (_vm->getSharedScore() && _vm->getSharedScore()->_loadedCast && _vm->getSharedScore()->_loadedCast->contains(castId)) {
_frames[i]->_sprites[j]->_cast = _vm->getSharedScore()->_loadedCast->getVal(castId);
} else if (_loadedCast->contains(castId)) {
_frames[i]->_sprites[j]->_cast = _loadedCast->getVal(castId);
@@ -615,7 +641,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
// TODO: Determine if there really is a minimum size.
// This value was too small for Shape Casts.
if (stream.size() < 10) {
- warning("Score::loadCastData(): CAST data id %d is too small", id);
+ warning("Score::loadCastData(): CASt data id %d is too small", id);
return;
}
@@ -745,12 +771,33 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
CastInfo *ci = new CastInfo();
- if (castStrings.size() >= 5) {
- ci->script = castStrings[0];
- ci->name = castStrings[1];
- ci->directory = castStrings[2];
- ci->fileName = castStrings[3];
+ // We have here variable number of strings. Thus, instead of
+ // adding tons of ifs, we use this switch()
+ switch (castStrings.size()) {
+ default:
+ warning("Score::loadCastData(): extra %d strings", castStrings.size() - 5);
+ // fallthrough
+ case 5:
ci->type = castStrings[4];
+ // fallthrough
+ case 4:
+ ci->fileName = castStrings[3];
+ // fallthrough
+ case 3:
+ ci->directory = castStrings[2];
+ // fallthrough
+ case 2:
+ ci->name = castStrings[1];
+
+ if (!ci->name.empty()) {
+ _castsNames[ci->name] = id;
+ }
+ // fallthrough
+ case 1:
+ ci->script = castStrings[0];
+ // fallthrough
+ case 0:
+ break;
}
// FIXME. Disabled by default, requires --debugflags=bytecode for now
@@ -759,7 +806,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
uint scriptId = ((ScriptCast *)(*_loadedCast)[id])->_id - 1;
if (scriptId < _castScriptIds.size()) {
int resourceId = _castScriptIds[scriptId];
- _lingo->addCodeV4(*_movieArchive->getResource(MKTAG('L', 's', 'c', 'r'), resourceId), kCastScript, id);
+ _lingo->addCodeV4(*_movieArchive->getResource(MKTAG('L', 's', 'c', 'r'), resourceId), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
} else {
warning("Score::loadCastData(): Lingo context missing a resource entry for script %d referenced in cast %d", scriptId, id);
}
@@ -767,9 +814,9 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
if (!ci->script.empty()) {
// the script type here could be wrong!
if (ConfMan.getBool("dump_scripts"))
- dumpScript(ci->script.c_str(), kCastScript, id);
+ dumpScript(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
- _lingo->addCode(ci->script.c_str(), kCastScript, id);
+ _lingo->addCode(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
}
}
@@ -1230,12 +1277,12 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableSubReadStreamEn
for (uint j = entries[i]; j < entries[i + 1]; j++)
if (data[j] == '\r')
entryString += '\n';
- else
+ else if (j > entries[i] || data[j] >= 0x20) // Skip first byte which is string length
entryString += data[j];
strings.push_back(entryString);
- debugC(6, kDebugLoading, "String %d:\n%s\n", i, entryString.c_str());
+ debugC(6, kDebugLoading, "String %d:\n%s\n", i, Common::toPrintable(entryString).c_str());
}
free(data);
@@ -1292,6 +1339,10 @@ void Score::startLoop() {
initGraphics(_movieRect.width(), _movieRect.height());
+ _surface = new Graphics::ManagedSurface;
+ _trailSurface = new Graphics::ManagedSurface;
+ _backSurface = new Graphics::ManagedSurface;
+
_surface->create(_movieRect.width(), _movieRect.height());
_trailSurface->create(_movieRect.width(), _movieRect.height());
_backSurface->create(_movieRect.width(), _movieRect.height());
@@ -1307,6 +1358,8 @@ void Score::startLoop() {
_stopPlay = false;
_nextFrameTime = 0;
+ _lingo->processEvent(kEventStartMovie);
+
_frames[_currentFrame]->prepareFrame(this);
while (!_stopPlay) {
@@ -1322,6 +1375,8 @@ void Score::startLoop() {
if (_currentFrame < _frames.size())
_vm->processEvents();
}
+
+ _lingo->processEvent(kEventStopMovie);
}
void Score::update() {
@@ -1481,7 +1536,7 @@ void Score::renderZoomBox(bool redraw) {
end = MIN(start + 3 - box->step % 2, 8);
}
- Graphics::MacPlotData pd(_surface, &_vm->_wm->getPatterns(), Graphics::kPatternCheckers, 1, 0);
+ Graphics::MacPlotData pd(_surface, &_vm->_wm->getPatterns(), Graphics::kPatternCheckers, 0, 0, 1, 0);
for (int i = start; i <= end; i++) {
Common::Rect r(box->start.left + (box->end.left - box->start.left) * i / 8,
diff --git a/engines/director/score.h b/engines/director/score.h
index ef7244bf97..d4d402bb3e 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -123,7 +123,7 @@ private:
public:
Common::Array<Frame *> _frames;
Common::HashMap<uint16, CastInfo *> _castsInfo;
- Common::HashMap<Common::String, int> _castsNames;
+ Common::HashMap<Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _castsNames;
Common::SortedArray<Label *> *_labels;
Common::HashMap<uint16, Common::String> _actions;
Common::HashMap<uint16, bool> _immediateActions;
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index d9f8291761..d953ebadaf 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -129,7 +129,7 @@ uint16 Sprite::getPattern() {
warning("Sprite::getPattern(): Unhandled cast type: %d", _cast->_type);
break;
}
-
+ // fallthrough
default:
return 0;
}
@@ -146,6 +146,7 @@ void Sprite::setPattern(uint16 pattern) {
case kOutlinedRoundedRectangleSprite:
case kOutlinedOvalSprite:
_castId = pattern;
+ break;
case kCastMemberSprite:
// TODO
diff --git a/engines/director/types.h b/engines/director/types.h
index d05cd3b72b..4a9bcc8f4a 100644
--- a/engines/director/types.h
+++ b/engines/director/types.h
@@ -42,13 +42,14 @@ enum CastType {
};
enum ScriptType {
+ kNoneScript = -1,
kMovieScript = 0,
kSpriteScript = 1,
kFrameScript = 2,
kCastScript = 3,
kGlobalScript = 4,
- kNoneScript = -1,
- kMaxScriptType = 4 // Sync with score.cpp:45, array scriptTypes[]
+ kScoreScript = 5,
+ kMaxScriptType = 5 // Sync with score.cpp:45, array scriptTypes[]
};
enum ShapeType {
@@ -71,9 +72,9 @@ enum TextAlignType {
};
enum TextFlag {
- kTextFlagEditable,
- kTextFlagAutoTab,
- kTextFlagDoNotWrap
+ kTextFlagEditable = (1 << 0),
+ kTextFlagAutoTab = (1 << 1),
+ kTextFlagDoNotWrap = (1 << 2)
};
enum SizeType {
@@ -174,6 +175,62 @@ enum LEvent {
kEventStart
};
+enum TransitionType {
+ kTransNone,
+ kTransWipeRight,
+ kTransWipeLeft,
+ kTransWipeDown,
+ kTransWipeUp,
+ kTransCenterOutHorizontal,
+ kTransEdgesInHorizontal,
+ kTransCenterOutVertical,
+ kTransEdgesInVertical,
+ kTransCenterOutSquare,
+ kTransEdgesInSquare,
+ kTransPushLeft,
+ kTransPushRight,
+ kTransPushDown,
+ kTransPushUp,
+ kTransRevealUp,
+ kTransRevealUpRight,
+ kTransRevealRight,
+ kTransRevealDown,
+ kTransRevealDownRight,
+ kTransRevealDownLeft,
+ kTransRevealLeft,
+ kTransRevealUpLeft,
+ kTransDissolvePixelsFast,
+ kTransDissolveBoxyRects,
+ kTransDissolveBoxySquares,
+ kTransDissolvePatterns,
+ kTransRandomRows,
+ kTransRandomColumns,
+ kTransCoverDown,
+ kTransCoverDownLeft,
+ kTransCoverDownRight,
+ kTransCoverLeft,
+ kTransCoverRight,
+ kTransCoverUp,
+ kTransCoverUpLeft,
+ kTransCoverUpRight,
+ kTransTypeVenitianBlind,
+ kTransTypeCheckerboard,
+ kTransTypeStripsBottomBuildLeft,
+ kTransTypeStripsBottomBuildRight,
+ kTransTypeStripsLeftBuildDown,
+ kTransTypeStripsLeftBuildUp,
+ kTransTypeStripsRightBuildDown,
+ kTransTypeStripsRightBuildUp,
+ kTransTypeStripsTopBuildLeft,
+ kTransTypeStripsTopBuildRight,
+ kTransZoomOpen,
+ kTransZoomClose,
+ kTransVerticalBinds,
+ kTransDissolveBitsTrans,
+ kTransDissolvePixels,
+ kTransDissolveBits
+};
+
const char *scriptType2str(ScriptType scr);