aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-20 13:23:47 +0200
committerBertrand Augereau2011-08-20 14:54:39 +0200
commitf4207b8149f562381f6a1b6ea4a908a6be9221c5 (patch)
tree33047edb7550668ee98791282fa6752ef2ed266c /engines
parent3affb925d57fee73d31cfd790ff3f7c6b722488b (diff)
downloadscummvm-rg350-f4207b8149f562381f6a1b6ea4a908a6be9221c5.tar.gz
scummvm-rg350-f4207b8149f562381f6a1b6ea4a908a6be9221c5.tar.bz2
scummvm-rg350-f4207b8149f562381f6a1b6ea4a908a6be9221c5.zip
DREAMWEB: 'placesetobject' and 'removesetobject' ported to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp28
-rw-r--r--engines/dreamweb/dreamgen.h6
-rw-r--r--engines/dreamweb/stubs.cpp24
-rw-r--r--engines/dreamweb/stubs.h4
4 files changed, 26 insertions, 36 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index b3ca7508b7..7a48d7313d 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -11243,32 +11243,6 @@ void DreamGenContext::findpuztext() {
si = ax;
}
-void DreamGenContext::placesetobject() {
- STACK_CHECK;
- push(es);
- push(bx);
- cl = 0;
- ch = 0;
- findormake();
- getsetad();
- es.byte(bx+58) = 0;
- bx = pop();
- es = pop();
-}
-
-void DreamGenContext::removesetobject() {
- STACK_CHECK;
- push(es);
- push(bx);
- cl = 255;
- ch = 0;
- findormake();
- getsetad();
- es.byte(bx+58) = 255;
- bx = pop();
- es = pop();
-}
-
void DreamGenContext::issetobonmap() {
STACK_CHECK;
push(es);
@@ -18595,8 +18569,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_putbackobstuff: putbackobstuff(); break;
case addr_showpuztext: showpuztext(); break;
case addr_findpuztext: findpuztext(); break;
- case addr_placesetobject: placesetobject(); break;
- case addr_removesetobject: removesetobject(); break;
case addr_issetobonmap: issetobonmap(); break;
case addr_placefreeobject: placefreeobject(); break;
case addr_removefreeobject: removefreeobject(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index a6dff60400..bca9cc634a 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -308,8 +308,6 @@ public:
static const uint16 addr_removefreeobject = 0xc6f4;
static const uint16 addr_placefreeobject = 0xc6f0;
static const uint16 addr_issetobonmap = 0xc6ec;
- static const uint16 addr_removesetobject = 0xc6e8;
- static const uint16 addr_placesetobject = 0xc6e4;
static const uint16 addr_findpuztext = 0xc6e0;
static const uint16 addr_showpuztext = 0xc6dc;
static const uint16 addr_putbackobstuff = 0xc6d8;
@@ -1578,7 +1576,7 @@ public:
void copper();
void folderhints();
void openhoteldoor();
- void removesetobject();
+ //void removesetobject();
//void dumptimedtext();
//void frameoutfx();
void blank();
@@ -1996,7 +1994,7 @@ public:
//void getmapad();
void getlocation();
void geteitherad();
- void placesetobject();
+ //void placesetobject();
void drawflags();
void zoomonoff();
void updatesymboltop();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 2968a5e9b7..67811f91f9 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -840,12 +840,10 @@ void DreamGenContext::fillspace() {
void DreamGenContext::dealwithspecial(uint8 firstParam, uint8 secondParam) {
uint8 type = firstParam - 220;
if (type == 0) {
- al = secondParam;
- placesetobject();
+ placesetobject(secondParam);
data.byte(kHavedoneobs) = 1;
} else if (type == 1) {
- al = secondParam;
- removesetobject();
+ removesetobject(secondParam);
data.byte(kHavedoneobs) = 1;
} else if (type == 2) {
al = secondParam;
@@ -1115,6 +1113,24 @@ void DreamGenContext::deletetaken() {
}
}
+void DreamGenContext::placesetobject() {
+ placesetobject(al);
+}
+
+void DreamGenContext::placesetobject(uint8 index) {
+ findormake(index, 0, 0);
+ getsetad(index)->b58[0] = 0;
+}
+
+void DreamGenContext::removesetobject() {
+ removesetobject(al);
+}
+
+void DreamGenContext::removesetobject(uint8 index) {
+ findormake(index, 0xff, 0);
+ getsetad(index)->b58[0] = 0xff;
+}
+
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 3ffc608f1e..61a65a3a80 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -158,4 +158,8 @@
void dochange(uint8 index, uint8 value, uint8 type);
void deletetaken();
bool isCD();
+ void placesetobject();
+ void placesetobject(uint8 index);
+ void removesetobject();
+ void removesetobject(uint8 index);