save savedata before loading state

git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@129 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
This commit is contained in:
sinamas 2008-03-04 06:07:32 +00:00
parent 5b67580b0c
commit 12aa59020f

View File

@ -78,6 +78,8 @@ void GB::set_savedir(const char *sdir) {
}
bool GB::load(const char* romfile) {
z80->saveSavedata();
const bool failed = z80->load(romfile);
SaveState state;
@ -109,6 +111,8 @@ void GB::saveState() {
}
void GB::loadState() {
z80->saveSavedata();
SaveState state;
z80->setStatePtrs(state);
StateSaver::loadState(state, "test.gqs");