From 435761051bc42febaccc407a180614762bc65f8c Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 30 May 2020 17:34:44 -0230 Subject: [PATCH] Add CartCreator to VS project, and fix a few warnings. --- src/common/ZipHandler.hxx | 2 +- src/emucore/Cart.cxx | 4 ++-- src/emucore/CartDetector.cxx | 2 +- src/emucore/MT24LC256.hxx | 6 +++--- src/windows/Stella.vcxproj | 2 ++ src/windows/Stella.vcxproj.filters | 14 ++++++++++---- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/common/ZipHandler.hxx b/src/common/ZipHandler.hxx index 861e1350a..aaf289357 100644 --- a/src/common/ZipHandler.hxx +++ b/src/common/ZipHandler.hxx @@ -297,7 +297,7 @@ class ZipHandler void addToCache(); private: - static constexpr uInt32 DECOMPRESS_BUFSIZE = 16_KB; + static constexpr size_t DECOMPRESS_BUFSIZE = 16_KB; static constexpr uInt32 CACHE_SIZE = 8; // number of open files to cache ZipFilePtr myZip; diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx index f86c81f8c..958b915df 100644 --- a/src/emucore/Cart.cxx +++ b/src/emucore/Cart.cxx @@ -80,10 +80,10 @@ bool Cartridge::bankChanged() uInt16 Cartridge::bankSize(uInt16 bank) const { size_t size; - getImage(size); - return std::min(size / romBankCount(), 4_KB); // assuming that each bank has the same size + return static_cast( + std::min(size / romBankCount(), 4_KB)); // assuming that each bank has the same size } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/CartDetector.cxx b/src/emucore/CartDetector.cxx index 22ad4be9b..0ecc6e82e 100644 --- a/src/emucore/CartDetector.cxx +++ b/src/emucore/CartDetector.cxx @@ -629,7 +629,7 @@ bool CartDetector::isProbablyFA2(const ByteBuffer& image, size_t) // file sizes // 32K version has all zeros in 29K-32K area - for(uInt32 i = 29_KB; i < 32_KB; ++i) + for(size_t i = 29_KB; i < 32_KB; ++i) if(image[i] != 0) return false; diff --git a/src/emucore/MT24LC256.hxx b/src/emucore/MT24LC256.hxx index 2832aef6c..94b894b21 100644 --- a/src/emucore/MT24LC256.hxx +++ b/src/emucore/MT24LC256.hxx @@ -46,9 +46,9 @@ class MT24LC256 public: // Sizes of the EEPROM - static constexpr uInt32 FLASH_SIZE = 32_KB; - static constexpr uInt32 PAGE_SIZE = 64; - static constexpr uInt32 PAGE_NUM = FLASH_SIZE / PAGE_SIZE; + static constexpr size_t FLASH_SIZE = 32_KB; + static constexpr size_t PAGE_SIZE = 64; + static constexpr size_t PAGE_NUM = FLASH_SIZE / PAGE_SIZE; // Initial state value of flash EEPROM static constexpr uInt8 INITIAL_VALUE = 0xff; diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index 97117b637..33abbe73e 100644 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -717,6 +717,7 @@ + @@ -1739,6 +1740,7 @@ + diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters index 2a740137e..ded397f71 100644 --- a/src/windows/Stella.vcxproj.filters +++ b/src/windows/Stella.vcxproj.filters @@ -1008,8 +1008,11 @@ Source Files\emucore - - Source Files\debugger + + Source Files + + + Source Files\emucore @@ -2072,8 +2075,11 @@ Header Files\emucore - - Header Files\debugger + + Header Files + + + Header Files\emucore