Fri, 12 Apr 2013 12:34:32 +0100
Fix read-after-write logic
In some cases (notably reading from a page after having written to it), the
mapper may change the pagestate from "accessed and written" ("dirty"; PS0,PS1)
to "accessed but not written" (clean; PS1,!PS0). This should never, ever, EVER
happen. Once a page is dirty, it remains so until the 68k clears the DIRTY
bit.
Once again, this wonderful bit of logic was missing from the TRM.
src/memory.c | file | annotate | diff | revisions |
1.1 diff -r 159f937af10d -r 1e4c45b144c4 src/memory.c 1.2 --- a/src/memory.c Wed Mar 13 01:10:34 2013 +0000 1.3 +++ b/src/memory.c Fri Apr 12 12:34:32 2013 +0100 1.4 @@ -94,7 +94,8 @@ 1.5 } else { 1.6 // No L7 interrupt 1.7 if ((write && !(MAP_PAGEBITS(addr) & PAGE_BIT_PS1) && (MAP_PAGEBITS(addr) & PAGE_BIT_PS0)) || 1.8 - (write && (MAP_PAGEBITS(addr) & PAGE_BIT_PS1) && !(MAP_PAGEBITS(addr) & PAGE_BIT_PS0))) 1.9 + (write && (MAP_PAGEBITS(addr) & PAGE_BIT_PS1) && !(MAP_PAGEBITS(addr) & PAGE_BIT_PS0)) || 1.10 + ( (MAP_PAGEBITS(addr) & PAGE_BIT_PS1) && (MAP_PAGEBITS(addr) & PAGE_BIT_PS0))) /* NOTE -- Once again, this case was missing from the PAL equations in the TRM... */ 1.11 { 1.12 // No L7 interrupt, PS[1:0] = 0b01, write 1.13 // No L7 interrupt, PS[1:0] = 0b10, write