Permalink
Showing
with
4 additions
and
3 deletions.
-
+1
−0
CHANGES
-
+3
−3
src/gba/memory.c
|
|
@@ -41,6 +41,7 @@ Bugfixes: |
|
|
- GBA Memory: Fix copy-on-write memory leak
|
|
|
- Core: Fix ROM patches not being unloaded when disabled (fixes mgba.io/i/962)
|
|
|
- GBA I/O: Fix writing to DISPCNT CGB flag (fixes mgba.io/i/902)
|
|
|
+ - GBA Memory: Partially revert prefetch changes (fixes mgba.io/i/840)
|
|
|
Misc:
|
|
|
- GBA Timer: Use global cycles for timers
|
|
|
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
|
|
|
|
|
@@ -1589,8 +1589,8 @@ int32_t GBAMemoryStall(struct ARMCore* cpu, int32_t wait) { |
|
|
maxLoads -= previousLoads;
|
|
|
}
|
|
|
|
|
|
- int32_t s = cpu->memory.activeSeqCycles16;
|
|
|
- int32_t n2s = cpu->memory.activeNonseqCycles16 - cpu->memory.activeSeqCycles16;
|
|
|
+ int32_t s = cpu->memory.activeSeqCycles16 + 1;
|
|
|
+ int32_t n2s = cpu->memory.activeNonseqCycles16 - cpu->memory.activeSeqCycles16 + 1;
|
|
|
|
|
|
// Figure out how many sequential loads we can jam in
|
|
|
int32_t stall = s;
|
|
|
@@ -1611,7 +1611,7 @@ int32_t GBAMemoryStall(struct ARMCore* cpu, int32_t wait) { |
|
|
memory->lastPrefetchedPc = cpu->gprs[ARM_PC] + WORD_SIZE_THUMB * (loads + previousLoads - 1);
|
|
|
|
|
|
// The next |loads|S waitstates disappear entirely, so long as they're all in a row
|
|
|
- cpu->cycles -= stall;
|
|
|
+ cpu->cycles -= (s - 1) * loads;
|
|
|
return wait;
|
|
|
}
|
|
|
|
|
|
|
0 comments on commit
abf1af3