2012-12-19 09:30:18 +00:00
|
|
|
#pragma once
|
2015-12-06 09:59:58 +00:00
|
|
|
#include <Project64-core/Settings/DebugSettings.h>
|
2012-12-19 09:30:18 +00:00
|
|
|
|
2013-03-22 05:47:20 +00:00
|
|
|
class CFlashram :
|
2015-12-13 07:10:40 +00:00
|
|
|
private CDebugSettings
|
2010-06-22 20:36:28 +00:00
|
|
|
{
|
2015-12-13 07:10:40 +00:00
|
|
|
enum Modes
|
|
|
|
{
|
|
|
|
FLASHRAM_MODE_NOPES = 0,
|
|
|
|
FLASHRAM_MODE_ERASE = 1,
|
|
|
|
FLASHRAM_MODE_WRITE = 2,
|
|
|
|
FLASHRAM_MODE_READ = 3,
|
|
|
|
FLASHRAM_MODE_STATUS = 4,
|
|
|
|
};
|
2010-06-22 20:36:28 +00:00
|
|
|
|
|
|
|
public:
|
2015-12-13 07:10:40 +00:00
|
|
|
CFlashram(bool ReadOnly);
|
|
|
|
~CFlashram();
|
2010-06-22 20:36:28 +00:00
|
|
|
|
2016-01-04 20:34:16 +00:00
|
|
|
void DmaFromFlashram(uint8_t * dest, int32_t StartOffset, int32_t len);
|
|
|
|
void DmaToFlashram(uint8_t * Source, int32_t StartOffset, int32_t len);
|
2015-12-13 07:10:40 +00:00
|
|
|
uint32_t ReadFromFlashStatus(uint32_t PAddr);
|
|
|
|
void WriteToFlashCommand(uint32_t Value);
|
2010-06-22 20:36:28 +00:00
|
|
|
|
|
|
|
private:
|
2021-04-13 00:07:11 +00:00
|
|
|
CFlashram(void);
|
|
|
|
CFlashram(const CFlashram&);
|
|
|
|
CFlashram& operator=(const CFlashram&);
|
2016-01-04 20:34:16 +00:00
|
|
|
|
2015-12-06 09:59:58 +00:00
|
|
|
bool LoadFlashram();
|
2010-06-22 20:36:28 +00:00
|
|
|
|
2015-12-06 09:59:58 +00:00
|
|
|
uint8_t * m_FlashRamPointer;
|
|
|
|
Modes m_FlashFlag;
|
|
|
|
uint64_t m_FlashStatus;
|
|
|
|
uint32_t m_FlashRAM_Offset;
|
|
|
|
bool m_ReadOnly;
|
2016-04-11 08:28:18 +00:00
|
|
|
CFile m_File;
|
2010-06-22 20:36:28 +00:00
|
|
|
};
|