From 7eab6a7c59feaff698061be19aef61d0d0e688c2 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Thu, 18 Aug 2011 00:35:10 +0200 Subject: DREAMWEB: 'commandonly' ported to C++ --- devtools/tasmrecover/tasm-recover | 1 + engines/dreamweb/dreamgen.cpp | 36 ------------------------------------ engines/dreamweb/dreamgen.h | 7 +++---- engines/dreamweb/stubs.cpp | 14 ++++++++++++++ engines/dreamweb/stubs.h | 2 ++ 5 files changed, 20 insertions(+), 40 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 1c5dacc69c..c333f58ad4 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -123,6 +123,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'getmapad', 'calcfrframe', 'finalframe', + 'commandonly', ], skip_output = [ # These functions are processed but not output 'dreamweb', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 23c9096aa2..1d974996cc 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -16566,41 +16566,6 @@ void DreamGenContext::examineobtext() { commandwithob(); } -void DreamGenContext::commandonly() { - STACK_CHECK; - push(ax); - push(bx); - push(cx); - push(dx); - push(es); - push(ds); - push(si); - push(di); - deltextline(); - di = pop(); - si = pop(); - ds = pop(); - es = pop(); - dx = pop(); - cx = pop(); - bx = pop(); - ax = pop(); - ah = 0; - _add(ax, ax); - bx = ax; - es = data.word(kCommandtext); - ax = es.word(bx); - _add(ax, (66*2)); - si = ax; - di = data.word(kTextaddressx); - bx = data.word(kTextaddressy); - dl = data.byte(kTextlen); - al = 0; - ah = 0; - printdirect(); - data.byte(kNewtextline) = 1; -} - void DreamGenContext::printmessage() { STACK_CHECK; push(dx); @@ -19326,7 +19291,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_obname: obname(); break; case addr_finishedwalking: finishedwalking(); break; case addr_examineobtext: examineobtext(); break; - case addr_commandonly: commandonly(); break; case addr_printmessage: printmessage(); break; case addr_printmessage2: printmessage2(); break; case addr_blocknametext: blocknametext(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 5cb261420b..b9ac99efd3 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -123,7 +123,6 @@ public: static const uint16 addr_blocknametext = 0xca34; static const uint16 addr_printmessage2 = 0xca30; static const uint16 addr_printmessage = 0xca2c; - static const uint16 addr_commandonly = 0xca28; static const uint16 addr_examineobtext = 0xca20; static const uint16 addr_finishedwalking = 0xca1c; static const uint16 addr_obname = 0xca18; @@ -1321,7 +1320,7 @@ public: void wornerror(); void putundercentre(); void checkobjectsize(); - void commandonly(); + //void commandonly(); void adjustlen(); void deallocatemem(); void checkforemm(); @@ -1594,7 +1593,7 @@ public: //void finalframe(); void receptionist(); void selectslot(); - void edenscdplayer(); + void openfilenocheck(); //void readoneblock(); void fadeupmon(); void paltoendpal(); @@ -1827,7 +1826,7 @@ public: //void makesprite(); void dreamweb(); void droperror(); - void openfilenocheck(); + void edenscdplayer(); void calledensdlift(); void checkinside(); void gates(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 1c60fb6a4f..85918625ec 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -920,6 +920,20 @@ void DreamGenContext::deltextline() { multiput(segRef(data.word(kBuffers)).ptr(kTextunder, 0), x, y, kUndertextsizex, kUndertextsizey); } +void DreamGenContext::commandonly() { + commandonly(al); +} + +void DreamGenContext::commandonly(uint8 command) { + deltextline(); + uint16 index = command * 2; + uint16 offset = kTextstart + segRef(data.word(kCommandtext)).word(index); + uint16 y = data.word(kTextaddressy); + const uint8 *string = segRef(data.word(kCommandtext)).ptr(offset, 0); + printdirect(&string, data.word(kTextaddressx), &y, data.byte(kTextlen), (bool)(data.byte(kTextlen) & 1)); + data.byte(kNewtextline) = 1; +} + void DreamGenContext::autosetwalk() { al = data.byte(kManspath); if (data.byte(kFinaldest) == al) diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 04773ee677..710ebf9e6c 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -117,6 +117,8 @@ void crosshair(); void showrain(); void deltextline(); + void commandonly(); + void commandonly(uint8 command); void doblocks(); void checkifperson(); bool checkifperson(uint8 x, uint8 y); -- cgit v1.2.3