aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-09-05 21:42:06 +0200
committerBertrand Augereau2011-09-05 21:42:06 +0200
commita6b6d05a2c5052a86c9bf3ca31f548c7ba08b5ee (patch)
treec8abaf9ae6df1c964a8d1ca6dc656ba4dab939d0
parent1163a83f3587f5ceef41f7c2c429c30e2e8b6887 (diff)
downloadscummvm-rg350-a6b6d05a2c5052a86c9bf3ca31f548c7ba08b5ee.tar.gz
scummvm-rg350-a6b6d05a2c5052a86c9bf3ca31f548c7ba08b5ee.tar.bz2
scummvm-rg350-a6b6d05a2c5052a86c9bf3ca31f548c7ba08b5ee.zip
DREAMWEB: Ported 'findallryan' to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp36
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp19
-rw-r--r--engines/dreamweb/stubs.h2
5 files changed, 23 insertions, 38 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 2193954cca..6d07d76800 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -189,6 +189,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'makeworn',
'obtoinv',
'showryanpage',
+ 'findallryan',
], skip_output = [
# These functions are processed but not output
'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index a03aa62b83..ad9cb5fbae 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3847,41 +3847,6 @@ nextopenslot:
undertextline();
}
-void DreamGenContext::findallryan() {
- STACK_CHECK;
- push(di);
- cx = 30;
- ax = 0x0ffff;
- _stosw(cx, true);
- di = pop();
- cl = 4;
- ds = data.word(kExtras);
- bx = (0+2080+30000);
- ch = 0;
-findryanloop:
- _cmp(ds.byte(bx+2), cl);
- if (!flags.z())
- goto notinryaninv;
- _cmp(ds.byte(bx+3), 255);
- if (!flags.z())
- goto notinryaninv;
- al = ds.byte(bx+4);
- ah = 0;
- push(di);
- _add(di, ax);
- _add(di, ax);
- al = ch;
- ah = 4;
- _stosw();
- di = pop();
-notinryaninv:
- _add(bx, 16);
- _inc(ch);
- _cmp(ch, (114));
- if (!flags.z())
- goto findryanloop;
-}
-
void DreamGenContext::findallopen() {
STACK_CHECK;
push(di);
@@ -17282,7 +17247,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_monprint: monprint(); break;
case addr_fillryan: fillryan(); break;
case addr_fillopen: fillopen(); break;
- case addr_findallryan: findallryan(); break;
case addr_findallopen: findallopen(); break;
case addr_examineob: examineob(); break;
case addr_makemainscreen: makemainscreen(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 6c62e9b0ae..8465c59885 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -494,7 +494,6 @@ public:
static const uint16 addr_makemainscreen = 0xc340;
static const uint16 addr_examineob = 0xc33c;
static const uint16 addr_findallopen = 0xc32c;
- static const uint16 addr_findallryan = 0xc328;
static const uint16 addr_fillopen = 0xc324;
static const uint16 addr_fillryan = 0xc320;
static const uint16 addr_monprint = 0xc314;
@@ -1929,7 +1928,7 @@ public:
void buttonseven();
void redrawmainscrn();
void showgroup();
- void findallryan();
+ //void findallryan();
//void channel0tran();
void buttonpress();
//void parseblaster();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 8985392cfc..51a79d72fa 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1822,5 +1822,24 @@ void DreamGenContext::showryanpage() {
showframe(icons1, kInventx + 167 + 18 * data.byte(kRyanpage), kInventy - 12, 13 + data.byte(kRyanpage), 0);
}
+void DreamGenContext::findallryan() {
+ findallryan(es.ptr(di, 60));
+}
+
+void DreamGenContext::findallryan(uint8 *inv) {
+ memset(inv, 0xff, 60);
+ for (size_t i = 0; i < kNumexobjects; ++i) {
+ DynObject *extra = getexad(i);
+ if (extra->mapad[0] != 4)
+ continue;
+ if (extra->mapad[1] != 0xff)
+ continue;
+ uint8 slot = extra->mapad[2];
+ assert(slot < 30);
+ inv[2 * slot + 0] = i;
+ inv[2 * slot + 1] = 4;
+ }
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 10cb2e8866..c8fbd9bf82 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -227,4 +227,6 @@
void obtoinv();
void obtoinv(uint8 index, uint8 flag, uint16 x, uint16 y);
void showryanpage();
+ void findallryan();
+ void findallryan(uint8 *inv);