Some fixes and code refactoring
This commit is contained in:
@@ -42,6 +42,11 @@ namespace Core.Memory
|
||||
|
||||
public byte Read(ushort address)
|
||||
{
|
||||
if (address < 0xC000 && !_isCartridgeLoaded)
|
||||
{
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
if (address < 0x4000)
|
||||
{
|
||||
if (address < 0x0400)
|
||||
@@ -65,7 +70,7 @@ namespace Core.Memory
|
||||
return _cartridgeRom[(_romBank2 * 0x4000) + (address - 0x8000)];
|
||||
}
|
||||
|
||||
// THE FIX 1: Bitwise AND perfectly forces 0xE000-0xFFFF to mirror down to 0xC000!
|
||||
// Bitwise AND perfectly forces 0xE000-0xFFFF to mirror down to 0xC000!
|
||||
return _workRam[address & 0x1FFF];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user