aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-11-26 20:45:59 +0100
committerWillem Jan Palenstijn2011-11-26 20:47:54 +0100
commit1c860bc4ce508506045e8f37fa4a6cf036577464 (patch)
tree45b11d279d9d5852933808f1a33d04704a294d84 /engines/dreamweb
parent900fc7d50e2688a83029578eb284483299465b2f (diff)
downloadscummvm-rg350-1c860bc4ce508506045e8f37fa4a6cf036577464.tar.gz
scummvm-rg350-1c860bc4ce508506045e8f37fa4a6cf036577464.tar.bz2
scummvm-rg350-1c860bc4ce508506045e8f37fa4a6cf036577464.zip
DREAMWEB: Convert 'restorereels'
This also allows 'allocateload' to be removed.
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp12
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp49
3 files changed, 23 insertions, 41 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 61d9e6f458..cbbfc6df88 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -12715,18 +12715,6 @@ void DreamGenContext::getridofall() {
deallocatemem();
}
-void DreamGenContext::allocateload() {
- STACK_CHECK;
- push(es);
- push(di);
- bx = es.word(di);
- cl = 4;
- _shr(bx, cl);
- allocatemem();
- di = pop();
- es = pop();
-}
-
void DreamGenContext::getridoftemp() {
STACK_CHECK;
es = data.word(kTempgraphics);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index ddfa97789d..f3c9873b13 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -53,7 +53,6 @@ public:
static const uint16 addr_getridoftemp2 = 0xcb78;
static const uint16 addr_getridoftemptext = 0xcb74;
static const uint16 addr_getridoftemp = 0xcb70;
- static const uint16 addr_allocateload = 0xcb68;
static const uint16 addr_dontloadseg = 0xcb64;
static const uint16 addr_getridofall = 0xcb3c;
static const uint16 addr_getridofreels = 0xcb38;
@@ -1799,7 +1798,7 @@ public:
//void getnextword();
void generalerror();
//void actualload();
- void allocateload();
+ //void allocateload();
//void saveposition();
void mode640x480();
void openeden();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 40c9cd18b0..c336a62307 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2315,34 +2315,29 @@ void DreamGenContext::restoreall() {
}
void DreamGenContext::restorereels() {
- STACK_CHECK;
- _cmp(data.byte(kRoomloaded), 0);
- if (flags.z())
- return /* (dontrestore) */;
- al = data.byte(kReallocation);
- getroomdata();
- dx = bx;
- openfile();
+ if (data.byte(kRoomloaded) == 0)
+ return;
+
+ const Room *room = getroomdata(data.byte(kReallocation));
+
+ engine->openFile(room->name);
+ cs.word(kHandle) = 1; //only one handle
+ flags._c = false;
readheader();
- dontloadseg();
- dontloadseg();
- dontloadseg();
- dontloadseg();
- allocateload();
- data.word(kReel1) = ax;
- ds = ax;
- dx = 0;
- loadseg();
- allocateload();
- data.word(kReel2) = ax;
- ds = ax;
- dx = 0;
- loadseg();
- allocateload();
- data.word(kReel3) = ax;
- ds = ax;
- dx = 0;
- loadseg();
+
+ // read segment lengths from room file header
+ int len[15];
+ for (int i = 0; i < 15; ++i)
+ len[i] = cs.word(kFiledata + 2*i);
+
+ engine->skipBytes(len[0]);
+ engine->skipBytes(len[1]);
+ engine->skipBytes(len[2]);
+ engine->skipBytes(len[3]);
+ data.word(kReel1) = allocateAndLoad(len[4]);
+ data.word(kReel2) = allocateAndLoad(len[5]);
+ data.word(kReel3) = allocateAndLoad(len[6]);
+
closefile();
}