aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devtools/tasmrecover/dreamweb/dreamweb.asm6
-rw-r--r--engines/dreamweb/dreamgen.cpp7
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/dreamweb.cpp6
4 files changed, 18 insertions, 4 deletions
diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm
index ea61338ae3..275d8208b0 100644
--- a/devtools/tasmrecover/dreamweb/dreamweb.asm
+++ b/devtools/tasmrecover/dreamweb/dreamweb.asm
@@ -195,6 +195,10 @@ alreadyloaded: mov newlocation,255
mov commandtype,255
mainloop: call screenupdate
+ cmp quitrequested, 0
+ jz $1
+ ret
+$1:
cmp wongame,0
jnz endofgame
cmp mandead,1
@@ -6219,6 +6223,8 @@ savefiles db "DREAMWEB.D00",0
Recname db "DREAMWEB.DEM",0
+Quitrequested db 0
+
;-------------------------------------------------------End of code segment----
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index a87f65bcb3..92901b0627 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -21359,6 +21359,11 @@ loadnew:
data.byte(kCommandtype) = 255;
mainloop:
screenupdate();
+ _cmp(data.byte(kQuitrequested), 0);
+ if (flags.z())
+ goto _tmp1;
+ return;
+_tmp1:
_cmp(data.byte(kWongame), 0);
if (!flags.z())
goto endofgame;
@@ -21972,7 +21977,7 @@ void DreamGenContext::__start() {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, };
+ 0x00, 0x00, 0x00, };
ds.assign(src, src + sizeof(src));
dreamweb();
}
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index a70f06d496..d7cf4677e3 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -486,7 +486,8 @@ public:
const static uint16 kSavenames = 8579;
const static uint16 kSavefiles = 8698;
const static uint16 kRecname = 8789;
- const static uint16 kStak = 8802;
+ const static uint16 kQuitrequested = 8802;
+ const static uint16 kStak = 8803;
const static uint16 kBlocktextdat = (0);
const static uint16 kPersonframes = (0);
const static uint16 kDebuglevel1 = (0);
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index cb66dda26b..4f39671b85 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -100,8 +100,9 @@ void DreamWebEngine::waitForVSync() {
}
void DreamWebEngine::quit() {
- warning("Engine should quit gracefully (but doesn't yet)");
- g_system->quit();
+ _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 1;
+ _context.data.byte(DreamGen::DreamGenContext::kLasthardkey) = 1;
+ _context.data.byte(DreamGen::DreamGenContext::kGetback) = 4;
}
void DreamWebEngine::processEvents() {
@@ -208,6 +209,7 @@ Common::Error DreamWebEngine::run() {
//http://martin.hinner.info/vga/timing.html
_context.__start();
+ _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 0;
getTimerManager()->removeTimerProc(vSyncInterrupt);