[Scummvm-cvs-logs] scummvm master -> cf671227fe52f7d87afeab65a90642d4aa6b7d73
whoozle
whoozle at yandex.ru
Sat Jun 18 11:36:27 CEST 2011
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4cdc9c9f8e DREAMWEB: implemented clean exit
cf671227fe DREAMWEB: do not call updatescreen before quitting, fixed crash on dosreturn, cleaned up dosreturn stub
Commit: 4cdc9c9f8e883bdb4864e6b2c0ef127bf0824e9a
https://github.com/scummvm/scummvm/commit/4cdc9c9f8e883bdb4864e6b2c0ef127bf0824e9a
Author: Vladimir Menshakov (whoozle at yandex.ru)
Date: 2011-06-18T02:33:58-07:00
Commit Message:
DREAMWEB: implemented clean exit
Changed paths:
devtools/tasmrecover/dreamweb/dreamweb.asm
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/dreamweb.cpp
diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm
index ea61338..275d820 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 a87f65b..92901b0 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 a70f06d..d7cf467 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 cb66dda..4f39671 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);
Commit: cf671227fe52f7d87afeab65a90642d4aa6b7d73
https://github.com/scummvm/scummvm/commit/cf671227fe52f7d87afeab65a90642d4aa6b7d73
Author: Vladimir Menshakov (whoozle at yandex.ru)
Date: 2011-06-18T02:33:58-07:00
Commit Message:
DREAMWEB: do not call updatescreen before quitting, fixed crash on dosreturn, cleaned up dosreturn stub
Changed paths:
devtools/tasmrecover/dreamweb/dreamweb.asm
engines/dreamweb/detection.cpp
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/dreamweb.cpp
engines/dreamweb/stubs.cpp
diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm
index 275d820..5d2a60a 100644
--- a/devtools/tasmrecover/dreamweb/dreamweb.asm
+++ b/devtools/tasmrecover/dreamweb/dreamweb.asm
@@ -194,11 +194,12 @@ alreadyloaded: mov newlocation,255
call startup
mov commandtype,255
-mainloop: call screenupdate
+mainloop:
cmp quitrequested, 0
jz $1
ret
$1:
+ call screenupdate
cmp wongame,0
jnz endofgame
cmp mandead,1
diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp
index a5cb7b5..613bba1 100644
--- a/engines/dreamweb/detection.cpp
+++ b/engines/dreamweb/detection.cpp
@@ -83,6 +83,12 @@ bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const {
}
bool DreamWeb::DreamWebEngine::hasFeature(EngineFeature f) const {
+ switch(f) {
+ case kSupportsRTL:
+ return true;
+ default:
+ return false;
+ }
return false;
}
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 92901b0..35721d3 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4165,6 +4165,11 @@ deloneloop:
goto deloneloop;
}
+void DreamGenContext::width160() {
+ STACK_CHECK;
+ _movsw(161);
+}
+
void DreamGenContext::doblocks() {
STACK_CHECK;
es = data.word(kWorkspace);
@@ -21358,12 +21363,12 @@ loadnew:
startup();
data.byte(kCommandtype) = 255;
mainloop:
- screenupdate();
_cmp(data.byte(kQuitrequested), 0);
if (flags.z())
goto _tmp1;
return;
_tmp1:
+ screenupdate();
_cmp(data.byte(kWongame), 0);
if (!flags.z())
goto endofgame;
@@ -22115,6 +22120,7 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case 0xc20c: doshake(); break;
case 0xc210: zoom(); break;
case 0xc214: delthisone(); break;
+ case 0xc224: width160(); break;
case 0xc228: doblocks(); break;
case 0xc22c: showframe(); break;
case 0xc230: frameoutv(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d7cf467..94b7607 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -964,6 +964,7 @@ public:
void createpanel();
void turnpathon();
void showmainops();
+ void width160dosreturn();
void madmanstelly();
void constant();
void loadroomssample();
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 4f39671..a0e3bf0 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -116,6 +116,9 @@ void DreamWebEngine::processEvents() {
int softKey, hardKey;
while (event_manager->pollEvent(event)) {
switch(event.type) {
+ case Common::EVENT_RTL:
+ quit();
+ break;
case Common::EVENT_KEYDOWN:
if (event.kbd.flags & Common::KBD_CTRL) {
switch (event.kbd.keycode) {
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 69f240a..b8c5fed 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -162,6 +162,10 @@ void DreamGenContext::openfilefromc() {
void DreamGenContext::openfile() {
Common::String name = getFilename(*this);
+ if (name.empty()) { //fixme: this happens if you quit from new game/load screen
+ flags._c = true;
+ return;
+ }
debug(1, "opening file: %s", name.c_str());
engine->openFile(name);
cs.word(kHandle) = 1; //only one handle
@@ -361,17 +365,19 @@ void DreamGenContext::generalerror() {
void DreamGenContext::dosreturn() {
_cmp(data.byte(kCommandtype), 250);
- if (flags.z()) goto alreadydos;
- data.byte(kCommandtype) = 250;
- al = 46;
- commandonly();
-alreadydos:
+ if (!flags.z()) {
+ data.byte(kCommandtype) = 250;
+ al = 46;
+ commandonly();
+ }
+
ax = data.word(kMousebutton);
_and(ax, 1);
- if (flags.z()) return;
+ if (flags.z())
+ return;
- quickquit2();
- quickquit();
+ data.word(kMousebutton) = 0;
+ engine->quit();
}
void DreamGenContext::set16colpalette() {}
More information about the Scummvm-git-logs
mailing list