mirror of
https://github.com/digarok/gsplus.git
synced 2024-09-27 01:54:42 +00:00
fix memory breakpoint range checking.
It's still broken for page/bank wrapped data. Eg, sta <$ff stores @ $ff and $00
This commit is contained in:
parent
5da4e5c39f
commit
bf09880caf
@ -443,14 +443,14 @@ int check_mp_breakpoints(word32 addr, word32 value, unsigned bytes, int in_page,
|
||||
|
||||
|
||||
/* assumptions:
|
||||
* bytes is 1-3, so no possibility of crossing multiple pags
|
||||
* bytes is 1-3, so no possibility of crossing multiple pages
|
||||
* g_mp_breakpoints is in ascending order.
|
||||
*/
|
||||
|
||||
word32 a1 = addr;
|
||||
word32 a2 = addr + bytes - 1;
|
||||
if (in_page) a1 = (a1 & 0x00ff) | (addr & 0xffff00);
|
||||
if (in_bank) a1 = (a1 & 0xffff) | (addr & 0xff0000);
|
||||
if (in_page) a2 = (a2 & 0x00ff) | (addr & 0xffff00);
|
||||
if (in_bank) a2 = (a2 & 0xffff) | (addr & 0xff0000);
|
||||
|
||||
stat1 = GET_PAGE_INFO_WR(((a1) >> 8) & 0xffff);
|
||||
stat2 = GET_PAGE_INFO_WR(((a2) >> 8) & 0xffff);
|
||||
@ -459,7 +459,7 @@ int check_mp_breakpoints(word32 addr, word32 value, unsigned bytes, int in_page,
|
||||
if (wstat & BANK_BREAK) {
|
||||
for (i = 0; i < g_num_mp_breakpoints; ++i) {
|
||||
word32 bp = g_mp_breakpoints[i];
|
||||
if (a1 >= bp && a2 <= bp) {
|
||||
if (bp >= a1 && bp <= a2) {
|
||||
g_abort_address = addr;
|
||||
g_abort_bytes = bytes;
|
||||
mask = (1 << (bytes << 3))-1;
|
||||
|
Loading…
Reference in New Issue
Block a user