mirror of https://github.com/stella-emu/stella.git
fixed #537 (writes to read ports)
This commit is contained in:
parent
a3b536c94d
commit
f88a932d1e
|
@ -143,10 +143,22 @@ bool Cartridge3EPlus::poke(uInt16 address, uInt8 value)
|
||||||
|
|
||||||
if(whichBankIsThere & BITMASK_ROMRAM)
|
if(whichBankIsThere & BITMASK_ROMRAM)
|
||||||
{
|
{
|
||||||
uInt32 byteOffset = address & BITMASK_RAM_BANK;
|
if(address & RAM_BANK_SIZE)
|
||||||
uInt32 baseAddress = ((whichBankIsThere & BIT_BANK_MASK) << RAM_BANK_TO_POWER) + byteOffset;
|
{
|
||||||
pokeRAM(myRAM[baseAddress], address, value);
|
uInt32 byteOffset = address & BITMASK_RAM_BANK;
|
||||||
changed = true;
|
uInt32 baseAddress = ((whichBankIsThere & BIT_BANK_MASK) << RAM_BANK_TO_POWER) + byteOffset;
|
||||||
|
pokeRAM(myRAM[baseAddress], address, value);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Writing to the read port should be ignored, but trigger a break if option enabled
|
||||||
|
uInt8 dummy;
|
||||||
|
|
||||||
|
pokeRAM(dummy, address, value);
|
||||||
|
myRamWriteAccess = address;
|
||||||
|
changed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,8 +104,21 @@ uInt8 CartridgeCV::peek(uInt16 address)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool CartridgeCV::poke(uInt16 address, uInt8 value)
|
bool CartridgeCV::poke(uInt16 address, uInt8 value)
|
||||||
{
|
{
|
||||||
pokeRAM(myRAM[address & 0x03FF], address, value);
|
|
||||||
return true;
|
if(address & 0x0400)
|
||||||
|
{
|
||||||
|
pokeRAM(myRAM[address & 0x03FF], address, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Writing to the read port should be ignored, but trigger a break if option enabled
|
||||||
|
uInt8 dummy;
|
||||||
|
|
||||||
|
pokeRAM(dummy, address, value);
|
||||||
|
myRamWriteAccess = address;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -104,9 +104,22 @@ bool CartridgeCVPlus::poke(uInt16 address, uInt8 value)
|
||||||
return mySystem->tia().poke(address, value);
|
return mySystem->tia().poke(address, value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pokeRAM(myRAM[address & 0x03FF], pokeAddress, value);
|
{
|
||||||
|
if(address & 0x0400)
|
||||||
|
{
|
||||||
|
pokeRAM(myRAM[address & 0x03FF], pokeAddress, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Writing to the read port should be ignored, but trigger a break if option enabled
|
||||||
|
uInt8 dummy;
|
||||||
|
|
||||||
return true;
|
pokeRAM(dummy, pokeAddress, value);
|
||||||
|
myRamWriteAccess = pokeAddress;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -135,10 +135,22 @@ bool CartridgeDASH::poke(uInt16 address, uInt8 value)
|
||||||
|
|
||||||
if(whichBankIsThere & BITMASK_ROMRAM)
|
if(whichBankIsThere & BITMASK_ROMRAM)
|
||||||
{
|
{
|
||||||
uInt32 byteOffset = address & BITMASK_RAM_BANK;
|
if(address & RAM_BANK_SIZE)
|
||||||
uInt32 baseAddress = ((whichBankIsThere & BIT_BANK_MASK) << RAM_BANK_TO_POWER) + byteOffset;
|
{
|
||||||
pokeRAM(myRAM[baseAddress], address, value);
|
uInt32 byteOffset = address & BITMASK_RAM_BANK;
|
||||||
changed = true;
|
uInt32 baseAddress = ((whichBankIsThere & BIT_BANK_MASK) << RAM_BANK_TO_POWER) + byteOffset;
|
||||||
|
pokeRAM(myRAM[baseAddress], address, value);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Writing to the read port should be ignored, but trigger a break if option enabled
|
||||||
|
uInt8 dummy;
|
||||||
|
|
||||||
|
pokeRAM(dummy, address, value);
|
||||||
|
myRamWriteAccess = address;
|
||||||
|
changed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,13 +137,42 @@ bool CartridgeMNetwork::poke(uInt16 address, uInt8 value)
|
||||||
// All RAM writes are mapped here
|
// All RAM writes are mapped here
|
||||||
if((myCurrentSlice[0] == myRAMSlice) && (address < BANK_SIZE / 2))
|
if((myCurrentSlice[0] == myRAMSlice) && (address < BANK_SIZE / 2))
|
||||||
{
|
{
|
||||||
pokeRAM(myRAM[address & (BANK_SIZE / 2 - 1)], pokeAddress, value);
|
// RAM slices
|
||||||
return true;
|
if(!(address & 0x0400))
|
||||||
|
{
|
||||||
|
pokeRAM(myRAM[address & (BANK_SIZE / 2 - 1)], pokeAddress, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Writing to the read port should be ignored, but trigger a break if option enabled
|
||||||
|
uInt8 dummy;
|
||||||
|
|
||||||
|
pokeRAM(dummy, pokeAddress, value);
|
||||||
|
myRamWriteAccess = pokeAddress;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if((address >= 0x0800) && (address <= 0x08FF))
|
else
|
||||||
{
|
{
|
||||||
pokeRAM(myRAM[0x0400 + (myCurrentRAM << 8) + (address & 0x00FF)], pokeAddress, value);
|
// fixed 256 bytes of RAM
|
||||||
return true;
|
if((address >= 0x0800) && (address <= 0x09FF))
|
||||||
|
{
|
||||||
|
if(!(address & 0x100))
|
||||||
|
{
|
||||||
|
pokeRAM(myRAM[0x0400 + (myCurrentRAM << 8) + (address & 0x00FF)], pokeAddress, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Writing to the read port should be ignored, but trigger a break if option enabled
|
||||||
|
uInt8 dummy;
|
||||||
|
|
||||||
|
pokeRAM(dummy, pokeAddress, value);
|
||||||
|
myRamWriteAccess = pokeAddress;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue