aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorTravis Howell2006-10-08 07:42:34 +0000
committerTravis Howell2006-10-08 07:42:34 +0000
commit07183595e79ddbe2bdc2c07da461d2baf60b6cb1 (patch)
treec6a6e7e63105a6b6fdb0cdbaaf54e434a8f01a75 /engines/agos
parent56153086e5be87cd0542c620cd5417b1d4779f41 (diff)
downloadscummvm-rg350-07183595e79ddbe2bdc2c07da461d2baf60b6cb1.tar.gz
scummvm-rg350-07183595e79ddbe2bdc2c07da461d2baf60b6cb1.tar.bz2
scummvm-rg350-07183595e79ddbe2bdc2c07da461d2baf60b6cb1.zip
Add a few palette differences and fix input in Elvira 1
svn-id: r24190
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.cpp19
-rw-r--r--engines/agos/agos.h4
-rw-r--r--engines/agos/items.cpp29
-rw-r--r--engines/agos/rooms.cpp2
-rw-r--r--engines/agos/vga.cpp93
5 files changed, 132 insertions, 15 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index f4e1ff24d7..8ab1811d1b 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -145,7 +145,6 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_hitarea_unk_3 = 0;
_mortalFlag = 0;
_updateScreen = false;
- _usePaletteDelay = 0;
_syncFlag2 = 0;
_inCallBack = 0;
_cepeFlag = 0;
@@ -253,15 +252,18 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_scrollUpHitArea = 0;
_scrollDownHitArea = 0;
- _fastFadeInFlag = 0;
_noOverWrite = 0;
_rejectBlock = false;
+ _fastFadeCount = 0;
+ _fastFadeInFlag = 0;
_fastFadeOutFlag = 0;
_unkPalFlag = 0;
+ _usePaletteDelay = 0;
_exitCutscene = 0;
_paletteFlag = 0;
+ _bottomPalette = 0;
_picture8600 = 0;
_soundFileId = 0;
@@ -271,8 +273,6 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_showPreposition = 0;
_showMessageFlag = 0;
- _fastFadeCount = 0;
-
_vgaSpriteChanged = 0;
_block = 0;
@@ -1305,7 +1305,7 @@ startOver:
_lastHitArea3 = NULL;
for (;;) {
- if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) && _keyPressed == 35)
+ if (getGameType() != GType_FF && getGameType() != GType_PP && _keyPressed == 35)
displayBoxStars();
if (getGameType() == GType_PP) {
if (checkArrows() != 0) {
@@ -1753,6 +1753,15 @@ void AGOSEngine::set_video_mode_internal(uint16 mode, uint16 vga_res_id) {
runVgaScript();
_vcPtr = vc_ptr_org;
+ if (getGameType() == GType_ELVIRA1 && _windowNum == 3 && _bottomPalette != 0) {
+ byte *dst = getBackBuf() + 42560;
+ int size = 21440;
+
+ while (size--) {
+ *dst += 0x10;
+ dst++;
+ }
+ }
if (getGameType() == GType_FF || getGameType() == GType_PP) {
fillFrontFromBack(0, 0, _screenWidth, _screenHeight);
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index fece720eaf..d7d9806e0b 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -274,7 +274,6 @@ protected:
bool _hitarea_unk_3;
bool _mortalFlag;
bool _updateScreen;
- bool _usePaletteDelay;
bool _syncFlag2;
bool _inCallBack;
bool _cepeFlag;
@@ -378,7 +377,9 @@ protected:
bool _fastFadeOutFlag;
bool _unkPalFlag;
+ bool _usePaletteDelay;
byte _paletteFlag;
+ int _bottomPalette;
uint _fastFadeCount;
volatile uint16 _fastFadeInFlag;
@@ -1066,6 +1067,7 @@ public:
void oe1_means();
void oe1_setUserItem();
void oe1_getUserItem();
+ void oe1_whereTo();
void oe1_clearUserItem();
void oe1_findMaster();
void oe1_nextMaster();
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 1f5c01a77b..a461666f3a 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -269,7 +269,7 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) {
op[177] = &AGOSEngine::oe1_getUserItem;
op[178] = &AGOSEngine::oe1_clearUserItem;
- op[180] = &AGOSEngine::oww_whereTo;
+ op[180] = &AGOSEngine::oe1_whereTo;
op[198] = &AGOSEngine::o_comment;
@@ -1168,15 +1168,24 @@ void AGOSEngine::o_defWindow() {
uint w = getVarOrWord();
uint h = getVarOrWord();
uint flags = getVarOrWord();
- uint fill_color = getVarOrWord();
- uint text_color = 0;
+ uint color = getVarOrWord();
+
+ uint fillColor, textColor;
+ if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 ||
+ getGameType() == GType_WW) {
+ fillColor = color % 100;
+ textColor = color / 100;
+ } else {
+ fillColor = getVarOrWord();
+ textColor = 0;
+ }
num &= 7;
if (_windowArray[num])
closeWindow(num);
- _windowArray[num] = openWindow(x, y, w, h, flags, fill_color, text_color);
+ _windowArray[num] = openWindow(x, y, w, h, flags, fillColor, textColor);
if (num == _curWindow) {
_textWindow = _windowArray[num];
@@ -1960,6 +1969,18 @@ void AGOSEngine::oe1_getUserItem() {
_objectItem = derefItem(getUserItem(i, n));
}
+void AGOSEngine::oe1_whereTo() {
+ // 180: where to
+ Item *i = getNextItemPtr();
+ int16 d = getVarOrByte();
+ int16 f = getVarOrByte();
+
+ if (f == 1)
+ _subjectItem = derefItem(getExitOf_e1(i, d));
+ else
+ _objectItem = derefItem(getExitOf_e1(i, d));
+}
+
void AGOSEngine::oe1_clearUserItem() {
// 178: clear user item
Item *i = getNextItemPtr();
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index 5d7e65785f..2de093b32d 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -86,7 +86,7 @@ uint16 AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
x = derefItem(g->dest[d]);
if (x == NULL)
return 0;
- if (findChildOfType(x, 1))
+ if (isRoom(x))
return itemPtrToID(x);
if (x->state != 0)
return 0;
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index c730e132fd..79501534c0 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -1485,6 +1485,7 @@ void AGOSEngine::drawImages(VC10_state *state) {
src = state->depack_src + (state->width * state->y_skip) * 8;
dst = state->surf_addr;
state->x_skip *= 4;
+
do {
for (count = 0; count != state->draw_width; count++) {
byte color;
@@ -1498,7 +1499,6 @@ void AGOSEngine::drawImages(VC10_state *state) {
dst += _screenWidth;
src += state->width * 8;
} while (--state->draw_height);
- /* vc10_helper_7 */
}
}
}
@@ -1759,6 +1759,7 @@ void AGOSEngine::vc21_endRepeat() {
}
}
+// TODO: Split this code into specific games!
void AGOSEngine::vc22_setSpritePalette() {
byte *offs, *palptr, *src;
uint16 a = 0, b, num, palSize;
@@ -1786,9 +1787,12 @@ void AGOSEngine::vc22_setSpritePalette() {
palptr = _displayPalette;
offs = _curVgaFile1 + READ_BE_UINT16(_curVgaFile1 + 6);
+ _bottomPalette = 1;
+
if (getGameType() == GType_ELVIRA1) {
if (b >= 1000) {
b -= 1000;
+ _bottomPalette = 0;
} else {
num = 13;
@@ -1806,6 +1810,86 @@ void AGOSEngine::vc22_setSpritePalette() {
palptr[15 * 4 + 1] = 192;
palptr[15 * 4 + 2] = 40;
palptr[15 * 4 + 3] = 0;
+
+ palptr[16 * 4 + 0] = 0;
+ palptr[16 * 4 + 1] = 0;
+ palptr[16 * 4 + 2] = 0;
+ palptr[16 * 4 + 3] = 0;
+
+ palptr[17 * 4 + 0] = 16;
+ palptr[17 * 4 + 1] = 0;
+ palptr[17 * 4 + 2] = 0;
+ palptr[17 * 4 + 3] = 0;
+
+ palptr[18 * 4 + 0] = 8;
+ palptr[18 * 4 + 1] = 8;
+ palptr[18 * 4 + 2] = 0;
+ palptr[18 * 4 + 3] = 0;
+
+ palptr[19 * 4 + 0] = 48;
+ palptr[19 * 4 + 1] = 24;
+ palptr[19 * 4 + 2] = 0;
+ palptr[19 * 4 + 3] = 0;
+
+ palptr[20 * 4 + 0] = 56;
+ palptr[20 * 4 + 1] = 40;
+ palptr[20 * 4 + 2] = 0;
+ palptr[20 * 4 + 3] = 0;
+
+ palptr[21 * 4 + 0] = 0;
+ palptr[21 * 4 + 1] = 0;
+ palptr[21 * 4 + 2] = 24;
+ palptr[21 * 4 + 3] = 0;
+
+ palptr[22 * 4 + 0] = 8;
+ palptr[22 * 4 + 1] = 16;
+ palptr[22 * 4 + 2] = 24;
+ palptr[22 * 4 + 3] = 0;
+
+ palptr[23 * 4 + 0] = 24;
+ palptr[23 * 4 + 1] = 32;
+ palptr[23 * 4 + 2] = 40;
+ palptr[23 * 4 + 3] = 0;
+
+ palptr[24 * 4 + 0] = 16;
+ palptr[24 * 4 + 1] = 24;
+ palptr[24 * 4 + 2] = 0;
+ palptr[24 * 4 + 3] = 0;
+
+ palptr[25 * 4 + 0] = 24;
+ palptr[25 * 4 + 1] = 8;
+ palptr[25 * 4 + 2] = 0;
+ palptr[25 * 4 + 3] = 0;
+
+ palptr[26 * 4 + 0] = 16;
+ palptr[26 * 4 + 1] = 16;
+ palptr[26 * 4 + 2] = 0;
+ palptr[26 * 4 + 3] = 0;
+
+ palptr[27 * 4 + 0] = 40;
+ palptr[27 * 4 + 1] = 40;
+ palptr[27 * 4 + 2] = 32;
+ palptr[27 * 4 + 3] = 0;
+
+ palptr[28 * 4 + 0] = 32;
+ palptr[28 * 4 + 1] = 32;
+ palptr[28 * 4 + 2] = 24;
+ palptr[28 * 4 + 3] = 0;
+
+ palptr[29 * 4 + 0] = 40;
+ palptr[29 * 4 + 1] = 0;
+ palptr[29 * 4 + 2] = 0;
+ palptr[29 * 4 + 3] = 0;
+
+ palptr[30 * 4 + 0] = 24;
+ palptr[30 * 4 + 1] = 24;
+ palptr[30 * 4 + 2] = 16;
+ palptr[30 * 4 + 3] = 0;
+
+ palptr[31 * 4 + 0] = 48;
+ palptr[31 * 4 + 1] = 48;
+ palptr[31 * 4 + 2] = 40;
+ palptr[31 * 4 + 3] = 0;
}
}
}
@@ -2004,9 +2088,10 @@ void AGOSEngine::vc34_setMouseOff() {
}
void AGOSEngine::vc35_clearWindow() {
- /* unused */
- _vcPtr += 4;
- _vgaSpriteChanged++;
+ uint16 num = vcReadNextWord();
+ uint16 color = vcReadNextWord();
+
+ debug(0, "vc35_clearWindow: window %d color %d\n", num, color);
}
void AGOSEngine::vc36_setWindowImage() {