aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devtools/tasmrecover/dreamweb/saveload.asm1
-rw-r--r--engines/dreamweb/saveload.cpp44
-rw-r--r--engines/dreamweb/stubs.cpp3
-rw-r--r--engines/dreamweb/stubs.h2
4 files changed, 18 insertions, 32 deletions
diff --git a/devtools/tasmrecover/dreamweb/saveload.asm b/devtools/tasmrecover/dreamweb/saveload.asm
index 6c98774a0f..f3c92d36f6 100644
--- a/devtools/tasmrecover/dreamweb/saveload.asm
+++ b/devtools/tasmrecover/dreamweb/saveload.asm
@@ -1502,7 +1502,6 @@ Loadold proc near
alreadyloadold: mov ax,mousebutton
and ax,1
jz noloadold
- mov ax,0ffffh
call doload
cmp getback,4
jz noloadold
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index ccf70aae6e..6f1691f6fa 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -35,18 +35,13 @@ void DreamGenContext::loadGame() {
}
if (data.word(kMousebutton) == data.word(kOldbutton))
return; // "noload"
- if (data.word(kMousebutton) == 1) {
- ax = 0xFFFF;
- doLoad();
- }
+ if (data.word(kMousebutton) == 1)
+ doLoad(-1);
}
-// input: ax = savegameId
// if -1, open menu to ask for slot to load
// if >= 0, directly load from that slot
-void DreamGenContext::doLoad() {
- int savegameId = (int16)ax;
-
+void DreamGenContext::doLoad(int savegameId) {
data.byte(kLoadingorsave) = 1;
if (ConfMan.getBool("dreamweb_originalsaveload") && savegameId == -1) {
@@ -417,26 +412,19 @@ unsigned int DreamGenContext::scanForNames() {
}
void DreamGenContext::loadOld() {
- STACK_CHECK;
- _cmp(data.byte(kCommandtype), 252);
- if (flags.z())
- goto alreadyloadold;
- data.byte(kCommandtype) = 252;
- al = 48;
- commandOnly();
-alreadyloadold:
- ax = data.word(kMousebutton);
- _and(ax, 1);
- if (flags.z())
- return /* (noloadold) */;
- ax = 0x0ffff;
- doLoad();
- _cmp(data.byte(kGetback), 4);
- if (flags.z())
- return /* (noloadold) */;
- _cmp(data.byte(kQuitrequested), 0);
- if (!flags.z())
- return /* (noloadold) */;
+ if (data.byte(kCommandtype) != 252) {
+ data.byte(kCommandtype) = 252;
+ commandOnly(48);
+ }
+
+ if (!(data.word(kMousebutton) & 1))
+ return;
+
+ doLoad(-1);
+
+ if (data.byte(kGetback) == 4 || quitRequested())
+ return;
+
showDecisions();
workToScreenM();
data.byte(kGetback) = 0;
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 2db75ee3e5..846937b3fa 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -348,8 +348,7 @@ void DreamGenContext::dreamweb() {
loadPalFromIFF();
clearPalette();
- ax = savegameId;
- doLoad();
+ doLoad(savegameId);
workToScreen();
fadeScreenUp();
startNewGame = false;
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 3bbe0dd02c..de9335f289 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -406,6 +406,6 @@
void enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
void enterCode();
unsigned int scanForNames();
- void doLoad();
+ void doLoad(int slot);
void loadOld();