mirror of https://github.com/mgba-emu/mgba.git
GBA: Flash erase timing changes
This commit is contained in:
parent
833d81ee75
commit
8538e99a08
1
CHANGES
1
CHANGES
|
@ -80,6 +80,7 @@ Misc:
|
|||
- 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:
|
||||
|
|
|
@ -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 @@ uint8_t GBASavedataReadFlash(struct GBASavedata* savedata, uint16_t address) {
|
|||
}
|
||||
}
|
||||
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];
|
||||
|
|
Loading…
Reference in New Issue