INTV: fix intellicart, fixes various homebrews

This commit is contained in:
alyosha-tas 2021-11-23 18:56:29 -05:00
parent d5c1ebb88e
commit 726ecef5a6
1 changed files with 6 additions and 6 deletions

View File

@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
int offset = 0; int offset = 0;
// Check to see if the header is valid. // Check to see if the header is valid.
if (Rom[offset++] != 0xA8 || Rom[offset++] != (0xFF ^ Rom[offset++])) if (Rom[offset++] != 0xA8 | Rom[offset++] != (0xFF ^ Rom[offset++]))
{ {
return -1; return -1;
} }
@ -121,16 +121,16 @@ namespace BizHawk.Emulation.Cores.Intellivision
MemoryAttributes[range] = new bool[4]; MemoryAttributes[range] = new bool[4];
// Readable. // Readable.
MemoryAttributes[range][0] = (range & 0x1) != 0; MemoryAttributes[range][0] = (attributes & 0x1) != 0;
// Writeable. // Writeable.
MemoryAttributes[range][1] = (range & 0x2) != 0; MemoryAttributes[range][1] = (attributes & 0x2) != 0;
// Narrow. // Narrow.
MemoryAttributes[range][2] = (range & 0x4) != 0; MemoryAttributes[range][2] = (attributes & 0x4) != 0;
// Bank-switched. // Bank-switched.
MemoryAttributes[range][3] = (range & 0x8) != 0; MemoryAttributes[range][3] = (attributes & 0x8) != 0;
} }
// Parse for fine addresses (Trimmed 2K ranges). // Parse for fine addresses (Trimmed 2K ranges).
@ -139,7 +139,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
int index; int index;
// The lower and upper 2K in a 4K range are 16 addresses away from each other. // The lower and upper 2K in a 4K range are 16 addresses away from each other.
if ((range & 0x1) != 0) if ((range & 0x1) == 0)
{ {
index = offset + 16 + (range >> 1); index = offset + 16 + (range >> 1);
} }