2016-01-28 03:02:05 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project64 - 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
|
|
|
|
|
2016-07-07 11:51:06 +00:00
|
|
|
class CMempak
|
2016-01-28 03:02:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-01-20 23:11:14 +00:00
|
|
|
CMempak();
|
|
|
|
|
2016-07-07 11:51:06 +00:00
|
|
|
void ReadFrom(int32_t Control, uint32_t address, uint8_t * data);
|
|
|
|
void WriteTo(int32_t Control, uint32_t address, uint8_t * data);
|
|
|
|
|
2017-01-20 23:11:14 +00:00
|
|
|
static uint8_t CalculateCrc(uint8_t * DataToCrc);
|
|
|
|
|
2016-05-16 08:23:31 +00:00
|
|
|
private:
|
2017-01-20 23:11:14 +00:00
|
|
|
CMempak(const CMempak&); // Disable copy constructor
|
|
|
|
CMempak& operator=(const CMempak&); // Disable assignment
|
|
|
|
|
|
|
|
void LoadMempak(int32_t Control, bool Create);
|
2016-07-07 11:51:06 +00:00
|
|
|
void Format(int32_t Control);
|
|
|
|
|
|
|
|
uint8_t m_Mempaks[4][128 * 256]; /* [CONTROLLERS][PAGES][BYTES_PER_PAGE] */
|
|
|
|
CFile m_MempakHandle[4];
|
2017-01-20 23:11:14 +00:00
|
|
|
bool m_Formatted[4];
|
2017-01-22 08:59:26 +00:00
|
|
|
bool m_SaveExists[4];
|
2016-01-28 03:02:05 +00:00
|
|
|
};
|