aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudvig Strigeus2001-10-17 10:07:40 +0000
committerLudvig Strigeus2001-10-17 10:07:40 +0000
commit632c4cc8b69797d62b8f4fbe47c326ddf51298c1 (patch)
treeac4e941535227297a9008e128082c85384d9936c
parente3efa056d2e0c738fed24de830f9ae7f13c66ad9 (diff)
downloadscummvm-rg350-632c4cc8b69797d62b8f4fbe47c326ddf51298c1.tar.gz
scummvm-rg350-632c4cc8b69797d62b8f4fbe47c326ddf51298c1.tar.bz2
scummvm-rg350-632c4cc8b69797d62b8f4fbe47c326ddf51298c1.zip
fixed verbs not saved in non dott games,
implemented a screen effect svn-id: r3438
-rw-r--r--gfx.cpp121
-rw-r--r--saveload.cpp6
-rw-r--r--scumm.h18
-rw-r--r--scummvm.cpp13
4 files changed, 143 insertions, 15 deletions
diff --git a/gfx.cpp b/gfx.cpp
index 0ac5b01dac..f5540a723f 100644
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
+ * Revision 1.7 2001/10/17 10:07:39 strigeus
+ * fixed verbs not saved in non dott games,
+ * implemented a screen effect
+ *
* Revision 1.6 2001/10/17 07:12:37 strigeus
* fixed nasty signed/unsigned bug
*
@@ -302,7 +306,6 @@ void Scumm::setCursor(int cursor) {
src = cur->data;
i=16;
do {
-/* TODO: endian trouble */
data = ((src[0]<<16) | (src[1]<<8))>>shramount;
src += 2;
mask[0] = (byte)(data>>24);
@@ -569,7 +572,7 @@ void Scumm::unkVirtScreen4(int a) {
switch(a) {
case 1: case 2: case 3:
- unkVirtScreen5(a-1);
+ unkScreenEffect7(a-1);
break;
case 128:
unkScreenEffect6();
@@ -1450,9 +1453,103 @@ int Scumm::findVirtScreen(int y) {
return -1;
}
-void Scumm::unkVirtScreen5(int a) {
+void Scumm::unkScreenEffect1() {
+ /* XXX: not implemented */
+ warning("stub unkScreenEffect1()");
+}
+
+void Scumm::unkScreenEffect2() {
/* XXX: not implemented */
- warning("stub unkVirtScreen5(%d)", a);
+ warning("stub unkScreenEffect2()");
+}
+
+void Scumm::unkScreenEffect3() {
+ /* XXX: not implemented */
+ warning("stub unkScreenEffect3()");
+}
+
+void Scumm::unkScreenEffect4() {
+ /* XXX: not implemented */
+ warning("stub unkScreenEffect4()");
+}
+
+static const int8 screen_eff7_table1[4][16] = {
+ {1,1,-1,1,-1,1,-1,-1,
+ 1,-1,-1,-1,1,1,1,-1},
+ {0,1,2,1,2,0,2,1,
+ 2,0,2,1,0,0,0,0},
+ {-2,-1,0,-1,-2,-1,-2,0
+ -2,-1,-2,0,0,0,0,0},
+ {0,-1,-2,-1,-2,0,-2,-1
+ -2,0,-2,-1,0,0,0,0}
+};
+
+static const byte screen_eff7_table2[4][16] = {
+ {0,0,39,0,39,0,39,24,
+ 0,24,39,24,0,0,0,24},
+ {0,0,0,0,0,0,0,0,
+ 1,0,1,0,255,0,0,0},
+ {39,24,39,24,39,24,39,24,
+ 38,24,38,24,255,0,0,0},
+ {0,24,39,24,39,0,39,24,
+ 38,0,38,24,255,0,0,0}
+};
+
+static const byte screen_eff7_table3[4] = {
+ 13,25,25,25
+};
+
+void Scumm::unkScreenEffect7(int a) {
+ int tab_1[16];
+ int tab_2[16];
+ int i,j;
+ int bottom;
+ int *tab2_ptr;
+ int l,t,r,b;
+
+ for (i=0; i<16; i++) {
+ tab_1[i] = screen_eff7_table1[a][i];
+ j = screen_eff7_table2[a][i];
+ if (j==24)
+ j = (virtscr[0].height>>3)-1;
+ tab_2[i] = j;
+ }
+
+ bottom = virtscr[0].height >> 3;
+ for (j=0; j < screen_eff7_table3[a]; j++) {
+ for (i=0; i<4; i++) {
+ l = tab_2[i*4];
+ t = tab_2[i*4+1];
+ r = tab_2[i*4+2];
+ b = tab_2[i*4+3];
+ if (t==b) {
+ while (l <= r) {
+ if (l>=0 && l<40 && (uint)t<(uint)bottom) {
+ virtscr[0].tdirty[l] = t<<3;
+ virtscr[0].bdirty[l] = (t+1)<<3;
+ }
+ l++;
+ }
+ } else {
+ /* DE92 */
+ if (l<0 || l>=40 || b<=t)
+ continue;
+ if (b>bottom)
+ b=bottom;
+ virtscr[0].tdirty[l] = t<<3;
+ virtscr[0].bdirty[l] = (b+1)<<3;
+ }
+ updateDirtyScreen(0);
+ }
+
+ for (i=0; i<16; i++)
+ tab_2[i] += tab_1[i];
+
+ updateScreen(this);
+ waitForTimer(this);
+ }
+ /* XXX: not implemented */
+ warning("stub unkScreenEffect7(%d)", a);
}
void Scumm::unkScreenEffect6() {
@@ -1636,8 +1733,20 @@ void Scumm::palManipulate() {
void Scumm::screenEffect(int effect) {
dseg_3DB6 = 1;
- warning("stub screenEffect(%d)",effect);
- /* TODO: not implemented */
+ switch(effect) {
+ case 1:
+ case 2:
+ case 3: unkScreenEffect7(effect-1); break;
+ case 128: unkScreenEffect6(); break;
+ case 130: unkScreenEffect1(); break;
+ case 131: unkScreenEffect2(); break;
+ case 132: unkScreenEffect3(); break;
+ case 133: unkScreenEffect4(); break;
+ case 134: unkScreenEffect5(0); break;
+ case 135: unkScreenEffect5(1); break;
+ default:
+ warning("Unknown screen effect, %d", effect);
+ }
dseg_4EA0 = 1;
}
diff --git a/saveload.cpp b/saveload.cpp
index 37c7801dba..377b93aec8 100644
--- a/saveload.cpp
+++ b/saveload.cpp
@@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
+ * Revision 1.4 2001/10/17 10:07:39 strigeus
+ * fixed verbs not saved in non dott games,
+ * implemented a screen effect
+ *
* Revision 1.3 2001/10/16 10:01:47 strigeus
* preliminary DOTT support
*
@@ -287,7 +291,7 @@ void Scumm::saveOrLoad(FILE *inout, bool mode) {
MKLINE(Scumm,gdi.unk4,sleByte),
MKLINE(Scumm,gdi.currentCursor,sleByte),
- MKLINE(Scumm,dseg_4F8A,sleUint16),
+ MKLINE(Scumm,doEffect,sleUint16), /* Convert to byte */
MKLINE(Scumm,_switchRoomEffect,sleByte),
MKLINE(Scumm,_newEffect,sleByte),
MKLINE(Scumm,_switchRoomEffect2,sleByte),
diff --git a/scumm.h b/scumm.h
index 0363a4af92..365a3d546e 100644
--- a/scumm.h
+++ b/scumm.h
@@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
+ * Revision 1.11 2001/10/17 10:07:40 strigeus
+ * fixed verbs not saved in non dott games,
+ * implemented a screen effect
+ *
* Revision 1.10 2001/10/17 07:12:37 strigeus
* fixed nasty signed/unsigned bug
*
@@ -604,7 +608,8 @@ struct Scumm {
byte _switchRoomEffect2, _switchRoomEffect;
uint16 dseg_4AC2;
- uint16 dseg_4F8A;
+
+ bool doEffect;
uint16 _drawBmpX;
uint16 dseg_719E;
@@ -946,7 +951,7 @@ struct Scumm {
void unkVirtScreen2();
void updateDirtyScreen(int slot);
void unkVirtScreen4(int a);
- void unkVirtScreen5(int a);
+
void drawStripToScreen();
void restoreMouse();
@@ -1351,9 +1356,14 @@ struct Scumm {
void updateDirtyRect(int virt, int left, int right, int top, int bottom, uint16 dirtybits);
int findVirtScreen(int y);
- void unkScreenEffect6();
+ void unkScreenEffect1();
+ void unkScreenEffect2();
+ void unkScreenEffect3();
+ void unkScreenEffect4();
void unkScreenEffect5(int a);
-
+ void unkScreenEffect6();
+ void unkScreenEffect7(int a);
+
void playSound(int sound);
void decreaseScriptDelay(int amount);
diff --git a/scummvm.cpp b/scummvm.cpp
index 84fd1e0f75..d7af3f0a40 100644
--- a/scummvm.cpp
+++ b/scummvm.cpp
@@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
+ * Revision 1.10 2001/10/17 10:07:40 strigeus
+ * fixed verbs not saved in non dott games,
+ * implemented a screen effect
+ *
* Revision 1.9 2001/10/16 20:31:27 strigeus
* misc fixes
*
@@ -60,9 +64,10 @@ void Scumm::initThings() {
_numVariables = 800;
_numBitVariables = 2048;
_numLocalObjects = 200;
+ _numVerbs = 100;
_inventory = (uint16*)alloc(0x50 * sizeof(uint16));
- _verbs = (VerbSlot*)alloc(102 * sizeof(VerbSlot));
+ _verbs = (VerbSlot*)alloc(100 * sizeof(VerbSlot));
_objs = (ObjectData*)alloc(200 * sizeof(ObjectData));
_vars = (int16*)alloc(800 * sizeof(int16));
_bitVars = (byte*)alloc(2048 >> 3);
@@ -353,9 +358,9 @@ void Scumm::scummMain(int argc, char **argv) {
cyclePalette();
palManipulate();
- if (dseg_4F8A) {
+ if (doEffect) {
+ doEffect = false;
screenEffect(_newEffect);
- dseg_4F8A = 0;
clearClickedStatus();
}
@@ -534,7 +539,7 @@ void Scumm::startScene(int room, Actor *a, int objectNr) {
a->moving = 0;
}
- dseg_4F8A = 1;
+ doEffect = true;
CHECK_HEAP
}