Remove AutoPause.cpp

This commit is contained in:
Nekotekina 2017-05-09 18:51:41 +03:00
parent 8209e6c1e3
commit 08c955d177
8 changed files with 5 additions and 119 deletions

View File

@ -1,73 +0,0 @@
#include "stdafx.h"
#include "Config.h"
#include "Emu/System.h"
#include "AutoPause.h"
cfg::bool_entry g_cfg_debug_autopause_syscall(cfg::root.misc, "Auto Pause at System Call");
cfg::bool_entry g_cfg_debug_autopause_func_call(cfg::root.misc, "Auto Pause at Function Call");
debug::autopause& debug::autopause::get_instance()
{
// Use magic static
static autopause instance;
return instance;
}
// Load Auto Pause Configuration from file "pause.bin"
void debug::autopause::reload(void)
{
auto& instance = get_instance();
instance.m_pause_function.clear();
instance.m_pause_syscall.clear();
// TODO: better format, possibly a config entry
if (fs::file list{ fs::get_config_dir() + "pause.bin" })
{
u32 num;
size_t fmax = list.size();
size_t fcur = 0;
list.seek(0);
while (fcur <= fmax - sizeof(u32))
{
list.read(&num, sizeof(u32));
fcur += sizeof(u32);
if (num == 0xFFFFFFFF) break;
if (num < 1024)
{
instance.m_pause_syscall.emplace(num);
LOG_WARNING(HLE, "Set autopause at syscall %lld", num);
}
else
{
instance.m_pause_function.emplace(num);
LOG_WARNING(HLE, "Set autopause at function 0x%08x", num);
}
}
}
}
bool debug::autopause::pause_syscall(u64 code)
{
if (g_cfg_debug_autopause_syscall && get_instance().m_pause_syscall.count(code) != 0)
{
Emu.Pause();
LOG_SUCCESS(HLE, "Autopause triggered at syscall %lld", code);
return true;
}
return false;
}
bool debug::autopause::pause_function(u32 code)
{
if (g_cfg_debug_autopause_func_call && get_instance().m_pause_function.count(code) != 0)
{
Emu.Pause();
LOG_SUCCESS(HLE, "Autopause triggered at function 0x%08x", code);
return true;
}
return false;
}

View File

@ -1,22 +0,0 @@
#pragma once
#include <unordered_set>
// Regarded as a Debugger Enchantment
namespace debug
{
// To store the pause function/call id, and let those pause there.
// Would be with a GUI to configure those.
class autopause
{
std::unordered_set<u64> m_pause_syscall;
std::unordered_set<u32> m_pause_function;
static autopause& get_instance();
public:
static void reload();
static bool pause_syscall(u64 code);
static bool pause_function(u32 code);
};
}

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "Utilities/Config.h"
#include "Utilities/AutoPause.h"
#include "Utilities/VirtualMemory.h"
#include "Crypto/sha1.h"
#include "Crypto/unself.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "Utilities/Config.h"
#include "Utilities/AutoPause.h"
#include "Emu/System.h"
#include "Emu/Cell/PPUFunction.h"
@ -997,12 +996,6 @@ extern void ppu_execute_syscall(ppu_thread& ppu, u64 code)
{
if (code < g_ppu_syscall_table.size())
{
// If autopause occures, check_status() will hold the thread till unpaused
if (debug::autopause::pause_syscall(code))
{
ppu.test_state();
}
if (auto func = g_ppu_syscall_table[code])
{
func(ppu);

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "Utilities/Config.h"
#include "Utilities/AutoPause.h"
#include "Utilities/event.h"
#include "Utilities/bin_patch.h"
#include "Emu/Memory/Memory.h"
@ -362,8 +361,6 @@ void Emulator::Load()
return;
}
debug::autopause::reload();
if (g_cfg_autostart && IsReady())
{
Run();

View File

@ -100,7 +100,7 @@ MainFrame::MainFrame()
menu_conf->Append(id_config_emu, "&Settings");
menu_conf->Append(id_config_pad, "&Keyboard Settings");
menu_conf->AppendSeparator();
menu_conf->Append(id_config_autopause_manager, "&Auto Pause Settings");
menu_conf->Append(id_config_autopause_manager, "&Auto Pause Settings")->Enable(false);
//menu_conf->AppendSeparator();
//menu_conf->Append(id_config_vfs_manager, "Virtual &File System Manager");
//menu_conf->Append(id_config_vhdd_manager, "Virtual &HDD Manager");

View File

@ -72,7 +72,6 @@
<ClCompile Include="..\ps3emu_api\ps3emu_api.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\Utilities\AutoPause.cpp" />
<ClCompile Include="..\Utilities\bin_patch.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
@ -138,7 +137,7 @@
<ClCompile Include="Emu\Cell\lv2\sys_trace.cpp" />
<ClCompile Include="Emu\Cell\lv2\sys_tty.cpp" />
<ClCompile Include="Emu\Cell\lv2\sys_vm.cpp" />
<ClCompile Include="Emu\Cell\lv2\sys_ss.cpp" />
<ClCompile Include="Emu\Cell\lv2\sys_ss.cpp" />
<ClCompile Include="Emu\Cell\Modules\sys_libc_.cpp" />
<ClCompile Include="Emu\Cell\PPUModule.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellAdec.cpp" />
@ -404,7 +403,6 @@
<ClInclude Include="..\ps3emu_api\ps3emu_api.h" />
<ClInclude Include="..\Utilities\Atomic.h" />
<ClInclude Include="..\Utilities\AtomicPtr.h" />
<ClInclude Include="..\Utilities\AutoPause.h" />
<ClInclude Include="..\Utilities\BEType.h" />
<ClInclude Include="..\Utilities\bin_patch.h" />
<ClInclude Include="..\Utilities\BitField.h" />
@ -543,7 +541,7 @@
<ClInclude Include="Emu\Cell\lv2\sys_trace.h" />
<ClInclude Include="Emu\Cell\lv2\sys_tty.h" />
<ClInclude Include="Emu\Cell\lv2\sys_vm.h" />
<ClInclude Include="Emu\Cell\lv2\sys_ss.h" />
<ClInclude Include="Emu\Cell\lv2\sys_ss.h" />
<ClInclude Include="Emu\Cell\MFC.h" />
<ClInclude Include="Emu\Cell\PPUModule.h" />
<ClInclude Include="Emu\Cell\Modules\cellAdec.h" />
@ -715,4 +713,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -149,9 +149,6 @@
<ClCompile Include="Emu\RSX\CgBinaryFragmentProgram.cpp">
<Filter>Emu\GPU\RSX</Filter>
</ClCompile>
<ClCompile Include="..\Utilities\AutoPause.cpp">
<Filter>Utilities</Filter>
</ClCompile>
<ClCompile Include="..\Utilities\rXml.cpp">
<Filter>Utilities</Filter>
</ClCompile>
@ -1063,9 +1060,6 @@
<ClInclude Include="Emu\RSX\GCM.h">
<Filter>Emu\GPU\RSX</Filter>
</ClInclude>
<ClInclude Include="..\Utilities\AutoPause.h">
<Filter>Utilities</Filter>
</ClInclude>
<ClInclude Include="Emu\IdManager.h">
<Filter>Emu</Filter>
</ClInclude>
@ -1376,7 +1370,7 @@
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\Modules\cellSysconf.h">
<Filter>Emu\Cell\Modules</Filter>
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\Modules\cellSysutil.h">
<Filter>Emu\Cell\Modules</Filter>