aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-15 14:02:50 +0200
committerBertrand Augereau2011-08-15 22:30:16 +0200
commit8cb9ff31cf67c3161c9513e36cdba48db55f4ed9 (patch)
tree78ac5e4de3ef03ada6b3260db36bffa7210a74bb
parent2dadf6ba19b61c4af20da31a81cdf31bd5d3e79c (diff)
downloadscummvm-rg350-8cb9ff31cf67c3161c9513e36cdba48db55f4ed9.tar.gz
scummvm-rg350-8cb9ff31cf67c3161c9513e36cdba48db55f4ed9.tar.bz2
scummvm-rg350-8cb9ff31cf67c3161c9513e36cdba48db55f4ed9.zip
DREAMWEB: 'findobname' ported to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp63
-rw-r--r--engines/dreamweb/dreamgen.h13
-rw-r--r--engines/dreamweb/stubs.cpp24
-rw-r--r--engines/dreamweb/stubs.h2
5 files changed, 33 insertions, 70 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index d256e44b36..d0cbae8fe5 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -107,6 +107,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'doblocks',
'checkifperson',
'getreelstart',
+ 'findobname',
], skip_output = [
# These functions are processed but not output
'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 75fdad7b1e..b72c83b40c 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -17422,68 +17422,6 @@ finishmakename:
_stosb(cx, true);
}
-void DreamGenContext::findobname() {
- STACK_CHECK;
- push(ax);
- ah = 0;
- _add(ax, ax);
- bx = ax;
- ax = pop();
- _cmp(ah, 5);
- if (!flags.z())
- goto notpersonname;
- push(ax);
- _and(al, 127);
- ah = 0;
- bx = 64*2;
- _mul(bx);
- si = ax;
- ds = data.word(kPeople);
- _add(si, (0+24));
- cx = (0+24+(1026*2));
- ax = ds.word(si);
- _add(ax, cx);
- si = ax;
- ax = pop();
- return;
-notpersonname:
- _cmp(ah, 4);
- if (!flags.z())
- goto notextraname;
- ds = data.word(kExtras);
- _add(bx, (0+2080+30000+(16*114)));
- ax = ds.word(bx);
- _add(ax, (0+2080+30000+(16*114)+((114+2)*2)));
- si = ax;
- return;
-notextraname:
- _cmp(ah, 2);
- if (!flags.z())
- goto notfreename;
- ds = data.word(kFreedesc);
- _add(bx, (0));
- ax = ds.word(bx);
- _add(ax, (0+(82*2)));
- si = ax;
- return;
-notfreename:
- _cmp(ah, 1);
- if (!flags.z())
- goto notsetname;
- ds = data.word(kSetdesc);
- _add(bx, (0));
- ax = ds.word(bx);
- _add(ax, (0+(130*2)));
- si = ax;
- return;
-notsetname:
- ds = data.word(kBlockdesc);
- _add(bx, (0));
- ax = ds.word(bx);
- _add(ax, (0+(98*2)));
- si = ax;
-}
-
void DreamGenContext::showicon() {
STACK_CHECK;
_cmp(data.byte(kReallocation), 50);
@@ -19905,7 +19843,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_bresenhams: bresenhams(); break;
case addr_workoutframes: workoutframes(); break;
case addr_copyname: copyname(); break;
- case addr_findobname: findobname(); break;
case addr_showicon: showicon(); break;
case addr_middlepanel: middlepanel(); break;
case addr_showman: showman(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 9a0e9e9629..4a8bcbd1a1 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -115,7 +115,6 @@ public:
static const uint16 addr_showman = 0xca6c;
static const uint16 addr_middlepanel = 0xca68;
static const uint16 addr_showicon = 0xca64;
- static const uint16 addr_findobname = 0xca60;
static const uint16 addr_copyname = 0xca5c;
static const uint16 addr_workoutframes = 0xca54;
static const uint16 addr_bresenhams = 0xca50;
@@ -1330,7 +1329,7 @@ public:
void bresenhams();
void getbackfromops();
//void frameoutv();
- void restoreall();
+ void opensarters();
void screenupdate();
void addlength();
void wornerror();
@@ -1339,7 +1338,7 @@ public:
void commandonly();
void adjustlen();
void deallocatemem();
- void mainscreen();
+ void checkforemm();
void watchreel();
void showfolder();
void turnanypathoff();
@@ -1364,6 +1363,7 @@ public:
void usecashcard();
void usewall();
void opentomb();
+ //void findobname();
void buttonfour();
void animpointer();
//void lockmon();
@@ -1443,7 +1443,6 @@ public:
void loadtempcharset();
void showbyte();
void useslab();
- //void aboutturn();
void usealtar();
void createpanel2();
void turnonpower();
@@ -1548,7 +1547,7 @@ public:
void wearwatch();
void runintroseq();
//void doblocks();
- void opensarters();
+ void restoreall();
void allpalette();
void findormake();
void nextsymbol();
@@ -1605,7 +1604,7 @@ public:
void showpointer();
void usecooker();
void loadmenu();
- void checkforemm();
+ //void aboutturn();
void checkifpathison();
void smallcandle();
void receptionist();
@@ -1626,7 +1625,7 @@ public:
void putundermenu();
void checkifex();
void intromagic2();
- void findobname();
+ void mainscreen();
void edeninbath();
void intromagic1();
void showdiarypage();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index ede63e0315..4fcc1e4698 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1000,4 +1000,28 @@ bool DreamGenContext::checkifperson(uint8 x, uint8 y) {
return false;
}
+void DreamGenContext::findobname() {
+ findobname(ah, al);
+}
+
+void DreamGenContext::findobname(uint8 type, uint8 index) {
+ if (type == 5) {
+ uint16 offset = 64 * 2 * (index & 127);
+ ds = data.word(kPeople);
+ si = ds.word(kPersontxtdat + offset) + kPersontext;
+ } else if (type == 4) {
+ ds = data.word(kExtras);
+ si = ds.word(kExtextdat + index * 2) + kExtext;
+ } else if (type == 2) {
+ ds = data.word(kFreedesc);
+ si = ds.word(kFreetextdat + index * 2) + kFreetext;
+ } else if (type == 1) {
+ ds = data.word(kSetdesc);
+ si = ds.word(kSettextdat + index * 2) + kSettext;
+ } else {
+ ds = data.word(kBlockdesc);
+ si = ds.word(kBlocktextdat + index * 2) + kBlocktext;
+ }
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 9f39b373b2..b9d22c25c5 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -121,4 +121,6 @@
void doblocks();
void checkifperson();
bool checkifperson(uint8 x, uint8 y);
+ void findobname();
+ void findobname(uint8 type, uint8 index);