aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-11 15:45:53 +0100
committerWillem Jan Palenstijn2011-12-11 15:45:53 +0100
commit05a27138744e3d5fe80602c2c97b6bea547863d9 (patch)
treee901ae5c490d32590e9819d0d2e3df87b496659e
parent11adaf6d695c1c6b436ce2cd18d4c59f729c542d (diff)
downloadscummvm-rg350-05a27138744e3d5fe80602c2c97b6bea547863d9.tar.gz
scummvm-rg350-05a27138744e3d5fe80602c2c97b6bea547863d9.tar.bz2
scummvm-rg350-05a27138744e3d5fe80602c2c97b6bea547863d9.zip
DREAMWEB: Convert checkInput
-rwxr-xr-xdevtools/tasmrecover/tasm-recover2
-rw-r--r--engines/dreamweb/dreamgen.cpp62
-rw-r--r--engines/dreamweb/dreamgen.h2
-rw-r--r--engines/dreamweb/saveload.cpp37
-rw-r--r--engines/dreamweb/stubs.h1
5 files changed, 40 insertions, 64 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 9c3d150825..41dca53a12 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -227,6 +227,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'checkifpathison',
'checkifperson',
'checkifset',
+ 'checkinput',
'checkone',
'checksoundint',
'checkspeed',
@@ -363,6 +364,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'getflagunderp',
'getlocation',
'getmapad',
+ 'getnamepos',
'getnextword',
'getnumber',
'getpersframe',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index fac388bbf7..8975c26991 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -5509,68 +5509,6 @@ void DreamGenContext::findText1() {
si = ax;
}
-void DreamGenContext::checkInput() {
- STACK_CHECK;
- _cmp(data.byte(kLoadingorsave), 3);
- if (flags.z())
- return /* (nokeypress) */;
- readKey();
- al = data.byte(kCurrentkey);
- _cmp(al, 0);
- if (flags.z())
- return /* (nokeypress) */;
- _cmp(al, 13);
- if (!flags.z())
- goto notret;
- data.byte(kLoadingorsave) = 3;
- goto afterkey;
-notret:
- _cmp(al, 8);
- if (!flags.z())
- goto nodel2;
- _cmp(data.byte(kCursorpos), 0);
- if (flags.z())
- return /* (nokeypress) */;
- getNamePos();
- _dec(data.byte(kCursorpos));
- es.byte(bx) = 0;
- es.byte(bx+1) = 1;
- goto afterkey;
-nodel2:
- _cmp(data.byte(kCursorpos), 14);
- if (flags.z())
- return /* (nokeypress) */;
- getNamePos();
- _inc(data.byte(kCursorpos));
- al = data.byte(kCurrentkey);
- es.byte(bx+1) = al;
- es.byte(bx+2) = 0;
- es.byte(bx+3) = 1;
- goto afterkey;
- return;
-afterkey:
- showOpBox();
- showNames();
- showSlots();
- showSaveOps();
- workToScreenM();
-}
-
-void DreamGenContext::getNamePos() {
- STACK_CHECK;
- al = data.byte(kCurrentslot);
- ah = 0;
- cx = 17;
- _mul(cx);
- dx = data;
- es = dx;
- bx = 1521;
- _add(bx, ax);
- al = data.byte(kCursorpos);
- ah = 0;
- _add(bx, ax);
-}
-
void DreamGenContext::selectSlot() {
STACK_CHECK;
_cmp(data.byte(kCommandtype), 244);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 889a60b357..1df283c997 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -526,7 +526,6 @@ public:
#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()
void useWire();
- void getNamePos();
void identifyOb();
void useLighter();
void runEndSeq();
@@ -535,7 +534,6 @@ public:
void getObTextStart();
void dumpDiaryKeys();
void entryTexts();
- void checkInput();
void putUnderCentre();
void checkObjectSize();
void findText1();
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 9060a3f000..2a8b8bec3d 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -481,4 +481,41 @@ void DreamBase::showNames() {
}
}
+void DreamGenContext::checkInput() {
+ if (data.byte(kLoadingorsave) == 3)
+ return;
+
+ readKey();
+
+ char *name = (char *)data.ptr(kSavenames + 17*data.byte(kCurrentslot) + 1, 16);
+
+ if (data.byte(kCurrentkey) == 0) {
+ return;
+ } else if (data.byte(kCurrentkey) == 13) {
+ data.byte(kLoadingorsave) = 3;
+ } else if (data.byte(kCurrentkey) == 8) {
+ if (data.byte(kCursorpos) == 0)
+ return;
+
+ --data.byte(kCursorpos);
+ name[data.byte(kCursorpos)] = 0;
+ name[data.byte(kCursorpos)+1] = 1;
+ } else {
+ if (data.byte(kCursorpos) == 14)
+ return;
+
+ name[data.byte(kCursorpos)] = data.byte(kCurrentkey);
+ name[data.byte(kCursorpos)+1] = 0;
+ name[data.byte(kCursorpos)+2] = 1;
+ ++data.byte(kCursorpos);
+ }
+
+ showOpBox();
+ showNames();
+ showSlots();
+ showSaveOps();
+ workToScreenM();
+}
+
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 5d99e231dc..c63b2449d8 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -559,5 +559,6 @@
void quitSymbol();
void diaryKeyP();
void diaryKeyN();
+ void checkInput();
#endif