[Scummvm-cvs-logs] scummvm master -> 67301fec53f0a9363c0b1f26718b0578509c3f26
wjp
wjp at usecode.org
Wed Nov 16 21:07:28 CET 2011
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e0496d4326 DREAMWEB: Move 'textformonk' and 'textforend' from dreamgen
c27367c33f DREAMWEB: Add missing CD checks in 'textforend' and 'textformonk'
71a39193ac DREAMWEB: Convert 'textforend' and 'textformonk'
67301fec53 DREAMWEB: Unhardcode reelCallbacks
Commit: e0496d43261c3f25897013593e5bf1e9ef8b67d6
https://github.com/scummvm/scummvm/commit/e0496d43261c3f25897013593e5bf1e9ef8b67d6
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-11-16T11:50:14-08:00
Commit Message:
DREAMWEB: Move 'textformonk' and 'textforend' from dreamgen
Changed paths:
devtools/tasmrecover/tasm-recover
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/sprite.cpp
engines/dreamweb/stubs.h
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index c27c963..b54d1dc 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -225,6 +225,8 @@ generator = cpp(context, "DreamGen", blacklist = [
'getundermenu',
'putundermenu',
'showoutermenu',
+ 'textforend',
+ 'textformonk',
], skip_output = [
# These functions are processed but not output
'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 40bb16d..12ab6b8 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1716,179 +1716,6 @@ void DreamGenContext::priesttext() {
setuptimeduse();
}
-void DreamGenContext::textforend() {
- STACK_CHECK;
- _cmp(data.byte(kIntrocount), 20);
- if (!flags.z())
- goto notendtext1;
- al = 0;
- bl = 34;
- bh = 20;
- cx = 60;
- goto gotendtext;
-notendtext1:
- _cmp(data.byte(kIntrocount), 50);
- if (!flags.z())
- goto notendtext2;
- al = 1;
- bl = 34;
- bh = 20;
- cx = 60;
- goto gotendtext;
-notendtext2:
- _cmp(data.byte(kIntrocount), 85);
- if (!flags.z())
- return /* (notendtext3) */;
- al = 2;
- bl = 34;
- bh = 20;
- cx = 60;
- goto gotendtext;
- return;
-gotendtext:
- dx = 1;
- ah = 83;
- setuptimedtemp();
-}
-
-void DreamGenContext::textformonk() {
- STACK_CHECK;
- _cmp(data.byte(kIntrocount), 1);
- if (!flags.z())
- goto notmonktext1;
- al = 19;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext1:
- _cmp(data.byte(kIntrocount), 5);
- if (!flags.z())
- goto notmonktext2;
- al = 20;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext2:
- _cmp(data.byte(kIntrocount), 9);
- if (!flags.z())
- goto notmonktext3;
- al = 21;
- bl = 48;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext3:
- _cmp(data.byte(kIntrocount), 13);
- if (!flags.z())
- goto notmonktext4;
- al = 22;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext4:
- _cmp(data.byte(kIntrocount), 15);
- if (!flags.z())
- goto notmonktext5;
- al = 23;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext5:
- _cmp(data.byte(kIntrocount), 21);
- if (!flags.z())
- goto notmonktext6;
- al = 24;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext6:
- _cmp(data.byte(kIntrocount), 25);
- if (!flags.z())
- goto notmonktext7;
- al = 25;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext7:
- _cmp(data.byte(kIntrocount), 29);
- if (!flags.z())
- goto notmonktext8;
- al = 26;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext8:
- _cmp(data.byte(kIntrocount), 33);
- if (!flags.z())
- goto notmonktext9;
- al = 27;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext9:
- _cmp(data.byte(kIntrocount), 37);
- if (!flags.z())
- goto notmonktext10;
- al = 28;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext10:
- _cmp(data.byte(kIntrocount), 41);
- if (!flags.z())
- goto notmonktext11;
- al = 29;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext11:
- _cmp(data.byte(kIntrocount), 45);
- if (!flags.z())
- goto notmonktext12;
- al = 30;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext12:
- _cmp(data.byte(kIntrocount), 52);
- if (!flags.z())
- goto notmonktext13;
- al = 31;
- bl = 68;
- bh = 154;
- cx = 220;
- goto gotmonktext;
-notmonktext13:
- _cmp(data.byte(kIntrocount), 53);
- if (!flags.z())
- return /* (notendtitles) */;
- fadescreendowns();
- data.byte(kVolumeto) = 7;
- data.byte(kVolumedirection) = 1;
- return;
-gotmonktext:
- dx = 1;
- ah = 82;
- _cmp(data.byte(kCh1playing), 255);
- if (flags.z())
- goto oktalk;
- _dec(data.byte(kIntrocount));
- return;
-oktalk:
- setuptimedtemp();
-}
-
void DreamGenContext::drunk() {
STACK_CHECK;
_cmp(data.byte(kGeneraldead), 0);
@@ -15968,8 +15795,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_madmanstelly: madmanstelly(); break;
case addr_madman: madman(); break;
case addr_priesttext: priesttext(); break;
- case addr_textforend: textforend(); break;
- case addr_textformonk: textformonk(); break;
case addr_drunk: drunk(); break;
case addr_advisor: advisor(); break;
case addr_copper: copper(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 6f29398..8c319bd 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -540,8 +540,6 @@ public:
static const uint16 addr_copper = 0xc0fc;
static const uint16 addr_advisor = 0xc0f8;
static const uint16 addr_drunk = 0xc0f4;
- static const uint16 addr_textformonk = 0xc0f0;
- static const uint16 addr_textforend = 0xc0ec;
static const uint16 addr_priesttext = 0xc0e8;
static const uint16 addr_madman = 0xc0dc;
static const uint16 addr_madmanstelly = 0xc0d8;
@@ -1227,7 +1225,6 @@ public:
void startdmablock();
void useopenbox();
void clearbuffers();
- //void getyad();
void neterror();
void storeit();
//void lockeddoorway();
@@ -1541,6 +1538,7 @@ public:
void fadeupmon();
//void paltoendpal();
void fadetowhite();
+ //void textformonk();
void loadsavebox();
void soundend();
void redes();
@@ -1607,7 +1605,7 @@ public:
void nothelderror();
//void readheader();
void getsetad();
- void textformonk();
+ //void getyad();
void reconstruct();
void soldier1();
//void animpointer();
@@ -1736,7 +1734,7 @@ public:
void twodigitnum();
//void madmantext();
void dumpcurrent();
- void textforend();
+ //void textforend();
void showdiarykeys();
void dontloadseg();
//void madmode();
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 34b0729..a267094 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -1020,5 +1020,178 @@ void DreamGenContext::initrain() {
rain->x = 0xff;
}
+void DreamGenContext::textforend() {
+ STACK_CHECK;
+ _cmp(data.byte(kIntrocount), 20);
+ if (!flags.z())
+ goto notendtext1;
+ al = 0;
+ bl = 34;
+ bh = 20;
+ cx = 60;
+ goto gotendtext;
+notendtext1:
+ _cmp(data.byte(kIntrocount), 50);
+ if (!flags.z())
+ goto notendtext2;
+ al = 1;
+ bl = 34;
+ bh = 20;
+ cx = 60;
+ goto gotendtext;
+notendtext2:
+ _cmp(data.byte(kIntrocount), 85);
+ if (!flags.z())
+ return /* (notendtext3) */;
+ al = 2;
+ bl = 34;
+ bh = 20;
+ cx = 60;
+ goto gotendtext;
+ return;
+gotendtext:
+ dx = 1;
+ ah = 83;
+ setuptimedtemp();
+}
+
+void DreamGenContext::textformonk() {
+ STACK_CHECK;
+ _cmp(data.byte(kIntrocount), 1);
+ if (!flags.z())
+ goto notmonktext1;
+ al = 19;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ goto gotmonktext;
+notmonktext1:
+ _cmp(data.byte(kIntrocount), 5);
+ if (!flags.z())
+ goto notmonktext2;
+ al = 20;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ goto gotmonktext;
+notmonktext2:
+ _cmp(data.byte(kIntrocount), 9);
+ if (!flags.z())
+ goto notmonktext3;
+ al = 21;
+ bl = 48;
+ bh = 154;
+ cx = 120;
+ goto gotmonktext;
+notmonktext3:
+ _cmp(data.byte(kIntrocount), 13);
+ if (!flags.z())
+ goto notmonktext4;
+ al = 22;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ goto gotmonktext;
+notmonktext4:
+ _cmp(data.byte(kIntrocount), 15);
+ if (!flags.z())
+ goto notmonktext5;
+ al = 23;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ goto gotmonktext;
+notmonktext5:
+ _cmp(data.byte(kIntrocount), 21);
+ if (!flags.z())
+ goto notmonktext6;
+ al = 24;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ goto gotmonktext;
+notmonktext6:
+ _cmp(data.byte(kIntrocount), 25);
+ if (!flags.z())
+ goto notmonktext7;
+ al = 25;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ goto gotmonktext;
+notmonktext7:
+ _cmp(data.byte(kIntrocount), 29);
+ if (!flags.z())
+ goto notmonktext8;
+ al = 26;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ goto gotmonktext;
+notmonktext8:
+ _cmp(data.byte(kIntrocount), 33);
+ if (!flags.z())
+ goto notmonktext9;
+ al = 27;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ goto gotmonktext;
+notmonktext9:
+ _cmp(data.byte(kIntrocount), 37);
+ if (!flags.z())
+ goto notmonktext10;
+ al = 28;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ goto gotmonktext;
+notmonktext10:
+ _cmp(data.byte(kIntrocount), 41);
+ if (!flags.z())
+ goto notmonktext11;
+ al = 29;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ goto gotmonktext;
+notmonktext11:
+ _cmp(data.byte(kIntrocount), 45);
+ if (!flags.z())
+ goto notmonktext12;
+ al = 30;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ goto gotmonktext;
+notmonktext12:
+ _cmp(data.byte(kIntrocount), 52);
+ if (!flags.z())
+ goto notmonktext13;
+ al = 31;
+ bl = 68;
+ bh = 154;
+ cx = 220;
+ goto gotmonktext;
+notmonktext13:
+ _cmp(data.byte(kIntrocount), 53);
+ if (!flags.z())
+ return /* (notendtitles) */;
+ fadescreendowns();
+ data.byte(kVolumeto) = 7;
+ data.byte(kVolumedirection) = 1;
+ return;
+gotmonktext:
+ dx = 1;
+ ah = 82;
+ _cmp(data.byte(kCh1playing), 255);
+ if (flags.z())
+ goto oktalk;
+ _dec(data.byte(kIntrocount));
+ return;
+oktalk:
+ setuptimedtemp();
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 90d3178..5688e8c 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -270,4 +270,7 @@
void loadroom();
void getundermenu();
void putundermenu();
+ void textformonk();
+ void textforend();
+
Commit: c27367c33f933bd3c0456e0952d3413c69dc7d86
https://github.com/scummvm/scummvm/commit/c27367c33f933bd3c0456e0952d3413c69dc7d86
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-11-16T11:50:14-08:00
Commit Message:
DREAMWEB: Add missing CD checks in 'textforend' and 'textformonk'
Changed paths:
engines/dreamweb/sprite.cpp
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index a267094..dfbbbaf 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -1031,7 +1031,7 @@ void DreamGenContext::textforend() {
cx = 60;
goto gotendtext;
notendtext1:
- _cmp(data.byte(kIntrocount), 50);
+ _cmp(data.byte(kIntrocount), (isCD() ? 50 : 65));
if (!flags.z())
goto notendtext2;
al = 1;
@@ -1040,7 +1040,7 @@ notendtext1:
cx = 60;
goto gotendtext;
notendtext2:
- _cmp(data.byte(kIntrocount), 85);
+ _cmp(data.byte(kIntrocount), (isCD() ? 85 : 110));
if (!flags.z())
return /* (notendtext3) */;
al = 2;
@@ -1093,7 +1093,7 @@ notmonktext3:
cx = 120;
goto gotmonktext;
notmonktext4:
- _cmp(data.byte(kIntrocount), 15);
+ _cmp(data.byte(kIntrocount), (isCD() ? 15 : 17));
if (!flags.z())
goto notmonktext5;
al = 23;
@@ -1165,7 +1165,7 @@ notmonktext11:
cx = 120;
goto gotmonktext;
notmonktext12:
- _cmp(data.byte(kIntrocount), 52);
+ _cmp(data.byte(kIntrocount), (isCD() ? 52 : 49));
if (!flags.z())
goto notmonktext13;
al = 31;
@@ -1178,17 +1178,21 @@ notmonktext13:
if (!flags.z())
return /* (notendtitles) */;
fadescreendowns();
- data.byte(kVolumeto) = 7;
- data.byte(kVolumedirection) = 1;
+ if (isCD()) {
+ data.byte(kVolumeto) = 7;
+ data.byte(kVolumedirection) = 1;
+ }
return;
gotmonktext:
dx = 1;
ah = 82;
- _cmp(data.byte(kCh1playing), 255);
- if (flags.z())
- goto oktalk;
- _dec(data.byte(kIntrocount));
- return;
+ if (isCD()) {
+ _cmp(data.byte(kCh1playing), 255);
+ if (flags.z())
+ goto oktalk;
+ _dec(data.byte(kIntrocount));
+ return;
+ }
oktalk:
setuptimedtemp();
}
Commit: 71a39193ac68384c297b6db4892441852e78cedd
https://github.com/scummvm/scummvm/commit/71a39193ac68384c297b6db4892441852e78cedd
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-11-16T11:50:14-08:00
Commit Message:
DREAMWEB: Convert 'textforend' and 'textformonk'
Changed paths:
engines/dreamweb/sprite.cpp
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index dfbbbaf..f3cf4a4 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -1021,179 +1021,107 @@ void DreamGenContext::initrain() {
}
void DreamGenContext::textforend() {
- STACK_CHECK;
- _cmp(data.byte(kIntrocount), 20);
- if (!flags.z())
- goto notendtext1;
- al = 0;
- bl = 34;
- bh = 20;
- cx = 60;
- goto gotendtext;
-notendtext1:
- _cmp(data.byte(kIntrocount), (isCD() ? 50 : 65));
- if (!flags.z())
- goto notendtext2;
- al = 1;
- bl = 34;
- bh = 20;
- cx = 60;
- goto gotendtext;
-notendtext2:
- _cmp(data.byte(kIntrocount), (isCD() ? 85 : 110));
- if (!flags.z())
- return /* (notendtext3) */;
- al = 2;
+ if (data.byte(kIntrocount) == 20)
+ al = 0;
+ else if (data.byte(kIntrocount) == (isCD() ? 50 : 65))
+ al = 1;
+ else if (data.byte(kIntrocount) == (isCD() ? 85 : 110))
+ al = 2;
+ else
+ return;
+
bl = 34;
bh = 20;
cx = 60;
- goto gotendtext;
- return;
-gotendtext:
dx = 1;
ah = 83;
setuptimedtemp();
}
void DreamGenContext::textformonk() {
- STACK_CHECK;
- _cmp(data.byte(kIntrocount), 1);
- if (!flags.z())
- goto notmonktext1;
- al = 19;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext1:
- _cmp(data.byte(kIntrocount), 5);
- if (!flags.z())
- goto notmonktext2;
- al = 20;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext2:
- _cmp(data.byte(kIntrocount), 9);
- if (!flags.z())
- goto notmonktext3;
- al = 21;
- bl = 48;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext3:
- _cmp(data.byte(kIntrocount), 13);
- if (!flags.z())
- goto notmonktext4;
- al = 22;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext4:
- _cmp(data.byte(kIntrocount), (isCD() ? 15 : 17));
- if (!flags.z())
- goto notmonktext5;
- al = 23;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext5:
- _cmp(data.byte(kIntrocount), 21);
- if (!flags.z())
- goto notmonktext6;
- al = 24;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext6:
- _cmp(data.byte(kIntrocount), 25);
- if (!flags.z())
- goto notmonktext7;
- al = 25;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext7:
- _cmp(data.byte(kIntrocount), 29);
- if (!flags.z())
- goto notmonktext8;
- al = 26;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext8:
- _cmp(data.byte(kIntrocount), 33);
- if (!flags.z())
- goto notmonktext9;
- al = 27;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext9:
- _cmp(data.byte(kIntrocount), 37);
- if (!flags.z())
- goto notmonktext10;
- al = 28;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext10:
- _cmp(data.byte(kIntrocount), 41);
- if (!flags.z())
- goto notmonktext11;
- al = 29;
- bl = 68;
- bh = 38;
- cx = 120;
- goto gotmonktext;
-notmonktext11:
- _cmp(data.byte(kIntrocount), 45);
- if (!flags.z())
- goto notmonktext12;
- al = 30;
- bl = 68;
- bh = 154;
- cx = 120;
- goto gotmonktext;
-notmonktext12:
- _cmp(data.byte(kIntrocount), (isCD() ? 52 : 49));
- if (!flags.z())
- goto notmonktext13;
- al = 31;
- bl = 68;
- bh = 154;
- cx = 220;
- goto gotmonktext;
-notmonktext13:
- _cmp(data.byte(kIntrocount), 53);
- if (!flags.z())
- return /* (notendtitles) */;
- fadescreendowns();
- if (isCD()) {
- data.byte(kVolumeto) = 7;
- data.byte(kVolumedirection) = 1;
+ if (data.byte(kIntrocount) == 1) {
+ al = 19;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 5) {
+ al = 20;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 9) {
+ al = 21;
+ bl = 48;
+ bh = 154;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 13) {
+ al = 22;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == (isCD() ? 15 : 17)) {
+ al = 23;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 21) {
+ al = 24;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 25) {
+ al = 25;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 29) {
+ al = 26;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 33) {
+ al = 27;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 37) {
+ al = 28;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 41) {
+ al = 29;
+ bl = 68;
+ bh = 38;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == 45) {
+ al = 30;
+ bl = 68;
+ bh = 154;
+ cx = 120;
+ } else if (data.byte(kIntrocount) == (isCD() ? 52 : 49)) {
+ al = 31;
+ bl = 68;
+ bh = 154;
+ cx = 220;
+ } else if (data.byte(kIntrocount) == 53) {
+ fadescreendowns();
+ if (isCD()) {
+ data.byte(kVolumeto) = 7;
+ data.byte(kVolumedirection) = 1;
+ }
+ return;
+ } else {
+ return;
}
- return;
-gotmonktext:
+
dx = 1;
ah = 82;
- if (isCD()) {
- _cmp(data.byte(kCh1playing), 255);
- if (flags.z())
- goto oktalk;
- _dec(data.byte(kIntrocount));
+ if (isCD() && data.byte(kCh1playing) != 255) {
+ data.byte(kIntrocount)--;
return;
}
-oktalk:
+
setuptimedtemp();
}
Commit: 67301fec53f0a9363c0b1f26718b0578509c3f26
https://github.com/scummvm/scummvm/commit/67301fec53f0a9363c0b1f26718b0578509c3f26
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-11-16T12:05:40-08:00
Commit Message:
DREAMWEB: Unhardcode reelCallbacks
Changed paths:
engines/dreamweb/sprite.cpp
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index f3cf4a4..1a1c8e9 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -585,6 +585,39 @@ void DreamGenContext::showrain() {
}
}
+static void (DreamGenContext::*reelCallbacks[])() = {
+ &DreamGenContext::gamer, &DreamGenContext::sparkydrip,
+ &DreamGenContext::eden, &DreamGenContext::edeninbath,
+ &DreamGenContext::sparky, &DreamGenContext::smokebloke,
+ &DreamGenContext::manasleep, &DreamGenContext::drunk,
+ &DreamGenContext::receptionist, &DreamGenContext::malefan,
+ &DreamGenContext::femalefan, &DreamGenContext::louis,
+ &DreamGenContext::louischair, &DreamGenContext::soldier1,
+ &DreamGenContext::bossman, &DreamGenContext::interviewer,
+ &DreamGenContext::heavy, &DreamGenContext::manasleep2,
+ &DreamGenContext::mansatstill, &DreamGenContext::drinker,
+ &DreamGenContext::bartender, &DreamGenContext::othersmoker,
+ &DreamGenContext::tattooman, &DreamGenContext::attendant,
+ &DreamGenContext::keeper, &DreamGenContext::candles1,
+ &DreamGenContext::smallcandle, &DreamGenContext::security,
+ &DreamGenContext::copper, &DreamGenContext::poolguard,
+ &DreamGenContext::rockstar, &DreamGenContext::businessman,
+ &DreamGenContext::train, &DreamGenContext::aide,
+ &DreamGenContext::mugger, &DreamGenContext::helicopter,
+ &DreamGenContext::intromagic1, &DreamGenContext::intromusic,
+ &DreamGenContext::intromagic2, &DreamGenContext::candles2,
+ &DreamGenContext::gates, &DreamGenContext::intromagic3,
+ &DreamGenContext::intromonks1, &DreamGenContext::candles,
+ &DreamGenContext::intromonks2, &DreamGenContext::handclap,
+ &DreamGenContext::monkandryan, &DreamGenContext::endgameseq,
+ &DreamGenContext::priest, &DreamGenContext::madman,
+ &DreamGenContext::madmanstelly, &DreamGenContext::alleybarksound,
+ &DreamGenContext::foghornsound, &DreamGenContext::carparkdrip,
+ &DreamGenContext::carparkdrip, &DreamGenContext::carparkdrip,
+ &DreamGenContext::carparkdrip
+};
+
+
void DreamGenContext::updatepeople() {
data.word(kListpos) = kPeoplelist;
memset(segRef(data.word(kBuffers)).ptr(kPeoplelist, 12 * sizeof(People)), 0xff, 12 * sizeof(People));
@@ -594,143 +627,15 @@ void DreamGenContext::updatepeople() {
// They use some of the fields in it to store state.
es = cs;
- bx = kReelroutines;
- const ReelRoutine *reelRoutine = (const ReelRoutine *)cs.ptr(bx, 0);
- const uint16 *callbacks = (const uint16 *)cs.ptr(kReelcalls, 0);
- while (true) {
- uint8 realLocation = reelRoutine->reallocation;
- if (realLocation == 255)
- return;
- if ((realLocation == data.byte(kReallocation)) &&
- (reelRoutine->mapX == data.byte(kMapx)) &&
- (reelRoutine->mapY == data.byte(kMapy))) {
- uint16 callback = READ_LE_UINT16(callbacks);
- //dw gamer,sparkydrip,eden,edeninbath,sparky,smokebloke
- if (callback == addr_gamer)
- gamer();
- else if (callback == addr_sparkydrip)
- sparkydrip();
- else if (callback == addr_eden)
- eden();
- else if (callback == addr_edeninbath)
- edeninbath();
- else if (callback == addr_sparky)
- sparky();
- else if (callback == addr_smokebloke)
- smokebloke();
- //dw manasleep,drunk,receptionist,malefan,femalefan
- else if (callback == addr_manasleep)
- manasleep();
- else if (callback == addr_drunk)
- drunk();
- else if (callback == addr_receptionist)
- receptionist();
- else if (callback == addr_malefan)
- malefan();
- else if (callback == addr_femalefan)
- femalefan();
- //dw louis,louischair,soldier1,bossman,interviewer
- else if (callback == addr_louis)
- louis();
- else if (callback == addr_louischair)
- louischair();
- else if (callback == addr_soldier1)
- soldier1();
- else if (callback == addr_bossman)
- bossman();
- else if (callback == addr_interviewer)
- interviewer();
- //dw heavy,manasleep2,mansatstill,drinker,bartender
- else if (callback == addr_heavy)
- heavy();
- else if (callback == addr_manasleep2)
- manasleep2();
- else if (callback == addr_mansatstill)
- mansatstill();
- else if (callback == addr_drinker)
- drinker();
- else if (callback == addr_bartender)
- bartender();
- //dw othersmoker,tattooman,attendant,keeper,candles1
- else if (callback == addr_othersmoker)
- othersmoker();
- else if (callback == addr_tattooman)
- tattooman();
- else if (callback == addr_attendant)
- attendant();
- else if (callback == addr_keeper)
- keeper();
- else if (callback == addr_candles1)
- candles1();
- //dw smallcandle,security,copper,poolguard,rockstar
- else if (callback == addr_smallcandle)
- smallcandle();
- else if (callback == addr_security)
- security();
- else if (callback == addr_copper)
- copper();
- else if (callback == addr_poolguard)
- poolguard();
- else if (callback == addr_rockstar)
- rockstar();
- //dw businessman,train,aide,mugger,helicopter
- else if (callback == addr_businessman)
- businessman();
- else if (callback == addr_train)
- train();
- else if (callback == addr_aide)
- aide();
- else if (callback == addr_mugger)
- mugger();
- else if (callback == addr_helicopter)
- helicopter();
- //dw intromagic1,intromusic,intromagic2,candles2,gates
- else if (callback == addr_intromagic1)
- intromagic1();
- else if (callback == addr_intromusic)
- intromusic();
- else if (callback == addr_intromagic2)
- intromagic2();
- else if (callback == addr_candles2)
- candles2();
- else if (callback == addr_gates)
- gates();
- //dw intromagic3,intromonks1,candles,intromonks2
- else if (callback == addr_intromagic3)
- intromagic3();
- else if (callback == addr_intromonks1)
- intromonks1();
- else if (callback == addr_candles)
- candles();
- else if (callback == addr_intromonks2)
- intromonks2();
- //dw handclap,monkandryan,endgameseq,priest,madman
- else if (callback == addr_handclap)
- handclap();
- else if (callback == addr_monkandryan)
- monkandryan();
- else if (callback == addr_endgameseq)
- endgameseq();
- else if (callback == addr_priest)
- priest();
- else if (callback == addr_madman)
- madman();
- //dw madmanstelly,alleybarksound,foghornsound
- else if (callback == addr_madmanstelly)
- madmanstelly();
- else if (callback == addr_alleybarksound)
- alleybarksound();
- else if (callback == addr_foghornsound)
- foghornsound();
- //dw carparkdrip,carparkdrip,carparkdrip,carparkdrip
- else if (callback == addr_carparkdrip)
- carparkdrip();
- else
- assert(false); // Oops I forgot something in the dispatch table
+ const ReelRoutine *r = (const ReelRoutine *)cs.ptr(kReelroutines, 0);
+
+ for (int i = 0; r[i].reallocation != 255; ++i) {
+ bx = kReelroutines + 8*i;
+ if (r[i].reallocation == data.byte(kReallocation) &&
+ r[i].mapX == data.byte(kMapx) &&
+ r[i].mapY == data.byte(kMapy)) {
+ (this->*(reelCallbacks[i]))();
}
- bx += 8;
- ++reelRoutine;
- ++callbacks;
}
}
More information about the Scummvm-git-logs
mailing list