aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.cpp3
-rw-r--r--engines/agos/agos.h44
-rw-r--r--engines/agos/debug.h2
-rw-r--r--engines/agos/detection_tables.h160
-rw-r--r--engines/agos/draw.cpp10
-rw-r--r--engines/agos/input.cpp5
-rw-r--r--engines/agos/midiparser_s1d.cpp4
-rw-r--r--engines/agos/pn.cpp50
-rw-r--r--engines/agos/res_snd.cpp4
-rw-r--r--engines/agos/saveload.cpp25
-rw-r--r--engines/agos/script_pn.cpp126
-rw-r--r--engines/agos/script_s1.cpp13
-rw-r--r--engines/agos/vga_e2.cpp44
-rw-r--r--engines/agos/vga_ww.cpp22
14 files changed, 256 insertions, 256 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 9903952577..0e53698b59 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -27,6 +27,7 @@
#include "common/file.h"
#include "common/system.h"
#include "common/events.h"
+#include "common/EventRecorder.h"
#include "agos/debugger.h"
#include "agos/intern.h"
@@ -528,7 +529,7 @@ AGOSEngine::AGOSEngine(OSystem *syst)
File::addDefaultDirectory(_gameDataDir.getChild("speech"));
File::addDefaultDirectory(_gameDataDir.getChild("SPEECH"));
- syst->getEventManager()->registerRandomSource(_rnd, "agos");
+ g_eventRec.registerRandomSource(_rnd, "agos");
}
Common::Error AGOSEngine::init() {
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 263811b78a..ac1f33428b 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1248,6 +1248,7 @@ protected:
void hitarea_stuff_helper_2();
void fastFadeIn();
void slowFadeIn();
+ void fullFade();
virtual void vcStopAnimation(uint16 zone, uint16 sprite);
@@ -1265,20 +1266,6 @@ protected:
#ifdef ENABLE_PN
class AGOSEngine_PN : public AGOSEngine {
- struct StackFrame {
- StackFrame *nextframe;
- int16 flag[6];
- int16 param[8];
- int16 classnum;
- uint8 *linpos;
- uint8 *lbase;
- int16 ll;
- int16 linenum;
- int16 process;
- jmp_buf *savearea;
- StackFrame() { memset(this, 0, sizeof(*this)); }
- };
-
virtual Common::Error go();
void demoSeq();
@@ -1358,8 +1345,30 @@ public:
void opn_opcode62();
void opn_opcode63();
+protected:
+ struct StackFrame {
+ StackFrame *nextframe;
+ int16 flag[6];
+ int16 param[8];
+ int16 classnum;
+ uint8 *linpos;
+ uint8 *lbase;
+ int16 ll;
+ int16 linenum;
+ int16 process;
+ int tagOfParentDoline; ///< tag of the doline "instance" to which this StackFrame belongs
+ StackFrame() { memset(this, 0, sizeof(*this)); }
+ };
+
+
StackFrame *_stackbase;
+ int _tagOfActiveDoline; ///< tag of the active doline "instance"
+ int _dolineReturnVal;
+
+ jmp_buf _loadfail;
+
+
byte *_dataBase, *_textBase;
uint32 _dataBaseSize, _textBaseSize;
@@ -1404,8 +1413,6 @@ public:
int _linembr;
uint8 *_linebase;
uint8 *_workptr;
- jmp_buf *_cjmpbuff;
- jmp_buf _loadfail;
uint16 getptr(uint32 pos);
uint32 getlong(uint32 pos);
@@ -1429,7 +1436,6 @@ public:
void addstack(int type);
void dumpstack();
- void junkstack();
void popstack(int type);
void funccpy(int *store);
void funcentry(int *storestore, int procn);
@@ -1465,8 +1471,8 @@ public:
virtual void windowPutChar(WindowBlock *window, byte c, byte b = 0);
bool badload(int8 errorNum);
- int loadfl(char *name);
- int savfl(char *name);
+ int loadFile(char *name);
+ int saveFile(char *name);
void getFilename();
void sysftodb();
void dbtosysf();
diff --git a/engines/agos/debug.h b/engines/agos/debug.h
index 375878a4bc..38674de765 100644
--- a/engines/agos/debug.h
+++ b/engines/agos/debug.h
@@ -2549,7 +2549,7 @@ const char *const ww_videoOpcodeNameTable[] = {
"j|IF_EGA",
/* 60 */
"d|STOP_ANIMATE",
- "d|VC_61",
+ "d|INTRO",
"|FASTFADEOUT",
"|FASTFADEIN",
};
diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h
index ec21acc0a1..0c672aef52 100644
--- a/engines/agos/detection_tables.h
+++ b/engines/agos/detection_tables.h
@@ -26,6 +26,8 @@
namespace AGOS {
using Common::GUIO_NONE;
+using Common::GUIO_NOMIDI;
+using Common::GUIO_NOMUSIC;
using Common::GUIO_NOSPEECH;
using Common::GUIO_NOSUBTITLES;
@@ -45,7 +47,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_PN,
@@ -68,7 +70,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAtariST,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_PN,
@@ -91,7 +93,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_PN,
@@ -137,7 +139,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA1,
@@ -158,7 +160,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA1,
@@ -179,7 +181,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA1,
@@ -200,7 +202,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA1,
@@ -223,7 +225,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAtariST,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA1,
@@ -246,7 +248,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA1,
@@ -269,7 +271,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA1,
@@ -410,7 +412,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA2,
@@ -436,7 +438,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA2,
@@ -462,7 +464,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA2,
@@ -488,7 +490,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA2,
@@ -514,7 +516,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA2,
@@ -540,7 +542,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA2,
@@ -566,7 +568,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformAtariST,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_ELVIRA2,
@@ -802,7 +804,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_WW,
@@ -829,7 +831,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_WW,
@@ -992,7 +994,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAcorn,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1017,7 +1019,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAcorn,
ADGF_DEMO,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1042,7 +1044,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAcorn,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1066,7 +1068,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1090,7 +1092,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_DEMO,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1114,7 +1116,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1138,7 +1140,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1162,7 +1164,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1186,7 +1188,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO_NOSPEECH | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1210,7 +1212,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1234,7 +1236,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES | GUIO_NOMIDI
},
GType_SIMON1,
@@ -1523,7 +1525,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1548,7 +1550,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1573,7 +1575,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1598,7 +1600,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1623,7 +1625,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1648,7 +1650,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1673,7 +1675,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::HB_ISR,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1698,7 +1700,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1724,7 +1726,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1749,7 +1751,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1774,7 +1776,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1799,7 +1801,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_SIMON1,
@@ -1824,7 +1826,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSPEECH
},
GType_SIMON2,
@@ -1949,7 +1951,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -1974,7 +1976,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -1999,7 +2001,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2024,7 +2026,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2049,7 +2051,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2074,7 +2076,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2099,7 +2101,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2124,7 +2126,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2175,7 +2177,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2200,7 +2202,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2225,7 +2227,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::CZ_CZE,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2250,7 +2252,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2275,7 +2277,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2300,7 +2302,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2325,7 +2327,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::PL_POL,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NONE
},
GType_SIMON2,
@@ -2346,7 +2348,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2367,7 +2369,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2391,7 +2393,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2415,7 +2417,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2439,7 +2441,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2463,7 +2465,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2487,7 +2489,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2511,7 +2513,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2534,7 +2536,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2557,7 +2559,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::PL_POL,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2580,7 +2582,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2603,7 +2605,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2626,7 +2628,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2649,7 +2651,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2672,7 +2674,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_FF,
@@ -2693,7 +2695,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES | GUIO_NOMUSIC
},
GType_PP,
@@ -2714,7 +2716,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_PP,
@@ -2735,7 +2737,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_PP,
@@ -2756,7 +2758,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_PP,
@@ -2777,7 +2779,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_PP,
@@ -2798,7 +2800,7 @@ static const AGOSGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO_NOSUBTITLES
},
GType_PP,
diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp
index 45443aa335..368da5db83 100644
--- a/engines/agos/draw.cpp
+++ b/engines/agos/draw.cpp
@@ -871,13 +871,11 @@ void AGOSEngine::slowFadeIn() {
_fastFadeInFlag &= ~0x8000;
_paletteFlag = false;
- memset(_videoBuf1, 0, 1024);
- memcpy(_currentPalette, _displayPalette, 1024);
- memcpy(_videoBuf1 + 1024, _displayPalette, 1024);
+ memset(_currentPalette, 0, sizeof(_currentPalette));
for (c = 255; c >= 0; c -= 4) {
- src = _videoBuf1 + 1024;
- dst = _videoBuf1;
+ src = _displayPalette;
+ dst = _currentPalette;
for (p = _fastFadeInFlag; p !=0 ; p -= 3) {
if (src[0] >= c)
@@ -889,7 +887,7 @@ void AGOSEngine::slowFadeIn() {
src += 4;
dst += 4;
}
- _system->setPalette(_videoBuf1, 0, _fastFadeCount);
+ _system->setPalette(_currentPalette, 0, _fastFadeCount);
delay(5);
}
_fastFadeInFlag = 0;
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index cf6e808384..5c37fe620a 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -664,10 +664,11 @@ void AGOSEngine_PN::handleKeyboard() {
}
}
if (chr == -1) {
- chr = _keyPressed.ascii;
- if (chr == 8 || chr == 13) {
+ if (_keyPressed.keycode == Common::KEYCODE_BACKSPACE || _keyPressed.keycode == Common::KEYCODE_RETURN) {
+ chr = _keyPressed.keycode;
addChar(chr);
} else if (!(_videoLockOut & 0x10)) {
+ chr = _keyPressed.ascii;
if (chr >= 32)
addChar(chr);
}
diff --git a/engines/agos/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp
index d77621cc7b..568135ef8c 100644
--- a/engines/agos/midiparser_s1d.cpp
+++ b/engines/agos/midiparser_s1d.cpp
@@ -126,6 +126,10 @@ void MidiParser_S1D::parseNextEvent(EventInfo &info) {
switch (info.event & 0x0F) {
case 0x0:
// Trigged by MOD2/MOD6/MOD15 in Waxworks
+ // Pure guesswork
+ info.ext.type = *(_position._play_pos++);
+ info.length = readVLQ(_position._play_pos);
+ info.ext.data = _position._play_pos;
break;
case 0x3: // Not sure, Song Select?
diff --git a/engines/agos/pn.cpp b/engines/agos/pn.cpp
index d92efa9077..e8135f56cd 100644
--- a/engines/agos/pn.cpp
+++ b/engines/agos/pn.cpp
@@ -35,6 +35,10 @@ namespace AGOS {
AGOSEngine_PN::AGOSEngine_PN(OSystem *system)
: AGOSEngine(system) {
+ _stackbase = 0;
+ _tagOfActiveDoline = 0;
+ _dolineReturnVal = 0;
+
_dataBase = 0;
_dataBaseSize = 0;
_textBase = 0;
@@ -70,7 +74,7 @@ AGOSEngine_PN::AGOSEngine_PN(OSystem *system)
_objects = 0;
_objectCountS = 0;
- _bp = 0;
+ _bp = 0;
_xofs = 0;
_havinit = 0;
_seed = 0;
@@ -84,16 +88,12 @@ AGOSEngine_PN::AGOSEngine_PN(OSystem *system)
_linebase = 0;
_workptr = 0;
-
- _cjmpbuff = NULL;
}
AGOSEngine_PN::~AGOSEngine_PN() {
free(_dataBase);
free(_textBase);
- free(_cjmpbuff);
- free(_stackbase);
}
const byte egaPalette[48] = {
@@ -251,29 +251,33 @@ void AGOSEngine_PN::setupBoxes() {
}
void AGOSEngine_PN::processor() {
- int q;
-
setqptrs();
- q = setjmp(_loadfail);
- _variableArray[6] = 0;
+ _tagOfActiveDoline = 0;
+ int q = 0;
+ do {
+ assert(_tagOfActiveDoline == 0);
+ _dolineReturnVal = 0;
- if (getPlatform() == Common::kPlatformAtariST) {
- _variableArray[21] = 2;
- } else if (getPlatform() == Common::kPlatformAmiga) {
- _variableArray[21] = 0;
- } else {
- _variableArray[21] = 1;
- }
+ _variableArray[6] = 0;
+
+ if (getPlatform() == Common::kPlatformAtariST) {
+ _variableArray[21] = 2;
+ } else if (getPlatform() == Common::kPlatformAmiga) {
+ _variableArray[21] = 0;
+ } else {
+ _variableArray[21] = 1;
+ }
- _variableArray[16] = _quickshort[6];
- _variableArray[17] = _quickshort[7];
- _variableArray[19] = getptr(55L);
+ _variableArray[16] = _quickshort[6];
+ _variableArray[17] = _quickshort[7];
+ _variableArray[19] = getptr(55L);
- // q indicates the process to run and is 0 the first time,
- // but 1 later on (i.e., when we are "called" from badload()).
- setposition(q, 0);
- doline(0);
+ // q indicates the process to run and is 0 the first time,
+ // but 1 later on (i.e., when we are "called" from badload()).
+ setposition(0, 0);
+ q = doline(0);
+ } while (q);
}
void AGOSEngine_PN::setqptrs() {
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index e85440d8e1..4f3582b55d 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -285,10 +285,6 @@ void AGOSEngine_Simon1::playMusic(uint16 music, uint16 track) {
void AGOSEngine::playMusic(uint16 music, uint16 track) {
stopMusic();
- // FIXME: Music too unstable, when switching locations.
- if (getPlatform() == Common::kPlatformPC && getGameType() == GType_WW)
- return;
-
if (getPlatform() == Common::kPlatformAmiga) {
playModule(music);
} else if (getPlatform() == Common::kPlatformAtariST) {
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index 16bde0097b..3787617be7 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -23,8 +23,6 @@
*
*/
-
-
#include "common/savefile.h"
#include "common/system.h"
@@ -231,7 +229,7 @@ bool AGOSEngine::confirmOverWrite(WindowBlock *window) {
break;
case Common::DE_DEU:
message1 = "\rDatei existiert bereits.\r\r";
- message2 = " berschreiben ?\r\r";
+ message2 = " Ueberschreiben ?\r\r";
message3 = " Ja Nein";
break;
default:
@@ -1555,13 +1553,16 @@ bool AGOSEngine_Elvira2::saveGame(uint slot, const char *caption) {
bool AGOSEngine_PN::badload(int8 errorNum) {
if (errorNum == -2)
return 0;
- /* Load error recovery routine */
+ // Load error recovery routine
+
+ // Clear any stack
while (_stackbase != NULL) {
- /* Clear any stack */
dumpstack();
}
- /* Restart from process 1 */
- longjmp(_loadfail, 1);
+
+ // Restart from process 1
+ _tagOfActiveDoline = 1;
+ _dolineReturnVal = 3;
return 1;
}
@@ -1572,7 +1573,7 @@ void AGOSEngine_PN::getFilename() {
memset(_saveFile, 0, sizeof(_saveFile));
while (!shouldQuit() && !strlen(_saveFile)) {
const char *msg = "File name : ";
- pcf((unsigned char)'\n');
+ pcf((unsigned char)'\n');
while (*msg)
pcf((unsigned char)*msg++);
@@ -1582,7 +1583,7 @@ void AGOSEngine_PN::getFilename() {
}
}
-int AGOSEngine_PN::loadfl(char *name) {
+int AGOSEngine_PN::loadFile(char *name) {
Common::InSaveFile *f;
haltAnimation();
@@ -1609,13 +1610,13 @@ int AGOSEngine_PN::loadfl(char *name) {
delete f;
return -1;
}
- delete f;
+ delete f;
restartAnimation();
dbtosysf();
return 0;
}
-int AGOSEngine_PN::savfl(char *name) {
+int AGOSEngine_PN::saveFile(char *name) {
Common::OutSaveFile *f;
sysftodb();
haltAnimation();
@@ -1625,7 +1626,7 @@ int AGOSEngine_PN::savfl(char *name) {
restartAnimation();
const char *msg = "Couldn't save. ";
- pcf((unsigned char)'\n');
+ pcf((unsigned char)'\n');
while (*msg)
pcf((unsigned char)*msg++);
diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp
index 4f9aab2965..2885781a9f 100644
--- a/engines/agos/script_pn.cpp
+++ b/engines/agos/script_pn.cpp
@@ -324,8 +324,8 @@ void AGOSEngine_PN::opn_opcode24() {
// That value then is returned to actCallD, which once again
// returns it. In the end, this amounts to a setScriptReturn(true)
// (but possibly in a different level than the current one).
- longjmp(*(_stackbase->savearea), 2);
- setScriptReturn(false);
+ _dolineReturnVal = 2;
+ _tagOfActiveDoline = _stackbase->tagOfParentDoline;
}
void AGOSEngine_PN::opn_opcode25() {
@@ -334,13 +334,13 @@ void AGOSEngine_PN::opn_opcode25() {
// That value then is returned to actCallD, which once again
// returns it. In the end, this amounts to a setScriptReturn(false)
// (but possibly in a different level than the current one).
- longjmp(*(_stackbase->savearea), 1);
- setScriptReturn(false);
+ _dolineReturnVal = 1;
+ _tagOfActiveDoline = _stackbase->tagOfParentDoline;
}
void AGOSEngine_PN::opn_opcode26() {
while ((_stackbase != NULL) && (_stackbase->classnum != kJmpClassNum))
- junkstack();
+ dumpstack();
dumpstack();
setScriptReturn(true);
}
@@ -353,16 +353,16 @@ void AGOSEngine_PN::opn_opcode27() {
void AGOSEngine_PN::opn_opcode28() {
addstack(varval());
- _stackbase->savearea = _cjmpbuff;
+ _stackbase->tagOfParentDoline = _tagOfActiveDoline;
setScriptReturn(false);
}
void AGOSEngine_PN::opn_opcode29() {
popstack(varval());
- // Jump back to the last doline indicated by the top stackfram.
+ // Jump back to the last doline indicated by the top stackframe.
// The -1 tells it to simply go on with its business.
- longjmp(*(_stackbase->savearea), -1);
- setScriptReturn(false);
+ _dolineReturnVal = -1;
+ _tagOfActiveDoline = _stackbase->tagOfParentDoline;
}
void AGOSEngine_PN::opn_opcode30() {
@@ -386,7 +386,7 @@ void AGOSEngine_PN::opn_opcode31() {
strcpy(bf, genSaveName(slot));
break;
case 1:
- strcpy(bf, "test.sav");
+ strcpy(bf, "pn.sav");
break;
case 2:
// NOTE: Is this case ever used?
@@ -397,7 +397,7 @@ void AGOSEngine_PN::opn_opcode31() {
if (slot == -1) {
setScriptReturn(false);
} else {
- a = loadfl(bf);
+ a = loadFile(bf);
if (a)
setScriptReturn(badload(a));
else
@@ -426,7 +426,7 @@ void AGOSEngine_PN::opn_opcode32() {
strcpy(bf, genSaveName(curSlot));
break;
case 1:
- strcpy(bf, "test.sav");
+ strcpy(bf, "pn.sav");
break;
case 2:
// NOTE: Is this case ever used?
@@ -434,7 +434,7 @@ void AGOSEngine_PN::opn_opcode32() {
break;
}
- a = savfl(bf);
+ a = saveFile(bf);
setScriptReturn(a);
}
@@ -520,19 +520,32 @@ void AGOSEngine_PN::opn_opcode39() {
}
void AGOSEngine_PN::opn_opcode40() {
- setScriptReturn(doaction() | doaction());
+ int a = doaction();
+ if (_dolineReturnVal != 0)
+ return;
+ int b = doaction();
+ setScriptReturn(a | b);
}
void AGOSEngine_PN::opn_opcode41() {
- setScriptReturn(doaction() & doaction());
+ int a = doaction();
+ if (_dolineReturnVal != 0)
+ return;
+ int b = doaction();
+ setScriptReturn(a & b);
}
void AGOSEngine_PN::opn_opcode42() {
- setScriptReturn(doaction() ^ doaction());
+ int a = doaction();
+ if (_dolineReturnVal != 0)
+ return;
+ int b = doaction();
+ setScriptReturn(a ^ b);
}
void AGOSEngine_PN::opn_opcode43() {
- setScriptReturn(!(doaction()));
+ int a = doaction();
+ setScriptReturn(!a);
}
void AGOSEngine_PN::opn_opcode44() {
@@ -874,41 +887,14 @@ int AGOSEngine_PN::doaction() {
}
int AGOSEngine_PN::doline(int needsave) {
- int x;
- jmp_buf *old_jmpbuf = NULL;
- jmp_buf *mybuf;
+ assert(!_stackbase == !needsave);
- mybuf = (jmp_buf *)malloc(sizeof(jmp_buf));
- if (mybuf == NULL)
- error("doline: Out of memory - stack overflow");
-
- x = setjmp(*mybuf);
- // Looking at the longjmp calls below, x can be -1, 1 or 2
- // (and of course 0 when it returns directly, as always).
- if (x > 0) {
- dumpstack();
- // Restore the active jmpbuf to its previous value,
- // then return the longjmp value (will be 2-1=1 or 1-1=0).
- _cjmpbuff = old_jmpbuf;
- free((char *)mybuf);
- return (x - 1);
- }
+ int x;
+ int myTag = ++_tagOfActiveDoline; // Obtain a unique tag for this doline invocation
+ _dolineReturnVal = 0;
- if (x == -1) {
- // Make this doline instance the active one (again).
- // This is used to "return" over possibly multiple
- // layers of nested script invocations.
- // Kind of like throwing an exception.
- _cjmpbuff = mybuf;
- goto carryon;
- }
-
- // Remember the previous active jmpbuf (gets restored
- // above when a longjmp with a positive param occurs).
- old_jmpbuf = _cjmpbuff;
- _cjmpbuff = mybuf;
if (needsave)
- _stackbase->savearea = mybuf;
+ _stackbase->tagOfParentDoline = myTag;
do {
_linct = ((*_linebase) & 127) - 1;
@@ -919,9 +905,26 @@ int AGOSEngine_PN::doline(int needsave) {
goto skipln;
}
-carryon:
do {
x = doaction();
+
+ if (_dolineReturnVal != 0) {
+ if (_tagOfActiveDoline != myTag)
+ return 0;
+
+ x = _dolineReturnVal;
+ _dolineReturnVal = 0;
+
+ if (x > 0) {
+ if (x != 3)
+ dumpstack();
+ // Restore the active jmpbuf to its previous value,
+ // then return _dolineReturnVal-1 (will be 2-1=1 or 1-1=0).
+ _tagOfActiveDoline = myTag - 1;
+ return (x - 1);
+ }
+ }
+
} while (x && !shouldQuit());
skipln:
@@ -1063,7 +1066,7 @@ void AGOSEngine_PN::addstack(int type) {
StackFrame *a;
int i;
- a = (StackFrame *)malloc(sizeof(StackFrame));
+ a = (StackFrame *)calloc(1, sizeof(StackFrame));
if (a == NULL)
error("addstack: Out of memory - stack overflow");
@@ -1093,24 +1096,13 @@ void AGOSEngine_PN::dumpstack() {
_stackbase = a;
}
-void AGOSEngine_PN::junkstack() {
- StackFrame *a;
-
- if (_stackbase == NULL)
- error("junkstack: Stack underflow or unknown longjmp");
-
- a = _stackbase->nextframe;
- if (_stackbase->classnum == kJmpClassNum)
- free((char *)_stackbase->savearea);
- free((char *)_stackbase);
- _stackbase = a;
-}
-
void AGOSEngine_PN::popstack(int type) {
- int i;
+ int i = 0;
- while ((_stackbase != NULL) && (_stackbase->classnum != type))
- junkstack();
+ while ((_stackbase != NULL) && (_stackbase->classnum != type)) {
+ dumpstack();
+ ++i;
+ }
if (_stackbase == NULL)
error("popstack: Stack underflow or unknown longjmp");
diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp
index 2e3d936037..81efb5cd81 100644
--- a/engines/agos/script_s1.cpp
+++ b/engines/agos/script_s1.cpp
@@ -576,18 +576,15 @@ void AGOSEngine_Simon1::os1_specialFade() {
// 187: fade to black
uint i;
- memcpy(_videoBuf1, _currentPalette, 4 * 256);
-
for (i = 32; i != 0; --i) {
- paletteFadeOut(_videoBuf1, 32, 8);
- paletteFadeOut(_videoBuf1 + 4 * 48, 144, 8);
- paletteFadeOut(_videoBuf1 + 4 * 208, 48, 8);
- _system->setPalette(_videoBuf1, 0, 256);
+ paletteFadeOut(_currentPalette, 32, 8);
+ paletteFadeOut(_currentPalette + 4 * 48, 144, 8);
+ paletteFadeOut(_currentPalette + 4 * 208, 48, 8);
+ _system->setPalette(_currentPalette, 0, 256);
delay(5);
}
- memcpy(_currentPalette, _videoBuf1, 1024);
- memcpy(_displayPalette, _videoBuf1, 1024);
+ memcpy(_displayPalette, _currentPalette, 1024);
}
void AGOSEngine::scriptMouseOff() {
diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp
index f6e6630d43..de3cb55963 100644
--- a/engines/agos/vga_e2.cpp
+++ b/engines/agos/vga_e2.cpp
@@ -353,9 +353,32 @@ void AGOSEngine::vc55_moveBox() {
_needHitAreaRecalc++;
}
-void AGOSEngine::vc56_fullScreen() {
- uint8 palette[1024];
+void AGOSEngine::fullFade() {
+ uint8 *srcPal, *dstPal;
+ int c, p;
+
+ for (c = 64; c != 0; c --) {
+ srcPal = _curVgaFile2 + 32;
+ dstPal = _currentPalette;
+ for (p = 768; p !=0 ; p -= 3) {
+ uint8 r = srcPal[0] * 4;
+ if (dstPal[0] != r)
+ dstPal[0] += 4;
+ uint8 g = srcPal[1] * 4;
+ if (dstPal[1] != g)
+ dstPal[1] += 4;
+ uint8 b = srcPal[2] * 4;
+ if (dstPal[2] != b)
+ dstPal[2] += 4;
+ srcPal += 3;
+ dstPal += 4;
+ }
+ _system->setPalette(_currentPalette, 0, 256);
+ delay(5);
+ }
+}
+void AGOSEngine::vc56_fullScreen() {
Graphics::Surface *screen = _system->lockScreen();
byte *dst = (byte *)screen->pixels;
byte *src = _curVgaFile2 + 800;
@@ -367,23 +390,12 @@ void AGOSEngine::vc56_fullScreen() {
}
_system->unlockScreen();
- //fullFade();
-
- src = _curVgaFile2 + 32;
- for (int i = 0; i < 256; i++) {
- palette[i * 4 + 0] = *src++ * 4;
- palette[i * 4 + 1] = *src++ * 4;
- palette[i * 4 + 2] = *src++ * 4;
- palette[i * 4 + 3] = 0;
- }
-
- _system->setPalette(palette, 0, 256);
+ fullFade();
}
void AGOSEngine::vc57_blackPalette() {
- uint8 palette[1024];
- memset(palette, 0, sizeof(palette));
- _system->setPalette(palette, 0, 256);
+ memset(_currentPalette, 0, sizeof(_currentPalette));
+ _system->setPalette(_currentPalette, 0, 256);
}
void AGOSEngine::vc58_checkCodeWheel() {
diff --git a/engines/agos/vga_ww.cpp b/engines/agos/vga_ww.cpp
index e7f2ad7807..afc05f7869 100644
--- a/engines/agos/vga_ww.cpp
+++ b/engines/agos/vga_ww.cpp
@@ -193,20 +193,8 @@ void AGOSEngine::vc61() {
_system->unlockScreen();
- if (a == 6) {
- //fullFade();
- src = _curVgaFile2 + 32;
-
- uint8 palette[1024];
- for (int i = 0; i < 256; i++) {
- palette[i * 4 + 0] = *src++ * 4;
- palette[i * 4 + 1] = *src++ * 4;
- palette[i * 4 + 2] = *src++ * 4;
- palette[i * 4 + 3] = 0;
- }
-
- _system->setPalette(palette, 0, 256);
- }
+ if (a == 6)
+ fullFade();
}
void AGOSEngine::vc62_fastFadeOut() {
@@ -221,8 +209,6 @@ void AGOSEngine::vc62_fastFadeOut() {
_fastFadeCount = 208;
}
- memcpy(_videoBuf1, _currentPalette, _fastFadeCount * 4);
-
if (getGameType() == GType_FF || getGameType() == GType_PP) {
if (getGameType() == GType_FF && getBitFlag(75)) {
fadeCount = 4;
@@ -237,8 +223,8 @@ void AGOSEngine::vc62_fastFadeOut() {
}
for (i = fadeCount; i != 0; --i) {
- paletteFadeOut(_videoBuf1, _fastFadeCount, fadeSize);
- _system->setPalette(_videoBuf1, 0, _fastFadeCount);
+ paletteFadeOut(_currentPalette, _fastFadeCount, fadeSize);
+ _system->setPalette(_currentPalette, 0, _fastFadeCount);
delay(5);
}