mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
This commit is contained in:
commit
fb9dbfab3a
@ -12,7 +12,7 @@ InstrBase<TO>* GetInstruction(T* list, const std::string& str)
|
||||
|
||||
if(instr)
|
||||
{
|
||||
if(instr->GetName().compare(str) == 0)
|
||||
if(instr->GetName() == str)
|
||||
{
|
||||
return instr;
|
||||
}
|
||||
@ -59,7 +59,7 @@ s64 FindOp(const std::string& text, const std::string& op, s64 from)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ArrayF<SectionInfo> sections_list;
|
||||
std::vector<SectionInfo*> sections_list;
|
||||
u32 section_name_offs = 0;
|
||||
u32 section_offs = 0;
|
||||
|
||||
@ -68,7 +68,8 @@ SectionInfo::SectionInfo(const std::string& _name)
|
||||
name = _name;
|
||||
memset(&shdr, 0, sizeof(Elf64_Shdr));
|
||||
|
||||
section_num = sections_list.Add(this);
|
||||
sections_list.push_back(this);
|
||||
section_num = sections_list.size() - 1;
|
||||
|
||||
shdr.sh_offset = section_offs;
|
||||
shdr.sh_name = section_name_offs;
|
||||
@ -81,37 +82,37 @@ void SectionInfo::SetDataSize(u32 size, u32 align)
|
||||
if(align) shdr.sh_addralign = align;
|
||||
if(shdr.sh_addralign) size = Memory.AlignAddr(size, shdr.sh_addralign);
|
||||
|
||||
if(code.GetCount())
|
||||
if(!code.empty())
|
||||
{
|
||||
for(u32 i=section_num + 1; i<sections_list.GetCount(); ++i)
|
||||
for(u32 i=section_num + 1; i<sections_list.size(); ++i)
|
||||
{
|
||||
sections_list[i].shdr.sh_offset -= code.GetCount();
|
||||
sections_list[i]->shdr.sh_offset -= code.size();
|
||||
}
|
||||
|
||||
section_offs -= code.GetCount();
|
||||
section_offs -= code.size();
|
||||
}
|
||||
|
||||
code.SetCount(size);
|
||||
code.resize(size);
|
||||
|
||||
section_offs += size;
|
||||
|
||||
for(u32 i=section_num + 1; i<sections_list.GetCount(); ++i)
|
||||
for(u32 i=section_num + 1; i<sections_list.size(); ++i)
|
||||
{
|
||||
sections_list[i].shdr.sh_offset += size;
|
||||
sections_list[i]->shdr.sh_offset += size;
|
||||
}
|
||||
}
|
||||
|
||||
SectionInfo::~SectionInfo()
|
||||
{
|
||||
sections_list.RemoveFAt(section_num);
|
||||
sections_list.erase(sections_list.begin() + section_num);
|
||||
|
||||
for(u32 i=section_num + 1; i<sections_list.GetCount(); ++i)
|
||||
for(u32 i=section_num + 1; i<sections_list.size(); ++i)
|
||||
{
|
||||
sections_list[i].shdr.sh_offset -= code.GetCount();
|
||||
sections_list[i].shdr.sh_name -= name.length();
|
||||
sections_list[i]->shdr.sh_offset -= code.size();
|
||||
sections_list[i]->shdr.sh_name -= name.length();
|
||||
}
|
||||
|
||||
section_offs -= code.GetCount();
|
||||
section_offs -= code.size();
|
||||
section_name_offs -= name.length();
|
||||
}
|
||||
|
||||
@ -371,9 +372,9 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
|
||||
|
||||
if(str.length() > 1)
|
||||
{
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
for(const Branch& branch : m_branches)
|
||||
{
|
||||
if(str != m_branches[i].m_name)
|
||||
if(str != branch.m_name)
|
||||
continue;
|
||||
|
||||
arg.type = ARG_BRANCH;
|
||||
@ -385,14 +386,14 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
|
||||
switch((char)str[0])
|
||||
{
|
||||
case 'r': case 'f': case 'v':
|
||||
|
||||
{
|
||||
if(str.length() < 2)
|
||||
{
|
||||
arg.type = ARG_ERR;
|
||||
return;
|
||||
}
|
||||
|
||||
if(str.compare("rtoc") == 0)
|
||||
if(str == "rtoc")
|
||||
{
|
||||
arg.type = ARG_REG_R;
|
||||
arg.value = 2;
|
||||
@ -408,8 +409,7 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
|
||||
}
|
||||
}
|
||||
|
||||
u32 reg;
|
||||
sscanf(str.substr(1, str.length() - 1).c_str(), "%d", ®);
|
||||
u32 reg = std::stoul(str.substr(1, str.length() - 1));
|
||||
|
||||
if(reg >= 32)
|
||||
{
|
||||
@ -417,7 +417,7 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
|
||||
return;
|
||||
}
|
||||
|
||||
switch((char)str[0])
|
||||
switch(str[0])
|
||||
{
|
||||
case 'r': arg.type = ARG_REG_R; break;
|
||||
case 'f': arg.type = ARG_REG_F; break;
|
||||
@ -426,8 +426,9 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
|
||||
}
|
||||
|
||||
arg.value = reg;
|
||||
}
|
||||
return;
|
||||
|
||||
|
||||
case 'c':
|
||||
if(str.length() > 2 && str[1] == 'r')
|
||||
{
|
||||
@ -475,7 +476,8 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
|
||||
return;
|
||||
}
|
||||
|
||||
if(str.length() > 2 && str.substr(0, 2).compare("0x") == 0)
|
||||
// Hex numbers
|
||||
if(str.length() > 2 && str.substr(0, 2) == "0x")
|
||||
{
|
||||
for(u32 i=2; i<str.length(); ++i)
|
||||
{
|
||||
@ -489,11 +491,8 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
|
||||
return;
|
||||
}
|
||||
|
||||
u32 val;
|
||||
sscanf(str.c_str(), "0x%x", &val);
|
||||
|
||||
arg.type = ARG_NUM16;
|
||||
arg.value = val;
|
||||
arg.value = std::stoul(str, nullptr, 16);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -506,39 +505,39 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
|
||||
}
|
||||
}
|
||||
|
||||
u32 val;
|
||||
sscanf(str.c_str(), "%d", &val);
|
||||
|
||||
arg.type = ARG_NUM;
|
||||
arg.value = val;
|
||||
arg.value = std::stoul(str);
|
||||
}
|
||||
|
||||
void CompilePPUProgram::LoadArgs()
|
||||
{
|
||||
m_args.Clear();
|
||||
m_args.clear();
|
||||
m_cur_arg = 0;
|
||||
|
||||
std::string str;
|
||||
while(int r = GetArg(str))
|
||||
{
|
||||
Arg* arg = new Arg(str);
|
||||
DetectArgInfo(*arg);
|
||||
m_args.Add(arg);
|
||||
if(r == -1) break;
|
||||
m_args.emplace_back(str);
|
||||
DetectArgInfo(m_args[m_args.size() -1]);
|
||||
|
||||
if(r == -1)
|
||||
break;
|
||||
}
|
||||
|
||||
m_end_args = m_args.GetCount() > 0;
|
||||
m_end_args = m_args.size() > 0;
|
||||
}
|
||||
|
||||
u32 CompilePPUProgram::GetBranchValue(const std::string& branch)
|
||||
u32 CompilePPUProgram::GetBranchValue(const std::string& branch_name)
|
||||
{
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
for(const Branch& branch : m_branches)
|
||||
{
|
||||
if(branch != m_branches[i].m_name)
|
||||
if(branch_name != branch.m_name)
|
||||
continue;
|
||||
if(m_branches[i].m_pos >= 0) return m_text_addr + m_branches[i].m_pos * 4;
|
||||
|
||||
return m_branches[i].m_addr;
|
||||
if(branch.m_pos >= 0)
|
||||
return m_text_addr + branch.m_pos * 4;
|
||||
|
||||
return branch.m_addr;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -548,7 +547,7 @@ bool CompilePPUProgram::SetNextArgType(u32 types, bool show_err)
|
||||
{
|
||||
if(m_error) return false;
|
||||
|
||||
if(m_cur_arg >= m_args.GetCount())
|
||||
if(m_cur_arg >= m_args.size())
|
||||
{
|
||||
if(show_err)
|
||||
{
|
||||
@ -581,7 +580,7 @@ bool CompilePPUProgram::SetNextArgBranch(u8 aa, bool show_err)
|
||||
const u32 pos = m_cur_arg;
|
||||
const bool ret = SetNextArgType(ARG_BRANCH | ARG_IMM, show_err);
|
||||
|
||||
if(!aa && pos < m_args.GetCount())
|
||||
if(!aa && pos < m_args.size())
|
||||
{
|
||||
switch(m_args[pos].type)
|
||||
{
|
||||
@ -665,11 +664,12 @@ bool CompilePPUProgram::IsSpOp(const std::string& op)
|
||||
|
||||
CompilePPUProgram::Branch& CompilePPUProgram::GetBranch(const std::string& name)
|
||||
{
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
for(Branch& branch : m_branches)
|
||||
{
|
||||
if(name != m_branches[i].m_name) continue;
|
||||
if(name != branch.m_name)
|
||||
continue;
|
||||
|
||||
return m_branches[i];
|
||||
return branch;
|
||||
}
|
||||
|
||||
return m_branches[0];
|
||||
@ -679,17 +679,18 @@ void CompilePPUProgram::SetSp(const std::string& name, u32 addr, bool create)
|
||||
{
|
||||
if(create)
|
||||
{
|
||||
m_branches.Move(new Branch(name, -1, addr));
|
||||
m_branches.emplace_back(name, -1, addr);
|
||||
return;
|
||||
}
|
||||
|
||||
GetBranch(name);
|
||||
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
for(Branch& branch : m_branches)
|
||||
{
|
||||
if(name != m_branches[i].m_name)
|
||||
if(name != branch.m_name)
|
||||
continue;
|
||||
m_branches[i].m_addr = addr;
|
||||
|
||||
branch.m_addr = addr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -736,8 +737,8 @@ void CompilePPUProgram::LoadSp(const std::string& op, Elf64_Shdr& s_opd)
|
||||
|
||||
case ARG_ERR:
|
||||
{
|
||||
m_branches.Move(new Branch("", -1, 0)); //TODO: allocated with new, deleted with free()
|
||||
dst_branch = &m_branches[m_branches.GetCount() - 1];
|
||||
m_branches.emplace_back("", -1, 0);
|
||||
dst_branch = &m_branches[m_branches.size() - 1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -805,17 +806,19 @@ void CompilePPUProgram::LoadSp(const std::string& op, Elf64_Shdr& s_opd)
|
||||
src1 = src1.substr(1, src1.length()-2);
|
||||
bool founded = false;
|
||||
|
||||
for(u32 i=0; i<m_sp_string.GetCount(); ++i)
|
||||
for(const SpData& sp_str : m_sp_string)
|
||||
{
|
||||
if(src1 != m_sp_string[i].m_data) continue;
|
||||
*dst_branch = Branch(dst, -1, m_sp_string[i].m_addr);
|
||||
if(src1 != sp_str.m_data)
|
||||
continue;
|
||||
|
||||
*dst_branch = Branch(dst, -1, sp_str.m_addr);
|
||||
founded = true;
|
||||
}
|
||||
|
||||
if(!founded)
|
||||
{
|
||||
const u32 addr = s_opd.sh_addr + s_opd.sh_size;
|
||||
m_sp_string.Move(new SpData(src1, addr)); //TODO: new and free mixed
|
||||
m_sp_string.emplace_back(src1, addr);
|
||||
s_opd.sh_size += src1.length() + 1;
|
||||
*dst_branch = Branch(dst, -1, addr);
|
||||
}
|
||||
@ -827,11 +830,11 @@ void CompilePPUProgram::LoadSp(const std::string& op, Elf64_Shdr& s_opd)
|
||||
case ARG_TXT: *dst_branch = Branch(dst, -1, src1.length() - 2); break;
|
||||
case ARG_BRANCH:
|
||||
{
|
||||
for(u32 i=0; i<m_sp_string.GetCount(); ++i)
|
||||
for(const SpData& sp_str : m_sp_string)
|
||||
{
|
||||
if(m_sp_string[i].m_addr == a_src1.value)
|
||||
if(sp_str.m_addr == a_src1.value)
|
||||
{
|
||||
*dst_branch = Branch(dst, -1, m_sp_string[i].m_data.length());
|
||||
*dst_branch = Branch(dst, -1, sp_str.m_data.length());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -957,14 +960,8 @@ void CompilePPUProgram::Compile()
|
||||
m_hex_list->Clear();
|
||||
}
|
||||
|
||||
m_code.Clear();
|
||||
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
{
|
||||
m_branches[i].m_name.clear();
|
||||
}
|
||||
|
||||
m_branches.Clear();
|
||||
m_code.clear();
|
||||
m_branches.clear();
|
||||
|
||||
u32 text_size = 0;
|
||||
while(!IsEnd())
|
||||
@ -1015,7 +1012,7 @@ void CompilePPUProgram::Compile()
|
||||
struct Module
|
||||
{
|
||||
std::string m_name;
|
||||
Array<u32> m_imports;
|
||||
std::vector<u32> m_imports;
|
||||
|
||||
Module(const std::string& name, u32 import) : m_name(name)
|
||||
{
|
||||
@ -1024,17 +1021,17 @@ void CompilePPUProgram::Compile()
|
||||
|
||||
void Add(u32 import)
|
||||
{
|
||||
m_imports.AddCpy(import);
|
||||
m_imports.push_back(import);
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_name.clear();
|
||||
m_imports.Clear();
|
||||
m_imports.clear();
|
||||
}
|
||||
};
|
||||
|
||||
Array<Module> modules;
|
||||
std::vector<Module> modules;
|
||||
|
||||
FirstChar();
|
||||
while(!IsEnd())
|
||||
@ -1049,9 +1046,9 @@ void CompilePPUProgram::Compile()
|
||||
while(p > 0 && m_asm[(size_t)p] != '[') p--;
|
||||
p++;
|
||||
|
||||
std::string module, name, id;
|
||||
std::string module_name, name, id;
|
||||
|
||||
if(!GetArg(module))
|
||||
if(!GetArg(module_name))
|
||||
{
|
||||
WriteError("module not found. style: [module, name, id]");
|
||||
m_error = true;
|
||||
@ -1059,7 +1056,7 @@ void CompilePPUProgram::Compile()
|
||||
continue;
|
||||
}
|
||||
|
||||
Arg a_module(module);
|
||||
Arg a_module(module_name);
|
||||
DetectArgInfo(a_module);
|
||||
|
||||
if(~ARG_ERR & a_module.type)
|
||||
@ -1118,26 +1115,28 @@ void CompilePPUProgram::Compile()
|
||||
|
||||
if(!CheckEnd()) continue;
|
||||
|
||||
m_branches.Move(new Branch(name, a_id.value, 0)); //TODO: HACK: new and free() mixed
|
||||
const u32 import = m_branches.GetCount() - 1;
|
||||
m_branches.emplace_back(name, a_id.value, 0);
|
||||
const u32 import = m_branches.size() - 1;
|
||||
|
||||
bool founded = false;
|
||||
for(u32 i=0; i<modules.GetCount(); ++i)
|
||||
for(Module& module : modules)
|
||||
{
|
||||
if(modules[i].m_name.compare(module) != 0) continue;
|
||||
if(module.m_name != module_name)
|
||||
continue;
|
||||
|
||||
founded = true;
|
||||
modules[i].Add(import);
|
||||
module.Add(import);
|
||||
break;
|
||||
}
|
||||
|
||||
if(!founded) modules.Move(new Module(module, import));
|
||||
if(!founded) modules.emplace_back(module_name, import);
|
||||
}
|
||||
|
||||
u32 imports_count = 0;
|
||||
|
||||
for(u32 m=0; m < modules.GetCount(); ++m)
|
||||
for(const Module& module : modules)
|
||||
{
|
||||
imports_count += modules[m].m_imports.GetCount();
|
||||
imports_count += module.m_imports.size();
|
||||
}
|
||||
|
||||
Elf64_Shdr s_sceStub_text;
|
||||
@ -1154,11 +1153,13 @@ void CompilePPUProgram::Compile()
|
||||
section_name_offset += std::string(".sceStub.text").length() + 1;
|
||||
section_offset += s_sceStub_text.sh_size;
|
||||
|
||||
for(u32 m=0, pos=0; m<modules.GetCount(); ++m)
|
||||
for(const Module& module : modules)
|
||||
{
|
||||
for(u32 i=0; i<modules[m].m_imports.GetCount(); ++i, ++pos)
|
||||
u32 pos = 0;
|
||||
for(const u32& import : module.m_imports)
|
||||
{
|
||||
m_branches[modules[m].m_imports[i]].m_addr = s_sceStub_text.sh_addr + sceStub_text_block * pos;
|
||||
m_branches[import].m_addr = s_sceStub_text.sh_addr + sceStub_text_block * pos;
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1184,7 +1185,7 @@ void CompilePPUProgram::Compile()
|
||||
s_lib_stub.sh_offset = section_offset;
|
||||
s_lib_stub.sh_addr = section_offset + 0x10000;
|
||||
s_lib_stub.sh_flags = 2;
|
||||
s_lib_stub.sh_size = sizeof(Elf64_StubHeader) * modules.GetCount();
|
||||
s_lib_stub.sh_size = sizeof(Elf64_StubHeader) * modules.size();
|
||||
sections_names.push_back(".lib.stub");
|
||||
section_name_offset += std::string(".lib.stub").length() + 1;
|
||||
section_offset += s_lib_stub.sh_size;
|
||||
@ -1226,9 +1227,9 @@ void CompilePPUProgram::Compile()
|
||||
s_rodata_sceResident.sh_addr = section_offset + 0x10000;
|
||||
s_rodata_sceResident.sh_flags = 2;
|
||||
s_rodata_sceResident.sh_size = 4;
|
||||
for(u32 i=0; i<modules.GetCount(); ++i)
|
||||
for(const Module& module : modules)
|
||||
{
|
||||
s_rodata_sceResident.sh_size += modules[i].m_name.length() + 1;
|
||||
s_rodata_sceResident.sh_size += module.m_name.length() + 1;
|
||||
}
|
||||
s_rodata_sceResident.sh_size = Memory.AlignAddr(s_rodata_sceResident.sh_size, s_rodata_sceResident.sh_addralign);
|
||||
sections_names.push_back(".rodata.sceResident");
|
||||
@ -1337,9 +1338,11 @@ void CompilePPUProgram::Compile()
|
||||
{
|
||||
const std::string& name = op.substr(0, op.length() - 1);
|
||||
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
for(const Branch& branch : m_branches)
|
||||
{
|
||||
if(name != m_branches[i].m_name) continue;
|
||||
if(name != branch.m_name)
|
||||
continue;
|
||||
|
||||
WriteError(fmt::Format("'%s' already declared", name.c_str()));
|
||||
m_error = true;
|
||||
break;
|
||||
@ -1356,7 +1359,7 @@ void CompilePPUProgram::Compile()
|
||||
|
||||
if(m_error) break;
|
||||
|
||||
m_branches.Move(new Branch(name, m_branch_pos)); //TODO: HACK: free() and new mixed
|
||||
m_branches.emplace_back(name, m_branch_pos);
|
||||
|
||||
CheckEnd();
|
||||
continue;
|
||||
@ -1367,23 +1370,23 @@ void CompilePPUProgram::Compile()
|
||||
}
|
||||
|
||||
bool has_entry = false;
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
for(const Branch& branch : m_branches)
|
||||
{
|
||||
if(m_branches[i].m_name != "entry")
|
||||
if(branch.m_name != "entry")
|
||||
continue;
|
||||
|
||||
has_entry = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!has_entry) m_branches.Move(new Branch("entry", 0)); //TODO: HACK: new and free() mixed
|
||||
if(!has_entry) m_branches.emplace_back("entry", 0);
|
||||
|
||||
if(m_analyze) m_error = false;
|
||||
FirstChar();
|
||||
|
||||
while(!IsEnd())
|
||||
{
|
||||
m_args.Clear();
|
||||
m_args.clear();
|
||||
m_end_args = false;
|
||||
|
||||
std::string op;
|
||||
@ -1453,7 +1456,7 @@ void CompilePPUProgram::Compile()
|
||||
|
||||
{
|
||||
Array<u32> args;
|
||||
args.SetCount(m_args.GetCount());
|
||||
args.SetCount(m_args.size());
|
||||
for(uint i=0; i<args.GetCount(); ++i)
|
||||
{
|
||||
args[i] = m_args[i].value;
|
||||
@ -1464,7 +1467,7 @@ void CompilePPUProgram::Compile()
|
||||
|
||||
if(m_analyze) WriteHex(fmt::Format("0x%08x\n", code));
|
||||
|
||||
if(!m_analyze) m_code.AddCpy(code);
|
||||
if(!m_analyze) m_code.push_back(code);
|
||||
|
||||
m_branch_pos++;
|
||||
}
|
||||
@ -1505,11 +1508,11 @@ void CompilePPUProgram::Compile()
|
||||
|
||||
u8* opd_data = new u8[s_opd.sh_size];
|
||||
u32 entry_point = s_text.sh_addr;
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
for(const Branch& branch : m_branches)
|
||||
{
|
||||
if(m_branches[i].m_name == "entry")
|
||||
if(branch.m_name == "entry")
|
||||
{
|
||||
entry_point += m_branches[i].m_pos * 4;
|
||||
entry_point += branch.m_pos * 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1551,11 +1554,14 @@ void CompilePPUProgram::Compile()
|
||||
WriteShdr(f, s_shstrtab);
|
||||
|
||||
f.Seek(s_text.sh_offset);
|
||||
for(u32 i=0; i<m_code.GetCount(); ++i) Write32(f, m_code[i]);
|
||||
for(const u32& code : m_code)
|
||||
{
|
||||
Write32(f, code);
|
||||
}
|
||||
|
||||
f.Seek(s_opd.sh_offset);
|
||||
f.Write(opd_data, 8);
|
||||
for(u32 i=0; i<m_sp_string.GetCount(); ++i)
|
||||
for(u32 i=0; i<m_sp_string.size(); ++i)
|
||||
{
|
||||
f.Seek(s_opd.sh_offset + (m_sp_string[i].m_addr - s_opd.sh_addr));
|
||||
f.Write(&m_sp_string[i].m_data[0], m_sp_string[i].m_data.length() + 1);
|
||||
@ -1579,7 +1585,7 @@ void CompilePPUProgram::Compile()
|
||||
f.Seek(s_lib_stub_top.sh_size, wxFromCurrent);
|
||||
|
||||
f.Seek(s_lib_stub.sh_offset);
|
||||
for(u32 i=0, nameoffs=4, dataoffs=0; i<modules.GetCount(); ++i)
|
||||
for(u32 i=0, nameoffs=4, dataoffs=0; i<modules.size(); ++i)
|
||||
{
|
||||
Elf64_StubHeader stub;
|
||||
memset(&stub, 0, sizeof(Elf64_StubHeader));
|
||||
@ -1590,9 +1596,9 @@ void CompilePPUProgram::Compile()
|
||||
stub.s_modulename = re32(s_rodata_sceResident.sh_addr + nameoffs);
|
||||
stub.s_nid = re32(s_rodata_sceFNID.sh_addr + dataoffs);
|
||||
stub.s_text = re32(s_data_sceFStub.sh_addr + dataoffs);
|
||||
stub.s_imports = re16(modules[i].m_imports.GetCount());
|
||||
stub.s_imports = re16(modules[i].m_imports.size());
|
||||
|
||||
dataoffs += modules[i].m_imports.GetCount() * 4;
|
||||
dataoffs += modules[i].m_imports.size() * 4;
|
||||
|
||||
f.Write(&stub, sizeof(Elf64_StubHeader));
|
||||
nameoffs += modules[i].m_name.length() + 1;
|
||||
@ -1602,25 +1608,25 @@ void CompilePPUProgram::Compile()
|
||||
f.Seek(s_lib_stub_btm.sh_size, wxFromCurrent);
|
||||
|
||||
f.Seek(s_data_sceFStub.sh_offset);
|
||||
for(u32 m=0; m<modules.GetCount(); ++m)
|
||||
for(const Module& module : modules)
|
||||
{
|
||||
for(u32 i=0; i<modules[m].m_imports.GetCount(); ++i)
|
||||
for(const u32& import : module.m_imports)
|
||||
{
|
||||
Write32(f, m_branches[modules[m].m_imports[i]].m_addr);
|
||||
Write32(f, m_branches[import].m_addr);
|
||||
}
|
||||
}
|
||||
|
||||
f.Seek(s_rodata_sceFNID.sh_offset);
|
||||
for(u32 m=0; m<modules.GetCount(); ++m)
|
||||
for(const Module& module : modules)
|
||||
{
|
||||
for(u32 i=0; i<modules[m].m_imports.GetCount(); ++i)
|
||||
for(const u32& import : module.m_imports)
|
||||
{
|
||||
Write32(f, m_branches[modules[m].m_imports[i]].m_id);
|
||||
Write32(f, m_branches[import].m_id);
|
||||
}
|
||||
}
|
||||
|
||||
f.Seek(s_rodata_sceResident.sh_offset + 4);
|
||||
for(u32 i=0; i<modules.GetCount(); ++i)
|
||||
for(u32 i=0; i<modules.size(); ++i)
|
||||
{
|
||||
f.Write(&modules[i].m_name[0], modules[i].m_name.length() + 1);
|
||||
}
|
||||
@ -1702,21 +1708,13 @@ void CompilePPUProgram::Compile()
|
||||
|
||||
sections_names.clear();
|
||||
delete[] opd_data;
|
||||
for(u32 i=0; i<modules.GetCount(); ++i) modules[i].Clear();
|
||||
modules.Clear();
|
||||
modules.clear();
|
||||
}
|
||||
|
||||
for(u32 i=0; i<m_branches.GetCount(); ++i)
|
||||
{
|
||||
m_branches[i].m_name.clear();
|
||||
}
|
||||
|
||||
m_branches.Clear();
|
||||
|
||||
m_code.Clear();
|
||||
m_args.Clear();
|
||||
|
||||
m_sp_string.Clear();
|
||||
m_branches.clear();
|
||||
m_code.clear();
|
||||
m_args.clear();
|
||||
m_sp_string.clear();
|
||||
|
||||
if(m_err_list) m_err_list->Thaw();
|
||||
|
||||
|
@ -1,20 +1,21 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include "PPUInstrTable.h"
|
||||
#include "Loader/ELF64.h"
|
||||
|
||||
enum ArgType
|
||||
{
|
||||
ARG_ERR = 0,
|
||||
ARG_NUM = 1 << 0,
|
||||
ARG_NUM16 = 1 << 1,
|
||||
ARG_TXT = 1 << 2,
|
||||
ARG_REG_R = 1 << 3,
|
||||
ARG_REG_F = 1 << 4,
|
||||
ARG_REG_V = 1 << 5,
|
||||
ARG_REG_CR = 1 << 6,
|
||||
ARG_BRANCH = 1 << 7,
|
||||
ARG_INSTR = 1 << 8,
|
||||
ARG_IMM = ARG_NUM | ARG_NUM16 | ARG_BRANCH,
|
||||
ARG_ERR = 0,
|
||||
ARG_NUM = 1 << 0,
|
||||
ARG_NUM16 = 1 << 1,
|
||||
ARG_TXT = 1 << 2,
|
||||
ARG_REG_R = 1 << 3,
|
||||
ARG_REG_F = 1 << 4,
|
||||
ARG_REG_V = 1 << 5,
|
||||
ARG_REG_CR = 1 << 6,
|
||||
ARG_BRANCH = 1 << 7,
|
||||
ARG_INSTR = 1 << 8,
|
||||
ARG_IMM = ARG_NUM | ARG_NUM16 | ARG_BRANCH,
|
||||
};
|
||||
|
||||
struct Arg
|
||||
@ -35,7 +36,7 @@ struct SectionInfo
|
||||
{
|
||||
Elf64_Shdr shdr;
|
||||
std::string name;
|
||||
Array<u8> code;
|
||||
std::vector<u8> code;
|
||||
u32 section_num;
|
||||
|
||||
SectionInfo(const std::string& name);
|
||||
@ -46,14 +47,13 @@ struct SectionInfo
|
||||
|
||||
struct ProgramInfo
|
||||
{
|
||||
Array<u8> code;
|
||||
std::vector<u8> code;
|
||||
Elf64_Phdr phdr;
|
||||
bool is_preload;
|
||||
|
||||
ProgramInfo()
|
||||
{
|
||||
is_preload = false;
|
||||
code.Clear();
|
||||
memset(&phdr, 0, sizeof(Elf64_Phdr));
|
||||
}
|
||||
};
|
||||
@ -92,9 +92,9 @@ class CompilePPUProgram
|
||||
wxTextCtrl* m_hex_list;
|
||||
wxTextCtrl* m_err_list;
|
||||
bool m_error;
|
||||
Array<u32> m_code;
|
||||
std::vector<u32> m_code;
|
||||
bool m_end_args;
|
||||
Array<Branch> m_branches;
|
||||
std::vector<Branch> m_branches;
|
||||
s32 m_branch_pos;
|
||||
u32 m_text_addr;
|
||||
std::string m_file_path;
|
||||
@ -111,8 +111,8 @@ class CompilePPUProgram
|
||||
}
|
||||
};
|
||||
|
||||
Array<SpData> m_sp_string;
|
||||
Array<Arg> m_args;
|
||||
std::vector<SpData> m_sp_string;
|
||||
std::vector<Arg> m_args;
|
||||
u32 m_cur_arg;
|
||||
|
||||
public:
|
||||
|
@ -290,8 +290,8 @@ void GLFragmentDecompilerThread::Task()
|
||||
//case 0x12: break; // KIL
|
||||
//case 0x13: break; // PK4
|
||||
//case 0x14: break; // UP4
|
||||
case 0x15: AddCode("ddx(" + GetSRC(src0) + ")"); break; // DDX
|
||||
case 0x16: AddCode("ddy(" + GetSRC(src0) + ")"); break; // DDY
|
||||
case 0x15: AddCode("dFdx(" + GetSRC(src0) + ")"); break; // DDX
|
||||
case 0x16: AddCode("dFdy(" + GetSRC(src0) + ")"); break; // DDY
|
||||
case 0x17: AddCode("texture(" + AddTex() + ", " + GetSRC(src0) + ".xy)"); break; //TEX
|
||||
//case 0x18: break; // TXP
|
||||
//case 0x19: break; // TXD
|
||||
|
@ -137,9 +137,9 @@ struct CellVideoOutColorInfo
|
||||
|
||||
struct CellVideoOutKSVList
|
||||
{
|
||||
u8 ksv[32*5];
|
||||
u8 reserved[4];
|
||||
u32 count;
|
||||
u8 ksv[32*5];
|
||||
u8 reserved[4];
|
||||
u32 count;
|
||||
};
|
||||
|
||||
enum CellVideoOutDisplayConversion
|
||||
@ -165,8 +165,8 @@ struct CellVideoOutDisplayMode
|
||||
|
||||
struct CellVideoOutResolution
|
||||
{
|
||||
u16 width;
|
||||
u16 height;
|
||||
be_t<u16> width;
|
||||
be_t<u16> height;
|
||||
};
|
||||
|
||||
struct CellVideoOutDeviceInfo
|
||||
|
@ -101,7 +101,7 @@ u32 cellGcmGetDefaultSegmentWordSize()
|
||||
return 0x100;
|
||||
}
|
||||
|
||||
int cellGcmInitDefaultFifoMode(int mode)
|
||||
int cellGcmInitDefaultFifoMode(s32 mode)
|
||||
{
|
||||
cellGcmSys.Warning("cellGcmInitDefaultFifoMode(mode=%d)", mode);
|
||||
return CELL_OK;
|
||||
|
@ -23,6 +23,8 @@ int cellGifDecExtCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam, u
|
||||
|
||||
int cellGifDecOpen(u32 mainHandle, mem32_t subHandle, const mem_ptr_t<CellGifDecSrc> src, mem_ptr_t<CellGifDecOpnInfo> openInfo)
|
||||
{
|
||||
if (!subHandle.IsGood() || !src.IsGood())
|
||||
return CELL_GIFDEC_ERROR_ARG;
|
||||
/*
|
||||
vfsStream* stream;
|
||||
|
||||
@ -73,6 +75,9 @@ int cellGifDecOpen(u32 mainHandle, mem32_t subHandle, const mem_ptr_t<CellGifDec
|
||||
|
||||
int cellGifDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellGifDecInfo> info)
|
||||
{
|
||||
if (!info.IsGood())
|
||||
return CELL_GIFDEC_ERROR_ARG;
|
||||
|
||||
CellGifDecSubHandle* subHandle_data;
|
||||
if(!cellGifDec.CheckId(subHandle, subHandle_data))
|
||||
return CELL_GIFDEC_ERROR_FATAL;
|
||||
@ -111,6 +116,9 @@ int cellGifDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellGifDecInfo
|
||||
|
||||
int cellGifDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellGifDecInParam> inParam, mem_ptr_t<CellGifDecOutParam> outParam)
|
||||
{
|
||||
if (!inParam.IsGood() || !outParam.IsGood())
|
||||
return CELL_GIFDEC_ERROR_ARG;
|
||||
|
||||
CellGifDecSubHandle* subHandle_data;
|
||||
if(!cellGifDec.CheckId(subHandle, subHandle_data))
|
||||
return CELL_GIFDEC_ERROR_FATAL;
|
||||
@ -138,6 +146,9 @@ int cellGifDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellGi
|
||||
|
||||
int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellGifDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellGifDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
if (!data.IsGood() || !dataCtrlParam.IsGood() || !dataOutInfo.IsGood())
|
||||
return CELL_GIFDEC_ERROR_ARG;
|
||||
|
||||
dataOutInfo->status = CELL_GIFDEC_DEC_STATUS_STOP;
|
||||
|
||||
CellGifDecSubHandle* subHandle_data;
|
||||
|
@ -30,6 +30,9 @@ int cellJpgDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t<CellJpgDecSrc> s
|
||||
cellJpgDec.Warning("cellJpgDecOpen(mainHandle=0x%x, subHandle=0x%x, src_addr=0x%x, openInfo=0x%x)",
|
||||
mainHandle, subHandle.GetAddr(), src.GetAddr(), openInfo);
|
||||
|
||||
if (!subHandle.IsGood() || !src.IsGood() || !openInfo.IsGood())
|
||||
return CELL_JPGDEC_ERROR_ARG;
|
||||
|
||||
CellJpgDecSubHandle *current_subHandle = new CellJpgDecSubHandle;
|
||||
|
||||
// Get file descriptor
|
||||
@ -65,6 +68,10 @@ int cellJpgDecClose(u32 mainHandle, u32 subHandle)
|
||||
int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellJpgDecInfo> info)
|
||||
{
|
||||
cellJpgDec.Log("cellJpgDecReadHeader(mainHandle=0x%x, subHandle=0x%x, info_addr=0x%llx)", mainHandle, subHandle, info.GetAddr());
|
||||
|
||||
if (!info.IsGood())
|
||||
return CELL_JPGDEC_ERROR_ARG;
|
||||
|
||||
CellJpgDecSubHandle* subHandle_data;
|
||||
if(!cellJpgDec.CheckId(subHandle, subHandle_data))
|
||||
return CELL_JPGDEC_ERROR_FATAL;
|
||||
@ -121,6 +128,9 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellJpgDecInfo
|
||||
|
||||
int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellJpgDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellJpgDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
if (!data.IsGood() || !dataCtrlParam.IsGood() || !dataOutInfo.IsGood())
|
||||
return CELL_JPGDEC_ERROR_ARG;
|
||||
|
||||
dataOutInfo->status = CELL_JPGDEC_DEC_STATUS_STOP;
|
||||
CellJpgDecSubHandle* subHandle_data;
|
||||
if(!cellJpgDec.CheckId(subHandle, subHandle_data))
|
||||
@ -185,6 +195,9 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
|
||||
int cellJpgDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellJpgDecInParam> inParam, mem_ptr_t<CellJpgDecOutParam> outParam)
|
||||
{
|
||||
if (!inParam.IsGood() || !outParam.IsGood())
|
||||
return CELL_JPGDEC_ERROR_ARG;
|
||||
|
||||
CellJpgDecSubHandle* subHandle_data;
|
||||
if(!cellJpgDec.CheckId(subHandle, subHandle_data))
|
||||
return CELL_JPGDEC_ERROR_FATAL;
|
||||
|
@ -524,7 +524,7 @@ int cellPamfEpIteratorGetEp(mem_ptr_t<CellPamfEpIterator> pIt, mem_ptr_t<CellPam
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellPamfEpIteratorMove(mem_ptr_t<CellPamfEpIterator> pIt, int steps, mem_ptr_t<CellPamfEp> pEp)
|
||||
int cellPamfEpIteratorMove(mem_ptr_t<CellPamfEpIterator> pIt, s32 steps, mem_ptr_t<CellPamfEp> pEp)
|
||||
{
|
||||
cellPamf.Error("cellPamfEpIteratorMove(pIt_addr=0x%x, steps=%d, pEp_addr=0x%x)", pIt.GetAddr(), steps, pEp.GetAddr());
|
||||
//TODO:
|
||||
|
@ -24,6 +24,9 @@ int cellPngDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t<CellPngDecSrc> s
|
||||
cellPngDec.Warning("cellPngDecOpen(mainHandle=0x%x, subHandle=0x%x, src_addr=0x%x, openInfo=0x%x)",
|
||||
mainHandle, subHandle.GetAddr(), src.GetAddr(), openInfo);
|
||||
|
||||
if (!subHandle.IsGood() || !src.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
CellPngDecSubHandle *current_subHandle = new CellPngDecSubHandle;
|
||||
|
||||
current_subHandle->fd = NULL;
|
||||
@ -38,7 +41,7 @@ int cellPngDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t<CellPngDecSrc> s
|
||||
case const_se_t<u32, CELL_PNGDEC_FILE>::value:
|
||||
// Get file descriptor
|
||||
MemoryAllocator<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(src->fileName, 0, fd, NULL, 0);
|
||||
int ret = cellFsOpen(src->fileName_addr, 0, fd.GetAddr(), NULL, 0);
|
||||
current_subHandle->fd = fd->ToLE();
|
||||
if(ret != CELL_OK) return CELL_PNGDEC_ERROR_OPEN_FILE;
|
||||
|
||||
@ -72,6 +75,9 @@ int cellPngDecClose(u32 mainHandle, u32 subHandle)
|
||||
|
||||
int cellPngDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellPngDecInfo> info)
|
||||
{
|
||||
if (!info.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
cellPngDec.Warning("cellPngDecReadHeader(mainHandle=0x%x, subHandle=0x%x, info_addr=0x%llx)", mainHandle, subHandle, info.GetAddr());
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec.CheckId(subHandle, subHandle_data))
|
||||
@ -94,8 +100,8 @@ int cellPngDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellPngDecInfo
|
||||
Memory.Copy(buffer.GetAddr(), subHandle_data->src.streamPtr.ToLE(), buffer.GetSize());
|
||||
break;
|
||||
case CELL_PNGDEC_FILE:
|
||||
cellFsLseek(fd, 0, CELL_SEEK_SET, pos);
|
||||
cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread);
|
||||
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
|
||||
cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread.GetAddr());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -129,6 +135,9 @@ int cellPngDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellPngDecInfo
|
||||
|
||||
int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellPngDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellPngDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
if (!data.IsGood() || !dataCtrlParam.IsGood() || !dataOutInfo.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
dataOutInfo->status = CELL_PNGDEC_DEC_STATUS_STOP;
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec.CheckId(subHandle, subHandle_data))
|
||||
@ -148,8 +157,8 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
Memory.Copy(png.GetAddr(), subHandle_data->src.streamPtr.ToLE(), png.GetSize());
|
||||
break;
|
||||
case CELL_PNGDEC_FILE:
|
||||
cellFsLseek(fd, 0, CELL_SEEK_SET, pos);
|
||||
cellFsRead(fd, png.GetAddr(), png.GetSize(), nread);
|
||||
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
|
||||
cellFsRead(fd, png.GetAddr(), png.GetSize(), nread.GetAddr());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -234,6 +243,9 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
|
||||
int cellPngDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellPngDecInParam> inParam, mem_ptr_t<CellPngDecOutParam> outParam)
|
||||
{
|
||||
if (!inParam.IsGood() || !outParam.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec.CheckId(subHandle, subHandle_data))
|
||||
return CELL_PNGDEC_ERROR_FATAL;
|
||||
|
@ -37,6 +37,19 @@ enum CellPngDecStreamSrcSel
|
||||
CELL_PNGDEC_BUFFER = 1,
|
||||
};
|
||||
|
||||
enum CellPngDecInterlaceMode
|
||||
{
|
||||
CELL_PNGDEC_NO_INTERLACE = 0,
|
||||
CELL_PNGDEC_ADAM7_INTERLACE = 1,
|
||||
};
|
||||
|
||||
enum CellPngDecOutputMode
|
||||
{
|
||||
CELL_PNGDEC_TOP_TO_BOTTOM = 0,
|
||||
CELL_PNGDEC_BOTTOM_TO_TOP = 1,
|
||||
};
|
||||
|
||||
// Structs
|
||||
struct CellPngDecDataOutInfo
|
||||
{
|
||||
be_t<u32> chunkInformation;
|
||||
@ -55,31 +68,31 @@ struct CellPngDecInfo
|
||||
be_t<u32> imageWidth;
|
||||
be_t<u32> imageHeight;
|
||||
be_t<u32> numComponents;
|
||||
be_t<u32> colorSpace; // CellPngDecColorSpace
|
||||
be_t<u32> colorSpace; // CellPngDecColorSpace
|
||||
be_t<u32> bitDepth;
|
||||
be_t<u32> interlaceMethod; // CellPngDecInterlaceMode
|
||||
be_t<u32> interlaceMethod; // CellPngDecInterlaceMode
|
||||
be_t<u32> chunkInformation;
|
||||
};
|
||||
|
||||
struct CellPngDecSrc
|
||||
{
|
||||
be_t<u32> srcSelect; // CellPngDecStreamSrcSel
|
||||
be_t<u32> fileName; // const char*
|
||||
be_t<u64> fileOffset; // int64_t
|
||||
be_t<u32> srcSelect; // CellPngDecStreamSrcSel
|
||||
be_t<u32> fileName_addr; // const char*
|
||||
be_t<s64> fileOffset;
|
||||
be_t<u32> fileSize;
|
||||
be_t<u32> streamPtr;
|
||||
be_t<u32> streamSize;
|
||||
be_t<u32> spuThreadEnable; // CellPngDecSpuThreadEna
|
||||
be_t<u32> spuThreadEnable; // CellPngDecSpuThreadEna
|
||||
};
|
||||
|
||||
struct CellPngDecInParam
|
||||
{
|
||||
be_t<u32> commandPtr;
|
||||
be_t<u32> outputMode; // CellPngDecOutputMode
|
||||
be_t<u32> outputColorSpace; // CellPngDecColorSpace
|
||||
be_t<u32> outputMode; // CellPngDecOutputMode
|
||||
be_t<u32> outputColorSpace; // CellPngDecColorSpace
|
||||
be_t<u32> outputBitDepth;
|
||||
be_t<u32> outputPackFlag; // CellPngDecPackFlag
|
||||
be_t<u32> outputAlphaSelect; // CellPngDecAlphaSelect
|
||||
be_t<u32> outputPackFlag; // CellPngDecPackFlag
|
||||
be_t<u32> outputAlphaSelect; // CellPngDecAlphaSelect
|
||||
be_t<u32> outputColorAlpha;
|
||||
};
|
||||
|
||||
@ -90,12 +103,13 @@ struct CellPngDecOutParam
|
||||
be_t<u32> outputHeight;
|
||||
be_t<u32> outputComponents;
|
||||
be_t<u32> outputBitDepth;
|
||||
be_t<u32> outputMode; // CellPngDecOutputMode
|
||||
be_t<u32> outputColorSpace; // CellPngDecColorSpace
|
||||
be_t<u32> outputMode; // CellPngDecOutputMode
|
||||
be_t<u32> outputColorSpace; // CellPngDecColorSpace
|
||||
be_t<u32> useMemorySpace;
|
||||
};
|
||||
|
||||
struct CellPngDecSubHandle //Custom struct
|
||||
//Custom structs
|
||||
struct CellPngDecSubHandle
|
||||
{
|
||||
u32 fd;
|
||||
u64 fileSize;
|
||||
|
@ -20,460 +20,468 @@ u64 convertToWin32FILETIME(u16 seconds, u16 minutes, u16 hours, u16 days, int ye
|
||||
return win32filetime;
|
||||
}
|
||||
|
||||
int cellRtcGetCurrentTick(mem64_t tick)
|
||||
int cellRtcGetCurrentTick(mem_ptr_t<CellRtcTick> pTick)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetCurrentTick(tick_addr=0x%x)", tick.GetAddr());
|
||||
cellRtc.Log("cellRtcGetCurrentTick(pTick=0x%x)", pTick.GetAddr());
|
||||
|
||||
if (!pTick.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime unow = wxDateTime::UNow();
|
||||
tick = unow.GetTicks();
|
||||
pTick->tick = unow.GetTicks();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcGetCurrentClock(u32 clock_addr, int time_zone)
|
||||
int cellRtcGetCurrentClock(mem_ptr_t<CellRtcDateTime> pClock, s32 iTimeZone)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetCurrentClock(clock_addr=0x%x, time_zone=%d)", clock_addr, time_zone);
|
||||
cellRtc.Log("cellRtcGetCurrentClock(pClock=0x%x, time_zone=%d)", pClock.GetAddr(), iTimeZone);
|
||||
|
||||
if (!pClock.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime unow = wxDateTime::UNow();
|
||||
|
||||
// Add time_zone as offset in minutes.
|
||||
wxTimeSpan tz = wxTimeSpan::wxTimeSpan(0, (long) time_zone, 0, 0);
|
||||
wxTimeSpan tz = wxTimeSpan::wxTimeSpan(0, (long) iTimeZone, 0, 0);
|
||||
unow.Add(tz);
|
||||
|
||||
Memory.Write16(clock_addr, unow.GetYear(wxDateTime::TZ::UTC));
|
||||
Memory.Write16(clock_addr + 2, unow.GetMonth(wxDateTime::TZ::UTC));
|
||||
Memory.Write16(clock_addr + 4, unow.GetDay(wxDateTime::TZ::UTC));
|
||||
Memory.Write16(clock_addr + 6, unow.GetHour(wxDateTime::TZ::UTC));
|
||||
Memory.Write16(clock_addr + 8, unow.GetMinute(wxDateTime::TZ::UTC));
|
||||
Memory.Write16(clock_addr + 10, unow.GetSecond(wxDateTime::TZ::UTC));
|
||||
Memory.Write32(clock_addr + 12, unow.GetMillisecond(wxDateTime::TZ::UTC) * 1000);
|
||||
pClock->year = unow.GetYear(wxDateTime::TZ::UTC);
|
||||
pClock->month = unow.GetMonth(wxDateTime::TZ::UTC);
|
||||
pClock->day = unow.GetDay(wxDateTime::TZ::UTC);
|
||||
pClock->hour = unow.GetHour(wxDateTime::TZ::UTC);
|
||||
pClock->minute = unow.GetMinute(wxDateTime::TZ::UTC);
|
||||
pClock->second = unow.GetSecond(wxDateTime::TZ::UTC);
|
||||
pClock->microsecond = unow.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcGetCurrentClockLocalTime(u32 clock_addr)
|
||||
int cellRtcGetCurrentClockLocalTime(mem_ptr_t<CellRtcDateTime> pClock)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetCurrentClockLocalTime(clock_addr=0x%x)", clock_addr);
|
||||
cellRtc.Log("cellRtcGetCurrentClockLocalTime(pClock=0x%x)", pClock.GetAddr());
|
||||
|
||||
if (!pClock.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime unow = wxDateTime::UNow();
|
||||
|
||||
Memory.Write16(clock_addr, unow.GetYear(wxDateTime::TZ::Local));
|
||||
Memory.Write16(clock_addr + 2, unow.GetMonth(wxDateTime::TZ::Local));
|
||||
Memory.Write16(clock_addr + 4, unow.GetDay(wxDateTime::TZ::Local));
|
||||
Memory.Write16(clock_addr + 6, unow.GetHour(wxDateTime::TZ::Local));
|
||||
Memory.Write16(clock_addr + 8, unow.GetMinute(wxDateTime::TZ::Local));
|
||||
Memory.Write16(clock_addr + 10, unow.GetSecond(wxDateTime::TZ::Local));
|
||||
Memory.Write32(clock_addr + 12, unow.GetMillisecond(wxDateTime::TZ::Local) * 1000);
|
||||
pClock->year = unow.GetYear(wxDateTime::TZ::Local);
|
||||
pClock->month = unow.GetMonth(wxDateTime::TZ::Local);
|
||||
pClock->day = unow.GetDay(wxDateTime::TZ::Local);
|
||||
pClock->hour = unow.GetHour(wxDateTime::TZ::Local);
|
||||
pClock->minute = unow.GetMinute(wxDateTime::TZ::Local);
|
||||
pClock->second = unow.GetSecond(wxDateTime::TZ::Local);
|
||||
pClock->microsecond = unow.GetMillisecond(wxDateTime::TZ::Local) * 1000;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcFormatRfc2822(u32 rfc_addr, u32 tick_addr, int time_zone)
|
||||
int cellRtcFormatRfc2822(u32 pszDateTime_addr, mem_ptr_t<CellRtcTick> pUtc, s32 iTimeZone)
|
||||
{
|
||||
cellRtc.Log("cellRtcFormatRfc2822(rfc_addr=0x%x, tick_addr=0x%x, time_zone=%d)", rfc_addr, tick_addr, time_zone);
|
||||
CellRtcTick current_tick;
|
||||
current_tick.tick = Memory.Read64(tick_addr);
|
||||
cellRtc.Log("cellRtcFormatRfc2822(pszDateTime_addr=0x%x, pUtc=0x%x, time_zone=%d)", pszDateTime_addr, pUtc.GetAddr(), iTimeZone);
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Add time_zone as offset in minutes.
|
||||
wxTimeSpan tz = wxTimeSpan::wxTimeSpan(0, (long) time_zone, 0, 0);
|
||||
wxTimeSpan tz = wxTimeSpan::wxTimeSpan(0, (long) iTimeZone, 0, 0);
|
||||
|
||||
// Get date from ticks + tz.
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)current_tick.tick);
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pUtc->tick);
|
||||
date.Add(tz);
|
||||
|
||||
// Format date string in RFC2822 format (e.g.: Mon, 01 Jan 1990 12:00:00 +0000).
|
||||
const std::string& str = fmt::ToUTF8(date.Format("%a, %d %b %Y %T %z", wxDateTime::TZ::UTC));
|
||||
Memory.WriteString(rfc_addr, str);
|
||||
Memory.WriteString(pszDateTime_addr, str);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcFormatRfc2822LocalTime(u32 rfc_addr, u32 tick_addr)
|
||||
int cellRtcFormatRfc2822LocalTime(u32 pszDateTime_addr, mem_ptr_t<CellRtcTick> pUtc)
|
||||
{
|
||||
cellRtc.Log("cellRtcFormatRfc2822LocalTime(rfc_addr=0x%x, tick_addr=0x%x)", rfc_addr, tick_addr);
|
||||
CellRtcTick current_tick;
|
||||
current_tick.tick = Memory.Read64(tick_addr);
|
||||
cellRtc.Log("cellRtcFormatRfc2822LocalTime(pszDateTime_addr=0x%x, pUtc=0x%x)", pszDateTime_addr, pUtc.GetAddr());
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Get date from ticks.
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)current_tick.tick);
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pUtc->tick);
|
||||
|
||||
// Format date string in RFC2822 format (e.g.: Mon, 01 Jan 1990 12:00:00 +0000).
|
||||
const std::string& str = fmt::ToUTF8(date.Format("%a, %d %b %Y %T %z", wxDateTime::TZ::Local));
|
||||
Memory.WriteString(rfc_addr, str);
|
||||
Memory.WriteString(pszDateTime_addr, str);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcFormatRfc3339(u32 rfc_addr, u32 tick_addr, int time_zone)
|
||||
int cellRtcFormatRfc3339(u32 pszDateTime_addr, mem_ptr_t<CellRtcTick> pUtc, s32 iTimeZone)
|
||||
{
|
||||
cellRtc.Log("cellRtcFormatRfc3339(rfc_addr=0x%x, tick_addr=0x%x, time_zone=%d)", rfc_addr, tick_addr, time_zone);
|
||||
CellRtcTick current_tick;
|
||||
current_tick.tick = Memory.Read64(tick_addr);
|
||||
cellRtc.Log("cellRtcFormatRfc3339(pszDateTime_addr=0x%x, pUtc=0x%x, iTimeZone=%d)", pszDateTime_addr, pUtc.GetAddr(), iTimeZone);
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Add time_zone as offset in minutes.
|
||||
wxTimeSpan tz = wxTimeSpan::wxTimeSpan(0, (long) time_zone, 0, 0);
|
||||
wxTimeSpan tz = wxTimeSpan::wxTimeSpan(0, (long) iTimeZone, 0, 0);
|
||||
|
||||
// Get date from ticks + tz.
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)current_tick.tick);
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pUtc->tick);
|
||||
date.Add(tz);
|
||||
|
||||
// Format date string in RFC3339 format (e.g.: 1990-01-01T12:00:00.00Z).
|
||||
const std::string& str = fmt::ToUTF8(date.Format("%FT%T.%zZ", wxDateTime::TZ::UTC));
|
||||
Memory.WriteString(rfc_addr, str);
|
||||
Memory.WriteString(pszDateTime_addr, str);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcFormatRfc3339LocalTime(u32 rfc_addr, u32 tick_addr)
|
||||
int cellRtcFormatRfc3339LocalTime(u32 pszDateTime_addr, mem_ptr_t<CellRtcTick> pUtc)
|
||||
{
|
||||
cellRtc.Log("cellRtcFormatRfc3339LocalTime(rfc_addr=0x%x, tick_addr=0x%x)", rfc_addr, tick_addr);
|
||||
CellRtcTick current_tick;
|
||||
current_tick.tick = Memory.Read64(tick_addr);
|
||||
cellRtc.Log("cellRtcFormatRfc3339LocalTime(pszDateTime_addr=0x%x, pUtc=0x%x)", pszDateTime_addr, pUtc.GetAddr());
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Get date from ticks.
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)current_tick.tick);
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t) pUtc->tick);
|
||||
|
||||
// Format date string in RFC3339 format (e.g.: 1990-01-01T12:00:00.00Z).
|
||||
const std::string& str = fmt::ToUTF8(date.Format("%FT%T.%zZ", wxDateTime::TZ::Local));
|
||||
Memory.WriteString(rfc_addr, str);
|
||||
Memory.WriteString(pszDateTime_addr, str);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcParseDateTime(mem64_t tick, u32 datetime_addr)
|
||||
int cellRtcParseDateTime(mem_ptr_t<CellRtcTick> pUtc, u32 pszDateTime_addr)
|
||||
{
|
||||
cellRtc.Log("cellRtcParseDateTime(tick_addr=0x%x, datetime_addr=0x%x)", tick.GetAddr(), datetime_addr);
|
||||
|
||||
const std::string& format = Memory.ReadString(datetime_addr);
|
||||
cellRtc.Log("cellRtcParseDateTime(pUtc=0x%x, pszDateTime_addr=0x%x)", pUtc.GetAddr(), pszDateTime_addr);
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Get date from formatted string.
|
||||
wxDateTime date;
|
||||
const std::string& format = Memory.ReadString(pszDateTime_addr);
|
||||
date.ParseDateTime(fmt::FromUTF8(format));
|
||||
|
||||
tick = date.GetTicks();
|
||||
pUtc->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcParseRfc3339(mem64_t tick, u32 datetime_addr)
|
||||
int cellRtcParseRfc3339(mem_ptr_t<CellRtcTick> pUtc, u32 pszDateTime_addr)
|
||||
{
|
||||
cellRtc.Log("cellRtcParseRfc3339(tick_addr=0x%x, datetime_addr=0x%x)", tick.GetAddr(), datetime_addr);
|
||||
cellRtc.Log("cellRtcParseRfc3339(pUtc=0x%x, pszDateTime_addr=0x%x)", pUtc.GetAddr(), pszDateTime_addr);
|
||||
|
||||
const std::string& format = Memory.ReadString(datetime_addr);
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Get date from RFC3339 formatted string.
|
||||
wxDateTime date;
|
||||
const std::string& format = Memory.ReadString(pszDateTime_addr);
|
||||
date.ParseDateTime(fmt::FromUTF8(format));
|
||||
|
||||
tick = date.GetTicks();
|
||||
pUtc->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcGetTick(u32 clock_addr, mem64_t tick)
|
||||
int cellRtcGetTick(mem_ptr_t<CellRtcDateTime> pTime, mem_ptr_t<CellRtcTick> pTick)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetTick(clock_addr=0x%x, tick_addr=0x%x)", clock_addr, tick.GetAddr());
|
||||
cellRtc.Log("cellRtcGetTick(pTime=0x%x, pTick=0x%x)", pTime.GetAddr(), pTick.GetAddr());
|
||||
|
||||
CellRtcDateTime clock;
|
||||
clock.year = Memory.Read16(clock_addr);
|
||||
clock.month = Memory.Read16(clock_addr + 2);
|
||||
clock.day = Memory.Read16(clock_addr + 4);
|
||||
clock.hour = Memory.Read16(clock_addr + 6);
|
||||
clock.minute = Memory.Read16(clock_addr + 8);
|
||||
clock.second = Memory.Read16(clock_addr + 10);
|
||||
clock.microsecond = Memory.Read32(clock_addr + 12);
|
||||
if (!pTime.IsGood() || !pTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime datetime = wxDateTime::wxDateTime(clock.day, (wxDateTime::Month)clock.month, clock.year, clock.hour, clock.minute, clock.second, (clock.microsecond / 1000));
|
||||
tick = datetime.GetTicks();
|
||||
wxDateTime datetime = wxDateTime::wxDateTime(pTime->day, (wxDateTime::Month)pTime->month.ToLE(), pTime->year, pTime->hour, pTime->minute, pTime->second, (pTime->microsecond / 1000));
|
||||
pTick->tick = datetime.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcSetTick(u32 clock_addr, u32 tick_addr)
|
||||
int cellRtcSetTick(mem_ptr_t<CellRtcDateTime> pTime, mem_ptr_t<CellRtcTick> pTick)
|
||||
{
|
||||
cellRtc.Log("cellRtcSetTick(clock_addr=0x%x, tick_addr=0x%x)", clock_addr, tick_addr);
|
||||
CellRtcTick current_tick;
|
||||
current_tick.tick = Memory.Read64(tick_addr);
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)current_tick.tick);
|
||||
|
||||
CellRtcDateTime clock;
|
||||
clock.year = date.GetYear(wxDateTime::TZ::UTC);
|
||||
clock.month = date.GetMonth(wxDateTime::TZ::UTC);
|
||||
clock.day = date.GetDay(wxDateTime::TZ::UTC);
|
||||
clock.hour = date.GetHour(wxDateTime::TZ::UTC);
|
||||
clock.minute = date.GetMinute(wxDateTime::TZ::UTC);
|
||||
clock.second = date.GetSecond(wxDateTime::TZ::UTC);
|
||||
clock.microsecond = date.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
|
||||
Memory.Write16(clock_addr, clock.year);
|
||||
Memory.Write16(clock_addr + 2, clock.month);
|
||||
Memory.Write16(clock_addr + 4, clock.day);
|
||||
Memory.Write16(clock_addr + 6, clock.hour);
|
||||
Memory.Write16(clock_addr + 8, clock.minute);
|
||||
Memory.Write16(clock_addr + 10, clock.second);
|
||||
Memory.Write32(clock_addr + 12, clock.microsecond);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddTicks(mem64_t tick, u32 tick_add_addr, long add)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddTicks(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
tick = Memory.Read64(tick_add_addr) + add;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddMicroseconds(mem64_t tick, u32 tick_add_addr, long add)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddMicroseconds(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
cellRtc.Log("cellRtcSetTick(pTime=0x%x, pTick=0x%x)", pTime.GetAddr(), pTick.GetAddr());
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_add_addr));
|
||||
wxTimeSpan microseconds = wxTimeSpan::wxTimeSpan(0, 0, 0, add / 1000);
|
||||
if (!pTime.IsGood() || !pTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick->tick);
|
||||
|
||||
pTime->year = date.GetYear(wxDateTime::TZ::UTC);
|
||||
pTime->month = date.GetMonth(wxDateTime::TZ::UTC);
|
||||
pTime->day = date.GetDay(wxDateTime::TZ::UTC);
|
||||
pTime->hour = date.GetHour(wxDateTime::TZ::UTC);
|
||||
pTime->minute = date.GetMinute(wxDateTime::TZ::UTC);
|
||||
pTime->second = date.GetSecond(wxDateTime::TZ::UTC);
|
||||
pTime->microsecond = date.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddTicks(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s64 lAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddTicks(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
pTick0->tick = pTick1->tick + lAdd;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddMicroseconds(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s64 lAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddMicroseconds(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick1->tick);
|
||||
wxTimeSpan microseconds = wxTimeSpan::wxTimeSpan(0, 0, 0, lAdd / 1000);
|
||||
date.Add(microseconds);
|
||||
tick = date.GetTicks();
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddSeconds(mem64_t tick, u32 tick_add_addr, long add)
|
||||
int cellRtcTickAddSeconds(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s64 lAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddSeconds(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
cellRtc.Log("cellRtcTickAddSeconds(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_add_addr));
|
||||
wxTimeSpan seconds = wxTimeSpan::wxTimeSpan(0, 0, add, 0);
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick1->tick);
|
||||
wxTimeSpan seconds = wxTimeSpan::wxTimeSpan(0, 0, lAdd, 0);
|
||||
date.Add(seconds);
|
||||
tick = date.GetTicks();
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddMinutes(mem64_t tick, u32 tick_add_addr, long add)
|
||||
int cellRtcTickAddMinutes(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s64 lAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddMinutes(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
cellRtc.Log("cellRtcTickAddMinutes(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_add_addr));
|
||||
wxTimeSpan minutes = wxTimeSpan::wxTimeSpan(0, add, 0, 0);
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick1->tick);
|
||||
wxTimeSpan minutes = wxTimeSpan::wxTimeSpan(0, lAdd, 0, 0);
|
||||
date.Add(minutes);
|
||||
tick = date.GetTicks();
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddHours(mem64_t tick, u32 tick_add_addr, int add)
|
||||
int cellRtcTickAddHours(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddHours(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
cellRtc.Log("cellRtcTickAddHours(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_add_addr));
|
||||
wxTimeSpan hours = wxTimeSpan::wxTimeSpan(add, 0, 0, 0);
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick1->tick);
|
||||
wxTimeSpan hours = wxTimeSpan::wxTimeSpan(iAdd, 0, 0, 0);
|
||||
date.Add(hours);
|
||||
tick = date.GetTicks();
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddDays(mem64_t tick, u32 tick_add_addr, int add)
|
||||
int cellRtcTickAddDays(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddDays(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
cellRtc.Log("cellRtcTickAddDays(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_add_addr));
|
||||
wxDateSpan days = wxDateSpan::wxDateSpan(0, 0, 0, add);
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick1->tick);
|
||||
wxDateSpan days = wxDateSpan::wxDateSpan(0, 0, 0, iAdd);
|
||||
date.Add(days);
|
||||
tick = date.GetTicks();
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddWeeks(mem64_t tick, u32 tick_add_addr, int add)
|
||||
int cellRtcTickAddWeeks(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddWeeks(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
cellRtc.Log("cellRtcTickAddWeeks(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_add_addr));
|
||||
wxDateSpan weeks = wxDateSpan::wxDateSpan(0, 0, add, 0);
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick1->tick);
|
||||
wxDateSpan weeks = wxDateSpan::wxDateSpan(0, 0, iAdd, 0);
|
||||
date.Add(weeks);
|
||||
tick = date.GetTicks();
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddMonths(mem64_t tick, u32 tick_add_addr, int add)
|
||||
int cellRtcTickAddMonths(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddMonths(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
cellRtc.Log("cellRtcTickAddMonths(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_add_addr));
|
||||
wxDateSpan months = wxDateSpan::wxDateSpan(0, add, 0, 0);
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick1->tick);
|
||||
wxDateSpan months = wxDateSpan::wxDateSpan(0, iAdd, 0, 0);
|
||||
date.Add(months);
|
||||
tick = date.GetTicks();
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcTickAddYears(mem64_t tick, u32 tick_add_addr, int add)
|
||||
int cellRtcTickAddYears(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc.Log("cellRtcTickAddYears(tick_addr=0x%x, tick_add_addr=0x%x, add=%l)", tick.GetAddr(), tick_add_addr, add);
|
||||
cellRtc.Log("cellRtcTickAddYears(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_add_addr));
|
||||
wxDateSpan years = wxDateSpan::wxDateSpan(add, 0, 0, 0);
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date = wxDateTime::wxDateTime((time_t)pTick1->tick);
|
||||
wxDateSpan years = wxDateSpan::wxDateSpan(iAdd, 0, 0, 0);
|
||||
date.Add(years);
|
||||
tick = date.GetTicks();
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcConvertUtcToLocalTime(u32 tick_utc_addr, mem64_t tick_local)
|
||||
int cellRtcConvertUtcToLocalTime(mem_ptr_t<CellRtcTick> pUtc, mem_ptr_t<CellRtcTick> pLocalTime)
|
||||
{
|
||||
cellRtc.Log("cellRtcConvertUtcToLocalTime(tick_utc_addr=0x%x, tick_local_addr=0x%x)", tick_utc_addr, tick_local.GetAddr());
|
||||
wxDateTime time = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_utc_addr));
|
||||
cellRtc.Log("cellRtcConvertUtcToLocalTime(pUtc=0x%x, pLocalTime=0x%x)", pUtc.GetAddr(), pLocalTime.GetAddr());
|
||||
|
||||
if (!pUtc.IsGood() || !pLocalTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime time = wxDateTime::wxDateTime((time_t)pUtc->tick);
|
||||
wxDateTime local_time = time.FromUTC(false);
|
||||
tick_local = local_time.GetTicks();
|
||||
pLocalTime->tick = local_time.GetTicks();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcConvertLocalTimeToUtc(u32 tick_local_addr, mem64_t tick_utc)
|
||||
int cellRtcConvertLocalTimeToUtc(mem_ptr_t<CellRtcTick> pLocalTime, mem_ptr_t<CellRtcTick> pUtc)
|
||||
{
|
||||
cellRtc.Log("cellRtcConvertLocalTimeToUtc(tick_local_addr=0x%x, tick_utc_addr=0x%x)", tick_local_addr, tick_utc.GetAddr());
|
||||
wxDateTime time = wxDateTime::wxDateTime((time_t)Memory.Read64(tick_local_addr));
|
||||
cellRtc.Log("cellRtcConvertLocalTimeToUtc(pLocalTime=0x%x, pUtc=0x%x)", pLocalTime.GetAddr(), pUtc.GetAddr());
|
||||
|
||||
if (!pLocalTime.IsGood() || !pUtc.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime time = wxDateTime::wxDateTime((time_t)pLocalTime->tick);
|
||||
wxDateTime utc_time = time.ToUTC(false);
|
||||
tick_utc = utc_time.GetTicks();
|
||||
pUtc->tick = utc_time.GetTicks();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcGetDosTime(u32 datetime_addr, mem64_t dos_time)
|
||||
int cellRtcGetDosTime(mem_ptr_t<CellRtcDateTime> pDateTime, mem32_t puiDosTime)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetDosTime(datetime_addr=0x%x, dos_time_addr=0x%x)", datetime_addr, dos_time.GetAddr());
|
||||
CellRtcDateTime datetime;
|
||||
datetime.year = Memory.Read16(datetime_addr);
|
||||
datetime.month = Memory.Read16(datetime_addr + 2);
|
||||
datetime.day = Memory.Read16(datetime_addr + 4);
|
||||
datetime.hour = Memory.Read16(datetime_addr + 6);
|
||||
datetime.minute = Memory.Read16(datetime_addr + 8);
|
||||
datetime.second = Memory.Read16(datetime_addr + 10);
|
||||
datetime.microsecond = Memory.Read32(datetime_addr + 12);
|
||||
cellRtc.Log("cellRtcGetDosTime(pDateTime=0x%x, puiDosTime=0x%x)", pDateTime.GetAddr(), puiDosTime.GetAddr());
|
||||
|
||||
if (!pDateTime.IsGood() || !puiDosTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Convert to DOS time.
|
||||
wxDateTime date_time = wxDateTime::wxDateTime(datetime.day, (wxDateTime::Month)datetime.month, datetime.year, datetime.hour, datetime.minute, datetime.second, (datetime.microsecond / 1000));
|
||||
dos_time = date_time.GetAsDOS();
|
||||
wxDateTime date_time = wxDateTime::wxDateTime(pDateTime->day, (wxDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
puiDosTime = date_time.GetAsDOS();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcGetTime_t(u32 datetime_addr, mem64_t posix_time)
|
||||
int cellRtcGetTime_t(mem_ptr_t<CellRtcDateTime> pDateTime, mem64_t piTime)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetTime_t(datetime_addr=0x%x, posix_time_addr=0x%x)", datetime_addr, posix_time.GetAddr());
|
||||
CellRtcDateTime datetime;
|
||||
datetime.year = Memory.Read16(datetime_addr);
|
||||
datetime.month = Memory.Read16(datetime_addr + 2);
|
||||
datetime.day = Memory.Read16(datetime_addr + 4);
|
||||
datetime.hour = Memory.Read16(datetime_addr + 6);
|
||||
datetime.minute = Memory.Read16(datetime_addr + 8);
|
||||
datetime.second = Memory.Read16(datetime_addr + 10);
|
||||
datetime.microsecond = Memory.Read32(datetime_addr + 12);
|
||||
cellRtc.Log("cellRtcGetTime_t(pDateTime=0x%x, piTime=0x%x)", pDateTime.GetAddr(), piTime.GetAddr());
|
||||
|
||||
if (!pDateTime.IsGood() || !piTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Convert to POSIX time_t.
|
||||
wxDateTime date_time = wxDateTime::wxDateTime(datetime.day, (wxDateTime::Month)datetime.month, datetime.year, datetime.hour, datetime.minute, datetime.second, (datetime.microsecond / 1000));
|
||||
posix_time = convertToUNIXTime(date_time.GetSecond(wxDateTime::TZ::UTC), date_time.GetMinute(wxDateTime::TZ::UTC),
|
||||
wxDateTime date_time = wxDateTime::wxDateTime(pDateTime->day, (wxDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
piTime = convertToUNIXTime(date_time.GetSecond(wxDateTime::TZ::UTC), date_time.GetMinute(wxDateTime::TZ::UTC),
|
||||
date_time.GetHour(wxDateTime::TZ::UTC), date_time.GetDay(wxDateTime::TZ::UTC), date_time.GetYear(wxDateTime::TZ::UTC));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcGetWin32FileTime(u32 datetime_addr, mem64_t win32_time)
|
||||
int cellRtcGetWin32FileTime(mem_ptr_t<CellRtcDateTime> pDateTime, mem64_t pulWin32FileTime)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetWin32FileTime(datetime_addr=0x%x, win32_time_addr=0x%x)", datetime_addr, win32_time.GetAddr());
|
||||
CellRtcDateTime datetime;
|
||||
datetime.year = Memory.Read16(datetime_addr);
|
||||
datetime.month = Memory.Read16(datetime_addr + 2);
|
||||
datetime.day = Memory.Read16(datetime_addr + 4);
|
||||
datetime.hour = Memory.Read16(datetime_addr + 6);
|
||||
datetime.minute = Memory.Read16(datetime_addr + 8);
|
||||
datetime.second = Memory.Read16(datetime_addr + 10);
|
||||
datetime.microsecond = Memory.Read32(datetime_addr + 12);
|
||||
cellRtc.Log("cellRtcGetWin32FileTime(pDateTime=0x%x, pulWin32FileTime=0x%x)", pDateTime.GetAddr(), pulWin32FileTime.GetAddr());
|
||||
|
||||
if (!pDateTime.IsGood() || !pulWin32FileTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Convert to WIN32 FILETIME.
|
||||
wxDateTime date_time = wxDateTime::wxDateTime(datetime.day, (wxDateTime::Month)datetime.month, datetime.year, datetime.hour, datetime.minute, datetime.second, (datetime.microsecond / 1000));
|
||||
win32_time = convertToWin32FILETIME(date_time.GetSecond(wxDateTime::TZ::UTC), date_time.GetMinute(wxDateTime::TZ::UTC),
|
||||
wxDateTime date_time = wxDateTime::wxDateTime(pDateTime->day, (wxDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
pulWin32FileTime = convertToWin32FILETIME(date_time.GetSecond(wxDateTime::TZ::UTC), date_time.GetMinute(wxDateTime::TZ::UTC),
|
||||
date_time.GetHour(wxDateTime::TZ::UTC), date_time.GetDay(wxDateTime::TZ::UTC), date_time.GetYear(wxDateTime::TZ::UTC));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcSetDosTime(u32 datetime_addr, u32 dos_time_addr)
|
||||
int cellRtcSetDosTime(mem_ptr_t<CellRtcDateTime> pDateTime, u32 uiDosTime)
|
||||
{
|
||||
cellRtc.Log("cellRtcSetDosTime(datetime_addr=0x%x, dos_time_addr=0x%x)", datetime_addr, dos_time_addr);
|
||||
cellRtc.Log("cellRtcSetDosTime(pDateTime=0x%x, uiDosTime=0x%x)", pDateTime.GetAddr(), uiDosTime);
|
||||
|
||||
if (!pDateTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
wxDateTime date_time;
|
||||
wxDateTime dos_time = date_time.SetFromDOS(Memory.Read32(dos_time_addr));
|
||||
wxDateTime dos_time = date_time.SetFromDOS(uiDosTime);
|
||||
|
||||
CellRtcDateTime datetime;
|
||||
datetime.year = dos_time.GetYear(wxDateTime::TZ::UTC);
|
||||
datetime.month = dos_time.GetMonth(wxDateTime::TZ::UTC);
|
||||
datetime.day = dos_time.GetDay(wxDateTime::TZ::UTC);
|
||||
datetime.hour = dos_time.GetHour(wxDateTime::TZ::UTC);
|
||||
datetime.minute = dos_time.GetMinute(wxDateTime::TZ::UTC);
|
||||
datetime.second = dos_time.GetSecond(wxDateTime::TZ::UTC);
|
||||
datetime.microsecond = dos_time.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
|
||||
Memory.Write16(datetime_addr, datetime.year);
|
||||
Memory.Write16(datetime_addr + 2, datetime.month);
|
||||
Memory.Write16(datetime_addr + 4, datetime.day);
|
||||
Memory.Write16(datetime_addr + 6, datetime.hour);
|
||||
Memory.Write16(datetime_addr + 8, datetime.minute);
|
||||
Memory.Write16(datetime_addr + 10, datetime.second);
|
||||
Memory.Write32(datetime_addr + 12, datetime.microsecond);
|
||||
pDateTime->year = dos_time.GetYear(wxDateTime::TZ::UTC);
|
||||
pDateTime->month = dos_time.GetMonth(wxDateTime::TZ::UTC);
|
||||
pDateTime->day = dos_time.GetDay(wxDateTime::TZ::UTC);
|
||||
pDateTime->hour = dos_time.GetHour(wxDateTime::TZ::UTC);
|
||||
pDateTime->minute = dos_time.GetMinute(wxDateTime::TZ::UTC);
|
||||
pDateTime->second = dos_time.GetSecond(wxDateTime::TZ::UTC);
|
||||
pDateTime->microsecond = dos_time.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcSetTime_t(u32 datetime_addr, u32 posix_time_addr)
|
||||
int cellRtcSetTime_t(mem_ptr_t<CellRtcDateTime> pDateTime, u64 iTime)
|
||||
{
|
||||
cellRtc.Log("cellRtcSetTime_t(datetime_addr=0x%x, posix_time_addr=0x%x)", datetime_addr, posix_time_addr);
|
||||
cellRtc.Log("cellRtcSetTime_t(pDateTime=0x%x, iTime=0x%llx)", pDateTime.GetAddr(), iTime);
|
||||
|
||||
wxDateTime date_time = wxDateTime::wxDateTime((time_t)Memory.Read64(posix_time_addr));
|
||||
|
||||
CellRtcDateTime datetime;
|
||||
datetime.year = date_time.GetYear(wxDateTime::TZ::UTC);
|
||||
datetime.month = date_time.GetMonth(wxDateTime::TZ::UTC);
|
||||
datetime.day = date_time.GetDay(wxDateTime::TZ::UTC);
|
||||
datetime.hour = date_time.GetHour(wxDateTime::TZ::UTC);
|
||||
datetime.minute = date_time.GetMinute(wxDateTime::TZ::UTC);
|
||||
datetime.second = date_time.GetSecond(wxDateTime::TZ::UTC);
|
||||
datetime.microsecond = date_time.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
if (!pDateTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
Memory.Write16(datetime_addr, datetime.year);
|
||||
Memory.Write16(datetime_addr + 2, datetime.month);
|
||||
Memory.Write16(datetime_addr + 4, datetime.day);
|
||||
Memory.Write16(datetime_addr + 6, datetime.hour);
|
||||
Memory.Write16(datetime_addr + 8, datetime.minute);
|
||||
Memory.Write16(datetime_addr + 10, datetime.second);
|
||||
Memory.Write32(datetime_addr + 12, datetime.microsecond);
|
||||
wxDateTime date_time = wxDateTime::wxDateTime((time_t)iTime);
|
||||
|
||||
pDateTime->year = date_time.GetYear(wxDateTime::TZ::UTC);
|
||||
pDateTime->month = date_time.GetMonth(wxDateTime::TZ::UTC);
|
||||
pDateTime->day = date_time.GetDay(wxDateTime::TZ::UTC);
|
||||
pDateTime->hour = date_time.GetHour(wxDateTime::TZ::UTC);
|
||||
pDateTime->minute = date_time.GetMinute(wxDateTime::TZ::UTC);
|
||||
pDateTime->second = date_time.GetSecond(wxDateTime::TZ::UTC);
|
||||
pDateTime->microsecond = date_time.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcSetWin32FileTime(u32 datetime_addr, u32 win32_time_addr)
|
||||
int cellRtcSetWin32FileTime(mem_ptr_t<CellRtcDateTime> pDateTime, u64 ulWin32FileTime)
|
||||
{
|
||||
cellRtc.Log("cellRtcSetWin32FileTime(datetime_addr=0x%x, win32_time_addr=0x%x)", datetime_addr, win32_time_addr);
|
||||
cellRtc.Log("cellRtcSetWin32FileTime(pDateTime=0x%x, ulWin32FileTime=0x%llx)", pDateTime, ulWin32FileTime);
|
||||
|
||||
wxDateTime date_time = wxDateTime::wxDateTime((time_t)Memory.Read64(win32_time_addr));
|
||||
|
||||
CellRtcDateTime datetime;
|
||||
datetime.year = date_time.GetYear(wxDateTime::TZ::UTC);
|
||||
datetime.month = date_time.GetMonth(wxDateTime::TZ::UTC);
|
||||
datetime.day = date_time.GetDay(wxDateTime::TZ::UTC);
|
||||
datetime.hour = date_time.GetHour(wxDateTime::TZ::UTC);
|
||||
datetime.minute = date_time.GetMinute(wxDateTime::TZ::UTC);
|
||||
datetime.second = date_time.GetSecond(wxDateTime::TZ::UTC);
|
||||
datetime.microsecond = date_time.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
if (!pDateTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
Memory.Write16(datetime_addr, datetime.year);
|
||||
Memory.Write16(datetime_addr + 2, datetime.month);
|
||||
Memory.Write16(datetime_addr + 4, datetime.day);
|
||||
Memory.Write16(datetime_addr + 6, datetime.hour);
|
||||
Memory.Write16(datetime_addr + 8, datetime.minute);
|
||||
Memory.Write16(datetime_addr + 10, datetime.second);
|
||||
Memory.Write32(datetime_addr + 12, datetime.microsecond);
|
||||
wxDateTime date_time = wxDateTime::wxDateTime((time_t)ulWin32FileTime);
|
||||
|
||||
pDateTime->year = date_time.GetYear(wxDateTime::TZ::UTC);
|
||||
pDateTime->month = date_time.GetMonth(wxDateTime::TZ::UTC);
|
||||
pDateTime->day = date_time.GetDay(wxDateTime::TZ::UTC);
|
||||
pDateTime->hour = date_time.GetHour(wxDateTime::TZ::UTC);
|
||||
pDateTime->minute = date_time.GetMinute(wxDateTime::TZ::UTC);
|
||||
pDateTime->second = date_time.GetSecond(wxDateTime::TZ::UTC);
|
||||
pDateTime->microsecond = date_time.GetMillisecond(wxDateTime::TZ::UTC) * 1000;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcIsLeapYear(int year)
|
||||
int cellRtcIsLeapYear(s32 year)
|
||||
{
|
||||
cellRtc.Log("cellRtcIsLeapYear(year=%d)", year);
|
||||
|
||||
@ -481,7 +489,7 @@ int cellRtcIsLeapYear(int year)
|
||||
return datetime.IsLeapYear(year, wxDateTime::Gregorian);
|
||||
}
|
||||
|
||||
int cellRtcGetDaysInMonth(int year, int month)
|
||||
int cellRtcGetDaysInMonth(s32 year, s32 month)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetDaysInMonth(year=%d, month=%d)", year, month);
|
||||
|
||||
@ -489,7 +497,7 @@ int cellRtcGetDaysInMonth(int year, int month)
|
||||
return datetime.GetNumberOfDays((wxDateTime::Month) month, year, wxDateTime::Gregorian);
|
||||
}
|
||||
|
||||
int cellRtcGetDayOfWeek(int year, int month, int day)
|
||||
int cellRtcGetDayOfWeek(s32 year, s32 month, s32 day)
|
||||
{
|
||||
cellRtc.Log("cellRtcGetDayOfWeek(year=%d, month=%d, day=%d)", year, month, day);
|
||||
|
||||
@ -498,36 +506,32 @@ int cellRtcGetDayOfWeek(int year, int month, int day)
|
||||
return datetime.GetWeekDay();
|
||||
}
|
||||
|
||||
int cellRtcCheckValid(u32 datetime_addr)
|
||||
int cellRtcCheckValid(mem_ptr_t<CellRtcDateTime> pTime)
|
||||
{
|
||||
cellRtc.Log("cellRtcCheckValid(datetime_addr=0x%x)", datetime_addr);
|
||||
CellRtcDateTime datetime;
|
||||
datetime.year = Memory.Read16(datetime_addr);
|
||||
datetime.month = Memory.Read16(datetime_addr + 2);
|
||||
datetime.day = Memory.Read16(datetime_addr + 4);
|
||||
datetime.hour = Memory.Read16(datetime_addr + 6);
|
||||
datetime.minute = Memory.Read16(datetime_addr + 8);
|
||||
datetime.second = Memory.Read16(datetime_addr + 10);
|
||||
datetime.microsecond = Memory.Read32(datetime_addr + 12);
|
||||
cellRtc.Log("cellRtcCheckValid(pTime=0x%x)", pTime.GetAddr());
|
||||
|
||||
if((datetime.year < 1) || (datetime.year > 9999)) return CELL_RTC_ERROR_INVALID_YEAR;
|
||||
else if((datetime.month < 1) || (datetime.month > 12)) return CELL_RTC_ERROR_INVALID_MONTH;
|
||||
else if((datetime.day < 1) || (datetime.day > 31)) return CELL_RTC_ERROR_INVALID_DAY;
|
||||
else if((datetime.hour < 0) || (datetime.hour > 23)) return CELL_RTC_ERROR_INVALID_HOUR;
|
||||
else if((datetime.minute < 0) || (datetime.minute > 59)) return CELL_RTC_ERROR_INVALID_MINUTE;
|
||||
else if((datetime.second < 0) || (datetime.second > 59)) return CELL_RTC_ERROR_INVALID_SECOND;
|
||||
else if((datetime.microsecond < 0) || (datetime.microsecond > 999999)) return CELL_RTC_ERROR_INVALID_MICROSECOND;
|
||||
if (!pTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
if ((pTime->year < 1) || (pTime->year > 9999)) return CELL_RTC_ERROR_INVALID_YEAR;
|
||||
else if ((pTime->month < 1) || (pTime->month > 12)) return CELL_RTC_ERROR_INVALID_MONTH;
|
||||
else if ((pTime->day < 1) || (pTime->day > 31)) return CELL_RTC_ERROR_INVALID_DAY;
|
||||
else if ((pTime->hour < 0) || (pTime->hour > 23)) return CELL_RTC_ERROR_INVALID_HOUR;
|
||||
else if ((pTime->minute < 0) || (pTime->minute > 59)) return CELL_RTC_ERROR_INVALID_MINUTE;
|
||||
else if ((pTime->second < 0) || (pTime->second > 59)) return CELL_RTC_ERROR_INVALID_SECOND;
|
||||
else if ((pTime->microsecond < 0) || (pTime->microsecond > 999999)) return CELL_RTC_ERROR_INVALID_MICROSECOND;
|
||||
else return CELL_OK;
|
||||
}
|
||||
|
||||
int cellRtcCompareTick(u32 tick_addr_1, u32 tick_addr_2)
|
||||
int cellRtcCompareTick(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1)
|
||||
{
|
||||
cellRtc.Log("cellRtcCompareTick(tick_addr_1=0x%x, tick_addr_2=0x%x)", tick_addr_1, tick_addr_2);
|
||||
u64 tick1 = Memory.Read64(tick_addr_1);
|
||||
u64 tick2 = Memory.Read64(tick_addr_2);
|
||||
cellRtc.Log("cellRtcCompareTick(pTick0=0x%x, pTick1=0x%x)", pTick0.GetAddr(), pTick1.GetAddr());
|
||||
|
||||
if(tick1 < tick2) return -1;
|
||||
else if(tick1 > tick2) return 1;
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
if (pTick0->tick < pTick1->tick) return -1;
|
||||
else if (pTick0->tick > pTick1->tick) return 1;
|
||||
else return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -21,16 +21,16 @@ enum
|
||||
|
||||
struct CellRtcTick
|
||||
{
|
||||
u64 tick;
|
||||
be_t<u64> tick;
|
||||
};
|
||||
|
||||
struct CellRtcDateTime
|
||||
{
|
||||
u16 year;
|
||||
u16 month;
|
||||
u16 day;
|
||||
u16 hour;
|
||||
u16 minute;
|
||||
u16 second;
|
||||
u32 microsecond;
|
||||
be_t<u16> year;
|
||||
be_t<u16> month;
|
||||
be_t<u16> day;
|
||||
be_t<u16> hour;
|
||||
be_t<u16> minute;
|
||||
be_t<u16> second;
|
||||
be_t<u32> microsecond;
|
||||
};
|
||||
|
@ -51,9 +51,9 @@ struct CellSpursAttribute
|
||||
|
||||
struct CellSpursInfo
|
||||
{
|
||||
be_t<int> nSpus;
|
||||
be_t<int> spuThreadGroupPriority;
|
||||
be_t<int> ppuThreadPriority;
|
||||
be_t<s32> nSpus;
|
||||
be_t<s32> spuThreadGroupPriority;
|
||||
be_t<s32> ppuThreadPriority;
|
||||
bool exitIfNoWork;
|
||||
bool spurs2;
|
||||
be_t<u32> traceBuffer_addr; //void *traceBuffer;
|
||||
@ -63,7 +63,7 @@ struct CellSpursInfo
|
||||
be_t<u32> spuThreads[8]; //typedef u32 sys_spu_thread_t;
|
||||
be_t<u32> spursHandlerThread0;
|
||||
be_t<u32> spursHandlerThread1;
|
||||
char namePrefix[CELL_SPURS_NAME_MAX_LENGTH+1];
|
||||
s8 namePrefix[CELL_SPURS_NAME_MAX_LENGTH+1];
|
||||
be_t<u64> namePrefixLength;
|
||||
be_t<u32> deadlineMissCounter;
|
||||
be_t<u32> deadlineMeetCounter;
|
||||
@ -125,7 +125,7 @@ struct CellSpursTracePacket
|
||||
|
||||
struct start_struct
|
||||
{
|
||||
char module[4];
|
||||
s8 module[4];
|
||||
be_t<u16> level;
|
||||
be_t<u16> ls;
|
||||
} start;
|
||||
@ -143,17 +143,17 @@ struct CellSpursTaskset
|
||||
|
||||
// Exception handlers.
|
||||
typedef void (*CellSpursGlobalExceptionEventHandler)(mem_ptr_t<CellSpurs> spurs, const mem_ptr_t<CellSpursExceptionInfo> info,
|
||||
uint id, mem_ptr_t<void> arg);
|
||||
u32 id, mem_ptr_t<void> arg);
|
||||
|
||||
typedef void (*CellSpursTasksetExceptionEventHandler)(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskset> taskset,
|
||||
uint idTask, const mem_ptr_t<CellSpursExceptionInfo> info, mem_ptr_t<void> arg);
|
||||
u32 idTask, const mem_ptr_t<CellSpursExceptionInfo> info, mem_ptr_t<void> arg);
|
||||
|
||||
struct CellSpursTasksetInfo
|
||||
{
|
||||
//CellSpursTaskInfo taskInfo[CELL_SPURS_MAX_TASK];
|
||||
be_t<u64> argument;
|
||||
be_t<uint> idWorkload;
|
||||
be_t<uint> idLastScheduledTask; //typedef unsigned CellSpursTaskId
|
||||
be_t<u32> idWorkload;
|
||||
be_t<u32> idLastScheduledTask; //typedef unsigned CellSpursTaskId
|
||||
be_t<u32> name_addr;
|
||||
CellSpursTasksetExceptionEventHandler exceptionEventHandler;
|
||||
be_t<u32> exceptionEventHandlerArgument_addr; //void *exceptionEventHandlerArgument
|
||||
|
@ -174,28 +174,20 @@ int cellVideoOutGetState(u32 videoOut, u32 deviceIndex, u32 state_addr)
|
||||
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
|
||||
}
|
||||
|
||||
int cellVideoOutGetResolution(u32 resolutionId, u32 resolution_addr)
|
||||
int cellVideoOutGetResolution(u32 resolutionId, mem_ptr_t<CellVideoOutResolution> resolution)
|
||||
{
|
||||
cellSysutil.Log("cellVideoOutGetResolution(resolutionId=%d, resolution_addr=0x%x)",
|
||||
resolutionId, resolution_addr);
|
||||
resolutionId, resolution.GetAddr());
|
||||
|
||||
if(!Memory.IsGoodAddr(resolution_addr, sizeof(CellVideoOutResolution)))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
if (!resolution.IsGood())
|
||||
return CELL_VIDEO_OUT_ERROR_ILLEGAL_PARAMETER;
|
||||
|
||||
u32 num = ResolutionIdToNum(resolutionId);
|
||||
|
||||
if(!num)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
CellVideoOutResolution res;
|
||||
re(res.width, ResolutionTable[num].width);
|
||||
re(res.height, ResolutionTable[num].height);
|
||||
|
||||
Memory.WriteData(resolution_addr, res);
|
||||
resolution->width = ResolutionTable[num].width;
|
||||
resolution->height = ResolutionTable[num].height;
|
||||
|
||||
return CELL_VIDEO_OUT_SUCCEEDED;
|
||||
}
|
||||
|
@ -215,14 +215,14 @@ struct CellHddGameStatGet
|
||||
|
||||
struct CellHddGameStatSet
|
||||
{
|
||||
CellHddGameSystemFileParam *setParam;
|
||||
u32 reserved_addr; // void*
|
||||
mem_beptr_t<CellHddGameSystemFileParam> setParam;
|
||||
be_t<u32> reserved_addr; // void*
|
||||
};
|
||||
|
||||
struct CellHddGameCBResult
|
||||
{
|
||||
be_t<u32> result;
|
||||
be_t<s32> errNeedSizeKB;
|
||||
u8 *invalidMsg;
|
||||
u32 reserved_addr; // void*
|
||||
be_t<u32> invalidMsg_addr; // char*
|
||||
be_t<u32> reserved_addr; // void*
|
||||
};
|
||||
|
@ -73,6 +73,36 @@ int sceNpDrmIsAvailable(u32 k_licensee_addr, u32 drm_path_addr)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNpDrmIsAvailable2(u32 k_licensee_addr, u32 drm_path_addr)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNp);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNpDrmVerifyUpgradeLicense(u32 content_id_addr)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNp);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNpDrmVerifyUpgradeLicense2(u32 content_id_addr)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNp);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNpDrmExecuteGamePurchase()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNp);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNpDrmGetTimelimit(u32 drm_path_addr, mem64_t time_remain_usec)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNp);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNpManagerGetStatus(mem32_t status)
|
||||
{
|
||||
sceNp.Log("sceNpManagerGetStatus(status_addr=0x%x)", status.GetAddr());
|
||||
@ -91,5 +121,10 @@ void sceNp_init()
|
||||
sceNp.AddFunc(0xbd28fdbf, sceNpInit);
|
||||
sceNp.AddFunc(0x4885aa18, sceNpTerm);
|
||||
sceNp.AddFunc(0xad218faf, sceNpDrmIsAvailable);
|
||||
sceNp.AddFunc(0xf042b14f, sceNpDrmIsAvailable2);
|
||||
sceNp.AddFunc(0x2ecd48ed, sceNpDrmVerifyUpgradeLicense);
|
||||
sceNp.AddFunc(0xbe0e3ee2, sceNpDrmVerifyUpgradeLicense2);
|
||||
sceNp.AddFunc(0xf283c143, sceNpDrmExecuteGamePurchase);
|
||||
sceNp.AddFunc(0xcf51864b, sceNpDrmGetTimelimit);
|
||||
sceNp.AddFunc(0xa7bff757, sceNpManagerGetStatus);
|
||||
}
|
||||
|
@ -4,10 +4,10 @@
|
||||
#include "SC_FUNC.h"
|
||||
|
||||
namespace detail{
|
||||
template<> bool CheckId(u32 id, ID*& _id,const std::string &name)
|
||||
{
|
||||
return Emu.GetIdManager().CheckID(id) && (_id = &Emu.GetIdManager().GetID(id))->m_name == name;
|
||||
}
|
||||
template<> bool CheckId(u32 id, ID*& _id,const std::string &name)
|
||||
{
|
||||
return Emu.GetIdManager().CheckID(id) && (_id = &Emu.GetIdManager().GetID(id))->m_name == name;
|
||||
}
|
||||
}
|
||||
|
||||
void default_syscall();
|
||||
@ -15,105 +15,211 @@ static func_caller *null_func = bind_func(default_syscall);
|
||||
|
||||
static func_caller* sc_table[1024] =
|
||||
{
|
||||
null_func, bind_func(sys_process_getpid), null_func, bind_func(sys_process_exit), null_func, //4
|
||||
null_func, null_func, null_func, null_func, null_func, //9
|
||||
null_func, null_func, bind_func(sys_process_get_number_of_object), bind_func(sys_process_get_id), null_func, //14
|
||||
null_func, null_func, null_func, bind_func(sys_process_getppid), null_func, //19
|
||||
null_func, null_func, bind_func(sys_process_exit), null_func, null_func, //24
|
||||
null_func, null_func, null_func, null_func, null_func, //29
|
||||
bind_func(sys_process_get_paramsfo), null_func, null_func, null_func, null_func, //34
|
||||
null_func, null_func, null_func, null_func, null_func, //39
|
||||
null_func, //40 (0x028)
|
||||
bind_func(sys_ppu_thread_exit), //41 (0x029)
|
||||
null_func, //42 (0x02A)
|
||||
bind_func(sys_ppu_thread_yield), //43 (0x02B)
|
||||
bind_func(sys_ppu_thread_join), //44 (0x02C)
|
||||
bind_func(sys_ppu_thread_detach), //45 (0x02D)
|
||||
bind_func(sys_ppu_thread_get_join_state), //46 (0x02E)
|
||||
bind_func(sys_ppu_thread_set_priority), //47 (0x02F)
|
||||
bind_func(sys_ppu_thread_get_priority), //48 (0x030)
|
||||
bind_func(sys_ppu_thread_get_stack_information), //49 (0x031)
|
||||
bind_func(sys_ppu_thread_stop), //50 (0x032)
|
||||
bind_func(sys_ppu_thread_restart), //51 (0x033)
|
||||
bind_func(sys_ppu_thread_create), //52 (0x034)
|
||||
null_func, //53 (0x035)
|
||||
null_func, //54 (0x036)
|
||||
null_func, null_func, null_func, null_func, null_func, //59
|
||||
bind_func(sys_trace_create), //60 (0x03C)
|
||||
bind_func(sys_trace_start), //61 (0x03D)
|
||||
bind_func(sys_trace_stop), //62 (0x03E)
|
||||
bind_func(sys_trace_update_top_index), //63 (0x03F)
|
||||
bind_func(sys_trace_destroy), //64 (0x040)
|
||||
bind_func(sys_trace_drain), //65 (0x041)
|
||||
bind_func(sys_trace_attach_process), //66 (0x042)
|
||||
bind_func(sys_trace_allocate_buffer), //67 (0x043)
|
||||
bind_func(sys_trace_free_buffer), //68 (0x044)
|
||||
bind_func(sys_trace_create2), //69 (0x045)
|
||||
bind_func(sys_timer_create), //70 (0x046)
|
||||
bind_func(sys_timer_destroy), //71 (0x047)
|
||||
bind_func(sys_timer_get_information), //72 (0x048)
|
||||
bind_func(sys_timer_start), //73 (0x049)
|
||||
bind_func(sys_timer_stop), //74 (0x04A)
|
||||
bind_func(sys_timer_connect_event_queue), //75 (0x04B)
|
||||
bind_func(sys_timer_disconnect_event_queue), //76 (0x04C)
|
||||
null_func, //77 (0x04D)
|
||||
null_func, //78 (0x04E)
|
||||
null_func, //79 (0x04F)
|
||||
null_func, null_func, bind_func(sys_event_flag_create), bind_func(sys_event_flag_destroy), null_func, //84
|
||||
bind_func(sys_event_flag_wait), bind_func(sys_event_flag_trywait), bind_func(sys_event_flag_set), null_func, null_func, //89
|
||||
bind_func(sys_semaphore_create), //90 (0x05A)
|
||||
bind_func(sys_semaphore_destroy), //91 (0x05B)
|
||||
bind_func(sys_semaphore_wait), //92 (0x05C)
|
||||
bind_func(sys_semaphore_trywait), //93 (0x05D)
|
||||
bind_func(sys_semaphore_post), //94 (0x05E)
|
||||
bind_func(sys_lwmutex_create), //95 (0x05F)
|
||||
bind_func(sys_lwmutex_destroy), //96 (0x060)
|
||||
bind_func(sys_lwmutex_lock), //97 (0x061)
|
||||
bind_func(sys_lwmutex_trylock), //98 (0x062)
|
||||
bind_func(sys_lwmutex_unlock), //99 (0x063)
|
||||
bind_func(sys_mutex_create), //100 (0x064)
|
||||
bind_func(sys_mutex_destroy), //101 (0x065)
|
||||
bind_func(sys_mutex_lock), //102 (0x066)
|
||||
bind_func(sys_mutex_trylock), //103 (0x067)
|
||||
bind_func(sys_mutex_unlock), //104 (0x068)
|
||||
bind_func(sys_cond_create), //105 (0x069)
|
||||
bind_func(sys_cond_destroy), //106 (0x06A)
|
||||
bind_func(sys_cond_wait), //107 (0x06B)
|
||||
bind_func(sys_cond_signal), //108 (0x06C)
|
||||
bind_func(sys_cond_signal_all), //109 (0x06D)
|
||||
bind_func(sys_cond_signal_to), null_func, null_func, null_func, //113 (0x071)
|
||||
null_func,
|
||||
bind_func(sys_process_getpid), //1 (0x001)
|
||||
null_func,//bind_func(sys_process_wait_for_child), //2 (0x002) ROOT
|
||||
bind_func(sys_process_exit), //3 (0x003)
|
||||
null_func,//bind_func(sys_process_get_status), //4 (0x004) DBG
|
||||
null_func,//bind_func(sys_process_detach_child), //5 (0x005) DBG
|
||||
|
||||
// Unused: 6-11
|
||||
null_func, null_func, null_func, null_func, null_func, null_func,
|
||||
|
||||
bind_func(sys_process_get_number_of_object), //12 (0x00B)
|
||||
bind_func(sys_process_get_id), //13 (0x00C)
|
||||
null_func,//bind_func(sys_process_is_spu_lock_line_reservation_address), //14 (0x00D)
|
||||
|
||||
// Unused: 15-17
|
||||
null_func, null_func, null_func,
|
||||
|
||||
bind_func(sys_process_getppid), //18 (0x012)
|
||||
null_func,//bind_func(sys_process_kill), //19 (0x013)
|
||||
null_func, //
|
||||
null_func,//bind_func(_sys_process_spawn), //21 (0x015) DBG
|
||||
bind_func(sys_process_exit), //22 (0x016)
|
||||
null_func,//bind_func(sys_process_wait_for_child2), //23 (0x017) DBG
|
||||
null_func,//bind_func(), //24 (0x018) DBG
|
||||
null_func,//bind_func(sys_process_get_sdk_version), //25 (0x019)
|
||||
null_func,//bind_func(_sys_process_exit), //26 (0x01A)
|
||||
null_func,//bind_func(), //27 (0x01B) DBG
|
||||
null_func,//bind_func(_sys_process_get_number_of_object)//28 (0x01C) ROOT
|
||||
null_func,//bind_func(sys_process_get_id), //29 (0x01D) ROOT
|
||||
bind_func(sys_process_get_paramsfo), //30 (0x01E)
|
||||
null_func,//bind_func(sys_process_get_ppu_guid), //31 (0x01F)
|
||||
|
||||
// Unused: 32-40
|
||||
null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func,
|
||||
|
||||
bind_func(sys_ppu_thread_exit), //41 (0x029)
|
||||
null_func, //
|
||||
bind_func(sys_ppu_thread_yield), //43 (0x02B)
|
||||
bind_func(sys_ppu_thread_join), //44 (0x02C)
|
||||
bind_func(sys_ppu_thread_detach), //45 (0x02D)
|
||||
bind_func(sys_ppu_thread_get_join_state), //46 (0x02E)
|
||||
bind_func(sys_ppu_thread_set_priority), //47 (0x02F) DBG
|
||||
bind_func(sys_ppu_thread_get_priority), //48 (0x030)
|
||||
bind_func(sys_ppu_thread_get_stack_information), //49 (0x031)
|
||||
bind_func(sys_ppu_thread_stop), //50 (0x032) ROOT
|
||||
bind_func(sys_ppu_thread_restart), //51 (0x033) ROOT
|
||||
bind_func(sys_ppu_thread_create), //52 (0x034) DBG
|
||||
null_func,//bind_func(sys_ppu_thread_start), //53 (0x035)
|
||||
null_func,//bind_func(), //54 (0x036) ROOT
|
||||
null_func,//bind_func(), //55 (0x037) ROOT
|
||||
null_func,//bind_func(sys_ppu_thread_rename), //56 (0x038)
|
||||
null_func,//bind_func(sys_ppu_thread_recover_page_fault)//57 (0x039)
|
||||
null_func,//bind_func(sys_ppu_thread_get_page_fault_context),//58 (0x03A)
|
||||
|
||||
// Unused: 59
|
||||
null_func,
|
||||
|
||||
bind_func(sys_trace_create), //60 (0x03C)
|
||||
bind_func(sys_trace_start), //61 (0x03D)
|
||||
bind_func(sys_trace_stop), //62 (0x03E)
|
||||
bind_func(sys_trace_update_top_index), //63 (0x03F)
|
||||
bind_func(sys_trace_destroy), //64 (0x040)
|
||||
bind_func(sys_trace_drain), //65 (0x041)
|
||||
bind_func(sys_trace_attach_process), //66 (0x042)
|
||||
bind_func(sys_trace_allocate_buffer), //67 (0x043)
|
||||
bind_func(sys_trace_free_buffer), //68 (0x044)
|
||||
bind_func(sys_trace_create2), //69 (0x045)
|
||||
bind_func(sys_timer_create), //70 (0x046)
|
||||
bind_func(sys_timer_destroy), //71 (0x047)
|
||||
bind_func(sys_timer_get_information), //72 (0x048)
|
||||
bind_func(sys_timer_start), //73 (0x049)
|
||||
bind_func(sys_timer_stop), //74 (0x04A)
|
||||
bind_func(sys_timer_connect_event_queue), //75 (0x04B)
|
||||
bind_func(sys_timer_disconnect_event_queue), //76 (0x04C)
|
||||
null_func,//bind_func(sys_trace_create2_in_cbepm), //77 (0x04D)
|
||||
null_func,//bind_func() //78 (0x04E)
|
||||
|
||||
// Unused: 79
|
||||
null_func,
|
||||
|
||||
null_func,//bind_func(sys_interrupt_tag_create) //80 (0x050)
|
||||
null_func,//bind_func(sys_interrupt_tag_destroy) //81 (0x051)
|
||||
bind_func(sys_event_flag_create), //82 (0x052)
|
||||
bind_func(sys_event_flag_destroy), //83 (0x053)
|
||||
null_func,//bind_func(sys_interrupt_thread_establish) //84 (0x054)
|
||||
bind_func(sys_event_flag_wait), //85 (0x055)
|
||||
bind_func(sys_event_flag_trywait), //86 (0x056)
|
||||
bind_func(sys_event_flag_set), //87 (0x057)
|
||||
null_func,//bind_func(sys_interrupt_thread_eoi) //88 (0x058)
|
||||
null_func,//bind_func(sys_interrupt_thread_disestablish)//89 (0x059)
|
||||
bind_func(sys_semaphore_create), //90 (0x05A)
|
||||
bind_func(sys_semaphore_destroy), //91 (0x05B)
|
||||
bind_func(sys_semaphore_wait), //92 (0x05C)
|
||||
bind_func(sys_semaphore_trywait), //93 (0x05D)
|
||||
bind_func(sys_semaphore_post), //94 (0x05E)
|
||||
bind_func(sys_lwmutex_create), //95 (0x05F)
|
||||
bind_func(sys_lwmutex_destroy), //96 (0x060)
|
||||
bind_func(sys_lwmutex_lock), //97 (0x061)
|
||||
bind_func(sys_lwmutex_trylock), //98 (0x062)
|
||||
bind_func(sys_lwmutex_unlock), //99 (0x063)
|
||||
bind_func(sys_mutex_create), //100 (0x064)
|
||||
bind_func(sys_mutex_destroy), //101 (0x065)
|
||||
bind_func(sys_mutex_lock), //102 (0x066)
|
||||
bind_func(sys_mutex_trylock), //103 (0x067)
|
||||
bind_func(sys_mutex_unlock), //104 (0x068)
|
||||
bind_func(sys_cond_create), //105 (0x069)
|
||||
bind_func(sys_cond_destroy), //106 (0x06A)
|
||||
bind_func(sys_cond_wait), //107 (0x06B)
|
||||
bind_func(sys_cond_signal), //108 (0x06C)
|
||||
bind_func(sys_cond_signal_all), //109 (0x06D)
|
||||
bind_func(sys_cond_signal_to), //110 (0x06E)
|
||||
null_func,//bind_func(sys_lwcond_create) //111 (0x06F)
|
||||
null_func,//bind_func(sys_lwcond_destroy) //112 (0x070)
|
||||
null_func,//bind_func(sys_lwcond_queue_wait) //113 (0x071)
|
||||
bind_func(sys_semaphore_get_value), //114 (0x072)
|
||||
null_func, null_func, null_func, bind_func(sys_event_flag_clear), null_func, //119 (0x077)
|
||||
bind_func(sys_rwlock_create), //120 (0x078)
|
||||
bind_func(sys_rwlock_destroy), //121 (0x079)
|
||||
bind_func(sys_rwlock_rlock), //122 (0x07A)
|
||||
bind_func(sys_rwlock_tryrlock), //123 (0x07B)
|
||||
bind_func(sys_rwlock_runlock), //124 (0x07C)
|
||||
bind_func(sys_rwlock_wlock), //125 (0x07D)
|
||||
bind_func(sys_rwlock_trywlock), //126 (0x07E)
|
||||
bind_func(sys_rwlock_wunlock), //127 (0x07F)
|
||||
bind_func(sys_event_queue_create), //128 (0x080)
|
||||
bind_func(sys_event_queue_destroy), //129 (0x081)
|
||||
bind_func(sys_event_queue_receive), bind_func(sys_event_queue_tryreceive), // 131
|
||||
bind_func(sys_event_flag_cancel), bind_func(sys_event_queue_drain), bind_func(sys_event_port_create), //134
|
||||
bind_func(sys_event_port_destroy), bind_func(sys_event_port_connect_local), //136
|
||||
bind_func(sys_event_port_disconnect), bind_func(sys_event_port_send), bind_func(sys_event_flag_get), //139
|
||||
null_func, bind_func(sys_timer_usleep), bind_func(sys_timer_sleep), null_func, bind_func(sys_time_get_timezone), //144
|
||||
bind_func(sys_time_get_current_time), bind_func(sys_time_get_system_time), bind_func(sys_time_get_timebase_frequency), null_func, null_func, //149
|
||||
null_func, null_func, null_func, null_func, null_func, //154
|
||||
null_func, bind_func(sys_spu_image_open), null_func, null_func, null_func, //159
|
||||
bind_func(sys_raw_spu_create), null_func, null_func, null_func, null_func, //164
|
||||
bind_func(sys_spu_thread_get_exit_status), bind_func(sys_spu_thread_set_argument), null_func, null_func, bind_func(sys_spu_initialize), //169
|
||||
bind_func(sys_spu_thread_group_create), bind_func(sys_spu_thread_group_destroy), bind_func(sys_spu_thread_initialize), //172
|
||||
bind_func(sys_spu_thread_group_start), bind_func(sys_spu_thread_group_suspend), //174
|
||||
bind_func(sys_spu_thread_group_resume), null_func, null_func, bind_func(sys_spu_thread_group_join), null_func, //179
|
||||
null_func, bind_func(sys_spu_thread_write_ls), bind_func(sys_spu_thread_read_ls), null_func, bind_func(sys_spu_thread_write_snr), //184
|
||||
bind_func(sys_spu_thread_group_connect_event), bind_func(sys_spu_thread_group_disconnect_event), //186
|
||||
bind_func(sys_spu_thread_set_spu_cfg), bind_func(sys_spu_thread_get_spu_cfg), null_func, //189
|
||||
bind_func(sys_spu_thread_write_spu_mb), bind_func(sys_spu_thread_connect_event), bind_func(sys_spu_thread_disconnect_event), //192
|
||||
bind_func(sys_spu_thread_bind_queue), bind_func(sys_spu_thread_unbind_queue), //194
|
||||
null_func, null_func, null_func, null_func, null_func, //199
|
||||
null_func, null_func, null_func, null_func, null_func, //204
|
||||
null_func,//bind_func() //115 (0x073)
|
||||
null_func,//bind_func() //116 (0x074)
|
||||
null_func,//bind_func() //117 (0x075)
|
||||
bind_func(sys_event_flag_clear), //118 (0x076)
|
||||
null_func,//bind_func() //119 (0x077) ROOT
|
||||
bind_func(sys_rwlock_create), //120 (0x078)
|
||||
bind_func(sys_rwlock_destroy), //121 (0x079)
|
||||
bind_func(sys_rwlock_rlock), //122 (0x07A)
|
||||
bind_func(sys_rwlock_tryrlock), //123 (0x07B)
|
||||
bind_func(sys_rwlock_runlock), //124 (0x07C)
|
||||
bind_func(sys_rwlock_wlock), //125 (0x07D)
|
||||
bind_func(sys_rwlock_trywlock), //126 (0x07E)
|
||||
bind_func(sys_rwlock_wunlock), //127 (0x07F)
|
||||
bind_func(sys_event_queue_create), //128 (0x080)
|
||||
bind_func(sys_event_queue_destroy), //129 (0x081)
|
||||
bind_func(sys_event_queue_receive), //130 (0x082)
|
||||
bind_func(sys_event_queue_tryreceive), //131 (0x083)
|
||||
bind_func(sys_event_flag_cancel), //132 (0x084)
|
||||
bind_func(sys_event_queue_drain), //133 (0x085)
|
||||
bind_func(sys_event_port_create), //134 (0x086)
|
||||
bind_func(sys_event_port_destroy), //135 (0x087)
|
||||
bind_func(sys_event_port_connect_local), //136 (0x088)
|
||||
bind_func(sys_event_port_disconnect), //137 (0x089)
|
||||
bind_func(sys_event_port_send), //138 (0x08A)
|
||||
bind_func(sys_event_flag_get), //139 (0x08B)
|
||||
null_func,//bind_func(sys_event_port_connect_ipc) //140 (0x08C)
|
||||
bind_func(sys_timer_usleep), //141 (0x08D)
|
||||
bind_func(sys_timer_sleep), //142 (0x08E)
|
||||
null_func,//bind_func(sys_time_set_timezone) //143 (0x08F) ROOT
|
||||
bind_func(sys_time_get_timezone), //144 (0x090)
|
||||
bind_func(sys_time_get_current_time), //145 (0x091)
|
||||
bind_func(sys_time_get_system_time), //146 (0x092) ROOT
|
||||
bind_func(sys_time_get_timebase_frequency), //147 (0x093)
|
||||
null_func,//bind_func(sys_rwlock_trywlock) //148 (0x094)
|
||||
|
||||
// Unused: 149
|
||||
null_func,
|
||||
|
||||
null_func,//bind_func(sys_raw_spu_create_interrupt_tag) //150 (0x096)
|
||||
null_func,//bind_func(sys_raw_spu_set_int_mask) //151 (0x097)
|
||||
null_func,//bind_func(sys_raw_spu_get_int_mask) //152 (0x098)
|
||||
null_func,//bind_func(sys_raw_spu_set_int_stat) //153 (0x099)
|
||||
null_func,//bind_func(sys_raw_spu_get_int_stat) //154 (0x09A)
|
||||
null_func,//bind_func(sys_spu_image_get_information?) //155 (0x09B)
|
||||
bind_func(sys_spu_image_open), //156 (0x09C)
|
||||
null_func,//bind_func(sys_spu_image_import) //157 (0x09D)
|
||||
null_func,//bind_func(sys_spu_image_close) //158 (0x09E)
|
||||
null_func,//bind_func(sys_raw_spu_load) //159 (0x09F)
|
||||
bind_func(sys_raw_spu_create), //160 (0x0A0)
|
||||
null_func,//bind_func(sys_raw_spu_destroy) //161 (0x0A1)
|
||||
null_func, //
|
||||
null_func,//bind_func(sys_raw_spu_read_puint_mb) //163 (0x0A3)
|
||||
null_func, //
|
||||
bind_func(sys_spu_thread_get_exit_status), //165 (0x0A5)
|
||||
bind_func(sys_spu_thread_set_argument), //166 (0x0A6)
|
||||
null_func,//bind_func(sys_spu_thread_group_start_on_exit)//167(0x0A7)
|
||||
null_func, //
|
||||
bind_func(sys_spu_initialize), //169 (0x0A9)
|
||||
bind_func(sys_spu_thread_group_create), //170 (0x0AA)
|
||||
bind_func(sys_spu_thread_group_destroy), //171 (0x0AB)
|
||||
bind_func(sys_spu_thread_initialize), //172 (0x0AC)
|
||||
bind_func(sys_spu_thread_group_start), //173 (0x0AD)
|
||||
bind_func(sys_spu_thread_group_suspend), //174 (0x0AE)
|
||||
bind_func(sys_spu_thread_group_resume), //175 (0x0AF)
|
||||
null_func,//bind_func(sys_spu_thread_group_yield) //176 (0x0B0)
|
||||
null_func,//bind_func(sys_spu_thread_group_terminate) //177 (0x0B1)
|
||||
bind_func(sys_spu_thread_group_join), //178 (0x0B2)
|
||||
null_func,//bind_func(sys_spu_thread_group_set_priority)//179 (0x0B3)
|
||||
null_func,//bind_func(sys_spu_thread_group_get_priority)//180 (0x0B4)
|
||||
bind_func(sys_spu_thread_write_ls), //181 (0x0B5)
|
||||
bind_func(sys_spu_thread_read_ls), //182 (0x0B6)
|
||||
null_func, //
|
||||
bind_func(sys_spu_thread_write_snr), //184 (0x0B8)
|
||||
bind_func(sys_spu_thread_group_connect_event), //185 (0x0B9)
|
||||
bind_func(sys_spu_thread_group_disconnect_event), //186 (0x0BA)
|
||||
bind_func(sys_spu_thread_set_spu_cfg), //187 (0x0BB)
|
||||
bind_func(sys_spu_thread_get_spu_cfg), //188 (0x0BC)
|
||||
null_func, //
|
||||
bind_func(sys_spu_thread_write_spu_mb), //190 (0x0BE)
|
||||
bind_func(sys_spu_thread_connect_event), //191 (0x0BF)
|
||||
bind_func(sys_spu_thread_disconnect_event), //192 (0x0C0)
|
||||
bind_func(sys_spu_thread_bind_queue), //193 (0x0C1)
|
||||
bind_func(sys_spu_thread_unbind_queue), //194 (0x0C2)
|
||||
null_func, //
|
||||
null_func,//bind_func(sys_raw_spu_set_spu_cfg) //196 (0x0C4)
|
||||
null_func,//bind_func(sys_raw_spu_get_spu_cfg) //197 (0x0C5)
|
||||
null_func,//bind_func(sys_spu_thread_recover_page_fault)//198 (0x0C6)
|
||||
null_func,//bind_func(sys_raw_spu_recover_page_fault) //199 (0x0C7)
|
||||
|
||||
null_func, null_func, null_func, null_func, null_func, //204(0x104)
|
||||
null_func, null_func, null_func, null_func, null_func, //209
|
||||
null_func, null_func, null_func, null_func, null_func, //214
|
||||
null_func, null_func, null_func, null_func, null_func, //219
|
||||
@ -123,9 +229,19 @@ static func_caller* sc_table[1024] =
|
||||
null_func, null_func, null_func, null_func, null_func, //239
|
||||
null_func, null_func, null_func, null_func, null_func, //244
|
||||
null_func, null_func, null_func, null_func, null_func, //249
|
||||
null_func, bind_func(sys_spu_thread_group_connect_event_all_threads), bind_func(sys_spu_thread_group_disconnect_event_all_threads), null_func, null_func, //254
|
||||
null_func, null_func, null_func, null_func, null_func, //259
|
||||
null_func, null_func, null_func, null_func, null_func, //264
|
||||
null_func, //250
|
||||
|
||||
bind_func(sys_spu_thread_group_connect_event_all_threads),//251 (0x0FB)
|
||||
bind_func(sys_spu_thread_group_disconnect_event_all_threads),//252 (0x0FC)
|
||||
null_func,//bind_func() //253 (0x0FD)
|
||||
null_func,//bind_func(sys_spu_thread_group_log) //254 (0x0FE)
|
||||
|
||||
// Unused: 255-259
|
||||
null_func, null_func, null_func, null_func, null_func,
|
||||
|
||||
null_func,//bind_func(sys_spu_image_open_by_fd) //260 (0x104)
|
||||
|
||||
null_func, null_func, null_func, null_func, //264
|
||||
null_func, null_func, null_func, null_func, null_func, //269
|
||||
null_func, null_func, null_func, null_func, null_func, //274
|
||||
null_func, null_func, null_func, null_func, null_func, //279
|
||||
@ -133,6 +249,7 @@ static func_caller* sc_table[1024] =
|
||||
null_func, null_func, null_func, null_func, null_func, //289
|
||||
null_func, null_func, null_func, null_func, null_func, //294
|
||||
null_func, null_func, null_func, null_func, null_func, //299
|
||||
|
||||
bind_func(sys_vm_memory_map), //300 (0x12C)
|
||||
bind_func(sys_vm_unmap), //301 (0x12D)
|
||||
bind_func(sys_vm_append_memory), //302 (0x12E)
|
||||
@ -146,32 +263,56 @@ static func_caller* sc_table[1024] =
|
||||
bind_func(sys_vm_sync), //310 (0x136)
|
||||
bind_func(sys_vm_test), //311 (0x137)
|
||||
bind_func(sys_vm_get_statistics), //312 (0x138)
|
||||
null_func, null_func, //314
|
||||
null_func, null_func, null_func, null_func, null_func, //319
|
||||
null_func, null_func, null_func, null_func, //323
|
||||
bind_func(sys_memory_container_create), //324
|
||||
bind_func(sys_memory_container_destroy), //325
|
||||
bind_func(sys_mmapper_allocate_fixed_address), //326
|
||||
bind_func(sys_mmapper_enable_page_fault_notification), //327
|
||||
null_func, null_func, //329
|
||||
bind_func(sys_mmapper_allocate_address), //330
|
||||
bind_func(sys_mmapper_free_address), //331
|
||||
null_func, null_func, null_func, null_func, //335
|
||||
bind_func(sys_mmapper_change_address_access_right), //336
|
||||
bind_func(sys_mmapper_search_and_map), //337
|
||||
null_func, null_func, null_func, //340
|
||||
bind_func(sys_memory_container_create), //341
|
||||
bind_func(sys_memory_container_destroy), //342
|
||||
bind_func(sys_memory_container_get_size), //343
|
||||
null_func, null_func, null_func, null_func, //347
|
||||
bind_func(sys_memory_allocate), //348
|
||||
bind_func(sys_memory_free), //349
|
||||
bind_func(sys_memory_allocate_from_container), //350
|
||||
bind_func(sys_memory_get_page_attribute), //351
|
||||
bind_func(sys_memory_get_user_memory_size), //352
|
||||
null_func, null_func, //354
|
||||
null_func, null_func, null_func, null_func, null_func, //359
|
||||
null_func, null_func, null_func, null_func, null_func, //364
|
||||
null_func,//bind_func() //313 (0x139)
|
||||
null_func,//bind_func() //314 (0x13A)
|
||||
null_func,//bind_func() //315 (0x13B)
|
||||
|
||||
// Unused: 316-323
|
||||
null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func,
|
||||
|
||||
bind_func(sys_memory_container_create), //324 (0x144)
|
||||
bind_func(sys_memory_container_destroy), //325 (0x145)
|
||||
bind_func(sys_mmapper_allocate_fixed_address), //326 (0x146)
|
||||
bind_func(sys_mmapper_enable_page_fault_notification), //327 (0x147)
|
||||
null_func,//bind_func() //328 (0x148)
|
||||
null_func,//bind_func(sys_mmapper_free_shared_memory) //329 (0x149)
|
||||
bind_func(sys_mmapper_allocate_address), //330 (0x14A)
|
||||
bind_func(sys_mmapper_free_address), //331 (0x14B)
|
||||
null_func,//bind_func(sys_mmapper_allocate_shared_memory)//332(0x14C)
|
||||
null_func,//bind_func(sys_mmapper_set_shared_memory_flag)//333(0x14D)
|
||||
null_func,//bind_func(sys_mmapper_map_shared_memory) //334 (0x14E)
|
||||
null_func,//bind_func(sys_mmapper_unmap_shared_memory) //335 (0x14F)
|
||||
bind_func(sys_mmapper_change_address_access_right), //336 (0x150)
|
||||
bind_func(sys_mmapper_search_and_map), //337 (0x151)
|
||||
null_func,//bind_func(sys_mmapper_get_shared_memory_attribute) //338 (0x152)
|
||||
null_func,//bind_func() //339 (0x153)
|
||||
null_func,//bind_func() //340 (0x154)
|
||||
bind_func(sys_memory_container_create), //341 (0x155)
|
||||
bind_func(sys_memory_container_destroy), //342 (0x156)
|
||||
bind_func(sys_memory_container_get_size), //343 (0x157)
|
||||
null_func,//bind_func(sys_memory_budget_set) //344 (0x158)
|
||||
null_func,//bind_func() //345 (0x159)
|
||||
null_func,//bind_func() //346 (0x15A)
|
||||
null_func, //
|
||||
bind_func(sys_memory_allocate), //348 (0x15C)
|
||||
bind_func(sys_memory_free), //349 (0x15D)
|
||||
bind_func(sys_memory_allocate_from_container), //350 (0x15E)
|
||||
bind_func(sys_memory_get_page_attribute), //351 (0x15F)
|
||||
bind_func(sys_memory_get_user_memory_size), //352 (0x160)
|
||||
null_func,//bind_func(sys_memory_get_user_memory_stat) //353 (0x161)
|
||||
null_func,//bind_func() //354 (0x162)
|
||||
null_func,//bind_func() //355 (0x163)
|
||||
null_func,//bind_func(sys_memory_allocate_colored) //356 (0x164)
|
||||
null_func,//bind_func() //357 (0x165)
|
||||
null_func,//bind_func() //358 (0x166)
|
||||
null_func,//bind_func() //359 (0x167)
|
||||
null_func,//bind_func() //360 (0x168)
|
||||
null_func,//bind_func(sys_memory_allocate_from_container_colored) //361 (0x169)
|
||||
null_func,//bind_func(sys_mmapper_allocate_memory_from_container) //362 (0x16A)
|
||||
null_func,//bind_func() //363 (0x16B)
|
||||
null_func,//bind_func() //364 (0x16C)
|
||||
|
||||
|
||||
null_func, null_func, null_func, null_func, null_func, //369
|
||||
null_func, null_func, null_func, null_func, null_func, //374
|
||||
null_func, null_func, null_func, null_func, null_func, //379
|
||||
@ -232,21 +373,23 @@ static func_caller* sc_table[1024] =
|
||||
null_func, null_func, null_func, null_func, null_func, //654
|
||||
null_func, null_func, null_func, null_func, null_func, //659
|
||||
null_func, null_func, null_func, null_func, null_func, //664
|
||||
null_func, //665 (0x299)
|
||||
bind_func(sys_rsx_device_open), //666 (0x29A)
|
||||
bind_func(sys_rsx_device_close), //667 (0x29B)
|
||||
bind_func(sys_rsx_memory_allocate), //668 (0x29C)
|
||||
bind_func(sys_rsx_memory_free), //669 (0x29D)
|
||||
bind_func(sys_rsx_context_allocate), //670 (0x29E)
|
||||
bind_func(sys_rsx_context_free), //671 (0x29F)
|
||||
bind_func(sys_rsx_context_iomap), //672 (0x2A0)
|
||||
bind_func(sys_rsx_context_iounmap), //673 (0x2A1)
|
||||
bind_func(sys_rsx_context_attribute), //674 (0x2A2)
|
||||
bind_func(sys_rsx_device_map), //675 (0x2A3)
|
||||
bind_func(sys_rsx_device_unmap), //676 (0x2A4)
|
||||
bind_func(sys_rsx_attribute), //677 (0x2A5)
|
||||
null_func, //678 (0x2A6)
|
||||
null_func, //679 (0x2A7)
|
||||
null_func, //665
|
||||
|
||||
bind_func(sys_rsx_device_open), //666 (0x29A)
|
||||
bind_func(sys_rsx_device_close), //667 (0x29B)
|
||||
bind_func(sys_rsx_memory_allocate), //668 (0x29C)
|
||||
bind_func(sys_rsx_memory_free), //669 (0x29D)
|
||||
bind_func(sys_rsx_context_allocate), //670 (0x29E)
|
||||
bind_func(sys_rsx_context_free), //671 (0x29F)
|
||||
bind_func(sys_rsx_context_iomap), //672 (0x2A0)
|
||||
bind_func(sys_rsx_context_iounmap), //673 (0x2A1)
|
||||
bind_func(sys_rsx_context_attribute), //674 (0x2A2)
|
||||
bind_func(sys_rsx_device_map), //675 (0x2A3)
|
||||
bind_func(sys_rsx_device_unmap), //676 (0x2A4)
|
||||
bind_func(sys_rsx_attribute), //677 (0x2A5)
|
||||
null_func, //678 (0x2A6)
|
||||
null_func, //679 (0x2A7) ROOT
|
||||
|
||||
null_func, null_func, null_func, null_func, null_func, //684
|
||||
null_func, null_func, null_func, null_func, null_func, //689
|
||||
null_func, null_func, null_func, null_func, null_func, //694
|
||||
@ -271,28 +414,57 @@ static func_caller* sc_table[1024] =
|
||||
null_func, null_func, null_func, null_func, null_func, //789
|
||||
null_func, null_func, null_func, null_func, null_func, //794
|
||||
null_func, null_func, null_func, null_func, null_func, //799
|
||||
null_func, //800 (0x320)
|
||||
bind_func(cellFsOpen), //801 (0x321)
|
||||
bind_func(cellFsRead), //802 (0x322)
|
||||
bind_func(cellFsWrite), //803 (0x323)
|
||||
bind_func(cellFsClose), //804 (0x324)
|
||||
bind_func(cellFsOpendir), //805 (0x325)
|
||||
bind_func(cellFsReaddir), //806 (0x326)
|
||||
bind_func(cellFsClosedir), //807 (0x327)
|
||||
bind_func(cellFsStat), //808 (0x328)
|
||||
bind_func(cellFsFstat), //809 (0x329)
|
||||
null_func, //810 (0x32A)
|
||||
bind_func(cellFsMkdir), //811 (0x32B)
|
||||
bind_func(cellFsRename), //812 (0x32C)
|
||||
bind_func(cellFsRmdir), //813 (0x32D)
|
||||
bind_func(cellFsUnlink), //814 (0x32E)
|
||||
null_func, null_func, null_func, bind_func(cellFsLseek), null_func, //819
|
||||
null_func, null_func, null_func, null_func, null_func, //824
|
||||
null_func, null_func, null_func, null_func, null_func, //829
|
||||
null_func, null_func, null_func, null_func, null_func, //834
|
||||
null_func, null_func, null_func, null_func, null_func, //839
|
||||
null_func, null_func, null_func, null_func, null_func, //844
|
||||
null_func, null_func, null_func, null_func, null_func, //849
|
||||
|
||||
null_func,//bind_func(sys_fs_test), //800 (0x320)
|
||||
bind_func(cellFsOpen), //801 (0x321)
|
||||
bind_func(cellFsRead), //802 (0x322)
|
||||
bind_func(cellFsWrite), //803 (0x323)
|
||||
bind_func(cellFsClose), //804 (0x324)
|
||||
bind_func(cellFsOpendir), //805 (0x325)
|
||||
bind_func(cellFsReaddir), //806 (0x326)
|
||||
bind_func(cellFsClosedir), //807 (0x327)
|
||||
bind_func(cellFsStat), //808 (0x328)
|
||||
bind_func(cellFsFstat), //809 (0x329)
|
||||
null_func,//bind_func(sys_fs_link), //810 (0x32A)
|
||||
bind_func(cellFsMkdir), //811 (0x32B)
|
||||
bind_func(cellFsRename), //812 (0x32C)
|
||||
bind_func(cellFsRmdir), //813 (0x32D)
|
||||
bind_func(cellFsUnlink), //814 (0x32E)
|
||||
null_func,//bind_func(cellFsUtime), //815 (0x32F)
|
||||
null_func,//bind_func(sys_fs_access), //816 (0x330)
|
||||
null_func,//bind_func(sys_fs_fcntl), //817 (0x331)
|
||||
bind_func(cellFsLseek), //818 (0x332)
|
||||
null_func,//bind_func(sys_fs_fdatasync), //819 (0x333)
|
||||
null_func,//bind_func(cellFsFsync), //820 (0x334)
|
||||
bind_func(cellFsFGetBlockSize), //821 (0x335)
|
||||
bind_func(cellFsGetBlockSize), //822 (0x336)
|
||||
null_func,//bind_func(sys_fs_acl_read), //823 (0x337)
|
||||
null_func,//bind_func(sys_fs_acl_write), //824 (0x338)
|
||||
null_func,//bind_func(sys_fs_lsn_get_cda_size), //825 (0x339)
|
||||
null_func,//bind_func(sys_fs_lsn_get_cda), //826 (0x33A)
|
||||
null_func,//bind_func(sys_fs_lsn_lock), //827 (0x33B)
|
||||
null_func,//bind_func(sys_fs_lsn_unlock), //828 (0x33C)
|
||||
null_func,//bind_func(sys_fs_lsn_read), //829 (0x33D)
|
||||
null_func,//bind_func(sys_fs_lsn_write), //830 (0x33E)
|
||||
bind_func(cellFsTruncate), //831 (0x33F)
|
||||
bind_func(cellFsFtruncate), //832 (0x340)
|
||||
null_func,//bind_func(sys_fs_symbolic_link), //833 (0x341)
|
||||
null_func,//bind_func(cellFsChmod), //834 (0x342)
|
||||
null_func,//bind_func(sys_fs_chown), //835 (0x343)
|
||||
null_func,//bind_func(sys_fs_newfs), //836 (0x344)
|
||||
null_func,//bind_func(sys_fs_mount), //837 (0x345)
|
||||
null_func,//bind_func(sys_fs_unmount), //838 (0x346)
|
||||
null_func,//bind_func(sys_fs_sync), //839 (0x347)
|
||||
null_func,//bind_func(sys_fs_disk_free), //840 (0x348)
|
||||
null_func,//bind_func(sys_fs_get_mount_info_size), //841 (0x349)
|
||||
null_func,//bind_func(sys_fs_get_mount_info), //842 (0x34A)
|
||||
null_func,//bind_func(sys_fs_get_fs_info_size), //843 (0x34B)
|
||||
null_func,//bind_func(sys_fs_get_fs_info), //844 (0x34C)
|
||||
null_func,//bind_func(sys_fs_mapped_allocate), //845 (0x34D)
|
||||
null_func,//bind_func(sys_fs_mapped_free), //846 (0x34E)
|
||||
null_func,//bind_func(sys_fs_truncate2), //847 (0x34F)
|
||||
|
||||
null_func, null_func, //849
|
||||
null_func, null_func, null_func, null_func, null_func, //854
|
||||
null_func, null_func, null_func, null_func, null_func, //859
|
||||
null_func, null_func, null_func, null_func, null_func, //864
|
||||
@ -327,7 +499,7 @@ static func_caller* sc_table[1024] =
|
||||
null_func, null_func, null_func, null_func, null_func, //1009
|
||||
null_func, null_func, null_func, null_func, null_func, //1014
|
||||
null_func, null_func, null_func, null_func, null_func, //1019
|
||||
null_func, null_func, null_func, bind_func(cellGcmCallback), //1024
|
||||
null_func, null_func, null_func, bind_func(cellGcmCallback), //1024
|
||||
};
|
||||
|
||||
void default_syscall()
|
||||
|
@ -294,7 +294,7 @@ extern int cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(in
|
||||
|
||||
//cellVideo
|
||||
extern int cellVideoOutGetState(u32 videoOut, u32 deviceIndex, u32 state_addr);
|
||||
extern int cellVideoOutGetResolution(u32 resolutionId, u32 resolution_addr);
|
||||
extern int cellVideoOutGetResolution(u32 resolutionId, mem_ptr_t<CellVideoOutResolution> resolution);
|
||||
extern int cellVideoOutConfigure(u32 videoOut, u32 config_addr, u32 option_addr, u32 waitForEvent);
|
||||
extern int cellVideoOutGetConfiguration(u32 videoOut, u32 config_addr, u32 option_addr);
|
||||
extern int cellVideoOutGetNumberOfDevice(u32 videoOut);
|
||||
|
@ -212,19 +212,24 @@ void LogFrame::Task()
|
||||
|
||||
const LogPacket item = LogBuffer.Pop();
|
||||
|
||||
while(m_log.GetItemCount() > max_item_count)
|
||||
wxListView& m_log = this->m_log; //makes m_log capturable by the lambda
|
||||
//queue adding the log message to the gui element in the main thread
|
||||
wxTheApp->GetTopWindow()->GetEventHandler()->CallAfter([item, &m_log]()
|
||||
{
|
||||
m_log.DeleteItem(0);
|
||||
wxThread::Yield();
|
||||
}
|
||||
while (m_log.GetItemCount() > max_item_count)
|
||||
{
|
||||
m_log.DeleteItem(0);
|
||||
wxThread::Yield();
|
||||
}
|
||||
|
||||
const int cur_item = m_log.GetItemCount();
|
||||
const int cur_item = m_log.GetItemCount();
|
||||
|
||||
m_log.InsertItem(cur_item, fmt::FromUTF8(item.m_prefix));
|
||||
m_log.SetItem(cur_item, 1, fmt::FromUTF8(item.m_text));
|
||||
m_log.SetItemTextColour(cur_item, fmt::FromUTF8(item.m_colour));
|
||||
m_log.SetColumnWidth(0, -1); // crashes on exit
|
||||
m_log.SetColumnWidth(1, -1);
|
||||
m_log.InsertItem(cur_item, fmt::FromUTF8(item.m_prefix));
|
||||
m_log.SetItem(cur_item, 1, fmt::FromUTF8(item.m_text));
|
||||
m_log.SetItemTextColour(cur_item, fmt::FromUTF8(item.m_colour));
|
||||
m_log.SetColumnWidth(0, -1);
|
||||
m_log.SetColumnWidth(1, -1);
|
||||
});
|
||||
|
||||
#ifdef _WIN32
|
||||
::SendMessage((HWND)m_log.GetHWND(), WM_VSCROLL, SB_BOTTOM, 0);
|
||||
|
@ -398,7 +398,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
for(int i=1; i<WXSIZEOF(ResolutionTable); ++i)
|
||||
{
|
||||
cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width, ResolutionTable[i].height));
|
||||
cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width.ToLE(), ResolutionTable[i].height.ToLE()));
|
||||
}
|
||||
|
||||
cbox_gs_aspect->Append("4:3");
|
||||
|
Loading…
x
Reference in New Issue
Block a user