aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/stubs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dreamweb/stubs.cpp')
-rw-r--r--engines/dreamweb/stubs.cpp33
1 files changed, 27 insertions, 6 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index dd2e16e00b..226c085a2b 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -480,6 +480,7 @@ void DreamGenContext::dreamweb() {
data.word(kOldpointerx) = 0xffff;
fadeDOS();
+ getTime();
clearBuffers();
clearPalette();
set16ColPalette();
@@ -936,6 +937,18 @@ void DreamGenContext::dumpTimedText() {
data.byte(kNeedtodumptimed) = 0;
}
+void DreamGenContext::getTime() {
+ TimeDate t;
+ g_system->getTimeAndDate(t);
+ debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec);
+ ch = t.tm_hour;
+ cl = t.tm_min;
+ dh = t.tm_sec;
+ data.byte(kSecondcount) = dh;
+ data.byte(kMinutecount) = cl;
+ data.byte(kHourcount) = ch;
+}
+
uint16 DreamGenContext::allocateMem(uint16 paragraphs) {
uint size = (paragraphs + 2) * 16;
debug(1, "allocate mem, %u bytes", size);
@@ -2058,12 +2071,9 @@ void DreamBase::showTime() {
return;
Frame *charset = (Frame *)getSegment(data.word(kCharset1)).ptr(0, 0);
- TimeDate t;
- g_system->getTimeAndDate(t);
-
- int seconds = t.tm_sec;
- int minutes = t.tm_min;
- int hours = t.tm_hour;
+ int seconds = data.byte(kSecondcount);
+ int minutes = data.byte(kMinutecount);
+ int hours = data.byte(kHourcount);
showFrame(charset, 282+5, 21, 91*3+10 + seconds / 10, 0);
showFrame(charset, 282+9, 21, 91*3+10 + seconds % 10, 0);
@@ -2086,6 +2096,17 @@ void DreamGenContext::watchCount() {
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;
}