aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-19 11:42:13 +0200
committerBertrand Augereau2011-08-20 12:09:24 +0200
commiteaa342fdd88227e71ee95551a064f95df3eb0dd6 (patch)
tree133eecb0aa30e4b5cdffb89fd3ce0a02f94835b3 /engines
parent663ca4774f2a51287212140b39a4c1e96309a06d (diff)
downloadscummvm-rg350-eaa342fdd88227e71ee95551a064f95df3eb0dd6.tar.gz
scummvm-rg350-eaa342fdd88227e71ee95551a064f95df3eb0dd6.tar.bz2
scummvm-rg350-eaa342fdd88227e71ee95551a064f95df3eb0dd6.zip
DREAMWEB: 'setallchanges' ported to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp23
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp14
-rw-r--r--engines/dreamweb/stubs.h1
4 files changed, 16 insertions, 25 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 789a016f6b..541a938c19 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -11338,28 +11338,6 @@ void DreamGenContext::switchryanoff() {
data.byte(kRyanon) = 1;
}
-void DreamGenContext::setallchanges() {
- STACK_CHECK;
- es = data.word(kBuffers);
- bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
-setallloop:
- ax = es.word(bx);
- _cmp(al, 255);
- if (flags.z())
- return /* (endsetloop) */;
- cx = es.word(bx+2);
- _add(bx, 4);
- _cmp(ah, data.byte(kReallocation));
- if (!flags.z())
- goto setallloop;
- push(es);
- push(bx);
- dochange();
- bx = pop();
- es = pop();
- goto setallloop;
-}
-
void DreamGenContext::dochange() {
STACK_CHECK;
_cmp(ch, 0);
@@ -18692,7 +18670,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_removefreeobject: removefreeobject(); break;
case addr_switchryanon: switchryanon(); break;
case addr_switchryanoff: switchryanoff(); break;
- case addr_setallchanges: setallchanges(); break;
case addr_dochange: dochange(); break;
case addr_autoappear: autoappear(); break;
case addr_setuptimeduse: setuptimeduse(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 9496c50607..8f14cbddfb 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -304,7 +304,6 @@ public:
static const uint16 addr_setuptimeduse = 0xc71c;
static const uint16 addr_autoappear = 0xc70c;
static const uint16 addr_dochange = 0xc708;
- static const uint16 addr_setallchanges = 0xc704;
static const uint16 addr_switchryanoff = 0xc700;
static const uint16 addr_switchryanon = 0xc6fc;
static const uint16 addr_removefreeobject = 0xc6f4;
@@ -2023,7 +2022,7 @@ public:
void openhoteldoor2();
void getridoftempsp();
void scanfornames();
- void setallchanges();
+ //void setallchanges();
void readsetdata();
//void printboth();
void standardload();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 76f6de4d7c..0adb11e3a1 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1066,6 +1066,20 @@ void DreamGenContext::findormake(uint8 b0, uint8 b2, uint8 b3) {
}
}
+void DreamGenContext::setallchanges() {
+ Change *change = (Change *)segRef(data.word(kBuffers)).ptr(kListofchanges, sizeof(Change));
+ while (change->b0 != 0xff) {
+ if (change->location == data.byte(kReallocation)) {
+ al = change->b0;
+ ah = change->location;
+ cl = change->b2;
+ ch = change->b3;
+ dochange();
+ }
+ ++change;
+ }
+}
+
bool DreamGenContext::isCD() {
// The original sources has two codepaths depending if the game is 'if cd' or not
// This is a hack to guess which version to use with the assumption that if we have a cd version
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index dd5b6399e7..53d6458fb4 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -151,5 +151,6 @@
void findxyfrompath();
void findormake();
void findormake(uint8 b0, uint8 b2, uint8 b3);
+ void setallchanges();
bool isCD();