m293: Fix alignment and update

This commit is contained in:
negativeExponent
2020-11-17 00:18:31 +08:00
parent 14b689cde6
commit 0cc55ba1f1

View File

@@ -55,13 +55,17 @@ static void Sync(void) {
} }
static DECLFW(M293Write1) { static DECLFW(M293Write1) {
if (A < 0xA000) regs[0] = V; regs[0] = V;
regs[1] = V; regs[1] = V;
Sync(); Sync();
} }
static DECLFW(M293Write2) { static DECLFW(M293Write2) {
if (A < 0xA000) regs[1] = V; regs[1] = V;
Sync();
}
static DECLFW(M293Write3) {
regs[0] = V; regs[0] = V;
Sync(); Sync();
} }
@@ -70,8 +74,9 @@ static void M293Power(void) {
regs[0] = regs[1] = 0; regs[0] = regs[1] = 0;
Sync(); Sync();
SetReadHandler(0x8000, 0xFFFF, CartBR); SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xBFFF, M293Write1); SetWriteHandler(0x8000, 0x9FFF, M293Write1);
SetWriteHandler(0xC000, 0xDFFF, M293Write2); SetWriteHandler(0xA000, 0xBFFF, M293Write2);
SetWriteHandler(0xC000, 0xDFFF, M293Write3);
} }
static void StateRestore(int version) { static void StateRestore(int version) {