aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-07-26 07:54:25 +0200
committerBertrand Augereau2011-07-28 17:26:47 +0200
commit5fc6a6e385813bb2b060e79f7853cd6ad112cad7 (patch)
treee26e76c52a339463dc959c8d1b6200864bc90b60
parentdfec38c615279dad5f6bc41ad7843e20bcd27d22 (diff)
downloadscummvm-rg350-5fc6a6e385813bb2b060e79f7853cd6ad112cad7.tar.gz
scummvm-rg350-5fc6a6e385813bb2b060e79f7853cd6ad112cad7.tar.bz2
scummvm-rg350-5fc6a6e385813bb2b060e79f7853cd6ad112cad7.zip
DREAMWEB: 'getroomspaths' and 'facerightway' ported to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover4
-rw-r--r--engines/dreamweb/dreamgen.cpp31
-rw-r--r--engines/dreamweb/dreamgen.h6
-rw-r--r--engines/dreamweb/sprite.cpp7
-rw-r--r--engines/dreamweb/stubs.cpp13
-rw-r--r--engines/dreamweb/stubs.h3
6 files changed, 28 insertions, 36 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index f09e2d186d..e0b0e21394 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -73,6 +73,8 @@ generator = cpp(context, "DreamGen", blacklist = [
'modifychar',
'lockmon',
'cancelch0',
- 'cancelch1'
+ 'cancelch1',
+ 'getroomspaths',
+ 'facerightway',
])
generator.generate('dreamweb') #start routine
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 7ec64263da..182a4411dd 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2395,24 +2395,6 @@ decdir:
es.byte(bx+29) = 0;
}
-void DreamGenContext::facerightway() {
- STACK_CHECK;
- push(es);
- push(bx);
- getroomspaths();
- al = data.byte(kManspath);
- ah = 0;
- _add(ax, ax);
- _add(ax, ax);
- _add(ax, ax);
- _add(bx, ax);
- al = es.byte(bx+7);
- data.byte(kTurntoface) = al;
- data.byte(kLeavedirection) = al;
- bx = pop();
- es = pop();
-}
-
void DreamGenContext::checkforexit() {
STACK_CHECK;
cl = data.byte(kRyanx);
@@ -18566,17 +18548,6 @@ success:
data.byte(kTurndirection) = 0;
}
-void DreamGenContext::getroomspaths() {
- STACK_CHECK;
- al = data.byte(kRoomnum);
- ah = 0;
- cx = 144;
- _mul(cx);
- es = data.word(kReels);
- bx = (0);
- _add(bx, ax);
-}
-
void DreamGenContext::copyname() {
STACK_CHECK;
push(di);
@@ -20908,7 +20879,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_findsource: findsource(); break;
case addr_mainman: mainman(); break;
case addr_aboutturn: aboutturn(); break;
- case addr_facerightway: facerightway(); break;
case addr_checkforexit: checkforexit(); break;
case addr_adjustdown: adjustdown(); break;
case addr_adjustup: adjustup(); break;
@@ -21457,7 +21427,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_checkdest: checkdest(); break;
case addr_bresenhams: bresenhams(); break;
case addr_workoutframes: workoutframes(); break;
- case addr_getroomspaths: getroomspaths(); break;
case addr_copyname: copyname(); break;
case addr_findobname: findobname(); break;
case addr_showicon: showicon(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 037fd2ad2a..130e0f0b5b 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -123,7 +123,6 @@ public:
static const uint16 addr_showicon = 0xca64;
static const uint16 addr_findobname = 0xca60;
static const uint16 addr_copyname = 0xca5c;
- static const uint16 addr_getroomspaths = 0xca58;
static const uint16 addr_workoutframes = 0xca54;
static const uint16 addr_bresenhams = 0xca50;
static const uint16 addr_checkdest = 0xca4c;
@@ -674,7 +673,6 @@ public:
static const uint16 addr_adjustup = 0xc150;
static const uint16 addr_adjustdown = 0xc14c;
static const uint16 addr_checkforexit = 0xc148;
- static const uint16 addr_facerightway = 0xc144;
static const uint16 addr_aboutturn = 0xc13c;
static const uint16 addr_mainman = 0xc138;
static const uint16 addr_findsource = 0xc130;
@@ -1513,7 +1511,7 @@ public:
void fillopen();
//void usetimedtext();
void delsprite();
- void getroomspaths();
+ //void getroomspaths();
//void dumptextline();
void fadescreendownhalf();
void useplate();
@@ -1902,7 +1900,7 @@ public:
void checkdest();
//void initman();
void loadpalfromiff();
- void facerightway();
+ //void facerightway();
void startup1();
void findlen();
void showsymbol();
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 6ed0421a93..ed54ea12f7 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -536,5 +536,12 @@ void DreamGenContext::liftsprite(Sprite *sprite, ObjData *objData) {
}
}
+void DreamGenContext::facerightway() {
+ uint8 *paths = getroomspathsCPP();
+ uint8 dir = paths[8 * data.byte(kManspath) + 7];
+ data.byte(kTurntoface) = dir;
+ data.byte(kLeavedirection) = dir;
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 0eb2d6de1f..dc9d60082b 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -825,5 +825,18 @@ void DreamGenContext::cancelch1() {
engine->stopSound(1);
}
+void DreamGenContext::getroomspaths() {
+ es = data.word(kReels);
+ bx = data.byte(kRoomnum) * 144;
+}
+
+uint8 *DreamGenContext::getroomspathsCPP() {
+ push(es);
+ es = data.word(kReels);
+ void *result = es.ptr(data.byte(kRoomnum) * 144, 144);
+ es = pop();
+ return (uint8 *)result;
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index b1e4be5f06..6c12ce4807 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -71,6 +71,7 @@
void spriteupdate();
void initman();
void mainmanCPP(Sprite *sprite);
+ void facerightway();
void walking();
void walking(Sprite *sprite);
void aboutturn(Sprite *sprite);
@@ -88,6 +89,8 @@
void liftsprite(Sprite *sprite, ObjData *objData);
void turnpathonCPP(uint8 param);
void turnpathoffCPP(uint8 param);
+ void getroomspaths();
+ uint8 *getroomspathsCPP();
void modifychar();
void lockmon();
void cancelch0();