aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/agi/agi.h13
-rw-r--r--engines/agi/detection.cpp17
-rw-r--r--engines/agi/font.h259
-rw-r--r--engines/agi/loader_preagi.cpp50
-rw-r--r--engines/agi/module.mk1
-rw-r--r--engines/agi/preagi.cpp12
-rw-r--r--engines/agi/preagi_common.cpp2
-rw-r--r--engines/agi/preagi_winnie.cpp153
-rw-r--r--engines/agi/preagi_winnie.h317
9 files changed, 816 insertions, 8 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 3c01b9a3f0..b30c9ed2dd 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -104,7 +104,8 @@ enum AgiGameID {
GID_SQ2,
GID_XMASCARD,
GID_FANMADE, // TODO: Should this be extended to include all fanmade games?
- GID_MICKEY // PreAGI
+ GID_MICKEY, // PreAGI
+ GID_WINNIE // PreAGI
};
} // End of namespace Agi
@@ -547,6 +548,7 @@ public:
virtual int deinit() = 0;
virtual int detectGame() = 0;
virtual int loadResource(int, int) = 0;
+ virtual int loadResource(int, const char*) = 0;
virtual int unloadResource(int, int) = 0;
virtual int loadObjects(const char *) = 0;
virtual int loadWords(const char *) = 0;
@@ -574,6 +576,7 @@ public:
virtual int deinit();
virtual int detectGame();
virtual int loadResource(int, int);
+ virtual int loadResource(int, const char*);
virtual int unloadResource(int, int);
virtual int loadObjects(const char *);
virtual int loadWords(const char *);
@@ -601,6 +604,7 @@ public:
virtual int deinit();
virtual int detectGame();
virtual int loadResource(int, int);
+ virtual int loadResource(int, const char*) { return 0; }
virtual int unloadResource(int, int);
virtual int loadObjects(const char *);
virtual int loadWords(const char *);
@@ -628,6 +632,7 @@ public:
virtual int deinit();
virtual int detectGame();
virtual int loadResource(int, int);
+ virtual int loadResource(int, const char*) { return 0; }
virtual int unloadResource(int, int);
virtual int loadObjects(const char *);
virtual int loadWords(const char *);
@@ -675,8 +680,8 @@ public:
volatile uint32 _clockCount;
AgiDebug _debug;
AgiGame _game;
- AgiLoader *_loader; /* loader */
Common::RandomSource *_rnd;
+ AgiLoader *_loader; /* loader */
virtual void agiTimerLow() = 0;
virtual int agiGetKeypressLow() = 0;
@@ -974,6 +979,7 @@ public:
int agiIsKeypressLow() { return 0; }
int preAgiLoadResource(int r, int n);
+ int preAgiLoadResource(int r, const char* n);
int preAgiUnloadResource(int r, int n);
PreAgiEngine(OSystem *syst);
@@ -982,9 +988,6 @@ public:
return _gameId;
}
-private:
-
-public:
GfxMgr *_gfx;
SoundMgr *_sound;
PictureMgr *_picture;
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 0213f84867..8d3989c3ec 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -93,6 +93,7 @@ static const PlainGameDescriptor agiGames[] = {
{"sq2", "Space Quest II: Vohaul's Revenge"},
{"sqx", "Space Quest X: The Lost Chapter"},
{"tetris", "AGI Tetris"},
+ {"winnie", "Winnie the Pooh in the Hundred Acre Wood"},
{"xmascard", "Xmas Card"},
{0, 0}
@@ -1613,6 +1614,22 @@ static const AGIGameDescription gameDescriptions[] = {
0x2936,
},
+ {
+ // Winnie the Pooh in the Hundred Acre Wood
+ // preagi game
+ {
+ "winnie",
+ "",
+ AD_ENTRY1("title.pic", "2e7900c1ccaa7671d65405f6d1efed30"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_WINNIE,
+ GType_PreAGI,
+ 0,
+ 0x0000,
+ },
{
// Xmas Card 1986 (PC) [AGI 2.272]
diff --git a/engines/agi/font.h b/engines/agi/font.h
index 072888b718..1bf61878ec 100644
--- a/engines/agi/font.h
+++ b/engines/agi/font.h
@@ -553,6 +553,265 @@ static const uint8 mickey_fontdata[] = {
0x10, 0x18, 0x1C, 0x1E, 0x1C, 0x18, 0x10, 0x00,
};
+static const uint8 ibm_fontdata[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+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, 0x7E, 0x7E, 0x00,
+ 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF,
+ 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00,
+ 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00,
+ 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00,
+ 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00,
+ 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00,
+ 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00,
+ 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00,
+ 0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00,
+ 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00,
+ 0x30, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00,
+ 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00,
+ 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00,
+ 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00,
+ 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00,
+ 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00,
+ 0x00, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60,
+ 0x00, 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0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
+ 0xDB, 0x77, 0xDB, 0xEE, 0xDB, 0x77, 0xDB, 0xEE,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18,
+ 0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36,
+ 0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36,
+ 0x00, 0x00, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18,
+ 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+ 0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00,
+ 0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00,
+ 0x18, 0x18, 0xF8, 0x18, 0xF8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00,
+ 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00,
+ 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18,
+ 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36,
+ 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00,
+ 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36,
+ 0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00,
+ 0x36, 0x36, 0x36, 0x36, 0xFF, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0x36, 0x36, 0x3F, 0x00, 0x00, 0x00,
+ 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18,
+ 0x00, 0x00, 0x00, 0x00, 0x3F, 0x36, 0x36, 0x36,
+ 0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36,
+ 0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
+ 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 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18, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70,
+ 0x30, 0x30, 0x00, 0xFC, 0x00, 0x30, 0x30, 0x00,
+ 0x00, 0x76, 0xDC, 0x00, 0x76, 0xDC, 0x00, 0x00,
+ 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
+ 0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C,
+ 0x78, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00,
+ 0x70, 0x18, 0x30, 0x60, 0x78, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
} // End of namespace Agi
#endif /* AGI_FONT_H */
diff --git a/engines/agi/loader_preagi.cpp b/engines/agi/loader_preagi.cpp
index abf3f69af4..53611833c8 100644
--- a/engines/agi/loader_preagi.cpp
+++ b/engines/agi/loader_preagi.cpp
@@ -47,8 +47,8 @@ int AgiLoader_preagi::getIntVersion() {
}
int AgiLoader_preagi::detectGame() {
- // TODO: Only Mickey is detected for now
- if (!Common::File::exists("1.pic"))
+ // TODO: Only Mickey/Winnie are detected for now
+ if (!(Common::File::exists("1.pic") || Common::File::exists("title.pic")))
return errInvalidAGIFile;
_intVersion = 0x0000;
@@ -211,6 +211,52 @@ int AgiLoader_preagi::loadResource(int t, int n) {
return ec;
}
+/*
+ * Loads a resource into memory, a raw resource is loaded in
+ * with above routine, then further decoded here.
+ */
+int AgiLoader_preagi::loadResource(int t, const char* n) {
+ int ec = errOK;
+ uint8 *data = NULL;
+ Common::File infile;
+
+ switch (t) {
+ case rPICTURE:
+ /* if picture is currently NOT loaded *OR* cacheing is off,
+ * unload the resource (caching==off) and reload it
+ */
+ if (~_vm->_game.dirPic[0].flags & RES_LOADED) {
+ unloadResource(rPICTURE, 0);
+
+ data = new uint8[4096];
+
+ if (!infile.open(n))
+ return errBadResource;
+ infile.read(data, infile.size());
+
+ if (data != NULL) {
+ _vm->_game.pictures[0].rdata = data;
+ _vm->_game.dirPic[0].len = infile.size();
+ _vm->_game.dirPic[0].flags |= RES_LOADED;
+ } else {
+ ec = errBadResource;
+ }
+
+ infile.close();
+ }
+ break;
+ case rSOUND:
+ break;
+ case rVIEW:
+ break;
+ default:
+ ec = errBadResource;
+ break;
+ }
+
+ return ec;
+}
+
int AgiLoader_preagi::loadObjects(const char *fname) {
return 0;
//return _vm->loadObjects(fname);
diff --git a/engines/agi/module.mk b/engines/agi/module.mk
index 50bb7cd6a8..eae3ea1d64 100644
--- a/engines/agi/module.mk
+++ b/engines/agi/module.mk
@@ -26,6 +26,7 @@ MODULE_OBJS = \
preagi.o \
preagi_common.o \
preagi_mickey.o \
+ preagi_winnie.o \
predictive.o \
saveload.o \
sound.o \
diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp
index 97b504d83d..ad7c3a87fc 100644
--- a/engines/agi/preagi.cpp
+++ b/engines/agi/preagi.cpp
@@ -48,6 +48,7 @@
// preagi engines
#include "agi/preagi_mickey.h"
+#include "agi/preagi_winnie.h"
namespace Agi {
@@ -237,6 +238,13 @@ int PreAgiEngine::go() {
mickey->run();
}
break;
+ case GID_WINNIE:
+ {
+ Winnie *winnie = new Winnie(this);
+ winnie->init();
+ winnie->run();
+ }
+ break;
default:
error("Unknown preagi engine");
break;
@@ -248,6 +256,10 @@ int PreAgiEngine::preAgiLoadResource(int r, int n) {
return _loader->loadResource(r, n);
}
+int PreAgiEngine::preAgiLoadResource (int r, const char* n) {
+ return _loader->loadResource(r, n);
+}
+
int PreAgiEngine::preAgiUnloadResource(int r, int n) {
return _loader->unloadResource(r, n);
}
diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp
index dab6a827f5..7db1013a42 100644
--- a/engines/agi/preagi_common.cpp
+++ b/engines/agi/preagi_common.cpp
@@ -67,7 +67,7 @@ void PreAgiEngine::drawStr(int row, int col, int attr, const char *buffer) {
break;
default:
- _gfx->putTextCharacter(1, col * 8 , row * 8, static_cast<char>(code), attr & 0x0f, (attr & 0xf0) / 0x10, false, mickey_fontdata);
+ _gfx->putTextCharacter(1, col * 8 , row * 8, static_cast<char>(code), attr & 0x0f, (attr & 0xf0) / 0x10, false, getGameID() == GID_MICKEY ? mickey_fontdata : ibm_fontdata);
if (++col == 320 / 8) {
col = 0;
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp
new file mode 100644
index 0000000000..61ca1d88e3
--- /dev/null
+++ b/engines/agi/preagi_winnie.cpp
@@ -0,0 +1,153 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "agi/preagi_winnie.h"
+#include "agi/graphics.h"
+
+namespace Agi {
+
+// default attributes
+#define IDA_DEFAULT 0x0F
+#define IDA_DEFAULT_REV 0xF0
+
+void Winnie::initEngine() {
+ //SetScreenPar(320, 200, (char*)ibm_fontdata);
+ //SetMenuPars(21, 21, IDS_WTP_SELECTION);
+}
+
+void Winnie::initVars() {
+ memset(&game, 0, sizeof(game));
+ game.fSound = 1;
+ game.nObjMiss = IDI_WTP_MAX_OBJ_MISSING;
+ game.nObjRet = 0;
+ game.fGame[0] = 1;
+ game.fGame[1] = 1;
+ room = IDI_WTP_ROOM_HOME;
+
+ mist = -1;
+ wind = false;
+ event = false;
+}
+
+void Winnie::randomize() {
+ int iObj = 0;
+ int iRoom = 0;
+ bool done;
+
+ for (int i = 0; i < IDI_WTP_MAX_OBJ_MISSING; i++) {
+ done = false;
+ while (!done) {
+ iObj = _vm->rnd(IDI_WTP_MAX_OBJ - 1) + 2;
+ done = true;
+ for (int j = 0; j < IDI_WTP_MAX_OBJ_MISSING; j++) {
+ if (game.iUsedObj[j] == iObj) {
+ done = false;
+ break;
+ }
+ }
+ }
+
+ game.iUsedObj[i] = iObj;
+
+ done = false;
+ while (!done) {
+ iRoom = _vm->rnd(IDI_WTP_MAX_ROOM_NORMAL) + 1;
+ done = true;
+ for (int j = 0; j < IDI_WTP_MAX_ROOM_OBJ; j++) {
+ if (game.iObjRoom[j] == iRoom) {
+ done = false;
+ break;
+ }
+ }
+ }
+
+ game.iObjRoom[iObj] = iRoom;
+ }
+}
+
+void Winnie::intro() {
+ intro_DrawLogo();
+ intro_DrawTitle();
+ intro_PlayTheme();
+}
+
+void Winnie::intro_DrawLogo() {
+ drawPic(IDS_WTP_FILE_LOGO);
+ printStr(IDS_WTP_INTRO_0);
+ _vm->waitAnyKeyChoice();
+}
+
+void Winnie::intro_DrawTitle() {
+ drawPic(IDS_WTP_FILE_TITLE);
+ printStr(IDS_WTP_INTRO_1);
+ _vm->waitAnyKeyChoice();
+}
+
+void Winnie::intro_PlayTheme() {
+ //if (!Winnie_PlaySound(IDI_WTP_SND_POOH_0)) return;
+ //if (!Winnie_PlaySound(IDI_WTP_SND_POOH_1)) return;
+ //if (!Winnie_PlaySound(IDI_WTP_SND_POOH_2)) return;
+}
+
+void Winnie::drawPic(const char *szName) {
+ char szFile[256] = {0};
+ uint8 *buffer = new uint8[4096];
+
+ // construct filename
+ sprintf(szFile, IDS_WTP_PATH, szName);
+
+ _vm->preAgiLoadResource(rPICTURE, szName);
+ _vm->_picture->decodePicture(0, true, false, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT);
+ _vm->_picture->showPic(IDI_WTP_PIC_X0, IDI_WTP_PIC_Y0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT);
+ _vm->_gfx->doUpdate();
+ _vm->_system->updateScreen(); // TODO: this should go in the game's main loop
+ _vm->preAgiUnloadResource(rPICTURE, 0);
+
+ delete [] buffer;
+}
+
+void Winnie::printStr(const char* szMsg) {
+ _vm->clearTextArea();
+ _vm->drawStr(21, 0, IDA_DEFAULT, szMsg);
+ _vm->_gfx->doUpdate();
+ _vm->_system->updateScreen();
+}
+
+Winnie::Winnie(PreAgiEngine* vm) : _vm(vm) {
+
+}
+
+void Winnie::init() {
+ initEngine();
+ initVars();
+}
+
+void Winnie::run() {
+ randomize();
+ intro();
+ //gameLoop();
+}
+
+}
diff --git a/engines/agi/preagi_winnie.h b/engines/agi/preagi_winnie.h
new file mode 100644
index 0000000000..62a7cf5d7b
--- /dev/null
+++ b/engines/agi/preagi_winnie.h
@@ -0,0 +1,317 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "agi/agi.h"
+
+namespace Agi {
+
+// strings
+
+#define IDS_WTP_SELECTION ">"
+
+#define IDS_WTP_PATH_ROOM "rooms\\rm.%02d"
+#define IDS_WTP_PATH_OBJ "obj.%02d"
+#define IDS_WTP_PATH_SND "snd.%02d"
+#define IDS_WTP_PATH "%s"
+
+#define IDS_WTP_FILE_LOGO "logo.pic"
+#define IDS_WTP_FILE_TITLE "title.pic"
+#define IDS_WTP_FILE_SAVEGAME "savegame"
+#define IDS_WTP_FILE_RND "rnd"
+
+#define IDS_WTP_DISK_ERROR "There is a problem with your disk drive.Please make sure your Winnie-the-Pooh disk is in the drive correctly."
+
+#define IDS_WTP_INTRO_0 " PRESENT"
+#define IDS_WTP_INTRO_1 " TM designates trademark of\n Sierra On-Line, Inc.\n (c) 1985 Walt Disney Productions"
+
+#define IDS_WTP_HELP_0 "The <SPACE BAR> moves the pointer. Press <RETURN> when it is by the choice you want. Press the <Backspace> key to see what you just finished reading."
+#define IDS_WTP_HELP_1 "Press <C> to see what you are carrying. <Ctrl-S> turns the sound off and on. <ESC> takes you to the playroom (in caseyou get lost or want to save the game)."
+
+#define IDS_WTP_GAME_OVER_0 "Congratulations!! You did it! You returned everything that was lost. Now,Christopher Robin invites you to a Hero party."
+#define IDS_WTP_GAME_OVER_1 "The good news is: YOU are the Hero!! The bad news is: you have to find the party by yourself. Good luck!"
+
+#define IDS_WTP_OWL_0 "\"For example, that object you are carrying now is interesting. I know I've seen it before. Hmmm. Let me think about this . . .\""
+#define IDS_WTP_OWL_1 "\"You know, this object here beside me isfamiliar. I'm sure I could give you some sort of clue about it. Let me see. . .\""
+
+#define IDS_WTP_WIND_0 "Oh, no! The Blustery Wind begins to howl. It has returned, and mixed up all the objects in the Wood."
+#define IDS_WTP_WIND_1 "But don't worry. Everyone still has theobjects you returned to them.\n\n (Today must be Winds-day!)"
+#define IDS_WTP_TIGGER "\"Hallooooo, there!!!! It's ME, Tigger! Let's BOUNCE!\""
+#define IDS_WTP_MIST "Oh, look out! The mysterious mist is coming in. It gets so thick that you can't see through it. Just keep walkingand it will soon clear up."
+
+#define IDS_WTP_SONG_0 "Winnie-the-Pooh, Winnie-the-Pooh, Tubby little cubby all stuffed with fluff, He's Winnie-the-Pooh, Winnie-the-Pooh, Willy, nilly, silly, old bear."
+#define IDS_WTP_SONG_1 "Deep in the Hundred Acre Wood, Where Christopher Robin plays, You will find the enchanted neighborhoodof Christopher's childhood days."
+#define IDS_WTP_SONG_2 "A donkey named Eeyore is his friend, and Kanga and little Roo. There's Rabbit and Piglet and there's Owl But most of all Winnie-the-Pooh!"
+
+#define IDS_WTP_NSEW "North South East West"
+#define IDS_WTP_TAKE "Take"
+#define IDS_WTP_DROP "Drop"
+#define IDS_WTP_CANT_GO "\nSorry, but you can't go that way."
+#define IDS_WTP_CANT_TAKE "You can't take it. You can only carry one object at a time."
+#define IDS_WTP_CANT_DROP "You can't drop it. Another object is already here."
+#define IDS_WTP_WRONG_PLACE "\nOk, but it doesn't belong here."
+#define IDS_WTP_OK "\nOk."
+
+#define IDS_WTP_INVENTORY_0 "You are carrying nothing."
+#define IDS_WTP_INVENTORY_1 "Number of objects still missing: %d"
+
+// COMMODORE 64 version strings
+
+#define IDS_WTP_PATH_ROOM_C64 "%sroom%02d"
+#define IDS_WTP_PATH_OBJ_C64 "%sobject%02d"
+#define IDS_WTP_PATH_SND_C64 "%ssound.obj"
+#define IDS_WTP_FILE_SAVEGAME_C64 "saved game"
+#define IDS_WTP_DISK_ERROR_C64 "There is a problem with your disk drive.Please make sure your disk is in the drive correctly."
+#define IDS_WTP_HELP_0_C64 "The <SPACE BAR> moves the pointer. Press <RETURN> when it is by the choice you want. <F1> brings back what you have already read."
+#define IDS_WTP_HELP_1_C64 "<F3> takes you back to the playroom (if you get lost, or want to save the game).<F5> turns the sound off and on. <F7> shows what you're carrying."
+#define IDS_WTP_WRONG_PLACE_C64 "\nOk, but this is not the right place."
+
+// maximum values
+
+#define IDI_WTP_MAX_OBJ_MISSING 10
+
+#define IDI_WTP_MAX_ROOM 62
+#define IDI_WTP_MAX_OBJ 40
+#define IDI_WTP_MAX_SND 14
+#define IDI_WTP_MAX_PIC 2
+
+#define IDI_WTP_MAX_ROOM_NORMAL 57
+#define IDI_WTP_MAX_ROOM_TELEPORT 30
+#define IDI_WTP_MAX_ROOM_OBJ 42
+#define IDI_WTP_MAX_BLOCK 4
+#define IDI_WTP_MAX_STR 6
+#define IDI_WTP_MAX_OBJ_STR 4
+#define IDI_WTP_MAX_OBJ_STR_END 2
+#define IDI_WTP_MAX_FLAG 40
+#define IDI_WTP_MAX_OPTION 3
+#define IDI_WTP_MAX_DIR 4
+#define IDI_WTP_MAX_MOVES_UNTIL_WIND 150
+
+// positions
+
+#define IDI_WTP_ROW_MENU 21
+#define IDI_WTP_ROW_OPTION_1 21
+#define IDI_WTP_ROW_OPTION_2 22
+#define IDI_WTP_ROW_OPTION_3 23
+#define IDI_WTP_ROW_OPTION_4 24
+
+#define IDI_WTP_COL_MENU 0
+#define IDI_WTP_COL_OPTION 1
+#define IDI_WTP_COL_NSEW 1
+#define IDI_WTP_COL_NORTH 1
+#define IDI_WTP_COL_SOUTH 8
+#define IDI_WTP_COL_EAST 15
+#define IDI_WTP_COL_WEST 21
+#define IDI_WTP_COL_TAKE 29
+#define IDI_WTP_COL_DROP 35
+#define IDI_WTP_COL_PRESENT 17
+
+// data file offset modifiers
+
+#define IDI_WTP_OFS_ROOM 0x5400
+#define IDI_WTP_OFS_OBJ 0x0800
+
+// picture
+
+#define IDI_WTP_PIC_WIDTH 140
+#define IDI_WTP_PIC_HEIGHT 159
+#define IDI_WTP_PIC_X0 10
+#define IDI_WTP_PIC_Y0 0
+#define IDI_WTP_PIC_FLAGS IDF_AGI_PIC_V2
+
+// selections
+
+enum {
+ IDI_WTP_SEL_HOME = -2,
+ IDI_WTP_SEL_BACK,
+ IDI_WTP_SEL_OPT_1,
+ IDI_WTP_SEL_OPT_2,
+ IDI_WTP_SEL_OPT_3,
+ IDI_WTP_SEL_NORTH,
+ IDI_WTP_SEL_SOUTH,
+ IDI_WTP_SEL_EAST,
+ IDI_WTP_SEL_WEST,
+ IDI_WTP_SEL_TAKE,
+ IDI_WTP_SEL_DROP,
+ IDI_WTP_SEL_REAL_OPT_1,
+ IDI_WTP_SEL_REAL_OPT_2,
+ IDI_WTP_SEL_REAL_OPT_3
+};
+
+#define IDI_WTP_SEL_LAST IDI_WTP_SEL_REAL_OPT_3
+
+// rooms
+
+enum {
+ IDI_WTP_ROOM_NONE = -1,
+ IDI_WTP_ROOM_NORTH,
+ IDI_WTP_ROOM_SOUTH,
+ IDI_WTP_ROOM_EAST,
+ IDI_WTP_ROOM_WEST
+};
+
+#define IDI_WTP_ROOM_HIDE 0
+
+#define IDI_WTP_ROOM_PICNIC 2
+#define IDI_WTP_ROOM_HOME 28
+#define IDI_WTP_ROOM_PARTY 58
+#define IDI_WTP_ROOM_MIST 59
+#define IDI_WTP_ROOM_TIGGER 61
+
+// sound
+
+enum ENUM_WTP_SOUND {
+ IDI_WTP_SND_POOH_0 = 1,
+ IDI_WTP_SND_TIGGER,
+ IDI_WTP_SND_TAKE,
+ IDI_WTP_SND_DROP,
+ IDI_WTP_SND_DROP_OK,
+ IDI_WTP_SND_FANFARE,
+ IDI_WTP_SND_POOH_1,
+ IDI_WTP_SND_KEYHELP,
+ IDI_WTP_SND_POOH_2,
+ IDI_WTP_SND_WIND_0,
+ IDI_WTP_SND_WIND_1
+};
+
+// script opcodes
+
+#define IDO_WTP_GOTO_ROOM 0x06
+#define IDO_WTP_PRINT_MSG 0x08
+#define IDO_WTP_PRINT_STR 0x0A
+#define IDO_WTP_DROP_OBJ 0x0C
+#define IDO_WTP_FLAG_CLEAR 0x0E
+#define IDO_WTP_FLAG_SET 0x10
+#define IDO_WTP_GAME_OVER 0x12
+#define IDO_WTP_WALK_MIST 0x14
+#define IDO_WTP_PLAY_SOUND 0x16
+#define IDO_WTP_SAVE_GAME 0x18
+#define IDO_WTP_LOAD_GAME 0x1A
+#define IDO_WTP_OWL_HELP 0x1C
+#define IDO_WTP_GOTO_RND 0x1E
+
+#define IDO_WTP_OPTION_0 0x15
+#define IDO_WTP_OPTION_1 0x16
+#define IDO_WTP_OPTION_2 0x17
+
+enum {
+ IDI_WTP_OBJ_DESC = 0,
+ IDI_WTP_OBJ_TAKE,
+ IDI_WTP_OBJ_DROP,
+ IDI_WTP_OBJ_HELP
+};
+
+enum {
+ IDI_WTP_PAR_OK = 0,
+ IDI_WTP_PAR_GOTO,
+ IDI_WTP_PAR_BACK
+};
+
+// room file option block
+
+struct WTP_ROOM_BLOCK {
+ uint16 ofsOpt[IDI_WTP_MAX_BLOCK];
+};
+
+// room file header
+
+struct WTP_ROOM_HDR {
+ uint8 roomNumber;
+ uint8 objId;
+ uint16 ofsPic;
+ uint16 fileLen;
+ uint16 reserved0;
+ int8 roomNew[IDI_WTP_MAX_DIR];
+ uint8 objX;
+ uint8 objY;
+ uint16 reserved1;
+ uint16 ofsDesc[IDI_WTP_MAX_BLOCK];
+ uint16 ofsBlock[IDI_WTP_MAX_BLOCK];
+ uint16 ofsStr[IDI_WTP_MAX_STR];
+ uint32 reserved2;
+ WTP_ROOM_BLOCK opt[IDI_WTP_MAX_BLOCK];
+};
+
+// object file header
+
+struct WTP_OBJ_HDR {
+ uint16 fileLen;
+ uint16 objId;
+ uint16 ofsEndStr[IDI_WTP_MAX_OBJ_STR_END];
+ uint16 ofsStr[IDI_WTP_MAX_OBJ_STR];
+ uint16 ofsPic;
+};
+
+// savegame
+
+struct WTP_SAVE_GAME {
+ uint16 reserved0; // 10c2 unused
+ uint16 fSound; // 10c4
+ uint16 nMoves; // 10c6
+ uint16 nObjMiss; // 10c8
+ uint16 nObjRet; // 10ca
+ uint16 reserved1; // 10ce unused
+ uint16 reserved2; // 10cf unused
+ uint16 reserved3; // 10d0 unused
+ uint16 iObjHave; // 10d2
+ uint16 o10d4; // 10d4 can be ignored
+ uint16 o10d6; // 10d6 can be ignored
+ uint16 o10d8; // 10d8 can be ignored
+ uint8 fGame[IDI_WTP_MAX_FLAG]; // 10da
+ uint8 iUsedObj[IDI_WTP_MAX_OBJ_MISSING]; // 1102
+ uint8 iObjRoom[IDI_WTP_MAX_ROOM_OBJ]; // 110c
+ uint16 o1136; // 1136 can be ignored
+ uint16 o1138; // 1138 can be ignored
+};
+
+class Winnie {
+ friend class PreAgiEngine;
+public:
+ Winnie(PreAgiEngine *vm);
+ //~Winnie();
+
+ void init();
+ void run();
+
+private:
+ PreAgiEngine *_vm;
+ WTP_SAVE_GAME game;
+ int room;
+ int mist;
+ bool wind;
+ bool event;
+ int tigger_mist;
+
+ void initEngine();
+ void initVars();
+ void randomize();
+ void intro();
+ void intro_DrawLogo();
+ void intro_DrawTitle();
+ void intro_PlayTheme();
+ void drawPic(const char*);
+ void printStr(const char*);
+};
+
+}