aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Menshakov2011-06-18 13:33:24 +0400
committerVladimir Menshakov2011-06-18 13:33:58 +0400
commitcf671227fe52f7d87afeab65a90642d4aa6b7d73 (patch)
treec88a5d750f5252f1375ad9564fd2884b76cf6456
parent4cdc9c9f8e883bdb4864e6b2c0ef127bf0824e9a (diff)
downloadscummvm-rg350-cf671227fe52f7d87afeab65a90642d4aa6b7d73.tar.gz
scummvm-rg350-cf671227fe52f7d87afeab65a90642d4aa6b7d73.tar.bz2
scummvm-rg350-cf671227fe52f7d87afeab65a90642d4aa6b7d73.zip
DREAMWEB: do not call updatescreen before quitting, fixed crash on dosreturn, cleaned up dosreturn stub
-rw-r--r--devtools/tasmrecover/dreamweb/dreamweb.asm3
-rw-r--r--engines/dreamweb/detection.cpp6
-rw-r--r--engines/dreamweb/dreamgen.cpp8
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/dreamweb.cpp3
-rw-r--r--engines/dreamweb/stubs.cpp22
6 files changed, 33 insertions, 10 deletions
diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm
index 275d8208b0..5d2a60a0c7 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 a5cb7b585f..613bba153f 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 92901b0627..35721d3d4b 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 d7cf4677e3..94b7607087 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 4f39671b85..a0e3bf0f9b 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 69f240ae5e..b8c5fedccd 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() {}