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
|
|
|
|
|
2010-06-14 21:14:58 +00:00
|
|
|
class CPifRamSettings
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
CPifRamSettings();
|
|
|
|
virtual ~CPifRamSettings();
|
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
bool bShowPifRamErrors() const
|
2015-03-29 17:19:28 +00:00
|
|
|
{
|
|
|
|
return m_bShowPifRamErrors;
|
|
|
|
}
|
2010-06-14 21:14:58 +00:00
|
|
|
|
|
|
|
private:
|
2015-04-28 22:19:02 +00:00
|
|
|
static void RefreshSettings(void*);
|
2010-06-14 21:14:58 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
static bool m_bShowPifRamErrors;
|
2010-06-14 21:14:58 +00:00
|
|
|
|
|
|
|
static int m_RefCount;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class CPifRam :
|
|
|
|
private CPifRamSettings,
|
|
|
|
private CEeprom
|
|
|
|
{
|
|
|
|
public:
|
2015-04-28 22:19:02 +00:00
|
|
|
CPifRam(bool SavesReadOnly);
|
|
|
|
~CPifRam();
|
2010-06-14 21:14:58 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
void Reset();
|
2011-01-02 10:40:00 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
void PifRamWrite();
|
|
|
|
void PifRamRead();
|
2010-06-14 21:14:58 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
void SI_DMA_READ();
|
|
|
|
void SI_DMA_WRITE();
|
2010-06-14 21:14:58 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
BYTE m_PifRom[0x7C0];
|
|
|
|
BYTE m_PifRam[0x40];
|
|
|
|
|
|
|
|
private:
|
2012-09-26 10:26:17 +00:00
|
|
|
#define CHALLENGE_LENGTH 0x20
|
2010-06-14 21:14:58 +00:00
|
|
|
void ProcessControllerCommand ( int Control, BYTE * Command );
|
|
|
|
void ReadControllerCommand ( int Control, BYTE * Command );
|
|
|
|
void LogControllerPakData ( char * Description );
|
2015-04-28 22:19:02 +00:00
|
|
|
void n64_cic_nus_6105 (char challenge[], char response[], int length);
|
2015-01-31 19:27:27 +00:00
|
|
|
};
|