This commit is contained in:
zilmar 2019-01-12 09:50:51 +11:00
commit f8e49ae37d
4 changed files with 119 additions and 93 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -135,7 +135,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));
@ -165,8 +165,8 @@ 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_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio", Plugin_UseHleAudio));
AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX RDB", Plugin_UseHleGfx));
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));
@ -386,8 +386,8 @@ 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_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio", false));
AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX Plugin", Default_UseHleGfx));
AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio Plugin", false));
AddHandler(Plugin_EnableAudio, new CSettingTypeApplication("Audio", "Enable Audio", true));
//Logging
@ -438,6 +438,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;
@ -448,7 +449,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)
{
@ -457,7 +462,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)
{
@ -466,7 +475,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)
{
@ -475,10 +488,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*/)

View File

@ -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")

View File

@ -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;
}