mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 17:58:37 +12:00
SPU: use progress dialog
This commit is contained in:
parent
ea1bb3b90e
commit
05e24f38f9
1 changed files with 18 additions and 16 deletions
|
@ -15,7 +15,9 @@
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
extern u64 get_system_time();
|
extern atomic_t<const char*> g_progr;
|
||||||
|
extern atomic_t<u64> g_progr_ptotal;
|
||||||
|
extern atomic_t<u64> g_progr_pdone;
|
||||||
|
|
||||||
const spu_decoder<spu_itype> s_spu_itype;
|
const spu_decoder<spu_itype> s_spu_itype;
|
||||||
|
|
||||||
|
@ -130,12 +132,19 @@ void spu_cache::initialize()
|
||||||
// Fake LS
|
// Fake LS
|
||||||
std::vector<be_t<u32>> ls(0x10000);
|
std::vector<be_t<u32>> ls(0x10000);
|
||||||
|
|
||||||
// Used to show progress
|
// Initialize progress dialog
|
||||||
u64 timex = get_system_time();
|
g_progr = "Building SPU cache...";
|
||||||
|
g_progr_ptotal += func_list.size();
|
||||||
|
|
||||||
// Build functions
|
// Build functions
|
||||||
for (auto&& func : func_list)
|
for (auto&& func : func_list)
|
||||||
{
|
{
|
||||||
|
if (Emu.IsStopped())
|
||||||
|
{
|
||||||
|
g_progr_pdone++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize LS with function data only
|
// Initialize LS with function data only
|
||||||
for (u32 i = 1, pos = func[0]; i < func.size(); i++, pos += 4)
|
for (u32 i = 1, pos = func[0]; i < func.size(); i++, pos += 4)
|
||||||
{
|
{
|
||||||
|
@ -163,20 +172,13 @@ void spu_cache::initialize()
|
||||||
ls[pos / 4] = 0;
|
ls[pos / 4] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Emu.IsStopped())
|
g_progr_pdone++;
|
||||||
{
|
}
|
||||||
LOG_ERROR(SPU, "SPU Runtime: Cache building aborted.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print progress every 400 ms
|
if (Emu.IsStopped())
|
||||||
const u64 timed = get_system_time() - timex;
|
{
|
||||||
|
LOG_ERROR(SPU, "SPU Runtime: Cache building aborted.");
|
||||||
if (timed >= 400000)
|
return;
|
||||||
{
|
|
||||||
LOG_SUCCESS(SPU, "Building SPU cache (%u/%u)...", &func - func_list.data(), func_list.size());
|
|
||||||
timex += 400000;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_SUCCESS(SPU, "SPU Runtime: Built %u functions.", func_list.size());
|
LOG_SUCCESS(SPU, "SPU Runtime: Built %u functions.", func_list.size());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue