fixed verbs not saved in non dott games,
implemented a screen effect svn-id: r3438
This commit is contained in:
parent
e3efa056d2
commit
632c4cc8b6
4 changed files with 143 additions and 15 deletions
121
gfx.cpp
121
gfx.cpp
|
@ -17,6 +17,10 @@
|
||||||
*
|
*
|
||||||
* Change Log:
|
* Change Log:
|
||||||
* $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
|
* Revision 1.6 2001/10/17 07:12:37 strigeus
|
||||||
* fixed nasty signed/unsigned bug
|
* fixed nasty signed/unsigned bug
|
||||||
*
|
*
|
||||||
|
@ -302,7 +306,6 @@ void Scumm::setCursor(int cursor) {
|
||||||
src = cur->data;
|
src = cur->data;
|
||||||
i=16;
|
i=16;
|
||||||
do {
|
do {
|
||||||
/* TODO: endian trouble */
|
|
||||||
data = ((src[0]<<16) | (src[1]<<8))>>shramount;
|
data = ((src[0]<<16) | (src[1]<<8))>>shramount;
|
||||||
src += 2;
|
src += 2;
|
||||||
mask[0] = (byte)(data>>24);
|
mask[0] = (byte)(data>>24);
|
||||||
|
@ -569,7 +572,7 @@ void Scumm::unkVirtScreen4(int a) {
|
||||||
|
|
||||||
switch(a) {
|
switch(a) {
|
||||||
case 1: case 2: case 3:
|
case 1: case 2: case 3:
|
||||||
unkVirtScreen5(a-1);
|
unkScreenEffect7(a-1);
|
||||||
break;
|
break;
|
||||||
case 128:
|
case 128:
|
||||||
unkScreenEffect6();
|
unkScreenEffect6();
|
||||||
|
@ -1450,9 +1453,103 @@ int Scumm::findVirtScreen(int y) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::unkVirtScreen5(int a) {
|
void Scumm::unkScreenEffect1() {
|
||||||
/* XXX: not implemented */
|
/* XXX: not implemented */
|
||||||
warning("stub unkVirtScreen5(%d)", a);
|
warning("stub unkScreenEffect1()");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scumm::unkScreenEffect2() {
|
||||||
|
/* XXX: not implemented */
|
||||||
|
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() {
|
void Scumm::unkScreenEffect6() {
|
||||||
|
@ -1636,8 +1733,20 @@ void Scumm::palManipulate() {
|
||||||
|
|
||||||
void Scumm::screenEffect(int effect) {
|
void Scumm::screenEffect(int effect) {
|
||||||
dseg_3DB6 = 1;
|
dseg_3DB6 = 1;
|
||||||
warning("stub screenEffect(%d)",effect);
|
switch(effect) {
|
||||||
/* TODO: not implemented */
|
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;
|
dseg_4EA0 = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
*
|
*
|
||||||
* Change Log:
|
* Change Log:
|
||||||
* $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
|
* Revision 1.3 2001/10/16 10:01:47 strigeus
|
||||||
* preliminary DOTT support
|
* preliminary DOTT support
|
||||||
*
|
*
|
||||||
|
@ -287,7 +291,7 @@ void Scumm::saveOrLoad(FILE *inout, bool mode) {
|
||||||
MKLINE(Scumm,gdi.unk4,sleByte),
|
MKLINE(Scumm,gdi.unk4,sleByte),
|
||||||
MKLINE(Scumm,gdi.currentCursor,sleByte),
|
MKLINE(Scumm,gdi.currentCursor,sleByte),
|
||||||
|
|
||||||
MKLINE(Scumm,dseg_4F8A,sleUint16),
|
MKLINE(Scumm,doEffect,sleUint16), /* Convert to byte */
|
||||||
MKLINE(Scumm,_switchRoomEffect,sleByte),
|
MKLINE(Scumm,_switchRoomEffect,sleByte),
|
||||||
MKLINE(Scumm,_newEffect,sleByte),
|
MKLINE(Scumm,_newEffect,sleByte),
|
||||||
MKLINE(Scumm,_switchRoomEffect2,sleByte),
|
MKLINE(Scumm,_switchRoomEffect2,sleByte),
|
||||||
|
|
18
scumm.h
18
scumm.h
|
@ -17,6 +17,10 @@
|
||||||
*
|
*
|
||||||
* Change Log:
|
* Change Log:
|
||||||
* $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
|
* Revision 1.10 2001/10/17 07:12:37 strigeus
|
||||||
* fixed nasty signed/unsigned bug
|
* fixed nasty signed/unsigned bug
|
||||||
*
|
*
|
||||||
|
@ -604,7 +608,8 @@ struct Scumm {
|
||||||
|
|
||||||
byte _switchRoomEffect2, _switchRoomEffect;
|
byte _switchRoomEffect2, _switchRoomEffect;
|
||||||
uint16 dseg_4AC2;
|
uint16 dseg_4AC2;
|
||||||
uint16 dseg_4F8A;
|
|
||||||
|
bool doEffect;
|
||||||
|
|
||||||
uint16 _drawBmpX;
|
uint16 _drawBmpX;
|
||||||
uint16 dseg_719E;
|
uint16 dseg_719E;
|
||||||
|
@ -946,7 +951,7 @@ struct Scumm {
|
||||||
void unkVirtScreen2();
|
void unkVirtScreen2();
|
||||||
void updateDirtyScreen(int slot);
|
void updateDirtyScreen(int slot);
|
||||||
void unkVirtScreen4(int a);
|
void unkVirtScreen4(int a);
|
||||||
void unkVirtScreen5(int a);
|
|
||||||
|
|
||||||
void drawStripToScreen();
|
void drawStripToScreen();
|
||||||
void restoreMouse();
|
void restoreMouse();
|
||||||
|
@ -1351,9 +1356,14 @@ struct Scumm {
|
||||||
void updateDirtyRect(int virt, int left, int right, int top, int bottom, uint16 dirtybits);
|
void updateDirtyRect(int virt, int left, int right, int top, int bottom, uint16 dirtybits);
|
||||||
int findVirtScreen(int y);
|
int findVirtScreen(int y);
|
||||||
|
|
||||||
void unkScreenEffect6();
|
void unkScreenEffect1();
|
||||||
|
void unkScreenEffect2();
|
||||||
|
void unkScreenEffect3();
|
||||||
|
void unkScreenEffect4();
|
||||||
void unkScreenEffect5(int a);
|
void unkScreenEffect5(int a);
|
||||||
|
void unkScreenEffect6();
|
||||||
|
void unkScreenEffect7(int a);
|
||||||
|
|
||||||
void playSound(int sound);
|
void playSound(int sound);
|
||||||
|
|
||||||
void decreaseScriptDelay(int amount);
|
void decreaseScriptDelay(int amount);
|
||||||
|
|
13
scummvm.cpp
13
scummvm.cpp
|
@ -17,6 +17,10 @@
|
||||||
*
|
*
|
||||||
* Change Log:
|
* Change Log:
|
||||||
* $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
|
* Revision 1.9 2001/10/16 20:31:27 strigeus
|
||||||
* misc fixes
|
* misc fixes
|
||||||
*
|
*
|
||||||
|
@ -60,9 +64,10 @@ void Scumm::initThings() {
|
||||||
_numVariables = 800;
|
_numVariables = 800;
|
||||||
_numBitVariables = 2048;
|
_numBitVariables = 2048;
|
||||||
_numLocalObjects = 200;
|
_numLocalObjects = 200;
|
||||||
|
_numVerbs = 100;
|
||||||
|
|
||||||
_inventory = (uint16*)alloc(0x50 * sizeof(uint16));
|
_inventory = (uint16*)alloc(0x50 * sizeof(uint16));
|
||||||
_verbs = (VerbSlot*)alloc(102 * sizeof(VerbSlot));
|
_verbs = (VerbSlot*)alloc(100 * sizeof(VerbSlot));
|
||||||
_objs = (ObjectData*)alloc(200 * sizeof(ObjectData));
|
_objs = (ObjectData*)alloc(200 * sizeof(ObjectData));
|
||||||
_vars = (int16*)alloc(800 * sizeof(int16));
|
_vars = (int16*)alloc(800 * sizeof(int16));
|
||||||
_bitVars = (byte*)alloc(2048 >> 3);
|
_bitVars = (byte*)alloc(2048 >> 3);
|
||||||
|
@ -353,9 +358,9 @@ void Scumm::scummMain(int argc, char **argv) {
|
||||||
cyclePalette();
|
cyclePalette();
|
||||||
palManipulate();
|
palManipulate();
|
||||||
|
|
||||||
if (dseg_4F8A) {
|
if (doEffect) {
|
||||||
|
doEffect = false;
|
||||||
screenEffect(_newEffect);
|
screenEffect(_newEffect);
|
||||||
dseg_4F8A = 0;
|
|
||||||
clearClickedStatus();
|
clearClickedStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,7 +539,7 @@ void Scumm::startScene(int room, Actor *a, int objectNr) {
|
||||||
a->moving = 0;
|
a->moving = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dseg_4F8A = 1;
|
doEffect = true;
|
||||||
|
|
||||||
CHECK_HEAP
|
CHECK_HEAP
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue