From 56ba7941a136713b8f596e43121d44bc152ca616 Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 26 Dec 2008 08:24:26 +0000 Subject: [PATCH] change backupmem autodetection to catch more cases of unusual usage patterns --- desmume/ChangeLog | 1 + desmume/src/mc.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/desmume/ChangeLog b/desmume/ChangeLog index cf3e51e0d..e15323790 100644 --- a/desmume/ChangeLog +++ b/desmume/ChangeLog @@ -20,6 +20,7 @@ - Add functions for a lid open/close. Holding key (default "Backspace" in Windows port) while game is freeze/non freeze. [CrazyMax] - Added a bunch of crazy templates to the cpu and mmu for minor speed boosts [zeromus] - Add secure area decryption from ndstool [zeromus] + - change backupmem autodetection to catch more cases of unusual usage patterns [zeromus] Graphics: - Added gfx3d module which emulates the whole GE as part of the core emu. [zeromus] - Moved the windows/cocoa OGLRender to the emu core and replace ogl_collector. diff --git a/desmume/src/mc.cpp b/desmume/src/mc.cpp index ba5f1d51a..21fb94ff3 100644 --- a/desmume/src/mc.cpp +++ b/desmume/src/mc.cpp @@ -145,7 +145,8 @@ void mc_reset_com(memory_chip_t *mc) mc->type = MC_TYPE_EEPROM2; mc->size = MC_SIZE_64KBITS; } - else if (mc->autodetectsize == (16+1)) + //if it writes a funny number less than 4kbits, then assume it is 4kbit eeprom + else if (mc->autodetectsize <= (16+1)) { // 4 Kbit EEPROM addr = mc->autodetectbuf[0]; @@ -163,6 +164,8 @@ void mc_reset_com(memory_chip_t *mc) mc->type = MC_TYPE_FLASH; mc->size = MC_SIZE_2MBITS; */ + + //otherwise, we hope it must be a 64kbits eeprom // 64 Kbit EEPROM addr = (mc->autodetectbuf[0] << 8) | mc->autodetectbuf[1]; mc->type = MC_TYPE_EEPROM2;