2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project 64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
|
2013-03-22 05:47:20 +00:00
|
|
|
class CFlashram :
|
|
|
|
private CDebugSettings
|
2010-06-22 20:36:28 +00:00
|
|
|
{
|
2015-03-29 17:19:28 +00:00
|
|
|
enum Modes
|
|
|
|
{
|
2010-06-22 20:36:28 +00:00
|
|
|
FLASHRAM_MODE_NOPES = 0,
|
|
|
|
FLASHRAM_MODE_ERASE = 1,
|
|
|
|
FLASHRAM_MODE_WRITE = 2,
|
|
|
|
FLASHRAM_MODE_READ = 3,
|
|
|
|
FLASHRAM_MODE_STATUS = 4,
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2015-04-28 22:19:02 +00:00
|
|
|
CFlashram(bool ReadOnly);
|
|
|
|
~CFlashram();
|
2010-06-22 20:36:28 +00:00
|
|
|
|
|
|
|
void DmaFromFlashram ( BYTE * dest, int StartOffset, int len );
|
|
|
|
void DmaToFlashram ( BYTE * Source, int StartOffset, int len );
|
|
|
|
DWORD ReadFromFlashStatus ( DWORD PAddr );
|
|
|
|
void WriteToFlashCommand ( DWORD Value );
|
|
|
|
|
|
|
|
private:
|
2015-04-28 22:19:02 +00:00
|
|
|
bool LoadFlashram();
|
2010-06-22 20:36:28 +00:00
|
|
|
|
|
|
|
BYTE * m_FlashRamPointer;
|
|
|
|
Modes m_FlashFlag;
|
|
|
|
QWORD m_FlashStatus;
|
|
|
|
DWORD m_FlashRAM_Offset;
|
|
|
|
bool m_ReadOnly;
|
|
|
|
HANDLE m_hFile;
|
|
|
|
};
|