[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 "Eeprom.h"
#include <Project64\N64 System\System Globals.h>
#include <Project64\N64 System\N64 Class.h>
#include <time.h>
CEeprom::CEeprom(bool ReadOnly) :
@ -27,13 +30,13 @@ CEeprom::~CEeprom()
}
}
unsigned char byte2bcd(int n)
uint8_t byte2bcd(int32_t n)
{
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;
struct tm curtime;
@ -164,9 +167,9 @@ void CEeprom::LoadEeprom()
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)
{
@ -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;
int i;
int32_t i;
if (m_hFile == NULL)
{

View File

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