diff options
author | Bertrand Augereau | 2011-11-16 20:09:47 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-11-16 20:24:53 +0100 |
commit | 606bde92445682c86ebe875544fb05925e578ed6 (patch) | |
tree | ceb8deaff56c8462249503f2f58c01110912d499 /engines/dreamweb | |
parent | 1fefbc6afe2eb6535386a11ec6db56c64c2acc20 (diff) | |
download | scummvm-rg350-606bde92445682c86ebe875544fb05925e578ed6.tar.gz scummvm-rg350-606bde92445682c86ebe875544fb05925e578ed6.tar.bz2 scummvm-rg350-606bde92445682c86ebe875544fb05925e578ed6.zip |
DREAMWEB: 'watchcount' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 44 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 5 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 25 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 |
4 files changed, 29 insertions, 47 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 4d71850cdd..35f0f633a6 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -13521,49 +13521,6 @@ void DreamGenContext::checkforshake() { data.byte(kShakecounter) = -1; } -void DreamGenContext::watchcount() { - STACK_CHECK; - _cmp(data.byte(kWatchon), 0); - if (flags.z()) - return /* (nowatchworn) */; - _inc(data.byte(kTimercount)); - _cmp(data.byte(kTimercount), 9); - if (flags.z()) - goto flashdots; - _cmp(data.byte(kTimercount), 18); - if (flags.z()) - goto uptime; - return; -flashdots: - ax = 91*3+21; - di = 268+4; - bx = 21; - ds = data.word(kCharset1); - showframe(); - goto finishwatch; -uptime: - data.byte(kTimercount) = 0; - _add(data.byte(kSecondcount), 1); - _cmp(data.byte(kSecondcount), 60); - if (!flags.z()) - goto finishtime; - data.byte(kSecondcount) = 0; - _inc(data.byte(kMinutecount)); - _cmp(data.byte(kMinutecount), 60); - if (!flags.z()) - goto finishtime; - data.byte(kMinutecount) = 0; - _inc(data.byte(kHourcount)); - _cmp(data.byte(kHourcount), 24); - if (!flags.z()) - goto finishtime; - data.byte(kHourcount) = 0; -finishtime: - showtime(); -finishwatch: - data.byte(kWatchdump) = 1; -} - void DreamGenContext::showtime() { STACK_CHECK; _cmp(data.byte(kWatchon), 0); @@ -16526,7 +16483,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_screenupdate: screenupdate(); break; case addr_watchreel: watchreel(); break; case addr_checkforshake: checkforshake(); break; - case addr_watchcount: watchcount(); break; case addr_showtime: showtime(); break; case addr_dumpwatch: dumpwatch(); break; case addr_showbyte: showbyte(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 7bdb934fd1..94299c7f9a 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -114,7 +114,6 @@ public: static const uint16 addr_showbyte = 0xc9b4; static const uint16 addr_dumpwatch = 0xc9b0; static const uint16 addr_showtime = 0xc9ac; - static const uint16 addr_watchcount = 0xc9a8; static const uint16 addr_checkforshake = 0xc9a4; static const uint16 addr_watchreel = 0xc9a0; static const uint16 addr_screenupdate = 0xc99c; @@ -1346,7 +1345,7 @@ public: //void showblink(); void mousecall(); void train(); - void watchcount(); + //void checkiffree(); void fadedownmon(); void loadcart(); //void splitintolines(); @@ -1973,7 +1972,7 @@ public: void usehole(); void useobject(); void volumeadjust(); - //void checkiffree(); + //void watchcount(); }; } diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index a01949edfb..338e8da158 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1951,6 +1951,31 @@ void DreamGenContext::showwatch() { } } +void DreamGenContext::watchcount() { + if (data.byte(kWatchon) == 0) + return; + ++data.byte(kTimercount); + if (data.byte(kTimercount) == 9) { + showframe((Frame *)segRef(data.word(kCharset1)).ptr(0, 0), 268+4, 21, 91*3+21, 0); + data.byte(kWatchdump) = 1; + } else if (data.byte(kTimercount) == 18) { + data.byte(kTimercount) = 0; + ++data.byte(kSecondcount); + if (data.byte(kSecondcount) == 60) { + data.byte(kSecondcount) = 0; + ++data.byte(kMinutecount); + if (data.byte(kMinutecount) == 60) { + data.byte(kMinutecount) = 0; + ++data.byte(kHourcount); + if (data.byte(kHourcount) == 24) + data.byte(kHourcount) = 0; + } + } + showtime(); + data.byte(kWatchdump) = 1; + } +} + void DreamGenContext::roomname() { printmessage(88, 18, 53, 240, false); uint16 textIndex = data.byte(kRoomnum); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index a9c8941a97..3170be9996 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -265,4 +265,6 @@ void startpaltoend(); void paltoendpal(); void fadecalculation(); + void watchcount(); + |