From 2c2cfadad00c89e02d5dc301c841c5b47b6d7e1b Mon Sep 17 00:00:00 2001 From: yabause Date: Wed, 8 Apr 2009 22:27:21 +0000 Subject: [PATCH] Merged 1855 and 1861 --- src/mc.cpp | 6 +++++- src/windows/Makefile.am | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mc.cpp b/src/mc.cpp index 4c692e39c..a439b3768 100644 --- a/src/mc.cpp +++ b/src/mc.cpp @@ -181,11 +181,15 @@ void mc_reset_com(memory_chip_t *mc) } else if ((mc->com == BM_CMD_WRITELOW) || (mc->com == FW_CMD_PAGEWRITE)) { + if(!mc->fp) + mc->fp = fopen(mc->filename, "wb+"); + if (mc->fp) { fseek(mc->fp, 0, SEEK_SET); - elems_written += fwrite((void *)mc->data, 1, mc->size, mc->fp); // fix me + elems_written += fwrite((void *)mc->data, 1, mc->size, mc->fp); // FIXME } + // FIXME: desmume silently ignores not having opened save-file mc->write_enable = FALSE; } diff --git a/src/windows/Makefile.am b/src/windows/Makefile.am index 3d1f1b396..797a05e76 100644 --- a/src/windows/Makefile.am +++ b/src/windows/Makefile.am @@ -9,7 +9,7 @@ desmume_SOURCES = \ CWindow.cpp CWindow.h \ disView.cpp disView.h ginfo.cpp ginfo.h \ IORegView.cpp IORegView.h \ - main.cpp mapView.cpp mapView.h memView.cpp memView.h \ + main.cpp main.h mapView.cpp mapView.h memView.cpp memView.h \ oamView.cpp oamView.h palView.cpp palView.h \ resource.h \ snddx.cpp snddx.h \ @@ -23,7 +23,7 @@ desmume_SOURCES = \ inputdx.cpp inputdx.h ogl.cpp \ throttle.cpp throttle.h windriver.h \ cheatsWin.cpp cheatsWin.h gbaslot_config.cpp gbaslot_config.h \ - mic.cpp \ + mic.cpp hotkey.cpp hotkey.h \ DeSmuME_2005.vcproj DeSmuME_2008.vcproj \ DeSmuME_Intel.icproj DeSmuME_Intel.vcproj DeSmuME_Intel.sln \ DeSmuME_x64.manifest DeSmuME_x86.manifest