From b00a4386082584d3ab539f784d68da06add0e14a Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Tue, 17 Sep 2019 09:38:47 +0200 Subject: [PATCH] replace some odd decimal numbers with hexadecimals --- src/emucore/CartCV.hxx | 6 +++--- src/emucore/CartE0.cxx | 6 +++--- src/emucore/CartMNetwork.cxx | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/emucore/CartCV.hxx b/src/emucore/CartCV.hxx index 4b26d87de..9a614c01b 100644 --- a/src/emucore/CartCV.hxx +++ b/src/emucore/CartCV.hxx @@ -137,16 +137,16 @@ class CartridgeCV : public Cartridge private: // The 2k ROM image for the cartridge - std::array myImage; + std::array myImage; // Initial size of the cart data size_t mySize; // The 1024 bytes of RAM - std::array myRAM; + std::array myRAM; // Initial RAM data from the cart (doesn't always exist) - std::array myInitialRAM; + std::array myInitialRAM; private: // Following constructors and assignment operators not supported diff --git a/src/emucore/CartE0.cxx b/src/emucore/CartE0.cxx index 91a41de06..d9ea44902 100644 --- a/src/emucore/CartE0.cxx +++ b/src/emucore/CartE0.cxx @@ -60,14 +60,14 @@ void CartridgeE0::install(System& system) for(uInt16 addr = 0x1C00; addr < (0x1FE0U & ~System::PAGE_MASK); addr += System::PAGE_SIZE) { - access.directPeekBase = &myImage[7168 + (addr & 0x03FF)]; - access.codeAccessBase = &myCodeAccessBase[7168 + (addr & 0x03FF)]; + access.directPeekBase = &myImage[0x1C00 + (addr & 0x03FF)]; + access.codeAccessBase = &myCodeAccessBase[0x1C00 + (addr & 0x03FF)]; mySystem->setPageAccess(addr, access); } // Set the page accessing methods for the hot spots in the last segment access.directPeekBase = nullptr; - access.codeAccessBase = &myCodeAccessBase[8128]; + access.codeAccessBase = &myCodeAccessBase[0x1FC0]; // TJ: is this the correct address (or 0x1FE0)? access.type = System::PageAccessType::READ; for(uInt16 addr = (0x1FE0 & ~System::PAGE_MASK); addr < 0x2000; addr += System::PAGE_SIZE) diff --git a/src/emucore/CartMNetwork.cxx b/src/emucore/CartMNetwork.cxx index 70c403eb3..020f11e29 100644 --- a/src/emucore/CartMNetwork.cxx +++ b/src/emucore/CartMNetwork.cxx @@ -121,7 +121,7 @@ uInt8 CartridgeMNetwork::peek(uInt16 address) else if((address >= 0x0800) && (address <= 0x08FF)) { // Reading from the 256B write port @ $1800 triggers an unwanted write - return peekRAM(myRAM[1024 + (myCurrentRAM << 8) + (address & 0x00FF)], peekAddress); + return peekRAM(myRAM[0x0400 + (myCurrentRAM << 8) + (address & 0x00FF)], peekAddress); } else return myImage[(myCurrentSlice[address >> 11] << 11) + (address & (BANK_SIZE - 1))]; @@ -144,7 +144,7 @@ bool CartridgeMNetwork::poke(uInt16 address, uInt8 value) } else if((address >= 0x0800) && (address <= 0x08FF)) { - pokeRAM(myRAM[1024 + (myCurrentRAM << 8) + (address & 0x00FF)], pokeAddress, value); + pokeRAM(myRAM[0x0400 + (myCurrentRAM << 8) + (address & 0x00FF)], pokeAddress, value); return true; } @@ -162,9 +162,9 @@ void CartridgeMNetwork::bankRAM(uInt16 bank) // Setup the page access methods for the current bank // Set the page accessing method for the 256 bytes of RAM reading pages - setAccess(0x1800, 0x100, 1024 + offset, myRAM.data(), romSize() + BANK_SIZE / 2, System::PageAccessType::WRITE); + setAccess(0x1800, 0x100, 0x0400 + offset, myRAM.data(), romSize() + BANK_SIZE / 2, System::PageAccessType::WRITE); // Set the page accessing method for the 256 bytes of RAM reading pages - setAccess(0x1900, 0x100, 1024 + offset, myRAM.data(), romSize() + BANK_SIZE / 2, System::PageAccessType::READ); + setAccess(0x1900, 0x100, 0x0400 + offset, myRAM.data(), romSize() + BANK_SIZE / 2, System::PageAccessType::READ); myBankChanged = true; } @@ -223,7 +223,7 @@ bool CartridgeMNetwork::patch(uInt16 address, uInt8 value) // Normally, a write to the read port won't do anything // However, the patch command is special in that ignores such // cart restrictions - myRAM[1024 + (myCurrentRAM << 8) + (address & 0x00FF)] = value; + myRAM[0x0400 + (myCurrentRAM << 8) + (address & 0x00FF)] = value; } else myImage[(myCurrentSlice[address >> 11] << 11) + (address & (BANK_SIZE-1))] = value;