aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-17 22:20:32 +0100
committerWillem Jan Palenstijn2011-12-17 22:28:54 +0100
commit30089ec31504c862d4ad4317075af600d38a79a8 (patch)
tree6fbf2982a19b1eb22cf29e094f4416c89a91dfe9
parent46caa771640a37339a0b2e1ed7774d9f894fdc68 (diff)
downloadscummvm-rg350-30089ec31504c862d4ad4317075af600d38a79a8.tar.gz
scummvm-rg350-30089ec31504c862d4ad4317075af600d38a79a8.tar.bz2
scummvm-rg350-30089ec31504c862d4ad4317075af600d38a79a8.zip
DREAMWEB: Convert clearBuffers, clearChanges
-rwxr-xr-xdevtools/tasmrecover/tasm-recover2
-rw-r--r--engines/dreamweb/dreambase.h2
-rw-r--r--engines/dreamweb/dreamgen.cpp67
-rw-r--r--engines/dreamweb/dreamgen.h2
-rw-r--r--engines/dreamweb/stubs.cpp35
5 files changed, 39 insertions, 69 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index cbc0001b43..30a6ea3036 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -305,6 +305,8 @@ generator = cpp(context, "DreamGen", blacklist = [
'checkspeed',
'chewy',
'clearbeforeload',
+ 'clearbuffers',
+ 'clearchanges',
'clearendpal',
'clearpalette',
'clearreels',
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index 7c86696568..06936ca72d 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -390,6 +390,8 @@ public:
void getTime();
void doChange(uint8 index, uint8 value, uint8 type);
bool isRyanHolding(const char *id);
+ void clearBuffers();
+ void clearChanges();
// from use.cpp
void placeFreeObject(uint8 index);
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index ea4d8e5b05..3c3abe9ca4 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2593,73 +2593,6 @@ gotkeyp:
showDiaryPage();
}
-void DreamGenContext::clearBuffers() {
- STACK_CHECK;
- es = data.word(kBuffers);
- cx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+898-441+68-0)/2;
- ax = 0;
- di = 0;
- _stosw(cx, true);
- es = data.word(kExtras);
- cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2;
- ax = 0x0ffff;
- di = 0;
- _stosw(cx, true);
- es = data.word(kBuffers);
- di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64));
- ds = cs;
- si = 441;
- cx = (898-441);
- _movsb(cx, true);
- es = data.word(kBuffers);
- di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+898-441);
- ds = cs;
- si = 0;
- cx = (68-0);
- _movsb(cx, true);
- clearChanges();
-}
-
-void DreamGenContext::clearChanges() {
- STACK_CHECK;
- es = data.word(kBuffers);
- cx = (250)*2;
- ax = 0x0ffff;
- di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
- _stosw(cx, true);
- ds = data.word(kBuffers);
- si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64));
- es = cs;
- di = 441;
- cx = (898-441);
- _movsb(cx, true);
- ds = data.word(kBuffers);
- si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+898-441);
- es = cs;
- di = 0;
- cx = (68-0);
- _movsb(cx, true);
- data.byte(kExpos) = 0;
- data.word(kExframepos) = 0;
- data.word(kExtextpos) = 0;
- es = data.word(kExtras);
- cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2;
- ax = 0x0ffff;
- di = 0;
- _stosw(cx, true);
- es = cs;
- di = 1120;
- al = 1;
- _stosb(2);
- al = 0;
- _stosb();
- al = 1;
- _stosb();
- ax = 0;
- cx = 6;
- _stosw(cx, true);
-}
-
void DreamGenContext::findPathOfPoint() {
STACK_CHECK;
push(ax);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f6100557c1..98bab1bd0e 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -471,7 +471,6 @@ public:
void fadeDownMon();
void getPersonText();
- void clearBuffers();
void getObTextStart();
void checkObjectSize();
void fillOpen();
@@ -522,7 +521,6 @@ public:
void searchForString();
void selectOpenOb();
void incRyanPage();
- void clearChanges();
void searchForFiles();
void getExAd();
void initialMonCols();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 1ba88405bc..eea38eb196 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -4593,4 +4593,39 @@ void DreamGenContext::showSlots() {
}
}
+void DreamBase::clearBuffers() {
+ memset(getSegment(data.word(kBuffers)).ptr(0, kLengthofbuffer), 0, kLengthofbuffer);
+
+ memset(getSegment(data.word(kExtras)).ptr(0, kLengthofextra), 0xFF, kLengthofextra);
+
+ // TODO: Remove this line
+ // (once the ReelRoutines are no longer in the data segment)
+ memcpy(getSegment(data.word(kBuffers)).ptr(kInitialreelrouts, kLenofreelrouts), data.ptr(kReelroutines, kLenofreelrouts), kLenofreelrouts);
+
+ memcpy(getSegment(data.word(kBuffers)).ptr(kInitialvars, kLengthofvars), data.ptr(kStartvars, kLengthofvars), kLengthofvars);
+
+ clearChanges();
+}
+
+void DreamBase::clearChanges() {
+ memset(getSegment(data.word(kBuffers)).ptr(kListofchanges, 4*kNumchanges), 0xFF, 4*kNumchanges);
+
+ // TODO: Call setupInitialReelRoutines instead
+ // (once the ReelRoutines are no longer in the data segment)
+ memcpy(data.ptr(kReelroutines, kLenofreelrouts), getSegment(data.word(kBuffers)).ptr(kInitialreelrouts, kLenofreelrouts), kLenofreelrouts);
+
+ memcpy(data.ptr(kStartvars, kLengthofvars), getSegment(data.word(kBuffers)).ptr(kInitialvars, kLengthofvars), kLengthofvars);
+
+ data.byte(kExpos) = 0;
+ data.word(kExframepos) = 0;
+ data.word(kExtextpos) = 0;
+
+ memset(getSegment(data.word(kExtras)).ptr(0, kLengthofextra), 0xFF, kLengthofextra);
+
+ const uint8 initialRoomsCanGo[] = { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ memcpy(data.ptr(kRoomscango, 16), initialRoomsCanGo, 16);
+}
+
+
} // End of namespace DreamGen