2022-04-19 00:07:57 +00:00
|
|
|
#pragma once
|
|
|
|
#include "MemoryHandler.h"
|
|
|
|
#include <Project64-core\Logging.h>
|
2022-10-16 21:57:52 +00:00
|
|
|
#include <Project64-core\N64System\SaveType\Eeprom.h>
|
2022-10-10 00:22:17 +00:00
|
|
|
#include <Project64-core\Settings\DebugSettings.h>
|
2022-04-19 00:07:57 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-10-16 21:57:52 +00:00
|
|
|
class CN64System;
|
2022-04-19 00:07:57 +00:00
|
|
|
class CMipsMemoryVM;
|
|
|
|
class CRegisters;
|
|
|
|
|
|
|
|
class PifRamHandler :
|
|
|
|
public MemoryHandler,
|
|
|
|
private CDebugSettings,
|
|
|
|
private CLogging
|
|
|
|
{
|
|
|
|
public:
|
2022-10-16 21:57:52 +00:00
|
|
|
PifRamHandler(CN64System & System, bool SavesReadOnly);
|
2022-04-19 00:07:57 +00:00
|
|
|
bool Read32(uint32_t Address, uint32_t & Value);
|
|
|
|
bool Write32(uint32_t Address, uint32_t Value, uint32_t Mask);
|
|
|
|
|
2022-10-16 21:57:52 +00:00
|
|
|
void DMA_READ();
|
|
|
|
void DMA_WRITE();
|
|
|
|
|
|
|
|
uint8_t * PifRam(void)
|
|
|
|
{
|
|
|
|
return m_PifRam;
|
|
|
|
}
|
|
|
|
|
2022-04-19 00:07:57 +00:00
|
|
|
private:
|
|
|
|
PifRamHandler();
|
|
|
|
PifRamHandler(const PifRamHandler &);
|
|
|
|
PifRamHandler & operator=(const PifRamHandler &);
|
|
|
|
|
2022-10-16 21:57:52 +00:00
|
|
|
void CicNus6105(const char * Challenge, char response[], int32_t length);
|
|
|
|
void ControlRead();
|
|
|
|
void ControlWrite(void);
|
|
|
|
void LogControllerPakData(const char * Description);
|
|
|
|
void ReadControllerCommand(int32_t Control, uint8_t * Command);
|
|
|
|
void ProcessControllerCommand(int32_t Control, uint8_t * Command);
|
|
|
|
void SystemReset(void);
|
|
|
|
|
2022-04-19 00:07:57 +00:00
|
|
|
static uint32_t swap32by8(uint32_t word);
|
|
|
|
|
2022-10-16 21:57:52 +00:00
|
|
|
static void stSystemReset(PifRamHandler * _this)
|
|
|
|
{
|
|
|
|
_this->SystemReset();
|
|
|
|
}
|
|
|
|
|
2022-04-19 00:07:57 +00:00
|
|
|
CMipsMemoryVM & m_MMU;
|
2022-10-16 21:57:52 +00:00
|
|
|
uint8_t m_PifRom[0x7C0];
|
|
|
|
uint8_t m_PifRam[0x40];
|
2022-04-19 00:07:57 +00:00
|
|
|
uint32_t & m_PC;
|
2022-10-16 21:57:52 +00:00
|
|
|
CEeprom m_Eeprom;
|
2022-04-19 00:07:57 +00:00
|
|
|
};
|