diff options
author | Willem Jan Palenstijn | 2011-06-26 12:09:56 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-08-18 00:28:08 +0200 |
commit | f3131e2dbf9d18bd37ef7fb56de1c15a9826301a (patch) | |
tree | 7d56f466ca940c4dc9e8f641276f7e45089b2c59 /engines/dreamweb | |
parent | aa9f9708737d687d702db31f7976426ddc61f41c (diff) | |
download | scummvm-rg350-f3131e2dbf9d18bd37ef7fb56de1c15a9826301a.tar.gz scummvm-rg350-f3131e2dbf9d18bd37ef7fb56de1c15a9826301a.tar.bz2 scummvm-rg350-f3131e2dbf9d18bd37ef7fb56de1c15a9826301a.zip |
DREAMWEB: Move several load/save functions out of dreamgen
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 164 | ||||
-rw-r--r-- | engines/dreamweb/module.mk | 1 | ||||
-rw-r--r-- | engines/dreamweb/saveload.cpp | 191 |
3 files changed, 192 insertions, 164 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 2ecdbac3fa..071841ea26 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -13769,71 +13769,6 @@ void DreamGenContext::loadsavebox() { loadintotemp(); } -void DreamGenContext::loadgame() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 246); - if (flags.z()) - goto alreadyload; - data.byte(kCommandtype) = 246; - al = 41; - commandonly(); -alreadyload: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (noload) */; - _cmp(ax, 1); - if (flags.z()) - goto doload; - return; -doload: - data.byte(kLoadingorsave) = 1; - showopbox(); - showloadops(); - data.byte(kCurrentslot) = 0; - showslots(); - shownames(); - data.byte(kPointerframe) = 0; - worktoscreenm(); - namestoold(); - data.byte(kGetback) = 0; -loadops: - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - return /* (quitloaded) */; - delpointer(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - bx = offset_loadlist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto loadops; - _cmp(data.byte(kGetback), 2); - if (flags.z()) - return /* (quitloaded) */; - getridoftemp(); - dx = data; - es = dx; - bx = 7979; - startloading(); - loadroomssample(); - data.byte(kRoomloaded) = 1; - data.byte(kNewlocation) = 255; - clearsprites(); - initman(); - initrain(); - data.word(kTextaddressx) = 13; - data.word(kTextaddressy) = 182; - data.byte(kTextlen) = 240; - startup(); - worktoscreen(); - data.byte(kGetback) = 4; -} - void DreamGenContext::getbacktoops() { STACK_CHECK; _cmp(data.byte(kCommandtype), 201); @@ -13898,56 +13833,6 @@ discopsloop: goto discopsloop; } -void DreamGenContext::savegame() { - STACK_CHECK; - _cmp(data.byte(kMandead), 2); - if (!flags.z()) - goto cansaveok; - blank(); - return; -cansaveok: - _cmp(data.byte(kCommandtype), 247); - if (flags.z()) - goto alreadysave; - data.byte(kCommandtype) = 247; - al = 44; - commandonly(); -alreadysave: - ax = data.word(kMousebutton); - _and(ax, 1); - if (!flags.z()) - goto dosave; - return; -dosave: - data.byte(kLoadingorsave) = 2; - showopbox(); - showsaveops(); - data.byte(kCurrentslot) = 0; - showslots(); - shownames(); - worktoscreenm(); - namestoold(); - data.word(kBufferin) = 0; - data.word(kBufferout) = 0; - data.byte(kGetback) = 0; -saveops: - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - return /* (quitsavegame) */; - delpointer(); - checkinput(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - bx = offset_savelist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto saveops; -} - void DreamGenContext::actualsave() { STACK_CHECK; _cmp(data.byte(kCommandtype), 222); @@ -14612,55 +14497,6 @@ alreadynewgame: data.byte(kGetback) = 3; } -void DreamGenContext::doload() { - STACK_CHECK; - data.byte(kLoadingorsave) = 1; - showopbox(); - showloadops(); - data.byte(kCurrentslot) = 0; - showslots(); - shownames(); - data.byte(kPointerframe) = 0; - worktoscreenm(); - namestoold(); - data.byte(kGetback) = 0; -loadops: - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - return /* (quitloaded) */; - delpointer(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - bx = offset_loadlist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto loadops; - _cmp(data.byte(kGetback), 2); - if (flags.z()) - return /* (quitloaded) */; - getridoftemp(); - dx = data; - es = dx; - bx = 7979; - startloading(); - loadroomssample(); - data.byte(kRoomloaded) = 1; - data.byte(kNewlocation) = 255; - clearsprites(); - initman(); - initrain(); - data.word(kTextaddressx) = 13; - data.word(kTextaddressy) = 182; - data.byte(kTextlen) = 240; - startup(); - worktoscreen(); - data.byte(kGetback) = 4; -} - void DreamGenContext::loadold() { STACK_CHECK; _cmp(data.byte(kCommandtype), 252); diff --git a/engines/dreamweb/module.mk b/engines/dreamweb/module.mk index c7307e8c2a..b33703a8dc 100644 --- a/engines/dreamweb/module.mk +++ b/engines/dreamweb/module.mk @@ -7,6 +7,7 @@ MODULE_OBJS := \ dreamweb.o \ dreamgen.o \ print.o \ + saveload.o \ sprite.o \ stubs.o \ vgagrafx.o diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp new file mode 100644 index 0000000000..9b6e35b01d --- /dev/null +++ b/engines/dreamweb/saveload.cpp @@ -0,0 +1,191 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "dreamweb/dreamweb.h" + +namespace DreamGen { + +void DreamGenContext::loadgame() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 246); + if (flags.z()) + goto alreadyload; + data.byte(kCommandtype) = 246; + al = 41; + commandonly(); +alreadyload: + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) + return /* (noload) */; + _cmp(ax, 1); + if (flags.z()) + goto doload; + return; +doload: + data.byte(kLoadingorsave) = 1; + showopbox(); + showloadops(); + data.byte(kCurrentslot) = 0; + showslots(); + shownames(); + data.byte(kPointerframe) = 0; + worktoscreenm(); + namestoold(); + data.byte(kGetback) = 0; +loadops: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (quitloaded) */; + delpointer(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = offset_loadlist; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) + goto loadops; + _cmp(data.byte(kGetback), 2); + if (flags.z()) + return /* (quitloaded) */; + getridoftemp(); + dx = data; + es = dx; + bx = 7979; + startloading(); + loadroomssample(); + data.byte(kRoomloaded) = 1; + data.byte(kNewlocation) = 255; + clearsprites(); + initman(); + initrain(); + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; + startup(); + worktoscreen(); + data.byte(kGetback) = 4; +} + +void DreamGenContext::doload() { + STACK_CHECK; + data.byte(kLoadingorsave) = 1; + showopbox(); + showloadops(); + data.byte(kCurrentslot) = 0; + showslots(); + shownames(); + data.byte(kPointerframe) = 0; + worktoscreenm(); + namestoold(); + data.byte(kGetback) = 0; +loadops: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (quitloaded) */; + delpointer(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = offset_loadlist; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) + goto loadops; + _cmp(data.byte(kGetback), 2); + if (flags.z()) + return /* (quitloaded) */; + getridoftemp(); + dx = data; + es = dx; + bx = 7979; + startloading(); + loadroomssample(); + data.byte(kRoomloaded) = 1; + data.byte(kNewlocation) = 255; + clearsprites(); + initman(); + initrain(); + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; + startup(); + worktoscreen(); + data.byte(kGetback) = 4; +} + +void DreamGenContext::savegame() { + STACK_CHECK; + _cmp(data.byte(kMandead), 2); + if (!flags.z()) + goto cansaveok; + blank(); + return; +cansaveok: + _cmp(data.byte(kCommandtype), 247); + if (flags.z()) + goto alreadysave; + data.byte(kCommandtype) = 247; + al = 44; + commandonly(); +alreadysave: + ax = data.word(kMousebutton); + _and(ax, 1); + if (!flags.z()) + goto dosave; + return; +dosave: + data.byte(kLoadingorsave) = 2; + showopbox(); + showsaveops(); + data.byte(kCurrentslot) = 0; + showslots(); + shownames(); + worktoscreenm(); + namestoold(); + data.word(kBufferin) = 0; + data.word(kBufferout) = 0; + data.byte(kGetback) = 0; +saveops: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (quitsavegame) */; + delpointer(); + checkinput(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = offset_savelist; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) + goto saveops; +} + +} /*namespace dreamgen */ |