From b7f416b3d906d017eaac869cf5bb473fec43eab7 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Sun, 4 Dec 2011 19:00:04 +0100 Subject: DREAMWEB: 'delChar' ported to C++ --- engines/dreamweb/dreamgen.cpp | 28 ---------------------------- engines/dreamweb/dreamgen.h | 1 - engines/dreamweb/monitor.cpp | 13 +++++++++++++ engines/dreamweb/stubs.h | 1 + 4 files changed, 14 insertions(+), 29 deletions(-) (limited to 'engines') diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index e0e5809f66..d5efcf7e80 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5405,34 +5405,6 @@ void DreamGenContext::makeCaps() { _sub(al, 32); } -void DreamGenContext::delChar() { - STACK_CHECK; - _dec(data.word(kCurpos)); - si = data.word(kCurpos); - _add(si, si); - es = cs; - _add(si, 1964); - es.byte(si) = 0; - al = es.byte(si+1); - ah = 0; - _sub(data.word(kMonadx), ax); - _sub(data.word(kCurslocx), ax); - di = data.word(kMonadx); - bx = data.word(kMonady); - ds = data.word(kMapstore); - ax = data.word(kCurpos); - _xchg(al, ah); - si = ax; - cl = 8; - ch = 8; - multiPut(); - di = data.word(kMonadx); - bx = data.word(kMonady); - cl = al; - ch = 8; - multiDump(); -} - void DreamGenContext::execCommand() { STACK_CHECK; es = cs; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index d93136f4f0..bd42cabeb1 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -633,7 +633,6 @@ public: void manAsleep2(); void moreTalk(); void startTalk(); - void delChar(); void getAnyAd(); void endGame(); void usePipe(); diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp index ebd160a98f..fff38d3801 100644 --- a/engines/dreamweb/monitor.cpp +++ b/engines/dreamweb/monitor.cpp @@ -148,6 +148,19 @@ void DreamGenContext::input() { } } +void DreamGenContext::delChar() { + char *inputLine = (char *)cs.ptr(kInputline, 0); + --data.word(kCurpos); + inputLine[data.word(kCurpos) * 2] = 0; + uint8 width = inputLine[data.word(kCurpos) * 2 + 1]; + data.word(kMonadx) -= width; + data.word(kCurslocx) -= width; + uint16 offset = data.word(kCurpos); + offset = ((offset & 0x00ff) << 8) | ((offset & 0xff00) >> 8); + multiPut(getSegment(data.word(kMapstore)).ptr(offset, 0), data.word(kMonadx), data.word(kMonady), 8, 8); + multiDump(data.word(kMonadx), data.word(kMonady), al, 8); +} + void DreamGenContext::printCurs() { uint16 x = data.word(kCurslocx); uint16 y = data.word(kCurslocy); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index ffc0d4b1b2..e2edd897b6 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -45,6 +45,7 @@ void saveLoad(); void printCurs(); void delCurs(); + void delChar(); void hangOnCurs(uint16 frameCount); void hangOnCurs(); void multiDump(); -- cgit v1.2.3