/
SPRegistersHandler.h
83 lines (72 loc) · 1.96 KB
/
SPRegistersHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#pragma once
#include "MIPSInterfaceHandler.h"
#include "MemoryHandler.h"
#include <Project64-core\Logging.h>
#include <Project64-core\Settings\DebugSettings.h>
#include <Project64-core\Settings\GameSettings.h>
#include <Project64-rsp-core/cpu/RSPRegisterHandler.h>
#include <stdint.h>
class SPRegistersReg
{
protected:
SPRegistersReg(uint32_t * SignalProcessorInterface);
public:
uint32_t & SP_MEM_ADDR_REG;
uint32_t & SP_DRAM_ADDR_REG;
uint32_t & SP_RD_LEN_REG;
uint32_t & SP_WR_LEN_REG;
uint32_t & SP_STATUS_REG;
uint32_t & SP_DMA_FULL_REG;
uint32_t & SP_DMA_BUSY_REG;
uint32_t & SP_SEMAPHORE_REG;
uint32_t & SP_PC_REG;
uint32_t & SP_IBIST_REG;
private:
SPRegistersReg();
SPRegistersReg(const SPRegistersReg &);
SPRegistersReg & operator=(const SPRegistersReg &);
};
class CRegisters;
class CMipsMemoryVM;
class CN64System;
class SPRegistersHandler :
public MemoryHandler,
private RSPRegisterHandler,
private CGameSettings,
private MIPSInterfaceReg,
private CDebugSettings,
private CLogging
{
public:
SPRegistersHandler(CN64System & N64System, CMipsMemoryVM & MMU, CRegisters & Reg);
bool Read32(uint32_t Address, uint32_t & Value);
bool Write32(uint32_t Address, uint32_t Value, uint32_t Mask);
uint8_t * Imem()
{
return &m_IMEM[0];
}
uint8_t * Dmem()
{
return &m_DMEM[0];
}
private:
SPRegistersHandler();
SPRegistersHandler(const SPRegistersHandler &);
SPRegistersHandler & operator=(const SPRegistersHandler &);
static void stSystemReset(SPRegistersHandler * _this)
{
_this->SystemReset();
}
void ClearSPInterrupt(void);
void SetSPInterrupt(void);
void SetHalt(void);
void DmaReadDone(uint32_t End);
void SystemReset(void);
uint8_t m_IMEM[0x1000];
uint8_t m_DMEM[0x1000];
CN64System & m_System;
CMipsMemoryVM & m_MMU;
CRegisters & m_Reg;
uint32_t & m_RspIntrReg;
uint32_t & m_PC;
};