From 9e5b1f9c07292312d22e9d920aa9382ab036c629 Mon Sep 17 00:00:00 2001 From: Frank-74 Date: Tue, 1 Jan 2019 22:51:15 +0000 Subject: [PATCH 1/5] Update .gitignore Ignore created Package folder for package_zip.cmd --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 36e36b22e..819e238e6 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ Thumbs.db /Config/Project64.sc3 /Config/Project64.zcache /ipch +/Package /Plugin/Audio/AndroidAudio.dll /Plugin/Audio/AndroidAudio_d.dll /Plugin/Audio/Project64-Audio.dll From 707e4a5fdd2688c2c15e681a538aa09c47e5c108 Mon Sep 17 00:00:00 2001 From: shygoo Date: Thu, 3 Jan 2019 15:20:20 -0600 Subject: [PATCH 2/5] [Debugger] Add step-over button to dlg resize map and fix tooltip (fix #1541) --- Source/Project64/UserInterface/Debugger/Debugger-Commands.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Commands.h b/Source/Project64/UserInterface/Debugger/Debugger-Commands.h index 12c5ef9cc..6b66fe6df 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Commands.h +++ b/Source/Project64/UserInterface/Debugger/Debugger-Commands.h @@ -131,6 +131,7 @@ private: BEGIN_DLGRESIZE_MAP(CDebugCommandsView) DLGRESIZE_CONTROL(IDC_GO_BTN, DLSZ_MOVE_X) DLGRESIZE_CONTROL(IDC_STEP_BTN, DLSZ_MOVE_X) + DLGRESIZE_CONTROL(IDC_STEPOVER_BTN, DLSZ_MOVE_X) DLGRESIZE_CONTROL(IDC_SKIP_BTN, DLSZ_MOVE_X) DLGRESIZE_CONTROL(IDC_ADDR_EDIT, DLSZ_MOVE_X) DLGRESIZE_CONTROL(IDC_SYMBOLS_BTN, DLSZ_MOVE_X) @@ -152,7 +153,7 @@ private: BEGIN_TOOLTIP_MAP() TOOLTIP(IDC_SKIP_BTN, "Skip (F1)") TOOLTIP(IDC_STEP_BTN, "Step (F2)") - TOOLTIP(IDC_STEP_BTN, "Step Over (F3)") + TOOLTIP(IDC_STEPOVER_BTN, "Step Over (F3)") TOOLTIP(IDC_GO_BTN, "Go (F4)") TOOLTIP(IDC_ADDBP_BTN, "Add breakpoint...") TOOLTIP(IDC_RMBP_BTN, "Remove selected breakpoint") From 7ef9b19dc96479c5fe433118c315fe2fdffee0c0 Mon Sep 17 00:00:00 2001 From: shygoo Date: Sat, 5 Jan 2019 19:55:26 -0600 Subject: [PATCH 3/5] [Debugger] Improve OpInfo::ReadsGPR/WritesGPR --- .../Project64/UserInterface/Debugger/OpInfo.h | 171 +++++++++--------- 1 file changed, 89 insertions(+), 82 deletions(-) diff --git a/Source/Project64/UserInterface/Debugger/OpInfo.h b/Source/Project64/UserInterface/Debugger/OpInfo.h index 685a7887a..c36173d47 100644 --- a/Source/Project64/UserInterface/Debugger/OpInfo.h +++ b/Source/Project64/UserInterface/Debugger/OpInfo.h @@ -179,64 +179,83 @@ public: { uint32_t op = m_OpCode.op; - if (op >= R4300i_LDL && op <= R4300i_LWU || - op >= R4300i_ADDI && op <= R4300i_XORI || - op == R4300i_LD || - op == R4300i_BGTZ || op == R4300i_BGTZL || - op == R4300i_BLEZ || op == R4300i_BLEZL) - { - if (m_OpCode.rs == nReg) - { - return true; - } - } - - if (op >= R4300i_SB && op <= R4300i_SWR || - op >= R4300i_SC && op <= R4300i_SD || - op == R4300i_BEQ || op == R4300i_BEQL || - op == R4300i_BNE || op == R4300i_BNEL) - { - // stores read value and index - if (m_OpCode.rs == nReg || m_OpCode.rt == nReg) - { - return true; - } - } - if (op == R4300i_SPECIAL) { uint32_t fn = m_OpCode.funct; - switch (fn) + if (m_OpCode.rs == nReg || m_OpCode.rt == nReg) { - case R4300i_SPECIAL_MTLO: - case R4300i_SPECIAL_MTHI: - case R4300i_SPECIAL_JR: - case R4300i_SPECIAL_JALR: + if (fn >= R4300i_SPECIAL_SLLV && fn <= R4300i_SPECIAL_SRAV || + fn >= R4300i_SPECIAL_DSLLV && fn <= R4300i_SPECIAL_DSRAV || + fn >= R4300i_SPECIAL_MULT && fn <= R4300i_SPECIAL_TNE) + { + return true; + } + if (m_OpCode.rs == nReg) { - return true; + if (fn == R4300i_SPECIAL_MTLO || fn == R4300i_SPECIAL_MTHI || + fn == R4300i_SPECIAL_JR || fn == R4300i_SPECIAL_JALR) + { + return true; + } } - break; - case R4300i_SPECIAL_SLL: - case R4300i_SPECIAL_SRL: - case R4300i_SPECIAL_SRA: + if (m_OpCode.rt == nReg) { - return true; + if (fn >= R4300i_SPECIAL_SLL && fn <= R4300i_SPECIAL_SRA || + fn >= R4300i_SPECIAL_DSLL && fn <= R4300i_SPECIAL_DSRA32) + { + return true; + } } - break; } - - if (fn >= R4300i_SPECIAL_SLLV && fn <= R4300i_SPECIAL_SRAV || - fn >= R4300i_SPECIAL_DSLLV && fn <= R4300i_SPECIAL_DSRAV || - fn >= R4300i_SPECIAL_DIVU && fn <= R4300i_SPECIAL_DSUBU) + } + else + { + if (m_OpCode.rs == nReg || m_OpCode.rt == nReg) { - // two register operands - if (m_OpCode.rt == nReg || m_OpCode.rs == nReg) + if (op >= R4300i_SB && op <= R4300i_SWR || + op >= R4300i_SC && op <= R4300i_SD || + op == R4300i_BEQ || op == R4300i_BEQL || + op == R4300i_BNE || op == R4300i_BNEL) { return true; } + + if (m_OpCode.rs == nReg) + { + if (op == R4300i_REGIMM) + { + return true; + } + + if (op >= R4300i_BLEZL && op <= R4300i_LWU || + op >= R4300i_BLEZ && op <= R4300i_XORI || + op >= R4300i_CACHE && op <= R4300i_LD || + op == R4300i_SWC1 || op == R4300i_SDC1) + { + return true; + } + } + + if (m_OpCode.rt == nReg) + { + if (op == R4300i_CP0 && m_OpCode.fmt == R4300i_COP0_MT) + { + return true; + } + + if (op == R4300i_CP1) + { + if (m_OpCode.fmt == R4300i_COP1_MT || + m_OpCode.fmt == R4300i_COP1_DMT || + m_OpCode.fmt == R4300i_COP1_CT) + { + return true; + } + } + } } } @@ -247,55 +266,43 @@ public: { uint32_t op = m_OpCode.op; - if (op >= R4300i_LDL && op <= R4300i_LWU || - op >= R4300i_ADDI && op <= R4300i_XORI || - op == R4300i_LUI || op == R4300i_LD) - { - // loads write value - if (m_OpCode.rt == nReg) - { - return true; - } - } - - if (op == R4300i_JAL) - { - if (nReg == 31) // RA - { - return true; - } - } - if (op == R4300i_SPECIAL) { - uint32_t fn = m_OpCode.funct; - - switch (fn) + if (m_OpCode.rd == nReg) { - case R4300i_SPECIAL_MFLO: - case R4300i_SPECIAL_MFHI: - case R4300i_SPECIAL_SLL: - case R4300i_SPECIAL_SRL: - case R4300i_SPECIAL_SRA: - if (m_OpCode.rd == nReg) - { - return true; - } - break; - } + uint32_t fn = m_OpCode.funct; - if (fn >= R4300i_SPECIAL_SLLV && fn <= R4300i_SPECIAL_SRAV || - fn >= R4300i_SPECIAL_DSLLV && fn <= R4300i_SPECIAL_DSRAV || - fn >= R4300i_SPECIAL_DIVU && fn <= R4300i_SPECIAL_DSUBU || - fn == R4300i_SPECIAL_JALR) - { - // result register - if (m_OpCode.rd == nReg) + if (fn >= R4300i_SPECIAL_SLL && fn <= R4300i_SPECIAL_SRAV || + fn >= R4300i_SPECIAL_DSLLV && fn <= R4300i_SPECIAL_DSRAV || + fn >= R4300i_SPECIAL_DIVU && fn <= R4300i_SPECIAL_DSUBU || + fn >= R4300i_SPECIAL_DSLL && fn <= R4300i_SPECIAL_DSRA32 || + fn == R4300i_SPECIAL_JALR || fn == R4300i_SPECIAL_MFLO || + fn == R4300i_SPECIAL_MFHI) { return true; } } } + else + { + if (m_OpCode.rt == nReg) + { + if (op >= R4300i_DADDI && op <= R4300i_LWU || + op >= R4300i_ADDI && op <= R4300i_LUI || + op == R4300i_LL || op == R4300i_LD || + (op == R4300i_CP0 && m_OpCode.fmt == R4300i_COP0_MF) || + (op == R4300i_CP1 && m_OpCode.fmt == R4300i_COP1_MF) || + (op == R4300i_CP1 && m_OpCode.fmt == R4300i_COP1_CF)) + { + return true; + } + } + } + + if (op == R4300i_JAL && nReg == 31) // nReg == RA + { + return true; + } return false; } From 590119f4147a7670f83a3f7b520b0b3049dde0e0 Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 9 Jan 2019 16:39:04 +1030 Subject: [PATCH 4/5] [Project64] Update names for lle hle settings --- Source/Project64-core/Settings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64-core/Settings.cpp b/Source/Project64-core/Settings.cpp index 9ff21efdb..7d03b3553 100644 --- a/Source/Project64-core/Settings.cpp +++ b/Source/Project64-core/Settings.cpp @@ -130,7 +130,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Setting_SyncViaAudioEnabled, new CSettingTypeTempBool(false, "SyncViaAudioEnabled")); AddHandler(Default_RDRamSize, new CSettingTypeApplication("Defaults", "RDRAM Size", 0x400000u)); - AddHandler(Default_UseHleGfx, new CSettingTypeApplication("Defaults", "HLE GFX", true)); + AddHandler(Default_UseHleGfx, new CSettingTypeApplication("Defaults", "HLE GFX Default", true)); AddHandler(Default_UseTlb, new CSettingTypeApplication("Defaults", "Use TLB", true)); AddHandler(Default_ViRefreshRate, new CSettingTypeApplication("Defaults", "ViRefresh", 1500u)); AddHandler(Default_AiCountPerBytes, new CSettingTypeApplication("Defaults", "AiCountPerBytes", 0u)); @@ -160,7 +160,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start", (uint32_t)0)); AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len", (uint32_t)0)); AddHandler(Rdb_TLB_PAddrStart, new CSettingTypeRomDatabase("TLB: PAddr Start", (uint32_t)0)); - AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX", Plugin_UseHleGfx)); + AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX RDB", Plugin_UseHleGfx)); AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio", Plugin_UseHleAudio)); AddHandler(Rdb_LoadRomToMemory, new CSettingTypeRomDatabase("Rom In Memory", false)); AddHandler(Rdb_ScreenHertz, new CSettingTypeRomDatabase("ScreenHertz", (uint32_t)0)); @@ -383,7 +383,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Plugin_AUDIO_CurVer, new CSettingTypeApplication("Plugin", "Audio Dll Ver", "")); AddHandler(Plugin_CONT_CurVer, new CSettingTypeApplication("Plugin", "Controller Dll Ver", "")); - AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX", Default_UseHleGfx)); + AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX Plugin", Default_UseHleGfx)); AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio", false)); AddHandler(Plugin_EnableAudio, new CSettingTypeApplication("Audio", "Enable Audio", true)); From e163ecd2f8a2667f291774ea26c162ef0ad9374d Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 10 Jan 2019 19:14:18 +1030 Subject: [PATCH 5/5] [Projext64] Add check around duplicate name --- Source/Project64-core/Settings.cpp | 31 +++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/Source/Project64-core/Settings.cpp b/Source/Project64-core/Settings.cpp index 7d03b3553..88fdd94b9 100644 --- a/Source/Project64-core/Settings.cpp +++ b/Source/Project64-core/Settings.cpp @@ -161,7 +161,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len", (uint32_t)0)); AddHandler(Rdb_TLB_PAddrStart, new CSettingTypeRomDatabase("TLB: PAddr Start", (uint32_t)0)); AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX RDB", Plugin_UseHleGfx)); - AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio", Plugin_UseHleAudio)); + AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio RDB", Plugin_UseHleAudio)); AddHandler(Rdb_LoadRomToMemory, new CSettingTypeRomDatabase("Rom In Memory", false)); AddHandler(Rdb_ScreenHertz, new CSettingTypeRomDatabase("ScreenHertz", (uint32_t)0)); AddHandler(Rdb_FuncLookupMode, new CSettingTypeRomDatabase("FuncFind", (uint32_t)FuncFind_PhysicalLookup)); @@ -384,7 +384,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) AddHandler(Plugin_CONT_CurVer, new CSettingTypeApplication("Plugin", "Controller Dll Ver", "")); AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX Plugin", Default_UseHleGfx)); - AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio", false)); + AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio Plugin", false)); AddHandler(Plugin_EnableAudio, new CSettingTypeApplication("Audio", "Enable Audio", true)); //Logging @@ -428,6 +428,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) { + uint32_t setting_id = 0; for (SETTING_MAP::iterator iter = _this->m_SettingInfo.begin(); iter != _this->m_SettingInfo.end(); iter++) { CSettingType * Setting = iter->second; @@ -438,7 +439,11 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) { continue; } - return iter->first; + if (setting_id != 0) + { + g_Notify->BreakPoint(__FILE__, __LINE__); + } + setting_id = iter->first; } else if (Setting->GetSettingType() == SettingType_CfgFile) { @@ -447,7 +452,11 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) { continue; } - return iter->first; + if (setting_id != 0) + { + g_Notify->BreakPoint(__FILE__, __LINE__); + } + setting_id = iter->first; } else if (Setting->GetSettingType() == SettingType_SelectedDirectory) { @@ -456,7 +465,11 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) { continue; } - return iter->first; + if (setting_id != 0) + { + g_Notify->BreakPoint(__FILE__, __LINE__); + } + setting_id = iter->first; } else if (Setting->GetSettingType() == SettingType_BoolVariable) { @@ -465,10 +478,14 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) { continue; } - return iter->first; + if (setting_id != 0) + { + g_Notify->BreakPoint(__FILE__, __LINE__); + } + setting_id = iter->first; } } - return 0; + return setting_id; } void CSettings::FlushSettings(CSettings * /*_this*/)