aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-11-17 18:21:34 +0100
committerBertrand Augereau2011-11-17 18:31:17 +0100
commit088ec69949b60e6398a447c3b37fbb5064fa8d46 (patch)
tree112ed586b6c436b6f07ad1a7d33660f22fe324c7 /engines
parent6c51635bb268aef450d4819877e5bb4ee328557d (diff)
downloadscummvm-rg350-088ec69949b60e6398a447c3b37fbb5064fa8d46.tar.gz
scummvm-rg350-088ec69949b60e6398a447c3b37fbb5064fa8d46.tar.bz2
scummvm-rg350-088ec69949b60e6398a447c3b37fbb5064fa8d46.zip
DREAMWEB: 'standardload' ported to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp19
-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, 21 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index fc2ab54d55..bb0f7ee942 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -14125,24 +14125,6 @@ void DreamGenContext::loadtempcharset() {
data.word(kTempcharset) = ax;
}
-void DreamGenContext::standardload() {
- STACK_CHECK;
- openfile();
- readheader();
- bx = es.word(di);
- push(bx);
- cl = 4;
- _shr(bx, cl);
- allocatemem();
- ds = ax;
- cx = pop();
- push(ax);
- dx = 0;
- readfromfile();
- closefile();
- ax = pop();
-}
-
void DreamGenContext::loadtemptext() {
STACK_CHECK;
standardload();
@@ -16070,7 +16052,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_loadintotemp2: loadintotemp2(); break;
case addr_loadintotemp3: loadintotemp3(); break;
case addr_loadtempcharset: loadtempcharset(); break;
- case addr_standardload: standardload(); break;
case addr_loadtemptext: loadtemptext(); break;
case addr_getridofreels: getridofreels(); break;
case addr_getridofall: getridofall(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index a97a82947e..d7cc73c634 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -64,7 +64,6 @@ public:
static const uint16 addr_getridofall = 0xcb3c;
static const uint16 addr_getridofreels = 0xcb38;
static const uint16 addr_loadtemptext = 0xcb2c;
- static const uint16 addr_standardload = 0xcb28;
static const uint16 addr_loadtempcharset = 0xcb24;
static const uint16 addr_loadintotemp3 = 0xcb20;
static const uint16 addr_loadintotemp2 = 0xcb1c;
@@ -1924,7 +1923,7 @@ public:
//void setallchanges();
void newgame();
//void printboth();
- void standardload();
+ //void standardload();
void undertextline();
void findroominloc();
void sitdowninbar();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 1a2943043c..c2dfa6644f 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -208,6 +208,20 @@ static Common::String getFilename(Context &context) {
return Common::String(name);
}
+uint16 DreamGenContext::standardload(const char *fileName) {
+ engine->openFile(fileName);
+ engine->readFromFile(cs.ptr(kFileheader, kHeaderlen), kHeaderlen);
+ uint16 sizeInBytes = cs.word(kFiledata);
+ uint16 result = allocatemem((sizeInBytes + 15) / 16);
+ engine->readFromFile(segRef(result).ptr(0, 0), sizeInBytes);
+ engine->closeFile();
+ return result;
+}
+
+void DreamGenContext::standardload() {
+ ax = standardload((const char *)cs.ptr(dx, 0));
+}
+
void DreamGenContext::seecommandtail() {
data.word(kSoundbaseadd) = 0x220;
data.byte(kSoundint) = 5;
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6a95ea2313..a4c2ccfdf8 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -23,6 +23,8 @@
uint8 *workspace();
void allocatework();
void clearwork();
+ void standardload();
+ uint16 standardload(const char *fileName); // Returns a segment handle which needs to be freed with deallocatemem for symmetry
void multidump();
void multidump(uint16 x, uint16 y, uint8 width, uint8 height);
void frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y);