From 8179a6bfa8bc1c7cd3d40a1e79dbed78b29b485f Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Thu, 17 Nov 2011 17:44:19 +0100 Subject: [PATCH] DREAMWEB: 'readsetdata' ported to C++ --- devtools/tasmrecover/tasm-recover | 1 + engines/dreamweb/dreamgen.cpp | 35 ------------------------------- engines/dreamweb/dreamgen.h | 7 +++---- engines/dreamweb/stubs.cpp | 32 ++++++++++++++++++++++++++++ engines/dreamweb/stubs.h | 1 + 5 files changed, 37 insertions(+), 39 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index dd271dec12a..5e7c478e8e1 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -232,6 +232,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'textforend', 'textformonk', 'twodigitnum', + 'readsetdata', 'loadroomssample', ], skip_output = [ # These functions are processed but not output diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 11bfc07ee0b..fc2ab54d558 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -14403,40 +14403,6 @@ void DreamGenContext::getridoftempsp() { deallocatemem(); } -void DreamGenContext::readsetdata() { - STACK_CHECK; - dx = 1857; - standardload(); - data.word(kCharset1) = ax; - dx = 1922; - standardload(); - data.word(kIcons1) = ax; - dx = 1935; - standardload(); - data.word(kIcons2) = ax; - dx = 1819; - standardload(); - data.word(kMainsprites) = ax; - dx = 2221; - standardload(); - data.word(kPuzzletext) = ax; - dx = 2273; - standardload(); - data.word(kCommandtext) = ax; - ax = data.word(kCharset1); - data.word(kCurrentset) = ax; - _cmp(data.byte(kSoundint), 255); - if (flags.z()) - return /* (novolumeload) */; - dx = 2286; - openfile(); - cx = 2048-256; - ds = data.word(kSoundbuffer); - dx = 16384; - readfromfile(); - closefile(); -} - void DreamGenContext::__start() { @@ -16120,7 +16086,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_getridoftemp3: getridoftemp3(); break; case addr_getridoftempcharset: getridoftempcharset(); break; case addr_getridoftempsp: getridoftempsp(); break; - case addr_readsetdata: readsetdata(); break; case addr_createfile: createfile(); break; case addr_openfile: openfile(); break; case addr_openfilefromc: openfilefromc(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 4f1eeac8098..a97a82947e1 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -49,7 +49,6 @@ public: static const uint16 addr_openfilefromc = 0xcb94; static const uint16 addr_openfile = 0xcb90; static const uint16 addr_createfile = 0xcb8c; - static const uint16 addr_readsetdata = 0xcb88; static const uint16 addr_getridoftempsp = 0xcb84; static const uint16 addr_getridoftempcharset = 0xcb80; static const uint16 addr_getridoftemp3 = 0xcb7c; @@ -1268,7 +1267,6 @@ public: //void getexpos(); void fadedos(); //void fillspace(); - void selectlocation(); //void multiget(); //void autosetwalk(); void fadeupmonfirst(); @@ -1625,6 +1623,7 @@ public: void findopenpos(); void describeob(); void deleteexframe(); + //void readsetdata(); void folderexit(); void dosreturn(); void wheelsound(); @@ -1768,7 +1767,7 @@ public: void calledensdlift(); void checkinside(); void gates(); - void newgame(); + void selectlocation(); //void showwatch(); //void turnanypathon(); void restorereels(); @@ -1923,7 +1922,7 @@ public: void getridoftempsp(); void scanfornames(); //void setallchanges(); - void readsetdata(); + void newgame(); //void printboth(); void standardload(); void undertextline(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index cfc40b9c746..67be4e2598f 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -2052,5 +2052,37 @@ void DreamGenContext::loadroomssample() { loadsecondsample(); } +void DreamGenContext::readsetdata() { + dx = kCharacterset1; + standardload(); + data.word(kCharset1) = ax; + dx = kIcongraphics0; + standardload(); + data.word(kIcons1) = ax; + dx = kIcongraphics1; + standardload(); + data.word(kIcons2) = ax; + dx = kSpritename1; + standardload(); + data.word(kMainsprites) = ax; + dx = kPuzzletextname; + standardload(); + data.word(kPuzzletext) = ax; + dx = kCommandtextname; + standardload(); + data.word(kCommandtext) = ax; + ax = data.word(kCharset1); + data.word(kCurrentset) = ax; + if (data.byte(kSoundint) == 0xff) + return; + dx = kVolumetabname; + openfile(); + cx = 2048-256; + ds = data.word(kSoundbuffer); + dx = 16384; + readfromfile(); + closefile(); +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 29068332e6c..6a95ea2313b 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -275,5 +275,6 @@ void putundermenu(); void textformonk(); void textforend(); + void readsetdata(); void loadroomssample();