[Project64] Clean up Section Info.cpp, x86CodeLog.cpp, plugins

This commit is contained in:
zilmar 2015-11-10 07:26:33 +11:00
parent dda79ce345
commit eef290f767
6 changed files with 116 additions and 113 deletions

View File

@ -12,8 +12,8 @@
CJumpInfo::CJumpInfo()
{
TargetPC = (DWORD)-1;
JumpPC = (DWORD)-1;
TargetPC = (uint32_t)-1;
JumpPC = (uint32_t)-1;
BranchLabel = "";
LinkLocation = NULL;
LinkLocation2 = NULL;
@ -25,7 +25,7 @@ CJumpInfo::CJumpInfo()
#ifdef tofix
bool CCodeSection::IsAllParentLoops(CCodeSection * Parent, bool IgnoreIfCompiled, DWORD Test)
bool CCodeSection::IsAllParentLoops(CCodeSection * Parent, bool IgnoreIfCompiled, uint32_t Test)
{
if (IgnoreIfCompiled && Parent->CompiledLocation != NULL) { return true; }
if (!InLoop) { return false; }
@ -132,9 +132,9 @@ CCodeSection::~CCodeSection()
}
}
DWORD CCodeSection::GetNewTestValue()
uint32_t CCodeSection::GetNewTestValue()
{
static DWORD LastTest = 0;
static uint32_t LastTest = 0;
if (LastTest == 0xFFFFFFFF) { LastTest = 0; }
LastTest += 1;
return LastTest;
@ -149,7 +149,6 @@ void CRegInfo::Initialize()
for (count = 1; count < 32; count ++ ) {
MIPS_RegState[count] = STATE_UNKNOWN;
MIPS_RegVal[count].DW = 0;
}
for (count = 0; count < 10; count ++ ) {
x86reg_MappedTo[count] = NotMapped;
@ -170,4 +169,3 @@ void CRegInfo::Initialize()
}
#endif

View File

@ -12,8 +12,10 @@
class CCodeSection;
class CCodeBlock;
struct CJumpInfo;
struct BLOCK_PARENT {
struct BLOCK_PARENT
{
CCodeSection * Parent;
CJumpInfo * JumpInfo;
};

View File

@ -13,7 +13,8 @@
static HANDLE hCPULogFile = NULL;
bool bX86Logging = false;
void x86_Log_Message (const char * Message, ...) {
void x86_Log_Message (const char * Message, ...)
{
DWORD dwWritten;
char Msg[400];
@ -27,8 +28,8 @@ void x86_Log_Message (const char * Message, ...) {
WriteFile( hCPULogFile,Msg,strlen(Msg),&dwWritten,NULL );
}
void Start_x86_Log (void) {
void Start_x86_Log (void)
{
CPath LogFileName(CPath::MODULE_DIRECTORY);
LogFileName.AppendDirectory("Logs");
LogFileName.SetNameExtension("CPUoutput.log");
@ -43,8 +44,10 @@ void Start_x86_Log (void) {
}
}
void Stop_x86_Log (void) {
if (hCPULogFile) {
void Stop_x86_Log (void)
{
if (hCPULogFile)
{
CloseHandle(hCPULogFile);
hCPULogFile = NULL;
bX86Logging = false;

View File

@ -119,13 +119,13 @@ bool CAudioPlugin::Initiate(CN64System * System, CMainGui * RenderWindow)
Info.RDRAM = g_MMU->Rdram();
Info.DMEM = g_MMU->Dmem();
Info.IMEM = g_MMU->Imem();
Info.MI__INTR_REG = (uint32_t *)&g_Reg->m_AudioIntrReg;
Info.AI__DRAM_ADDR_REG = (uint32_t *)&g_Reg->AI_DRAM_ADDR_REG;
Info.AI__LEN_REG = (uint32_t *)&g_Reg->AI_LEN_REG;
Info.AI__CONTROL_REG = (uint32_t *)&g_Reg->AI_CONTROL_REG;
Info.AI__STATUS_REG = (uint32_t *)&g_Reg->AI_STATUS_REG;
Info.AI__DACRATE_REG = (uint32_t *)&g_Reg->AI_DACRATE_REG;
Info.AI__BITRATE_REG = (uint32_t *)&g_Reg->AI_BITRATE_REG;
Info.MI__INTR_REG = &g_Reg->m_AudioIntrReg;
Info.AI__DRAM_ADDR_REG = &g_Reg->AI_DRAM_ADDR_REG;
Info.AI__LEN_REG = &g_Reg->AI_LEN_REG;
Info.AI__CONTROL_REG = &g_Reg->AI_CONTROL_REG;
Info.AI__STATUS_REG = &g_Reg->AI_STATUS_REG;
Info.AI__DACRATE_REG = &g_Reg->AI_DACRATE_REG;
Info.AI__BITRATE_REG = &g_Reg->AI_BITRATE_REG;
}
m_Initialized = InitiateAudio(Info) != 0;

View File

@ -191,29 +191,29 @@ bool CGfxPlugin::Initiate(CN64System * System, CMainGui * RenderWindow)
Info.RDRAM = g_MMU->Rdram();
Info.DMEM = g_MMU->Dmem();
Info.IMEM = g_MMU->Imem();
Info.MI__INTR_REG = (uint32_t *)&g_Reg->m_GfxIntrReg;
Info.DPC__START_REG = (uint32_t *)&g_Reg->DPC_START_REG;
Info.DPC__END_REG = (uint32_t *)&g_Reg->DPC_END_REG;
Info.DPC__CURRENT_REG = (uint32_t *)&g_Reg->DPC_CURRENT_REG;
Info.DPC__STATUS_REG = (uint32_t *)&g_Reg->DPC_STATUS_REG;
Info.DPC__CLOCK_REG = (uint32_t *)&g_Reg->DPC_CLOCK_REG;
Info.DPC__BUFBUSY_REG = (uint32_t *)&g_Reg->DPC_BUFBUSY_REG;
Info.DPC__PIPEBUSY_REG = (uint32_t *)&g_Reg->DPC_PIPEBUSY_REG;
Info.DPC__TMEM_REG = (uint32_t *)&g_Reg->DPC_TMEM_REG;
Info.VI__STATUS_REG = (uint32_t *)&g_Reg->VI_STATUS_REG;
Info.VI__ORIGIN_REG = (uint32_t *)&g_Reg->VI_ORIGIN_REG;
Info.VI__WIDTH_REG = (uint32_t *)&g_Reg->VI_WIDTH_REG;
Info.VI__INTR_REG = (uint32_t *)&g_Reg->VI_INTR_REG;
Info.VI__V_CURRENT_LINE_REG = (uint32_t *)&g_Reg->VI_CURRENT_REG;
Info.VI__TIMING_REG = (uint32_t *)&g_Reg->VI_TIMING_REG;
Info.VI__V_SYNC_REG = (uint32_t *)&g_Reg->VI_V_SYNC_REG;
Info.VI__H_SYNC_REG = (uint32_t *)&g_Reg->VI_H_SYNC_REG;
Info.VI__LEAP_REG = (uint32_t *)&g_Reg->VI_LEAP_REG;
Info.VI__H_START_REG = (uint32_t *)&g_Reg->VI_H_START_REG;
Info.VI__V_START_REG = (uint32_t *)&g_Reg->VI_V_START_REG;
Info.VI__V_BURST_REG = (uint32_t *)&g_Reg->VI_V_BURST_REG;
Info.VI__X_SCALE_REG = (uint32_t *)&g_Reg->VI_X_SCALE_REG;
Info.VI__Y_SCALE_REG = (uint32_t *)&g_Reg->VI_Y_SCALE_REG;
Info.MI__INTR_REG = &g_Reg->m_GfxIntrReg;
Info.DPC__START_REG = &g_Reg->DPC_START_REG;
Info.DPC__END_REG = &g_Reg->DPC_END_REG;
Info.DPC__CURRENT_REG = &g_Reg->DPC_CURRENT_REG;
Info.DPC__STATUS_REG = &g_Reg->DPC_STATUS_REG;
Info.DPC__CLOCK_REG = &g_Reg->DPC_CLOCK_REG;
Info.DPC__BUFBUSY_REG = &g_Reg->DPC_BUFBUSY_REG;
Info.DPC__PIPEBUSY_REG = &g_Reg->DPC_PIPEBUSY_REG;
Info.DPC__TMEM_REG = &g_Reg->DPC_TMEM_REG;
Info.VI__STATUS_REG = &g_Reg->VI_STATUS_REG;
Info.VI__ORIGIN_REG = &g_Reg->VI_ORIGIN_REG;
Info.VI__WIDTH_REG = &g_Reg->VI_WIDTH_REG;
Info.VI__INTR_REG = &g_Reg->VI_INTR_REG;
Info.VI__V_CURRENT_LINE_REG = &g_Reg->VI_CURRENT_REG;
Info.VI__TIMING_REG = &g_Reg->VI_TIMING_REG;
Info.VI__V_SYNC_REG = &g_Reg->VI_V_SYNC_REG;
Info.VI__H_SYNC_REG = &g_Reg->VI_H_SYNC_REG;
Info.VI__LEAP_REG = &g_Reg->VI_LEAP_REG;
Info.VI__H_START_REG = &g_Reg->VI_H_START_REG;
Info.VI__V_START_REG = &g_Reg->VI_V_START_REG;
Info.VI__V_BURST_REG = &g_Reg->VI_V_BURST_REG;
Info.VI__X_SCALE_REG = &g_Reg->VI_X_SCALE_REG;
Info.VI__Y_SCALE_REG = &g_Reg->VI_Y_SCALE_REG;
}
m_Initialized = InitiateGFX(Info) != 0;

View File

@ -161,26 +161,26 @@ bool CRSP_Plugin::Initiate(CPlugins * Plugins, CN64System * System)
Info.DMEM = g_MMU->Dmem();
Info.IMEM = g_MMU->Imem();
Info.MI__INTR_REG = (uint32_t *)&g_Reg->m_RspIntrReg;
Info.MI__INTR_REG = &g_Reg->m_RspIntrReg;
Info.SP__MEM_ADDR_REG = (uint32_t *)&g_Reg->SP_MEM_ADDR_REG;
Info.SP__DRAM_ADDR_REG = (uint32_t *)&g_Reg->SP_DRAM_ADDR_REG;
Info.SP__RD_LEN_REG = (uint32_t *)&g_Reg->SP_RD_LEN_REG;
Info.SP__WR_LEN_REG = (uint32_t *)&g_Reg->SP_WR_LEN_REG;
Info.SP__STATUS_REG = (uint32_t *)&g_Reg->SP_STATUS_REG;
Info.SP__DMA_FULL_REG = (uint32_t *)&g_Reg->SP_DMA_FULL_REG;
Info.SP__DMA_BUSY_REG = (uint32_t *)&g_Reg->SP_DMA_BUSY_REG;
Info.SP__PC_REG = (uint32_t *)&g_Reg->SP_PC_REG;
Info.SP__SEMAPHORE_REG = (uint32_t *)&g_Reg->SP_SEMAPHORE_REG;
Info.SP__MEM_ADDR_REG = &g_Reg->SP_MEM_ADDR_REG;
Info.SP__DRAM_ADDR_REG = &g_Reg->SP_DRAM_ADDR_REG;
Info.SP__RD_LEN_REG = &g_Reg->SP_RD_LEN_REG;
Info.SP__WR_LEN_REG = &g_Reg->SP_WR_LEN_REG;
Info.SP__STATUS_REG = &g_Reg->SP_STATUS_REG;
Info.SP__DMA_FULL_REG = &g_Reg->SP_DMA_FULL_REG;
Info.SP__DMA_BUSY_REG = &g_Reg->SP_DMA_BUSY_REG;
Info.SP__PC_REG = &g_Reg->SP_PC_REG;
Info.SP__SEMAPHORE_REG = &g_Reg->SP_SEMAPHORE_REG;
Info.DPC__START_REG = (uint32_t *)&g_Reg->DPC_START_REG;
Info.DPC__END_REG = (uint32_t *)&g_Reg->DPC_END_REG;
Info.DPC__CURRENT_REG = (uint32_t *)&g_Reg->DPC_CURRENT_REG;
Info.DPC__STATUS_REG = (uint32_t *)&g_Reg->DPC_STATUS_REG;
Info.DPC__CLOCK_REG = (uint32_t *)&g_Reg->DPC_CLOCK_REG;
Info.DPC__BUFBUSY_REG = (uint32_t *)&g_Reg->DPC_BUFBUSY_REG;
Info.DPC__PIPEBUSY_REG = (uint32_t *)&g_Reg->DPC_PIPEBUSY_REG;
Info.DPC__TMEM_REG = (uint32_t *)&g_Reg->DPC_TMEM_REG;
Info.DPC__START_REG = &g_Reg->DPC_START_REG;
Info.DPC__END_REG = &g_Reg->DPC_END_REG;
Info.DPC__CURRENT_REG = &g_Reg->DPC_CURRENT_REG;
Info.DPC__STATUS_REG = &g_Reg->DPC_STATUS_REG;
Info.DPC__CLOCK_REG = &g_Reg->DPC_CLOCK_REG;
Info.DPC__BUFBUSY_REG = &g_Reg->DPC_BUFBUSY_REG;
Info.DPC__PIPEBUSY_REG = &g_Reg->DPC_PIPEBUSY_REG;
Info.DPC__TMEM_REG = &g_Reg->DPC_TMEM_REG;
}
InitiateRSP(Info, &m_CycleCount);