aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2009-08-11 14:42:44 +0000
committerTravis Howell2009-08-11 14:42:44 +0000
commit1c15bcf87d158b7cfb9047015344ebb2717f3c37 (patch)
treea21f0dbd042cd48792d822f71f83f4ddeb660d12 /engines
parent7f667c528916f8d1082bfc582a74c5d2a6b9a4c9 (diff)
downloadscummvm-rg350-1c15bcf87d158b7cfb9047015344ebb2717f3c37.tar.gz
scummvm-rg350-1c15bcf87d158b7cfb9047015344ebb2717f3c37.tar.bz2
scummvm-rg350-1c15bcf87d158b7cfb9047015344ebb2717f3c37.zip
Add option to disable later games (Feeble Files, Puzzle Pack) in AGOS game engine, which require higher resolution.
svn-id: r43270
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/agos.cpp4
-rw-r--r--engines/agos/agos.h19
-rw-r--r--engines/agos/animation.cpp1
-rw-r--r--engines/agos/animation.h3
-rw-r--r--engines/agos/charset.cpp4
-rw-r--r--engines/agos/cursor.cpp75
-rw-r--r--engines/agos/debug.cpp4
-rw-r--r--engines/agos/detection.cpp6
-rw-r--r--engines/agos/detection_tables.h4
-rw-r--r--engines/agos/draw.cpp2
-rw-r--r--engines/agos/event.cpp4
-rw-r--r--engines/agos/gfx.cpp2
-rw-r--r--engines/agos/icons.cpp6
-rw-r--r--engines/agos/module.mk26
-rw-r--r--engines/agos/res.cpp18
-rw-r--r--engines/agos/rooms.cpp2
-rw-r--r--engines/agos/saveload.cpp3
-rw-r--r--engines/agos/string.cpp4
-rw-r--r--engines/agos/subroutine.cpp2
-rw-r--r--engines/agos/verb.cpp10
-rw-r--r--engines/agos/vga.cpp11
-rw-r--r--engines/agos/vga_e2.cpp2
-rw-r--r--engines/agos/vga_ff.cpp51
-rw-r--r--engines/agos/vga_s1.cpp85
-rw-r--r--engines/agos/window.cpp2
-rw-r--r--engines/engines.mk4
26 files changed, 219 insertions, 135 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 0e53698b59..a786882630 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -59,6 +59,7 @@ static const GameSpecificSettings puzzlepack_settings = {
"MUSIC", // speech_filename
};
+#ifdef ENABLE_AGOS2
AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system)
: AGOSEngine_Feeble(system) {
@@ -72,6 +73,7 @@ AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system)
_startSecondCount = 0;
_tSecondCount = 0;
}
+#endif
AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system)
: AGOSEngine_Simon1(system) {
@@ -696,6 +698,7 @@ static const uint16 initialVideoWindows_PN[20] = {
3, 2, 14, 129,
};
+#ifdef ENABLE_AGOS2
void AGOSEngine_PuzzlePack::setupGame() {
gss = &puzzlepack_settings;
_numVideoOpcodes = 85;
@@ -712,6 +715,7 @@ void AGOSEngine_PuzzlePack::setupGame() {
AGOSEngine::setupGame();
}
+#endif
void AGOSEngine_Simon2::setupGame() {
gss = &simon2_settings;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index ac1f33428b..f279a6dba3 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -34,14 +34,13 @@
#include "common/stack.h"
#include "common/util.h"
+#ifdef ENABLE_AGOS2
#include "agos/animation.h"
+#endif
#include "agos/midi.h"
#include "agos/sound.h"
#include "agos/vga.h"
-// TODO: Replace with more portable code
-#include <setjmp.h>
-
namespace AGOS {
uint fileReadItemID(Common::SeekableReadStream *in);
@@ -892,6 +891,7 @@ public:
void vc19_loop();
void vc20_setRepeat();
void vc21_endRepeat();
+ virtual void vc22_setPalette();
void vc23_setPriority();
void vc24_setSpriteXY();
void vc25_halt_sprite();
@@ -904,7 +904,7 @@ public:
void vc33_setMouseOn();
void vc34_setMouseOff();
void vc35_clearWindow();
- void vc36_setWindowImage();
+ virtual void vc36_setWindowImage();
void vc38_ifVarNotZero();
void vc39_setVar();
void vc40_scrollRight();
@@ -924,7 +924,6 @@ public:
// Video Script Opcodes, Elvira 1
void vc17_waitEnd();
- void vc22_setPaletteOld();
void vc32_saveScreen();
void vc37_pokePalette();
@@ -962,10 +961,9 @@ public:
void vc45_setSpriteX();
void vc46_setSpriteY();
void vc47_addToVar();
- void vc48_setPathFinder();
+ virtual void vc48_setPathFinder();
void vc59_ifSpeech();
void vc61_setMaskImage();
- void vc22_setPaletteNew();
// Video Script Opcodes, Simon 2
void vc56_delayLong();
@@ -1771,6 +1769,8 @@ public:
virtual void executeOpcode(int opcode);
+ virtual void vc22_setPalette();
+
// Opcodes, Simon 1
void os1_animate();
void os1_pauseGame();
@@ -1875,6 +1875,7 @@ protected:
virtual char *genSaveName(int slot);
};
+#ifdef ENABLE_AGOS2
class AGOSEngine_Feeble : public AGOSEngine_Simon2 {
public:
AGOSEngine_Feeble(OSystem *system);
@@ -1886,6 +1887,9 @@ public:
virtual void executeOpcode(int opcode);
+ virtual void vc36_setWindowImage();
+ virtual void vc48_setPathFinder();
+
void off_chance();
void off_jumpOut();
void off_addTextBox();
@@ -2092,6 +2096,7 @@ protected:
virtual char *genSaveName(int slot);
};
+#endif
} // End of namespace AGOS
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index 36399a7b2f..2e7eb9cb5e 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -27,6 +27,7 @@
#include "common/endian.h"
#include "common/events.h"
+#include "common/file.h"
#include "common/system.h"
#include "graphics/cursorman.h"
diff --git a/engines/agos/animation.h b/engines/agos/animation.h
index 4ebcb3d4b3..3ce6aa9ab2 100644
--- a/engines/agos/animation.h
+++ b/engines/agos/animation.h
@@ -26,9 +26,6 @@
#ifndef AGOS_ANIMATION_H
#define AGOS_ANIMATION_H
-#include "common/file.h"
-#include "common/stream.h"
-
#include "graphics/video/dxa_decoder.h"
#include "graphics/video/smk_decoder.h"
#include "sound/mixer.h"
diff --git a/engines/agos/charset.cpp b/engines/agos/charset.cpp
index 5b0a694312..fb012a89dd 100644
--- a/engines/agos/charset.cpp
+++ b/engines/agos/charset.cpp
@@ -34,6 +34,7 @@
namespace AGOS {
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::doOutput(const byte *src, uint len) {
if (_textWindow == NULL)
return;
@@ -64,6 +65,7 @@ void AGOSEngine_Feeble::doOutput(const byte *src, uint len) {
}
}
}
+#endif
void AGOSEngine::doOutput(const byte *src, uint len) {
uint idx;
@@ -573,6 +575,7 @@ void AGOSEngine::windowPutChar(WindowBlock *window, byte c, byte b) {
}
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::windowNewLine(WindowBlock *window) {
if (_noOracleScroll == 0) {
if (window->height < window->textRow + 30) {
@@ -603,6 +606,7 @@ void AGOSEngine_Feeble::windowNewLine(WindowBlock *window) {
window->textColumnOffset = 0;
window->textLength = 0;
}
+#endif
void AGOSEngine::windowNewLine(WindowBlock *window) {
window->textColumn = 0;
diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp
index c279fbd335..1304ca7ca4 100644
--- a/engines/agos/cursor.cpp
+++ b/engines/agos/cursor.cpp
@@ -348,6 +348,7 @@ static const byte _mouseOffs[29 * 32] = {
0,0,10,7,10,6,10,5,10,4,10,3,10,4,10,5,10,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
+#ifdef ENABLE_AGOS2
void AGOSEngine_PuzzlePack::handleMouseMoved() {
uint x;
@@ -379,6 +380,7 @@ void AGOSEngine_PuzzlePack::handleMouseMoved() {
drawMousePointer();
}
+#endif
void AGOSEngine_Simon1::handleMouseMoved() {
uint x;
@@ -638,6 +640,7 @@ void AGOSEngine::mouseOn() {
_videoLockOut &= ~1;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_PuzzlePack::initMouse() {
if (getGameId() == GID_DIMP) {
AGOSEngine_Simon1::initMouse();
@@ -652,48 +655,12 @@ void AGOSEngine_FeebleDemo::initMouse() {
// TODO: Add larger cursor
AGOSEngine_Simon1::initMouse();
}
-
-static const byte mouseCursorPalette[] = {
- 0x00, 0x00, 0x00, 0x00, // Black
- 0xFF, 0xFF, 0xFF, 0x00, // White
-};
-
void AGOSEngine_Feeble::initMouse() {
_maxCursorWidth = 40;
_maxCursorHeight = 40;
_mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1);
}
-void AGOSEngine_Simon1::initMouse() {
- AGOSEngine::initMouse();
-
- const uint16 *src = _common_mouseInfo;
- for (int i = 0; i < 16; i++) {
- for (int j = 0; j < 16; j++) {
- if (src[0] & (1 << (15 - (j % 16)))) {
- if (src[1] & (1 << (15 - (j % 16)))) {
- _mouseData[16 * i + j] = 1;
- } else {
- _mouseData[16 * i + j] = 0;
- }
- }
- }
- src += 2;
- }
-
- CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
-}
-
-void AGOSEngine::initMouse() {
- _maxCursorWidth = 16;
- _maxCursorHeight = 16;
- _mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1);
-
- memset(_mouseData, 0xFF, _maxCursorWidth * _maxCursorHeight);
-
- CursorMan.replaceCursorPalette(mouseCursorPalette, 0, ARRAYSIZE(mouseCursorPalette) / 4);
-}
-
void AGOSEngine_PuzzlePack::loadMouseImage() {
loadZone(_variableArray[500]);
VgaPointersEntry *vpe = &_vgaBufferPointers[_variableArray[500]];
@@ -793,6 +760,42 @@ void AGOSEngine_Feeble::drawMousePointer() {
CursorMan.replaceCursor(_mouseData, _maxCursorWidth, _maxCursorHeight, hotspotX, hotspotY, 0);
}
}
+#endif
+
+void AGOSEngine_Simon1::initMouse() {
+ AGOSEngine::initMouse();
+
+ const uint16 *src = _common_mouseInfo;
+ for (int i = 0; i < 16; i++) {
+ for (int j = 0; j < 16; j++) {
+ if (src[0] & (1 << (15 - (j % 16)))) {
+ if (src[1] & (1 << (15 - (j % 16)))) {
+ _mouseData[16 * i + j] = 1;
+ } else {
+ _mouseData[16 * i + j] = 0;
+ }
+ }
+ }
+ src += 2;
+ }
+
+ CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
+}
+
+static const byte mouseCursorPalette[] = {
+ 0x00, 0x00, 0x00, 0x00, // Black
+ 0xFF, 0xFF, 0xFF, 0x00, // White
+};
+
+void AGOSEngine::initMouse() {
+ _maxCursorWidth = 16;
+ _maxCursorHeight = 16;
+ _mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1);
+
+ memset(_mouseData, 0xFF, _maxCursorWidth * _maxCursorHeight);
+
+ CursorMan.replaceCursorPalette(mouseCursorPalette, 0, ARRAYSIZE(mouseCursorPalette) / 4);
+}
void AGOSEngine::drawMousePointer() {
if (getGameType() == GType_SIMON2) {
diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp
index 8bdb35d3ae..519dfc344c 100644
--- a/engines/agos/debug.cpp
+++ b/engines/agos/debug.cpp
@@ -26,6 +26,8 @@
// AGOS debug functions
+#include "common/file.h"
+
#include "agos/debug.h"
#include "agos/agos.h"
#include "agos/intern.h"
@@ -323,6 +325,7 @@ void AGOSEngine::dumpAllVgaScriptFiles() {
}
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::dumpVgaFile(const byte *vga) {
const byte *pp;
const byte *p;
@@ -352,6 +355,7 @@ void AGOSEngine_Feeble::dumpVgaFile(const byte *vga) {
p += sizeof(ImageHeader_Feeble);
}
}
+#endif
void AGOSEngine_Simon1::dumpVgaFile(const byte *vga) {
const byte *pp;
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 7877e19646..a7b5b91602 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -66,17 +66,21 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = {
};
static const PlainGameDescriptor simonGames[] = {
+#ifdef ENABLE_PN
{"pn", "Personal Nightmare"},
+#endif
{"elvira1", "Elvira - Mistress of the Dark"},
{"elvira2", "Elvira II - The Jaws of Cerberus"},
{"waxworks", "Waxworks"},
{"simon1", "Simon the Sorcerer 1"},
{"simon2", "Simon the Sorcerer 2"},
+#ifdef ENABLE_AGOS2
{"feeble", "The Feeble Files"},
{"dimp", "Demon in my Pocket"},
{"jumble", "Jumble"},
{"puzzle", "NoPatience"},
{"swampy", "Swampy Adventures"},
+#endif
{0, 0}
};
@@ -158,6 +162,7 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
case AGOS::GType_SIMON2:
*engine = new AGOS::AGOSEngine_Simon2(syst);
break;
+#ifdef ENABLE_AGOS2
case AGOS::GType_FF:
if (gd->features & GF_DEMO)
*engine = new AGOS::AGOSEngine_FeebleDemo(syst);
@@ -167,6 +172,7 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
case AGOS::GType_PP:
*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
break;
+#endif
default:
res = false;
error("AGOS engine: unknown gameType");
diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h
index 533f35d304..2a6cf4f752 100644
--- a/engines/agos/detection_tables.h
+++ b/engines/agos/detection_tables.h
@@ -32,6 +32,7 @@ using Common::GUIO_NOSPEECH;
using Common::GUIO_NOSUBTITLES;
static const AGOSGameDescription gameDescriptions[] = {
+#ifdef ENABLE_PN
// Personal Nightmare 1.1 - English Amiga
{
{
@@ -123,6 +124,7 @@ static const AGOSGameDescription gameDescriptions[] = {
GID_PN,
GF_OLD_BUNDLE | GF_CRUNCHED | GF_EGA | GF_PLANAR
},
+#endif
// Elvira 1 - English Amiga Floppy Demo
{
@@ -2335,6 +2337,7 @@ static const AGOSGameDescription gameDescriptions[] = {
GF_TALKIE
},
+#ifdef ENABLE_AGOS2
// The Feeble Files - English DOS Demo
{
{
@@ -2807,6 +2810,7 @@ static const AGOSGameDescription gameDescriptions[] = {
GID_SWAMPY,
GF_OLD_BUNDLE | GF_TALKIE
},
+#endif
{ AD_TABLE_END_MARKER, 0, 0, 0 }
};
diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp
index 368da5db83..35023885cc 100644
--- a/engines/agos/draw.cpp
+++ b/engines/agos/draw.cpp
@@ -46,6 +46,7 @@ byte *AGOSEngine::getScaleBuf() {
return (byte *)_scaleBuf->pixels;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::animateSpritesByY() {
VgaSprite *vsp;
VgaPointersEntry *vpe;
@@ -147,6 +148,7 @@ void AGOSEngine_Feeble::animateSprites() {
_displayScreen = true;
}
+#endif
void AGOSEngine::animateSprites() {
VgaSprite *vsp;
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index cbb09e1ec7..0c7c1feb51 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -552,6 +552,7 @@ void AGOSEngine::delay(uint amount) {
} while (cur < start + amount && !shouldQuit());
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_PuzzlePack::timerProc() {
_lastTickCount = _system->getMillis();
@@ -609,6 +610,7 @@ void AGOSEngine_Feeble::timerProc() {
_videoLockOut &= ~2;
}
+#endif
#ifdef ENABLE_PN
void AGOSEngine_PN::timerProc() {
@@ -677,6 +679,7 @@ void AGOSEngine::timerProc() {
_videoLockOut &= ~2;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_PuzzlePack::dimpIdle() {
int z, n;
@@ -758,5 +761,6 @@ void AGOSEngine_PuzzlePack::dimpIdle() {
}
}
}
+#endif
} // End of namespace AGOS
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp
index 1b5a820260..a7bd1895c5 100644
--- a/engines/agos/gfx.cpp
+++ b/engines/agos/gfx.cpp
@@ -226,6 +226,7 @@ bool AGOSEngine::drawImage_clip(VC10_state *state) {
return (state->draw_width != 0 && state->draw_height != 0);
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::scaleClip(int16 h, int16 w, int16 y, int16 x, int16 scrollY) {
Common::Rect srcRect, dstRect;
float factor, xscale;
@@ -461,6 +462,7 @@ void AGOSEngine_Feeble::drawImage(VC10_state *state) {
} while (--state->draw_height);
}
}
+#endif
void AGOSEngine_Simon1::drawMaskedImage(VC10_state *state) {
if (getGameType() == GType_SIMON1 && (_windowNum == 3 || _windowNum == 4 || _windowNum >= 10)) {
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index d06e4ec6fc..cb37cf3841 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -374,6 +374,7 @@ void AGOSEngine::drawIcon(WindowBlock *window, uint icon, uint x, uint y) {
_videoLockOut &= ~0x8000;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::drawIconArray(uint num, Item *itemRef, int line, int classMask) {
Item *item_ptr_org = itemRef;
WindowBlock *window;
@@ -477,6 +478,7 @@ l1:; itemRef = derefItem(itemRef->next);
window->iconPtr->upArrow = _scrollUpHitArea;
window->iconPtr->downArrow = _scrollDownHitArea;
}
+#endif
void AGOSEngine::drawIconArray(uint num, Item *itemRef, int line, int classMask) {
Item *item_ptr_org = itemRef;
@@ -581,6 +583,7 @@ void AGOSEngine::drawIconArray(uint num, Item *itemRef, int line, int classMask)
}
}
+#ifdef ENABLE_AGOS2
uint AGOSEngine_Feeble::setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *itemPtr) {
HitArea *ha = findEmptyHitArea();
@@ -596,6 +599,7 @@ uint AGOSEngine_Feeble::setupIconHitArea(WindowBlock *window, uint num, uint x,
return ha - _hitAreas;
}
+#endif
uint AGOSEngine_Simon2::setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *itemPtr) {
HitArea *ha = findEmptyHitArea();
@@ -683,6 +687,7 @@ uint AGOSEngine::setupIconHitArea(WindowBlock *window, uint num, uint x, uint y,
return ha - _hitAreas;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::addArrows(WindowBlock *window, uint8 num) {
HitArea *ha;
@@ -712,6 +717,7 @@ void AGOSEngine_Feeble::addArrows(WindowBlock *window, uint8 num) {
ha->window = window;
ha->verb = 1;
}
+#endif
void AGOSEngine_Simon2::addArrows(WindowBlock *window, uint8 num) {
HitArea *ha;
diff --git a/engines/agos/module.mk b/engines/agos/module.mk
index a7042fa2ad..41305620f8 100644
--- a/engines/agos/module.mk
+++ b/engines/agos/module.mk
@@ -2,7 +2,6 @@ MODULE := engines/agos
MODULE_OBJS := \
agos.o \
- animation.o \
charset.o \
charset-fontdata.o \
contain.o \
@@ -12,7 +11,6 @@ MODULE_OBJS := \
detection.o \
draw.o \
event.o \
- feeble.o \
gfx.o \
icons.o \
input.o \
@@ -20,8 +18,6 @@ MODULE_OBJS := \
menus.o \
midi.o \
midiparser_s1d.o \
- oracle.o \
- pn.o \
res.o \
res_ami.o \
res_snd.o \
@@ -30,26 +26,38 @@ MODULE_OBJS := \
script.o \
script_e1.o \
script_e2.o \
- script_pn.o \
script_ww.o \
script_s1.o \
script_s2.o \
- script_ff.o \
- script_pp.o \
sound.o \
string.o \
subroutine.o \
verb.o \
vga.o \
vga_e2.o \
- vga_pn.o \
vga_ww.o \
vga_s1.o \
vga_s2.o \
- vga_ff.o \
window.o \
zones.o
+ifdef ENABLE_PN
+MODULE_OBJS += \
+ pn.o \
+ script_pn.o \
+ vga_pn.o
+endif
+
+ifdef ENABLE_AGOS2
+MODULE_OBJS += \
+ animation.o \
+ feeble.o \
+ oracle.o \
+ script_ff.o \
+ script_pp.o \
+ vga_ff.o
+endif
+
# This module can be built as a plugin
ifeq ($(ENABLE_AGOS), DYNAMIC_PLUGIN)
PLUGIN := 1
diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp
index 4278ed11e6..e7e9920ced 100644
--- a/engines/agos/res.cpp
+++ b/engines/agos/res.cpp
@@ -39,25 +39,27 @@ using Common::File;
namespace AGOS {
+#ifdef ENABLE_AGOS2
uint16 AGOSEngine_Feeble::to16Wrapper(uint value) {
return TO_LE_16(value);
}
-uint16 AGOSEngine::to16Wrapper(uint value) {
- return TO_BE_16(value);
-}
-
uint16 AGOSEngine_Feeble::readUint16Wrapper(const void *src) {
return READ_LE_UINT16(src);
}
-uint16 AGOSEngine::readUint16Wrapper(const void *src) {
- return READ_BE_UINT16(src);
-}
-
uint32 AGOSEngine_Feeble::readUint32Wrapper(const void *src) {
return READ_LE_UINT32(src);
}
+#endif
+
+uint16 AGOSEngine::to16Wrapper(uint value) {
+ return TO_BE_16(value);
+}
+
+uint16 AGOSEngine::readUint16Wrapper(const void *src) {
+ return READ_BE_UINT16(src);
+}
uint32 AGOSEngine::readUint32Wrapper(const void *src) {
return READ_BE_UINT32(src);
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index e3052e7d2f..d5146ae408 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -25,6 +25,8 @@
+#include "common/file.h"
+
#include "agos/agos.h"
#include "agos/intern.h"
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index 77b503b2e3..0d31c0353d 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/file.h"
#include "common/savefile.h"
#include "common/system.h"
@@ -72,6 +73,7 @@ int AGOSEngine::countSaveGames() {
return i;
}
+#ifdef ENABLE_AGOS2
char *AGOSEngine_PuzzlePack::genSaveName(int slot) {
static char buf[20];
@@ -88,6 +90,7 @@ char *AGOSEngine_Feeble::genSaveName(int slot) {
sprintf(buf, "feeble.%.3d", slot);
return buf;
}
+#endif
char *AGOSEngine_Simon2::genSaveName(int slot) {
static char buf[20];
diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp
index 3773b1fa10..6fa0b5d97f 100644
--- a/engines/agos/string.cpp
+++ b/engines/agos/string.cpp
@@ -25,6 +25,8 @@
+#include "common/file.h"
+
#include "agos/agos.h"
#include "agos/intern.h"
@@ -560,6 +562,7 @@ void AGOSEngine::printScreenText(uint vgaSpriteId, uint color, const char *strin
}
}
+#ifdef ENABLE_AGOS2
// The Feeble Files specific
void AGOSEngine_Feeble::printScreenText(uint vgaSpriteId, uint color, const char *string, int16 x, int16 y, int16 width) {
char convertedString[320];
@@ -693,6 +696,7 @@ void AGOSEngine_Feeble::sendInteractText(uint16 num, const char *fmt, ...) {
printInteractText(num, string);
}
+#endif
// Waxworks specific
uint16 AGOSEngine_Waxworks::getBoxSize() {
diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp
index 70ad3404f5..a4aa81a171 100644
--- a/engines/agos/subroutine.cpp
+++ b/engines/agos/subroutine.cpp
@@ -25,6 +25,8 @@
+#include "common/file.h"
+
#include "agos/agos.h"
#include "agos/intern.h"
diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp
index 8376ebb28e..8e425e0b64 100644
--- a/engines/agos/verb.cpp
+++ b/engines/agos/verb.cpp
@@ -203,6 +203,7 @@ static const char *const czech_verb_prep_names[] = {
"", "", "", "komu ?"
};
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::clearName() {
stopAnimateSimon2(2, 6);
_lastNameOn = NULL;
@@ -210,6 +211,7 @@ void AGOSEngine_Feeble::clearName() {
_mouseAnim = 1;
return;
}
+#endif
void AGOSEngine_Simon2::clearName() {
if (getBitFlag(79)) {
@@ -530,6 +532,7 @@ void AGOSEngine::defineBox(int id, int x, int y, int width, int height, int flag
_needHitAreaRecalc++;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_PuzzlePack::resetVerbs() {
_verbHitArea = 300;
}
@@ -559,6 +562,7 @@ void AGOSEngine_Feeble::resetVerbs() {
setVerb(NULL);
}
}
+#endif
void AGOSEngine::resetVerbs() {
if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2)
@@ -590,6 +594,7 @@ void AGOSEngine::resetVerbs() {
}
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::setVerb(HitArea *ha) {
int cursor = _mouseCursor;
if (_noRightClick)
@@ -616,6 +621,7 @@ void AGOSEngine_Feeble::setVerb(HitArea *ha) {
_needHitAreaRecalc++;
_verbHitArea = cursor + 300;
}
+#endif
void AGOSEngine::setVerb(HitArea *ha) {
HitArea *tmp = _currentVerbBox;
@@ -654,9 +660,11 @@ void AGOSEngine::setVerb(HitArea *ha) {
_currentVerbBox = ha;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::hitarea_leave(HitArea *ha, bool state) {
invertBox(ha, state);
}
+#endif
void AGOSEngine::hitarea_leave(HitArea *ha, bool state) {
if (getGameType() == GType_SIMON2) {
@@ -917,6 +925,7 @@ void AGOSEngine::displayName(HitArea *ha) {
_lastNameOn = ha;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::invertBox(HitArea *ha, bool state) {
if (getBitFlag(205) || getBitFlag(206)) {
if (state != 0) {
@@ -959,6 +968,7 @@ void AGOSEngine_Feeble::invertBox(HitArea *ha, bool state) {
}
}
}
+#endif
void AGOSEngine::invertBox(HitArea *ha, byte a, byte b, byte c, byte d) {
byte *src, color;
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index 7855d0e805..1344be6b3a 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -106,7 +106,7 @@ void AGOSEngine_Elvira1::setupVideoOpcodes(VgaOpcodeProc *op) {
op[20] = &AGOSEngine::vc19_loop;
op[21] = &AGOSEngine::vc20_setRepeat;
op[22] = &AGOSEngine::vc21_endRepeat;
- op[23] = &AGOSEngine::vc22_setPaletteOld;
+ op[23] = &AGOSEngine::vc22_setPalette;
op[24] = &AGOSEngine::vc23_setPriority;
op[25] = &AGOSEngine::vc24_setSpriteXY;
op[26] = &AGOSEngine::vc25_halt_sprite;
@@ -918,7 +918,7 @@ static const uint8 iconPalette[64] = {
0x77, 0x55, 0x00,
};
-void AGOSEngine::vc22_setPaletteOld() {
+void AGOSEngine::vc22_setPalette() {
byte *offs, *palptr, *src;
uint16 b, num;
@@ -1302,12 +1302,7 @@ void AGOSEngine::vc36_setWindowImage() {
_displayScreen = false;
uint16 vga_res = vcReadNextWord();
uint16 windowNum = vcReadNextWord();
-
- if (getGameType() == GType_FF || getGameType() == GType_PP) {
- fillBackGroundFromFront();
- } else {
- setWindowImage(windowNum, vga_res);
- }
+ setWindowImage(windowNum, vga_res);
}
void AGOSEngine::vc37_pokePalette() {
diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp
index de3cb55963..1bbc7f4849 100644
--- a/engines/agos/vga_e2.cpp
+++ b/engines/agos/vga_e2.cpp
@@ -40,7 +40,7 @@ void AGOSEngine_Elvira2::setupVideoOpcodes(VgaOpcodeProc *op) {
op[17] = &AGOSEngine::vc17_waitEnd;
op[19] = &AGOSEngine::vc19_loop;
- op[22] = &AGOSEngine::vc22_setPaletteOld;
+ op[22] = &AGOSEngine::vc22_setPalette;
op[28] = &AGOSEngine::vc28_playSFX;
op[32] = &AGOSEngine::vc32_saveScreen;
op[37] = &AGOSEngine::vc37_pokePalette;
diff --git a/engines/agos/vga_ff.cpp b/engines/agos/vga_ff.cpp
index 14451a3dbe..694aa3ba28 100644
--- a/engines/agos/vga_ff.cpp
+++ b/engines/agos/vga_ff.cpp
@@ -68,6 +68,57 @@ int AGOSEngine::getScale(int16 y, int16 x) {
}
}
+void AGOSEngine_Feeble::vc36_setWindowImage() {
+ _displayScreen = false;
+ vcReadNextWord();
+ vcReadNextWord();
+ fillBackGroundFromFront();
+}
+
+void AGOSEngine_Feeble::vc48_setPathFinder() {
+ uint16 a = (uint16)_variableArrayPtr[12];
+ const uint16 *p = _pathFindArray[a - 1];
+
+ VgaSprite *vsp = findCurSprite();
+ int16 x, y, ydiff;
+ int16 x1, y1, x2, y2;
+ uint pos = 0;
+
+ x = vsp->x;
+ while (x >= (int16)readUint16Wrapper(p + 2)) {
+ p += 2;
+ pos++;
+ }
+
+ x1 = readUint16Wrapper(p);
+ y1 = readUint16Wrapper(p + 1);
+ x2 = readUint16Wrapper(p + 2);
+ y2 = readUint16Wrapper(p + 3);
+
+ if (x2 != 9999) {
+ ydiff = y2 - y1;
+ if (ydiff < 0) {
+ ydiff = -ydiff;
+ x = vsp->x & 7;
+ ydiff *= x;
+ ydiff /= 8;
+ ydiff = -ydiff;
+ } else {
+ x = vsp->x & 7;
+ ydiff *= x;
+ ydiff /= 8;
+ }
+ y1 += ydiff;
+ }
+
+ y = vsp->y;
+ vsp->y = y1;
+ checkScrollY(y1 - y, y1);
+
+ _variableArrayPtr[11] = x1;
+ _variableArrayPtr[13] = pos;
+}
+
void AGOSEngine::vc75_setScale() {
_baseY = vcReadNextWord();
_scale = vcReadNextWord() / 1000000.0f;
diff --git a/engines/agos/vga_s1.cpp b/engines/agos/vga_s1.cpp
index b1ae26437e..bb13d211fe 100644
--- a/engines/agos/vga_s1.cpp
+++ b/engines/agos/vga_s1.cpp
@@ -36,7 +36,7 @@ void AGOSEngine_Simon1::setupVideoOpcodes(VgaOpcodeProc *op) {
op[11] = &AGOSEngine::vc11_clearPathFinder;
op[17] = &AGOSEngine::vc17_setPathfinderItem;
- op[22] = &AGOSEngine::vc22_setPaletteNew;
+ op[22] = &AGOSEngine::vc22_setPalette;
op[32] = &AGOSEngine::vc32_copyVar;
op[37] = &AGOSEngine::vc37_addToSpriteY;
op[48] = &AGOSEngine::vc48_setPathFinder;
@@ -96,7 +96,7 @@ static const uint8 customPalette[96] = {
0xFF, 0xFF, 0x77,
};
-void AGOSEngine::vc22_setPaletteNew() {
+void AGOSEngine_Simon1::vc22_setPalette() {
byte *offs, *palptr = 0, *src;
uint16 a = 0, b, num, palSize = 0;
@@ -186,73 +186,32 @@ void AGOSEngine::vc48_setPathFinder() {
uint16 a = (uint16)_variableArrayPtr[12];
const uint16 *p = _pathFindArray[a - 1];
- if (getGameType() == GType_FF || getGameType() == GType_PP) {
- VgaSprite *vsp = findCurSprite();
- int16 x, y, ydiff;
- int16 x1, y1, x2, y2;
- uint pos = 0;
-
- x = vsp->x;
- while (x >= (int16)readUint16Wrapper(p + 2)) {
- p += 2;
- pos++;
- }
-
- x1 = readUint16Wrapper(p);
- y1 = readUint16Wrapper(p + 1);
- x2 = readUint16Wrapper(p + 2);
- y2 = readUint16Wrapper(p + 3);
-
- if (x2 != 9999) {
- ydiff = y2 - y1;
- if (ydiff < 0) {
- ydiff = -ydiff;
- x = vsp->x & 7;
- ydiff *= x;
- ydiff /= 8;
- ydiff = -ydiff;
- } else {
- x = vsp->x & 7;
- ydiff *= x;
- ydiff /= 8;
- }
- y1 += ydiff;
- }
-
- y = vsp->y;
- vsp->y = y1;
- checkScrollY(y1 - y, y1);
-
- _variableArrayPtr[11] = x1;
- _variableArrayPtr[13] = pos;
- } else {
- uint b = (uint16)_variableArray[13];
- p += b * 2 + 1;
- int c = _variableArray[14];
+ uint b = (uint16)_variableArray[13];
+ p += b * 2 + 1;
+ int c = _variableArray[14];
- int step;
- int y1, y2;
- int16 *vp;
+ int step;
+ int y1, y2;
+ int16 *vp;
- step = 2;
- if (c < 0) {
- c = -c;
- step = -2;
- }
+ step = 2;
+ if (c < 0) {
+ c = -c;
+ step = -2;
+ }
- vp = &_variableArray[20];
+ vp = &_variableArray[20];
- do {
- y2 = readUint16Wrapper(p);
- p += step;
- y1 = readUint16Wrapper(p) - y2;
+ do {
+ y2 = readUint16Wrapper(p);
+ p += step;
+ y1 = readUint16Wrapper(p) - y2;
- vp[0] = y1 / 2;
- vp[1] = y1 - (y1 / 2);
+ vp[0] = y1 / 2;
+ vp[1] = y1 - (y1 / 2);
- vp += 2;
- } while (--c);
- }
+ vp += 2;
+ } while (--c);
}
void AGOSEngine::vc59_ifSpeech() {
diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp
index a578568a03..8bf4102067 100644
--- a/engines/agos/window.cpp
+++ b/engines/agos/window.cpp
@@ -122,6 +122,7 @@ void AGOSEngine::clearWindow(WindowBlock *window) {
window->scrollY = 0;
}
+#ifdef ENABLE_AGOS2
void AGOSEngine_Feeble::colorWindow(WindowBlock *window) {
byte *dst;
uint16 h, w;
@@ -140,6 +141,7 @@ void AGOSEngine_Feeble::colorWindow(WindowBlock *window) {
_videoLockOut &= ~0x8000;
}
+#endif
void AGOSEngine::colorWindow(WindowBlock *window) {
uint16 y, h;
diff --git a/engines/engines.mk b/engines/engines.mk
index 8d7d8de9ff..ff2b7c0a3e 100644
--- a/engines/engines.mk
+++ b/engines/engines.mk
@@ -24,6 +24,10 @@ MODULES += engines/agos
ifdef ENABLE_PN
DEFINES += -DENABLE_PN
endif
+
+ifdef ENABLE_AGOS2
+DEFINES += -DENABLE_AGOS2
+endif
endif
ifdef ENABLE_CINE