mirror of https://github.com/stella-emu/stella.git
Merge remote-tracking branch 'remotes/origin/master' into feature/quadtari
This commit is contained in:
commit
2557d03d05
|
@ -3624,7 +3624,7 @@
|
||||||
<td><span style="white-space:nowrap">-dev.rwportbreak</span></td>
|
<td><span style="white-space:nowrap">-dev.rwportbreak</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Break on write to ...</td>
|
<td>Break on writes to ...</td>
|
||||||
<td>A write to a read port interrupts emulation and the debugger is entered.</td>
|
<td>A write to a read port interrupts emulation and the debugger is entered.</td>
|
||||||
<td><span style="white-space:nowrap">-dev.wrportbreak</span></td>
|
<td><span style="white-space:nowrap">-dev.wrportbreak</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -59,28 +59,3 @@ bool Cartridge3EPlus::checkSwitchBank(uInt16 address, uInt8 value)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
uInt8 Cartridge3EPlus::peek(uInt16 address)
|
|
||||||
{
|
|
||||||
uInt16 peekAddress = address;
|
|
||||||
address &= ROM_MASK;
|
|
||||||
|
|
||||||
if(address < 0x0040) // TIA peek
|
|
||||||
return mySystem->tia().peek(address);
|
|
||||||
|
|
||||||
return CartridgeEnhanced::peek(peekAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
bool Cartridge3EPlus::poke(uInt16 address, uInt8 value)
|
|
||||||
{
|
|
||||||
if(CartridgeEnhanced::poke(address, value))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if(address < 0x0040) // TIA poke
|
|
||||||
// Handle TIA space that we claimed above
|
|
||||||
return mySystem->tia().poke(address, value);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
|
@ -124,23 +124,6 @@ class Cartridge3EPlus: public Cartridge3E
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
Get the byte at the specified address
|
|
||||||
|
|
||||||
@return The byte at the specified address
|
|
||||||
*/
|
|
||||||
uInt8 peek(uInt16 address) override;
|
|
||||||
|
|
||||||
/**
|
|
||||||
Change the byte at the specified address to the given value
|
|
||||||
|
|
||||||
@param address The address where the value should be stored
|
|
||||||
@param value The value to be stored at the address
|
|
||||||
@return True if the poke changed the device address space, else false
|
|
||||||
*/
|
|
||||||
bool poke(uInt16 address, uInt8 value) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool checkSwitchBank(uInt16 address, uInt8 value) override;
|
bool checkSwitchBank(uInt16 address, uInt8 value) override;
|
||||||
|
|
||||||
|
|
|
@ -91,14 +91,12 @@ void CartridgeEnhanced::install(System& system)
|
||||||
System::PageAccess access(this, System::PageAccessType::READ);
|
System::PageAccess access(this, System::PageAccessType::READ);
|
||||||
|
|
||||||
// Set the page accessing method for the RAM writing pages
|
// Set the page accessing method for the RAM writing pages
|
||||||
// Map access to this class, since we need to inspect all accesses to
|
// Note: Writes are mapped to poke() (NOT using direcPokeBase) to check for read from write port (RWP)
|
||||||
// check if RWP happens
|
|
||||||
access.type = System::PageAccessType::WRITE;
|
access.type = System::PageAccessType::WRITE;
|
||||||
for(uInt16 addr = ROM_OFFSET + myWriteOffset; addr < ROM_OFFSET + myWriteOffset + myRamSize; addr += System::PAGE_SIZE)
|
for(uInt16 addr = ROM_OFFSET + myWriteOffset; addr < ROM_OFFSET + myWriteOffset + myRamSize; addr += System::PAGE_SIZE)
|
||||||
{
|
{
|
||||||
const uInt16 offset = addr & myRamMask;
|
const uInt16 offset = addr & myRamMask;
|
||||||
|
|
||||||
access.directPokeBase = &myRAM[offset];
|
|
||||||
access.romAccessBase = &myRomAccessBase[myWriteOffset + offset];
|
access.romAccessBase = &myRomAccessBase[myWriteOffset + offset];
|
||||||
access.romPeekCounter = &myRomAccessCounter[myWriteOffset + offset];
|
access.romPeekCounter = &myRomAccessCounter[myWriteOffset + offset];
|
||||||
access.romPokeCounter = &myRomAccessCounter[myWriteOffset + offset + myAccessSize];
|
access.romPokeCounter = &myRomAccessCounter[myWriteOffset + offset + myAccessSize];
|
||||||
|
@ -107,7 +105,6 @@ void CartridgeEnhanced::install(System& system)
|
||||||
|
|
||||||
// Set the page accessing method for the RAM reading pages
|
// Set the page accessing method for the RAM reading pages
|
||||||
access.type = System::PageAccessType::READ;
|
access.type = System::PageAccessType::READ;
|
||||||
access.directPokeBase = nullptr;
|
|
||||||
for(uInt16 addr = ROM_OFFSET + myReadOffset; addr < ROM_OFFSET + myReadOffset + myRamSize; addr += System::PAGE_SIZE)
|
for(uInt16 addr = ROM_OFFSET + myReadOffset; addr < ROM_OFFSET + myReadOffset + myRamSize; addr += System::PAGE_SIZE)
|
||||||
{
|
{
|
||||||
const uInt16 offset = addr & myRamMask;
|
const uInt16 offset = addr & myRamMask;
|
||||||
|
@ -263,6 +260,7 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment)
|
||||||
myCurrentSegOffset[segment] = uInt32(mySize) + (ramBank << myBankShift);
|
myCurrentSegOffset[segment] = uInt32(mySize) + (ramBank << myBankShift);
|
||||||
|
|
||||||
// Set the page accessing method for the RAM writing pages
|
// Set the page accessing method for the RAM writing pages
|
||||||
|
// Note: Writes are mapped to poke() (NOT using direcPokeBase) to check for read from write port (RWP)
|
||||||
uInt16 fromAddr = (ROM_OFFSET + segmentOffset + myWriteOffset) & ~System::PAGE_MASK;
|
uInt16 fromAddr = (ROM_OFFSET + segmentOffset + myWriteOffset) & ~System::PAGE_MASK;
|
||||||
uInt16 toAddr = (ROM_OFFSET + segmentOffset + myWriteOffset + (myBankSize >> 1)) & ~System::PAGE_MASK;
|
uInt16 toAddr = (ROM_OFFSET + segmentOffset + myWriteOffset + (myBankSize >> 1)) & ~System::PAGE_MASK;
|
||||||
System::PageAccess access(this, System::PageAccessType::WRITE);
|
System::PageAccess access(this, System::PageAccessType::WRITE);
|
||||||
|
@ -271,7 +269,6 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment)
|
||||||
{
|
{
|
||||||
const uInt32 offset = bankOffset + (addr & myRamMask);
|
const uInt32 offset = bankOffset + (addr & myRamMask);
|
||||||
|
|
||||||
access.directPokeBase = &myRAM[offset - mySize];
|
|
||||||
access.romAccessBase = &myRomAccessBase[offset];
|
access.romAccessBase = &myRomAccessBase[offset];
|
||||||
access.romPeekCounter = &myRomAccessCounter[offset];
|
access.romPeekCounter = &myRomAccessCounter[offset];
|
||||||
access.romPokeCounter = &myRomAccessCounter[offset + myAccessSize];
|
access.romPokeCounter = &myRomAccessCounter[offset + myAccessSize];
|
||||||
|
@ -282,7 +279,6 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment)
|
||||||
fromAddr = (ROM_OFFSET + segmentOffset + myReadOffset) & ~System::PAGE_MASK;
|
fromAddr = (ROM_OFFSET + segmentOffset + myReadOffset) & ~System::PAGE_MASK;
|
||||||
toAddr = (ROM_OFFSET + segmentOffset + myReadOffset + (myBankSize >> 1)) & ~System::PAGE_MASK;
|
toAddr = (ROM_OFFSET + segmentOffset + myReadOffset + (myBankSize >> 1)) & ~System::PAGE_MASK;
|
||||||
access.type = System::PageAccessType::READ;
|
access.type = System::PageAccessType::READ;
|
||||||
access.directPokeBase = nullptr;
|
|
||||||
|
|
||||||
for(uInt16 addr = fromAddr; addr < toAddr; addr += System::PAGE_SIZE)
|
for(uInt16 addr = fromAddr; addr < toAddr; addr += System::PAGE_SIZE)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue