Rsp: Move InitilizeRSPRegisters and InitilizeRSP into rsp-core

This commit is contained in:
zilmar 2023-09-21 15:16:26 +09:30
parent 42a944c660
commit 5dcc7e200f
5 changed files with 34 additions and 19 deletions

View File

@ -1,3 +1,24 @@
#include "RSPInfo.h" #include "RSPInfo.h"
#include <Project64-rsp-core/Settings/RspSettings.h>
#include <Project64-rsp-core/Settings/RspSettingsID.h>
#include <Project64-rsp-core/cpu/RSPCpu.h>
#include <Project64-rsp-core/cpu/RSPRegisters.h>
#include <Project64-rsp-core/cpu/RspMemory.h>
#include <Settings/Settings.h>
RSP_INFO RSPInfo; RSP_INFO RSPInfo;
void InitilizeRSP(RSP_INFO & Rsp_Info)
{
RSPInfo = Rsp_Info;
AudioHle = Set_AudioHle != 0 ? GetSystemSetting(Set_AudioHle) != 0 : false;
GraphicsHle = Set_GraphicsHle != 0 ? GetSystemSetting(Set_GraphicsHle) != 0 : true;
AllocateMemory();
InitilizeRSPRegisters();
Build_RSP();
#ifdef GenerateLog
Start_Log();
#endif
}

View File

@ -1,3 +1,5 @@
#include <Project64-plugin-spec/Rsp.h> #include <Project64-plugin-spec/Rsp.h>
extern RSP_INFO RSPInfo; extern RSP_INFO RSPInfo;
void InitilizeRSP(RSP_INFO & Rsp_Info);

View File

@ -1,4 +1,5 @@
#include "cpu/RspTypes.h" #include "cpu/RspTypes.h"
#include <string.h>
// RSP registers // RSP registers
UWORD32 RSP_GPR[32], RSP_Flags[4]; UWORD32 RSP_GPR[32], RSP_Flags[4];
@ -44,6 +45,15 @@ char * GPR_Strings[32] = {
"RA", "RA",
}; };
void InitilizeRSPRegisters(void)
{
memset(RSP_GPR, 0, sizeof(RSP_GPR));
for (size_t i = 0, n = sizeof(RSP_Vect) / sizeof(RSP_Vect[0]); i < n; i++)
{
RSP_Vect[i] = RSPVector();
}
}
int64_t AccumulatorGet(uint8_t el) int64_t AccumulatorGet(uint8_t el)
{ {
return (((int64_t)RSP_ACCUM[el].HW[3]) << 32) | (((int64_t)RSP_ACCUM[el].UHW[2]) << 16) | RSP_ACCUM[el].UHW[1]; return (((int64_t)RSP_ACCUM[el].HW[3]) << 32) | (((int64_t)RSP_ACCUM[el].UHW[2]) << 16) | RSP_ACCUM[el].UHW[1];

View File

@ -111,15 +111,6 @@ void HideRSP_RegisterPanel(int Panel)
} }
} }
void InitilizeRSPRegisters(void)
{
memset(RSP_GPR, 0, sizeof(RSP_GPR));
for (size_t i = 0, n = sizeof(RSP_Vect) / sizeof(RSP_Vect[0]); i < n; i++)
{
RSP_Vect[i] = RSPVector();
}
}
void PaintRSP_HiddenPanel(HWND hWnd) void PaintRSP_HiddenPanel(HWND hWnd)
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;

View File

@ -322,17 +322,8 @@ EXPORT void InitiateRSP(RSP_INFO Rsp_Info, uint32_t * CycleCount)
{ {
g_RSPDebuggerUI.reset(new RSPDebuggerUI); g_RSPDebuggerUI.reset(new RSPDebuggerUI);
g_RSPDebugger = g_RSPDebuggerUI.get(); g_RSPDebugger = g_RSPDebuggerUI.get();
RSPInfo = Rsp_Info; InitilizeRSP(Rsp_Info);
AudioHle = GetSystemSetting(Set_AudioHle) != 0;
GraphicsHle = GetSystemSetting(Set_GraphicsHle) != 0;
*CycleCount = 0; *CycleCount = 0;
AllocateMemory();
InitilizeRSPRegisters();
Build_RSP();
#ifdef GenerateLog
Start_Log();
#endif
} }
/* /*