From 95a8cdd36cb43c576232b50a0dd8dbbb676e39f0 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Fri, 2 Dec 2011 12:07:53 +0100 Subject: [PATCH] DREAMWEB: 'singleKey' ported to C++ --- devtools/tasmrecover/tasm-recover | 1 + engines/dreamweb/dreamgen.cpp | 17 ----------------- engines/dreamweb/dreamgen.h | 1 - engines/dreamweb/keypad.cpp | 14 ++++++++++++++ engines/dreamweb/stubs.h | 2 ++ 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index ebf036f9e7d..68e883fad49 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -341,6 +341,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'gamer', 'eden', 'sparky', + 'singlekey', ], skip_output = [ # These functions are processed but not output 'dreamweb', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 1c2c4ce0389..11163ee9d27 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -9465,23 +9465,6 @@ gotlight: showFrame(); } -void DreamGenContext::singleKey() { - STACK_CHECK; - _cmp(data.byte(kGraphicpress), al); - if (!flags.z()) - goto gotkey; - _add(al, 11); - _cmp(data.byte(kPresscount), 8); - if (!flags.c()) - goto gotkey; - _sub(al, 11); -gotkey: - ds = data.word(kTempgraphics); - _sub(al, 20); - ah = 0; - showFrame(); -} - void DreamGenContext::dumpKeypad() { STACK_CHECK; di = (36+112)-3; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index f84b037a648..f6c482b0829 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -915,7 +915,6 @@ public: void quitSymbol(); void setTopRight(); void findSetObject(); - void singleKey(); void hangOne(); void carParkDrip(); void useDiary(); diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp index 0867ffd2abd..dc19d97bd29 100644 --- a/engines/dreamweb/keypad.cpp +++ b/engines/dreamweb/keypad.cpp @@ -32,5 +32,19 @@ void DreamGenContext::putUnderMenu() { multiPut(segRef(data.word(kBuffers)).ptr(kUndertimedtext, 0), kMenux, kMenuy, 48, 48); } +void DreamGenContext::singleKey(uint8 key, uint16 x, uint16 y) { + if (key == data.byte(kGraphicpress)) { + key += 11; + if (data.byte(kPresscount) < 8) + key -= 11; + } + key -= 20; + showFrame(tempGraphics(), x, y, key, 0); +} + +void DreamGenContext::singleKey() { + singleKey(al, di, bx); +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 60231c4e6e4..25b2b531f9c 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -382,4 +382,6 @@ void gamer(ReelRoutine &routine); void eden(ReelRoutine &routine); void sparky(ReelRoutine &routine); + void singleKey(uint8 key, uint16 x, uint16 y); + void singleKey();