aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorBertrand Augereau2011-07-17 14:38:30 +0200
committerBertrand Augereau2011-07-18 22:59:16 +0200
commit9072ecf781bb8fd116a02530631d3cfa1e44648b (patch)
tree56373a8bdb0440747aff34213ba63da599f0053d /engines/dreamweb
parent7d9ff04fbfa5749ce1f7ca9d7b5bd8efb5b02bcc (diff)
downloadscummvm-rg350-9072ecf781bb8fd116a02530631d3cfa1e44648b.tar.gz
scummvm-rg350-9072ecf781bb8fd116a02530631d3cfa1e44648b.tar.bz2
scummvm-rg350-9072ecf781bb8fd116a02530631d3cfa1e44648b.zip
DREAMWEB: Blacklisted 'kernchars' and 'getnextword'
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp74
-rw-r--r--engines/dreamweb/dreamgen.h6
-rw-r--r--engines/dreamweb/stubs.cpp43
-rw-r--r--engines/dreamweb/stubs.h3
4 files changed, 48 insertions, 78 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index c5ada978c0..b8a5e5122b 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4946,36 +4946,6 @@ nokern:
cx = pop();
}
-void DreamGenContext::kernchars() {
- STACK_CHECK;
- _cmp(al, 'a');
- if (flags.z())
- goto iskern;
- _cmp(al, 'u');
- if (flags.z())
- goto iskern;
- return;
-iskern:
- _cmp(ah, 'n');
- if (flags.z())
- goto kernit;
- _cmp(ah, 't');
- if (flags.z())
- goto kernit;
- _cmp(ah, 'r');
- if (flags.z())
- goto kernit;
- _cmp(ah, 'i');
- if (flags.z())
- goto kernit;
- _cmp(ah, 'l');
- if (flags.z())
- goto kernit;
- return;
-kernit:
- _dec(cl);
-}
-
void DreamGenContext::printslow() {
STACK_CHECK;
data.byte(kPointerframe) = 1;
@@ -5347,48 +5317,6 @@ notcent2:
cl = ch;
}
-void DreamGenContext::getnextword() {
- STACK_CHECK;
- bx = 0;
-getloop:
- ax = es.word(di);
- _inc(di);
- _inc(bh);
- _cmp(al, ':');
- if (flags.z())
- goto endall;
- _cmp(al, 0);
- if (flags.z())
- goto endall;
- _cmp(al, 32);
- if (flags.z())
- goto endword;
- modifychar();
- _cmp(al, 255);
- if (flags.z())
- goto getloop;
- push(ax);
- _sub(al, 32);
- ah = 0;
- _add(ax, data.word(kCharshift));
- _add(ax, ax);
- si = ax;
- _add(ax, ax);
- _add(si, ax);
- cl = ds.byte(si+0);
- ax = pop();
- kernchars();
- _add(bl, cl);
- goto getloop;
-endword:
- _add(bl, 6);
- al = 0;
- return;
-endall:
- _add(bl, 6);
- al = 1;
-}
-
void DreamGenContext::fillryan() {
STACK_CHECK;
es = data.word(kBuffers);
@@ -21610,14 +21538,12 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_set16colpalette: set16colpalette(); break;
case addr_realcredits: realcredits(); break;
case addr_printchar: printchar(); break;
- case addr_kernchars: kernchars(); break;
case addr_printslow: printslow(); break;
case addr_waitframes: waitframes(); break;
case addr_printboth: printboth(); break;
case addr_printdirect: printdirect(); break;
case addr_monprint: monprint(); break;
case addr_getnumber: getnumber(); break;
- case addr_getnextword: getnextword(); break;
case addr_fillryan: fillryan(); break;
case addr_fillopen: fillopen(); break;
case addr_findallryan: findallryan(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f43e4742bc..032ad5847c 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -562,14 +562,12 @@ public:
static const uint16 addr_findallryan = 0xc328;
static const uint16 addr_fillopen = 0xc324;
static const uint16 addr_fillryan = 0xc320;
- static const uint16 addr_getnextword = 0xc31c;
static const uint16 addr_getnumber = 0xc318;
static const uint16 addr_monprint = 0xc314;
static const uint16 addr_printdirect = 0xc310;
static const uint16 addr_printboth = 0xc30c;
static const uint16 addr_waitframes = 0xc308;
static const uint16 addr_printslow = 0xc304;
- static const uint16 addr_kernchars = 0xc300;
static const uint16 addr_printchar = 0xc2fc;
static const uint16 addr_realcredits = 0xc2f8;
static const uint16 addr_set16colpalette = 0xc2f4;
@@ -1396,7 +1394,7 @@ public:
void showdiscops();
void advisor();
void additionaltext();
- void kernchars();
+ //void kernchars();
void othersmoker();
void autosetwalk();
void setuptimedtemp();
@@ -1967,7 +1965,7 @@ public:
void checkforshake();
void usebuttona();
void cancelch1();
- void getnextword();
+ //void getnextword();
void generalerror();
void actualload();
void allocateload();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 1bad368d43..e7fb421353 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -217,6 +217,49 @@ void DreamGenContext::setmouse() {
data.word(kOldpointerx) = 0xffff;
}
+void DreamGenContext::getnextword() {
+ uint8 totalWidth = 0;
+ bh = 0;
+ while(true) {
+ ax = es.word(di);
+ uint8 firstChar = al;
+ uint8 secondChar = ah;
+ ++di;
+ ++bh;
+ if ((firstChar == ':') || (firstChar == 0)) { //endall
+ totalWidth += 6;
+ bl = totalWidth;
+ al = 1;
+ return;
+ }
+ if (firstChar == 32) { //endword
+ totalWidth += 6;
+ bl = totalWidth;
+ al = 0;
+ return;
+ }
+ firstChar = engine->modifyChar(firstChar);
+ if (firstChar != 255) {
+ uint8 width = ds.byte(6*(firstChar - 32 + data.word(kCharshift)));
+ width = kernchars(firstChar, secondChar, width);
+ totalWidth += width;
+ bl = totalWidth;
+ }
+ }
+}
+
+uint8 DreamGenContext::kernchars(uint8 firstChar, uint8 secondChar, uint8 width) {
+ if ((firstChar == 'a') || (al == 'u')) {
+ if ((secondChar == 'n') || (secondChar == 't') || (secondChar == 'r') || (secondChar == 'i') || (secondChar == 'l'))
+ return width-1;
+ }
+ return width;
+}
+
+void DreamGenContext::kernchars() {
+ cl = kernchars(al, ah, cl);
+}
+
void DreamGenContext::gettime() {
TimeDate t;
g_system->getTimeAndDate(t);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 4b7f956296..70c1cfda13 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -14,6 +14,9 @@
void seecommandtail();
void randomnumber();
void quickquit2();
+ void getnextword();
+ void kernchars();
+ uint8 kernchars(uint8 firstChar, uint8 secondChar, uint8 width);
Sprite* spritetable();
void showframe();
uint16 showframeCPP(uint16 dst, uint16 src, uint16 x, uint16 y, uint8 frameNumber, uint8 effectsFlag);