aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-03 20:32:41 +0100
committerWillem Jan Palenstijn2011-12-03 20:39:06 +0100
commit1fb892878fcfa6c38efc08e40e59676785147e70 (patch)
tree63ff4e7503b539fc88dce077f624b09dc99df8d5
parent0336c67bfdc86be6932b9f57939361769ba25e6d (diff)
downloadscummvm-rg350-1fb892878fcfa6c38efc08e40e59676785147e70.tar.gz
scummvm-rg350-1fb892878fcfa6c38efc08e40e59676785147e70.tar.bz2
scummvm-rg350-1fb892878fcfa6c38efc08e40e59676785147e70.zip
DREAMWEB: Move temporary room for loading out of data segment
-rwxr-xr-xdevtools/tasmrecover/tasm-recover2
-rw-r--r--engines/dreamweb/dreamgen.cpp62
-rw-r--r--engines/dreamweb/dreamgen.h22
-rw-r--r--engines/dreamweb/saveload.cpp14
4 files changed, 48 insertions, 52 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 87005894a8..0896f0563b 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -36,6 +36,8 @@ p = parser(skip_binary_data = [
'keyconverttab',
'atmospherelist',
'linedata',
+ 'madeuproomdat',
+ 'recname',
# keypad.asm
'keypadlist',
'symbollist',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 3bdad08ac8..7a66a05bc0 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -5273,14 +5273,14 @@ void DreamGenContext::getDestInfo() {
push(ax);
dx = data;
es = dx;
- si = 2800;
+ si = 2768;
_add(si, ax);
cl = es.byte(si);
ax = pop();
push(cx);
dx = data;
es = dx;
- si = 2816;
+ si = 2784;
_add(si, ax);
ax = pop();
}
@@ -5457,7 +5457,7 @@ clearedlocations:
bx = ax;
dx = data;
es = dx;
- _add(bx, 2800);
+ _add(bx, 2768);
es.byte(bx) = 0;
}
@@ -5670,7 +5670,7 @@ void DreamGenContext::delChar() {
si = data.word(kCurpos);
_add(si, si);
es = cs;
- _add(si, 2834);
+ _add(si, 2802);
es.byte(si) = 0;
al = es.byte(si+1);
ah = 0;
@@ -5697,7 +5697,7 @@ void DreamGenContext::execCommand() {
es = cs;
bx = offset_comlist;
ds = cs;
- si = 2834;
+ si = 2802;
al = ds.byte(si);
_cmp(al, 0);
if (!flags.z())
@@ -5892,7 +5892,7 @@ notyetassigned:
push(bx);
_add(bx, 2);
ds = cs;
- si = 2834;
+ si = 2802;
checkpass:
_lodsw();
ah = es.byte(bx);
@@ -6220,7 +6220,7 @@ void DreamGenContext::parser() {
al = '=';
_stosb();
ds = cs;
- si = 2834;
+ si = 2802;
notspace1:
_lodsw();
_cmp(al, 32);
@@ -9844,7 +9844,7 @@ void DreamGenContext::getNamePos() {
_mul(cx);
dx = data;
es = dx;
- bx = 2968;
+ bx = 2936;
_add(bx, ax);
al = data.byte(kCursorpos);
ah = 0;
@@ -9998,7 +9998,7 @@ void DreamGenContext::showNames() {
STACK_CHECK;
dx = data;
es = dx;
- si = 2968+1;
+ si = 2936+1;
di = (60)+21;
bx = (52)+10;
cl = 0;
@@ -10518,7 +10518,7 @@ void DreamGenContext::clearChanges() {
di = 0;
_stosw(cx, true);
es = cs;
- di = 2800;
+ di = 2768;
al = 1;
_stosb(2);
al = 0;
@@ -11646,13 +11646,13 @@ void DreamGenContext::__start() {
//0x0ab0: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0ac0: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0ad0: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00,
//0x0ae0: .... .... .... ....
- 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0af0: .... .... .... ....
- 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0b00: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0b10: .... .... .... ....
@@ -11666,39 +11666,33 @@ void DreamGenContext::__start() {
//0x0b50: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0b60: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- //0x0b70: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- //0x0b80: .... .... .... ....
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- //0x0b90: .... .... .... ....
+ //0x0b70: .... .... .... ....
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01,
- //0x0ba0: .... .... .... ....
+ //0x0b80: .... .... .... ....
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01,
- //0x0bb0: .... .... .... ....
+ //0x0b90: .... .... .... ....
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01,
- //0x0bc0: .... .... .... ....
+ //0x0ba0: .... .... .... ....
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01,
- //0x0bd0: .... .... .... ....
+ //0x0bb0: .... .... .... ....
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01,
- //0x0be0: .... .... .... ....
+ //0x0bc0: .... .... .... ....
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00,
- //0x0bf0: .... .... .... ....
+ //0x0bd0: .... .... .... ....
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x44,
- //0x0c00: .... .... .... ...D
+ //0x0be0: .... .... .... ...D
0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41,
- //0x0c10: REAM WEB. D00. DREA
+ //0x0bf0: REAM WEB. D00. DREA
0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45,
- //0x0c20: MWEB .D01 .DRE AMWE
+ //0x0c00: MWEB .D01 .DRE AMWE
0x42, 0x2e, 0x44, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44,
- //0x0c30: B.D0 2.DR EAMW EB.D
+ //0x0c10: B.D0 2.DR EAMW EB.D
0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00,
- //0x0c40: 03.D REAM WEB. D04.
+ //0x0c20: 03.D REAM WEB. D04.
0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45,
- //0x0c50: DREA MWEB .D05 .DRE
- 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57,
- //0x0c60: AMWE B.D0 6.DR EAMW
- 0x45, 0x42, 0x2e, 0x44, 0x45, 0x4d, 0x00, 0x00, 0x00, 0x00, };
+ //0x0c30: DREA MWEB .D05 .DRE
+ 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x36, 0x00, 0x00, 0x00, 0x00, };
ds.assign(src, src + sizeof(src));
dreamweb();
}
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index aa5b10bdcd..01a1bd6571 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -504,18 +504,16 @@ public:
static const uint16 kFileheader = 2672;
static const uint16 kFiledata = 2722;
static const uint16 kExtradata = 2762;
- static const uint16 kMadeuproomdat = 2768;
- static const uint16 kRoomscango = 2800;
- static const uint16 kRoompics = 2816;
- static const uint16 kOplist = 2831;
- static const uint16 kInputline = 2834;
- static const uint16 kPresslist = 2962;
- static const uint16 kSavenames = 2968;
- static const uint16 kSavefiles = 3087;
- static const uint16 kRecname = 3178;
- static const uint16 kQuitrequested = 3191;
- static const uint16 kSubtitles = 3192;
- static const uint16 kForeignrelease = 3193;
+ static const uint16 kRoomscango = 2768;
+ static const uint16 kRoompics = 2784;
+ static const uint16 kOplist = 2799;
+ static const uint16 kInputline = 2802;
+ static const uint16 kPresslist = 2930;
+ static const uint16 kSavenames = 2936;
+ static const uint16 kSavefiles = 3055;
+ static const uint16 kQuitrequested = 3146;
+ static const uint16 kSubtitles = 3147;
+ static const uint16 kForeignrelease = 3148;
static const uint16 kBlocktextdat = (0);
static const uint16 kPersonframes = (0);
static const uint16 kDebuglevel1 = (0);
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 6f1691f6fa..910f74e86c 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -28,6 +28,10 @@
namespace DreamGen {
+// Temporary storage for loading the room from a savegame
+Room g_madeUpRoomDat;
+
+
void DreamGenContext::loadGame() {
if (data.byte(kCommandtype) != 246) {
data.byte(kCommandtype) = 246;
@@ -100,15 +104,13 @@ void DreamGenContext::doLoad(int savegameId) {
}
// If we reach this point, loadPosition() has just been called.
- // Note: Among other things, it will have filled kMadeuproomdat.
-
+ // Among other things, it will have filled g_MadeUpRoomDat.
// kTempgraphics might not have been allocated if we bypassed all menus
if (data.word(kTempgraphics) != 0xFFFF)
getRidOfTemp();
- const Room *room = (const Room *)cs.ptr(kMadeuproomdat, sizeof(Room));
- startLoading(*room);
+ startLoading(g_madeUpRoomDat);
loadRoomsSample();
data.byte(kRoomloaded) = 1;
data.byte(kNewlocation) = 255;
@@ -370,9 +372,9 @@ void DreamGenContext::loadPosition(unsigned int slot) {
engine->readFromSaveFile(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]);
// len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango'
- // Note: the values read into Madeuproomdat are only used in actualLoad,
+ // Note: the values read into g_madeUpRoomDat are only used in actualLoad,
// which is (almost) immediately called after this function
- engine->readFromSaveFile(data.ptr(kMadeuproomdat, sizeof(Room)), sizeof(Room));
+ engine->readFromSaveFile((uint8 *)&g_madeUpRoomDat, sizeof(Room));
engine->readFromSaveFile(data.ptr(kRoomscango, 16), 16);
engine->readFromSaveFile(cs.ptr(kReelroutines, len[5]), len[5]);