[Project64] Use standard types in Eeprom.cpp

This commit is contained in:
zilmar 2015-11-15 13:20:18 +11:00
parent 64e0dae30f
commit d740aaf350
2 changed files with 175 additions and 167 deletions

View File

@ -9,6 +9,9 @@
* * * *
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include "Eeprom.h"
#include <Project64\N64 System\System Globals.h>
#include <Project64\N64 System\N64 Class.h>
#include <time.h> #include <time.h>
CEeprom::CEeprom(bool ReadOnly) : CEeprom::CEeprom(bool ReadOnly) :
@ -27,13 +30,13 @@ CEeprom::~CEeprom()
} }
} }
unsigned char byte2bcd(int n) uint8_t byte2bcd(int32_t n)
{ {
n %= 100; n %= 100;
return (unsigned char)(((n / 10) << 4) | (n % 10)); return (uint8_t)(((n / 10) << 4) | (n % 10));
} }
void CEeprom::EepromCommand ( BYTE * Command) void CEeprom::EepromCommand(uint8_t * Command)
{ {
time_t curtime_time; time_t curtime_time;
struct tm curtime; struct tm curtime;
@ -164,9 +167,9 @@ void CEeprom::LoadEeprom()
ReadFile(m_hFile, m_EEPROM, sizeof(m_EEPROM), &dwRead, NULL); ReadFile(m_hFile, m_EEPROM, sizeof(m_EEPROM), &dwRead, NULL);
} }
void CEeprom::ReadFrom(BYTE * Buffer, int line) void CEeprom::ReadFrom(uint8_t * Buffer, int32_t line)
{ {
int i; int32_t i;
if (m_hFile == NULL) if (m_hFile == NULL)
{ {
@ -179,10 +182,10 @@ void CEeprom::ReadFrom(BYTE * Buffer, int line)
} }
} }
void CEeprom::WriteTo(BYTE * Buffer, int line) void CEeprom::WriteTo(uint8_t * Buffer, int32_t line)
{ {
DWORD dwWritten; DWORD dwWritten;
int i; int32_t i;
if (m_hFile == NULL) if (m_hFile == NULL)
{ {

View File

@ -9,6 +9,7 @@
* * * *
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include <Project64-core/Settings/Debug Settings.h>
class CEeprom : class CEeprom :
private CDebugSettings private CDebugSettings
@ -17,14 +18,18 @@ public:
CEeprom ( bool ReadOnly ); CEeprom ( bool ReadOnly );
~CEeprom(); ~CEeprom();
void EepromCommand ( BYTE * Command ); void EepromCommand ( uint8_t * Command );
private: private:
void LoadEeprom (); CEeprom(void); // Disable default constructor
void ReadFrom ( BYTE * Buffer, int line ); CEeprom(const CEeprom&); // Disable copy constructor
void WriteTo ( BYTE * Buffer, int line ); CEeprom& operator=(const CEeprom&); // Disable assignment
BYTE m_EEPROM[0x800]; void LoadEeprom ();
void ReadFrom ( uint8_t * Buffer, int32_t line );
void WriteTo ( uint8_t * Buffer, int32_t line );
uint8_t m_EEPROM[0x800];
bool m_ReadOnly; bool m_ReadOnly;
HANDLE m_hFile; void * m_hFile;
}; };