mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
commit
2b48443b95
@ -7,17 +7,16 @@
|
||||
|
||||
using namespace Debug;
|
||||
|
||||
//Even different from those tutorials on webpages, i use the method similiar from Log.h
|
||||
//TODO:: Question: Does such a Singleton struct get fully deallocated after its pointer?
|
||||
AutoPause* gAutoPause = nullptr;
|
||||
std::unique_ptr<AutoPause> g_autopause;
|
||||
|
||||
AutoPause& AutoPause::getInstance(void)
|
||||
{
|
||||
if (!gAutoPause)
|
||||
if (!g_autopause)
|
||||
{
|
||||
gAutoPause = new AutoPause();
|
||||
g_autopause.reset(new AutoPause);
|
||||
}
|
||||
return *gAutoPause;
|
||||
|
||||
return *g_autopause;
|
||||
}
|
||||
|
||||
//Still use binary format. Default Setting should be "disable all auto pause".
|
||||
|
@ -20,6 +20,7 @@ std::unique_ptr<wchar_t[]> ConvertUTF8ToWChar(const std::string& source)
|
||||
if (!MultiByteToWideChar(CP_UTF8, 0, source.c_str(), size, buffer.get(), size))
|
||||
{
|
||||
LOG_ERROR(GENERAL, "ConvertUTF8ToWChar(source='%s') failed: 0x%llx", source, GET_API_ERROR);
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
@ -27,17 +28,28 @@ std::unique_ptr<wchar_t[]> ConvertUTF8ToWChar(const std::string& source)
|
||||
|
||||
std::string ConvertWCharToUTF8(const wchar_t* source)
|
||||
{
|
||||
const int size = WideCharToMultiByte(CP_UTF8, 0, source, -1 /* NTS */, NULL, 0, NULL, NULL); // size
|
||||
|
||||
if (size < 1) throw std::length_error(__FUNCTION__); // ???
|
||||
const int length = lstrlenW(source); // source length
|
||||
|
||||
std::string result;
|
||||
|
||||
result.resize(size - 1);
|
||||
|
||||
if (!WideCharToMultiByte(CP_UTF8, 0, source, -1 /* NTS */, &result.front(), size, NULL, NULL))
|
||||
if (length == 0)
|
||||
{
|
||||
LOG_ERROR(GENERAL, "ConvertWCharToUTF8() failed: 0x%llx", GET_API_ERROR);
|
||||
return result;
|
||||
}
|
||||
|
||||
const int size = WideCharToMultiByte(CP_UTF8, 0, source, length, NULL, 0, NULL, NULL); // output size
|
||||
|
||||
if (size <= 0)
|
||||
{
|
||||
LOG_ERROR(GENERAL, "ConvertWCharToUTF8(length=%d) failed: 0x%llx", length, GET_API_ERROR);
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
result.resize(size);
|
||||
|
||||
if (!WideCharToMultiByte(CP_UTF8, 0, source, length, &result.front(), size, NULL, NULL))
|
||||
{
|
||||
throw __FUNCTION__;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
2
asmjit
2
asmjit
@ -1 +1 @@
|
||||
Subproject commit 48da90ded775fa2ba0fd3f15522890ad631ad6de
|
||||
Subproject commit 9001d2f2b77eec93ce79facb1ef6d11b96dc612f
|
@ -258,7 +258,7 @@ cpu_thread& armv7_thread::args(std::initializer_list<std::string> values)
|
||||
|
||||
for (auto& arg : values)
|
||||
{
|
||||
const u32 arg_size = vm::cast(arg.size(), "arg.size()"); // get arg size
|
||||
const u32 arg_size = arg.size(); // get arg size
|
||||
|
||||
for (char c : arg)
|
||||
{
|
||||
|
@ -369,7 +369,7 @@ void SPUThread::do_dma_list_cmd(u32 cmd, spu_mfc_arg_t args)
|
||||
|
||||
if (rec->sb.data() & se16(0x8000))
|
||||
{
|
||||
ch_stall_stat.push_logical_or(1 << args.tag);
|
||||
ch_stall_stat.push_bit_or(1 << args.tag);
|
||||
|
||||
spu_mfc_arg_t stalled;
|
||||
stalled.ea = (args.ea & ~0xffffffff) | (list_addr + (i + 1) * 8);
|
||||
|
@ -156,7 +156,7 @@ public:
|
||||
return out_result;
|
||||
}
|
||||
|
||||
void push_logical_or(u32 value)
|
||||
void push_bit_or(u32 value)
|
||||
{
|
||||
sync_var._or({ 1, value });
|
||||
}
|
||||
@ -550,7 +550,7 @@ public:
|
||||
{
|
||||
if (snr_config & 1)
|
||||
{
|
||||
ch_snr1.push_logical_or(value);
|
||||
ch_snr1.push_bit_or(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -561,7 +561,7 @@ public:
|
||||
{
|
||||
if (snr_config & 2)
|
||||
{
|
||||
ch_snr2.push_logical_or(value);
|
||||
ch_snr2.push_bit_or(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -103,19 +103,6 @@ namespace vm
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef __APPLE__
|
||||
template<>
|
||||
struct cast_ptr<unsigned long>
|
||||
{
|
||||
static_assert(sizeof(unsigned long) == 8, "Unexpected size of unsigned long");
|
||||
|
||||
__forceinline static u32 cast(const unsigned long addr, const char* func)
|
||||
{
|
||||
return cast_ptr<u64>::cast(addr, func);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template<>
|
||||
struct cast_ptr<u32>
|
||||
{
|
||||
|
@ -138,14 +138,14 @@ std::string CgBinaryDisasm::FormatDisAsm(const std::string& code)
|
||||
{
|
||||
const std::pair<std::string, std::function<std::string()>> repl_list[] =
|
||||
{
|
||||
{ "$$", []() -> std::string { return "$"; } },
|
||||
{ "$0", std::bind(std::mem_fn(&CgBinaryDisasm::GetSrcDisAsm<SRC0>), this, src0) },
|
||||
{ "$1", std::bind(std::mem_fn(&CgBinaryDisasm::GetSrcDisAsm<SRC1>), this, src1) },
|
||||
{ "$2", std::bind(std::mem_fn(&CgBinaryDisasm::GetSrcDisAsm<SRC2>), this, src2) },
|
||||
{ "$t", std::bind(std::mem_fn(&CgBinaryDisasm::AddTexDisAsm), this) },
|
||||
{ "$m", std::bind(std::mem_fn(&CgBinaryDisasm::GetMask), this) },
|
||||
{ "$cond", std::bind(std::mem_fn(&CgBinaryDisasm::GetCondDisAsm), this) },
|
||||
{ "$c", std::bind(std::mem_fn(&CgBinaryDisasm::AddConstDisAsm), this) }
|
||||
{ "$$", []() -> std::string { return "$"; } },
|
||||
{ "$0", [this]{ return GetSrcDisAsm<SRC0>(src0); } },
|
||||
{ "$1", [this]{ return GetSrcDisAsm<SRC1>(src1); } },
|
||||
{ "$2", [this]{ return GetSrcDisAsm<SRC2>(src2); } },
|
||||
{ "$t", [this]{ return AddTexDisAsm(); } },
|
||||
{ "$m", [this]{ return GetMask(); } },
|
||||
{ "$cond", [this]{ return GetCondDisAsm(); } },
|
||||
{ "$c", [this]{ return AddConstDisAsm(); } },
|
||||
};
|
||||
|
||||
return fmt::replace_all(code, repl_list);
|
||||
@ -241,27 +241,27 @@ void CgBinaryDisasm::TaskFP()
|
||||
|
||||
while (true)
|
||||
{
|
||||
for (auto finded = std::find(m_end_offsets.begin(), m_end_offsets.end(), m_size);
|
||||
finded != m_end_offsets.end();
|
||||
finded = std::find(m_end_offsets.begin(), m_end_offsets.end(), m_size))
|
||||
for (auto found = std::find(m_end_offsets.begin(), m_end_offsets.end(), m_size);
|
||||
found != m_end_offsets.end();
|
||||
found = std::find(m_end_offsets.begin(), m_end_offsets.end(), m_size))
|
||||
{
|
||||
m_end_offsets.erase(finded);
|
||||
m_end_offsets.erase(found);
|
||||
m_arb_shader += "ENDIF;\n";
|
||||
}
|
||||
|
||||
for (auto finded = std::find(m_loop_end_offsets.begin(), m_loop_end_offsets.end(), m_size);
|
||||
finded != m_loop_end_offsets.end();
|
||||
finded = std::find(m_loop_end_offsets.begin(), m_loop_end_offsets.end(), m_size))
|
||||
for (auto found = std::find(m_loop_end_offsets.begin(), m_loop_end_offsets.end(), m_size);
|
||||
found != m_loop_end_offsets.end();
|
||||
found = std::find(m_loop_end_offsets.begin(), m_loop_end_offsets.end(), m_size))
|
||||
{
|
||||
m_loop_end_offsets.erase(finded);
|
||||
m_loop_end_offsets.erase(found);
|
||||
m_arb_shader += "ENDLOOP;\n";
|
||||
}
|
||||
|
||||
for (auto finded = std::find(m_else_offsets.begin(), m_else_offsets.end(), m_size);
|
||||
finded != m_else_offsets.end();
|
||||
finded = std::find(m_else_offsets.begin(), m_else_offsets.end(), m_size))
|
||||
for (auto found = std::find(m_else_offsets.begin(), m_else_offsets.end(), m_size);
|
||||
found != m_else_offsets.end();
|
||||
found = std::find(m_else_offsets.begin(), m_else_offsets.end(), m_size))
|
||||
{
|
||||
m_else_offsets.erase(finded);
|
||||
m_else_offsets.erase(found);
|
||||
m_arb_shader += "ELSE;\n";
|
||||
}
|
||||
|
||||
|
@ -174,23 +174,25 @@ std::string CgBinaryDisasm::FormatDisasm(const std::string& code)
|
||||
{
|
||||
const std::pair<std::string, std::function<std::string()>> repl_list[] =
|
||||
{
|
||||
{ "$$", []() -> std::string { return "$"; } },
|
||||
{ "$0", std::bind(std::mem_fn(&CgBinaryDisasm::GetSRCDisasm), this, 0) },
|
||||
{ "$1", std::bind(std::mem_fn(&CgBinaryDisasm::GetSRCDisasm), this, 1) },
|
||||
{ "$2", std::bind(std::mem_fn(&CgBinaryDisasm::GetSRCDisasm), this, 2) },
|
||||
{ "$s", std::bind(std::mem_fn(&CgBinaryDisasm::GetSRCDisasm), this, 2) },
|
||||
{ "$am", std::bind(std::mem_fn(&CgBinaryDisasm::AddAddrMaskDisasm), this) },
|
||||
{ "$a", std::bind(std::mem_fn(&CgBinaryDisasm::AddAddrRegDisasm), this) },
|
||||
{ "$t", std::bind(std::mem_fn(&CgBinaryDisasm::GetTexDisasm), this) },
|
||||
{ "$fa", [this]()->std::string { return std::to_string(GetAddrDisasm()); } },
|
||||
{ "$ifcond ", [this]() -> std::string
|
||||
{ "$$", []() -> std::string { return "$"; } },
|
||||
{ "$0", [this]{ return GetSRCDisasm(0); } },
|
||||
{ "$1", [this]{ return GetSRCDisasm(1); } },
|
||||
{ "$2", [this]{ return GetSRCDisasm(2); } },
|
||||
{ "$s", [this]{ return GetSRCDisasm(2); } },
|
||||
{ "$am", [this]{ return AddAddrMaskDisasm(); } },
|
||||
{ "$a", [this]{ return AddAddrRegDisasm(); } },
|
||||
{ "$t", [this]{ return GetTexDisasm(); } },
|
||||
{ "$fa", [this]{ return std::to_string(GetAddrDisasm()); } },
|
||||
|
||||
{ "$ifcond ", [this]
|
||||
{
|
||||
const std::string& cond = GetCondDisasm();
|
||||
if (cond == "true") return "";
|
||||
std::string cond = GetCondDisasm();
|
||||
if (cond == "true") cond.clear();
|
||||
return cond;
|
||||
}
|
||||
},
|
||||
{ "$cond", std::bind(std::mem_fn(&CgBinaryDisasm::GetCondDisasm), this) }
|
||||
|
||||
{ "$cond", [this]{ return GetCondDisasm(); } },
|
||||
};
|
||||
|
||||
return fmt::replace_all(code, repl_list);
|
||||
|
@ -124,11 +124,12 @@ std::string GLFragmentDecompilerThread::Format(const std::string& code)
|
||||
const std::pair<std::string, std::function<std::string()>> repl_list[] =
|
||||
{
|
||||
{ "$$", []() -> std::string { return "$"; } },
|
||||
{ "$0", std::bind(std::mem_fn(&GLFragmentDecompilerThread::GetSRC<SRC0>), this, src0) },
|
||||
{ "$1", std::bind(std::mem_fn(&GLFragmentDecompilerThread::GetSRC<SRC1>), this, src1) },
|
||||
{ "$2", std::bind(std::mem_fn(&GLFragmentDecompilerThread::GetSRC<SRC2>), this, src2) },
|
||||
{ "$t", std::bind(std::mem_fn(&GLFragmentDecompilerThread::AddTex), this) },
|
||||
{ "$m", std::bind(std::mem_fn(&GLFragmentDecompilerThread::GetMask), this) },
|
||||
{ "$0", [this]{ return GetSRC<SRC0>(src0); } },
|
||||
{ "$1", [this]{ return GetSRC<SRC1>(src1); } },
|
||||
{ "$2", [this]{ return GetSRC<SRC2>(src2); } },
|
||||
{ "$t", [this]{ return AddTex(); } },
|
||||
{ "$m", [this]{ return GetMask(); } },
|
||||
|
||||
{ "$ifcond ", [this]() -> std::string
|
||||
{
|
||||
const std::string& cond = GetCond();
|
||||
@ -136,8 +137,9 @@ std::string GLFragmentDecompilerThread::Format(const std::string& code)
|
||||
return "if(" + cond + ") ";
|
||||
}
|
||||
},
|
||||
{ "$cond", std::bind(std::mem_fn(&GLFragmentDecompilerThread::GetCond), this) },
|
||||
{ "$c", std::bind(std::mem_fn(&GLFragmentDecompilerThread::AddConst), this) }
|
||||
|
||||
{ "$cond", [this]{ return GetCond(); } },
|
||||
{ "$c", [this]{ return AddConst(); } }
|
||||
};
|
||||
|
||||
return fmt::replace_all(code, repl_list);
|
||||
@ -375,21 +377,21 @@ void GLFragmentDecompilerThread::Task()
|
||||
|
||||
while (true)
|
||||
{
|
||||
for (auto finded = std::find(m_end_offsets.begin(), m_end_offsets.end(), m_size);
|
||||
finded != m_end_offsets.end();
|
||||
finded = std::find(m_end_offsets.begin(), m_end_offsets.end(), m_size))
|
||||
for (auto found = std::find(m_end_offsets.begin(), m_end_offsets.end(), m_size);
|
||||
found != m_end_offsets.end();
|
||||
found = std::find(m_end_offsets.begin(), m_end_offsets.end(), m_size))
|
||||
{
|
||||
m_end_offsets.erase(finded);
|
||||
m_end_offsets.erase(found);
|
||||
m_code_level--;
|
||||
AddCode("}");
|
||||
m_loop_count--;
|
||||
}
|
||||
|
||||
for (auto finded = std::find(m_else_offsets.begin(), m_else_offsets.end(), m_size);
|
||||
finded != m_else_offsets.end();
|
||||
finded = std::find(m_else_offsets.begin(), m_else_offsets.end(), m_size))
|
||||
for (auto found = std::find(m_else_offsets.begin(), m_else_offsets.end(), m_size);
|
||||
found != m_else_offsets.end();
|
||||
found = std::find(m_else_offsets.begin(), m_else_offsets.end(), m_size))
|
||||
{
|
||||
m_else_offsets.erase(finded);
|
||||
m_else_offsets.erase(found);
|
||||
m_code_level--;
|
||||
AddCode("}");
|
||||
AddCode("else");
|
||||
|
@ -195,18 +195,17 @@ std::string GLVertexDecompilerThread::Format(const std::string& code)
|
||||
{
|
||||
const std::pair<std::string, std::function<std::string()>> repl_list[] =
|
||||
{
|
||||
{ "$$", []() -> std::string { return "$"; } },
|
||||
{ "$0", std::bind(std::mem_fn(&GLVertexDecompilerThread::GetSRC), this, 0) },
|
||||
{ "$1", std::bind(std::mem_fn(&GLVertexDecompilerThread::GetSRC), this, 1) },
|
||||
{ "$2", std::bind(std::mem_fn(&GLVertexDecompilerThread::GetSRC), this, 2) },
|
||||
{ "$s", std::bind(std::mem_fn(&GLVertexDecompilerThread::GetSRC), this, 2) },
|
||||
{ "$am", std::bind(std::mem_fn(&GLVertexDecompilerThread::AddAddrMask), this) },
|
||||
{ "$a", std::bind(std::mem_fn(&GLVertexDecompilerThread::AddAddrReg), this) },
|
||||
{ "$$", []() -> std::string { return "$"; } },
|
||||
{ "$0", [this]{ return GetSRC(0); } },
|
||||
{ "$1", [this]{ return GetSRC(1); } },
|
||||
{ "$2", [this]{ return GetSRC(2); } },
|
||||
{ "$s", [this]{ return GetSRC(2); } },
|
||||
{ "$am", [this]{ return AddAddrMask(); } },
|
||||
{ "$a", [this]{ return AddAddrReg(); } },
|
||||
{ "$t", [this]{ return GetTex(); } },
|
||||
{ "$fa", [this]{ return std::to_string(GetAddr()); } },
|
||||
{ "$f()", [this]{ return GetFunc(); } },
|
||||
|
||||
{ "$t", std::bind(std::mem_fn(&GLVertexDecompilerThread::GetTex), this) },
|
||||
|
||||
{ "$fa", [this]()->std::string { return std::to_string(GetAddr()); } },
|
||||
{ "$f()", std::bind(std::mem_fn(&GLVertexDecompilerThread::GetFunc), this) },
|
||||
{ "$ifcond ", [this]() -> std::string
|
||||
{
|
||||
const std::string& cond = GetCond();
|
||||
@ -214,7 +213,8 @@ std::string GLVertexDecompilerThread::Format(const std::string& code)
|
||||
return "if(" + cond + ") ";
|
||||
}
|
||||
},
|
||||
{ "$cond", std::bind(std::mem_fn(&GLVertexDecompilerThread::GetCond), this) }
|
||||
|
||||
{ "$cond", [this]{ return GetCond(); } }
|
||||
};
|
||||
|
||||
return fmt::replace_all(code, repl_list);
|
||||
|
@ -598,10 +598,10 @@ s32 cellFsStRead(u32 fd, vm::ptr<u8> buf, u64 size, vm::ptr<u64> rsize)
|
||||
const u64 copied = file->st_copied.load();
|
||||
const u32 position = vm::cast(file->st_buffer + copied % file->st_ringbuf_size);
|
||||
const u64 total_read = file->st_total_read.load();
|
||||
const u32 copy_size = vm::cast(*rsize = std::min<u64>(size, total_read - copied));
|
||||
const u64 copy_size = (*rsize = std::min<u64>(size, total_read - copied)); // write rsize
|
||||
|
||||
// copy data
|
||||
const u32 first_size = std::min<u32>(copy_size, file->st_ringbuf_size - (position - file->st_buffer));
|
||||
const u64 first_size = std::min<u64>(copy_size, file->st_ringbuf_size - (position - file->st_buffer));
|
||||
memcpy(buf.get_ptr(), vm::get_ptr(position), first_size);
|
||||
memcpy((buf + first_size).get_ptr(), vm::get_ptr(file->st_buffer), copy_size - first_size);
|
||||
|
||||
@ -723,7 +723,7 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, fs_st_cb_t func)
|
||||
return CELL_FS_ENXIO;
|
||||
}
|
||||
|
||||
if (!file->st_callback.compare_and_swap_test({}, { vm::cast(size, "size"), func }))
|
||||
if (!file->st_callback.compare_and_swap_test({}, { size, func }))
|
||||
{
|
||||
return CELL_FS_EIO;
|
||||
}
|
||||
@ -940,7 +940,7 @@ s32 cellFsAioRead(vm::ptr<CellFsAio> aio, vm::ptr<s32> id, fs_aio_cb_t func)
|
||||
|
||||
const s32 xid = (*id = ++g_fs_aio_id);
|
||||
|
||||
thread_t("FS AIO Read Thread", std::bind(fsAio, aio, false, xid, func)).detach();
|
||||
thread_t("FS AIO Read Thread", [=]{ fsAio(aio, false, xid, func); }).detach();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -958,7 +958,7 @@ s32 cellFsAioWrite(vm::ptr<CellFsAio> aio, vm::ptr<s32> id, fs_aio_cb_t func)
|
||||
|
||||
const s32 xid = (*id = ++g_fs_aio_id);
|
||||
|
||||
thread_t("FS AIO Write Thread", std::bind(fsAio, aio, true, xid, func)).detach();
|
||||
thread_t("FS AIO Write Thread", [=]{ fsAio(aio, true, xid, func); }).detach();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -19,51 +19,6 @@ SaveDataDialogInstance::SaveDataDialogInstance()
|
||||
{
|
||||
}
|
||||
|
||||
// Auxiliary Classes
|
||||
class SortSaveDataEntry
|
||||
{
|
||||
const u32 m_type;
|
||||
const u32 m_order;
|
||||
|
||||
public:
|
||||
SortSaveDataEntry(u32 type, u32 order)
|
||||
: m_type(type)
|
||||
, m_order(order)
|
||||
{
|
||||
}
|
||||
|
||||
bool operator()(const SaveDataEntry& entry1, const SaveDataEntry& entry2) const
|
||||
{
|
||||
if (m_order == CELL_SAVEDATA_SORTORDER_DESCENT)
|
||||
{
|
||||
if (m_type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
||||
{
|
||||
return entry1.mtime >= entry2.mtime;
|
||||
}
|
||||
|
||||
if (m_type == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
||||
{
|
||||
return entry1.subtitle >= entry2.subtitle;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_order == CELL_SAVEDATA_SORTORDER_ASCENT)
|
||||
{
|
||||
if (m_type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
||||
{
|
||||
return entry1.mtime < entry2.mtime;
|
||||
}
|
||||
|
||||
if (m_type == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
||||
{
|
||||
return entry1.subtitle < entry2.subtitle;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
enum : u32
|
||||
{
|
||||
SAVEDATA_OP_AUTO_SAVE = 0,
|
||||
@ -182,7 +137,37 @@ __noinline s32 savedata_op(
|
||||
}
|
||||
|
||||
// Sort the entries
|
||||
std::sort(save_entries.begin(), save_entries.end(), SortSaveDataEntry(setList->sortType, setList->sortOrder));
|
||||
{
|
||||
const u32 order = setList->sortOrder;
|
||||
const u32 type = setList->sortType;
|
||||
|
||||
if (order > CELL_SAVEDATA_SORTORDER_ASCENT || type > CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
||||
{
|
||||
// error
|
||||
}
|
||||
|
||||
std::sort(save_entries.begin(), save_entries.end(), [=](const SaveDataEntry& entry1, const SaveDataEntry& entry2)
|
||||
{
|
||||
if (order == CELL_SAVEDATA_SORTORDER_DESCENT && type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
||||
{
|
||||
return entry1.mtime >= entry2.mtime;
|
||||
}
|
||||
if (order == CELL_SAVEDATA_SORTORDER_DESCENT && type == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
||||
{
|
||||
return entry1.subtitle >= entry2.subtitle;
|
||||
}
|
||||
if (order == CELL_SAVEDATA_SORTORDER_ASCENT && type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
||||
{
|
||||
return entry1.mtime < entry2.mtime;
|
||||
}
|
||||
if (order == CELL_SAVEDATA_SORTORDER_ASCENT && type == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
||||
{
|
||||
return entry1.subtitle < entry2.subtitle;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
// Fill the listGet->dirList array
|
||||
auto dir_list = listGet->dirList.get_ptr();
|
||||
|
@ -1025,8 +1025,10 @@ s32 syncLFQueueGetPushPointer(vm::ptr<CellSyncLFQueue> queue, s32& pointer, u32
|
||||
return CELL_SYNC_ERROR_PERM;
|
||||
}
|
||||
|
||||
const s32 depth = queue->m_depth;
|
||||
|
||||
u32 var1 = 0;
|
||||
s32 depth = queue->m_depth;
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true)
|
||||
@ -1149,7 +1151,7 @@ s32 syncLFQueueCompletePushPointer(vm::ptr<CellSyncLFQueue> queue, s32 pointer,
|
||||
return CELL_SYNC_ERROR_PERM;
|
||||
}
|
||||
|
||||
s32 depth = (u32)queue->m_depth;
|
||||
const s32 depth = queue->m_depth;
|
||||
|
||||
while (true)
|
||||
{
|
||||
@ -1343,8 +1345,8 @@ s32 _cellSyncLFQueuePushBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm:
|
||||
}
|
||||
}
|
||||
|
||||
const s32 depth = (u32)queue->m_depth;
|
||||
const s32 size = (u32)queue->m_size;
|
||||
const s32 depth = queue->m_depth;
|
||||
const s32 size = queue->m_size;
|
||||
const u32 addr = vm::cast<u64>((queue->m_buffer.addr() & ~1ull) + size * (position >= depth ? position - depth : position));
|
||||
memcpy(vm::get_ptr<void>(addr), buffer.get_ptr(), size);
|
||||
|
||||
@ -1369,8 +1371,10 @@ s32 syncLFQueueGetPopPointer(vm::ptr<CellSyncLFQueue> queue, s32& pointer, u32 i
|
||||
return CELL_SYNC_ERROR_PERM;
|
||||
}
|
||||
|
||||
const s32 depth = queue->m_depth;
|
||||
|
||||
u32 var1 = 0;
|
||||
s32 depth = (u32)queue->m_depth;
|
||||
|
||||
while (true)
|
||||
{
|
||||
while (true)
|
||||
@ -1493,7 +1497,7 @@ s32 syncLFQueueCompletePopPointer(vm::ptr<CellSyncLFQueue> queue, s32 pointer, c
|
||||
return CELL_SYNC_ERROR_PERM;
|
||||
}
|
||||
|
||||
s32 depth = (u32)queue->m_depth;
|
||||
const s32 depth = queue->m_depth;
|
||||
|
||||
while (true)
|
||||
{
|
||||
@ -1686,8 +1690,8 @@ s32 _cellSyncLFQueuePopBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm::
|
||||
}
|
||||
}
|
||||
|
||||
const s32 depth = (u32)queue->m_depth;
|
||||
const s32 size = (u32)queue->m_size;
|
||||
const s32 depth = queue->m_depth;
|
||||
const s32 size = queue->m_size;
|
||||
const u32 addr = vm::cast<u64>((queue->m_buffer.addr() & ~1) + size * (position >= depth ? position - depth : position));
|
||||
memcpy(buffer.get_ptr(), vm::get_ptr<void>(addr), size);
|
||||
|
||||
@ -1807,9 +1811,9 @@ s32 cellSyncLFQueueDepth(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32> depth)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 _cellSyncLFQueueGetSignalAddress(vm::ptr<const CellSyncLFQueue> queue, vm::ptr<u32> ppSignal)
|
||||
s32 _cellSyncLFQueueGetSignalAddress(vm::ptr<const CellSyncLFQueue> queue, vm::ptr<vm::bptr<void>> ppSignal)
|
||||
{
|
||||
cellSync.Log("_cellSyncLFQueueGetSignalAddress(queue=*0x%x, ppSignal=*0x%x)", queue, ppSignal);
|
||||
cellSync.Log("_cellSyncLFQueueGetSignalAddress(queue=*0x%x, ppSignal=**0x%x)", queue, ppSignal);
|
||||
|
||||
if (!queue || !ppSignal)
|
||||
{
|
||||
@ -1820,7 +1824,8 @@ s32 _cellSyncLFQueueGetSignalAddress(vm::ptr<const CellSyncLFQueue> queue, vm::p
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
*ppSignal = (u32)queue->m_eaSignal.addr();
|
||||
*ppSignal = queue->m_eaSignal;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ s32 sys_cond_signal_all(u32 cond_id)
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (const u32 count = vm::cast(cond->waiters.size()))
|
||||
if (const u32 count = cond->waiters.size())
|
||||
{
|
||||
cond->signaled += count;
|
||||
cond->waiters.clear();
|
||||
|
@ -158,8 +158,9 @@ using fs_st_cb_t = vm::ptr<void(u32 xfd, u64 xsize)>;
|
||||
|
||||
struct fs_st_cb_rec_t
|
||||
{
|
||||
u32 size;
|
||||
u64 size;
|
||||
fs_st_cb_t func;
|
||||
u32 pad;
|
||||
};
|
||||
|
||||
struct fs_file_t
|
||||
|
@ -135,7 +135,7 @@ s32 _sys_lwcond_signal_all(u32 lwcond_id, u32 lwmutex_id, u32 mode)
|
||||
sys_lwcond.Error("_sys_lwcond_signal_all(%d): invalid mode (%d)", lwcond_id, mode);
|
||||
}
|
||||
|
||||
const u32 count = vm::cast(cond->waiters.size());
|
||||
const u32 count = cond->waiters.size();
|
||||
|
||||
if (count)
|
||||
{
|
||||
|
@ -577,7 +577,7 @@ namespace loader
|
||||
{
|
||||
if (phdr.p_memsz)
|
||||
{
|
||||
if (!vm::alloc(vm::cast(phdr.p_vaddr.addr()), vm::cast(phdr.p_memsz, "phdr.p_memsz"), vm::main))
|
||||
if (!vm::alloc(phdr.p_vaddr.addr(), phdr.p_memsz, vm::main))
|
||||
{
|
||||
LOG_ERROR(LOADER, "%s(): AllocFixed(0x%llx, 0x%llx) failed", __FUNCTION__, phdr.p_vaddr.addr(), phdr.p_memsz);
|
||||
|
||||
@ -606,7 +606,7 @@ namespace loader
|
||||
{
|
||||
m_stream->Seek(handler::get_stream_offset() + phdr.p_offset);
|
||||
m_stream->Read(phdr.p_vaddr.get_ptr(), phdr.p_filesz);
|
||||
hook_ppu_funcs(vm::ptr<u32>::make(phdr.p_vaddr.addr()), vm::cast(phdr.p_filesz) / 4);
|
||||
hook_ppu_funcs(vm::ptr<u32>::make(phdr.p_vaddr.addr()), phdr.p_filesz / 4);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -614,10 +614,7 @@ namespace loader
|
||||
|
||||
case 0x00000007: //TLS
|
||||
{
|
||||
Emu.SetTLSData(
|
||||
vm::cast(phdr.p_vaddr.addr(), "TLS: phdr.p_vaddr"),
|
||||
vm::cast(phdr.p_filesz.value(), "TLS: phdr.p_filesz"),
|
||||
vm::cast(phdr.p_memsz.value(), "TLS: phdr.p_memsz"));
|
||||
Emu.SetTLSData(phdr.p_vaddr.addr(), phdr.p_filesz, phdr.p_memsz);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user