From aefdf240fb91efbecc3dc929ae311faa9c8d7b02 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Tue, 30 Aug 2011 02:53:49 +0200 Subject: DREAMWEB: 'obpicture' ported to C++ --- engines/dreamweb/dreamgen.cpp | 33 --------------------------------- engines/dreamweb/dreamgen.h | 3 +-- engines/dreamweb/stubs.cpp | 12 ++++++++++++ engines/dreamweb/stubs.h | 1 + 4 files changed, 14 insertions(+), 35 deletions(-) (limited to 'engines') diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 6ebb617f7e..bcc1cbb1e2 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4487,38 +4487,6 @@ void DreamGenContext::examicon() { showframe(); } -void DreamGenContext::obpicture() { - STACK_CHECK; - al = data.byte(kCommand); - ah = data.byte(kObjecttype); - _cmp(ah, 1); - if (flags.z()) - return /* (setframe) */; - _cmp(ah, 4); - if (flags.z()) - goto exframe; - ds = data.word(kFreeframes); - di = 160; - bx = 68; - cl = al; - _add(al, al); - _add(al, cl); - _inc(al); - ah = 128; - showframe(); - return; -exframe: - ds = data.word(kExtras); - di = 160; - bx = 68; - cl = al; - _add(al, al); - _add(al, cl); - _inc(al); - ah = 128; - showframe(); -} - void DreamGenContext::describeob() { STACK_CHECK; getobtextstart(); @@ -17908,7 +17876,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_openob: openob(); break; case addr_obicons: obicons(); break; case addr_examicon: examicon(); break; - case addr_obpicture: obpicture(); break; case addr_describeob: describeob(); break; case addr_additionaltext: additionaltext(); break; case addr_obsthatdothings: obsthatdothings(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 8cf0462d74..d638722c6c 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -495,7 +495,6 @@ public: static const uint16 addr_obsthatdothings = 0xc36c; static const uint16 addr_additionaltext = 0xc368; static const uint16 addr_describeob = 0xc364; - static const uint16 addr_obpicture = 0xc360; static const uint16 addr_examicon = 0xc35c; static const uint16 addr_obicons = 0xc358; static const uint16 addr_openob = 0xc354; @@ -1871,7 +1870,7 @@ public: void settopleft(); void searchforstring(); //void clearsprites(); - void obpicture(); + //void obpicture(); void selectopenob(); //void widedoor(); void security(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 1ffe3295ef..0f3e6420ef 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1643,6 +1643,18 @@ void DreamGenContext::printmessage(uint16 x, uint16 y, uint8 index, uint8 maxWid printdirect(&string, x, &y, maxWidth, centered); } +void DreamGenContext::obpicture() { + if (data.byte(kObjecttype) == 1) + return; + Frame *frames; + if (data.byte(kObjecttype) == 4) + frames = (Frame *)segRef(data.word(kExtras)).ptr(0, 0); + else + frames = (Frame *)segRef(data.word(kFreeframes)).ptr(0, 0); + uint8 frame = 3 * data.byte(kCommand) + 1; + showframe(frames, 160, 68, frame, 0x80); +} + bool DreamGenContext::isCD() { // The original sources has two codepaths depending if the game is 'if cd' or not // This is a hack to guess which version to use with the assumption that if we have a cd version diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 58bda83d84..17b884cdc5 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -199,4 +199,5 @@ void addtopeoplelist(ReelRoutine *routine); void getexpos(); void paneltomap(); + void obpicture(); -- cgit v1.2.3