GBA: Flash erase timing changes
Jeffrey Pfau jeffrey@endrift.com
Fri, 19 Jun 2015 04:25:29 -0700
2 files changed,
9 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -80,6 +80,7 @@ - Qt: Don't save window size when entering fullscreen
- Qt: Make the default fullscreen binding for Windows be Alt-Enter - GBA Video: Refactor software renderer into separate files - ARM7: Add emulation for Undefined CPU mode + - GBA: More accurate cycle estimation for ROM prefetch and flash save chips 0.2.1: (2015-05-13) Bugfixes:
M
src/gba/savedata.c
→
src/gba/savedata.c
@@ -14,6 +14,11 @@
#include <errno.h> #include <fcntl.h> +// Some testing was done here... +// Erase cycles can vary greatly. +// Some games may vary anywhere between about 2000 cycles to up to 30000 cycles. (Observed on a Macronix (09C2) chip). +// Other games vary from very little, with a fairly solid 20500 cycle count. (Observed on a SST (D4BF) chip). +// An average estimation is as follows. #define FLASH_SETTLE_CYCLES 18000 static void _flashSwitchBank(struct GBASavedata* savedata, int bank);@@ -234,7 +239,9 @@ }
} } if (savedata->dust > 0 && (address >> 12) == savedata->settling) { - --savedata->dust; + // Give some overhead for waitstates and the comparison + // This estimation can probably be improved + savedata->dust -= 10; return 0x5F; } return savedata->currentBank[address];