diff options
author | Filippos Karapetis | 2011-12-09 00:28:25 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-09 00:29:11 +0200 |
commit | 0d90b66d3896a8107a140a0b2e048492993c7229 (patch) | |
tree | 03ac87fadf5c9d70207177caa24cbb80ba9ad83e /engines/dreamweb | |
parent | 99d3b7b5c3042dcd0857aa733e2d43ed17864c0f (diff) | |
download | scummvm-rg350-0d90b66d3896a8107a140a0b2e048492993c7229.tar.gz scummvm-rg350-0d90b66d3896a8107a140a0b2e048492993c7229.tar.bz2 scummvm-rg350-0d90b66d3896a8107a140a0b2e048492993c7229.zip |
DREAMWEB: Port 'discops' to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 124 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 28 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 53 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 94 insertions, 112 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 5331d78fdf..9a07dc11ec 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -3380,14 +3380,14 @@ void DreamGenContext::getDestInfo() { push(ax); dx = data; es = dx; - si = 1581; + si = 1539; _add(si, ax); cl = es.byte(si); ax = pop(); push(cx); dx = data; es = dx; - si = 1597; + si = 1555; _add(si, ax); ax = pop(); } @@ -3439,7 +3439,7 @@ clearedlocations: bx = ax; dx = data; es = dx; - _add(bx, 1581); + _add(bx, 1539); es.byte(bx) = 0; } @@ -3475,7 +3475,7 @@ void DreamGenContext::execCommand() { es = cs; bx = offset_comlist; ds = cs; - si = 1615; + si = 1573; al = ds.byte(si); _cmp(al, 0); if (!flags.z()) @@ -3670,7 +3670,7 @@ notyetassigned: push(bx); _add(bx, 2); ds = cs; - si = 1615; + si = 1573; checkpass: _lodsw(); ah = es.byte(bx); @@ -3998,7 +3998,7 @@ void DreamGenContext::parser() { al = '='; _stosb(); ds = cs; - si = 1615; + si = 1573; notspace1: _lodsw(); _cmp(al, 32); @@ -5874,48 +5874,6 @@ justret: data.byte(kManisoffscreen) = 0; } -void DreamGenContext::discOps() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 249); - if (flags.z()) - goto alreadydiscops; - data.byte(kCommandtype) = 249; - al = 43; - commandOnly(); -alreadydiscops: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nodiscops) */; - _and(ax, 1); - if (!flags.z()) - goto dodiscops; - return; -dodiscops: - scanForNames(); - data.byte(kLoadingorsave) = 2; - showOpBox(); - showDiscOps(); - data.byte(kCurrentslot) = 0; - workToScreenM(); - data.byte(kGetback) = 0; -discopsloop: - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - return /* (quitdiscops) */; - delPointer(); - readMouse(); - showPointer(); - vSync(); - dumpPointer(); - dumpTextLine(); - bx = offset_discopslist; - checkCoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto discopsloop; -} - void DreamGenContext::checkInput() { STACK_CHECK; _cmp(data.byte(kLoadingorsave), 3); @@ -5971,7 +5929,7 @@ void DreamGenContext::getNamePos() { _mul(cx); dx = data; es = dx; - bx = 1749; + bx = 1707; _add(bx, ax); al = data.byte(kCursorpos); ah = 0; @@ -6067,7 +6025,7 @@ void DreamGenContext::showNames() { STACK_CHECK; dx = data; es = dx; - si = 1749+1; + si = 1707+1; di = (60)+21; bx = (52)+10; cl = 0; @@ -6443,7 +6401,7 @@ void DreamGenContext::clearChanges() { di = 0; _stosw(cx, true); es = cs; - di = 1581; + di = 1539; al = 1; _stosb(2); al = 0; @@ -6812,31 +6770,31 @@ void DreamGenContext::__start() { //0x0560: w... R... 4.F. ..>. 0x6f, 0x00, 0x80, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, //0x0570: o... .... D... L... - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, - //0x0580: @... .... ..w. ..R. - 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, - //0x0590: ..D. F... >.o. P... - 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - //0x05a0: ..p. ..H. ..@. .... - 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, - //0x05b0: .... .... $SPE ECHR - 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x4f, 0x42, 0x4a, 0x45, - //0x05c0: 24C0 005. RAW. OBJE - 0x43, 0x54, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x05d0: CT N AME ONE - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x05e0: - 0x20, 0x20, 0x20, 0x20, 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, - //0x05f0: .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, - //0x0600: .... .... .... .D:. + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x53, + //0x0580: @... .... .... ..$S + 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, + //0x0590: PEEC HR24 C000 5.RA + 0x57, 0x00, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, + //0x05a0: W.OB JECT NAM E ON + 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + //0x05b0: E + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, + //0x05c0: .. .... + 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, + //0x05d0: .... .... .... .... + 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x05e0: ...D :... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x05f0: .... .... .... .... + 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x0600: .... .... .... .... + 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, //0x0610: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0620: .... .... .... .... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0630: .... .... .... .... - 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, 0x00, 0x00, 0x00, //0x0640: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0650: .... .... .... .... @@ -6848,27 +6806,23 @@ void DreamGenContext::__start() { //0x0680: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0690: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, //0x06a0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, //0x06b0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, //0x06c0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, //0x06d0: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, //0x06e0: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, //0x06f0: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, //0x0700: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, //0x0710: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, - //0x0720: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, - //0x0730: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, }; + 0x01, 0x01, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index f35c87d536..776fbe0fd2 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -32,19 +32,18 @@ namespace DreamGen { -static const uint16 offset_opslist = 0x0560; -static const uint16 offset_operand1 = 0x0504; static const uint16 offset_money1poke = 0x052e; +static const uint16 offset_speechfile = 0x0595; static const uint16 offset_openchangesize = 0x0446; -static const uint16 offset_discopslist = 0x058a; -static const uint16 offset_commandline = 0x05cc; +static const uint16 offset_operand1 = 0x0504; static const uint16 offset_comlist = 0x045e; -static const uint16 offset_speechfile = 0x05bf; +static const uint16 offset_opslist = 0x0560; static const uint16 offset_diarylist = 0x0536; static const uint16 offset_rootdir = 0x0512; static const uint16 offset_money2poke = 0x0533; static const uint16 offset_keys = 0x049a; static const uint16 offset_quitlist = 0x0448; +static const uint16 offset_commandline = 0x05a2; static const uint16 kStartvars = 0; static const uint16 kProgresspoints = 1; static const uint16 kWatchon = 2; @@ -426,15 +425,15 @@ static const uint16 kGungraphic = 1055; static const uint16 kMonkface = 1068; static const uint16 kTitle7graphics = 1081; static const uint16 kCurrentfile = 1312; -static const uint16 kRoomscango = 1581; -static const uint16 kRoompics = 1597; -static const uint16 kOplist = 1612; -static const uint16 kInputline = 1615; -static const uint16 kPresslist = 1743; -static const uint16 kSavenames = 1749; -static const uint16 kQuitrequested = 1868; -static const uint16 kSubtitles = 1869; -static const uint16 kForeignrelease = 1870; +static const uint16 kRoomscango = 1539; +static const uint16 kRoompics = 1555; +static const uint16 kOplist = 1570; +static const uint16 kInputline = 1573; +static const uint16 kPresslist = 1701; +static const uint16 kSavenames = 1707; +static const uint16 kQuitrequested = 1826; +static const uint16 kSubtitles = 1827; +static const uint16 kForeignrelease = 1828; static const uint16 kBlocktextdat = (0); static const uint16 kPersonframes = (0); static const uint16 kDebuglevel1 = (0); @@ -585,7 +584,6 @@ public: void removeObFromInv(); void heavy(); void useKey(); - void discOps(); void monitorLogo(); void dirFile(); void pickupConts(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 8d7ef9340a..c39ca75b46 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1707,17 +1707,6 @@ void DreamGenContext::checkCoords() { checkCoords(opsList); break; } - case offset_discopslist: { - RectWithCallback discOpsList[] = { - { kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamGenContext::loadGame }, - { kOpsx+10,kOpsx+79,kOpsy+10,kOpsy+59,&DreamGenContext::saveGame }, - { kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamGenContext::getBackToOps }, - { 0,320,0,200,&DreamGenContext::blank }, - { 0xFFFF,0,0,0,0 } - }; - checkCoords(discOpsList); - break; - } default: ::error("Unimplemented checkcoords() call"); } @@ -4019,9 +4008,49 @@ void DreamGenContext::talk() { workToScreenM(); if (data.byte(kSpeechloaded) == 1) { cancelCh1(); - data.byte(kVolumedirection) = -1; + data.byte(kVolumedirection) = 0xFF; data.byte(kVolumeto) = 0; } } + +void DreamGenContext::discOps() { + if (data.byte(kCommandtype) != 249) { + data.byte(kCommandtype) = 249; + commandOnly(43); + } + + if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1)) + return; + + scanForNames(); + data.byte(kLoadingorsave) = 2; + showOpBox(); + showDiscOps(); + data.byte(kCurrentslot) = 0; + workToScreenM(); + data.byte(kGetback) = 0; + + RectWithCallback discOpsList[] = { + { kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamGenContext::loadGame }, + { kOpsx+10,kOpsx+79,kOpsy+10,kOpsy+59,&DreamGenContext::saveGame }, + { kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamGenContext::getBackToOps }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + do { + if (data.byte(kQuitrequested) != 0) + return; // quitdiscops + + delPointer(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + checkCoords(discOpsList); + } while (!data.byte(kGetback)); +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index ab59b973d2..114b271aa5 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -556,5 +556,6 @@ void putUnderZoom(); void decide(); void talk(); + void discOps(); #endif |