aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-23 10:13:10 +0200
committerBertrand Augereau2011-08-23 13:22:14 +0200
commite04761549d1c4e02be306a2862cbcd6712f24a40 (patch)
tree0e227ad7549430ae482744f282436c5ca7f613a3 /engines/dreamweb
parentc80af54ef9b5564e35f052f93748eccbfd2b25a6 (diff)
downloadscummvm-rg350-e04761549d1c4e02be306a2862cbcd6712f24a40.tar.gz
scummvm-rg350-e04761549d1c4e02be306a2862cbcd6712f24a40.tar.bz2
scummvm-rg350-e04761549d1c4e02be306a2862cbcd6712f24a40.zip
DREAMWEB: 'getflagunderp' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp13
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp14
-rw-r--r--engines/dreamweb/stubs.h2
4 files changed, 17 insertions, 15 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 0ee8c50cd3..288a7a5ae8 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -15976,18 +15976,6 @@ searchmess:
printdirect();
}
-void DreamGenContext::getflagunderp() {
- STACK_CHECK;
- cx = data.word(kMousex);
- _sub(cx, data.word(kMapadx));
- ax = data.word(kMousey);
- _sub(ax, data.word(kMapady));
- ch = al;
- checkone();
- data.byte(kLastflag) = cl;
- data.byte(kLastflagex) = ch;
-}
-
void DreamGenContext::setwalk() {
STACK_CHECK;
_cmp(data.byte(kLinepointer), 254);
@@ -18582,7 +18570,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_examineobtext: examineobtext(); break;
case addr_printmessage: printmessage(); break;
case addr_printmessage2: printmessage2(); break;
- case addr_getflagunderp: getflagunderp(); break;
case addr_setwalk: setwalk(); break;
case addr_bresenhams: bresenhams(); break;
case addr_workoutframes: workoutframes(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 7ed079c00e..eb15b18840 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -115,7 +115,6 @@ public:
static const uint16 addr_workoutframes = 0xca54;
static const uint16 addr_bresenhams = 0xca50;
static const uint16 addr_setwalk = 0xca44;
- static const uint16 addr_getflagunderp = 0xca40;
static const uint16 addr_printmessage2 = 0xca30;
static const uint16 addr_printmessage = 0xca2c;
static const uint16 addr_examineobtext = 0xca20;
@@ -1843,7 +1842,7 @@ public:
void louischair();
void saveems();
void locationpic();
- void getflagunderp();
+ //void getflagunderp();
void dolook();
void opentvdoor();
void triggermessage();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index f0938ea30b..7cf1a307e3 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1163,6 +1163,20 @@ bool DreamGenContext::finishedwalkingCPP() {
return (data.byte(kLinepointer) == 254) && (data.byte(kFacing) == data.byte(kTurntoface));
}
+void DreamGenContext::getflagunderp() {
+ uint8 flag, flagEx;
+ getflagunderp(&flag, &flagEx);
+ cl = flag;
+ ch = flagEx;
+}
+
+void DreamGenContext::getflagunderp(uint8 *flag, uint8 *flagEx) {
+ uint8 type, flagX, flagY;
+ checkone(data.word(kMousex) - data.word(kMapadx), data.word(kMousey) - data.word(kMapady), flag, flagEx, &type, &flagX, &flagY);
+ cl = data.byte(kLastflag) = *flag;
+ ch = data.byte(kLastflagex) = *flagEx;
+}
+
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 9d5550be5b..80bee35e06 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -171,4 +171,6 @@
void finishedwalking();
void checkone();
void checkone(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY);
+ void getflagunderp();
+ void getflagunderp(uint8 *flag, uint8 *flagEx);