From 3ba0f072ce948be4e628283bf6151b0dca36d752 Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 5 Jan 2016 07:34:16 +1100 Subject: [PATCH] [Project64] Flashram to use standard types --- Source/Project64-core/N64System/Mips/FlashRam.cpp | 8 ++++---- Source/Project64-core/N64System/Mips/FlashRam.h | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/Project64-core/N64System/Mips/FlashRam.cpp b/Source/Project64-core/N64System/Mips/FlashRam.cpp index 2b524dc63..ef8478563 100644 --- a/Source/Project64-core/N64System/Mips/FlashRam.cpp +++ b/Source/Project64-core/N64System/Mips/FlashRam.cpp @@ -34,7 +34,7 @@ CFlashram::~CFlashram() } } -void CFlashram::DmaFromFlashram(uint8_t * dest, int StartOffset, int len) +void CFlashram::DmaFromFlashram(uint8_t * dest, int32_t StartOffset, int32_t len) { uint8_t FlipBuffer[0x10000]; uint32_t count; @@ -70,12 +70,12 @@ void CFlashram::DmaFromFlashram(uint8_t * dest, int StartOffset, int len) SetFilePointer(m_hFile, StartOffset, NULL, FILE_BEGIN); DWORD dwRead; ReadFile(m_hFile, FlipBuffer, len, &dwRead, NULL); - for (count = dwRead; (int)count < len; count++) + for (count = dwRead; (int32_t)count < len; count++) { FlipBuffer[count] = 0xFF; } - for (count = 0; (int)count < len; count += 4) + for (count = 0; (int32_t)count < len; count += 4) { register uint32_t eax; @@ -103,7 +103,7 @@ void CFlashram::DmaFromFlashram(uint8_t * dest, int StartOffset, int len) } } -void CFlashram::DmaToFlashram(uint8_t * Source, int StartOffset, int len) +void CFlashram::DmaToFlashram(uint8_t * Source, int32_t StartOffset, int32_t len) { switch (m_FlashFlag) { diff --git a/Source/Project64-core/N64System/Mips/FlashRam.h b/Source/Project64-core/N64System/Mips/FlashRam.h index 48c339666..f30944460 100644 --- a/Source/Project64-core/N64System/Mips/FlashRam.h +++ b/Source/Project64-core/N64System/Mips/FlashRam.h @@ -27,12 +27,16 @@ public: CFlashram(bool ReadOnly); ~CFlashram(); - void DmaFromFlashram(uint8_t * dest, int StartOffset, int len); - void DmaToFlashram(uint8_t * Source, int StartOffset, int len); + void DmaFromFlashram(uint8_t * dest, int32_t StartOffset, int32_t len); + void DmaToFlashram(uint8_t * Source, int32_t StartOffset, int32_t len); uint32_t ReadFromFlashStatus(uint32_t PAddr); void WriteToFlashCommand(uint32_t Value); private: + CFlashram(void); // Disable default constructor + CFlashram(const CFlashram&); // Disable copy constructor + CFlashram& operator=(const CFlashram&); // Disable assignment + bool LoadFlashram(); uint8_t * m_FlashRamPointer;