diff options
author | Bertrand Augereau | 2011-11-17 00:18:28 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-11-17 00:18:28 +0100 |
commit | d608c079447c64255e4e27d44a7dc843cf5f6407 (patch) | |
tree | 5a3daae38884c5ed1a0a1b794d44db124c24bc30 | |
parent | 301048ec98e701d733efaef55dc13af3593d9dec (diff) | |
download | scummvm-rg350-d608c079447c64255e4e27d44a7dc843cf5f6407.tar.gz scummvm-rg350-d608c079447c64255e4e27d44a7dc843cf5f6407.tar.bz2 scummvm-rg350-d608c079447c64255e4e27d44a7dc843cf5f6407.zip |
DREAMWEB: 'showtime' ported to C++
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 67 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 27 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 3 |
5 files changed, 27 insertions, 74 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 4389f06ecf..d38fca921a 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -207,6 +207,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'convicons', 'examineob', 'showwatch', + 'showtime', 'roomname', 'transfertext', 'splitintolines', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 9479d34dc1..41ed80e37f 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -13298,72 +13298,6 @@ void DreamGenContext::checkforshake() { data.byte(kShakecounter) = -1; } -void DreamGenContext::showtime() { - STACK_CHECK; - _cmp(data.byte(kWatchon), 0); - if (flags.z()) - return /* (nowatch) */; - al = data.byte(kSecondcount); - cl = 0; - twodigitnum(); - push(ax); - al = ah; - ah = 0; - _add(ax, 91*3+10); - ds = data.word(kCharset1); - di = 282+5; - bx = 21; - showframe(); - ax = pop(); - ah = 0; - _add(ax, 91*3+10); - ds = data.word(kCharset1); - di = 282+9; - bx = 21; - showframe(); - al = data.byte(kMinutecount); - cl = 0; - twodigitnum(); - push(ax); - al = ah; - ah = 0; - _add(ax, 91*3); - ds = data.word(kCharset1); - di = 270+5; - bx = 21; - showframe(); - ax = pop(); - ah = 0; - _add(ax, 91*3); - ds = data.word(kCharset1); - di = 270+11; - bx = 21; - showframe(); - al = data.byte(kHourcount); - cl = 0; - twodigitnum(); - push(ax); - al = ah; - ah = 0; - _add(ax, 91*3); - ds = data.word(kCharset1); - di = 256+5; - bx = 21; - showframe(); - ax = pop(); - ah = 0; - _add(ax, 91*3); - ds = data.word(kCharset1); - di = 256+11; - bx = 21; - showframe(); - ax = 91*3+20; - ds = data.word(kCharset1); - di = 267+5; - bx = 21; - showframe(); -} - void DreamGenContext::dumpwatch() { STACK_CHECK; _cmp(data.byte(kWatchdump), 1); @@ -16209,7 +16143,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_screenupdate: screenupdate(); break; case addr_watchreel: watchreel(); break; case addr_checkforshake: checkforshake(); break; - case addr_showtime: showtime(); break; case addr_dumpwatch: dumpwatch(); break; case addr_showbyte: showbyte(); break; case addr_onedigit: onedigit(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 97b29517c9..63783c0cf7 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -110,7 +110,6 @@ public: static const uint16 addr_onedigit = 0xc9b8; static const uint16 addr_showbyte = 0xc9b4; static const uint16 addr_dumpwatch = 0xc9b0; - static const uint16 addr_showtime = 0xc9ac; static const uint16 addr_checkforshake = 0xc9a4; static const uint16 addr_watchreel = 0xc9a0; static const uint16 addr_screenupdate = 0xc99c; @@ -1918,7 +1917,7 @@ public: void readcitypic(); void getpersontext(); void intoinv(); - void showtime(); + //void showtime(); void parser(); void hangonw(); void intro(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 6292882fa2..8e7a0761c8 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1956,6 +1956,25 @@ void DreamGenContext::showwatch() { } } +void DreamGenContext::showtime() { + if (data.byte(kWatchon) == 0) + return; + Frame *charset = (Frame *)segRef(data.word(kCharset1)).ptr(0, 0); + + uint8 mod1, mod10; + twodigitnum(data.byte(kSecondcount), 0, &mod10, &mod1); + showframe(charset, 282+5, 21, 91*3+10 + mod10, 0); + showframe(charset, 282+9, 21, 91*3+10 + mod1, 0); + twodigitnum(data.byte(kMinutecount), 0, &mod10, &mod1); + showframe(charset, 270+5, 21, 91*3 + mod10, 0); + showframe(charset, 270+11, 21, 91*3 + mod1, 0); + twodigitnum(data.byte(kHourcount), 0, &mod10, &mod1); + showframe(charset, 256+5, 21, 91*3 + mod10, 0); + showframe(charset, 256+11, 21, 91*3 + mod1, 0); + + showframe(charset, 267+5, 21, 91*3+20, 0); +} + void DreamGenContext::watchcount() { if (data.byte(kWatchon) == 0) return; @@ -2021,16 +2040,16 @@ void DreamGenContext::loadroom() { } void DreamGenContext::twodigitnum(uint8 num, uint8 baseChar, - uint8 &digit1, uint8 &digit2) { - digit1 = baseChar + num/10; - digit2 = baseChar + num%10; + uint8 *digit1, uint8 *digit2) { + *digit1 = baseChar + num/10; + *digit2 = baseChar + num%10; } // Convert a number between 0 and 99 into its two digits, either // ASCII (if cl/basechar == '0'), or raw (if cl/basechar == 0). void DreamGenContext::twodigitnum() { uint8 digit1, digit2; - twodigitnum(al, cl, digit1, digit2); + twodigitnum(al, cl, &digit1, &digit2); ah = digit1; al = digit2; } diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index dde31936f7..aa47a62cbb 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -251,6 +251,7 @@ void convicons(); void examineob(bool examineAgain = true); void showwatch(); + void showtime(); void roomname(); void transfertext(); void initrain(); @@ -272,6 +273,6 @@ void putundermenu(); void textformonk(); void textforend(); - void twodigitnum(uint8 num, uint8 baseChar, uint8 &digit1, uint8 &digit2); + void twodigitnum(uint8 num, uint8 baseChar, uint8 *digit1, uint8 *digit2); void twodigitnum(); |