project64/Source/Project64-core/N64System/MemoryHandler/PifRamHandler.h

55 lines
1.4 KiB
C
Raw Normal View History

2022-04-19 00:07:57 +00:00
#pragma once
#include "MemoryHandler.h"
#include <Project64-core\Logging.h>
#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>
class CN64System;
2022-04-19 00:07:57 +00:00
class CMipsMemoryVM;
class CRegisters;
class PifRamHandler :
public MemoryHandler,
private CDebugSettings,
private CLogging
{
public:
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);
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 &);
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);
static void stSystemReset(PifRamHandler * _this)
{
_this->SystemReset();
}
2022-04-19 00:07:57 +00:00
CMipsMemoryVM & m_MMU;
uint8_t m_PifRom[0x7C0];
uint8_t m_PifRam[0x40];
2022-04-19 00:07:57 +00:00
uint32_t & m_PC;
CEeprom m_Eeprom;
2022-04-19 00:07:57 +00:00
};