X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fjaguar.cpp;h=9365b01672c2a8afa82fd8f3781743e4cf4fc28d;hb=e68c334af31779da826f7876a3af487c2e96c3f6;hp=5f23f1b4da8306ef7c3351baa079e2d3d27e26ad;hpb=da13c0c4d801c2838b18fe6492cbe4a7b576164b;p=virtualjaguar diff --git a/src/jaguar.cpp b/src/jaguar.cpp index 5f23f1b..9365b01 100644 --- a/src/jaguar.cpp +++ b/src/jaguar.cpp @@ -1496,11 +1496,12 @@ void JaguarDasm(uint32 offset, uint32 qt) uint8 JaguarReadByte(uint32 offset, uint32 who/*=UNKNOWN*/) { uint8 data = 0x00; - offset &= 0xFFFFFF; - if (offset < 0x200000) - data = jaguarMainRAM[offset & 0x3FFFFF]; - else if ((offset >= 0x800000) && (offset < 0xC00000)) + + // First 2M is mirrored in the $0 - $7FFFFF range + if (offset < 0x800000) + data = jaguarMainRAM[offset & 0x1FFFFF]; + else if ((offset >= 0x800000) && (offset < 0xDFFF00)) data = jaguarMainROM[offset - 0x800000]; else if ((offset >= 0xDFFF00) && (offset <= 0xDFFFFF)) data = CDROMReadByte(offset, who); @@ -1521,11 +1522,13 @@ uint8 JaguarReadByte(uint32 offset, uint32 who/*=UNKNOWN*/) uint16 JaguarReadWord(uint32 offset, uint32 who/*=UNKNOWN*/) { offset &= 0xFFFFFF; - if (offset <= 0x1FFFFE) + + // First 2M is mirrored in the $0 - $7FFFFF range + if (offset < 0x800000) { return (jaguarMainRAM[(offset+0) & 0x1FFFFF] << 8) | jaguarMainRAM[(offset+1) & 0x1FFFFF]; } - else if ((offset >= 0x800000) && (offset <= 0xBFFFFE)) + else if ((offset >= 0x800000) && (offset < 0xDFFF00)) { offset -= 0x800000; return (jaguarMainROM[offset+0] << 8) | jaguarMainROM[offset+1]; @@ -1555,7 +1558,9 @@ void JaguarWriteByte(uint32 offset, uint8 data, uint32 who/*=UNKNOWN*/) WriteLog("JWB: Byte %02X written at %08X by %s\n", data, offset, whoName[who]);//*/ offset &= 0xFFFFFF; - if (offset < 0x200000) + + // First 2M is mirrored in the $0 - $7FFFFF range + if (offset < 0x800000) { jaguarMainRAM[offset & 0x1FFFFF] = data; return; @@ -1599,7 +1604,8 @@ if (offset == 0x0102)//64*4) offset &= 0xFFFFFF; - if (offset <= 0x1FFFFE) + // First 2M is mirrored in the $0 - $7FFFFF range + if (offset <= 0x7FFFFE) { /* GPU Table (CD BIOS)