From 4aca1957125fafd8726ee0a6c19abbc23b7abc5d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 3 Dec 2011 21:15:40 +0100 Subject: DREAMWEB: Clean up last remaining kFileheader/kFiledata usage --- devtools/tasmrecover/dreamweb/dreamweb.asm | 2 +- devtools/tasmrecover/tasm-recover | 3 ++ engines/dreamweb/dreamgen.cpp | 78 +++++++++++++----------------- engines/dreamweb/dreamgen.h | 25 +++++----- engines/dreamweb/stubs.cpp | 12 ++--- 5 files changed, 52 insertions(+), 68 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index d8a728c382..fa3a4f7957 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -5916,7 +5916,7 @@ Fileheader db "DREAMWEB DATA FILE " db "CREATIVE REALITY" Filedata dw 20 dup (0) Extradata db 6 dup (0) -Headerlen equ $-Fileheader +Headerlen equ 96 ; $-Fileheader Roomdata db "DREAMWEB.R00",0 ;Ryan's apartment diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 2384ba66eb..150bc0fbd2 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -38,6 +38,9 @@ p = parser(skip_binary_data = [ 'linedata', 'madeuproomdat', 'recname', + 'fileheader', + 'filedata', + 'extradata', # keypad.asm 'keypadlist', 'symbollist', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 354eeea44f..f089297df8 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 = 2625; + si = 2529; _add(si, ax); cl = es.byte(si); ax = pop(); push(cx); dx = data; es = dx; - si = 2641; + si = 2545; _add(si, ax); ax = pop(); } @@ -5457,7 +5457,7 @@ clearedlocations: bx = ax; dx = data; es = dx; - _add(bx, 2625); + _add(bx, 2529); es.byte(bx) = 0; } @@ -5572,7 +5572,7 @@ void DreamGenContext::delChar() { si = data.word(kCurpos); _add(si, si); es = cs; - _add(si, 2659); + _add(si, 2563); es.byte(si) = 0; al = es.byte(si+1); ah = 0; @@ -5599,7 +5599,7 @@ void DreamGenContext::execCommand() { es = cs; bx = offset_comlist; ds = cs; - si = 2659; + si = 2563; al = ds.byte(si); _cmp(al, 0); if (!flags.z()) @@ -5794,7 +5794,7 @@ notyetassigned: push(bx); _add(bx, 2); ds = cs; - si = 2659; + si = 2563; checkpass: _lodsw(); ah = es.byte(bx); @@ -6122,7 +6122,7 @@ void DreamGenContext::parser() { al = '='; _stosb(); ds = cs; - si = 2659; + si = 2563; notspace1: _lodsw(); _cmp(al, 32); @@ -9746,7 +9746,7 @@ void DreamGenContext::getNamePos() { _mul(cx); dx = data; es = dx; - bx = 2793; + bx = 2697; _add(bx, ax); al = data.byte(kCursorpos); ah = 0; @@ -9900,7 +9900,7 @@ void DreamGenContext::showNames() { STACK_CHECK; dx = data; es = dx; - si = 2793+1; + si = 2697+1; di = (60)+21; bx = (52)+10; cl = 0; @@ -10420,7 +10420,7 @@ void DreamGenContext::clearChanges() { di = 0; _stosw(cx, true); es = cs; - di = 2625; + di = 2529; al = 1; _stosb(2); al = 0; @@ -11518,64 +11518,52 @@ void DreamGenContext::__start() { //0x09c0: .D:. .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x09d0: .... .... .... .... - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, - //0x09e0: .DRE AMWE B DA TA F - 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, 0x39, - //0x09f0: ILE COPY RIGH T 19 - 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x56, 0x45, 0x20, 0x52, 0x45, 0x41, 0x4c, - //0x0a00: 92 C REAT IVE REAL - 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0a10: ITY. .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0a20: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0a30: .... .... .... .... 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0a40: .... .... .... .... + //0x09e0: .... .... .... .... 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, - //0x0a50: .... .... .... .... + //0x09f0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0a60: .... .... .... .... + //0x0a00: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0a70: .... .... .... .... + //0x0a10: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0a80: .... .... .... .... + //0x0a20: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0a90: .... .... .... .... + //0x0a30: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0aa0: .... .... .... .... + //0x0a40: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0ab0: .... .... .... .... + //0x0a50: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0ac0: .... .... .... .... + //0x0a60: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0ad0: .... .... .... .... + //0x0a70: .... .... .... .... 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x0ae0: .... .... .... .... + //0x0a80: .... .... .... .... 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, - //0x0af0: .... .... .... .... + //0x0a90: .... .... .... .... 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, - //0x0b00: .... .... .... .... + //0x0aa0: .... .... .... .... 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, - //0x0b10: .... .... .... .... + //0x0ab0: .... .... .... .... 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, - //0x0b20: .... .... .... .... + //0x0ac0: .... .... .... .... 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, - //0x0b30: .... .... .... .... + //0x0ad0: .... .... .... .... 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, - //0x0b40: .... .... .... .... + //0x0ae0: .... .... .... .... 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x0b50: .... .... .... .... + //0x0af0: .... .... .... .... 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, - //0x0b60: DREA MWEB .D00 .DRE + //0x0b00: DREA MWEB .D00 .DRE 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - //0x0b70: AMWE B.D0 1.DR EAMW + //0x0b10: AMWE B.D0 1.DR EAMW 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - //0x0b80: EB.D 02.D REAM WEB. + //0x0b20: EB.D 02.D REAM WEB. 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x34, - //0x0b90: D03. DREA MWEB .D04 + //0x0b30: D03. DREA MWEB .D04 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x35, 0x00, 0x44, 0x52, - //0x0ba0: .DRE AMWE B.D0 5.DR + //0x0b40: .DRE AMWE B.D0 5.DR 0x45, 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 7b2b1e87a1..4d1244fe6a 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -490,19 +490,16 @@ public: static const uint16 kTitle7graphics = 1864; static const uint16 kPalettescreen = 1877; static const uint16 kCurrentfile = 2202; - static const uint16 kFileheader = 2529; - static const uint16 kFiledata = 2579; - static const uint16 kExtradata = 2619; - static const uint16 kRoomscango = 2625; - static const uint16 kRoompics = 2641; - static const uint16 kOplist = 2656; - static const uint16 kInputline = 2659; - static const uint16 kPresslist = 2787; - static const uint16 kSavenames = 2793; - static const uint16 kSavefiles = 2912; - static const uint16 kQuitrequested = 3003; - static const uint16 kSubtitles = 3004; - static const uint16 kForeignrelease = 3005; + static const uint16 kRoomscango = 2529; + static const uint16 kRoompics = 2545; + static const uint16 kOplist = 2560; + static const uint16 kInputline = 2563; + static const uint16 kPresslist = 2691; + static const uint16 kSavenames = 2697; + static const uint16 kSavefiles = 2816; + static const uint16 kQuitrequested = 2907; + static const uint16 kSubtitles = 2908; + static const uint16 kForeignrelease = 2909; static const uint16 kBlocktextdat = (0); static const uint16 kPersonframes = (0); static const uint16 kDebuglevel1 = (0); @@ -569,7 +566,6 @@ public: static const uint16 kLenofmapstore = (22*8*20*8); static const uint16 kUndertextsizex = (228); static const uint16 kNumchanges = (250); - static const uint16 kHeaderlen = (2625-2529); static const uint16 kUndertimedysize = (30); static const uint16 kExframeslen = (30000); static const uint16 kTablesize = (32); @@ -594,6 +590,7 @@ public: static const uint16 kZoomx = (8); static const uint16 kInventx = (80); static const uint16 kMenux = (80+40); + static const uint16 kHeaderlen = (96); static const uint16 kLenofreelrouts = (991-534); void useWire(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 14f8d9e7ea..f671bfdd22 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1235,12 +1235,6 @@ void DreamGenContext::makeBackOb(SetObject *objData) { sprite->animFrame = 0; } -void DreamGenContext::readHeader() { - ax = engine->readFromFile(cs.ptr(kFileheader, kHeaderlen), kHeaderlen); - es = cs; - di = kFiledata; -} - uint16 DreamGenContext::allocateAndLoad(unsigned int size) { // allocatemem adds 32 bytes, so it doesn't matter that size/16 rounds down uint16 result = allocateMem(size / 16); @@ -2689,12 +2683,14 @@ void DreamGenContext::restoreReels() { engine->openFile(room.name); cs.word(kHandle) = 1; //only one handle flags._c = false; - readHeader(); + + FileHeader header; + engine->readFromFile((uint8 *)&header, sizeof(FileHeader)); // read segment lengths from room file header int len[15]; for (int i = 0; i < 15; ++i) - len[i] = cs.word(kFiledata + 2*i); + len[i] = header.len(i); engine->skipBytes(len[0]); engine->skipBytes(len[1]); -- cgit v1.2.3