From ef962e53ef3f42334f4ac98823afc81a97a776b5 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Mon, 31 Aug 2020 14:17:12 +0200 Subject: [PATCH 1/3] micro typo --- docs/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index 65e416468..ffb2c5c55 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3624,7 +3624,7 @@ -dev.rwportbreak - Break on write to ... + Break on writes to ... A write to a read port interrupts emulation and the debugger is entered. -dev.wrportbreak From cf2922a2b18c6dcbb5a207bac102b623a8fa76a7 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Tue, 1 Sep 2020 07:52:21 +0200 Subject: [PATCH 2/3] fixes #695 (wrong RWPs) (directPokeBase must NOT be set! (partially reverts b264e7634 and 5568dd300) --- src/emucore/CartEnhanced.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/emucore/CartEnhanced.cxx b/src/emucore/CartEnhanced.cxx index 633104cf3..b401da819 100644 --- a/src/emucore/CartEnhanced.cxx +++ b/src/emucore/CartEnhanced.cxx @@ -91,14 +91,12 @@ void CartridgeEnhanced::install(System& system) System::PageAccess access(this, System::PageAccessType::READ); // Set the page accessing method for the RAM writing pages - // Map access to this class, since we need to inspect all accesses to - // check if RWP happens + // Note: Writes are mapped to poke() (NOT using direcPokeBase) to check for read from write port (RWP) access.type = System::PageAccessType::WRITE; for(uInt16 addr = ROM_OFFSET + myWriteOffset; addr < ROM_OFFSET + myWriteOffset + myRamSize; addr += System::PAGE_SIZE) { const uInt16 offset = addr & myRamMask; - access.directPokeBase = &myRAM[offset]; access.romAccessBase = &myRomAccessBase[myWriteOffset + offset]; access.romPeekCounter = &myRomAccessCounter[myWriteOffset + offset]; 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 access.type = System::PageAccessType::READ; - access.directPokeBase = nullptr; for(uInt16 addr = ROM_OFFSET + myReadOffset; addr < ROM_OFFSET + myReadOffset + myRamSize; addr += System::PAGE_SIZE) { const uInt16 offset = addr & myRamMask; @@ -263,6 +260,7 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment) myCurrentSegOffset[segment] = uInt32(mySize) + (ramBank << myBankShift); // 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 toAddr = (ROM_OFFSET + segmentOffset + myWriteOffset + (myBankSize >> 1)) & ~System::PAGE_MASK; System::PageAccess access(this, System::PageAccessType::WRITE); @@ -271,7 +269,6 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment) { const uInt32 offset = bankOffset + (addr & myRamMask); - access.directPokeBase = &myRAM[offset - mySize]; access.romAccessBase = &myRomAccessBase[offset]; access.romPeekCounter = &myRomAccessCounter[offset]; access.romPokeCounter = &myRomAccessCounter[offset + myAccessSize]; @@ -282,7 +279,6 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment) fromAddr = (ROM_OFFSET + segmentOffset + myReadOffset) & ~System::PAGE_MASK; toAddr = (ROM_OFFSET + segmentOffset + myReadOffset + (myBankSize >> 1)) & ~System::PAGE_MASK; access.type = System::PageAccessType::READ; - access.directPokeBase = nullptr; for(uInt16 addr = fromAddr; addr < toAddr; addr += System::PAGE_SIZE) { From 93e1d0945cddc9e42a7345d5500848003cae7dec Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Tue, 1 Sep 2020 08:01:09 +0200 Subject: [PATCH 3/3] fixed 3E+ peeks and pokes (using 3E code now) --- src/emucore/Cart3EPlus.cxx | 25 ------------------------- src/emucore/Cart3EPlus.hxx | 17 ----------------- 2 files changed, 42 deletions(-) diff --git a/src/emucore/Cart3EPlus.cxx b/src/emucore/Cart3EPlus.cxx index 2233b0d71..41f3ef21b 100644 --- a/src/emucore/Cart3EPlus.cxx +++ b/src/emucore/Cart3EPlus.cxx @@ -59,28 +59,3 @@ bool Cartridge3EPlus::checkSwitchBank(uInt16 address, uInt8 value) } 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; -} diff --git a/src/emucore/Cart3EPlus.hxx b/src/emucore/Cart3EPlus.hxx index bdb8f85f5..d09a445ce 100644 --- a/src/emucore/Cart3EPlus.hxx +++ b/src/emucore/Cart3EPlus.hxx @@ -124,23 +124,6 @@ class Cartridge3EPlus: public Cartridge3E } #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: bool checkSwitchBank(uInt16 address, uInt8 value) override;