aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-11-21 16:49:45 +0100
committerBertrand Augereau2011-11-21 17:52:50 +0100
commitf7fd8e0d0a1ae22a6dadc34133671e9e4f66bffb (patch)
tree14752c96a4d8ecd27c8445b2c63bb5532b8ebf68
parente578cb8976f10cd9217cddef48c6693cf5d03c7b (diff)
downloadscummvm-rg350-f7fd8e0d0a1ae22a6dadc34133671e9e4f66bffb.tar.gz
scummvm-rg350-f7fd8e0d0a1ae22a6dadc34133671e9e4f66bffb.tar.bz2
scummvm-rg350-f7fd8e0d0a1ae22a6dadc34133671e9e4f66bffb.zip
DREAMWEB: 'saveload' ported to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp26
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/saveload.cpp14
-rw-r--r--engines/dreamweb/stubs.h1
5 files changed, 17 insertions, 28 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 8b0797accb..a0a2ba9ed8 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -34,6 +34,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'screenupdate',
'startup',
'startup1',
+ 'saveload',
'switchryanon',
'switchryanoff',
'quickquit',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 0e242fcc83..507a8f80a9 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -10979,31 +10979,6 @@ void DreamGenContext::findtext1() {
si = ax;
}
-void DreamGenContext::saveload() {
- STACK_CHECK;
- _cmp(data.word(kWatchingtime), 0);
- if (!flags.z())
- { blank(); return; };
- _cmp(data.byte(kPointermode), 2);
- if (flags.z())
- { blank(); return; };
- _cmp(data.byte(kCommandtype), 253);
- if (flags.z())
- goto alreadyops;
- data.byte(kCommandtype) = 253;
- al = 43;
- commandonly();
-alreadyops:
- ax = data.word(kMousebutton);
- _cmp(ax, data.word(kOldbutton));
- if (flags.z())
- return /* (noops) */;
- _and(ax, 1);
- if (flags.z())
- return /* (noops) */;
- dosaveload();
-}
-
void DreamGenContext::dosaveload() {
STACK_CHECK;
data.byte(kPointerframe) = 0;
@@ -15156,7 +15131,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_showdiarypage: showdiarypage(); break;
case addr_findtext1: findtext1(); break;
case addr_zoomonoff: zoomonoff(); break;
- case addr_saveload: saveload(); break;
case addr_dosaveload: dosaveload(); break;
case addr_getbackfromops: getbackfromops(); break;
case addr_showmainops: showmainops(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d003a6ecb1..4311babb3b 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -181,7 +181,6 @@ public:
static const uint16 addr_showmainops = 0xc838;
static const uint16 addr_getbackfromops = 0xc834;
static const uint16 addr_dosaveload = 0xc830;
- static const uint16 addr_saveload = 0xc82c;
static const uint16 addr_zoomonoff = 0xc828;
static const uint16 addr_findtext1 = 0xc824;
static const uint16 addr_showdiarypage = 0xc820;
@@ -1419,7 +1418,7 @@ public:
//void makebackob();
void middlepanel();
//void dumpwatch();
- void saveload();
+ //void saveload();
void monitorlogo();
void loadposition();
//void wornerror();
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 6faab5554f..398d71e98b 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -360,4 +360,18 @@ void DreamGenContext::oldtonames() {
memcpy(cs.ptr(kSavenames, 0), segRef(data.word(kBuffers)).ptr(kZoomspace, 0), 17*4);
}
+void DreamGenContext::saveload() {
+ if (data.word(kWatchingtime) || (data.byte(kPointermode) == 2)) {
+ blank();
+ return;
+ }
+ if (data.byte(kCommandtype) != 253) {
+ data.byte(kCommandtype) = 253;
+ commandonly(43);
+ }
+ if ((data.word(kMousebutton) != data.word(kOldbutton)) && (data.word(kMousebutton) & 1))
+ dosaveload();
+}
+
} /*namespace dreamgen */
+
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index c408ac2239..fe761530f0 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -42,6 +42,7 @@
void loadtempcharset();
void loadtempcharset(const char *fileName);
Frame *tempCharset();
+ void saveload();
void printcurs();
void delcurs();
void hangoncurs(uint16 frameCount);