From a2b444e0faeb52c54307971a431cf1485c39f5b2 Mon Sep 17 00:00:00 2001 From: normmatt234 Date: Wed, 19 Nov 2008 07:48:00 +0000 Subject: [PATCH] More Save Auto Detection Sizes added. Opps broke one of the save type buttons. --- desmume/src/mc.cpp | 6 ++++-- desmume/src/windows/main.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/desmume/src/mc.cpp b/desmume/src/mc.cpp index 82fe91296..0c366d6d3 100644 --- a/desmume/src/mc.cpp +++ b/desmume/src/mc.cpp @@ -102,6 +102,8 @@ void mc_reset_com(memory_chip_t *mc) { u32 addr, size; + printlog("autodetectsize = %d\n",mc->autodetectsize); + if (mc->autodetectsize == (32768+2)) { // FRAM @@ -127,14 +129,14 @@ void mc_reset_com(memory_chip_t *mc) mc->type = MC_TYPE_FLASH; mc->size = MC_SIZE_2MBITS; } - else if (mc->autodetectsize == (128+2)) + else if ((mc->autodetectsize == (128+2)) || (mc->autodetectsize == (64+2)) || (mc->autodetectsize == (40+2))) { // 512 Kbit EEPROM addr = (mc->autodetectbuf[0] << 8) | mc->autodetectbuf[1]; mc->type = MC_TYPE_EEPROM2; mc->size = MC_SIZE_512KBITS; } - else if (mc->autodetectsize == (32+2)) + else if ((mc->autodetectsize == (32+2)) || (mc->autodetectsize == (16+2))) { // 64 Kbit EEPROM addr = (mc->autodetectbuf[0] << 8) | mc->autodetectbuf[1]; diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 2e73565c4..c2d59a063 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2243,7 +2243,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM return 0; case IDC_SAVETYPE3: clearsaver(); - saver(IDC_SAVETYPE2); + saver(IDC_SAVETYPE3); mmu_select_savetype(2,&backupmemorytype,&backupmemorysize); return 0; case IDC_SAVETYPE4: