diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index da53a22558..54f032bdbd 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -562,9 +562,27 @@ bool get_x64_reg_value(x64_context* context, x64_reg_t reg, size_t d_size, size_ out_value = (u8)(*X64REG(context, reg - X64R_AH) >> 8); return true; } - else if (reg == X64_IMM32) + else if (reg == X64_IMM8) { // load the immediate value (assuming it's at the end of the instruction) + const s8 imm_value = *(s8*)(RIP(context) + i_size - 1); + + switch (d_size) + { + case 1: out_value = (u8)imm_value; return true; + } + } + else if (reg == X64_IMM16) + { + const s16 imm_value = *(s16*)(RIP(context) + i_size - 2); + + switch (d_size) + { + case 2: out_value = (u16)imm_value; return true; + } + } + else if (reg == X64_IMM32) + { const s32 imm_value = *(s32*)(RIP(context) + i_size - 4); switch (d_size) @@ -573,18 +591,6 @@ bool get_x64_reg_value(x64_context* context, x64_reg_t reg, size_t d_size, size_ case 8: out_value = (u64)imm_value; return true; // sign-extended } } - else if (reg == X64_IMM16) - { - // load the immediate value (assuming it's at the end of the instruction) - out_value = *(s16*)(RIP(context) + i_size - 2); - return true; - } - else if (reg == X64_IMM8) - { - // load the immediate value (assuming it's at the end of the instruction) - out_value = *(s8*)(RIP(context) + i_size - 1); - return true; - } else if (reg == X64R_ECX) { out_value = (u32)RCX(context); diff --git a/rpcs3/Emu/ARMv7/ARMv7Context.h b/rpcs3/Emu/ARMv7/ARMv7Context.h index 9200cd5752..ba97ed2375 100644 --- a/rpcs3/Emu/ARMv7/ARMv7Context.h +++ b/rpcs3/Emu/ARMv7/ARMv7Context.h @@ -174,6 +174,12 @@ struct ARMv7Context return get_stack_arg(g_count++); } } + + template + __noinline void fmt_debug_str(const char* fmt, T... args) + { + debug_str = fmt::format(fmt, args...); + } }; template::value> diff --git a/rpcs3/Emu/ARMv7/ARMv7Interpreter.cpp b/rpcs3/Emu/ARMv7/ARMv7Interpreter.cpp index 452da44c12..c035596347 100644 --- a/rpcs3/Emu/ARMv7/ARMv7Interpreter.cpp +++ b/rpcs3/Emu/ARMv7/ARMv7Interpreter.cpp @@ -294,7 +294,7 @@ namespace ARMv7_instrs context.debug_str.insert(pos, 8 - pos, ' '); } - context.debug_str = fmt::format("0x%08x: %s", context.thread.PC, context.debug_str); + context.fmt_debug_str("0x%08x: %s", context.thread.PC, context.debug_str); LV2_LOCK(0); @@ -530,16 +530,16 @@ void ARMv7_instrs::HACK(ARMv7Context& context, const ARMv7Code code, const ARMv7 { if (func->func) { - context.debug_str = fmt::format("hack%s %s", fmt_cond(cond), func->name); + context.fmt_debug_str("hack%s %s", fmt_cond(cond), func->name); } else { - context.debug_str = fmt::format("hack%s UNIMPLEMENTED:0x%08X (%s)", fmt_cond(cond), func->nid, func->name); + context.fmt_debug_str("hack%s UNIMPLEMENTED:0x%08X (%s)", fmt_cond(cond), func->nid, func->name); } } else { - context.debug_str = fmt::format("hack%s %d", fmt_cond(cond), index); + context.fmt_debug_str("hack%s %d", fmt_cond(cond), index); } } if (process_debug(context)) return; @@ -575,9 +575,14 @@ void ARMv7_instrs::MRC_(ARMv7Context& context, const ARMv7Code code, const ARMv7 default: throw __FUNCTION__; } + auto disasm = [&]() + { + context.fmt_debug_str("mrc%s p%d,%d,r%d,c%d,c%d,%d", fmt_cond(cond), cp, opc1, t, cn, cm, opc2); + }; + if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("mrc%s p%d,%d,r%d,c%d,c%d,%d", fmt_cond(cond), cp, opc1, t, cn, cm, opc2); + if (context.debug & DF_DISASM) disasm(); if (process_debug(context)) return; } @@ -598,7 +603,7 @@ void ARMv7_instrs::MRC_(ARMv7Context& context, const ARMv7Code code, const ARMv7 return; } - throw fmt::format("Bad instruction: mrc%s p%d,%d,r%d,c%d,c%d,%d", fmt_cond(cond), cp, opc1, t, cn, cm, opc2); + Error(__FUNCTION__, code, type, (disasm(), context.debug_str.c_str()), "Bad instruction"); } } @@ -626,7 +631,7 @@ void ARMv7_instrs::ADC_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("adc%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("adc%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -680,7 +685,7 @@ void ARMv7_instrs::ADC_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("adc%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("adc%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -765,7 +770,7 @@ void ARMv7_instrs::ADD_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("add%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("add%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -836,7 +841,7 @@ void ARMv7_instrs::ADD_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("add%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("add%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -916,7 +921,7 @@ void ARMv7_instrs::ADD_SPI(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("add%s%s %s,sp,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("add%s%s %s,sp,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); if (process_debug(context)) return; } @@ -982,7 +987,7 @@ void ARMv7_instrs::ADD_SPR(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("add%s%s %s,sp,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("add%s%s %s,sp,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -1048,7 +1053,7 @@ void ARMv7_instrs::ADR(ARMv7Context& context, const ARMv7Code code, const ARMv7_ if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("adr%s r%d, 0x%08X", fmt_cond(cond), d, result); + if (context.debug & DF_DISASM) context.fmt_debug_str("adr%s r%d, 0x%08X", fmt_cond(cond), d, result); if (process_debug(context)) return; } @@ -1084,7 +1089,7 @@ void ARMv7_instrs::AND_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("and%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("and%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -1137,7 +1142,7 @@ void ARMv7_instrs::AND_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("and%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("and%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -1248,7 +1253,7 @@ void ARMv7_instrs::B(ARMv7Context& context, const ARMv7Code code, const ARMv7_en if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("b%s 0x%08X", fmt_cond(cond), context.read_pc() + imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("b%s 0x%08X", fmt_cond(cond), context.read_pc() + imm32); if (process_debug(context)) return; } @@ -1302,7 +1307,7 @@ void ARMv7_instrs::BIC_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("bic%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("bic%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -1354,7 +1359,7 @@ void ARMv7_instrs::BIC_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("bic%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("bic%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -1427,7 +1432,7 @@ void ARMv7_instrs::BL(ARMv7Context& context, const ARMv7Code code, const ARMv7_e if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("bl%s 0x%08X", fmt_cond(cond), pc); + if (context.debug & DF_DISASM) context.fmt_debug_str("bl%s 0x%08X", fmt_cond(cond), pc); if (process_debug(context)) return; } @@ -1492,13 +1497,12 @@ void ARMv7_instrs::BLX(ARMv7Context& context, const ARMv7Code code, const ARMv7_ { if (context.debug & DF_DISASM) { - context.debug_str = fmt::format("blx%s ", fmt_cond(cond)); switch (type) { - case T1: context.debug_str += fmt_reg((code.data >> 3) & 0xf); break; - case T2: context.debug_str += fmt::format("0x%08X", target); break; - case A1: context.debug_str += fmt_reg(code.data & 0xf); break; - default: context.debug_str += "???"; + case T1: context.fmt_debug_str("blx%s %s", fmt_cond(cond), fmt_reg((code.data >> 3) & 0xf)); break; + case T2: context.fmt_debug_str("blx%s 0x%08X", fmt_cond(cond), target); break; + case A1: context.fmt_debug_str("blx%s %s", fmt_cond(cond), fmt_reg(code.data & 0xf)); break; + default: context.fmt_debug_str("blx%s ???", fmt_cond(cond)); } } if (process_debug(context)) return; @@ -1536,7 +1540,7 @@ void ARMv7_instrs::BX(ARMv7Context& context, const ARMv7Code code, const ARMv7_e if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("bx%s %s", fmt_cond(cond), fmt_reg(m)); + if (context.debug & DF_DISASM) context.fmt_debug_str("bx%s %s", fmt_cond(cond), fmt_reg(m)); if (process_debug(context)) return; } @@ -1568,7 +1572,7 @@ void ARMv7_instrs::CB_Z(ARMv7Context& context, const ARMv7Code code, const ARMv7 if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("cb%sz 0x%08X", nonzero ? "n" : "", context.read_pc() + imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("cb%sz 0x%08X", nonzero ? "n" : "", context.read_pc() + imm32); if (process_debug(context)) return; } @@ -1601,7 +1605,7 @@ void ARMv7_instrs::CLZ(ARMv7Context& context, const ARMv7Code code, const ARMv7_ if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("clz%s %s,%s", fmt_cond(cond), fmt_reg(d), fmt_reg(m)); + if (context.debug & DF_DISASM) context.fmt_debug_str("clz%s %s,%s", fmt_cond(cond), fmt_reg(d), fmt_reg(m)); if (process_debug(context)) return; } @@ -1668,7 +1672,7 @@ void ARMv7_instrs::CMP_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("cmp%s %s,#0x%X", fmt_cond(cond), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("cmp%s %s,#0x%X", fmt_cond(cond), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -1729,7 +1733,7 @@ void ARMv7_instrs::CMP_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("cmp%s %s,%s%s", fmt_cond(cond), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("cmp%s %s,%s%s", fmt_cond(cond), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -1812,7 +1816,7 @@ void ARMv7_instrs::EOR_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("eor%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("eor%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -1865,7 +1869,7 @@ void ARMv7_instrs::EOR_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("eor%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("eor%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -1917,7 +1921,7 @@ void ARMv7_instrs::IT(ARMv7Context& context, const ARMv7Code code, const ARMv7_e if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("IT%s %s", fmt_it(context.ITSTATE.shift_state), fmt_cond(context.ITSTATE.condition)); + if (context.debug & DF_DISASM) context.fmt_debug_str("IT%s %s", fmt_it(context.ITSTATE.shift_state), fmt_cond(context.ITSTATE.condition)); if (process_debug(context)) return; } } @@ -1959,7 +1963,7 @@ void ARMv7_instrs::LDM(ARMv7Context& context, const ARMv7Code code, const ARMv7_ if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldm%s %s%s,{%s}", fmt_cond(cond), fmt_reg(n), wback ? "!" : "", fmt_reg_list(reg_list)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldm%s %s%s,{%s}", fmt_cond(cond), fmt_reg(n), wback ? "!" : "", fmt_reg_list(reg_list)); if (process_debug(context)) return; } @@ -2076,7 +2080,7 @@ void ARMv7_instrs::LDR_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldr%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldr%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -2127,7 +2131,7 @@ void ARMv7_instrs::LDR_LIT(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldr%s %s,0x%08X", fmt_cond(cond), fmt_reg(t), addr); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldr%s %s,0x%08X", fmt_cond(cond), fmt_reg(t), addr); if (process_debug(context)) return; } @@ -2181,7 +2185,7 @@ void ARMv7_instrs::LDR_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldr%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldr%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); if (process_debug(context)) return; } @@ -2256,7 +2260,7 @@ void ARMv7_instrs::LDRB_IMM(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldrb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldrb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -2325,7 +2329,7 @@ void ARMv7_instrs::LDRB_REG(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldrb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldrb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); if (process_debug(context)) return; } @@ -2374,7 +2378,7 @@ void ARMv7_instrs::LDRD_IMM(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldrd%s %s,%s,%s", fmt_cond(cond), fmt_reg(t), fmt_reg(t2), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldrd%s %s,%s,%s", fmt_cond(cond), fmt_reg(t), fmt_reg(t2), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -2421,7 +2425,7 @@ void ARMv7_instrs::LDRD_LIT(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldrd%s %s,%s,0x%08X", fmt_cond(cond), fmt_reg(t), fmt_reg(t2), addr); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldrd%s %s,%s,0x%08X", fmt_cond(cond), fmt_reg(t), fmt_reg(t2), addr); if (process_debug(context)) return; } @@ -2499,7 +2503,7 @@ void ARMv7_instrs::LDRH_IMM(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldrh%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldrh%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -2580,7 +2584,7 @@ void ARMv7_instrs::LDRSB_IMM(ARMv7Context& context, const ARMv7Code code, const if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldrsb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldrsb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -2667,7 +2671,7 @@ void ARMv7_instrs::LDREX(ARMv7Context& context, const ARMv7Code code, const ARMv if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ldrex%s %s,[%s,#0x%X]", fmt_cond(cond), fmt_reg(t), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("ldrex%s %s,[%s,#0x%X]", fmt_cond(cond), fmt_reg(t), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -2745,7 +2749,7 @@ void ARMv7_instrs::LSL_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("lsl%s%s %s,%s,#%d", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), shift_n); + if (context.debug & DF_DISASM) context.fmt_debug_str("lsl%s%s %s,%s,#%d", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), shift_n); if (process_debug(context)) return; } @@ -2795,7 +2799,7 @@ void ARMv7_instrs::LSL_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("lsl%s%s %s,%s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m)); + if (context.debug & DF_DISASM) context.fmt_debug_str("lsl%s%s %s,%s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m)); if (process_debug(context)) return; } @@ -2847,7 +2851,7 @@ void ARMv7_instrs::LSR_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("lsr%s%s %s,%s,#%d", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), shift_n); + if (context.debug & DF_DISASM) context.fmt_debug_str("lsr%s%s %s,%s,#%d", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), shift_n); if (process_debug(context)) return; } @@ -2939,8 +2943,8 @@ void ARMv7_instrs::MOV_IMM(ARMv7Context& context, const ARMv7Code code, const AR { switch (type) { - case T3: case A2: context.debug_str = fmt::format("movw%s%s %s,#0x%04X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); break; - default: context.debug_str = fmt::format("mov%s%s %s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); + case T3: case A2: context.fmt_debug_str("movw%s%s %s,#0x%04X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); break; + default: context.fmt_debug_str("mov%s%s %s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); } } if (process_debug(context)) return; @@ -3004,7 +3008,7 @@ void ARMv7_instrs::MOV_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("mov%s%s %s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m)); + if (context.debug & DF_DISASM) context.fmt_debug_str("mov%s%s %s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m)); if (process_debug(context)) return; } @@ -3043,7 +3047,7 @@ void ARMv7_instrs::MOVT(ARMv7Context& context, const ARMv7Code code, const ARMv7 if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("movt%s %s,#0x%04X", fmt_cond(cond), fmt_reg(d), imm16); + if (context.debug & DF_DISASM) context.fmt_debug_str("movt%s %s,#0x%04X", fmt_cond(cond), fmt_reg(d), imm16); if (process_debug(context)) return; } @@ -3115,7 +3119,7 @@ void ARMv7_instrs::MUL(ARMv7Context& context, const ARMv7Code code, const ARMv7_ if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("mul%s%s %s,%s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m)); + if (context.debug & DF_DISASM) context.fmt_debug_str("mul%s%s %s,%s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m)); if (process_debug(context)) return; } @@ -3158,7 +3162,7 @@ void ARMv7_instrs::MVN_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("mvn%s%s %s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("mvn%s%s %s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); if (process_debug(context)) return; } @@ -3209,7 +3213,7 @@ void ARMv7_instrs::MVN_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("mvn%s%s %s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("mvn%s%s %s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -3265,7 +3269,7 @@ void ARMv7_instrs::NOP(ARMv7Context& context, const ARMv7Code code, const ARMv7_ if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("nop%s", fmt_cond(cond)); + if (context.debug & DF_DISASM) context.fmt_debug_str("nop%s", fmt_cond(cond)); if (process_debug(context)) return; } @@ -3319,7 +3323,7 @@ void ARMv7_instrs::ORR_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("orr%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("orr%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -3372,7 +3376,7 @@ void ARMv7_instrs::ORR_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("orr%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("orr%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -3465,7 +3469,7 @@ void ARMv7_instrs::POP(ARMv7Context& context, const ARMv7Code code, const ARMv7_ if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("pop%s {%s}", fmt_cond(cond), fmt_reg_list(reg_list)); + if (context.debug & DF_DISASM) context.fmt_debug_str("pop%s {%s}", fmt_cond(cond), fmt_reg_list(reg_list)); if (process_debug(context)) return; } @@ -3536,7 +3540,7 @@ void ARMv7_instrs::PUSH(ARMv7Context& context, const ARMv7Code code, const ARMv7 if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("push%s {%s}", fmt_cond(cond), fmt_reg_list(reg_list)); + if (context.debug & DF_DISASM) context.fmt_debug_str("push%s {%s}", fmt_cond(cond), fmt_reg_list(reg_list)); if (process_debug(context)) return; } @@ -3686,7 +3690,7 @@ void ARMv7_instrs::REV(ARMv7Context& context, const ARMv7Code code, const ARMv7_ if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("rev%s %s,%s", fmt_cond(cond), fmt_reg(d), fmt_reg(m)); + if (context.debug & DF_DISASM) context.fmt_debug_str("rev%s %s,%s", fmt_cond(cond), fmt_reg(d), fmt_reg(m)); if (process_debug(context)) return; } @@ -3740,7 +3744,7 @@ void ARMv7_instrs::ROR_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ror%s%s %s,%s,#%d", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), shift_n); + if (context.debug & DF_DISASM) context.fmt_debug_str("ror%s%s %s,%s,#%d", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(m), shift_n); if (process_debug(context)) return; } @@ -3790,7 +3794,7 @@ void ARMv7_instrs::ROR_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("ror%s%s %s,%s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m)); + if (context.debug & DF_DISASM) context.fmt_debug_str("ror%s%s %s,%s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m)); if (process_debug(context)) return; } @@ -3853,7 +3857,7 @@ void ARMv7_instrs::RSB_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("rsb%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("rsb%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -4286,7 +4290,7 @@ void ARMv7_instrs::STM(ARMv7Context& context, const ARMv7Code code, const ARMv7_ if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("stm%s %s%s,{%s}", fmt_cond(cond), fmt_reg(n), wback ? "!" : "", fmt_reg_list(reg_list)); + if (context.debug & DF_DISASM) context.fmt_debug_str("stm%s %s%s,{%s}", fmt_cond(cond), fmt_reg(n), wback ? "!" : "", fmt_reg_list(reg_list)); if (process_debug(context)) return; } @@ -4402,7 +4406,7 @@ void ARMv7_instrs::STR_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("str%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("str%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -4461,7 +4465,7 @@ void ARMv7_instrs::STR_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("str%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("str%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); if (process_debug(context)) return; } @@ -4533,7 +4537,7 @@ void ARMv7_instrs::STRB_IMM(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("strb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("strb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -4592,7 +4596,7 @@ void ARMv7_instrs::STRB_REG(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("strb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("strb%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); if (process_debug(context)) return; } @@ -4640,7 +4644,7 @@ void ARMv7_instrs::STRD_IMM(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("strd%s %s,%s,%s", fmt_cond(cond), fmt_reg(t), fmt_reg(t2), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("strd%s %s,%s,%s", fmt_cond(cond), fmt_reg(t), fmt_reg(t2), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -4721,7 +4725,7 @@ void ARMv7_instrs::STRH_IMM(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("strh%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); + if (context.debug & DF_DISASM) context.fmt_debug_str("strh%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_imm(n, imm32, index, add, wback)); if (process_debug(context)) return; } @@ -4780,7 +4784,7 @@ void ARMv7_instrs::STRH_REG(ARMv7Context& context, const ARMv7Code code, const A if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("strh%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("strh%s %s,%s", fmt_cond(cond), fmt_reg(t), fmt_mem_reg(n, m, index, add, wback, shift_t, shift_n)); if (process_debug(context)) return; } @@ -4823,7 +4827,7 @@ void ARMv7_instrs::STREX(ARMv7Context& context, const ARMv7Code code, const ARMv if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("strex%s %s,%s,[%s,#0x%x]", fmt_cond(cond), fmt_reg(d), fmt_reg(t), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("strex%s %s,%s,[%s,#0x%x]", fmt_cond(cond), fmt_reg(d), fmt_reg(t), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -4917,7 +4921,7 @@ void ARMv7_instrs::SUB_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("sub%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("sub%s%s %s,%s,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -4974,7 +4978,7 @@ void ARMv7_instrs::SUB_REG(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("sub%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); + if (context.debug & DF_DISASM) context.fmt_debug_str("sub%s%s %s,%s,%s%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), fmt_reg(n), fmt_reg(m), fmt_shift(shift_t, shift_n)); if (process_debug(context)) return; } @@ -5046,7 +5050,7 @@ void ARMv7_instrs::SUB_SPI(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("sub%s%s %s,sp,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("sub%s%s %s,sp,#0x%X", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d), imm32); if (process_debug(context)) return; } @@ -5201,7 +5205,7 @@ void ARMv7_instrs::TST_IMM(ARMv7Context& context, const ARMv7Code code, const AR if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("tst%s %s,#0x%X", fmt_cond(cond), fmt_reg(n), imm32); + if (context.debug & DF_DISASM) context.fmt_debug_str("tst%s %s,#0x%X", fmt_cond(cond), fmt_reg(n), imm32); if (process_debug(context)) return; } @@ -5376,7 +5380,7 @@ void ARMv7_instrs::UMULL(ARMv7Context& context, const ARMv7Code code, const ARMv if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("umull%s%s %s,%s,%s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d0), fmt_reg(d1), fmt_reg(n), fmt_reg(m)); + if (context.debug & DF_DISASM) context.fmt_debug_str("umull%s%s %s,%s,%s,%s", set_flags ? "s" : "", fmt_cond(cond), fmt_reg(d0), fmt_reg(d1), fmt_reg(n), fmt_reg(m)); if (process_debug(context)) return; } @@ -5568,7 +5572,7 @@ void ARMv7_instrs::UXTB(ARMv7Context& context, const ARMv7Code code, const ARMv7 if (context.debug) { - if (context.debug & DF_DISASM) context.debug_str = fmt::format("uxtb%s %s,%s%s", fmt_cond(cond), fmt_reg(d), fmt_reg(m), fmt_shift(SRType_ROR, rot)); + if (context.debug & DF_DISASM) context.fmt_debug_str("uxtb%s %s,%s%s", fmt_cond(cond), fmt_reg(d), fmt_reg(m), fmt_shift(SRType_ROR, rot)); if (process_debug(context)) return; } diff --git a/rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp b/rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp index 016917d6de..cd17ee6894 100644 --- a/rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp +++ b/rpcs3/Emu/ARMv7/Modules/sceLibKernel.cpp @@ -994,7 +994,7 @@ s32 sceIoGetstat(vm::psv::ptr name, vm::psv::ptr buf) } -#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibKernel, #name, &name) +#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibKernel, #name, name) psv_log_base sceLibKernel("sceLibKernel", []() { diff --git a/rpcs3/Emu/ARMv7/Modules/sceLibc.cpp b/rpcs3/Emu/ARMv7/Modules/sceLibc.cpp index 3e5b21c44e..f6364a7514 100644 --- a/rpcs3/Emu/ARMv7/Modules/sceLibc.cpp +++ b/rpcs3/Emu/ARMv7/Modules/sceLibc.cpp @@ -246,7 +246,7 @@ namespace sce_libc_func } } -#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibc, #name, &sce_libc_func::name) +#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibc, #name, sce_libc_func::name) psv_log_base sceLibc("SceLibc", []() { diff --git a/rpcs3/Emu/ARMv7/Modules/sceLibm.cpp b/rpcs3/Emu/ARMv7/Modules/sceLibm.cpp index 1cbd5cd12e..0fc905e819 100644 --- a/rpcs3/Emu/ARMv7/Modules/sceLibm.cpp +++ b/rpcs3/Emu/ARMv7/Modules/sceLibm.cpp @@ -9,7 +9,7 @@ namespace sce_libm_func } -#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibm, #name, &sce_libm_func::name) +#define REG_FUNC(nid, name) reg_psv_func(nid, &sceLibm, #name, sce_libm_func::name) psv_log_base sceLibm("SceLibm", []() { diff --git a/rpcs3/Emu/ARMv7/Modules/sceLibstdcxx.cpp b/rpcs3/Emu/ARMv7/Modules/sceLibstdcxx.cpp index 73260d9420..263c0b3303 100644 --- a/rpcs3/Emu/ARMv7/Modules/sceLibstdcxx.cpp +++ b/rpcs3/Emu/ARMv7/Modules/sceLibstdcxx.cpp @@ -23,7 +23,7 @@ namespace sce_libstdcxx_func } // Attention: find and set correct original mangled name in third parameter, for example: REG_FUNC(0xAE71DC3, operator_new_nothrow, "_ZnwjRKSt9nothrow_t"); -#define REG_FUNC(nid, name, orig_name) reg_psv_func(nid, &sceLibstdcxx, orig_name, &sce_libstdcxx_func::name) +#define REG_FUNC(nid, name, orig_name) reg_psv_func(nid, &sceLibstdcxx, orig_name, sce_libstdcxx_func::name) psv_log_base sceLibstdcxx("SceLibstdcxx", []() { diff --git a/rpcs3/Emu/ARMv7/PSVFuncList.cpp b/rpcs3/Emu/ARMv7/PSVFuncList.cpp index fdbad45cad..79fc5efdbe 100644 --- a/rpcs3/Emu/ARMv7/PSVFuncList.cpp +++ b/rpcs3/Emu/ARMv7/PSVFuncList.cpp @@ -75,7 +75,7 @@ void execute_psv_func_by_index(ARMv7Context& context, u32 index) if (func->func) { - (*func->func)(context); + func->func(context); } else { @@ -223,10 +223,10 @@ void initialize_psv_modules() psv_func& hle_return = g_psv_func_list[SFI_HLE_RETURN]; hle_return.nid = 0; hle_return.name = "HLE_RETURN"; - hle_return.func.reset(new psv_func_detail::func_binder([](ARMv7Context& context) + hle_return.func = [](ARMv7Context& context) { context.thread.FastStop(); - })); + }; // load functions for (auto module : g_psv_modules) diff --git a/rpcs3/Emu/ARMv7/PSVFuncList.h b/rpcs3/Emu/ARMv7/PSVFuncList.h index ed2d9217a8..2780e33a7b 100644 --- a/rpcs3/Emu/ARMv7/PSVFuncList.h +++ b/rpcs3/Emu/ARMv7/PSVFuncList.h @@ -33,13 +33,7 @@ public: }; -// Abstract HLE function caller base class -class psv_func_caller -{ -public: - virtual void operator()(ARMv7Context& CPU) = 0; - virtual ~psv_func_caller(){}; -}; +typedef void(*psv_func_caller)(ARMv7Context&); // Utilities for binding ARMv7Context to C++ function arguments received by HLE functions or sent to callbacks namespace psv_func_detail @@ -361,81 +355,49 @@ namespace psv_func_detail } template - class func_binder; + struct func_binder; template - class func_binder : public psv_func_caller + struct func_binder { typedef void(*func_t)(T...); - const func_t m_call; - public: - func_binder(func_t call) - : psv_func_caller() - , m_call(call) + static void do_call(ARMv7Context& context, func_t _func) { - } - - virtual void operator()(ARMv7Context& context) - { - call(m_call, get_func_args<0, 0, 0, T...>(context)); + call(_func, get_func_args<0, 0, 0, T...>(context)); } }; template - class func_binder : public psv_func_caller + struct func_binder { typedef void(*func_t)(ARMv7Context&, T...); - const func_t m_call; - public: - func_binder(func_t call) - : psv_func_caller() - , m_call(call) + static void do_call(ARMv7Context& context, func_t _func) { - } - - virtual void operator()(ARMv7Context& context) - { - call(m_call, std::tuple_cat(std::tuple(context), get_func_args<0, 0, 0, T...>(context))); + call(_func, std::tuple_cat(std::tuple(context), get_func_args<0, 0, 0, T...>(context))); } }; template - class func_binder : public psv_func_caller + struct func_binder { typedef RT(*func_t)(T...); - const func_t m_call; - public: - func_binder(func_t call) - : psv_func_caller() - , m_call(call) + static void do_call(ARMv7Context& context, func_t _func) { - } - - virtual void operator()(ARMv7Context& context) - { - bind_result::value>::put_result(context, call(m_call, get_func_args<0, 0, 0, T...>(context))); + bind_result::value>::put_result(context, call(_func, get_func_args<0, 0, 0, T...>(context))); } }; template - class func_binder : public psv_func_caller + struct func_binder { typedef RT(*func_t)(ARMv7Context&, T...); - const func_t m_call; - public: - func_binder(func_t call) - : psv_func_caller() - , m_call(call) + static void do_call(ARMv7Context& context, func_t _func) { - } - - virtual void operator()(ARMv7Context& context) - { - bind_result::value>::put_result(context, call(m_call, std::tuple_cat(std::tuple(context), get_func_args<0, 0, 0, T...>(context)))); + bind_result::value>::put_result(context, call(_func, std::tuple_cat(std::tuple(context), get_func_args<0, 0, 0, T...>(context)))); } }; @@ -474,7 +436,7 @@ struct psv_func { u32 nid; // Unique function ID (should be generated individually for each elf loaded) const char* name; // Function name for information - std::shared_ptr func; // Function caller instance + psv_func_caller func; // Function caller psv_log_base* module; // Module for information }; @@ -488,16 +450,24 @@ enum psv_special_function_index : u16 // Do not call directly u32 add_psv_func(psv_func data); // Do not call directly -template void reg_psv_func(u32 nid, psv_log_base* module, const char* name, RT(*func)(T...)) +__forceinline static u32 add_psv_func(u32 nid, psv_log_base* module, const char* name, psv_func_caller func) { psv_func f; f.nid = nid; f.name = name; - f.func.reset(new psv_func_detail::func_binder(func)); + f.func = func; f.module = module; - add_psv_func(f); + return add_psv_func(f); } +// Do not call directly +template __forceinline void call_psv_func(ARMv7Context& context, RT(*func)(T...)) +{ + psv_func_detail::func_binder::do_call(context, func); +} + +#define reg_psv_func(nid, module, name, func) add_psv_func(nid, module, name, [](ARMv7Context& context){ call_psv_func(context, func); }) + // Find registered HLE function by NID psv_func* get_psv_func_by_nid(u32 nid, u32* out_index = nullptr); // Find registered HLE function by its index diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index d4bdbc4a8b..a21a524fc6 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -4,7 +4,6 @@ #include "Emu/SysCalls/SysCalls.h" #include "rpcs3/Ini.h" #include "Emu/System.h" -#include "Emu/SysCalls/Static.h" #include "Emu/SysCalls/Modules.h" #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/lv2/sys_time.h" @@ -2255,7 +2254,7 @@ private: } void HACK(u32 index) { - execute_ps3_func_by_index(CPU, index); + execute_ppu_func_by_index(CPU, index); } void SC(u32 lev) { @@ -2263,14 +2262,6 @@ private: { case 0x0: SysCall(); break; case 0x1: throw "SC(): HyperCall LV1"; - case 0x2: - Emu.GetSFuncManager().StaticExecute(CPU, (u32)CPU.GPR[11]); - if (Ini.HLELogging.GetValue()) - { - LOG_NOTICE(PPU, "'%s' done with code[0x%llx]! #pc: 0x%x", - Emu.GetSFuncManager()[CPU.GPR[11]]->name, CPU.GPR[3], CPU.PC); - } - break; case 0x3: CPU.FastStop(); break; default: throw fmt::Format("SC(): unknown level (0x%x)", lev); } diff --git a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp index 621270b58a..d7c348d03b 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp @@ -1999,7 +1999,7 @@ void Compiler::BC(u32 bo, u32 bi, s32 bd, u32 aa, u32 lk) { } void Compiler::HACK(u32 index) { - Call("execute_ps3_func_by_index", &execute_ps3_func_by_index, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt32(index)); + Call("execute_ppu_func_by_index", &execute_ppu_func_by_index, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt32(index)); } void Compiler::SC(u32 lev) { @@ -2007,10 +2007,6 @@ void Compiler::SC(u32 lev) { case 0: Call("SysCalls.DoSyscall", SysCalls::DoSyscall, m_state.args[CompileTaskState::Args::State], GetGpr(11)); break; - case 2: - Call("StaticFuncManager.StaticExecute", &StaticFuncManager::StaticExecute, - m_ir_builder->getInt64((u64)&Emu.GetSFuncManager()), m_state.args[CompileTaskState::Args::State], GetGpr(11, 32)); - break; case 3: Call("PPUThread.FastStop", &PPUThread::FastStop, m_state.args[CompileTaskState::Args::State]); break; diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 01b3a94b9e..205dc2b4eb 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -6,7 +6,6 @@ #include "Emu/Cell/PPUThread.h" #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/Modules.h" -#include "Emu/SysCalls/Static.h" #include "Emu/Cell/PPUDecoder.h" #include "Emu/Cell/PPUInterpreter.h" #include "Emu/Cell/PPULLVMRecompiler.h" diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index 6e4e8bcd48..61d31fca42 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -174,6 +174,8 @@ void ModuleManager::Init() { if (!initialized) { + clear_ppu_functions(); + for (auto& m : g_module_list) { if (m.module) diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index 523f572c59..5939cf47b4 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -1,20 +1,21 @@ #include "stdafx.h" +#include "Ini.h" #include "Utilities/Log.h" #include "Emu/Memory/Memory.h" #include "Emu/System.h" #include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/SysCalls.h" -#include "Emu/SysCalls/Static.h" #include "Emu/SysCalls/CB_FUNC.h" #include "Crypto/sha1.h" #include "ModuleManager.h" #include "Emu/Cell/PPUInstrTable.h" -std::vector g_ps3_func_list; +std::vector g_ppu_func_list; +std::vector g_ppu_func_subs; -u32 add_ps3_func(ModuleFunc func) +u32 add_ppu_func(ModuleFunc func) { - for (auto& f : g_ps3_func_list) + for (auto& f : g_ppu_func_list) { if (f.id == func.id) { @@ -30,23 +31,50 @@ u32 add_ps3_func(ModuleFunc func) f.lle_func = func.lle_func; } - return (u32)(&f - g_ps3_func_list.data()); + return (u32)(&f - g_ppu_func_list.data()); } } - g_ps3_func_list.push_back(func); - return (u32)g_ps3_func_list.size() - 1; + g_ppu_func_list.push_back(func); + return (u32)g_ppu_func_list.size() - 1; } -ModuleFunc* get_ps3_func_by_nid(u32 nid, u32* out_index) +u32 add_ppu_func_sub(StaticFunc func) { - for (auto& f : g_ps3_func_list) + g_ppu_func_subs.push_back(func); + return func.index; +} + +u32 add_ppu_func_sub(const char group[8], const u64 ops[], const char* name, Module* module, ppu_func_caller func) +{ + StaticFunc sf; + sf.index = add_ppu_func(ModuleFunc(get_function_id(name), module, func)); + sf.name = name; + sf.group = *(u64*)group; + sf.found = 0; + + // TODO: check for self-inclusions, use CRC + for (u32 i = 0; ops[i]; i++) + { + SFuncOp op; + op.mask = re32((u32)(ops[i] >> 32)); + op.crc = re32((u32)(ops[i])); + if (op.mask) op.crc &= op.mask; + sf.ops.push_back(op); + } + + return add_ppu_func_sub(sf); +} + +ModuleFunc* get_ppu_func_by_nid(u32 nid, u32* out_index) +{ + for (auto& f : g_ppu_func_list) { if (f.id == nid) { if (out_index) { - *out_index = (u32)(&f - g_ps3_func_list.data()); + *out_index = (u32)(&f - g_ppu_func_list.data()); } return &f; @@ -56,19 +84,19 @@ ModuleFunc* get_ps3_func_by_nid(u32 nid, u32* out_index) return nullptr; } -ModuleFunc* get_ps3_func_by_index(u32 index) +ModuleFunc* get_ppu_func_by_index(u32 index) { - if (index >= g_ps3_func_list.size()) + if (index >= g_ppu_func_list.size()) { return nullptr; } - return &g_ps3_func_list[index]; + return &g_ppu_func_list[index]; } -void execute_ps3_func_by_index(PPUThread& CPU, u32 index) +void execute_ppu_func_by_index(PPUThread& CPU, u32 index) { - if (auto func = get_ps3_func_by_index(index)) + if (auto func = get_ppu_func_by_index(index)) { // save RTOC vm::write64(vm::cast(CPU.GPR[1] + 0x28), CPU.GPR[2]); @@ -82,7 +110,7 @@ void execute_ps3_func_by_index(PPUThread& CPU, u32 index) } else if (func->func) { - (*func->func)(CPU); + func->func(CPU); } else { @@ -98,9 +126,10 @@ void execute_ps3_func_by_index(PPUThread& CPU, u32 index) } } -void clear_ps3_functions() +void clear_ppu_functions() { - g_ps3_func_list.clear(); + g_ppu_func_list.clear(); + g_ppu_func_subs.clear(); } u32 get_function_id(const char* name) @@ -119,6 +148,180 @@ u32 get_function_id(const char* name) return (u32&)output[0]; } +void hook_ppu_funcs(u32* base, u32 size) +{ + size /= 4; + + if (!Ini.HLEHookStFunc.GetValue()) + return; + + // TODO: optimize search + for (u32 i = 0; i < size; i++) + { + for (u32 j = 0; j < g_ppu_func_subs.size(); j++) + { + if ((base[i] & g_ppu_func_subs[j].ops[0].mask) == g_ppu_func_subs[j].ops[0].crc) + { + bool found = true; + u32 can_skip = 0; + for (u32 k = i, x = 0; x + 1 <= g_ppu_func_subs[j].ops.size(); k++, x++) + { + if (k >= size) + { + found = false; + break; + } + + // skip NOP + if (base[k] == se32(0x60000000)) + { + x--; + continue; + } + + const u32 mask = g_ppu_func_subs[j].ops[x].mask; + const u32 crc = g_ppu_func_subs[j].ops[x].crc; + + if (!mask) + { + // TODO: define syntax + if (crc < 4) // skip various number of instructions that don't match next pattern entry + { + can_skip += crc; + k--; // process this position again + } + else if (base[k] != crc) // skippable pattern ("optional" instruction), no mask allowed + { + k--; + if (can_skip) // cannot define this behaviour properly + { + LOG_WARNING(LOADER, "hook_ppu_funcs(): can_skip = %d (unchanged)", can_skip); + } + } + else + { + if (can_skip) // cannot define this behaviour properly + { + LOG_WARNING(LOADER, "hook_ppu_funcs(): can_skip = %d (set to 0)", can_skip); + can_skip = 0; + } + } + } + else if ((base[k] & mask) != crc) // masked pattern + { + if (can_skip) + { + can_skip--; + } + else + { + found = false; + break; + } + } + else + { + can_skip = 0; + } + } + if (found) + { + LOG_NOTICE(LOADER, "Function '%s' hooked (addr=0x%x)", g_ppu_func_subs[j].name, vm::get_addr(base + i * 4)); + g_ppu_func_subs[j].found++; + base[i + 0] = re32(0x04000000 | g_ppu_func_subs[j].index); // hack + base[i + 1] = se32(0x4e800020); // blr + i += 1; // skip modified code + } + } + } + } + + // check function groups + for (u32 i = 0; i < g_ppu_func_subs.size(); i++) + { + if (g_ppu_func_subs[i].found) // start from some group + { + const u64 group = g_ppu_func_subs[i].group; + + enum GroupSearchResult : u32 + { + GSR_SUCCESS = 0, // every function from this group has been found once + GSR_MISSING = 1, // (error) some function not found + GSR_EXCESS = 2, // (error) some function found twice or more + }; + u32 res = GSR_SUCCESS; + + // analyse + for (u32 j = 0; j < g_ppu_func_subs.size(); j++) if (g_ppu_func_subs[j].group == group) + { + u32 count = g_ppu_func_subs[j].found; + + if (count == 0) // not found + { + // check if this function has been found with different pattern + for (u32 k = 0; k < g_ppu_func_subs.size(); k++) if (g_ppu_func_subs[k].group == group) + { + if (k != j && g_ppu_func_subs[k].index == g_ppu_func_subs[j].index) + { + count += g_ppu_func_subs[k].found; + } + } + if (count == 0) + { + res |= GSR_MISSING; + LOG_ERROR(LOADER, "Function '%s' not found", g_ppu_func_subs[j].name); + } + else if (count > 1) + { + res |= GSR_EXCESS; + } + } + else if (count == 1) // found + { + // ensure that this function has NOT been found with different pattern + for (u32 k = 0; k < g_ppu_func_subs.size(); k++) if (g_ppu_func_subs[k].group == group) + { + if (k != j && g_ppu_func_subs[k].index == g_ppu_func_subs[j].index) + { + if (g_ppu_func_subs[k].found) + { + res |= GSR_EXCESS; + LOG_ERROR(LOADER, "Function '%s' hooked twice", g_ppu_func_subs[j].name); + } + } + } + } + else + { + res |= GSR_EXCESS; + LOG_ERROR(LOADER, "Function '%s' hooked twice", g_ppu_func_subs[j].name); + } + } + + // clear data + for (u32 j = 0; j < g_ppu_func_subs.size(); j++) + { + if (g_ppu_func_subs[j].group == group) g_ppu_func_subs[j].found = 0; + } + + char name[9] = "????????"; + + *(u64*)name = group; + + if (res == GSR_SUCCESS) + { + LOG_SUCCESS(LOADER, "Function group [%s] successfully hooked", std::string(name, 9).c_str()); + } + else + { + LOG_ERROR(LOADER, "Function group [%s] failed:%s%s", std::string(name, 9).c_str(), + (res & GSR_MISSING ? " missing;" : ""), + (res & GSR_EXCESS ? " excess;" : "")); + } + } + } +} + Module::Module(const char* name, void(*init)()) : m_is_loaded(false) , m_name(name) @@ -204,90 +407,3 @@ IdManager& Module::GetIdManager() const { return Emu.GetIdManager(); } - -void Module::PushNewFuncSub(SFunc* func) -{ - Emu.GetSFuncManager().push_back(func); -} - -void fix_import(Module* module, u32 nid, u32 addr) -{ - using namespace PPU_instr; - - vm::ptr ptr = vm::ptr::make(addr); - - u32 index; - - if (auto func = get_ps3_func_by_nid(nid, &index)) - { - *ptr++ = HACK(index); - *ptr++ = BLR(); - } - else - { - module->Error("Unimplemented function 0x%x (0x%x)", nid, addr); - } - - //*ptr++ = ADDIS(11, 0, func >> 16); - //*ptr++ = ORI(11, 11, func & 0xffff); - //*ptr++ = NOP(); - //++ptr; - //*ptr++ = SC(0); - //*ptr++ = BLR(); - //*ptr++ = NOP(); - //*ptr++ = NOP(); -} - -void fix_relocs(Module* module, u32 lib, u32 start, u32 end, u32 seg2) -{ - // start of table: - // addr = (u64) addr - seg2, (u32) 1, (u32) 1, (u64) ptr - // addr = (u64) addr - seg2, (u32) 0x101, (u32) 1, (u64) ptr - seg2 (???) - // addr = (u64) addr, (u32) 0x100, (u32) 1, (u64) ptr - seg2 (???) - // addr = (u64) addr, (u32) 0, (u32) 1, (u64) ptr (???) - - for (u32 i = lib + start; i < lib + end; i += 24) - { - u64 addr = vm::read64(i) + lib; - const u64 flag = vm::read64(i + 8); - - if ((u32)addr != addr || (u32)(addr + seg2) != (addr + seg2)) - { - module->Error("fix_relocs(): invalid address (0x%llx)", addr); - } - else if (flag == 0x10100000001ull) - { - addr = addr + seg2; - u32 value = vm::read32((u32)addr); - assert(value == vm::read64(i + 16) + seg2); - vm::write32((u32)addr, value + lib); - } - else if (flag == 0x100000001ull) - { - addr = addr + seg2; - u32 value = vm::read32((u32)addr); - assert(value == vm::read64(i + 16)); - vm::write32((u32)addr, value + lib); - } - else if (flag == 0x10000000001ull) - { - u32 value = vm::read32((u32)addr); - assert(value == vm::read64(i + 16) + seg2); - vm::write32((u32)addr, value + lib); - } - else if (flag == 1) - { - u32 value = vm::read32((u32)addr); - assert(value == vm::read64(i + 16)); - vm::write32((u32)addr, value + lib); - } - else if (flag == 0x10000000004ull || flag == 0x10000000006ull) - { - // seems to be instruction modifiers for imports (done in other way in FIX_IMPORT) - } - else - { - module->Notice("fix_relocs(): 0x%x : 0x%llx", i - lib, flag); - } - } -} diff --git a/rpcs3/Emu/SysCalls/Modules.h b/rpcs3/Emu/SysCalls/Modules.h index 856430a235..6b724a1619 100644 --- a/rpcs3/Emu/SysCalls/Modules.h +++ b/rpcs3/Emu/SysCalls/Modules.h @@ -10,10 +10,10 @@ struct ModuleFunc { u32 id; Module* module; - std::shared_ptr func; + ppu_func_caller func; vm::ptr lle_func; - ModuleFunc(u32 id, Module* module, func_caller* func, vm::ptr lle_func = vm::ptr::make(0)) + ModuleFunc(u32 id, Module* module, ppu_func_caller func, vm::ptr lle_func = vm::ptr::make(0)) : id(id) , module(module) , func(func) @@ -28,23 +28,15 @@ struct SFuncOp u32 mask; }; -struct SFunc +struct StaticFunc { - func_caller* func; - void* ptr; + u32 index; const char* name; std::vector ops; u64 group; u32 found; - - ~SFunc() - { - delete func; - } }; -class StaticFuncManager; - class Module : public LogBase { std::string m_name; @@ -52,7 +44,6 @@ class Module : public LogBase void(*m_init)(); IdManager& GetIdManager() const; - void PushNewFuncSub(SFunc* func); Module() = delete; @@ -116,67 +107,26 @@ public: } bool RemoveId(u32 id); - - template __forceinline void AddFunc(u32 id, T func); - template __forceinline void AddFunc(const char* name, T func); - template __forceinline void AddFuncSub(const char group[8], const u64 ops[], const char* name, T func); }; -u32 add_ps3_func(ModuleFunc func); -ModuleFunc* get_ps3_func_by_nid(u32 nid, u32* out_index = nullptr); -ModuleFunc* get_ps3_func_by_index(u32 index); -void execute_ps3_func_by_index(PPUThread& CPU, u32 id); -void clear_ps3_functions(); +u32 add_ppu_func(ModuleFunc func); +ModuleFunc* get_ppu_func_by_nid(u32 nid, u32* out_index = nullptr); +ModuleFunc* get_ppu_func_by_index(u32 index); +void execute_ppu_func_by_index(PPUThread& CPU, u32 id); +void clear_ppu_functions(); u32 get_function_id(const char* name); -template -__forceinline void Module::AddFunc(u32 id, T func) -{ - add_ps3_func(ModuleFunc(id, this, bind_func(func))); -} +u32 add_ppu_func_sub(StaticFunc sf); +u32 add_ppu_func_sub(const char group[8], const u64 ops[], const char* name, Module* module, ppu_func_caller func); -template -__forceinline void Module::AddFunc(const char* name, T func) -{ - AddFunc(get_function_id(name), func); -} +void hook_ppu_funcs(u32* base, u32 size); -template -__forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], const char* name, T func) -{ - if (!ops[0]) return; +#define REG_FUNC(module, name) add_ppu_func(ModuleFunc(get_function_id(#name), &module, bind_func(name))) - SFunc* sf = new SFunc; - sf->ptr = (void *)func; - sf->func = bind_func(func); - sf->name = name; - sf->group = *(u64*)group; - sf->found = 0; - - // TODO: check for self-inclusions, use CRC - for (u32 i = 0; ops[i]; i++) - { - SFuncOp op; - op.mask = ops[i] >> 32; - op.crc = (u32)ops[i]; - if (op.mask) op.crc &= op.mask; - op.mask = re32(op.mask); - op.crc = re32(op.crc); - sf->ops.push_back(op); - } - PushNewFuncSub(sf); -} - -void fix_import(Module* module, u32 nid, u32 addr); - -#define FIX_IMPORT(module, func, addr) fix_import(module, get_function_id(#func), addr) - -void fix_relocs(Module* module, u32 lib, u32 start, u32 end, u32 seg2); +#define REG_UNNAMED(module, nid) add_ppu_func(ModuleFunc(0x##nid, &module, bind_func(_nid_##nid))) #define REG_SUB(module, group, name, ...) \ static const u64 name ## _table[] = {__VA_ARGS__ , 0}; \ - module.AddFuncSub(group, name ## _table, #name, name) - -#define REG_FUNC(module, name) module.AddFunc(get_function_id(#name), name) + if (name ## _table[0]) add_ppu_func_sub(group, name ## _table, #name, &module, bind_func(name)) #define UNIMPLEMENTED_FUNC(module) module.Error("%s", __FUNCTION__) diff --git a/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp b/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp index 0427de1bc3..464ac26224 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp @@ -212,34 +212,34 @@ s32 cellAtracGetInternalErrorInfo(vm::ptr pHandle, vm::ptr Module cellAtrac("cellAtrac", []() { - cellAtrac.AddFunc(0x66afc68e, cellAtracSetDataAndGetMemSize); + REG_FUNC(cellAtrac, cellAtracSetDataAndGetMemSize); - cellAtrac.AddFunc(0xfa293e88, cellAtracCreateDecoder); - cellAtrac.AddFunc(0x2642d4cc, cellAtracCreateDecoderExt); - cellAtrac.AddFunc(0x761cb9be, cellAtracDeleteDecoder); + REG_FUNC(cellAtrac, cellAtracCreateDecoder); + REG_FUNC(cellAtrac, cellAtracCreateDecoderExt); + REG_FUNC(cellAtrac, cellAtracDeleteDecoder); - cellAtrac.AddFunc(0x8eb0e65f, cellAtracDecode); + REG_FUNC(cellAtrac, cellAtracDecode); - cellAtrac.AddFunc(0x2bfff084, cellAtracGetStreamDataInfo); - cellAtrac.AddFunc(0x46cfc013, cellAtracAddStreamData); - cellAtrac.AddFunc(0xdfab73aa, cellAtracGetRemainFrame); - cellAtrac.AddFunc(0xc9a95fcb, cellAtracGetVacantSize); - cellAtrac.AddFunc(0x99efe171, cellAtracIsSecondBufferNeeded); - cellAtrac.AddFunc(0xbe07f05e, cellAtracGetSecondBufferInfo); - cellAtrac.AddFunc(0x06ddb53e, cellAtracSetSecondBuffer); + REG_FUNC(cellAtrac, cellAtracGetStreamDataInfo); + REG_FUNC(cellAtrac, cellAtracAddStreamData); + REG_FUNC(cellAtrac, cellAtracGetRemainFrame); + REG_FUNC(cellAtrac, cellAtracGetVacantSize); + REG_FUNC(cellAtrac, cellAtracIsSecondBufferNeeded); + REG_FUNC(cellAtrac, cellAtracGetSecondBufferInfo); + REG_FUNC(cellAtrac, cellAtracSetSecondBuffer); - cellAtrac.AddFunc(0x0f9667b6, cellAtracGetChannel); - cellAtrac.AddFunc(0x5f62d546, cellAtracGetMaxSample); - cellAtrac.AddFunc(0x4797d1ff, cellAtracGetNextSample); - cellAtrac.AddFunc(0xcf01d5d4, cellAtracGetSoundInfo); - cellAtrac.AddFunc(0x7b22e672, cellAtracGetNextDecodePosition); - cellAtrac.AddFunc(0x006016da, cellAtracGetBitrate); + REG_FUNC(cellAtrac, cellAtracGetChannel); + REG_FUNC(cellAtrac, cellAtracGetMaxSample); + REG_FUNC(cellAtrac, cellAtracGetNextSample); + REG_FUNC(cellAtrac, cellAtracGetSoundInfo); + REG_FUNC(cellAtrac, cellAtracGetNextDecodePosition); + REG_FUNC(cellAtrac, cellAtracGetBitrate); - cellAtrac.AddFunc(0xab6b6dbf, cellAtracGetLoopInfo); - cellAtrac.AddFunc(0x78ba5c41, cellAtracSetLoopNum); + REG_FUNC(cellAtrac, cellAtracGetLoopInfo); + REG_FUNC(cellAtrac, cellAtracSetLoopNum); - cellAtrac.AddFunc(0x99fb73d1, cellAtracGetBufferInfoForResetting); - cellAtrac.AddFunc(0x7772eb2b, cellAtracResetPlayPosition); + REG_FUNC(cellAtrac, cellAtracGetBufferInfoForResetting); + REG_FUNC(cellAtrac, cellAtracResetPlayPosition); - cellAtrac.AddFunc(0xb5c11938, cellAtracGetInternalErrorInfo); + REG_FUNC(cellAtrac, cellAtracGetInternalErrorInfo); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp b/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp index 15b7f773e0..e047c4ea06 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp @@ -41,9 +41,9 @@ int cellBGDLGetMode() void cellBgdl_init() { - cellBgdl.AddFunc(0x4e9bb95b, cellBGDLGetInfo); - cellBgdl.AddFunc(0x2ab0d183, cellBGDLGetInfo2); - cellBgdl.AddFunc(0x7e134a90, cellBGDLSetMode); - cellBgdl.AddFunc(0x74e57bdf, cellBGDLGetMode); + REG_FUNC(cellBgdl, cellBGDLGetInfo); + REG_FUNC(cellBgdl, cellBGDLGetInfo2); + REG_FUNC(cellBgdl, cellBGDLSetMode); + REG_FUNC(cellBgdl, cellBGDLGetMode); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp index 3dd0d99cc3..f6c8e292e9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp @@ -569,38 +569,38 @@ void cellCamera_unload() Module cellCamera("cellCamera", []() { - cellCamera.AddFunc(0xbf47c5dd, cellCameraInit); - cellCamera.AddFunc(0x5ad46570, cellCameraEnd); - cellCamera.AddFunc(0x85e1b8da, cellCameraOpen); - cellCamera.AddFunc(0x5d25f866, cellCameraOpenEx); - cellCamera.AddFunc(0x379c5dd6, cellCameraClose); + REG_FUNC(cellCamera, cellCameraInit); + REG_FUNC(cellCamera, cellCameraEnd); + REG_FUNC(cellCamera, cellCameraOpen); + REG_FUNC(cellCamera, cellCameraOpenEx); + REG_FUNC(cellCamera, cellCameraClose); - cellCamera.AddFunc(0x602e2052, cellCameraGetDeviceGUID); - cellCamera.AddFunc(0x58bc5870, cellCameraGetType); - cellCamera.AddFunc(0x8ca53dde, cellCameraIsAvailable); - cellCamera.AddFunc(0x7e063bbc, cellCameraIsAttached); - cellCamera.AddFunc(0xfa160f24, cellCameraIsOpen); - cellCamera.AddFunc(0x5eebf24e, cellCameraIsStarted); - cellCamera.AddFunc(0x532b8aaa, cellCameraGetAttribute); - cellCamera.AddFunc(0x8cd56eee, cellCameraSetAttribute); - cellCamera.AddFunc(0x7dac520c, cellCameraGetBufferSize); - cellCamera.AddFunc(0x10697d7f, cellCameraGetBufferInfo); - cellCamera.AddFunc(0x0e63c444, cellCameraGetBufferInfoEx); + REG_FUNC(cellCamera, cellCameraGetDeviceGUID); + REG_FUNC(cellCamera, cellCameraGetType); + REG_FUNC(cellCamera, cellCameraIsAvailable); + REG_FUNC(cellCamera, cellCameraIsAttached); + REG_FUNC(cellCamera, cellCameraIsOpen); + REG_FUNC(cellCamera, cellCameraIsStarted); + REG_FUNC(cellCamera, cellCameraGetAttribute); + REG_FUNC(cellCamera, cellCameraSetAttribute); + REG_FUNC(cellCamera, cellCameraGetBufferSize); + REG_FUNC(cellCamera, cellCameraGetBufferInfo); + REG_FUNC(cellCamera, cellCameraGetBufferInfoEx); - cellCamera.AddFunc(0x61dfbe83, cellCameraPrepExtensionUnit); - cellCamera.AddFunc(0xeb6f95fb, cellCameraCtrlExtensionUnit); - cellCamera.AddFunc(0xb602e328, cellCameraGetExtensionUnit); - cellCamera.AddFunc(0x2dea3e9b, cellCameraSetExtensionUnit); + REG_FUNC(cellCamera, cellCameraPrepExtensionUnit); + REG_FUNC(cellCamera, cellCameraCtrlExtensionUnit); + REG_FUNC(cellCamera, cellCameraGetExtensionUnit); + REG_FUNC(cellCamera, cellCameraSetExtensionUnit); - cellCamera.AddFunc(0x81f83db9, cellCameraReset); - cellCamera.AddFunc(0x456dc4aa, cellCameraStart); - cellCamera.AddFunc(0x3845d39b, cellCameraRead); - cellCamera.AddFunc(0x21fc151f, cellCameraReadEx); - cellCamera.AddFunc(0xe28b206b, cellCameraReadComplete); - cellCamera.AddFunc(0x02f5ced0, cellCameraStop); + REG_FUNC(cellCamera, cellCameraReset); + REG_FUNC(cellCamera, cellCameraStart); + REG_FUNC(cellCamera, cellCameraRead); + REG_FUNC(cellCamera, cellCameraReadEx); + REG_FUNC(cellCamera, cellCameraReadComplete); + REG_FUNC(cellCamera, cellCameraStop); - cellCamera.AddFunc(0xb0647e5a, cellCameraSetNotifyEventQueue); - cellCamera.AddFunc(0x9b98d258, cellCameraRemoveNotifyEventQueue); - cellCamera.AddFunc(0xa7fd2f5b, cellCameraSetNotifyEventQueue2); - cellCamera.AddFunc(0x44673f07, cellCameraRemoveNotifyEventQueue2); + REG_FUNC(cellCamera, cellCameraSetNotifyEventQueue); + REG_FUNC(cellCamera, cellCameraRemoveNotifyEventQueue); + REG_FUNC(cellCamera, cellCameraSetNotifyEventQueue2); + REG_FUNC(cellCamera, cellCameraRemoveNotifyEventQueue2); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp b/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp index 83473a902c..e89fe43bce 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp @@ -71,14 +71,14 @@ int cellCelp8EncGetAu() void cellCelp8Enc_init() { - cellCelp8Enc.AddFunc(0x2d677e0c, cellCelp8EncQueryAttr); - cellCelp8Enc.AddFunc(0x2eb6efee, cellCelp8EncOpen); - cellCelp8Enc.AddFunc(0xcd48ad62, cellCelp8EncOpenEx); - cellCelp8Enc.AddFunc(0xfd2566b4, cellCelp8EncClose); - cellCelp8Enc.AddFunc(0x0f6ab57b, cellCelp8EncStart); - cellCelp8Enc.AddFunc(0xbbbc2c1c, cellCelp8EncEnd); - cellCelp8Enc.AddFunc(0x2099f86e, cellCelp8EncEncodeFrame); - cellCelp8Enc.AddFunc(0x29da1ea6, cellCelp8EncWaitForOutput); - cellCelp8Enc.AddFunc(0x48c5020d, cellCelp8EncGetAu); + REG_FUNC(cellCelp8Enc, cellCelp8EncQueryAttr); + REG_FUNC(cellCelp8Enc, cellCelp8EncOpen); + REG_FUNC(cellCelp8Enc, cellCelp8EncOpenEx); + REG_FUNC(cellCelp8Enc, cellCelp8EncClose); + REG_FUNC(cellCelp8Enc, cellCelp8EncStart); + REG_FUNC(cellCelp8Enc, cellCelp8EncEnd); + REG_FUNC(cellCelp8Enc, cellCelp8EncEncodeFrame); + REG_FUNC(cellCelp8Enc, cellCelp8EncWaitForOutput); + REG_FUNC(cellCelp8Enc, cellCelp8EncGetAu); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp b/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp index 03be6b4957..9ee9c60953 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp @@ -71,14 +71,14 @@ int cellCelpEncGetAu() void cellCelpEnc_init() { - cellCelpEnc.AddFunc(0x6b148570, cellCelpEncQueryAttr); - cellCelpEnc.AddFunc(0x77b3b29a, cellCelpEncOpen); - cellCelpEnc.AddFunc(0x9eb084db, cellCelpEncOpenEx); - cellCelpEnc.AddFunc(0x15ec0cca, cellCelpEncClose); - cellCelpEnc.AddFunc(0x55dc23de, cellCelpEncStart); - cellCelpEnc.AddFunc(0xf2b85dff, cellCelpEncEnd); - cellCelpEnc.AddFunc(0x81fe030c, cellCelpEncEncodeFrame); - cellCelpEnc.AddFunc(0x9b244272, cellCelpEncWaitForOutput); - cellCelpEnc.AddFunc(0x3773692f, cellCelpEncGetAu); + REG_FUNC(cellCelpEnc, cellCelpEncQueryAttr); + REG_FUNC(cellCelpEnc, cellCelpEncOpen); + REG_FUNC(cellCelpEnc, cellCelpEncOpenEx); + REG_FUNC(cellCelpEnc, cellCelpEncClose); + REG_FUNC(cellCelpEnc, cellCelpEncStart); + REG_FUNC(cellCelpEnc, cellCelpEncEnd); + REG_FUNC(cellCelpEnc, cellCelpEncEncodeFrame); + REG_FUNC(cellCelpEnc, cellCelpEncWaitForOutput); + REG_FUNC(cellCelpEnc, cellCelpEncGetAu); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp index 4e3e7e610a..5e5ebd4be6 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp @@ -1170,24 +1170,24 @@ int cellDmuxFlushEs(u32 esHandle) Module cellDmux("cellDmux", []() { - cellDmux.AddFunc(0xa2d4189b, cellDmuxQueryAttr); - cellDmux.AddFunc(0x3f76e3cd, cellDmuxQueryAttr2); - cellDmux.AddFunc(0x68492de9, cellDmuxOpen); - cellDmux.AddFunc(0xf6c23560, cellDmuxOpenEx); - cellDmux.AddFunc(0x11bc3a6c, cellDmuxOpen2); - cellDmux.AddFunc(0x8c692521, cellDmuxClose); - cellDmux.AddFunc(0x04e7499f, cellDmuxSetStream); - cellDmux.AddFunc(0x5d345de9, cellDmuxResetStream); - cellDmux.AddFunc(0xccff1284, cellDmuxResetStreamAndWaitDone); - cellDmux.AddFunc(0x02170d1a, cellDmuxQueryEsAttr); - cellDmux.AddFunc(0x52911bcf, cellDmuxQueryEsAttr2); - cellDmux.AddFunc(0x7b56dc3f, cellDmuxEnableEs); - cellDmux.AddFunc(0x05371c8d, cellDmuxDisableEs); - cellDmux.AddFunc(0x21d424f0, cellDmuxResetEs); - cellDmux.AddFunc(0x42c716b5, cellDmuxGetAu); - cellDmux.AddFunc(0x2750c5e0, cellDmuxPeekAu); - cellDmux.AddFunc(0x2c9a5857, cellDmuxGetAuEx); - cellDmux.AddFunc(0x002e8da2, cellDmuxPeekAuEx); - cellDmux.AddFunc(0x24ea6474, cellDmuxReleaseAu); - cellDmux.AddFunc(0xebb3b2bd, cellDmuxFlushEs); + REG_FUNC(cellDmux, cellDmuxQueryAttr); + REG_FUNC(cellDmux, cellDmuxQueryAttr2); + REG_FUNC(cellDmux, cellDmuxOpen); + REG_FUNC(cellDmux, cellDmuxOpenEx); + REG_FUNC(cellDmux, cellDmuxOpen2); + REG_FUNC(cellDmux, cellDmuxClose); + REG_FUNC(cellDmux, cellDmuxSetStream); + REG_FUNC(cellDmux, cellDmuxResetStream); + REG_FUNC(cellDmux, cellDmuxResetStreamAndWaitDone); + REG_FUNC(cellDmux, cellDmuxQueryEsAttr); + REG_FUNC(cellDmux, cellDmuxQueryEsAttr2); + REG_FUNC(cellDmux, cellDmuxEnableEs); + REG_FUNC(cellDmux, cellDmuxDisableEs); + REG_FUNC(cellDmux, cellDmuxResetEs); + REG_FUNC(cellDmux, cellDmuxGetAu); + REG_FUNC(cellDmux, cellDmuxPeekAu); + REG_FUNC(cellDmux, cellDmuxGetAuEx); + REG_FUNC(cellDmux, cellDmuxPeekAuEx); + REG_FUNC(cellDmux, cellDmuxReleaseAu); + REG_FUNC(cellDmux, cellDmuxFlushEs); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp b/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp index e2d6f2d0b2..632f4b56aa 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp @@ -293,57 +293,57 @@ int cellFiberPpuUtilWorkerControlInitializeWithAttribute() Module cellFiber("cellFiber", []() { - cellFiber.AddFunc(0x55870804, _cellFiberPpuInitialize); + REG_FUNC(cellFiber, _cellFiberPpuInitialize); - cellFiber.AddFunc(0x9e25c72d, _cellFiberPpuSchedulerAttributeInitialize); - cellFiber.AddFunc(0xee3b604d, cellFiberPpuInitializeScheduler); - cellFiber.AddFunc(0x8b6baa01, cellFiberPpuFinalizeScheduler); - cellFiber.AddFunc(0x12b1acf0, cellFiberPpuRunFibers); - cellFiber.AddFunc(0xf6c6900c, cellFiberPpuCheckFlags); - cellFiber.AddFunc(0xe492a675, cellFiberPpuHasRunnableFiber); + REG_FUNC(cellFiber, _cellFiberPpuSchedulerAttributeInitialize); + REG_FUNC(cellFiber, cellFiberPpuInitializeScheduler); + REG_FUNC(cellFiber, cellFiberPpuFinalizeScheduler); + REG_FUNC(cellFiber, cellFiberPpuRunFibers); + REG_FUNC(cellFiber, cellFiberPpuCheckFlags); + REG_FUNC(cellFiber, cellFiberPpuHasRunnableFiber); - cellFiber.AddFunc(0xc11f8056, _cellFiberPpuAttributeInitialize); - cellFiber.AddFunc(0x7c2f4034, cellFiberPpuCreateFiber); - cellFiber.AddFunc(0xfa8d5f95, cellFiberPpuExit); - cellFiber.AddFunc(0x0c44f441, cellFiberPpuYield); - cellFiber.AddFunc(0xa6004249, cellFiberPpuJoinFiber); - cellFiber.AddFunc(0x5d9a7034, cellFiberPpuSelf); - cellFiber.AddFunc(0x8afb8356, cellFiberPpuSendSignal); - cellFiber.AddFunc(0x6c164b3b, cellFiberPpuWaitSignal); - cellFiber.AddFunc(0xa4599cf3, cellFiberPpuWaitFlag); - cellFiber.AddFunc(0xb0594b2d, cellFiberPpuGetScheduler); - cellFiber.AddFunc(0xfbf5fe40, cellFiberPpuSetPriority); - cellFiber.AddFunc(0xf3e81219, cellFiberPpuCheckStackLimit); + REG_FUNC(cellFiber, _cellFiberPpuAttributeInitialize); + REG_FUNC(cellFiber, cellFiberPpuCreateFiber); + REG_FUNC(cellFiber, cellFiberPpuExit); + REG_FUNC(cellFiber, cellFiberPpuYield); + REG_FUNC(cellFiber, cellFiberPpuJoinFiber); + REG_FUNC(cellFiber, cellFiberPpuSelf); + REG_FUNC(cellFiber, cellFiberPpuSendSignal); + REG_FUNC(cellFiber, cellFiberPpuWaitSignal); + REG_FUNC(cellFiber, cellFiberPpuWaitFlag); + REG_FUNC(cellFiber, cellFiberPpuGetScheduler); + REG_FUNC(cellFiber, cellFiberPpuSetPriority); + REG_FUNC(cellFiber, cellFiberPpuCheckStackLimit); - cellFiber.AddFunc(0x31252ec3, _cellFiberPpuContextAttributeInitialize); - cellFiber.AddFunc(0x72086315, cellFiberPpuContextInitialize); - cellFiber.AddFunc(0xb3a48079, cellFiberPpuContextFinalize); - cellFiber.AddFunc(0xaba1c563, cellFiberPpuContextRun); - cellFiber.AddFunc(0xd0066b17, cellFiberPpuContextSwitch); - cellFiber.AddFunc(0x34a81091, cellFiberPpuContextSelf); - cellFiber.AddFunc(0x01036193, cellFiberPpuContextReturnToThread); - cellFiber.AddFunc(0xb90c871b, cellFiberPpuContextCheckStackLimit); + REG_FUNC(cellFiber, _cellFiberPpuContextAttributeInitialize); + REG_FUNC(cellFiber, cellFiberPpuContextInitialize); + REG_FUNC(cellFiber, cellFiberPpuContextFinalize); + REG_FUNC(cellFiber, cellFiberPpuContextRun); + REG_FUNC(cellFiber, cellFiberPpuContextSwitch); + REG_FUNC(cellFiber, cellFiberPpuContextSelf); + REG_FUNC(cellFiber, cellFiberPpuContextReturnToThread); + REG_FUNC(cellFiber, cellFiberPpuContextCheckStackLimit); - cellFiber.AddFunc(0x081c98be, cellFiberPpuContextRunScheduler); - cellFiber.AddFunc(0x0a25b6c8, cellFiberPpuContextEnterScheduler); + REG_FUNC(cellFiber, cellFiberPpuContextRunScheduler); + REG_FUNC(cellFiber, cellFiberPpuContextEnterScheduler); - cellFiber.AddFunc(0xbf9cd933, cellFiberPpuSchedulerTraceInitialize); - cellFiber.AddFunc(0x3860a12a, cellFiberPpuSchedulerTraceFinalize); - cellFiber.AddFunc(0xadedbebf, cellFiberPpuSchedulerTraceStart); - cellFiber.AddFunc(0xe665f9a9, cellFiberPpuSchedulerTraceStop); + REG_FUNC(cellFiber, cellFiberPpuSchedulerTraceInitialize); + REG_FUNC(cellFiber, cellFiberPpuSchedulerTraceFinalize); + REG_FUNC(cellFiber, cellFiberPpuSchedulerTraceStart); + REG_FUNC(cellFiber, cellFiberPpuSchedulerTraceStop); - cellFiber.AddFunc(0x68ba4568, _cellFiberPpuUtilWorkerControlAttributeInitialize); - cellFiber.AddFunc(0x1e7a247a, cellFiberPpuUtilWorkerControlRunFibers); - cellFiber.AddFunc(0x3204b146, cellFiberPpuUtilWorkerControlInitialize); - cellFiber.AddFunc(0x392c5aa5, cellFiberPpuUtilWorkerControlSetPollingMode); - cellFiber.AddFunc(0x3b417f82, cellFiberPpuUtilWorkerControlJoinFiber); - cellFiber.AddFunc(0x4fc86b2c, cellFiberPpuUtilWorkerControlDisconnectEventQueue); - cellFiber.AddFunc(0x5d3992dd, cellFiberPpuUtilWorkerControlSendSignal); - cellFiber.AddFunc(0x62a20f0d, cellFiberPpuUtilWorkerControlConnectEventQueueToSpurs); - cellFiber.AddFunc(0xa27c95ca, cellFiberPpuUtilWorkerControlFinalize); - cellFiber.AddFunc(0xbabf714b, cellFiberPpuUtilWorkerControlWakeup); - cellFiber.AddFunc(0xbfca88d3, cellFiberPpuUtilWorkerControlCreateFiber); - cellFiber.AddFunc(0xc04e2438, cellFiberPpuUtilWorkerControlShutdown); - cellFiber.AddFunc(0xea6dc1ad, cellFiberPpuUtilWorkerControlCheckFlags); - cellFiber.AddFunc(0xf2ccad4f, cellFiberPpuUtilWorkerControlInitializeWithAttribute); + REG_FUNC(cellFiber, _cellFiberPpuUtilWorkerControlAttributeInitialize); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlRunFibers); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlInitialize); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlSetPollingMode); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlJoinFiber); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlDisconnectEventQueue); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlSendSignal); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlConnectEventQueueToSpurs); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlFinalize); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlWakeup); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlCreateFiber); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlShutdown); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlCheckFlags); + REG_FUNC(cellFiber, cellFiberPpuUtilWorkerControlInitializeWithAttribute); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp index 7831a68fed..6e58293669 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp @@ -588,54 +588,54 @@ Module cellFont("cellFont", []() delete s_fontInternalInstance; }; - cellFont.AddFunc(0x25c107e6, cellFontInit); - cellFont.AddFunc(0x6bf6f832, cellFontSetFontsetOpenMode); - cellFont.AddFunc(0x6cfada83, cellFontSetFontOpenMode); - cellFont.AddFunc(0x042e74e3, cellFontCreateRenderer); - cellFont.AddFunc(0x1387c45c, cellFontGetHorizontalLayout); - cellFont.AddFunc(0x21ebb248, cellFontDestroyRenderer); - cellFont.AddFunc(0x227e1e3c, cellFontSetupRenderScalePixel); - cellFont.AddFunc(0x29329541, cellFontOpenFontInstance); - cellFont.AddFunc(0x297f0e93, cellFontSetScalePixel); - cellFont.AddFunc(0x2da9fd9d, cellFontGetRenderCharGlyphMetrics); - cellFont.AddFunc(0x40d40544, cellFontEndLibrary); - cellFont.AddFunc(0x66a23100, cellFontBindRenderer); - cellFont.AddFunc(0x7ab47f7e, cellFontEnd); - cellFont.AddFunc(0x8657c8f5, cellFontSetEffectSlant); - cellFont.AddFunc(0xe16e679a, cellFontGetEffectSlant); - cellFont.AddFunc(0x88be4799, cellFontRenderCharGlyphImage); - cellFont.AddFunc(0x90b9465e, cellFontRenderSurfaceInit); - cellFont.AddFunc(0x98ac5524, cellFontGetFontIdCode); - cellFont.AddFunc(0xa885cc9b, cellFontOpenFontset); - cellFont.AddFunc(0xb276f1f6, cellFontCloseFont); - cellFont.AddFunc(0xb422b005, cellFontRenderSurfaceSetScissor); - cellFont.AddFunc(0xd8eaee9f, cellFontGetCharGlyphMetrics); - cellFont.AddFunc(0xf03dcc29, cellFontInitializeWithRevision); - cellFont.AddFunc(0x061049ad, cellFontGraphicsSetFontRGBA); - cellFont.AddFunc(0x073fa321, cellFontOpenFontsetOnMemory); - cellFont.AddFunc(0x0a7306a4, cellFontOpenFontFile); - cellFont.AddFunc(0x16322df1, cellFontGraphicsSetScalePixel); - cellFont.AddFunc(0x2388186c, cellFontGraphicsGetScalePixel); - cellFont.AddFunc(0x25253fe4, cellFontSetEffectWeight); - cellFont.AddFunc(0x53f529fe, cellFontGlyphSetupVertexesGlyph); - cellFont.AddFunc(0x698897f8, cellFontGetVerticalLayout); - cellFont.AddFunc(0x700e6223, cellFontGetRenderCharGlyphMetricsVertical); - cellFont.AddFunc(0x70f3e728, cellFontSetScalePoint); - cellFont.AddFunc(0x78d05e08, cellFontSetupRenderEffectSlant); - cellFont.AddFunc(0x7c83bc15, cellFontGraphicsSetLineRGBA); - cellFont.AddFunc(0x87bd650f, cellFontGraphicsSetDrawType); - cellFont.AddFunc(0x8a35c887, cellFontEndGraphics); - cellFont.AddFunc(0x970d4c22, cellFontGraphicsSetupDrawContext); - cellFont.AddFunc(0x9e19072b, cellFontOpenFontMemory); - cellFont.AddFunc(0xa6dc25d1, cellFontSetupRenderEffectWeight); - cellFont.AddFunc(0xa8fae920, cellFontGlyphGetOutlineControlDistance); - cellFont.AddFunc(0xb4d112af, cellFontGlyphGetVertexesGlyphSize); - cellFont.AddFunc(0xc17259de, cellFontGenerateCharGlyph); - cellFont.AddFunc(0xd62f5d76, cellFontDeleteGlyph); - cellFont.AddFunc(0xdee0836c, cellFontExtend); - cellFont.AddFunc(0xe857a0ca, cellFontRenderCharGlyphImageVertical); - cellFont.AddFunc(0xfb3341ba, cellFontSetResolutionDpi); - cellFont.AddFunc(0xfe9a6dd7, cellFontGetCharGlyphMetricsVertical); - cellFont.AddFunc(0xf16379fa, cellFontUnbindRenderer); - cellFont.AddFunc(0xb015a84e, cellFontGetRevisionFlags); + REG_FUNC(cellFont, cellFontInit); + REG_FUNC(cellFont, cellFontSetFontsetOpenMode); + REG_FUNC(cellFont, cellFontSetFontOpenMode); + REG_FUNC(cellFont, cellFontCreateRenderer); + REG_FUNC(cellFont, cellFontGetHorizontalLayout); + REG_FUNC(cellFont, cellFontDestroyRenderer); + REG_FUNC(cellFont, cellFontSetupRenderScalePixel); + REG_FUNC(cellFont, cellFontOpenFontInstance); + REG_FUNC(cellFont, cellFontSetScalePixel); + REG_FUNC(cellFont, cellFontGetRenderCharGlyphMetrics); + REG_FUNC(cellFont, cellFontEndLibrary); + REG_FUNC(cellFont, cellFontBindRenderer); + REG_FUNC(cellFont, cellFontEnd); + REG_FUNC(cellFont, cellFontSetEffectSlant); + REG_FUNC(cellFont, cellFontGetEffectSlant); + REG_FUNC(cellFont, cellFontRenderCharGlyphImage); + REG_FUNC(cellFont, cellFontRenderSurfaceInit); + REG_FUNC(cellFont, cellFontGetFontIdCode); + REG_FUNC(cellFont, cellFontOpenFontset); + REG_FUNC(cellFont, cellFontCloseFont); + REG_FUNC(cellFont, cellFontRenderSurfaceSetScissor); + REG_FUNC(cellFont, cellFontGetCharGlyphMetrics); + REG_FUNC(cellFont, cellFontInitializeWithRevision); + REG_FUNC(cellFont, cellFontGraphicsSetFontRGBA); + REG_FUNC(cellFont, cellFontOpenFontsetOnMemory); + REG_FUNC(cellFont, cellFontOpenFontFile); + REG_FUNC(cellFont, cellFontGraphicsSetScalePixel); + REG_FUNC(cellFont, cellFontGraphicsGetScalePixel); + REG_FUNC(cellFont, cellFontSetEffectWeight); + REG_FUNC(cellFont, cellFontGlyphSetupVertexesGlyph); + REG_FUNC(cellFont, cellFontGetVerticalLayout); + REG_FUNC(cellFont, cellFontGetRenderCharGlyphMetricsVertical); + REG_FUNC(cellFont, cellFontSetScalePoint); + REG_FUNC(cellFont, cellFontSetupRenderEffectSlant); + REG_FUNC(cellFont, cellFontGraphicsSetLineRGBA); + REG_FUNC(cellFont, cellFontGraphicsSetDrawType); + REG_FUNC(cellFont, cellFontEndGraphics); + REG_FUNC(cellFont, cellFontGraphicsSetupDrawContext); + REG_FUNC(cellFont, cellFontOpenFontMemory); + REG_FUNC(cellFont, cellFontSetupRenderEffectWeight); + REG_FUNC(cellFont, cellFontGlyphGetOutlineControlDistance); + REG_FUNC(cellFont, cellFontGlyphGetVertexesGlyphSize); + REG_FUNC(cellFont, cellFontGenerateCharGlyph); + REG_FUNC(cellFont, cellFontDeleteGlyph); + REG_FUNC(cellFont, cellFontExtend); + REG_FUNC(cellFont, cellFontRenderCharGlyphImageVertical); + REG_FUNC(cellFont, cellFontSetResolutionDpi); + REG_FUNC(cellFont, cellFontGetCharGlyphMetricsVertical); + REG_FUNC(cellFont, cellFontUnbindRenderer); + REG_FUNC(cellFont, cellFontGetRevisionFlags); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp b/rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp index 155b147e51..3234b40621 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp @@ -43,7 +43,7 @@ Module cellFontFT("cellFontFT", []() delete s_fontFtInternalInstance; }; - cellFontFT.AddFunc(0x7a0a83c4, cellFontInitLibraryFreeTypeWithRevision); - cellFontFT.AddFunc(0xec89a187, cellFontFTGetRevisionFlags); - cellFontFT.AddFunc(0xfa0c2de0, cellFontFTGetInitializedRevisionFlags); + REG_FUNC(cellFontFT, cellFontInitLibraryFreeTypeWithRevision); + REG_FUNC(cellFontFT, cellFontFTGetRevisionFlags); + REG_FUNC(cellFontFT, cellFontFTGetInitializedRevisionFlags); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp index 6edc187340..76531de0cc 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp @@ -495,25 +495,25 @@ Module cellGame("cellGame", []() // (TODO: Disc Exchange functions missing) - cellGame.AddFunc(0xf52639ea, cellGameBootCheck); - cellGame.AddFunc(0xce4374f6, cellGamePatchCheck); - cellGame.AddFunc(0xdb9819f3, cellGameDataCheck); - cellGame.AddFunc(0x70acec67, cellGameContentPermit); + REG_FUNC(cellGame, cellGameBootCheck); + REG_FUNC(cellGame, cellGamePatchCheck); + REG_FUNC(cellGame, cellGameDataCheck); + REG_FUNC(cellGame, cellGameContentPermit); - cellGame.AddFunc(0x42a2e133, cellGameCreateGameData); - cellGame.AddFunc(0xb367c6e3, cellGameDeleteGameData); + REG_FUNC(cellGame, cellGameCreateGameData); + REG_FUNC(cellGame, cellGameDeleteGameData); - cellGame.AddFunc(0xb7a45caf, cellGameGetParamInt); + REG_FUNC(cellGame, cellGameGetParamInt); //cellGame.AddFunc(, cellGameSetParamInt); - cellGame.AddFunc(0x3a5d726a, cellGameGetParamString); - cellGame.AddFunc(0xdaa5cd20, cellGameSetParamString); - cellGame.AddFunc(0xef9d42d5, cellGameGetSizeKB); - cellGame.AddFunc(0x2a8e6b92, cellGameGetDiscContentInfoUpdatePath); - cellGame.AddFunc(0xa80bf223, cellGameGetLocalWebContentPath); + REG_FUNC(cellGame, cellGameGetParamString); + REG_FUNC(cellGame, cellGameSetParamString); + REG_FUNC(cellGame, cellGameGetSizeKB); + REG_FUNC(cellGame, cellGameGetDiscContentInfoUpdatePath); + REG_FUNC(cellGame, cellGameGetLocalWebContentPath); - cellGame.AddFunc(0xb0a1f8c6, cellGameContentErrorDialog); + REG_FUNC(cellGame, cellGameContentErrorDialog); - cellGame.AddFunc(0xd24e3928, cellGameThemeInstall); - cellGame.AddFunc(0x87406734, cellGameThemeInstallFromBuffer); + REG_FUNC(cellGame, cellGameThemeInstall); + REG_FUNC(cellGame, cellGameThemeInstallFromBuffer); //cellGame.AddFunc(, CellGameThemeInstallCallback); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index f9f9f3624a..e3ff78e0f4 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -1090,14 +1090,14 @@ void cellGcmSetDefaultCommandBuffer() // Other //------------------------------------------------------------------------ -s32 cellGcmSetFlipCommand(vm::ptr ctx, u32 id) +s32 _cellGcmSetFlipCommand(vm::ptr ctx, u32 id) { cellGcmSys.Log("cellGcmSetFlipCommand(ctx_addr=0x%x, id=0x%x)", ctx.addr(), id); return cellGcmSetPrepareFlip(ctx, id); } -s32 cellGcmSetFlipCommandWithWaitLabel(vm::ptr ctx, u32 id, u32 label_index, u32 label_value) +s32 _cellGcmSetFlipCommandWithWaitLabel(vm::ptr ctx, u32 id, u32 label_index, u32 label_value) { cellGcmSys.Log("cellGcmSetFlipCommandWithWaitLabel(ctx_addr=0x%x, id=0x%x, label_index=0x%x, label_value=0x%x)", ctx.addr(), id, label_index, label_value); @@ -1218,23 +1218,23 @@ Module cellGcmSys("cellGcmSys", []() local_addr = 0; // Data Retrieval - cellGcmSys.AddFunc(0xc8f3bd09, cellGcmGetCurrentField); - cellGcmSys.AddFunc(0xf80196c1, cellGcmGetLabelAddress); - cellGcmSys.AddFunc(0x21cee035, cellGcmGetNotifyDataAddress); - cellGcmSys.AddFunc(0x661fe266, _cellGcmFunc12); - cellGcmSys.AddFunc(0x99d397ac, cellGcmGetReport); - cellGcmSys.AddFunc(0x9a0159af, cellGcmGetReportDataAddress); - cellGcmSys.AddFunc(0x8572bce2, cellGcmGetReportDataAddressLocation); - cellGcmSys.AddFunc(0xa6b180ac, cellGcmGetReportDataLocation); - cellGcmSys.AddFunc(0x5a41c10f, cellGcmGetTimeStamp); - cellGcmSys.AddFunc(0x2ad4951b, cellGcmGetTimeStampLocation); + REG_FUNC(cellGcmSys, cellGcmGetCurrentField); + REG_FUNC(cellGcmSys, cellGcmGetLabelAddress); + REG_FUNC(cellGcmSys, cellGcmGetNotifyDataAddress); + REG_FUNC(cellGcmSys, _cellGcmFunc12); + REG_FUNC(cellGcmSys, cellGcmGetReport); + REG_FUNC(cellGcmSys, cellGcmGetReportDataAddress); + REG_FUNC(cellGcmSys, cellGcmGetReportDataAddressLocation); + REG_FUNC(cellGcmSys, cellGcmGetReportDataLocation); + REG_FUNC(cellGcmSys, cellGcmGetTimeStamp); + REG_FUNC(cellGcmSys, cellGcmGetTimeStampLocation); // Command Buffer Control - cellGcmSys.AddFunc(0xa547adde, cellGcmGetControlRegister); - cellGcmSys.AddFunc(0x5e2ee0f0, cellGcmGetDefaultCommandWordSize); - cellGcmSys.AddFunc(0x8cdf8c70, cellGcmGetDefaultSegmentWordSize); - cellGcmSys.AddFunc(0xcaabd992, cellGcmInitDefaultFifoMode); - cellGcmSys.AddFunc(0x9ba451e4, cellGcmSetDefaultFifoSize); + REG_FUNC(cellGcmSys, cellGcmGetControlRegister); + REG_FUNC(cellGcmSys, cellGcmGetDefaultCommandWordSize); + REG_FUNC(cellGcmSys, cellGcmGetDefaultSegmentWordSize); + REG_FUNC(cellGcmSys, cellGcmInitDefaultFifoMode); + REG_FUNC(cellGcmSys, cellGcmSetDefaultFifoSize); //cellGcmSys.AddFunc(, cellGcmReserveMethodSize); //cellGcmSys.AddFunc(, cellGcmResetDefaultCommandBuffer); //cellGcmSys.AddFunc(, cellGcmSetupContextData); @@ -1243,80 +1243,80 @@ Module cellGcmSys("cellGcmSys", []() //cellGcmSys.AddFunc(, cellGcmFlush); // Hardware Resource Management - cellGcmSys.AddFunc(0x4524cccd, cellGcmBindTile); - cellGcmSys.AddFunc(0x9dc04436, cellGcmBindZcull); - cellGcmSys.AddFunc(0x1f61b3ff, cellGcmDumpGraphicsError); - cellGcmSys.AddFunc(0xe315a0b2, cellGcmGetConfiguration); - cellGcmSys.AddFunc(0x371674cf, cellGcmGetDisplayBufferByFlipIndex); - cellGcmSys.AddFunc(0x72a577ce, cellGcmGetFlipStatus); - cellGcmSys.AddFunc(0x63387071, cellGcmGetLastFlipTime); - cellGcmSys.AddFunc(0x23ae55a3, cellGcmGetLastSecondVTime); - cellGcmSys.AddFunc(0x055bd74d, cellGcmGetTiledPitchSize); - cellGcmSys.AddFunc(0x723bbc7e, cellGcmGetVBlankCount); - cellGcmSys.AddFunc(0x5f909b17, _cellGcmFunc1); - cellGcmSys.AddFunc(0x3a33c1fd, _cellGcmFunc15); - cellGcmSys.AddFunc(0x15bae46b, _cellGcmInitBody); - cellGcmSys.AddFunc(0xfce9e764, cellGcmInitSystemMode); - cellGcmSys.AddFunc(0xb2e761d4, cellGcmResetFlipStatus); - cellGcmSys.AddFunc(0x51c9d62b, cellGcmSetDebugOutputLevel); - cellGcmSys.AddFunc(0xa53d12ae, cellGcmSetDisplayBuffer); - cellGcmSys.AddFunc(0xdc09357e, cellGcmSetFlip); - cellGcmSys.AddFunc(0xa41ef7e8, cellGcmSetFlipHandler); - cellGcmSys.AddFunc(0xacee8542, cellGcmSetFlipImmediate); - cellGcmSys.AddFunc(0x4ae8d215, cellGcmSetFlipMode); - cellGcmSys.AddFunc(0xa47c09ff, cellGcmSetFlipStatus); - cellGcmSys.AddFunc(0xd01b570d, cellGcmSetGraphicsHandler); - cellGcmSys.AddFunc(0x0b4b62d5, cellGcmSetPrepareFlip); - cellGcmSys.AddFunc(0x0a862772, cellGcmSetQueueHandler); - cellGcmSys.AddFunc(0x4d7ce993, cellGcmSetSecondVFrequency); - cellGcmSys.AddFunc(0xdc494430, cellGcmSetSecondVHandler); - cellGcmSys.AddFunc(0xbd100dbc, cellGcmSetTileInfo); - cellGcmSys.AddFunc(0x06edea9e, cellGcmSetUserHandler); - cellGcmSys.AddFunc(0xffe0160e, cellGcmSetVBlankFrequency); - cellGcmSys.AddFunc(0xa91b0402, cellGcmSetVBlankHandler); - cellGcmSys.AddFunc(0x983fb9aa, cellGcmSetWaitFlip); - cellGcmSys.AddFunc(0xd34a420d, cellGcmSetZcull); - cellGcmSys.AddFunc(0x25b40ab4, cellGcmSortRemapEaIoAddress); - cellGcmSys.AddFunc(0xd9b7653e, cellGcmUnbindTile); - cellGcmSys.AddFunc(0xa75640e8, cellGcmUnbindZcull); - cellGcmSys.AddFunc(0x657571f7, cellGcmGetTileInfo); - cellGcmSys.AddFunc(0xd9a0a879, cellGcmGetZcullInfo); - cellGcmSys.AddFunc(0x0e6b0dae, cellGcmGetDisplayInfo); - cellGcmSys.AddFunc(0x93806525, cellGcmGetCurrentDisplayBufferId); - cellGcmSys.AddFunc(0xbd6d60d9, cellGcmSetInvalidateTile); + REG_FUNC(cellGcmSys, cellGcmBindTile); + REG_FUNC(cellGcmSys, cellGcmBindZcull); + REG_FUNC(cellGcmSys, cellGcmDumpGraphicsError); + REG_FUNC(cellGcmSys, cellGcmGetConfiguration); + REG_FUNC(cellGcmSys, cellGcmGetDisplayBufferByFlipIndex); + REG_FUNC(cellGcmSys, cellGcmGetFlipStatus); + REG_FUNC(cellGcmSys, cellGcmGetLastFlipTime); + REG_FUNC(cellGcmSys, cellGcmGetLastSecondVTime); + REG_FUNC(cellGcmSys, cellGcmGetTiledPitchSize); + REG_FUNC(cellGcmSys, cellGcmGetVBlankCount); + REG_FUNC(cellGcmSys, _cellGcmFunc1); + REG_FUNC(cellGcmSys, _cellGcmFunc15); + REG_FUNC(cellGcmSys, _cellGcmInitBody); + REG_FUNC(cellGcmSys, cellGcmInitSystemMode); + REG_FUNC(cellGcmSys, cellGcmResetFlipStatus); + REG_FUNC(cellGcmSys, cellGcmSetDebugOutputLevel); + REG_FUNC(cellGcmSys, cellGcmSetDisplayBuffer); + REG_FUNC(cellGcmSys, cellGcmSetFlip); + REG_FUNC(cellGcmSys, cellGcmSetFlipHandler); + REG_FUNC(cellGcmSys, cellGcmSetFlipImmediate); + REG_FUNC(cellGcmSys, cellGcmSetFlipMode); + REG_FUNC(cellGcmSys, cellGcmSetFlipStatus); + REG_FUNC(cellGcmSys, cellGcmSetGraphicsHandler); + REG_FUNC(cellGcmSys, cellGcmSetPrepareFlip); + REG_FUNC(cellGcmSys, cellGcmSetQueueHandler); + REG_FUNC(cellGcmSys, cellGcmSetSecondVFrequency); + REG_FUNC(cellGcmSys, cellGcmSetSecondVHandler); + REG_FUNC(cellGcmSys, cellGcmSetTileInfo); + REG_FUNC(cellGcmSys, cellGcmSetUserHandler); + REG_FUNC(cellGcmSys, cellGcmSetVBlankFrequency); + REG_FUNC(cellGcmSys, cellGcmSetVBlankHandler); + REG_FUNC(cellGcmSys, cellGcmSetWaitFlip); + REG_FUNC(cellGcmSys, cellGcmSetZcull); + REG_FUNC(cellGcmSys, cellGcmSortRemapEaIoAddress); + REG_FUNC(cellGcmSys, cellGcmUnbindTile); + REG_FUNC(cellGcmSys, cellGcmUnbindZcull); + REG_FUNC(cellGcmSys, cellGcmGetTileInfo); + REG_FUNC(cellGcmSys, cellGcmGetZcullInfo); + REG_FUNC(cellGcmSys, cellGcmGetDisplayInfo); + REG_FUNC(cellGcmSys, cellGcmGetCurrentDisplayBufferId); + REG_FUNC(cellGcmSys, cellGcmSetInvalidateTile); //cellGcmSys.AddFunc(, cellGcmSetFlipWithWaitLabel); // Memory Mapping - cellGcmSys.AddFunc(0x21ac3697, cellGcmAddressToOffset); - cellGcmSys.AddFunc(0xfb81c03e, cellGcmGetMaxIoMapSize); - cellGcmSys.AddFunc(0x2922aed0, cellGcmGetOffsetTable); - cellGcmSys.AddFunc(0x2a6fba9c, cellGcmIoOffsetToAddress); - cellGcmSys.AddFunc(0x63441cb4, cellGcmMapEaIoAddress); - cellGcmSys.AddFunc(0x626e8518, cellGcmMapEaIoAddressWithFlags); - cellGcmSys.AddFunc(0xdb769b32, cellGcmMapLocalMemory); - cellGcmSys.AddFunc(0xa114ec67, cellGcmMapMainMemory); - cellGcmSys.AddFunc(0xa7ede268, cellGcmReserveIoMapSize); - cellGcmSys.AddFunc(0xefd00f54, cellGcmUnmapEaIoAddress); - cellGcmSys.AddFunc(0xdb23e867, cellGcmUnmapIoAddress); - cellGcmSys.AddFunc(0x3b9bd5bd, cellGcmUnreserveIoMapSize); + REG_FUNC(cellGcmSys, cellGcmAddressToOffset); + REG_FUNC(cellGcmSys, cellGcmGetMaxIoMapSize); + REG_FUNC(cellGcmSys, cellGcmGetOffsetTable); + REG_FUNC(cellGcmSys, cellGcmIoOffsetToAddress); + REG_FUNC(cellGcmSys, cellGcmMapEaIoAddress); + REG_FUNC(cellGcmSys, cellGcmMapEaIoAddressWithFlags); + REG_FUNC(cellGcmSys, cellGcmMapLocalMemory); + REG_FUNC(cellGcmSys, cellGcmMapMainMemory); + REG_FUNC(cellGcmSys, cellGcmReserveIoMapSize); + REG_FUNC(cellGcmSys, cellGcmUnmapEaIoAddress); + REG_FUNC(cellGcmSys, cellGcmUnmapIoAddress); + REG_FUNC(cellGcmSys, cellGcmUnreserveIoMapSize); // Cursor - cellGcmSys.AddFunc(0x107bf3a1, cellGcmInitCursor); - cellGcmSys.AddFunc(0xc47d0812, cellGcmSetCursorEnable); - cellGcmSys.AddFunc(0x69c6cc82, cellGcmSetCursorDisable); - cellGcmSys.AddFunc(0xf9bfdc72, cellGcmSetCursorImageOffset); - cellGcmSys.AddFunc(0x1a0de550, cellGcmSetCursorPosition); - cellGcmSys.AddFunc(0xbd2fa0a7, cellGcmUpdateCursor); + REG_FUNC(cellGcmSys, cellGcmInitCursor); + REG_FUNC(cellGcmSys, cellGcmSetCursorEnable); + REG_FUNC(cellGcmSys, cellGcmSetCursorDisable); + REG_FUNC(cellGcmSys, cellGcmSetCursorImageOffset); + REG_FUNC(cellGcmSys, cellGcmSetCursorPosition); + REG_FUNC(cellGcmSys, cellGcmUpdateCursor); // Functions for Maintaining Compatibility - cellGcmSys.AddFunc(0xbc982946, cellGcmSetDefaultCommandBuffer); + REG_FUNC(cellGcmSys, cellGcmSetDefaultCommandBuffer); //cellGcmSys.AddFunc(, cellGcmGetCurrentBuffer); //cellGcmSys.AddFunc(, cellGcmSetCurrentBuffer); //cellGcmSys.AddFunc(, cellGcmSetDefaultCommandBufferAndSegmentWordSize); //cellGcmSys.AddFunc(, cellGcmSetUserCallback); // Other - cellGcmSys.AddFunc(0x21397818, cellGcmSetFlipCommand); - cellGcmSys.AddFunc(0xd8f88e1a, cellGcmSetFlipCommandWithWaitLabel); - cellGcmSys.AddFunc(0xd0b1d189, cellGcmSetTile); + REG_FUNC(cellGcmSys, _cellGcmSetFlipCommand); + REG_FUNC(cellGcmSys, _cellGcmSetFlipCommandWithWaitLabel); + REG_FUNC(cellGcmSys, cellGcmSetTile); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp index f3245d54cf..22ce3c49c5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp @@ -390,44 +390,44 @@ void cellGem_unload() Module cellGem("cellGem", []() { //cellGem.AddFunc(, cellGemAttributeInit); - cellGem.AddFunc(0xafa99ead, cellGemCalibrate); - cellGem.AddFunc(0x9b9714a4, cellGemClearStatusFlags); - cellGem.AddFunc(0x1a13d010, cellGemConvertVideoFinish); - cellGem.AddFunc(0x6dce048c, cellGemConvertVideoStart); - cellGem.AddFunc(0x4219de31, cellGemEnableCameraPitchAngleCorrection); - cellGem.AddFunc(0x1a2518a2, cellGemEnableMagnetometer); - cellGem.AddFunc(0xe1f85a80, cellGemEnd); - cellGem.AddFunc(0x6fc4c791, cellGemFilterState); - cellGem.AddFunc(0xce6d7791, cellGemForceRGB); - cellGem.AddFunc(0x6a5b7048, cellGemGetAccelerometerPositionInDevice); - cellGem.AddFunc(0x2d2c2764, cellGemGetAllTrackableHues); - cellGem.AddFunc(0x8befac67, cellGemGetCameraState); - cellGem.AddFunc(0x02eb41bb, cellGemGetEnvironmentLightingColor); - cellGem.AddFunc(0xb8ef56a6, cellGemGetHuePixels); - cellGem.AddFunc(0x92cc4b34, cellGemGetImageState); - cellGem.AddFunc(0xd37b127a, cellGemGetInertialState); - cellGem.AddFunc(0x9e1dff96, cellGemGetInfo); - cellGem.AddFunc(0x2e0a170d, cellGemGetMemorySize); - cellGem.AddFunc(0x1b30cc22, cellGemGetRGB); - cellGem.AddFunc(0x6db6b007, cellGemGetRumble); - cellGem.AddFunc(0x6441d38d, cellGemGetState); - cellGem.AddFunc(0xfee33481, cellGemGetStatusFlags); - cellGem.AddFunc(0x18ea899a, cellGemGetTrackerHue); + REG_FUNC(cellGem, cellGemCalibrate); + REG_FUNC(cellGem, cellGemClearStatusFlags); + REG_FUNC(cellGem, cellGemConvertVideoFinish); + REG_FUNC(cellGem, cellGemConvertVideoStart); + REG_FUNC(cellGem, cellGemEnableCameraPitchAngleCorrection); + REG_FUNC(cellGem, cellGemEnableMagnetometer); + REG_FUNC(cellGem, cellGemEnd); + REG_FUNC(cellGem, cellGemFilterState); + REG_FUNC(cellGem, cellGemForceRGB); + REG_FUNC(cellGem, cellGemGetAccelerometerPositionInDevice); + REG_FUNC(cellGem, cellGemGetAllTrackableHues); + REG_FUNC(cellGem, cellGemGetCameraState); + REG_FUNC(cellGem, cellGemGetEnvironmentLightingColor); + REG_FUNC(cellGem, cellGemGetHuePixels); + REG_FUNC(cellGem, cellGemGetImageState); + REG_FUNC(cellGem, cellGemGetInertialState); + REG_FUNC(cellGem, cellGemGetInfo); + REG_FUNC(cellGem, cellGemGetMemorySize); + REG_FUNC(cellGem, cellGemGetRGB); + REG_FUNC(cellGem, cellGemGetRumble); + REG_FUNC(cellGem, cellGemGetState); + REG_FUNC(cellGem, cellGemGetStatusFlags); + REG_FUNC(cellGem, cellGemGetTrackerHue); //cellGem.AddFunc(, cellGemGetVideoConvertSize); - cellGem.AddFunc(0xc7622586, cellGemHSVtoRGB); - cellGem.AddFunc(0x13ea7c64, cellGemInit); - cellGem.AddFunc(0xe3e4f0d6, cellGemInvalidateCalibration); - cellGem.AddFunc(0xfb5887f9, cellGemIsTrackableHue); - cellGem.AddFunc(0xa03ef587, cellGemPrepareCamera); - cellGem.AddFunc(0xc07896f9, cellGemPrepareVideoConvert); + REG_FUNC(cellGem, cellGemHSVtoRGB); + REG_FUNC(cellGem, cellGemInit); + REG_FUNC(cellGem, cellGemInvalidateCalibration); + REG_FUNC(cellGem, cellGemIsTrackableHue); + REG_FUNC(cellGem, cellGemPrepareCamera); + REG_FUNC(cellGem, cellGemPrepareVideoConvert); //cellGem.AddFunc(, cellGemReadExternalPortDeviceInfo); - cellGem.AddFunc(0xde54e2fc, cellGemReset); - cellGem.AddFunc(0x49609306, cellGemSetRumble); - cellGem.AddFunc(0x77e08704, cellGemSetYaw); - cellGem.AddFunc(0x928ac5f8, cellGemTrackHues); - cellGem.AddFunc(0x41ae9c31, cellGemUpdateFinish); - cellGem.AddFunc(0x0ecd2261, cellGemUpdateStart); + REG_FUNC(cellGem, cellGemReset); + REG_FUNC(cellGem, cellGemSetRumble); + REG_FUNC(cellGem, cellGemSetYaw); + REG_FUNC(cellGem, cellGemTrackHues); + REG_FUNC(cellGem, cellGemUpdateFinish); + REG_FUNC(cellGem, cellGemUpdateStart); //cellGem.AddFunc(, cellGemVideoConvertAttributeInit); //cellGem.AddFunc(, cellGemVideoConvertAttributeInitRgba); - cellGem.AddFunc(0x1f6328d8, cellGemWriteExternalPort); + REG_FUNC(cellGem, cellGemWriteExternalPort); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp index 6264c5e818..b78fe6e90c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp @@ -277,17 +277,17 @@ int cellGifDecDestroy(u32 mainHandle) Module cellGifDec("cellGifDec", []() { - cellGifDec.AddFunc(0xb60d42a5, cellGifDecCreate); - cellGifDec.AddFunc(0x4711cb7f, cellGifDecExtCreate); - cellGifDec.AddFunc(0x75745079, cellGifDecOpen); - cellGifDec.AddFunc(0xf0da95de, cellGifDecReadHeader); - cellGifDec.AddFunc(0x41a90dc4, cellGifDecSetParameter); - cellGifDec.AddFunc(0x44b1bc61, cellGifDecDecodeData); - cellGifDec.AddFunc(0x116a7da9, cellGifDecClose); - cellGifDec.AddFunc(0xe74b2cb1, cellGifDecDestroy); + REG_FUNC(cellGifDec, cellGifDecCreate); + REG_FUNC(cellGifDec, cellGifDecExtCreate); + REG_FUNC(cellGifDec, cellGifDecOpen); + REG_FUNC(cellGifDec, cellGifDecReadHeader); + REG_FUNC(cellGifDec, cellGifDecSetParameter); + REG_FUNC(cellGifDec, cellGifDecDecodeData); + REG_FUNC(cellGifDec, cellGifDecClose); + REG_FUNC(cellGifDec, cellGifDecDestroy); - /*cellGifDec.AddFunc(0x17fb83c1, cellGifDecExtOpen); - cellGifDec.AddFunc(0xe53f91f2, cellGifDecExtReadHeader); - cellGifDec.AddFunc(0x95cae771, cellGifDecExtSetParameter); - cellGifDec.AddFunc(0x02e7e03e, cellGifDecExtDecodeData);*/ + /*REG_FUNC(cellGifDec, cellGifDecExtOpen); + REG_FUNC(cellGifDec, cellGifDecExtReadHeader); + REG_FUNC(cellGifDec, cellGifDecExtSetParameter); + REG_FUNC(cellGifDec, cellGifDecExtDecodeData);*/ }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp b/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp index 0548c9bf16..7e116bed58 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp @@ -126,28 +126,28 @@ int cellHttpUtilBase64Decoder() void cellHttpUtil_init() { - cellHttpUtil.AddFunc(0x32faaf58, cellHttpUtilParseUri); - cellHttpUtil.AddFunc(0x8bb608e4, cellHttpUtilParseUriPath); - cellHttpUtil.AddFunc(0xa3457869, cellHttpUtilParseProxy); - cellHttpUtil.AddFunc(0x2bcbced4, cellHttpUtilParseStatusLine); - cellHttpUtil.AddFunc(0xe1fb0ebd, cellHttpUtilParseHeader); + REG_FUNC(cellHttpUtil, cellHttpUtilParseUri); + REG_FUNC(cellHttpUtil, cellHttpUtilParseUriPath); + REG_FUNC(cellHttpUtil, cellHttpUtilParseProxy); + REG_FUNC(cellHttpUtil, cellHttpUtilParseStatusLine); + REG_FUNC(cellHttpUtil, cellHttpUtilParseHeader); - cellHttpUtil.AddFunc(0x1c6e4dbb, cellHttpUtilBuildRequestLine); - cellHttpUtil.AddFunc(0x04accebf, cellHttpUtilBuildHeader); - cellHttpUtil.AddFunc(0x6f0f7667, cellHttpUtilBuildUri); + REG_FUNC(cellHttpUtil, cellHttpUtilBuildRequestLine); + REG_FUNC(cellHttpUtil, cellHttpUtilBuildHeader); + REG_FUNC(cellHttpUtil, cellHttpUtilBuildUri); - cellHttpUtil.AddFunc(0xf05df789, cellHttpUtilCopyUri); - cellHttpUtil.AddFunc(0x8ea23deb, cellHttpUtilMergeUriPath); - cellHttpUtil.AddFunc(0xaabeb869, cellHttpUtilSweepPath); - cellHttpUtil.AddFunc(0x50ea75bc, cellHttpUtilCopyStatusLine); - cellHttpUtil.AddFunc(0x97f9fbe5, cellHttpUtilCopyHeader); - cellHttpUtil.AddFunc(0x37bb53a2, cellHttpUtilAppendHeaderValue); + REG_FUNC(cellHttpUtil, cellHttpUtilCopyUri); + REG_FUNC(cellHttpUtil, cellHttpUtilMergeUriPath); + REG_FUNC(cellHttpUtil, cellHttpUtilSweepPath); + REG_FUNC(cellHttpUtil, cellHttpUtilCopyStatusLine); + REG_FUNC(cellHttpUtil, cellHttpUtilCopyHeader); + REG_FUNC(cellHttpUtil, cellHttpUtilAppendHeaderValue); - cellHttpUtil.AddFunc(0x9003b1f2, cellHttpUtilEscapeUri); - cellHttpUtil.AddFunc(0x2763fd66, cellHttpUtilUnescapeUri); - cellHttpUtil.AddFunc(0x44d756d6, cellHttpUtilFormUrlEncode); - cellHttpUtil.AddFunc(0x8e6c5bb9, cellHttpUtilFormUrlDecode); - cellHttpUtil.AddFunc(0x83faa354, cellHttpUtilBase64Encoder); - cellHttpUtil.AddFunc(0x8e52ee08, cellHttpUtilBase64Decoder); + REG_FUNC(cellHttpUtil, cellHttpUtilEscapeUri); + REG_FUNC(cellHttpUtil, cellHttpUtilUnescapeUri); + REG_FUNC(cellHttpUtil, cellHttpUtilFormUrlEncode); + REG_FUNC(cellHttpUtil, cellHttpUtilFormUrlDecode); + REG_FUNC(cellHttpUtil, cellHttpUtilBase64Encoder); + REG_FUNC(cellHttpUtil, cellHttpUtilBase64Decoder); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp b/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp index 3a8ba92062..f7e0966fd1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp @@ -258,49 +258,49 @@ int cellImeJpConfirmPrediction() void cellImejp_init() { - cellImejp.AddFunc(0x44608862, cellImeJpOpen); - cellImejp.AddFunc(0x47b43dd4, cellImeJpOpen2); - cellImejp.AddFunc(0x1b119958, cellImeJpOpen3); - cellImejp.AddFunc(0x46d1234a, cellImeJpClose); + REG_FUNC(cellImejp, cellImeJpOpen); + REG_FUNC(cellImejp, cellImeJpOpen2); + REG_FUNC(cellImejp, cellImeJpOpen3); + REG_FUNC(cellImejp, cellImeJpClose); - cellImejp.AddFunc(0x24e9d8fc, cellImeJpSetKanaInputMode); - cellImejp.AddFunc(0xf5992ec8, cellImeJpSetInputCharType); - cellImejp.AddFunc(0xc1786c81, cellImeJpSetFixInputMode); + REG_FUNC(cellImejp, cellImeJpSetKanaInputMode); + REG_FUNC(cellImejp, cellImeJpSetInputCharType); + REG_FUNC(cellImejp, cellImeJpSetFixInputMode); //cellImejp.AddFunc(, cellImeJpAllowExtensionCharacters); - cellImejp.AddFunc(0x36d38701, cellImeJpReset); + REG_FUNC(cellImejp, cellImeJpReset); - cellImejp.AddFunc(0x66c6cc78, cellImeJpGetStatus); + REG_FUNC(cellImejp, cellImeJpGetStatus); - cellImejp.AddFunc(0x6ccbe3d6, cellImeJpEnterChar); - cellImejp.AddFunc(0x5b6ada55, cellImeJpEnterCharExt); - cellImejp.AddFunc(0x441a1c2b, cellImeJpEnterString); - cellImejp.AddFunc(0x6298b55a, cellImeJpEnterStringExt); - cellImejp.AddFunc(0xac6693d8, cellImeJpModeCaretRight); - cellImejp.AddFunc(0xe76c9700, cellImeJpModeCaretLeft); - cellImejp.AddFunc(0xaa1d1f57, cellImeJpBackspaceWord); - cellImejp.AddFunc(0x72257652, cellImeJpDeleteWord); - cellImejp.AddFunc(0x6319eda3, cellImeJpAllDeleteConvertString); - cellImejp.AddFunc(0x1e29103b, cellImeJpConvertForward); - cellImejp.AddFunc(0xc2bb48bc, cellImeJpConvertBackward); - cellImejp.AddFunc(0x7a18c2b9, cellImeJpCurrentPartConfirm); - cellImejp.AddFunc(0x7189430b, cellImeJpAllConfirm); - cellImejp.AddFunc(0xeae879dc, cellImeJpConvertCancel); - cellImejp.AddFunc(0xcbbc20b7, cellImeJpAllConvertCancel); - cellImejp.AddFunc(0x37961cc1, cellImeJpExtendConvertArea); - cellImejp.AddFunc(0xaa2a3287, cellImeJpShortenConvertArea); - cellImejp.AddFunc(0xbd679cc1, cellImeJpTemporalConfirm); - cellImejp.AddFunc(0x8bb41f47, cellImeJpPostConvert); - cellImejp.AddFunc(0x1e411261, cellImeJpMoveFocusClause); - cellImejp.AddFunc(0x0e363ae7, cellImeJpGetFocusTop); - cellImejp.AddFunc(0x5f5b3227, cellImeJpGetFocusLength); - cellImejp.AddFunc(0x89f8a567, cellImeJpGetConfirmYomiString); - cellImejp.AddFunc(0xd3fc3606, cellImeJpGetConfirmString); - cellImejp.AddFunc(0xea2d4881, cellImeJpGetConvertYomiString); - cellImejp.AddFunc(0xf91abda3, cellImeJpGetConvertString); - cellImejp.AddFunc(0xc4796a45, cellImeJpGetCandidateListSize); - cellImejp.AddFunc(0xe4cc15ba, cellImeJpGetCandidateList); - cellImejp.AddFunc(0x177bd218, cellImeJpGetCandidateSelect); - cellImejp.AddFunc(0x1986f2cd, cellImeJpGetPredictList); - cellImejp.AddFunc(0xeede898c, cellImeJpConfirmPrediction); + REG_FUNC(cellImejp, cellImeJpEnterChar); + REG_FUNC(cellImejp, cellImeJpEnterCharExt); + REG_FUNC(cellImejp, cellImeJpEnterString); + REG_FUNC(cellImejp, cellImeJpEnterStringExt); + REG_FUNC(cellImejp, cellImeJpModeCaretRight); + REG_FUNC(cellImejp, cellImeJpModeCaretLeft); + REG_FUNC(cellImejp, cellImeJpBackspaceWord); + REG_FUNC(cellImejp, cellImeJpDeleteWord); + REG_FUNC(cellImejp, cellImeJpAllDeleteConvertString); + REG_FUNC(cellImejp, cellImeJpConvertForward); + REG_FUNC(cellImejp, cellImeJpConvertBackward); + REG_FUNC(cellImejp, cellImeJpCurrentPartConfirm); + REG_FUNC(cellImejp, cellImeJpAllConfirm); + REG_FUNC(cellImejp, cellImeJpConvertCancel); + REG_FUNC(cellImejp, cellImeJpAllConvertCancel); + REG_FUNC(cellImejp, cellImeJpExtendConvertArea); + REG_FUNC(cellImejp, cellImeJpShortenConvertArea); + REG_FUNC(cellImejp, cellImeJpTemporalConfirm); + REG_FUNC(cellImejp, cellImeJpPostConvert); + REG_FUNC(cellImejp, cellImeJpMoveFocusClause); + REG_FUNC(cellImejp, cellImeJpGetFocusTop); + REG_FUNC(cellImejp, cellImeJpGetFocusLength); + REG_FUNC(cellImejp, cellImeJpGetConfirmYomiString); + REG_FUNC(cellImejp, cellImeJpGetConfirmString); + REG_FUNC(cellImejp, cellImeJpGetConvertYomiString); + REG_FUNC(cellImejp, cellImeJpGetConvertString); + REG_FUNC(cellImejp, cellImeJpGetCandidateListSize); + REG_FUNC(cellImejp, cellImeJpGetCandidateList); + REG_FUNC(cellImejp, cellImeJpGetCandidateSelect); + REG_FUNC(cellImejp, cellImeJpGetPredictList); + REG_FUNC(cellImejp, cellImeJpConfirmPrediction); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp index 7c2211ab50..ea49bf80cd 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp @@ -322,17 +322,17 @@ int cellJpgDecSetParameter(u32 mainHandle, u32 subHandle, vm::ptr config) void cellKb_init() { - sys_io.AddFunc(0x433f6ec0, cellKbInit); - sys_io.AddFunc(0xbfce3285, cellKbEnd); - sys_io.AddFunc(0x2073b7f6, cellKbClearBuf); - sys_io.AddFunc(0x4ab1fa77, cellKbCnvRawCode); - sys_io.AddFunc(0x2f1774d5, cellKbGetInfo); - sys_io.AddFunc(0xff0a21b7, cellKbRead); - sys_io.AddFunc(0xa5f85e4d, cellKbSetCodeType); - sys_io.AddFunc(0x3f72c56e, cellKbSetLEDStatus); - sys_io.AddFunc(0xdeefdfa7, cellKbSetReadMode); - sys_io.AddFunc(0x1f71ecbe, cellKbGetConfiguration); + REG_FUNC(sys_io, cellKbInit); + REG_FUNC(sys_io, cellKbEnd); + REG_FUNC(sys_io, cellKbClearBuf); + REG_FUNC(sys_io, cellKbCnvRawCode); + REG_FUNC(sys_io, cellKbGetInfo); + REG_FUNC(sys_io, cellKbRead); + REG_FUNC(sys_io, cellKbSetCodeType); + REG_FUNC(sys_io, cellKbSetLEDStatus); + REG_FUNC(sys_io, cellKbSetReadMode); + REG_FUNC(sys_io, cellKbGetConfiguration); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp b/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp index 4b1e6d7a10..73e704b9a0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp @@ -48,10 +48,10 @@ int cellKey2CharSetArrangement() void cellKey2char_init() { - cellKey2char.AddFunc(0xabf629c1, cellKey2CharOpen); - cellKey2char.AddFunc(0x14bf2dc1, cellKey2CharClose); - cellKey2char.AddFunc(0x56776c0d, cellKey2CharGetChar); - cellKey2char.AddFunc(0xbfc03768, cellKey2CharSetMode); - cellKey2char.AddFunc(0x0dfbadfa, cellKey2CharSetArrangement); + REG_FUNC(cellKey2char, cellKey2CharOpen); + REG_FUNC(cellKey2char, cellKey2CharClose); + REG_FUNC(cellKey2char, cellKey2CharGetChar); + REG_FUNC(cellKey2char, cellKey2CharSetMode); + REG_FUNC(cellKey2char, cellKey2CharSetArrangement); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp index 4fefb3b4c5..a29aec4262 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp @@ -339,169 +339,169 @@ Module cellL10n("cellL10n", []() { // NOTE: I think this module should be LLE'd instead of implementing all its functions - // cellL10n.AddFunc(0x005200e6, UCS2toEUCJP); - // cellL10n.AddFunc(0x01b0cbf4, l10n_convert); - // cellL10n.AddFunc(0x0356038c, UCS2toUTF32); - // cellL10n.AddFunc(0x05028763, jis2kuten); - // cellL10n.AddFunc(0x058addc8, UTF8toGB18030); - // cellL10n.AddFunc(0x060ee3b2, JISstoUTF8s); - // cellL10n.AddFunc(0x07168a83, SjisZen2Han); - // cellL10n.AddFunc(0x0bc386c8, ToSjisLower); - // cellL10n.AddFunc(0x0bedf77d, UCS2toGB18030); - // cellL10n.AddFunc(0x0bf867e2, HZstoUCS2s); - // cellL10n.AddFunc(0x0ce278fd, UCS2stoHZs); - // cellL10n.AddFunc(0x0d90a48d, UCS2stoSJISs); - // cellL10n.AddFunc(0x0f624540, kuten2eucjp); - // cellL10n.AddFunc(0x14ee3649, sjis2jis); - // cellL10n.AddFunc(0x14f504b8, EUCKRstoUCS2s); - // cellL10n.AddFunc(0x16eaf5f1, UHCstoEUCKRs); - // cellL10n.AddFunc(0x1758053c, jis2sjis); - // cellL10n.AddFunc(0x1906ce6b, jstrnchk); - // cellL10n.AddFunc(0x1ac0d23d, L10nConvert); - // cellL10n.AddFunc(0x1ae2acee, EUCCNstoUTF8s); - // cellL10n.AddFunc(0x1cb1138f, GBKstoUCS2s); - // cellL10n.AddFunc(0x1da42d70, eucjphan2zen); - // cellL10n.AddFunc(0x1ec712e0, ToSjisHira); - // cellL10n.AddFunc(0x1fb50183, GBKtoUCS2); - // cellL10n.AddFunc(0x21948c03, eucjp2jis); - // cellL10n.AddFunc(0x21aa3045, UTF32stoUTF8s); - // cellL10n.AddFunc(0x24fd32a9, sjishan2zen); - // cellL10n.AddFunc(0x256b6861, UCS2toSBCS); - // cellL10n.AddFunc(0x262a5ae2, UTF8stoGBKs); - // cellL10n.AddFunc(0x28724522, UTF8toUCS2); - // cellL10n.AddFunc(0x2ad091c6, UCS2stoUTF8s); - // cellL10n.AddFunc(0x2b84030c, EUCKRstoUTF8s); - // cellL10n.AddFunc(0x2efa7294, UTF16stoUTF32s); - // cellL10n.AddFunc(0x2f9eb543, UTF8toEUCKR); - // cellL10n.AddFunc(0x317ab7c2, UTF16toUTF8); - // cellL10n.AddFunc(0x32689828, ARIBstoUTF8s); - // cellL10n.AddFunc(0x33435818, SJISstoUTF8s); - // cellL10n.AddFunc(0x33f8b35c, sjiszen2han); - // cellL10n.AddFunc(0x3968f176, ToEucJpLower); - // cellL10n.AddFunc(0x398a3dee, MSJIStoUTF8); - // cellL10n.AddFunc(0x3a20bc34, UCS2stoMSJISs); - // cellL10n.AddFunc(0x3dabd5a7, EUCJPtoUTF8); - // cellL10n.AddFunc(0x3df65b64, eucjp2sjis); - // cellL10n.AddFunc(0x408a622b, ToEucJpHira); - // cellL10n.AddFunc(0x41b4a5ae, UHCstoUCS2s); - // cellL10n.AddFunc(0x41ccf033, ToEucJpKata); - // cellL10n.AddFunc(0x42838145, HZstoUTF8s); - // cellL10n.AddFunc(0x4931b44e, UTF8toMSJIS); - // cellL10n.AddFunc(0x4b3bbacb, BIG5toUTF8); - // cellL10n.AddFunc(0x511d386b, EUCJPstoSJISs); - // cellL10n.AddFunc(0x52b7883f, UTF8stoBIG5s); - // cellL10n.AddFunc(0x53558b6b, UTF16stoUCS2s); - // cellL10n.AddFunc(0x53764725, UCS2stoGB18030s); - // cellL10n.AddFunc(0x53c71ac2, EUCJPtoSJIS); - // cellL10n.AddFunc(0x54f59807, EUCJPtoUCS2); - // cellL10n.AddFunc(0x55f6921c, UCS2stoGBKs); - // cellL10n.AddFunc(0x58246762, EUCKRtoUHC); - // cellL10n.AddFunc(0x596df41c, UCS2toSJIS); - // cellL10n.AddFunc(0x5a4ab223, MSJISstoUTF8s); - // cellL10n.AddFunc(0x5ac783dc, EUCJPstoUTF8s); - // cellL10n.AddFunc(0x5b684dfb, UCS2toBIG5); - // cellL10n.AddFunc(0x5cd29270, UTF8stoEUCKRs); - // cellL10n.AddFunc(0x5e1d9330, UHCstoUTF8s); - // cellL10n.AddFunc(0x60ffa0ec, GB18030stoUCS2s); - // cellL10n.AddFunc(0x6122e000, SJIStoUTF8); - // cellL10n.AddFunc(0x6169f205, JISstoSJISs); - // cellL10n.AddFunc(0x61fb9442, UTF8toUTF16); - // cellL10n.AddFunc(0x62b36bcf, UTF8stoMSJISs); - // cellL10n.AddFunc(0x63219199, EUCKRtoUTF8); - // cellL10n.AddFunc(0x638c2fc1, SjisHan2Zen); - // cellL10n.AddFunc(0x64a10ec8, UCS2toUTF16); - // cellL10n.AddFunc(0x65444204, UCS2toMSJIS); - // cellL10n.AddFunc(0x6621a82c, sjis2kuten); - // cellL10n.AddFunc(0x6a6f25d1, UCS2toUHC); - // cellL10n.AddFunc(0x6c62d879, UTF32toUCS2); - // cellL10n.AddFunc(0x6de4b508, ToSjisUpper); - // cellL10n.AddFunc(0x6e0705c4, UTF8toEUCJP); - // cellL10n.AddFunc(0x6e5906fd, UCS2stoEUCJPs); - // cellL10n.AddFunc(0x6fc530b3, UTF16toUCS2); - // cellL10n.AddFunc(0x714a9b4a, UCS2stoUTF16s); - // cellL10n.AddFunc(0x71804d64, UCS2stoEUCCNs); - // cellL10n.AddFunc(0x72632e53, SBCSstoUTF8s); - // cellL10n.AddFunc(0x73f2cd21, SJISstoJISs); - // cellL10n.AddFunc(0x74496718, SBCStoUTF8); - // cellL10n.AddFunc(0x74871fe0, UTF8toUTF32); - cellL10n.AddFunc(0x750c363d, jstrchk); - // cellL10n.AddFunc(0x7c5bde1c, UHCtoEUCKR); - // cellL10n.AddFunc(0x7c912bda, kuten2jis); - // cellL10n.AddFunc(0x7d07a1c2, UTF8toEUCCN); - // cellL10n.AddFunc(0x8171c1cc, EUCCNtoUTF8); - // cellL10n.AddFunc(0x82d5ecdf, EucJpZen2Han); - // cellL10n.AddFunc(0x8555fe15, UTF32stoUTF16s); - // cellL10n.AddFunc(0x860fc741, GBKtoUTF8); - // cellL10n.AddFunc(0x867f7b8b, ToEucJpUpper); - // cellL10n.AddFunc(0x88f8340b, UCS2stoJISs); - // cellL10n.AddFunc(0x89236c86, UTF8stoGB18030s); - // cellL10n.AddFunc(0x8a56f148, EUCKRstoUHCs); - // cellL10n.AddFunc(0x8ccdba38, UTF8stoUTF32s); - // cellL10n.AddFunc(0x8f472054, UTF8stoEUCCNs); - // cellL10n.AddFunc(0x90e9b5d2, EUCJPstoUCS2s); - // cellL10n.AddFunc(0x91a99765, UHCtoUCS2); - cellL10n.AddFunc(0x931ff25a, L10nConvertStr); - // cellL10n.AddFunc(0x949bb14c, GBKstoUTF8s); - // cellL10n.AddFunc(0x9557ac9b, UTF8toUHC); - // cellL10n.AddFunc(0x9768b6d3, UTF32toUTF8); - // cellL10n.AddFunc(0x9874020d, sjis2eucjp); - // cellL10n.AddFunc(0x9a0e7d23, UCS2toEUCCN); - // cellL10n.AddFunc(0x9a13d6b8, UTF8stoUHCs); - // cellL10n.AddFunc(0x9a72059d, EUCKRtoUCS2); - // cellL10n.AddFunc(0x9b1210c6, UTF32toUTF16); - // cellL10n.AddFunc(0x9cd8135b, EUCCNstoUCS2s); - // cellL10n.AddFunc(0x9ce52809, SBCSstoUCS2s); - // cellL10n.AddFunc(0x9cf1ab77, UTF8stoJISs); - // cellL10n.AddFunc(0x9d14dc46, ToSjisKata); - // cellL10n.AddFunc(0x9dcde367, jis2eucjp); - // cellL10n.AddFunc(0x9ec52258, BIG5toUCS2); - // cellL10n.AddFunc(0xa0d463c0, UCS2toGBK); - // cellL10n.AddFunc(0xa19fb9de, UTF16toUTF32); - // cellL10n.AddFunc(0xa298cad2, l10n_convert_str); - // cellL10n.AddFunc(0xa34fa0eb, EUCJPstoJISs); - // cellL10n.AddFunc(0xa5146299, UTF8stoARIBs); - // cellL10n.AddFunc(0xa609f3e9, JISstoEUCJPs); - // cellL10n.AddFunc(0xa60ff5c9, EucJpHan2Zen); - // cellL10n.AddFunc(0xa963619c, isEucJpKigou); - // cellL10n.AddFunc(0xa9a76fb8, UCS2toUTF8); - // cellL10n.AddFunc(0xaf18d499, GB18030toUCS2); - // cellL10n.AddFunc(0xb3361be6, UHCtoUTF8); - // cellL10n.AddFunc(0xb6e45343, MSJIStoUCS2); - // cellL10n.AddFunc(0xb7cef4a6, UTF8toGBK); - // cellL10n.AddFunc(0xb7e08f7a, kuten2sjis); - // cellL10n.AddFunc(0xb9cf473d, UTF8toSBCS); - // cellL10n.AddFunc(0xbdd44ee3, SJIStoUCS2); - // cellL10n.AddFunc(0xbe42e661, eucjpzen2han); - // cellL10n.AddFunc(0xbe8d5485, UCS2stoARIBs); - // cellL10n.AddFunc(0xbefe3869, isSjisKigou); - // cellL10n.AddFunc(0xc62b758d, UTF8stoEUCJPs); - // cellL10n.AddFunc(0xc7bdcb4c, UCS2toEUCKR); - // cellL10n.AddFunc(0xc944fa56, SBCStoUCS2); - // cellL10n.AddFunc(0xc9b78f58, MSJISstoUCS2s); - // cellL10n.AddFunc(0xcc1633cc, l10n_get_converter); - // cellL10n.AddFunc(0xd02ef83d, GB18030stoUTF8s); - // cellL10n.AddFunc(0xd8721e2c, SJISstoEUCJPs); - // cellL10n.AddFunc(0xd8cb24cb, UTF32stoUCS2s); - // cellL10n.AddFunc(0xd990858b, BIG5stoUTF8s); - // cellL10n.AddFunc(0xd9fb1224, EUCCNtoUCS2); - // cellL10n.AddFunc(0xda67b37f, UTF8stoSBCSs); - // cellL10n.AddFunc(0xdc54886c, UCS2stoEUCKRs); - // cellL10n.AddFunc(0xdd5ebdeb, UTF8stoSJISs); - // cellL10n.AddFunc(0xdefa1c17, UTF8stoHZs); - // cellL10n.AddFunc(0xe2eabb32, eucjp2kuten); - // cellL10n.AddFunc(0xe6d9e234, UTF8toBIG5); - // cellL10n.AddFunc(0xe6f5711b, UTF16stoUTF8s); - // cellL10n.AddFunc(0xe956dc64, JISstoUCS2s); - // cellL10n.AddFunc(0xeabc3d00, GB18030toUTF8); - // cellL10n.AddFunc(0xeb3dc670, UTF8toSJIS); - // cellL10n.AddFunc(0xeb41cc68, ARIBstoUCS2s); - // cellL10n.AddFunc(0xeb685b83, UCS2stoUTF32s); - // cellL10n.AddFunc(0xebae29c0, UCS2stoSBCSs); - // cellL10n.AddFunc(0xee6c6a39, UCS2stoBIG5s); - // cellL10n.AddFunc(0xf1dcfa71, UCS2stoUHCs); - // cellL10n.AddFunc(0xf439728e, SJIStoEUCJP); - // cellL10n.AddFunc(0xf7681b9a, UTF8stoUTF16s); - // cellL10n.AddFunc(0xf9b1896d, SJISstoUCS2s); - // cellL10n.AddFunc(0xfa4a675a, BIG5stoUCS2s); - // cellL10n.AddFunc(0xfdbf6ac5, UTF8stoUCS2s); + // REG_FUNC(cellL10n, UCS2toEUCJP); + // REG_FUNC(cellL10n, l10n_convert); + // REG_FUNC(cellL10n, UCS2toUTF32); + // REG_FUNC(cellL10n, jis2kuten); + // REG_FUNC(cellL10n, UTF8toGB18030); + // REG_FUNC(cellL10n, JISstoUTF8s); + // REG_FUNC(cellL10n, SjisZen2Han); + // REG_FUNC(cellL10n, ToSjisLower); + // REG_FUNC(cellL10n, UCS2toGB18030); + // REG_FUNC(cellL10n, HZstoUCS2s); + // REG_FUNC(cellL10n, UCS2stoHZs); + // REG_FUNC(cellL10n, UCS2stoSJISs); + // REG_FUNC(cellL10n, kuten2eucjp); + // REG_FUNC(cellL10n, sjis2jis); + // REG_FUNC(cellL10n, EUCKRstoUCS2s); + // REG_FUNC(cellL10n, UHCstoEUCKRs); + // REG_FUNC(cellL10n, jis2sjis); + // REG_FUNC(cellL10n, jstrnchk); + // REG_FUNC(cellL10n, L10nConvert); + // REG_FUNC(cellL10n, EUCCNstoUTF8s); + // REG_FUNC(cellL10n, GBKstoUCS2s); + // REG_FUNC(cellL10n, eucjphan2zen); + // REG_FUNC(cellL10n, ToSjisHira); + // REG_FUNC(cellL10n, GBKtoUCS2); + // REG_FUNC(cellL10n, eucjp2jis); + // REG_FUNC(cellL10n, UTF32stoUTF8s); + // REG_FUNC(cellL10n, sjishan2zen); + // REG_FUNC(cellL10n, UCS2toSBCS); + // REG_FUNC(cellL10n, UTF8stoGBKs); + // REG_FUNC(cellL10n, UTF8toUCS2); + // REG_FUNC(cellL10n, UCS2stoUTF8s); + // REG_FUNC(cellL10n, EUCKRstoUTF8s); + // REG_FUNC(cellL10n, UTF16stoUTF32s); + // REG_FUNC(cellL10n, UTF8toEUCKR); + // REG_FUNC(cellL10n, UTF16toUTF8); + // REG_FUNC(cellL10n, ARIBstoUTF8s); + // REG_FUNC(cellL10n, SJISstoUTF8s); + // REG_FUNC(cellL10n, sjiszen2han); + // REG_FUNC(cellL10n, ToEucJpLower); + // REG_FUNC(cellL10n, MSJIStoUTF8); + // REG_FUNC(cellL10n, UCS2stoMSJISs); + // REG_FUNC(cellL10n, EUCJPtoUTF8); + // REG_FUNC(cellL10n, eucjp2sjis); + // REG_FUNC(cellL10n, ToEucJpHira); + // REG_FUNC(cellL10n, UHCstoUCS2s); + // REG_FUNC(cellL10n, ToEucJpKata); + // REG_FUNC(cellL10n, HZstoUTF8s); + // REG_FUNC(cellL10n, UTF8toMSJIS); + // REG_FUNC(cellL10n, BIG5toUTF8); + // REG_FUNC(cellL10n, EUCJPstoSJISs); + // REG_FUNC(cellL10n, UTF8stoBIG5s); + // REG_FUNC(cellL10n, UTF16stoUCS2s); + // REG_FUNC(cellL10n, UCS2stoGB18030s); + // REG_FUNC(cellL10n, EUCJPtoSJIS); + // REG_FUNC(cellL10n, EUCJPtoUCS2); + // REG_FUNC(cellL10n, UCS2stoGBKs); + // REG_FUNC(cellL10n, EUCKRtoUHC); + // REG_FUNC(cellL10n, UCS2toSJIS); + // REG_FUNC(cellL10n, MSJISstoUTF8s); + // REG_FUNC(cellL10n, EUCJPstoUTF8s); + // REG_FUNC(cellL10n, UCS2toBIG5); + // REG_FUNC(cellL10n, UTF8stoEUCKRs); + // REG_FUNC(cellL10n, UHCstoUTF8s); + // REG_FUNC(cellL10n, GB18030stoUCS2s); + // REG_FUNC(cellL10n, SJIStoUTF8); + // REG_FUNC(cellL10n, JISstoSJISs); + // REG_FUNC(cellL10n, UTF8toUTF16); + // REG_FUNC(cellL10n, UTF8stoMSJISs); + // REG_FUNC(cellL10n, EUCKRtoUTF8); + // REG_FUNC(cellL10n, SjisHan2Zen); + // REG_FUNC(cellL10n, UCS2toUTF16); + // REG_FUNC(cellL10n, UCS2toMSJIS); + // REG_FUNC(cellL10n, sjis2kuten); + // REG_FUNC(cellL10n, UCS2toUHC); + // REG_FUNC(cellL10n, UTF32toUCS2); + // REG_FUNC(cellL10n, ToSjisUpper); + // REG_FUNC(cellL10n, UTF8toEUCJP); + // REG_FUNC(cellL10n, UCS2stoEUCJPs); + // REG_FUNC(cellL10n, UTF16toUCS2); + // REG_FUNC(cellL10n, UCS2stoUTF16s); + // REG_FUNC(cellL10n, UCS2stoEUCCNs); + // REG_FUNC(cellL10n, SBCSstoUTF8s); + // REG_FUNC(cellL10n, SJISstoJISs); + // REG_FUNC(cellL10n, SBCStoUTF8); + // REG_FUNC(cellL10n, UTF8toUTF32); + REG_FUNC(cellL10n, jstrchk); + // REG_FUNC(cellL10n, UHCtoEUCKR); + // REG_FUNC(cellL10n, kuten2jis); + // REG_FUNC(cellL10n, UTF8toEUCCN); + // REG_FUNC(cellL10n, EUCCNtoUTF8); + // REG_FUNC(cellL10n, EucJpZen2Han); + // REG_FUNC(cellL10n, UTF32stoUTF16s); + // REG_FUNC(cellL10n, GBKtoUTF8); + // REG_FUNC(cellL10n, ToEucJpUpper); + // REG_FUNC(cellL10n, UCS2stoJISs); + // REG_FUNC(cellL10n, UTF8stoGB18030s); + // REG_FUNC(cellL10n, EUCKRstoUHCs); + // REG_FUNC(cellL10n, UTF8stoUTF32s); + // REG_FUNC(cellL10n, UTF8stoEUCCNs); + // REG_FUNC(cellL10n, EUCJPstoUCS2s); + // REG_FUNC(cellL10n, UHCtoUCS2); + REG_FUNC(cellL10n, L10nConvertStr); + // REG_FUNC(cellL10n, GBKstoUTF8s); + // REG_FUNC(cellL10n, UTF8toUHC); + // REG_FUNC(cellL10n, UTF32toUTF8); + // REG_FUNC(cellL10n, sjis2eucjp); + // REG_FUNC(cellL10n, UCS2toEUCCN); + // REG_FUNC(cellL10n, UTF8stoUHCs); + // REG_FUNC(cellL10n, EUCKRtoUCS2); + // REG_FUNC(cellL10n, UTF32toUTF16); + // REG_FUNC(cellL10n, EUCCNstoUCS2s); + // REG_FUNC(cellL10n, SBCSstoUCS2s); + // REG_FUNC(cellL10n, UTF8stoJISs); + // REG_FUNC(cellL10n, ToSjisKata); + // REG_FUNC(cellL10n, jis2eucjp); + // REG_FUNC(cellL10n, BIG5toUCS2); + // REG_FUNC(cellL10n, UCS2toGBK); + // REG_FUNC(cellL10n, UTF16toUTF32); + // REG_FUNC(cellL10n, l10n_convert_str); + // REG_FUNC(cellL10n, EUCJPstoJISs); + // REG_FUNC(cellL10n, UTF8stoARIBs); + // REG_FUNC(cellL10n, JISstoEUCJPs); + // REG_FUNC(cellL10n, EucJpHan2Zen); + // REG_FUNC(cellL10n, isEucJpKigou); + // REG_FUNC(cellL10n, UCS2toUTF8); + // REG_FUNC(cellL10n, GB18030toUCS2); + // REG_FUNC(cellL10n, UHCtoUTF8); + // REG_FUNC(cellL10n, MSJIStoUCS2); + // REG_FUNC(cellL10n, UTF8toGBK); + // REG_FUNC(cellL10n, kuten2sjis); + // REG_FUNC(cellL10n, UTF8toSBCS); + // REG_FUNC(cellL10n, SJIStoUCS2); + // REG_FUNC(cellL10n, eucjpzen2han); + // REG_FUNC(cellL10n, UCS2stoARIBs); + // REG_FUNC(cellL10n, isSjisKigou); + // REG_FUNC(cellL10n, UTF8stoEUCJPs); + // REG_FUNC(cellL10n, UCS2toEUCKR); + // REG_FUNC(cellL10n, SBCStoUCS2); + // REG_FUNC(cellL10n, MSJISstoUCS2s); + // REG_FUNC(cellL10n, l10n_get_converter); + // REG_FUNC(cellL10n, GB18030stoUTF8s); + // REG_FUNC(cellL10n, SJISstoEUCJPs); + // REG_FUNC(cellL10n, UTF32stoUCS2s); + // REG_FUNC(cellL10n, BIG5stoUTF8s); + // REG_FUNC(cellL10n, EUCCNtoUCS2); + // REG_FUNC(cellL10n, UTF8stoSBCSs); + // REG_FUNC(cellL10n, UCS2stoEUCKRs); + // REG_FUNC(cellL10n, UTF8stoSJISs); + // REG_FUNC(cellL10n, UTF8stoHZs); + // REG_FUNC(cellL10n, eucjp2kuten); + // REG_FUNC(cellL10n, UTF8toBIG5); + // REG_FUNC(cellL10n, UTF16stoUTF8s); + // REG_FUNC(cellL10n, JISstoUCS2s); + // REG_FUNC(cellL10n, GB18030toUTF8); + // REG_FUNC(cellL10n, UTF8toSJIS); + // REG_FUNC(cellL10n, ARIBstoUCS2s); + // REG_FUNC(cellL10n, UCS2stoUTF32s); + // REG_FUNC(cellL10n, UCS2stoSBCSs); + // REG_FUNC(cellL10n, UCS2stoBIG5s); + // REG_FUNC(cellL10n, UCS2stoUHCs); + // REG_FUNC(cellL10n, SJIStoEUCJP); + // REG_FUNC(cellL10n, UTF8stoUTF16s); + // REG_FUNC(cellL10n, SJISstoUCS2s); + // REG_FUNC(cellL10n, BIG5stoUCS2s); + // REG_FUNC(cellL10n, UTF8stoUCS2s); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellLv2dbg.cpp b/rpcs3/Emu/SysCalls/Modules/cellLv2dbg.cpp index 06bd8d77fa..eb05b6320d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellLv2dbg.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellLv2dbg.cpp @@ -223,47 +223,47 @@ int sys_dbg_get_coredump_params() void cellLv2dbg_init() { - cellLv2dbg.AddFunc(0xc21ee635, sys_dbg_read_spu_thread_context); - cellLv2dbg.AddFunc(0xc353353a, sys_dbg_initialize_ppu_exception_handler); - cellLv2dbg.AddFunc(0x22916f45, sys_dbg_register_ppu_exception_handler); - cellLv2dbg.AddFunc(0xc0eb9266, sys_dbg_finalize_ppu_exception_handler); - cellLv2dbg.AddFunc(0xc6d7ec13, sys_dbg_unregister_ppu_exception_handler); - cellLv2dbg.AddFunc(0x06a840f5, sys_dbg_set_stacksize_ppu_exception_handler); - cellLv2dbg.AddFunc(0x4ded9f6c, sys_dbg_signal_to_ppu_exception_handler); - cellLv2dbg.AddFunc(0x3147c6ca, sys_dbg_enable_floating_point_enabled_exception); - cellLv2dbg.AddFunc(0xf254768c, sys_dbg_disable_floating_point_enabled_exception); - cellLv2dbg.AddFunc(0xdb14b37b, sys_dbg_set_address_to_dabr); - cellLv2dbg.AddFunc(0xbb0ae221, sys_dbg_get_address_from_dabr); - cellLv2dbg.AddFunc(0xab475d53, sys_dbg_set_mask_to_ppu_exception_handler); + REG_FUNC(cellLv2dbg, sys_dbg_read_spu_thread_context); + REG_FUNC(cellLv2dbg, sys_dbg_initialize_ppu_exception_handler); + REG_FUNC(cellLv2dbg, sys_dbg_register_ppu_exception_handler); + REG_FUNC(cellLv2dbg, sys_dbg_finalize_ppu_exception_handler); + REG_FUNC(cellLv2dbg, sys_dbg_unregister_ppu_exception_handler); + REG_FUNC(cellLv2dbg, sys_dbg_set_stacksize_ppu_exception_handler); + REG_FUNC(cellLv2dbg, sys_dbg_signal_to_ppu_exception_handler); + REG_FUNC(cellLv2dbg, sys_dbg_enable_floating_point_enabled_exception); + REG_FUNC(cellLv2dbg, sys_dbg_disable_floating_point_enabled_exception); + REG_FUNC(cellLv2dbg, sys_dbg_set_address_to_dabr); + REG_FUNC(cellLv2dbg, sys_dbg_get_address_from_dabr); + REG_FUNC(cellLv2dbg, sys_dbg_set_mask_to_ppu_exception_handler); - cellLv2dbg.AddFunc(0xc5eef17f, sys_dbg_read_ppu_thread_context); - cellLv2dbg.AddFunc(0x266c2bd3, sys_dbg_read_spu_thread_context2); + REG_FUNC(cellLv2dbg, sys_dbg_read_ppu_thread_context); + REG_FUNC(cellLv2dbg, sys_dbg_read_spu_thread_context2); - cellLv2dbg.AddFunc(0x4b55f456, sys_dbg_get_ppu_thread_name); - cellLv2dbg.AddFunc(0x3e5eed36, sys_dbg_get_spu_thread_name); - cellLv2dbg.AddFunc(0xbd69e584, sys_dbg_get_spu_thread_group_name); - cellLv2dbg.AddFunc(0x6b413178, sys_dbg_get_ppu_thread_status); - cellLv2dbg.AddFunc(0x9ddb9dc3, sys_dbg_get_spu_thread_group_status); + REG_FUNC(cellLv2dbg, sys_dbg_get_ppu_thread_name); + REG_FUNC(cellLv2dbg, sys_dbg_get_spu_thread_name); + REG_FUNC(cellLv2dbg, sys_dbg_get_spu_thread_group_name); + REG_FUNC(cellLv2dbg, sys_dbg_get_ppu_thread_status); + REG_FUNC(cellLv2dbg, sys_dbg_get_spu_thread_group_status); - cellLv2dbg.AddFunc(0x113b0bea, sys_dbg_get_ppu_thread_ids); - cellLv2dbg.AddFunc(0x1860f909, sys_dbg_get_spu_thread_ids); - cellLv2dbg.AddFunc(0x08ef08a9, sys_dbg_get_spu_thread_group_ids); + REG_FUNC(cellLv2dbg, sys_dbg_get_ppu_thread_ids); + REG_FUNC(cellLv2dbg, sys_dbg_get_spu_thread_ids); + REG_FUNC(cellLv2dbg, sys_dbg_get_spu_thread_group_ids); - cellLv2dbg.AddFunc(0x50453aa8, sys_dbg_get_mutex_information); - cellLv2dbg.AddFunc(0xcb377e36, sys_dbg_get_lwmutex_information); - cellLv2dbg.AddFunc(0x9794bb53, sys_dbg_get_rwlock_information); - cellLv2dbg.AddFunc(0xa2d6cbd2, sys_dbg_get_semaphore_information); - cellLv2dbg.AddFunc(0x63bd413e, sys_dbg_get_cond_information); - cellLv2dbg.AddFunc(0x7bdadb01, sys_dbg_get_lwcond_information); - cellLv2dbg.AddFunc(0x381ae33e, sys_dbg_get_event_queue_information); - cellLv2dbg.AddFunc(0xdf856979, sys_dbg_get_event_flag_information); + REG_FUNC(cellLv2dbg, sys_dbg_get_mutex_information); + REG_FUNC(cellLv2dbg, sys_dbg_get_lwmutex_information); + REG_FUNC(cellLv2dbg, sys_dbg_get_rwlock_information); + REG_FUNC(cellLv2dbg, sys_dbg_get_semaphore_information); + REG_FUNC(cellLv2dbg, sys_dbg_get_cond_information); + REG_FUNC(cellLv2dbg, sys_dbg_get_lwcond_information); + REG_FUNC(cellLv2dbg, sys_dbg_get_event_queue_information); + REG_FUNC(cellLv2dbg, sys_dbg_get_event_flag_information); - cellLv2dbg.AddFunc(0x580f8203, sys_dbg_vm_get_page_information); + REG_FUNC(cellLv2dbg, sys_dbg_vm_get_page_information); - cellLv2dbg.AddFunc(0x24a3d413, sys_dbg_mat_set_condition); - cellLv2dbg.AddFunc(0x590a276e, sys_dbg_mat_get_condition); + REG_FUNC(cellLv2dbg, sys_dbg_mat_set_condition); + REG_FUNC(cellLv2dbg, sys_dbg_mat_get_condition); - cellLv2dbg.AddFunc(0xd830062a, sys_dbg_signal_to_coredump_handler); - cellLv2dbg.AddFunc(0xb9da87d3, sys_dbg_get_coredump_params); + REG_FUNC(cellLv2dbg, sys_dbg_signal_to_coredump_handler); + REG_FUNC(cellLv2dbg, sys_dbg_get_coredump_params); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellMic.cpp b/rpcs3/Emu/SysCalls/Modules/cellMic.cpp index 59d6803df8..28833558aa 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMic.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMic.cpp @@ -290,51 +290,51 @@ void cellMic_unload() Module cellMic("cellMic", []() { - cellMic.AddFunc(0x8325e02d, cellMicInit); - cellMic.AddFunc(0xc6328caa, cellMicEnd); - cellMic.AddFunc(0xdd1b59f0, cellMicOpen); - cellMic.AddFunc(0x8d229f8e, cellMicClose); + REG_FUNC(cellMic, cellMicInit); + REG_FUNC(cellMic, cellMicEnd); + REG_FUNC(cellMic, cellMicOpen); + REG_FUNC(cellMic, cellMicClose); - cellMic.AddFunc(0x017024a8, cellMicGetDeviceGUID); - cellMic.AddFunc(0xa52d2ae4, cellMicGetType); - cellMic.AddFunc(0x1b42101b, cellMicIsAttached); - cellMic.AddFunc(0x186cb1fb, cellMicIsOpen); - cellMic.AddFunc(0x6a024aa0, cellMicGetDeviceAttr); - cellMic.AddFunc(0xb2c16321, cellMicSetDeviceAttr); - cellMic.AddFunc(0xac5ba03a, cellMicGetSignalAttr); - cellMic.AddFunc(0x323deb41, cellMicSetSignalAttr); - cellMic.AddFunc(0xb30780eb, cellMicGetSignalState); + REG_FUNC(cellMic, cellMicGetDeviceGUID); + REG_FUNC(cellMic, cellMicGetType); + REG_FUNC(cellMic, cellMicIsAttached); + REG_FUNC(cellMic, cellMicIsOpen); + REG_FUNC(cellMic, cellMicGetDeviceAttr); + REG_FUNC(cellMic, cellMicSetDeviceAttr); + REG_FUNC(cellMic, cellMicGetSignalAttr); + REG_FUNC(cellMic, cellMicSetSignalAttr); + REG_FUNC(cellMic, cellMicGetSignalState); - cellMic.AddFunc(0xdd724314, cellMicStart); - cellMic.AddFunc(0x07e1b12c, cellMicRead); - cellMic.AddFunc(0xfcfaf246, cellMicStop); - cellMic.AddFunc(0x6bc46aab, cellMicReset); + REG_FUNC(cellMic, cellMicStart); + REG_FUNC(cellMic, cellMicRead); + REG_FUNC(cellMic, cellMicStop); + REG_FUNC(cellMic, cellMicReset); - cellMic.AddFunc(0x7903400e, cellMicSetNotifyEventQueue); - cellMic.AddFunc(0x6cc7ae00, cellMicSetNotifyEventQueue2); - cellMic.AddFunc(0x65336418, cellMicRemoveNotifyEventQueue); + REG_FUNC(cellMic, cellMicSetNotifyEventQueue); + REG_FUNC(cellMic, cellMicSetNotifyEventQueue2); + REG_FUNC(cellMic, cellMicRemoveNotifyEventQueue); - cellMic.AddFunc(0x05709bbf, cellMicOpenEx); - cellMic.AddFunc(0xddd19a89, cellMicStartEx); - cellMic.AddFunc(0x4e0b69ee, cellMicGetFormatRaw); - cellMic.AddFunc(0xfda12276, cellMicGetFormatAux); - cellMic.AddFunc(0x87a08d29, cellMicGetFormatDsp); - cellMic.AddFunc(0xa42ac07a, cellMicOpenRaw); - cellMic.AddFunc(0x72165a7f, cellMicReadRaw); - cellMic.AddFunc(0x3acc118e, cellMicReadAux); - cellMic.AddFunc(0xc414faa5, cellMicReadDsp); + REG_FUNC(cellMic, cellMicOpenEx); + REG_FUNC(cellMic, cellMicStartEx); + REG_FUNC(cellMic, cellMicGetFormatRaw); + REG_FUNC(cellMic, cellMicGetFormatAux); + REG_FUNC(cellMic, cellMicGetFormatDsp); + REG_FUNC(cellMic, cellMicOpenRaw); + REG_FUNC(cellMic, cellMicReadRaw); + REG_FUNC(cellMic, cellMicReadAux); + REG_FUNC(cellMic, cellMicReadDsp); - cellMic.AddFunc(0x25c5723f, cellMicGetStatus); - cellMic.AddFunc(0xe839380f, cellMicStopEx); - cellMic.AddFunc(0x3ace58f3, cellMicSysShareClose); - cellMic.AddFunc(0x48108a23, cellMicGetFormat); - cellMic.AddFunc(0x891c6291, cellMicSetMultiMicNotifyEventQueue); - cellMic.AddFunc(0xad049ecf, cellMicGetFormatEx); - cellMic.AddFunc(0xbdfd51e2, cellMicSysShareStop); - cellMic.AddFunc(0xc3610dbd, cellMicSysShareOpen); - cellMic.AddFunc(0xc461563c, cellMicCommand); - cellMic.AddFunc(0xcac7e7d7, cellMicSysShareStart); - cellMic.AddFunc(0xd127cd3e, cellMicSysShareInit); - cellMic.AddFunc(0xf82bbf7c, cellMicSysShareEnd); - cellMic.AddFunc(0xfdbbe469, cellMicGetDeviceIdentifier); + REG_FUNC(cellMic, cellMicGetStatus); + REG_FUNC(cellMic, cellMicStopEx); + REG_FUNC(cellMic, cellMicSysShareClose); + REG_FUNC(cellMic, cellMicGetFormat); + REG_FUNC(cellMic, cellMicSetMultiMicNotifyEventQueue); + REG_FUNC(cellMic, cellMicGetFormatEx); + REG_FUNC(cellMic, cellMicSysShareStop); + REG_FUNC(cellMic, cellMicSysShareOpen); + REG_FUNC(cellMic, cellMicCommand); + REG_FUNC(cellMic, cellMicSysShareStart); + REG_FUNC(cellMic, cellMicSysShareInit); + REG_FUNC(cellMic, cellMicSysShareEnd); + REG_FUNC(cellMic, cellMicGetDeviceIdentifier); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp b/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp index 56945faf21..fc1cd1431f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp @@ -131,14 +131,14 @@ int cellMouseGetRawData(u32 port_no, u32 data_addr) void cellMouse_init() { - sys_io.AddFunc(0xc9030138, cellMouseInit); - sys_io.AddFunc(0x3ef66b95, cellMouseClearBuf); - sys_io.AddFunc(0xe10183ce, cellMouseEnd); - sys_io.AddFunc(0x5baf30fb, cellMouseGetInfo); - sys_io.AddFunc(0x4d0b3b1f, cellMouseInfoTabletMode); - sys_io.AddFunc(0x3138e632, cellMouseGetData); - sys_io.AddFunc(0x6bd131f0, cellMouseGetDataList); - sys_io.AddFunc(0x2d16da4f, cellMouseSetTabletMode); - sys_io.AddFunc(0x21a62e9b, cellMouseGetTabletDataList); - sys_io.AddFunc(0xa328cc35, cellMouseGetRawData); + REG_FUNC(sys_io, cellMouseInit); + REG_FUNC(sys_io, cellMouseClearBuf); + REG_FUNC(sys_io, cellMouseEnd); + REG_FUNC(sys_io, cellMouseGetInfo); + REG_FUNC(sys_io, cellMouseInfoTabletMode); + REG_FUNC(sys_io, cellMouseGetData); + REG_FUNC(sys_io, cellMouseGetDataList); + REG_FUNC(sys_io, cellMouseSetTabletMode); + REG_FUNC(sys_io, cellMouseGetTabletDataList); + REG_FUNC(sys_io, cellMouseGetRawData); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp b/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp index 82acd368b8..da47cfdcef 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp @@ -86,15 +86,15 @@ int cellMusicDecodeGetContentsId() void cellMusicDecode_init() { - cellMusicDecode.AddFunc(0xd55dbc11, cellMusicDecodeInitialize); - cellMusicDecode.AddFunc(0x84f154b2, cellMusicDecodeInitializeSystemWorkload); - cellMusicDecode.AddFunc(0xa8615dc8, cellMusicDecodeFinalize); - cellMusicDecode.AddFunc(0xf24cb963, cellMusicDecodeSelectContents); - cellMusicDecode.AddFunc(0x066bb1cf, cellMusicDecodeSetDecodeCommand); - cellMusicDecode.AddFunc(0x5af74c50, cellMusicDecodeGetDecodeStatus); - cellMusicDecode.AddFunc(0xa881b744, cellMusicDecodeRead); - cellMusicDecode.AddFunc(0xdbf70550, cellMusicDecodeGetSelectionContext); - cellMusicDecode.AddFunc(0xb84f5c81, cellMusicDecodeSetSelectionContext); - cellMusicDecode.AddFunc(0x58ab1999, cellMusicDecodeGetContentsId); + REG_FUNC(cellMusicDecode, cellMusicDecodeInitialize); + REG_FUNC(cellMusicDecode, cellMusicDecodeInitializeSystemWorkload); + REG_FUNC(cellMusicDecode, cellMusicDecodeFinalize); + REG_FUNC(cellMusicDecode, cellMusicDecodeSelectContents); + REG_FUNC(cellMusicDecode, cellMusicDecodeSetDecodeCommand); + REG_FUNC(cellMusicDecode, cellMusicDecodeGetDecodeStatus); + REG_FUNC(cellMusicDecode, cellMusicDecodeRead); + REG_FUNC(cellMusicDecode, cellMusicDecodeGetSelectionContext); + REG_FUNC(cellMusicDecode, cellMusicDecodeSetSelectionContext); + REG_FUNC(cellMusicDecode, cellMusicDecodeGetContentsId); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp b/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp index d8699348c6..0eccd57292 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp @@ -53,10 +53,10 @@ int cellMusicExportProgress() void cellMusicExport_init() { - cellMusicExport.AddFunc(0xb4c9b4f9, cellMusicExportInitialize); - cellMusicExport.AddFunc(0xe0443a44, cellMusicExportInitialize2); - cellMusicExport.AddFunc(0xe90effea, cellMusicExportFinalize); - cellMusicExport.AddFunc(0xb202f0e8, cellMusicExportFromFile); - cellMusicExport.AddFunc(0x92b50ebc, cellMusicExportProgress); + REG_FUNC(cellMusicExport, cellMusicExportInitialize); + REG_FUNC(cellMusicExport, cellMusicExportInitialize2); + REG_FUNC(cellMusicExport, cellMusicExportFinalize); + REG_FUNC(cellMusicExport, cellMusicExportFromFile); + REG_FUNC(cellMusicExport, cellMusicExportProgress); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp b/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp index ac6ba2ab74..5ea8f9c321 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp @@ -125,18 +125,18 @@ void cellNetCtl_unload() Module cellNetCtl("cellNetCtl", []() { - cellNetCtl.AddFunc(0xbd5a59fc, cellNetCtlInit); - cellNetCtl.AddFunc(0x105ee2cb, cellNetCtlTerm); + REG_FUNC(cellNetCtl, cellNetCtlInit); + REG_FUNC(cellNetCtl, cellNetCtlTerm); - cellNetCtl.AddFunc(0x8b3eba69, cellNetCtlGetState); - cellNetCtl.AddFunc(0x0ce13c6b, cellNetCtlAddHandler); - cellNetCtl.AddFunc(0x901815c3, cellNetCtlDelHandler); + REG_FUNC(cellNetCtl, cellNetCtlGetState); + REG_FUNC(cellNetCtl, cellNetCtlAddHandler); + REG_FUNC(cellNetCtl, cellNetCtlDelHandler); - cellNetCtl.AddFunc(0x1e585b5d, cellNetCtlGetInfo); + REG_FUNC(cellNetCtl, cellNetCtlGetInfo); - cellNetCtl.AddFunc(0x04459230, cellNetCtlNetStartDialogLoadAsync); - cellNetCtl.AddFunc(0x71d53210, cellNetCtlNetStartDialogAbortAsync); - cellNetCtl.AddFunc(0x0f1f13d3, cellNetCtlNetStartDialogUnloadAsync); + REG_FUNC(cellNetCtl, cellNetCtlNetStartDialogLoadAsync); + REG_FUNC(cellNetCtl, cellNetCtlNetStartDialogAbortAsync); + REG_FUNC(cellNetCtl, cellNetCtlNetStartDialogUnloadAsync); - cellNetCtl.AddFunc(0x3a12865f, cellNetCtlGetNatInfo); + REG_FUNC(cellNetCtl, cellNetCtlGetNatInfo); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp b/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp index 24b2e7162e..0c9c779f6a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp @@ -38,8 +38,8 @@ int cellOvisInvalidateOverlappedSegments() Module cellOvis("cellOvis", []() { - cellOvis.AddFunc(0x82f294b2, cellOvisGetOverlayTableSize); - cellOvis.AddFunc(0xa876c911, cellOvisInitializeOverlayTable); - cellOvis.AddFunc(0xce6cb776, cellOvisFixSpuSegments); - cellOvis.AddFunc(0x629ba0c0, cellOvisInvalidateOverlappedSegments); + REG_FUNC(cellOvis, cellOvisGetOverlayTableSize); + REG_FUNC(cellOvis, cellOvisInitializeOverlayTable); + REG_FUNC(cellOvis, cellOvisFixSpuSegments); + REG_FUNC(cellOvis, cellOvisInvalidateOverlappedSegments); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPad.cpp b/rpcs3/Emu/SysCalls/Modules/cellPad.cpp index 91aab2d96b..7b09ba37d7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPad.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPad.cpp @@ -528,23 +528,23 @@ s32 cellPadLddUnregisterController(s32 handle) void cellPad_init() { - sys_io.AddFunc(0x1cf98800, cellPadInit); - sys_io.AddFunc(0x4d9b75d5, cellPadEnd); - sys_io.AddFunc(0x0d5f2c14, cellPadClearBuf); - sys_io.AddFunc(0x8b72cda1, cellPadGetData); - sys_io.AddFunc(0x6bc09c61, cellPadGetDataExtra); - sys_io.AddFunc(0xf65544ee, cellPadSetActDirect); - sys_io.AddFunc(0x3aaad464, cellPadGetInfo); - sys_io.AddFunc(0xa703a51d, cellPadGetInfo2); - sys_io.AddFunc(0x4cc9b68d, cellPadPeriphGetInfo); - sys_io.AddFunc(0x578e3c98, cellPadSetPortSetting); - sys_io.AddFunc(0x0e2dfaad, cellPadInfoPressMode); - sys_io.AddFunc(0x78200559, cellPadInfoSensorMode); - sys_io.AddFunc(0xf83f8182, cellPadSetPressMode); - sys_io.AddFunc(0xbe5be3ba, cellPadSetSensorMode); - sys_io.AddFunc(0xdbf4c59c, cellPadGetCapabilityInfo); - sys_io.AddFunc(0x20a97ba2, cellPadLddRegisterController); - sys_io.AddFunc(0xbafd6409, cellPadLddDataInsert); - sys_io.AddFunc(0x8b8231e5, cellPadLddGetPortNo); - sys_io.AddFunc(0xe442faa8, cellPadLddUnregisterController); + REG_FUNC(sys_io, cellPadInit); + REG_FUNC(sys_io, cellPadEnd); + REG_FUNC(sys_io, cellPadClearBuf); + REG_FUNC(sys_io, cellPadGetData); + REG_FUNC(sys_io, cellPadGetDataExtra); + REG_FUNC(sys_io, cellPadSetActDirect); + REG_FUNC(sys_io, cellPadGetInfo); + REG_FUNC(sys_io, cellPadGetInfo2); + REG_FUNC(sys_io, cellPadPeriphGetInfo); + REG_FUNC(sys_io, cellPadSetPortSetting); + REG_FUNC(sys_io, cellPadInfoPressMode); + REG_FUNC(sys_io, cellPadInfoSensorMode); + REG_FUNC(sys_io, cellPadSetPressMode); + REG_FUNC(sys_io, cellPadSetSensorMode); + REG_FUNC(sys_io, cellPadGetCapabilityInfo); + REG_FUNC(sys_io, cellPadLddRegisterController); + REG_FUNC(sys_io, cellPadLddDataInsert); + REG_FUNC(sys_io, cellPadLddGetPortNo); + REG_FUNC(sys_io, cellPadLddUnregisterController); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp b/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp index d0c6d04863..22ad3eb8e8 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp @@ -736,27 +736,27 @@ s32 cellPamfEpIteratorMove(vm::ptr pIt, s32 steps, vm::ptr pTick0, vm::ptr pTick1) Module cellRtc("cellRtc", []() { - cellRtc.AddFunc(0x9dafc0d9, cellRtcGetCurrentTick); - cellRtc.AddFunc(0x32c941cf, cellRtcGetCurrentClock); - cellRtc.AddFunc(0x2cce9cf5, cellRtcGetCurrentClockLocalTime); + REG_FUNC(cellRtc, cellRtcGetCurrentTick); + REG_FUNC(cellRtc, cellRtcGetCurrentClock); + REG_FUNC(cellRtc, cellRtcGetCurrentClockLocalTime); - cellRtc.AddFunc(0x5491b9d5, cellRtcFormatRfc2822); - cellRtc.AddFunc(0xa07c3d2f, cellRtcFormatRfc2822LocalTime); - cellRtc.AddFunc(0xd9c0b463, cellRtcFormatRfc3339); - cellRtc.AddFunc(0x1324948a, cellRtcFormatRfc3339LocalTime); - cellRtc.AddFunc(0xc5bc0fac, cellRtcParseDateTime); - cellRtc.AddFunc(0xcf11c3d6, cellRtcParseRfc3339); + REG_FUNC(cellRtc, cellRtcFormatRfc2822); + REG_FUNC(cellRtc, cellRtcFormatRfc2822LocalTime); + REG_FUNC(cellRtc, cellRtcFormatRfc3339); + REG_FUNC(cellRtc, cellRtcFormatRfc3339LocalTime); + REG_FUNC(cellRtc, cellRtcParseDateTime); + REG_FUNC(cellRtc, cellRtcParseRfc3339); - cellRtc.AddFunc(0xc7bdb7eb, cellRtcGetTick); - cellRtc.AddFunc(0x99b13034, cellRtcSetTick); - cellRtc.AddFunc(0x269a1882, cellRtcTickAddTicks); - cellRtc.AddFunc(0xf8509925, cellRtcTickAddMicroseconds); - cellRtc.AddFunc(0xccce71bd, cellRtcTickAddSeconds); - cellRtc.AddFunc(0x2f010bfa, cellRtcTickAddMinutes); - cellRtc.AddFunc(0xd41d3bd2, cellRtcTickAddHours); - cellRtc.AddFunc(0x75744e2a, cellRtcTickAddDays); - cellRtc.AddFunc(0x64c63fd5, cellRtcTickAddWeeks); - cellRtc.AddFunc(0xe0ecbb45, cellRtcTickAddMonths); - cellRtc.AddFunc(0x332a74dd, cellRtcTickAddYears); - cellRtc.AddFunc(0xc48d5002, cellRtcConvertUtcToLocalTime); - cellRtc.AddFunc(0x46ca7fe0, cellRtcConvertLocalTimeToUtc); + REG_FUNC(cellRtc, cellRtcGetTick); + REG_FUNC(cellRtc, cellRtcSetTick); + REG_FUNC(cellRtc, cellRtcTickAddTicks); + REG_FUNC(cellRtc, cellRtcTickAddMicroseconds); + REG_FUNC(cellRtc, cellRtcTickAddSeconds); + REG_FUNC(cellRtc, cellRtcTickAddMinutes); + REG_FUNC(cellRtc, cellRtcTickAddHours); + REG_FUNC(cellRtc, cellRtcTickAddDays); + REG_FUNC(cellRtc, cellRtcTickAddWeeks); + REG_FUNC(cellRtc, cellRtcTickAddMonths); + REG_FUNC(cellRtc, cellRtcTickAddYears); + REG_FUNC(cellRtc, cellRtcConvertUtcToLocalTime); + REG_FUNC(cellRtc, cellRtcConvertLocalTimeToUtc); // (TODO: Time Information Manipulation Functions missing) - cellRtc.AddFunc(0xdfff32cf, cellRtcGetDosTime); - cellRtc.AddFunc(0xcb90c761, cellRtcGetTime_t); - cellRtc.AddFunc(0xe7086f05, cellRtcGetWin32FileTime); - cellRtc.AddFunc(0x9598d4b3, cellRtcSetDosTime); - cellRtc.AddFunc(0xbb543189, cellRtcSetTime_t); - cellRtc.AddFunc(0x5f68c268, cellRtcSetWin32FileTime); + REG_FUNC(cellRtc, cellRtcGetDosTime); + REG_FUNC(cellRtc, cellRtcGetTime_t); + REG_FUNC(cellRtc, cellRtcGetWin32FileTime); + REG_FUNC(cellRtc, cellRtcSetDosTime); + REG_FUNC(cellRtc, cellRtcSetTime_t); + REG_FUNC(cellRtc, cellRtcSetWin32FileTime); - cellRtc.AddFunc(0x5316b4a8, cellRtcIsLeapYear); - cellRtc.AddFunc(0x5b6a0a1d, cellRtcGetDaysInMonth); - cellRtc.AddFunc(0xc2d8cf95, cellRtcGetDayOfWeek); - cellRtc.AddFunc(0x7f1086e6, cellRtcCheckValid); + REG_FUNC(cellRtc, cellRtcIsLeapYear); + REG_FUNC(cellRtc, cellRtcGetDaysInMonth); + REG_FUNC(cellRtc, cellRtcGetDayOfWeek); + REG_FUNC(cellRtc, cellRtcCheckValid); - cellRtc.AddFunc(0xfb51fc61, cellRtcCompareTick); + REG_FUNC(cellRtc, cellRtcCompareTick); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp index c7b59517ed..1a3051f881 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp @@ -218,40 +218,40 @@ int cellRudpProcessEvents() void cellRudp_init() { - cellRudp.AddFunc(0x63f63545, cellRudpInit); - cellRudp.AddFunc(0xb6bcb4a1, cellRudpEnd); - cellRudp.AddFunc(0x6c0cff03, cellRudpEnableInternalIOThread); - cellRudp.AddFunc(0x7ed95e60, cellRudpSetEventHandler); - cellRudp.AddFunc(0x54f81789, cellRudpSetMaxSegmentSize); - cellRudp.AddFunc(0xfbf7e9e4, cellRudpGetMaxSegmentSize); + REG_FUNC(cellRudp, cellRudpInit); + REG_FUNC(cellRudp, cellRudpEnd); + REG_FUNC(cellRudp, cellRudpEnableInternalIOThread); + REG_FUNC(cellRudp, cellRudpSetEventHandler); + REG_FUNC(cellRudp, cellRudpSetMaxSegmentSize); + REG_FUNC(cellRudp, cellRudpGetMaxSegmentSize); - cellRudp.AddFunc(0x7dadc739, cellRudpCreateContext); - cellRudp.AddFunc(0x384ba777, cellRudpSetOption); - cellRudp.AddFunc(0xff9d259c, cellRudpGetOption); + REG_FUNC(cellRudp, cellRudpCreateContext); + REG_FUNC(cellRudp, cellRudpSetOption); + REG_FUNC(cellRudp, cellRudpGetOption); - cellRudp.AddFunc(0x74bfad12, cellRudpGetContextStatus); - cellRudp.AddFunc(0xcd1a3f23, cellRudpGetStatus); - cellRudp.AddFunc(0xd666931f, cellRudpGetLocalInfo); - cellRudp.AddFunc(0x576831ae, cellRudpGetRemoteInfo); + REG_FUNC(cellRudp, cellRudpGetContextStatus); + REG_FUNC(cellRudp, cellRudpGetStatus); + REG_FUNC(cellRudp, cellRudpGetLocalInfo); + REG_FUNC(cellRudp, cellRudpGetRemoteInfo); - cellRudp.AddFunc(0xee41e16a, cellRudpBind); - cellRudp.AddFunc(0xc407844f, cellRudpInitiate); - cellRudp.AddFunc(0xc1ad7ced, cellRudpActivate); - cellRudp.AddFunc(0x48d3eeac, cellRudpTerminate); + REG_FUNC(cellRudp, cellRudpBind); + REG_FUNC(cellRudp, cellRudpInitiate); + REG_FUNC(cellRudp, cellRudpActivate); + REG_FUNC(cellRudp, cellRudpTerminate); - cellRudp.AddFunc(0x92e4d899, cellRudpRead); - cellRudp.AddFunc(0x48c001b0, cellRudpWrite); - cellRudp.AddFunc(0x2cde989f, cellRudpGetSizeReadable); - cellRudp.AddFunc(0xa86b28e3, cellRudpGetSizeWritable); - cellRudp.AddFunc(0xa70737da, cellRudpFlush); + REG_FUNC(cellRudp, cellRudpRead); + REG_FUNC(cellRudp, cellRudpWrite); + REG_FUNC(cellRudp, cellRudpGetSizeReadable); + REG_FUNC(cellRudp, cellRudpGetSizeWritable); + REG_FUNC(cellRudp, cellRudpFlush); - cellRudp.AddFunc(0x6bc587e9, cellRudpPollCreate); - cellRudp.AddFunc(0x8ac398f1, cellRudpPollDestroy); - cellRudp.AddFunc(0xa3db855c, cellRudpPollControl); - cellRudp.AddFunc(0xd8310700, cellRudpPollWait); + REG_FUNC(cellRudp, cellRudpPollCreate); + REG_FUNC(cellRudp, cellRudpPollDestroy); + REG_FUNC(cellRudp, cellRudpPollControl); + REG_FUNC(cellRudp, cellRudpPollWait); //cellRudp.AddFunc(, cellRudpPollCancel); - cellRudp.AddFunc(0x6ee04954, cellRudpNetReceived); - cellRudp.AddFunc(0xfade48b2, cellRudpProcessEvents); + REG_FUNC(cellRudp, cellRudpNetReceived); + REG_FUNC(cellRudp, cellRudpProcessEvents); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp index 77c71102db..8132afd92e 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp @@ -880,141 +880,141 @@ int cellSailPlayerUnregisterSource() Module cellSail("cellSail", []() { - cellSail.AddFunc(0x346ebba3, cellSailMemAllocatorInitialize); + REG_FUNC(cellSail, cellSailMemAllocatorInitialize); - cellSail.AddFunc(0x4cc54f8e, cellSailFutureInitialize); - cellSail.AddFunc(0x9553af65, cellSailFutureFinalize); - cellSail.AddFunc(0x0c4cb439, cellSailFutureReset); - cellSail.AddFunc(0xa37fed15, cellSailFutureSet); - cellSail.AddFunc(0x3a2d806c, cellSailFutureGet); - cellSail.AddFunc(0x51ecf361, cellSailFutureIsDone); + REG_FUNC(cellSail, cellSailFutureInitialize); + REG_FUNC(cellSail, cellSailFutureFinalize); + REG_FUNC(cellSail, cellSailFutureReset); + REG_FUNC(cellSail, cellSailFutureSet); + REG_FUNC(cellSail, cellSailFutureGet); + REG_FUNC(cellSail, cellSailFutureIsDone); - cellSail.AddFunc(0xd5f9a15b, cellSailDescriptorGetStreamType); - cellSail.AddFunc(0x4c191088, cellSailDescriptorGetUri); - cellSail.AddFunc(0xbd1635f4, cellSailDescriptorGetMediaInfo); - cellSail.AddFunc(0x76b1a425, cellSailDescriptorSetAutoSelection); - cellSail.AddFunc(0x277adf21, cellSailDescriptorIsAutoSelection); - cellSail.AddFunc(0x0abb318b, cellSailDescriptorCreateDatabase); - cellSail.AddFunc(0x28336e89, cellSailDescriptorDestroyDatabase); - cellSail.AddFunc(0xc044fab1, cellSailDescriptorOpen); - cellSail.AddFunc(0x15fd6a2a, cellSailDescriptorClose); - cellSail.AddFunc(0x0d0c2f0c, cellSailDescriptorSetEs); - cellSail.AddFunc(0xdf5553ef, cellSailDescriptorClearEs); - cellSail.AddFunc(0xac9c3b1f, cellSailDescriptorGetCapabilities); - cellSail.AddFunc(0x92590d52, cellSailDescriptorInquireCapability); - cellSail.AddFunc(0xee94b99b, cellSailDescriptorSetParameter); + REG_FUNC(cellSail, cellSailDescriptorGetStreamType); + REG_FUNC(cellSail, cellSailDescriptorGetUri); + REG_FUNC(cellSail, cellSailDescriptorGetMediaInfo); + REG_FUNC(cellSail, cellSailDescriptorSetAutoSelection); + REG_FUNC(cellSail, cellSailDescriptorIsAutoSelection); + REG_FUNC(cellSail, cellSailDescriptorCreateDatabase); + REG_FUNC(cellSail, cellSailDescriptorDestroyDatabase); + REG_FUNC(cellSail, cellSailDescriptorOpen); + REG_FUNC(cellSail, cellSailDescriptorClose); + REG_FUNC(cellSail, cellSailDescriptorSetEs); + REG_FUNC(cellSail, cellSailDescriptorClearEs); + REG_FUNC(cellSail, cellSailDescriptorGetCapabilities); + REG_FUNC(cellSail, cellSailDescriptorInquireCapability); + REG_FUNC(cellSail, cellSailDescriptorSetParameter); - cellSail.AddFunc(0x3d0d3b72, cellSailSoundAdapterInitialize); - cellSail.AddFunc(0xd1462438, cellSailSoundAdapterFinalize); - cellSail.AddFunc(0x1c9d5e5a, cellSailSoundAdapterSetPreferredFormat); - cellSail.AddFunc(0x7eb8d6b5, cellSailSoundAdapterGetFrame); - cellSail.AddFunc(0xf25f197d, cellSailSoundAdapterGetFormat); - cellSail.AddFunc(0xeec22809, cellSailSoundAdapterUpdateAvSync); - cellSail.AddFunc(0x4ae979df, cellSailSoundAdapterPtsToTimePosition); + REG_FUNC(cellSail, cellSailSoundAdapterInitialize); + REG_FUNC(cellSail, cellSailSoundAdapterFinalize); + REG_FUNC(cellSail, cellSailSoundAdapterSetPreferredFormat); + REG_FUNC(cellSail, cellSailSoundAdapterGetFrame); + REG_FUNC(cellSail, cellSailSoundAdapterGetFormat); + REG_FUNC(cellSail, cellSailSoundAdapterUpdateAvSync); + REG_FUNC(cellSail, cellSailSoundAdapterPtsToTimePosition); - cellSail.AddFunc(0x1c983864, cellSailGraphicsAdapterInitialize); - cellSail.AddFunc(0x76488bb1, cellSailGraphicsAdapterFinalize); - cellSail.AddFunc(0x2e3ccb5e, cellSailGraphicsAdapterSetPreferredFormat); - cellSail.AddFunc(0x0247c69e, cellSailGraphicsAdapterGetFrame); - cellSail.AddFunc(0x018281a8, cellSailGraphicsAdapterGetFrame2); - cellSail.AddFunc(0xffd58aa4, cellSailGraphicsAdapterGetFormat); - cellSail.AddFunc(0x44a20e79, cellSailGraphicsAdapterUpdateAvSync); - cellSail.AddFunc(0x1872331b, cellSailGraphicsAdapterPtsToTimePosition); + REG_FUNC(cellSail, cellSailGraphicsAdapterInitialize); + REG_FUNC(cellSail, cellSailGraphicsAdapterFinalize); + REG_FUNC(cellSail, cellSailGraphicsAdapterSetPreferredFormat); + REG_FUNC(cellSail, cellSailGraphicsAdapterGetFrame); + REG_FUNC(cellSail, cellSailGraphicsAdapterGetFrame2); + REG_FUNC(cellSail, cellSailGraphicsAdapterGetFormat); + REG_FUNC(cellSail, cellSailGraphicsAdapterUpdateAvSync); + REG_FUNC(cellSail, cellSailGraphicsAdapterPtsToTimePosition); - cellSail.AddFunc(0x3dd9639a, cellSailAuReceiverInitialize); - cellSail.AddFunc(0xed58e3ec, cellSailAuReceiverFinalize); - cellSail.AddFunc(0x3a1132ed, cellSailAuReceiverGet); + REG_FUNC(cellSail, cellSailAuReceiverInitialize); + REG_FUNC(cellSail, cellSailAuReceiverFinalize); + REG_FUNC(cellSail, cellSailAuReceiverGet); - cellSail.AddFunc(0x67b4d01f, cellSailRendererAudioInitialize); - cellSail.AddFunc(0x06dd4174, cellSailRendererAudioFinalize); - cellSail.AddFunc(0xb7b4ecee, cellSailRendererAudioNotifyCallCompleted); - cellSail.AddFunc(0xf841a537, cellSailRendererAudioNotifyFrameDone); - cellSail.AddFunc(0x325039b9, cellSailRendererAudioNotifyOutputEos); + REG_FUNC(cellSail, cellSailRendererAudioInitialize); + REG_FUNC(cellSail, cellSailRendererAudioFinalize); + REG_FUNC(cellSail, cellSailRendererAudioNotifyCallCompleted); + REG_FUNC(cellSail, cellSailRendererAudioNotifyFrameDone); + REG_FUNC(cellSail, cellSailRendererAudioNotifyOutputEos); - cellSail.AddFunc(0x8d1ff475, cellSailRendererVideoInitialize); - cellSail.AddFunc(0x47055fea, cellSailRendererVideoFinalize); - cellSail.AddFunc(0x954f48f8, cellSailRendererVideoNotifyCallCompleted); - cellSail.AddFunc(0x5f77e8df, cellSailRendererVideoNotifyFrameDone); - cellSail.AddFunc(0xdff1cda2, cellSailRendererVideoNotifyOutputEos); + REG_FUNC(cellSail, cellSailRendererVideoInitialize); + REG_FUNC(cellSail, cellSailRendererVideoFinalize); + REG_FUNC(cellSail, cellSailRendererVideoNotifyCallCompleted); + REG_FUNC(cellSail, cellSailRendererVideoNotifyFrameDone); + REG_FUNC(cellSail, cellSailRendererVideoNotifyOutputEos); - cellSail.AddFunc(0x9d30bdce, cellSailSourceInitialize); - cellSail.AddFunc(0xee724c99, cellSailSourceFinalize); - cellSail.AddFunc(0x764ec2d2, cellSailSourceNotifyCallCompleted); - cellSail.AddFunc(0x54c53688, cellSailSourceNotifyInputEos); - cellSail.AddFunc(0x95ee1695, cellSailSourceNotifyStreamOut); - cellSail.AddFunc(0xf289f0cd, cellSailSourceNotifySessionError); - cellSail.AddFunc(0xf4009a94, cellSailSourceNotifyMediaStateChanged); + REG_FUNC(cellSail, cellSailSourceInitialize); + REG_FUNC(cellSail, cellSailSourceFinalize); + REG_FUNC(cellSail, cellSailSourceNotifyCallCompleted); + REG_FUNC(cellSail, cellSailSourceNotifyInputEos); + REG_FUNC(cellSail, cellSailSourceNotifyStreamOut); + REG_FUNC(cellSail, cellSailSourceNotifySessionError); + REG_FUNC(cellSail, cellSailSourceNotifyMediaStateChanged); //cellSail.AddFunc(, cellSailSourceCheck); - cellSail.AddFunc(0x3df98d41, cellSailSourceNotifyOpenCompleted); - cellSail.AddFunc(0x640c7278, cellSailSourceNotifyStartCompleted); - cellSail.AddFunc(0x7473970a, cellSailSourceNotifyStopCompleted); - cellSail.AddFunc(0x946ecca0, cellSailSourceNotifyReadCompleted); - cellSail.AddFunc(0xbdb2251a, cellSailSourceSetDiagHandler); - cellSail.AddFunc(0xc457b203, cellSailSourceNotifyCloseCompleted); + REG_FUNC(cellSail, cellSailSourceNotifyOpenCompleted); + REG_FUNC(cellSail, cellSailSourceNotifyStartCompleted); + REG_FUNC(cellSail, cellSailSourceNotifyStopCompleted); + REG_FUNC(cellSail, cellSailSourceNotifyReadCompleted); + REG_FUNC(cellSail, cellSailSourceSetDiagHandler); + REG_FUNC(cellSail, cellSailSourceNotifyCloseCompleted); - cellSail.AddFunc(0xb980b76e, cellSailMp4MovieGetBrand); - cellSail.AddFunc(0xd4049de0, cellSailMp4MovieIsCompatibleBrand); - cellSail.AddFunc(0x5783a454, cellSailMp4MovieGetMovieInfo); - cellSail.AddFunc(0x5faf802b, cellSailMp4MovieGetTrackByIndex); - cellSail.AddFunc(0x85b07126, cellSailMp4MovieGetTrackById); - cellSail.AddFunc(0xc2d90ec9, cellSailMp4MovieGetTrackByTypeAndIndex); - cellSail.AddFunc(0xa48be428, cellSailMp4TrackGetTrackInfo); - cellSail.AddFunc(0x72236ec1, cellSailMp4TrackGetTrackReferenceCount); - cellSail.AddFunc(0x5f44f64f, cellSailMp4TrackGetTrackReference); + REG_FUNC(cellSail, cellSailMp4MovieGetBrand); + REG_FUNC(cellSail, cellSailMp4MovieIsCompatibleBrand); + REG_FUNC(cellSail, cellSailMp4MovieGetMovieInfo); + REG_FUNC(cellSail, cellSailMp4MovieGetTrackByIndex); + REG_FUNC(cellSail, cellSailMp4MovieGetTrackById); + REG_FUNC(cellSail, cellSailMp4MovieGetTrackByTypeAndIndex); + REG_FUNC(cellSail, cellSailMp4TrackGetTrackInfo); + REG_FUNC(cellSail, cellSailMp4TrackGetTrackReferenceCount); + REG_FUNC(cellSail, cellSailMp4TrackGetTrackReference); //cellSail.AddFunc(, cellSailMp4ConvertTimeScale); - cellSail.AddFunc(0x6e83f5c0, cellSailAviMovieGetMovieInfo); - cellSail.AddFunc(0x3e908c56, cellSailAviMovieGetStreamByIndex); - cellSail.AddFunc(0xddebd2a5, cellSailAviMovieGetStreamByTypeAndIndex); - cellSail.AddFunc(0x10298371, cellSailAviMovieGetHeader); - cellSail.AddFunc(0xc09e2f23, cellSailAviStreamGetMediaType); - cellSail.AddFunc(0xcc3cca60, cellSailAviStreamGetHeader); + REG_FUNC(cellSail, cellSailAviMovieGetMovieInfo); + REG_FUNC(cellSail, cellSailAviMovieGetStreamByIndex); + REG_FUNC(cellSail, cellSailAviMovieGetStreamByTypeAndIndex); + REG_FUNC(cellSail, cellSailAviMovieGetHeader); + REG_FUNC(cellSail, cellSailAviStreamGetMediaType); + REG_FUNC(cellSail, cellSailAviStreamGetHeader); - cellSail.AddFunc(0x17932b26, cellSailPlayerInitialize); - cellSail.AddFunc(0x23654375, cellSailPlayerInitialize2); - cellSail.AddFunc(0x18b4629d, cellSailPlayerFinalize); - cellSail.AddFunc(0xbedccc74, cellSailPlayerRegisterSource); - cellSail.AddFunc(0x186b98d3, cellSailPlayerGetRegisteredProtocols); - cellSail.AddFunc(0x1139a206, cellSailPlayerSetSoundAdapter); - cellSail.AddFunc(0x18bcd21b, cellSailPlayerSetGraphicsAdapter); - cellSail.AddFunc(0xf5747e1f, cellSailPlayerSetAuReceiver); - cellSail.AddFunc(0x92eaf6ca, cellSailPlayerSetRendererAudio); - cellSail.AddFunc(0xecf56150, cellSailPlayerSetRendererVideo); - cellSail.AddFunc(0x5f7c7a6f, cellSailPlayerSetParameter); - cellSail.AddFunc(0x952269c9, cellSailPlayerGetParameter); - cellSail.AddFunc(0x6f0b1002, cellSailPlayerSubscribeEvent); - cellSail.AddFunc(0x69793952, cellSailPlayerUnsubscribeEvent); - cellSail.AddFunc(0x47632810, cellSailPlayerReplaceEventHandler); - cellSail.AddFunc(0xbdf21b0f, cellSailPlayerBoot); - cellSail.AddFunc(0xd7938b8d, cellSailPlayerCreateDescriptor); - cellSail.AddFunc(0xfc839bd4, cellSailPlayerDestroyDescriptor); - cellSail.AddFunc(0x7c8dff3b, cellSailPlayerAddDescriptor); - cellSail.AddFunc(0x9897fbd1, cellSailPlayerRemoveDescriptor); - cellSail.AddFunc(0x752f8585, cellSailPlayerGetDescriptorCount); - cellSail.AddFunc(0x75fca288, cellSailPlayerGetCurrentDescriptor); - cellSail.AddFunc(0x34ecc1b9, cellSailPlayerOpenStream); - cellSail.AddFunc(0x85beffcc, cellSailPlayerCloseStream); - cellSail.AddFunc(0x145f9b11, cellSailPlayerOpenEsAudio); - cellSail.AddFunc(0x477501f6, cellSailPlayerOpenEsVideo); - cellSail.AddFunc(0xa849d0a7, cellSailPlayerOpenEsUser); - cellSail.AddFunc(0x4fa5ad09, cellSailPlayerReopenEsAudio); - cellSail.AddFunc(0xf60a8a69, cellSailPlayerReopenEsVideo); - cellSail.AddFunc(0x7b6fa92e, cellSailPlayerReopenEsUser); - cellSail.AddFunc(0xbf9b8d72, cellSailPlayerCloseEsAudio); - cellSail.AddFunc(0x07924359, cellSailPlayerCloseEsVideo); - cellSail.AddFunc(0xaed9d6cd, cellSailPlayerCloseEsUser); - cellSail.AddFunc(0xe535b0d3, cellSailPlayerStart); - cellSail.AddFunc(0xeba8d4ec, cellSailPlayerStop); - cellSail.AddFunc(0x26563ddc, cellSailPlayerNext); - cellSail.AddFunc(0x950d53c1, cellSailPlayerCancel); - cellSail.AddFunc(0xd1d55a90, cellSailPlayerSetPaused); - cellSail.AddFunc(0xaafa17b8, cellSailPlayerIsPaused); - cellSail.AddFunc(0xfc5baf8a, cellSailPlayerSetRepeatMode); - cellSail.AddFunc(0x38144ecf, cellSailPlayerGetRepeatMode); - cellSail.AddFunc(0x91d287f6, cellSailPlayerSetEsAudioMuted); - cellSail.AddFunc(0xf1446a40, cellSailPlayerSetEsVideoMuted); - cellSail.AddFunc(0x09de25fd, cellSailPlayerIsEsAudioMuted); - cellSail.AddFunc(0xdbe32ed4, cellSailPlayerIsEsVideoMuted); - cellSail.AddFunc(0xcc987ba6, cellSailPlayerDumpImage); - cellSail.AddFunc(0x025b4974, cellSailPlayerUnregisterSource); + REG_FUNC(cellSail, cellSailPlayerInitialize); + REG_FUNC(cellSail, cellSailPlayerInitialize2); + REG_FUNC(cellSail, cellSailPlayerFinalize); + REG_FUNC(cellSail, cellSailPlayerRegisterSource); + REG_FUNC(cellSail, cellSailPlayerGetRegisteredProtocols); + REG_FUNC(cellSail, cellSailPlayerSetSoundAdapter); + REG_FUNC(cellSail, cellSailPlayerSetGraphicsAdapter); + REG_FUNC(cellSail, cellSailPlayerSetAuReceiver); + REG_FUNC(cellSail, cellSailPlayerSetRendererAudio); + REG_FUNC(cellSail, cellSailPlayerSetRendererVideo); + REG_FUNC(cellSail, cellSailPlayerSetParameter); + REG_FUNC(cellSail, cellSailPlayerGetParameter); + REG_FUNC(cellSail, cellSailPlayerSubscribeEvent); + REG_FUNC(cellSail, cellSailPlayerUnsubscribeEvent); + REG_FUNC(cellSail, cellSailPlayerReplaceEventHandler); + REG_FUNC(cellSail, cellSailPlayerBoot); + REG_FUNC(cellSail, cellSailPlayerCreateDescriptor); + REG_FUNC(cellSail, cellSailPlayerDestroyDescriptor); + REG_FUNC(cellSail, cellSailPlayerAddDescriptor); + REG_FUNC(cellSail, cellSailPlayerRemoveDescriptor); + REG_FUNC(cellSail, cellSailPlayerGetDescriptorCount); + REG_FUNC(cellSail, cellSailPlayerGetCurrentDescriptor); + REG_FUNC(cellSail, cellSailPlayerOpenStream); + REG_FUNC(cellSail, cellSailPlayerCloseStream); + REG_FUNC(cellSail, cellSailPlayerOpenEsAudio); + REG_FUNC(cellSail, cellSailPlayerOpenEsVideo); + REG_FUNC(cellSail, cellSailPlayerOpenEsUser); + REG_FUNC(cellSail, cellSailPlayerReopenEsAudio); + REG_FUNC(cellSail, cellSailPlayerReopenEsVideo); + REG_FUNC(cellSail, cellSailPlayerReopenEsUser); + REG_FUNC(cellSail, cellSailPlayerCloseEsAudio); + REG_FUNC(cellSail, cellSailPlayerCloseEsVideo); + REG_FUNC(cellSail, cellSailPlayerCloseEsUser); + REG_FUNC(cellSail, cellSailPlayerStart); + REG_FUNC(cellSail, cellSailPlayerStop); + REG_FUNC(cellSail, cellSailPlayerNext); + REG_FUNC(cellSail, cellSailPlayerCancel); + REG_FUNC(cellSail, cellSailPlayerSetPaused); + REG_FUNC(cellSail, cellSailPlayerIsPaused); + REG_FUNC(cellSail, cellSailPlayerSetRepeatMode); + REG_FUNC(cellSail, cellSailPlayerGetRepeatMode); + REG_FUNC(cellSail, cellSailPlayerSetEsAudioMuted); + REG_FUNC(cellSail, cellSailPlayerSetEsVideoMuted); + REG_FUNC(cellSail, cellSailPlayerIsEsAudioMuted); + REG_FUNC(cellSail, cellSailPlayerIsEsVideoMuted); + REG_FUNC(cellSail, cellSailPlayerDumpImage); + REG_FUNC(cellSail, cellSailPlayerUnregisterSource); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp b/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp index ba88dd083c..3a23954543 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp @@ -239,50 +239,50 @@ int cellSailRecorderDumpImage() void cellSailRec_init() { - cellSailRec.AddFunc(0xe14cae97, cellSailProfileSetEsAudioParameter); - cellSailRec.AddFunc(0x1422a425, cellSailProfileSetEsVideoParameter); - cellSailRec.AddFunc(0xe8d86c43, cellSailProfileSetStreamParameter); + REG_FUNC(cellSailRec, cellSailProfileSetEsAudioParameter); + REG_FUNC(cellSailRec, cellSailProfileSetEsVideoParameter); + REG_FUNC(cellSailRec, cellSailProfileSetStreamParameter); - cellSailRec.AddFunc(0xb3d30b0d, cellSailVideoConverterCanProcess); - cellSailRec.AddFunc(0x855da8c6, cellSailVideoConverterProcess); - cellSailRec.AddFunc(0xe16de678, cellSailVideoConverterCanGetResult); - cellSailRec.AddFunc(0xe15679fe, cellSailVideoConverterGetResult); + REG_FUNC(cellSailRec, cellSailVideoConverterCanProcess); + REG_FUNC(cellSailRec, cellSailVideoConverterProcess); + REG_FUNC(cellSailRec, cellSailVideoConverterCanGetResult); + REG_FUNC(cellSailRec, cellSailVideoConverterGetResult); //cellSailRec.AddFunc(, CellSailVideoConverterFuncProcessDone); - cellSailRec.AddFunc(0xbd591197, cellSailFeederAudioInitialize); - cellSailRec.AddFunc(0x899d1587, cellSailFeederAudioFinalize); - cellSailRec.AddFunc(0xc2e2f30d, cellSailFeederAudioNotifyCallCompleted); - cellSailRec.AddFunc(0x3c775cea, cellSailFeederAudioNotifyFrameOut); - cellSailRec.AddFunc(0x999c0dc5, cellSailFeederAudioNotifySessionEnd); - cellSailRec.AddFunc(0xaf310ae6, cellSailFeederAudioNotifySessionError); + REG_FUNC(cellSailRec, cellSailFeederAudioInitialize); + REG_FUNC(cellSailRec, cellSailFeederAudioFinalize); + REG_FUNC(cellSailRec, cellSailFeederAudioNotifyCallCompleted); + REG_FUNC(cellSailRec, cellSailFeederAudioNotifyFrameOut); + REG_FUNC(cellSailRec, cellSailFeederAudioNotifySessionEnd); + REG_FUNC(cellSailRec, cellSailFeederAudioNotifySessionError); - cellSailRec.AddFunc(0x57415dd3, cellSailFeederVideoInitialize); - cellSailRec.AddFunc(0x81bfeae8, cellSailFeederVideoFinalize); - cellSailRec.AddFunc(0xd84daeb9, cellSailFeederVideoNotifyCallCompleted); - cellSailRec.AddFunc(0xe5e0572a, cellSailFeederVideoNotifyFrameOut); - cellSailRec.AddFunc(0xbff6e8d3, cellSailFeederVideoNotifySessionEnd); - cellSailRec.AddFunc(0x86cae679, cellSailFeederVideoNotifySessionError); + REG_FUNC(cellSailRec, cellSailFeederVideoInitialize); + REG_FUNC(cellSailRec, cellSailFeederVideoFinalize); + REG_FUNC(cellSailRec, cellSailFeederVideoNotifyCallCompleted); + REG_FUNC(cellSailRec, cellSailFeederVideoNotifyFrameOut); + REG_FUNC(cellSailRec, cellSailFeederVideoNotifySessionEnd); + REG_FUNC(cellSailRec, cellSailFeederVideoNotifySessionError); - cellSailRec.AddFunc(0x7a52bf69, cellSailRecorderInitialize); - cellSailRec.AddFunc(0xf57d74e3, cellSailRecorderFinalize); - cellSailRec.AddFunc(0x3deae857, cellSailRecorderSetFeederAudio); - cellSailRec.AddFunc(0x4fec43a9, cellSailRecorderSetFeederVideo); - cellSailRec.AddFunc(0x0a3ea2a9, cellSailRecorderSetParameter); - cellSailRec.AddFunc(0xff20157b, cellSailRecorderGetParameter); + REG_FUNC(cellSailRec, cellSailRecorderInitialize); + REG_FUNC(cellSailRec, cellSailRecorderFinalize); + REG_FUNC(cellSailRec, cellSailRecorderSetFeederAudio); + REG_FUNC(cellSailRec, cellSailRecorderSetFeederVideo); + REG_FUNC(cellSailRec, cellSailRecorderSetParameter); + REG_FUNC(cellSailRec, cellSailRecorderGetParameter); //cellSailRec.AddFunc(, cellSailRecorderSubscribeEvent); //cellSailRec.AddFunc(, cellSailRecorderUnsubscribeEvent); //cellSailRec.AddFunc(, cellSailRecorderReplaceEventHandler); - cellSailRec.AddFunc(0xc4617ddc, cellSailRecorderBoot); - cellSailRec.AddFunc(0x50affdc1, cellSailRecorderCreateProfile); - cellSailRec.AddFunc(0x376c3926, cellSailRecorderDestroyProfile); - cellSailRec.AddFunc(0x49476a3d, cellSailRecorderCreateVideoConverter); - cellSailRec.AddFunc(0x455c4709, cellSailRecorderDestroyVideoConverter); - cellSailRec.AddFunc(0x10c81457, cellSailRecorderOpenStream); - cellSailRec.AddFunc(0xe3f56f62, cellSailRecorderCloseStream); - cellSailRec.AddFunc(0x4830faf8, cellSailRecorderStart); - cellSailRec.AddFunc(0x18ecc741, cellSailRecorderStop); - cellSailRec.AddFunc(0xd37fb694, cellSailRecorderCancel); + REG_FUNC(cellSailRec, cellSailRecorderBoot); + REG_FUNC(cellSailRec, cellSailRecorderCreateProfile); + REG_FUNC(cellSailRec, cellSailRecorderDestroyProfile); + REG_FUNC(cellSailRec, cellSailRecorderCreateVideoConverter); + REG_FUNC(cellSailRec, cellSailRecorderDestroyVideoConverter); + REG_FUNC(cellSailRec, cellSailRecorderOpenStream); + REG_FUNC(cellSailRec, cellSailRecorderCloseStream); + REG_FUNC(cellSailRec, cellSailRecorderStart); + REG_FUNC(cellSailRec, cellSailRecorderStop); + REG_FUNC(cellSailRec, cellSailRecorderCancel); - cellSailRec.AddFunc(0x37aad85f, cellSailRecorderDumpImage); + REG_FUNC(cellSailRec, cellSailRecorderDumpImage); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp index 52df2aa113..146b6ae9ce 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp @@ -31,8 +31,8 @@ s32 cellScreenShotDisable() Module cellScreenshot("cellScreenshot", []() { - cellScreenshot.AddFunc(0xd3ad63e4, cellScreenShotSetParameter); - cellScreenshot.AddFunc(0x7a9c2243, cellScreenShotSetOverlayImage); - cellScreenshot.AddFunc(0x9e33ab8f, cellScreenShotEnable); - cellScreenshot.AddFunc(0xfc6f4e74, cellScreenShotDisable); -}); + REG_FUNC(cellScreenshot, cellScreenShotSetParameter); + REG_FUNC(cellScreenshot, cellScreenShotSetOverlayImage); + REG_FUNC(cellScreenshot, cellScreenShotEnable); + REG_FUNC(cellScreenshot, cellScreenShotDisable); +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp index 7f9b8e9abe..f5426e1023 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp @@ -153,24 +153,24 @@ s32 cellSearchEnd() Module cellSearch("cellSearch", []() { - cellSearch.AddFunc(0xc81ccf8a, cellSearchInitialize); - cellSearch.AddFunc(0xbfab7616, cellSearchFinalize); - cellSearch.AddFunc(0x0a4c8295, cellSearchStartListSearch); - cellSearch.AddFunc(0x64fb0b76, cellSearchStartContentSearchInList); - cellSearch.AddFunc(0x0591826f, cellSearchStartContentSearch); - cellSearch.AddFunc(0xc0ed0522, cellSearchStartSceneSearchInVideo); - cellSearch.AddFunc(0x13524faa, cellSearchStartSceneSearch); - cellSearch.AddFunc(0x3b210319, cellSearchGetContentInfoByOffset); - cellSearch.AddFunc(0x9663a44b, cellSearchGetContentInfoByContentId); - cellSearch.AddFunc(0x540d9068, cellSearchGetOffsetByContentId); - cellSearch.AddFunc(0x94e21701, cellSearchGetContentIdByOffset); - cellSearch.AddFunc(0xd7a7a433, cellSearchGetContentInfoGameComment); - cellSearch.AddFunc(0x025ce169, cellSearchGetMusicSelectionContext); - cellSearch.AddFunc(0xed20e079, cellSearchGetMusicSelectionContextOfSingleTrack); - cellSearch.AddFunc(0xffb28491, cellSearchGetContentInfoPath); - cellSearch.AddFunc(0x37b5ba0c, cellSearchGetContentInfoPathMovieThumb); - cellSearch.AddFunc(0xe73cb0d2, cellSearchPrepareFile); - cellSearch.AddFunc(0x35cda406, cellSearchGetContentInfoDeveloperData); - cellSearch.AddFunc(0x8fe376a6, cellSearchCancel); - cellSearch.AddFunc(0x774033d6, cellSearchEnd); -}); + REG_FUNC(cellSearch, cellSearchInitialize); + REG_FUNC(cellSearch, cellSearchFinalize); + REG_FUNC(cellSearch, cellSearchStartListSearch); + REG_FUNC(cellSearch, cellSearchStartContentSearchInList); + REG_FUNC(cellSearch, cellSearchStartContentSearch); + REG_FUNC(cellSearch, cellSearchStartSceneSearchInVideo); + REG_FUNC(cellSearch, cellSearchStartSceneSearch); + REG_FUNC(cellSearch, cellSearchGetContentInfoByOffset); + REG_FUNC(cellSearch, cellSearchGetContentInfoByContentId); + REG_FUNC(cellSearch, cellSearchGetOffsetByContentId); + REG_FUNC(cellSearch, cellSearchGetContentIdByOffset); + REG_FUNC(cellSearch, cellSearchGetContentInfoGameComment); + REG_FUNC(cellSearch, cellSearchGetMusicSelectionContext); + REG_FUNC(cellSearch, cellSearchGetMusicSelectionContextOfSingleTrack); + REG_FUNC(cellSearch, cellSearchGetContentInfoPath); + REG_FUNC(cellSearch, cellSearchGetContentInfoPathMovieThumb); + REG_FUNC(cellSearch, cellSearchPrepareFile); + REG_FUNC(cellSearch, cellSearchGetContentInfoDeveloperData); + REG_FUNC(cellSearch, cellSearchCancel); + REG_FUNC(cellSearch, cellSearchEnd); +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp b/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp index c29c7e6781..5f6982b496 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp @@ -123,26 +123,26 @@ int cellKeySheapQueueDelete() void cellSheap_init() { - cellSheap.AddFunc(0xbbb47cd8, cellSheapInitialize); - cellSheap.AddFunc(0x4b1383fb, cellSheapAllocate); - cellSheap.AddFunc(0x5c5994bd, cellSheapFree); - cellSheap.AddFunc(0x37968718, cellSheapQueryMax); - cellSheap.AddFunc(0x7fa23275, cellSheapQueryFree); + REG_FUNC(cellSheap, cellSheapInitialize); + REG_FUNC(cellSheap, cellSheapAllocate); + REG_FUNC(cellSheap, cellSheapFree); + REG_FUNC(cellSheap, cellSheapQueryMax); + REG_FUNC(cellSheap, cellSheapQueryFree); // (TODO: Some cellKeySheap* functions are missing) - cellSheap.AddFunc(0xa1b25841, cellKeySheapInitialize); - cellSheap.AddFunc(0x4a5b9659, cellKeySheapBufferNew); - cellSheap.AddFunc(0xe6b37362, cellKeySheapBufferDelete); + REG_FUNC(cellSheap, cellKeySheapInitialize); + REG_FUNC(cellSheap, cellKeySheapBufferNew); + REG_FUNC(cellSheap, cellKeySheapBufferDelete); - cellSheap.AddFunc(0x3478e1e6, cellKeySheapMutexNew); - cellSheap.AddFunc(0x2452679f, cellKeySheapMutexDelete); - cellSheap.AddFunc(0xe897c835, cellKeySheapBarrierNew); - cellSheap.AddFunc(0xf6f5fbca, cellKeySheapBarrierDelete); - cellSheap.AddFunc(0x69a5861d, cellKeySheapSemaphoreNew); - cellSheap.AddFunc(0x73a45cf8, cellKeySheapSemaphoreDelete); - cellSheap.AddFunc(0xf01ac471, cellKeySheapRwmNew); - cellSheap.AddFunc(0xed136702, cellKeySheapRwmDelete); - cellSheap.AddFunc(0x987e260e, cellKeySheapQueueNew); - cellSheap.AddFunc(0x79a6abd0, cellKeySheapQueueDelete); + REG_FUNC(cellSheap, cellKeySheapMutexNew); + REG_FUNC(cellSheap, cellKeySheapMutexDelete); + REG_FUNC(cellSheap, cellKeySheapBarrierNew); + REG_FUNC(cellSheap, cellKeySheapBarrierDelete); + REG_FUNC(cellSheap, cellKeySheapSemaphoreNew); + REG_FUNC(cellSheap, cellKeySheapSemaphoreDelete); + REG_FUNC(cellSheap, cellKeySheapRwmNew); + REG_FUNC(cellSheap, cellKeySheapRwmDelete); + REG_FUNC(cellSheap, cellKeySheapQueueNew); + REG_FUNC(cellSheap, cellKeySheapQueueDelete); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp b/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp index cd6d3b7e45..3b53c3a142 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp @@ -90,21 +90,21 @@ int cellSslCertGetMd5Fingerprint() void cellSsl_init() { - cellSsl.AddFunc(0xfb02c9d2, cellSslInit); - cellSsl.AddFunc(0x1650aea4, cellSslEnd); + REG_FUNC(cellSsl, cellSslInit); + REG_FUNC(cellSsl, cellSslEnd); - cellSsl.AddFunc(0x571afaca, cellSslCertificateLoader); + REG_FUNC(cellSsl, cellSslCertificateLoader); - cellSsl.AddFunc(0x7b689ebc, cellSslCertGetSerialNumber); - cellSsl.AddFunc(0xf8206492, cellSslCertGetPublicKey); - cellSsl.AddFunc(0x8e505175, cellSslCertGetRsaPublicKeyModulus); - cellSsl.AddFunc(0x033c4905, cellSslCertGetRsaPublicKeyExponent); - cellSsl.AddFunc(0x31d9ba8d, cellSslCertGetNotBefore); - cellSsl.AddFunc(0x218b64da, cellSslCertGetNotAfter); - cellSsl.AddFunc(0x32c61bdf, cellSslCertGetSubjectName); - cellSsl.AddFunc(0xae6eb491, cellSslCertGetIssuerName); - cellSsl.AddFunc(0x766d3ca1, cellSslCertGetNameEntryCount); - cellSsl.AddFunc(0x006c4900, cellSslCertGetNameEntryInfo); - cellSsl.AddFunc(0x5e9253ca, cellSslCertGetMd5Fingerprint); + REG_FUNC(cellSsl, cellSslCertGetSerialNumber); + REG_FUNC(cellSsl, cellSslCertGetPublicKey); + REG_FUNC(cellSsl, cellSslCertGetRsaPublicKeyModulus); + REG_FUNC(cellSsl, cellSslCertGetRsaPublicKeyExponent); + REG_FUNC(cellSsl, cellSslCertGetNotBefore); + REG_FUNC(cellSsl, cellSslCertGetNotAfter); + REG_FUNC(cellSsl, cellSslCertGetSubjectName); + REG_FUNC(cellSsl, cellSslCertGetIssuerName); + REG_FUNC(cellSsl, cellSslCertGetNameEntryCount); + REG_FUNC(cellSsl, cellSslCertGetNameEntryInfo); + REG_FUNC(cellSsl, cellSslCertGetMd5Fingerprint); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp b/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp index b5d389ff32..5e642a01b5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp @@ -76,16 +76,16 @@ int cellSubDisplayGetPeerList() Module cellSubdisplay("cellSubdisplay", []() { - cellSubdisplay.AddFunc(0xf9a7e8a5, cellSubDisplayInit); - cellSubdisplay.AddFunc(0x551d80a5, cellSubDisplayEnd); - cellSubdisplay.AddFunc(0x6595ce22, cellSubDisplayGetRequiredMemory); - cellSubdisplay.AddFunc(0xa5bccb47, cellSubDisplayStart); - cellSubdisplay.AddFunc(0x6d85ddb3, cellSubDisplayStop); + REG_FUNC(cellSubdisplay, cellSubDisplayInit); + REG_FUNC(cellSubdisplay, cellSubDisplayEnd); + REG_FUNC(cellSubdisplay, cellSubDisplayGetRequiredMemory); + REG_FUNC(cellSubdisplay, cellSubDisplayStart); + REG_FUNC(cellSubdisplay, cellSubDisplayStop); - cellSubdisplay.AddFunc(0x938ac642, cellSubDisplayGetVideoBuffer); - cellSubdisplay.AddFunc(0xaee1e0c2, cellSubDisplayAudioOutBlocking); - cellSubdisplay.AddFunc(0x5468d6b0, cellSubDisplayAudioOutNonBlocking); + REG_FUNC(cellSubdisplay, cellSubDisplayGetVideoBuffer); + REG_FUNC(cellSubdisplay, cellSubDisplayAudioOutBlocking); + REG_FUNC(cellSubdisplay, cellSubDisplayAudioOutNonBlocking); - cellSubdisplay.AddFunc(0x8a264d71, cellSubDisplayGetPeerNum); - cellSubdisplay.AddFunc(0xe2485f79, cellSubDisplayGetPeerList); + REG_FUNC(cellSubdisplay, cellSubDisplayGetPeerNum); + REG_FUNC(cellSubdisplay, cellSubDisplayGetPeerList); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 0894a4e53b..6e3f4af9dc 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -1858,50 +1858,50 @@ s32 _cellSyncLFQueueDetachLv2EventQueue(vm::ptr spus, u32 num, vm::ptr listNum, vm::ptr list Module cellUserInfo("cellUserInfo", []() { - cellUserInfo.AddFunc(0x2b761140, cellUserInfoGetStat); - cellUserInfo.AddFunc(0x3097cc1c, cellUserInfoSelectUser_ListType); - cellUserInfo.AddFunc(0x55123a25, cellUserInfoSelectUser_SetList); - cellUserInfo.AddFunc(0xb3516536, cellUserInfoEnableOverlay); - cellUserInfo.AddFunc(0xc55e338b, cellUserInfoGetList); + REG_FUNC(cellUserInfo, cellUserInfoGetStat); + REG_FUNC(cellUserInfo, cellUserInfoSelectUser_ListType); + REG_FUNC(cellUserInfo, cellUserInfoSelectUser_SetList); + REG_FUNC(cellUserInfo, cellUserInfoEnableOverlay); + REG_FUNC(cellUserInfo, cellUserInfoGetList); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index 9bd76dacc0..b99cae0696 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -889,15 +889,15 @@ int cellVdecSetFrameRate(u32 handle, CellVdecFrameRate frc) Module cellVdec("cellVdec", []() { - cellVdec.AddFunc(0xff6f6ebe, cellVdecQueryAttr); - cellVdec.AddFunc(0xc982a84a, cellVdecQueryAttrEx); - cellVdec.AddFunc(0xb6bbcd5d, cellVdecOpen); - cellVdec.AddFunc(0x0053e2d8, cellVdecOpenEx); - cellVdec.AddFunc(0x16698e83, cellVdecClose); - cellVdec.AddFunc(0xc757c2aa, cellVdecStartSeq); - cellVdec.AddFunc(0x824433f0, cellVdecEndSeq); - cellVdec.AddFunc(0x2bf4ddd2, cellVdecDecodeAu); - cellVdec.AddFunc(0x807c861a, cellVdecGetPicture); - cellVdec.AddFunc(0x17c702b9, cellVdecGetPicItem); - cellVdec.AddFunc(0xe13ef6fc, cellVdecSetFrameRate); + REG_FUNC(cellVdec, cellVdecQueryAttr); + REG_FUNC(cellVdec, cellVdecQueryAttrEx); + REG_FUNC(cellVdec, cellVdecOpen); + REG_FUNC(cellVdec, cellVdecOpenEx); + REG_FUNC(cellVdec, cellVdecClose); + REG_FUNC(cellVdec, cellVdecStartSeq); + REG_FUNC(cellVdec, cellVdecEndSeq); + REG_FUNC(cellVdec, cellVdecDecodeAu); + REG_FUNC(cellVdec, cellVdecGetPicture); + REG_FUNC(cellVdec, cellVdecGetPicItem); + REG_FUNC(cellVdec, cellVdecSetFrameRate); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp b/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp index 1b568231fd..6268fc3357 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp @@ -233,39 +233,39 @@ int cellVoiceDebugTopology() void cellVoice_init() { - cellVoice.AddFunc(0xae6a21d5, cellVoiceConnectIPortToOPort); - cellVoice.AddFunc(0x2a01013e, cellVoiceCreateNotifyEventQueue); - cellVoice.AddFunc(0x2de54871, cellVoiceCreatePort); - cellVoice.AddFunc(0x9f70c475, cellVoiceDeletePort); - cellVoice.AddFunc(0x18d3df30, cellVoiceDisconnectIPortFromOPort); - cellVoice.AddFunc(0xe0e1ae12, cellVoiceEnd); - cellVoice.AddFunc(0xbef53a2b, cellVoiceGetBitRate); - cellVoice.AddFunc(0x474609e2, cellVoiceGetMuteFlag); - cellVoice.AddFunc(0xf629ed67, cellVoiceGetPortAttr); - cellVoice.AddFunc(0x54ac3519, cellVoiceGetPortInfo); - cellVoice.AddFunc(0xd6811aa7, cellVoiceGetSignalState); - cellVoice.AddFunc(0x762dc193, cellVoiceGetVolume); - cellVoice.AddFunc(0xc7cf1182, cellVoiceInit); - cellVoice.AddFunc(0xb1a2c38f, cellVoiceInitEx); - cellVoice.AddFunc(0x87c71b06, cellVoicePausePort); - cellVoice.AddFunc(0xd14e784d, cellVoicePausePortAll); - cellVoice.AddFunc(0xdd000886, cellVoiceRemoveNotifyEventQueue); - cellVoice.AddFunc(0xff0fa43a, cellVoiceResetPort); - cellVoice.AddFunc(0x7bf17b15, cellVoiceResumePort); - cellVoice.AddFunc(0x7f3963f7, cellVoiceResumePortAll); - cellVoice.AddFunc(0x7e60adc6, cellVoiceSetBitRate); - cellVoice.AddFunc(0xdde35a0c, cellVoiceSetMuteFlag); - cellVoice.AddFunc(0xd4d80ea5, cellVoiceSetMuteFlagAll); - cellVoice.AddFunc(0x35d84910, cellVoiceSetNotifyEventQueue); - cellVoice.AddFunc(0x9d0f4af1, cellVoiceSetPortAttr); - cellVoice.AddFunc(0xd5ae37d8, cellVoiceSetVolume); - cellVoice.AddFunc(0x0a563878, cellVoiceStart); - cellVoice.AddFunc(0x94d51f92, cellVoiceStartEx); - cellVoice.AddFunc(0xd3a84be1, cellVoiceStop); - cellVoice.AddFunc(0x2f24fea3, cellVoiceUpdatePort); - cellVoice.AddFunc(0x3dad26e7, cellVoiceWriteToIPort); - cellVoice.AddFunc(0x30f0b5ab, cellVoiceWriteToIPortEx); - cellVoice.AddFunc(0x36472c57, cellVoiceReadFromOPort); - cellVoice.AddFunc(0x20bafe31, cellVoiceDebugTopology); + REG_FUNC(cellVoice, cellVoiceConnectIPortToOPort); + REG_FUNC(cellVoice, cellVoiceCreateNotifyEventQueue); + REG_FUNC(cellVoice, cellVoiceCreatePort); + REG_FUNC(cellVoice, cellVoiceDeletePort); + REG_FUNC(cellVoice, cellVoiceDisconnectIPortFromOPort); + REG_FUNC(cellVoice, cellVoiceEnd); + REG_FUNC(cellVoice, cellVoiceGetBitRate); + REG_FUNC(cellVoice, cellVoiceGetMuteFlag); + REG_FUNC(cellVoice, cellVoiceGetPortAttr); + REG_FUNC(cellVoice, cellVoiceGetPortInfo); + REG_FUNC(cellVoice, cellVoiceGetSignalState); + REG_FUNC(cellVoice, cellVoiceGetVolume); + REG_FUNC(cellVoice, cellVoiceInit); + REG_FUNC(cellVoice, cellVoiceInitEx); + REG_FUNC(cellVoice, cellVoicePausePort); + REG_FUNC(cellVoice, cellVoicePausePortAll); + REG_FUNC(cellVoice, cellVoiceRemoveNotifyEventQueue); + REG_FUNC(cellVoice, cellVoiceResetPort); + REG_FUNC(cellVoice, cellVoiceResumePort); + REG_FUNC(cellVoice, cellVoiceResumePortAll); + REG_FUNC(cellVoice, cellVoiceSetBitRate); + REG_FUNC(cellVoice, cellVoiceSetMuteFlag); + REG_FUNC(cellVoice, cellVoiceSetMuteFlagAll); + REG_FUNC(cellVoice, cellVoiceSetNotifyEventQueue); + REG_FUNC(cellVoice, cellVoiceSetPortAttr); + REG_FUNC(cellVoice, cellVoiceSetVolume); + REG_FUNC(cellVoice, cellVoiceStart); + REG_FUNC(cellVoice, cellVoiceStartEx); + REG_FUNC(cellVoice, cellVoiceStop); + REG_FUNC(cellVoice, cellVoiceUpdatePort); + REG_FUNC(cellVoice, cellVoiceWriteToIPort); + REG_FUNC(cellVoice, cellVoiceWriteToIPortEx); + REG_FUNC(cellVoice, cellVoiceReadFromOPort); + REG_FUNC(cellVoice, cellVoiceDebugTopology); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp index eb0cad507e..bd681ef0bf 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp @@ -150,9 +150,9 @@ int cellVpostExec(u32 handle, vm::ptr inPicBuff, vm::ptr config) port.channel = 8; port.block = 16; port.attr = 0; - port.level = 1.0f; + port.addr = g_audio.buffer + AUDIO_PORT_OFFSET * g_surmx.audio_port; + port.read_index_addr = g_audio.indexes + sizeof(u64) * g_surmx.audio_port; + port.size = port.channel * port.block * AUDIO_SAMPLES * sizeof(float); port.tag = 0; + port.level = 1.0f; + port.level_set = 1.0f; + port.level_inc = 0.0f; - libmixer.Warning("*** audio port opened(default)"); + libmixer.Warning("*** audio port opened (port=%d)", g_surmx.audio_port); mixcount = 0; surMixerCb.set(0); @@ -628,6 +633,11 @@ Module libmixer("libmixer", []() { g_surmx.audio_port = ~0; + libmixer.on_stop = []() + { + ssp.clear(); + }; + REG_SUB(libmixer, "surmxAAN", cellAANAddData, 0xffffffff7c691b78, 0xffffffff7c0802a6, diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp index 729305be2c..fcd948c3b0 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp @@ -1645,232 +1645,232 @@ void sceNp_unload() Module sceNp("sceNp", []() { - sceNp.AddFunc(0xbd28fdbf, sceNpInit); - sceNp.AddFunc(0x41251f74, sceNp2Init); - sceNp.AddFunc(0xc2ced2b7, sceNpUtilBandwidthTestInitStart); - sceNp.AddFunc(0x4885aa18, sceNpTerm); - sceNp.AddFunc(0xaadb7c12, sceNp2Term); - sceNp.AddFunc(0x432b3cbf, sceNpUtilBandwidthTestShutdown); - 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(0xaa16695f, sceNpDrmProcessExitSpawn); - sceNp.AddFunc(0xe6c8f3f9, sceNpDrmProcessExitSpawn2); - sceNp.AddFunc(0xbcc09fe7, sceNpBasicRegisterHandler); - sceNp.AddFunc(0x4026eac5, sceNpBasicRegisterContextSensitiveHandler); - sceNp.AddFunc(0xacb9ee8e, sceNpBasicUnregisterHandler); - sceNp.AddFunc(0x3f0808aa, sceNpBasicSetPresence); - sceNp.AddFunc(0xbe81c71c, sceNpBasicSetPresenceDetails); - sceNp.AddFunc(0x5e849303, sceNpBasicSetPresenceDetails2); - sceNp.AddFunc(0xec0a1fbf, sceNpBasicSendMessage); - sceNp.AddFunc(0x01fbbc9b, sceNpBasicSendMessageGui); - sceNp.AddFunc(0x43b989f5, sceNpBasicSendMessageAttachment); - sceNp.AddFunc(0xb5cb2d56, sceNpBasicRecvMessageAttachment); - sceNp.AddFunc(0x64a704cc, sceNpBasicRecvMessageAttachmentLoad); - sceNp.AddFunc(0x806960ab, sceNpBasicRecvMessageCustom); - sceNp.AddFunc(0xe1c9f675, sceNpBasicMarkMessageAsUsed); - sceNp.AddFunc(0x481ce0e8, sceNpBasicAbortGui); - sceNp.AddFunc(0x27c69eba, sceNpBasicAddFriend); - sceNp.AddFunc(0xafef640d, sceNpBasicGetFriendListEntryCount); - sceNp.AddFunc(0x04372385, sceNpBasicGetFriendListEntry); - sceNp.AddFunc(0x32c78a6a, sceNpBasicGetFriendPresenceByIndex); - sceNp.AddFunc(0x6453b27b, sceNpBasicGetFriendPresenceByIndex2); - sceNp.AddFunc(0xfd39ae13, sceNpBasicGetFriendPresenceByNpId); - sceNp.AddFunc(0x260caedd, sceNpBasicGetFriendPresenceByNpId2); - sceNp.AddFunc(0x168a3117, sceNpBasicAddPlayersHistory); - sceNp.AddFunc(0xbcdbb2ab, sceNpBasicAddPlayersHistoryAsync); - sceNp.AddFunc(0xa15f35fe, sceNpBasicGetPlayersHistoryEntryCount); - sceNp.AddFunc(0xbab91fc9, sceNpBasicGetPlayersHistoryEntry); - sceNp.AddFunc(0x1ae8a549, sceNpBasicAddBlockListEntry); - sceNp.AddFunc(0x73931bd0, sceNpBasicGetBlockListEntryCount); - sceNp.AddFunc(0xf2b3338a, sceNpBasicGetBlockListEntry); - sceNp.AddFunc(0x9153bdf4, sceNpBasicGetMessageAttachmentEntryCount); - sceNp.AddFunc(0x5d543bbe, sceNpBasicGetMessageAttachmentEntry); - sceNp.AddFunc(0xa8afa7d4, sceNpBasicGetCustomInvitationEntryCount); - sceNp.AddFunc(0xd053f113, sceNpBasicGetCustomInvitationEntry); - sceNp.AddFunc(0xaf505def, sceNpBasicGetMatchingInvitationEntryCount); - sceNp.AddFunc(0x05af1cb8, sceNpBasicGetMatchingInvitationEntry); - sceNp.AddFunc(0xbf607ec6, sceNpBasicGetClanMessageEntryCount); - sceNp.AddFunc(0x4d9c615d, sceNpBasicGetClanMessageEntry); - sceNp.AddFunc(0xecd503de, sceNpBasicGetMessageEntryCount); - sceNp.AddFunc(0x30d1cbde, sceNpBasicGetMessageEntry); - sceNp.AddFunc(0xe035f7d6, sceNpBasicGetEvent); - sceNp.AddFunc(0xfcac355a, sceNpCommerceCreateCtx); - sceNp.AddFunc(0xe2877bea, sceNpCommerceDestroyCtx); - sceNp.AddFunc(0x8d1d096c, sceNpCommerceInitProductCategory); - sceNp.AddFunc(0x6cb81eb2, sceNpCommerceDestroyProductCategory); - sceNp.AddFunc(0x26f33146, sceNpCommerceGetProductCategoryStart); - sceNp.AddFunc(0xcfd469e4, sceNpCommerceGetProductCategoryFinish); - sceNp.AddFunc(0x3f195b3a, sceNpCommerceGetProductCategoryResult); - sceNp.AddFunc(0x674bb9ff, sceNpCommerceGetProductCategoryAbort); - sceNp.AddFunc(0x936df4aa, sceNpCommerceGetProductId); - sceNp.AddFunc(0xeb5f2544, sceNpCommerceGetProductName); - sceNp.AddFunc(0x359642a6, sceNpCommerceGetCategoryDescription); - sceNp.AddFunc(0xaee8cf71, sceNpCommerceGetCategoryId); - sceNp.AddFunc(0x9452f4f8, sceNpCommerceGetCategoryImageURL); - sceNp.AddFunc(0xeb9df054, sceNpCommerceGetCategoryInfo); - sceNp.AddFunc(0x6e2ab18b, sceNpCommerceGetCategoryName); - sceNp.AddFunc(0x79225aa3, sceNpCommerceGetCurrencyCode); - sceNp.AddFunc(0xaf57d9c9, sceNpCommerceGetCurrencyDecimals); - sceNp.AddFunc(0xb1c02d66, sceNpCommerceGetCurrencyInfo); - sceNp.AddFunc(0x2be41ece, sceNpCommerceGetNumOfChildCategory); - sceNp.AddFunc(0x7208dc08, sceNpCommerceGetNumOfChildProductSku); - sceNp.AddFunc(0xa85a4951, sceNpCommerceGetSkuDescription); - sceNp.AddFunc(0x39a69619, sceNpCommerceGetSkuId); - sceNp.AddFunc(0xccbe2e69, sceNpCommerceGetSkuImageURL); - sceNp.AddFunc(0xee530059, sceNpCommerceGetSkuName); - sceNp.AddFunc(0x78d7f9ad, sceNpCommerceGetSkuPrice); - sceNp.AddFunc(0x1a3fcb69, sceNpCommerceGetSkuUserData); - sceNp.AddFunc(0x99ac9952, sceNpCommerceSetDataFlagStart); - sceNp.AddFunc(0xdbdb909f, sceNpCommerceGetDataFlagStart); - sceNp.AddFunc(0x8d4518a0, sceNpCommerceSetDataFlagFinish); - sceNp.AddFunc(0x9281e87a, sceNpCommerceGetDataFlagFinish); - sceNp.AddFunc(0xd03cea35, sceNpCommerceGetDataFlagState); - sceNp.AddFunc(0x0561448b, sceNpCommerceGetDataFlagAbort); - sceNp.AddFunc(0xba65de6d, sceNpCommerceGetChildCategoryInfo); - sceNp.AddFunc(0x01cd9cfd, sceNpCommerceGetChildProductSkuInfo); - sceNp.AddFunc(0xe36c660e, sceNpCommerceDoCheckoutStartAsync); - sceNp.AddFunc(0xaf3eba5a, sceNpCommerceDoCheckoutFinishAsync); - sceNp.AddFunc(0x45f8f3aa, sceNpCustomMenuRegisterActions); - sceNp.AddFunc(0xf9732ac8, sceNpCustomMenuActionSetActivation); - sceNp.AddFunc(0x9458f464, sceNpCustomMenuRegisterExceptionList); - sceNp.AddFunc(0xf0a9182b, sceNpFriendlist); - sceNp.AddFunc(0xd7fb1fa6, sceNpFriendlistCustom); - sceNp.AddFunc(0xf59e1da8, sceNpFriendlistAbortGui); - sceNp.AddFunc(0x5f2d9257, sceNpLookupInit); - sceNp.AddFunc(0x8440537c, sceNpLookupTerm); - sceNp.AddFunc(0xce81c7f0, sceNpLookupCreateTitleCtx); - sceNp.AddFunc(0x5de61626, sceNpLookupDestroyTitleCtx); - sceNp.AddFunc(0xea2e9ffc, sceNpLookupCreateTransactionCtx); - sceNp.AddFunc(0xfb87cf5e, sceNpLookupDestroyTransactionCtx); - sceNp.AddFunc(0x71e5af7e, sceNpLookupSetTimeout); - sceNp.AddFunc(0x3d1760dc, sceNpLookupAbortTransaction); - sceNp.AddFunc(0xd737fd2d, sceNpLookupWaitAsync); - sceNp.AddFunc(0x7508112e, sceNpLookupPollAsync); - sceNp.AddFunc(0x166dcc11, sceNpLookupNpId); - sceNp.AddFunc(0xd12e40ae, sceNpLookupNpIdAsync); - sceNp.AddFunc(0xdfd63b62, sceNpLookupUserProfile); - sceNp.AddFunc(0xff0a2378, sceNpLookupUserProfileAsync); - sceNp.AddFunc(0x2fccbfe0, sceNpLookupUserProfileWithAvatarSize); - sceNp.AddFunc(0x1fdb3ec2, sceNpLookupUserProfileWithAvatarSizeAsync); - sceNp.AddFunc(0xb6017827, sceNpLookupAvatarImage); - sceNp.AddFunc(0xbf9eea93, sceNpLookupAvatarImageAsync); - sceNp.AddFunc(0x9ee9f97e, sceNpLookupTitleStorage); - sceNp.AddFunc(0x5e117ed5, sceNpLookupTitleStorageAsync); - sceNp.AddFunc(0xca39c4b2, sceNpLookupTitleSmallStorage); - sceNp.AddFunc(0x860b1756, sceNpLookupTitleSmallStorageAsync); - sceNp.AddFunc(0xe7dcd3b4, sceNpManagerRegisterCallback); - sceNp.AddFunc(0x52a6b523, sceNpManagerUnregisterCallback); - sceNp.AddFunc(0xa7bff757, sceNpManagerGetStatus); - sceNp.AddFunc(0xbdc07fd5, sceNpManagerGetNetworkTime); - sceNp.AddFunc(0xbe07c708, sceNpManagerGetOnlineId); - sceNp.AddFunc(0xfe37a7f4, sceNpManagerGetNpId); - sceNp.AddFunc(0xf42c0df8, sceNpManagerGetOnlineName); - sceNp.AddFunc(0x36d0c2c5, sceNpManagerGetAvatarUrl); - sceNp.AddFunc(0x32200389, sceNpManagerGetMyLanguages); - sceNp.AddFunc(0xb1e0718b, sceNpManagerGetAccountRegion); - sceNp.AddFunc(0x168fcece, sceNpManagerGetAccountAge); - sceNp.AddFunc(0x6ee62ed2, sceNpManagerGetContentRatingFlag); - sceNp.AddFunc(0xeb7a3d84, sceNpManagerGetChatRestrictionFlag); - sceNp.AddFunc(0x4b9efb7a, sceNpManagerGetCachedInfo); - sceNp.AddFunc(0x16f88a6f, sceNpManagerGetPsHandle); - sceNp.AddFunc(0x7e2fef28, sceNpManagerRequestTicket); - sceNp.AddFunc(0x8297f1ec, sceNpManagerRequestTicket2); - sceNp.AddFunc(0x0968aa36, sceNpManagerGetTicket); - sceNp.AddFunc(0x58fa4fcd, sceNpManagerGetTicketParam); - sceNp.AddFunc(0xb66d1c46, sceNpManagerGetEntitlementIdList); - sceNp.AddFunc(0xa1709abd, sceNpManagerGetEntitlementById); - sceNp.AddFunc(0x442381f7, sceNpManagerSubSignin); - sceNp.AddFunc(0x60440c73, sceNpManagerSubSigninAbortGui); - sceNp.AddFunc(0x000e53cc, sceNpManagerSubSignout); - sceNp.AddFunc(0xac66568c, sceNpMatchingCreateCtx); - sceNp.AddFunc(0x2e1c5068, sceNpMatchingDestroyCtx); - sceNp.AddFunc(0x03c741a7, sceNpMatchingGetResult); - sceNp.AddFunc(0x26b3bc94, sceNpMatchingGetResultGUI); - sceNp.AddFunc(0x6f8fd267, sceNpMatchingSetRoomInfo); - sceNp.AddFunc(0x4a18a89e, sceNpMatchingSetRoomInfoNoLimit); - sceNp.AddFunc(0x691f429d, sceNpMatchingGetRoomInfo); - sceNp.AddFunc(0xb020684e, sceNpMatchingGetRoomInfoNoLimit); - sceNp.AddFunc(0xa284bd1d, sceNpMatchingSetRoomSearchFlag); - sceNp.AddFunc(0xee64cf8e, sceNpMatchingGetRoomSearchFlag); - sceNp.AddFunc(0x73a2e36b, sceNpMatchingGetRoomMemberListLocal); - sceNp.AddFunc(0xe24eea19, sceNpMatchingGetRoomListLimitGUI); - sceNp.AddFunc(0x34cc0ca4, sceNpMatchingKickRoomMember); - sceNp.AddFunc(0xd20d7798, sceNpMatchingKickRoomMemberWithOpt); - sceNp.AddFunc(0x14497465, sceNpMatchingQuickMatchGUI); - sceNp.AddFunc(0x8b7bbd73, sceNpMatchingSendInvitationGUI); - sceNp.AddFunc(0x2ad7837d, sceNpMatchingAcceptInvitationGUI); - sceNp.AddFunc(0x3cc8588a, sceNpMatchingCreateRoomGUI); - sceNp.AddFunc(0x474b7b13, sceNpMatchingJoinRoomGUI); - sceNp.AddFunc(0xf806c54c, sceNpMatchingLeaveRoom); - sceNp.AddFunc(0x32febb4c, sceNpMatchingSearchJoinRoomGUI); - sceNp.AddFunc(0xdae2d351, sceNpMatchingGrantOwnership); - sceNp.AddFunc(0xceeebc7a, sceNpProfileCallGui); - sceNp.AddFunc(0x2f2c6b3e, sceNpProfileAbortGui); - sceNp.AddFunc(0x32cf311f, sceNpScoreInit); - sceNp.AddFunc(0x9851f805, sceNpScoreTerm); - sceNp.AddFunc(0xb9f93bbb, sceNpScoreCreateTitleCtx); - sceNp.AddFunc(0x259113b8, sceNpScoreDestroyTitleCtx); - sceNp.AddFunc(0x6f5e8143, sceNpScoreCreateTransactionCtx); - sceNp.AddFunc(0xc5f4cf82, sceNpScoreDestroyTransactionCtx); - sceNp.AddFunc(0x29dd45dc, sceNpScoreSetTimeout); - sceNp.AddFunc(0x2706eaa1, sceNpScoreSetPlayerCharacterId); - sceNp.AddFunc(0x1a2704f7, sceNpScoreWaitAsync); - sceNp.AddFunc(0xa7a090e5, sceNpScorePollAsync); - sceNp.AddFunc(0xf4e0f607, sceNpScoreGetBoardInfo); - sceNp.AddFunc(0xddce7d15, sceNpScoreGetBoardInfoAsync); - sceNp.AddFunc(0x1672170e, sceNpScoreRecordScore); - sceNp.AddFunc(0xf0b1e399, sceNpScoreRecordScoreAsync); - sceNp.AddFunc(0x04ca5e6a, sceNpScoreRecordGameData); - sceNp.AddFunc(0xf76847c2, sceNpScoreRecordGameDataAsync); - sceNp.AddFunc(0x3b02418d, sceNpScoreGetGameData); - sceNp.AddFunc(0xdb2e4dc2, sceNpScoreGetGameDataAsync); - sceNp.AddFunc(0x05d65dff, sceNpScoreGetRankingByNpId); - sceNp.AddFunc(0x3db7914d, sceNpScoreGetRankingByNpIdAsync); - sceNp.AddFunc(0xfbc82301, sceNpScoreGetRankingByRange); - sceNp.AddFunc(0x21206642, sceNpScoreGetRankingByRangeAsync); - sceNp.AddFunc(0x7deb244c, sceNpScoreCensorComment); - sceNp.AddFunc(0x7be47e61, sceNpScoreCensorCommentAsync); - sceNp.AddFunc(0xf1b77918, sceNpScoreSanitizeComment); - sceNp.AddFunc(0x2cd2a1af, sceNpScoreSanitizeCommentAsync); - sceNp.AddFunc(0xc3a991ee, sceNpScoreGetRankingByNpIdPcId); - sceNp.AddFunc(0xc4b6cd8f, sceNpScoreGetRankingByNpIdPcIdAsync); - sceNp.AddFunc(0xee5b20d9, sceNpScoreAbortTransaction); - sceNp.AddFunc(0xded17c26, sceNpScoreGetClansMembersRankingByNpId); - sceNp.AddFunc(0xe8a67160, sceNpScoreGetClansMembersRankingByNpIdAsync); - sceNp.AddFunc(0x41ffd4f2, sceNpScoreGetClansMembersRankingByNpIdPcId); - sceNp.AddFunc(0x433fcb30, sceNpScoreGetClansMembersRankingByNpIdPcIdAsync); - sceNp.AddFunc(0x6d4adc3b, sceNpScoreGetClansMembersRankingByRange); - sceNp.AddFunc(0x4d5e0670, sceNpScoreGetClansMembersRankingByRangeAsync); - sceNp.AddFunc(0x741fbf24, sceNpScoreGetClanMemberGameData); - sceNp.AddFunc(0xbef887e5, sceNpScoreGetClanMemberGameDataAsync); - sceNp.AddFunc(0x2a76895a, sceNpScoreGetClansRankingByClanId); - sceNp.AddFunc(0x227f8763, sceNpScoreGetClansRankingByClanIdAsync); - sceNp.AddFunc(0xb082003b, sceNpScoreGetClansRankingByRange); - sceNp.AddFunc(0x7b7e9137, sceNpScoreGetClansRankingByRangeAsync); - sceNp.AddFunc(0x6356082e, sceNpSignalingCreateCtx); - sceNp.AddFunc(0xa8cf8451, sceNpSignalingDestroyCtx); - sceNp.AddFunc(0x50b86d94, sceNpSignalingAddExtendedHandler); - sceNp.AddFunc(0x276c72b2, sceNpSignalingSetCtxOpt); - sceNp.AddFunc(0x2687a127, sceNpSignalingGetCtxOpt); - sceNp.AddFunc(0x60897c38, sceNpSignalingActivateConnection); - sceNp.AddFunc(0xfd0eb5ae, sceNpSignalingDeactivateConnection); - sceNp.AddFunc(0x95c7bba3, sceNpSignalingTerminateConnection); - sceNp.AddFunc(0xca0a2d04, sceNpSignalingGetConnectionStatus); - sceNp.AddFunc(0x155de760, sceNpSignalingGetConnectionInfo); - sceNp.AddFunc(0xe853d388, sceNpSignalingGetConnectionFromNpId); - sceNp.AddFunc(0x34ce82a0, sceNpSignalingGetConnectionFromPeerAddress); - sceNp.AddFunc(0x9ad7fbd1, sceNpSignalingGetLocalNetInfo); - sceNp.AddFunc(0x75eb50cb, sceNpSignalingGetPeerNetInfo); - sceNp.AddFunc(0x64dbb89d, sceNpSignalingCancelPeerNetInfo); - sceNp.AddFunc(0xd0958814, sceNpSignalingGetPeerNetInfoResult); - sceNp.AddFunc(0xd208f91d, sceNpUtilCmpNpId); - sceNp.AddFunc(0xf5ff5f31, sceNpUtilCmpNpIdInOrder); - sceNp.AddFunc(0xc880f37d, sceNpUtilBandwidthTestGetStatus); - sceNp.AddFunc(0xc99ee313, sceNpUtilBandwidthTestAbort); - sceNp.AddFunc(0xee0cc40c, _sceNpSysutilClientMalloc); - sceNp.AddFunc(0x816c6a5f, _sceNpSysutilClientFree); + REG_FUNC(sceNp, sceNpInit); + REG_FUNC(sceNp, sceNp2Init); + REG_FUNC(sceNp, sceNpUtilBandwidthTestInitStart); + REG_FUNC(sceNp, sceNpTerm); + REG_FUNC(sceNp, sceNp2Term); + REG_FUNC(sceNp, sceNpUtilBandwidthTestShutdown); + REG_FUNC(sceNp, sceNpDrmIsAvailable); + REG_FUNC(sceNp, sceNpDrmIsAvailable2); + REG_FUNC(sceNp, sceNpDrmVerifyUpgradeLicense); + REG_FUNC(sceNp, sceNpDrmVerifyUpgradeLicense2); + REG_FUNC(sceNp, sceNpDrmExecuteGamePurchase); + REG_FUNC(sceNp, sceNpDrmGetTimelimit); + REG_FUNC(sceNp, sceNpDrmProcessExitSpawn); + REG_FUNC(sceNp, sceNpDrmProcessExitSpawn2); + REG_FUNC(sceNp, sceNpBasicRegisterHandler); + REG_FUNC(sceNp, sceNpBasicRegisterContextSensitiveHandler); + REG_FUNC(sceNp, sceNpBasicUnregisterHandler); + REG_FUNC(sceNp, sceNpBasicSetPresence); + REG_FUNC(sceNp, sceNpBasicSetPresenceDetails); + REG_FUNC(sceNp, sceNpBasicSetPresenceDetails2); + REG_FUNC(sceNp, sceNpBasicSendMessage); + REG_FUNC(sceNp, sceNpBasicSendMessageGui); + REG_FUNC(sceNp, sceNpBasicSendMessageAttachment); + REG_FUNC(sceNp, sceNpBasicRecvMessageAttachment); + REG_FUNC(sceNp, sceNpBasicRecvMessageAttachmentLoad); + REG_FUNC(sceNp, sceNpBasicRecvMessageCustom); + REG_FUNC(sceNp, sceNpBasicMarkMessageAsUsed); + REG_FUNC(sceNp, sceNpBasicAbortGui); + REG_FUNC(sceNp, sceNpBasicAddFriend); + REG_FUNC(sceNp, sceNpBasicGetFriendListEntryCount); + REG_FUNC(sceNp, sceNpBasicGetFriendListEntry); + REG_FUNC(sceNp, sceNpBasicGetFriendPresenceByIndex); + REG_FUNC(sceNp, sceNpBasicGetFriendPresenceByIndex2); + REG_FUNC(sceNp, sceNpBasicGetFriendPresenceByNpId); + REG_FUNC(sceNp, sceNpBasicGetFriendPresenceByNpId2); + REG_FUNC(sceNp, sceNpBasicAddPlayersHistory); + REG_FUNC(sceNp, sceNpBasicAddPlayersHistoryAsync); + REG_FUNC(sceNp, sceNpBasicGetPlayersHistoryEntryCount); + REG_FUNC(sceNp, sceNpBasicGetPlayersHistoryEntry); + REG_FUNC(sceNp, sceNpBasicAddBlockListEntry); + REG_FUNC(sceNp, sceNpBasicGetBlockListEntryCount); + REG_FUNC(sceNp, sceNpBasicGetBlockListEntry); + REG_FUNC(sceNp, sceNpBasicGetMessageAttachmentEntryCount); + REG_FUNC(sceNp, sceNpBasicGetMessageAttachmentEntry); + REG_FUNC(sceNp, sceNpBasicGetCustomInvitationEntryCount); + REG_FUNC(sceNp, sceNpBasicGetCustomInvitationEntry); + REG_FUNC(sceNp, sceNpBasicGetMatchingInvitationEntryCount); + REG_FUNC(sceNp, sceNpBasicGetMatchingInvitationEntry); + REG_FUNC(sceNp, sceNpBasicGetClanMessageEntryCount); + REG_FUNC(sceNp, sceNpBasicGetClanMessageEntry); + REG_FUNC(sceNp, sceNpBasicGetMessageEntryCount); + REG_FUNC(sceNp, sceNpBasicGetMessageEntry); + REG_FUNC(sceNp, sceNpBasicGetEvent); + REG_FUNC(sceNp, sceNpCommerceCreateCtx); + REG_FUNC(sceNp, sceNpCommerceDestroyCtx); + REG_FUNC(sceNp, sceNpCommerceInitProductCategory); + REG_FUNC(sceNp, sceNpCommerceDestroyProductCategory); + REG_FUNC(sceNp, sceNpCommerceGetProductCategoryStart); + REG_FUNC(sceNp, sceNpCommerceGetProductCategoryFinish); + REG_FUNC(sceNp, sceNpCommerceGetProductCategoryResult); + REG_FUNC(sceNp, sceNpCommerceGetProductCategoryAbort); + REG_FUNC(sceNp, sceNpCommerceGetProductId); + REG_FUNC(sceNp, sceNpCommerceGetProductName); + REG_FUNC(sceNp, sceNpCommerceGetCategoryDescription); + REG_FUNC(sceNp, sceNpCommerceGetCategoryId); + REG_FUNC(sceNp, sceNpCommerceGetCategoryImageURL); + REG_FUNC(sceNp, sceNpCommerceGetCategoryInfo); + REG_FUNC(sceNp, sceNpCommerceGetCategoryName); + REG_FUNC(sceNp, sceNpCommerceGetCurrencyCode); + REG_FUNC(sceNp, sceNpCommerceGetCurrencyDecimals); + REG_FUNC(sceNp, sceNpCommerceGetCurrencyInfo); + REG_FUNC(sceNp, sceNpCommerceGetNumOfChildCategory); + REG_FUNC(sceNp, sceNpCommerceGetNumOfChildProductSku); + REG_FUNC(sceNp, sceNpCommerceGetSkuDescription); + REG_FUNC(sceNp, sceNpCommerceGetSkuId); + REG_FUNC(sceNp, sceNpCommerceGetSkuImageURL); + REG_FUNC(sceNp, sceNpCommerceGetSkuName); + REG_FUNC(sceNp, sceNpCommerceGetSkuPrice); + REG_FUNC(sceNp, sceNpCommerceGetSkuUserData); + REG_FUNC(sceNp, sceNpCommerceSetDataFlagStart); + REG_FUNC(sceNp, sceNpCommerceGetDataFlagStart); + REG_FUNC(sceNp, sceNpCommerceSetDataFlagFinish); + REG_FUNC(sceNp, sceNpCommerceGetDataFlagFinish); + REG_FUNC(sceNp, sceNpCommerceGetDataFlagState); + REG_FUNC(sceNp, sceNpCommerceGetDataFlagAbort); + REG_FUNC(sceNp, sceNpCommerceGetChildCategoryInfo); + REG_FUNC(sceNp, sceNpCommerceGetChildProductSkuInfo); + REG_FUNC(sceNp, sceNpCommerceDoCheckoutStartAsync); + REG_FUNC(sceNp, sceNpCommerceDoCheckoutFinishAsync); + REG_FUNC(sceNp, sceNpCustomMenuRegisterActions); + REG_FUNC(sceNp, sceNpCustomMenuActionSetActivation); + REG_FUNC(sceNp, sceNpCustomMenuRegisterExceptionList); + REG_FUNC(sceNp, sceNpFriendlist); + REG_FUNC(sceNp, sceNpFriendlistCustom); + REG_FUNC(sceNp, sceNpFriendlistAbortGui); + REG_FUNC(sceNp, sceNpLookupInit); + REG_FUNC(sceNp, sceNpLookupTerm); + REG_FUNC(sceNp, sceNpLookupCreateTitleCtx); + REG_FUNC(sceNp, sceNpLookupDestroyTitleCtx); + REG_FUNC(sceNp, sceNpLookupCreateTransactionCtx); + REG_FUNC(sceNp, sceNpLookupDestroyTransactionCtx); + REG_FUNC(sceNp, sceNpLookupSetTimeout); + REG_FUNC(sceNp, sceNpLookupAbortTransaction); + REG_FUNC(sceNp, sceNpLookupWaitAsync); + REG_FUNC(sceNp, sceNpLookupPollAsync); + REG_FUNC(sceNp, sceNpLookupNpId); + REG_FUNC(sceNp, sceNpLookupNpIdAsync); + REG_FUNC(sceNp, sceNpLookupUserProfile); + REG_FUNC(sceNp, sceNpLookupUserProfileAsync); + REG_FUNC(sceNp, sceNpLookupUserProfileWithAvatarSize); + REG_FUNC(sceNp, sceNpLookupUserProfileWithAvatarSizeAsync); + REG_FUNC(sceNp, sceNpLookupAvatarImage); + REG_FUNC(sceNp, sceNpLookupAvatarImageAsync); + REG_FUNC(sceNp, sceNpLookupTitleStorage); + REG_FUNC(sceNp, sceNpLookupTitleStorageAsync); + REG_FUNC(sceNp, sceNpLookupTitleSmallStorage); + REG_FUNC(sceNp, sceNpLookupTitleSmallStorageAsync); + REG_FUNC(sceNp, sceNpManagerRegisterCallback); + REG_FUNC(sceNp, sceNpManagerUnregisterCallback); + REG_FUNC(sceNp, sceNpManagerGetStatus); + REG_FUNC(sceNp, sceNpManagerGetNetworkTime); + REG_FUNC(sceNp, sceNpManagerGetOnlineId); + REG_FUNC(sceNp, sceNpManagerGetNpId); + REG_FUNC(sceNp, sceNpManagerGetOnlineName); + REG_FUNC(sceNp, sceNpManagerGetAvatarUrl); + REG_FUNC(sceNp, sceNpManagerGetMyLanguages); + REG_FUNC(sceNp, sceNpManagerGetAccountRegion); + REG_FUNC(sceNp, sceNpManagerGetAccountAge); + REG_FUNC(sceNp, sceNpManagerGetContentRatingFlag); + REG_FUNC(sceNp, sceNpManagerGetChatRestrictionFlag); + REG_FUNC(sceNp, sceNpManagerGetCachedInfo); + REG_FUNC(sceNp, sceNpManagerGetPsHandle); + REG_FUNC(sceNp, sceNpManagerRequestTicket); + REG_FUNC(sceNp, sceNpManagerRequestTicket2); + REG_FUNC(sceNp, sceNpManagerGetTicket); + REG_FUNC(sceNp, sceNpManagerGetTicketParam); + REG_FUNC(sceNp, sceNpManagerGetEntitlementIdList); + REG_FUNC(sceNp, sceNpManagerGetEntitlementById); + REG_FUNC(sceNp, sceNpManagerSubSignin); + REG_FUNC(sceNp, sceNpManagerSubSigninAbortGui); + REG_FUNC(sceNp, sceNpManagerSubSignout); + REG_FUNC(sceNp, sceNpMatchingCreateCtx); + REG_FUNC(sceNp, sceNpMatchingDestroyCtx); + REG_FUNC(sceNp, sceNpMatchingGetResult); + REG_FUNC(sceNp, sceNpMatchingGetResultGUI); + REG_FUNC(sceNp, sceNpMatchingSetRoomInfo); + REG_FUNC(sceNp, sceNpMatchingSetRoomInfoNoLimit); + REG_FUNC(sceNp, sceNpMatchingGetRoomInfo); + REG_FUNC(sceNp, sceNpMatchingGetRoomInfoNoLimit); + REG_FUNC(sceNp, sceNpMatchingSetRoomSearchFlag); + REG_FUNC(sceNp, sceNpMatchingGetRoomSearchFlag); + REG_FUNC(sceNp, sceNpMatchingGetRoomMemberListLocal); + REG_FUNC(sceNp, sceNpMatchingGetRoomListLimitGUI); + REG_FUNC(sceNp, sceNpMatchingKickRoomMember); + REG_FUNC(sceNp, sceNpMatchingKickRoomMemberWithOpt); + REG_FUNC(sceNp, sceNpMatchingQuickMatchGUI); + REG_FUNC(sceNp, sceNpMatchingSendInvitationGUI); + REG_FUNC(sceNp, sceNpMatchingAcceptInvitationGUI); + REG_FUNC(sceNp, sceNpMatchingCreateRoomGUI); + REG_FUNC(sceNp, sceNpMatchingJoinRoomGUI); + REG_FUNC(sceNp, sceNpMatchingLeaveRoom); + REG_FUNC(sceNp, sceNpMatchingSearchJoinRoomGUI); + REG_FUNC(sceNp, sceNpMatchingGrantOwnership); + REG_FUNC(sceNp, sceNpProfileCallGui); + REG_FUNC(sceNp, sceNpProfileAbortGui); + REG_FUNC(sceNp, sceNpScoreInit); + REG_FUNC(sceNp, sceNpScoreTerm); + REG_FUNC(sceNp, sceNpScoreCreateTitleCtx); + REG_FUNC(sceNp, sceNpScoreDestroyTitleCtx); + REG_FUNC(sceNp, sceNpScoreCreateTransactionCtx); + REG_FUNC(sceNp, sceNpScoreDestroyTransactionCtx); + REG_FUNC(sceNp, sceNpScoreSetTimeout); + REG_FUNC(sceNp, sceNpScoreSetPlayerCharacterId); + REG_FUNC(sceNp, sceNpScoreWaitAsync); + REG_FUNC(sceNp, sceNpScorePollAsync); + REG_FUNC(sceNp, sceNpScoreGetBoardInfo); + REG_FUNC(sceNp, sceNpScoreGetBoardInfoAsync); + REG_FUNC(sceNp, sceNpScoreRecordScore); + REG_FUNC(sceNp, sceNpScoreRecordScoreAsync); + REG_FUNC(sceNp, sceNpScoreRecordGameData); + REG_FUNC(sceNp, sceNpScoreRecordGameDataAsync); + REG_FUNC(sceNp, sceNpScoreGetGameData); + REG_FUNC(sceNp, sceNpScoreGetGameDataAsync); + REG_FUNC(sceNp, sceNpScoreGetRankingByNpId); + REG_FUNC(sceNp, sceNpScoreGetRankingByNpIdAsync); + REG_FUNC(sceNp, sceNpScoreGetRankingByRange); + REG_FUNC(sceNp, sceNpScoreGetRankingByRangeAsync); + REG_FUNC(sceNp, sceNpScoreCensorComment); + REG_FUNC(sceNp, sceNpScoreCensorCommentAsync); + REG_FUNC(sceNp, sceNpScoreSanitizeComment); + REG_FUNC(sceNp, sceNpScoreSanitizeCommentAsync); + REG_FUNC(sceNp, sceNpScoreGetRankingByNpIdPcId); + REG_FUNC(sceNp, sceNpScoreGetRankingByNpIdPcIdAsync); + REG_FUNC(sceNp, sceNpScoreAbortTransaction); + REG_FUNC(sceNp, sceNpScoreGetClansMembersRankingByNpId); + REG_FUNC(sceNp, sceNpScoreGetClansMembersRankingByNpIdAsync); + REG_FUNC(sceNp, sceNpScoreGetClansMembersRankingByNpIdPcId); + REG_FUNC(sceNp, sceNpScoreGetClansMembersRankingByNpIdPcIdAsync); + REG_FUNC(sceNp, sceNpScoreGetClansMembersRankingByRange); + REG_FUNC(sceNp, sceNpScoreGetClansMembersRankingByRangeAsync); + REG_FUNC(sceNp, sceNpScoreGetClanMemberGameData); + REG_FUNC(sceNp, sceNpScoreGetClanMemberGameDataAsync); + REG_FUNC(sceNp, sceNpScoreGetClansRankingByClanId); + REG_FUNC(sceNp, sceNpScoreGetClansRankingByClanIdAsync); + REG_FUNC(sceNp, sceNpScoreGetClansRankingByRange); + REG_FUNC(sceNp, sceNpScoreGetClansRankingByRangeAsync); + REG_FUNC(sceNp, sceNpSignalingCreateCtx); + REG_FUNC(sceNp, sceNpSignalingDestroyCtx); + REG_FUNC(sceNp, sceNpSignalingAddExtendedHandler); + REG_FUNC(sceNp, sceNpSignalingSetCtxOpt); + REG_FUNC(sceNp, sceNpSignalingGetCtxOpt); + REG_FUNC(sceNp, sceNpSignalingActivateConnection); + REG_FUNC(sceNp, sceNpSignalingDeactivateConnection); + REG_FUNC(sceNp, sceNpSignalingTerminateConnection); + REG_FUNC(sceNp, sceNpSignalingGetConnectionStatus); + REG_FUNC(sceNp, sceNpSignalingGetConnectionInfo); + REG_FUNC(sceNp, sceNpSignalingGetConnectionFromNpId); + REG_FUNC(sceNp, sceNpSignalingGetConnectionFromPeerAddress); + REG_FUNC(sceNp, sceNpSignalingGetLocalNetInfo); + REG_FUNC(sceNp, sceNpSignalingGetPeerNetInfo); + REG_FUNC(sceNp, sceNpSignalingCancelPeerNetInfo); + REG_FUNC(sceNp, sceNpSignalingGetPeerNetInfoResult); + REG_FUNC(sceNp, sceNpUtilCmpNpId); + REG_FUNC(sceNp, sceNpUtilCmpNpIdInOrder); + REG_FUNC(sceNp, sceNpUtilBandwidthTestGetStatus); + REG_FUNC(sceNp, sceNpUtilBandwidthTestAbort); + REG_FUNC(sceNp, _sceNpSysutilClientMalloc); + REG_FUNC(sceNp, _sceNpSysutilClientFree); }); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp index 4a3baff1b4..440b8dc321 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp @@ -434,43 +434,43 @@ void sceNpClans_unload() Module sceNpClans("sceNpClans", []() { - sceNpClans.AddFunc(0x9b820047, sceNpClansInit); - sceNpClans.AddFunc(0x42332cb7, sceNpClansTerm); - sceNpClans.AddFunc(0x9a72232d, sceNpClansCreateRequest); - sceNpClans.AddFunc(0xd6551cd1, sceNpClansDestroyRequest); - sceNpClans.AddFunc(0xe82969e2, sceNpClansAbortRequest); - sceNpClans.AddFunc(0xa6a31a38, sceNpClansCreateClan); - sceNpClans.AddFunc(0x4826f6d5, sceNpClansDisbandClan); - sceNpClans.AddFunc(0xca4181b4, sceNpClansGetClanList); - sceNpClans.AddFunc(0x672399a8, sceNpClansGetClanListByNpId); - sceNpClans.AddFunc(0x1221a1bf, sceNpClansSearchByProfile); - sceNpClans.AddFunc(0xace0cfba, sceNpClansSearchByName); - sceNpClans.AddFunc(0x487de998, sceNpClansGetClanInfo); - sceNpClans.AddFunc(0x09f9e1a9, sceNpClansUpdateClanInfo); - sceNpClans.AddFunc(0x856ff5c0, sceNpClansGetMemberList); - sceNpClans.AddFunc(0x20472da0, sceNpClansGetMemberInfo); - sceNpClans.AddFunc(0xf4a2d52b, sceNpClansUpdateMemberInfo); - sceNpClans.AddFunc(0x9cac2085, sceNpClansChangeMemberRole); - sceNpClans.AddFunc(0x38dadf1f, sceNpClansGetAutoAcceptStatus); - sceNpClans.AddFunc(0x5da94854, sceNpClansUpdateAutoAcceptStatus); - sceNpClans.AddFunc(0xdbf300ca, sceNpClansJoinClan); - sceNpClans.AddFunc(0x560f717b, sceNpClansLeaveClan); - sceNpClans.AddFunc(0xaa7912b5, sceNpClansKickMember); - sceNpClans.AddFunc(0xbc05ef31, sceNpClansSendInvitation); - sceNpClans.AddFunc(0x726dffd5, sceNpClansCancelInvitation); - sceNpClans.AddFunc(0x095e12c6, sceNpClansSendInvitationResponse); - sceNpClans.AddFunc(0x59743b2b, sceNpClansSendMembershipRequest); - sceNpClans.AddFunc(0x299ccc9b, sceNpClansCancelMembershipRequest); - sceNpClans.AddFunc(0x942dbdc4, sceNpClansSendMembershipResponse); - sceNpClans.AddFunc(0x56bc5a7c, sceNpClansGetBlacklist); - sceNpClans.AddFunc(0x4d06aef7, sceNpClansAddBlacklistEntry); - sceNpClans.AddFunc(0x5bff9da1, sceNpClansRemoveBlacklistEntry); - sceNpClans.AddFunc(0x727aa7f8, sceNpClansRetrieveAnnouncements); - sceNpClans.AddFunc(0xada45b84, sceNpClansPostAnnouncement); - sceNpClans.AddFunc(0xe2590f60, sceNpClansRemoveAnnouncement); - sceNpClans.AddFunc(0x83d65529, sceNpClansPostChallenge); - sceNpClans.AddFunc(0x8e785b97, sceNpClansRetrievePostedChallenges); - sceNpClans.AddFunc(0xd3346dc4, sceNpClansRemovePostedChallenge); - sceNpClans.AddFunc(0x0df25834, sceNpClansRetrieveChallenges); - sceNpClans.AddFunc(0xce6dc0f0, sceNpClansRemoveChallenge); + REG_FUNC(sceNpClans, sceNpClansInit); + REG_FUNC(sceNpClans, sceNpClansTerm); + REG_FUNC(sceNpClans, sceNpClansCreateRequest); + REG_FUNC(sceNpClans, sceNpClansDestroyRequest); + REG_FUNC(sceNpClans, sceNpClansAbortRequest); + REG_FUNC(sceNpClans, sceNpClansCreateClan); + REG_FUNC(sceNpClans, sceNpClansDisbandClan); + REG_FUNC(sceNpClans, sceNpClansGetClanList); + REG_FUNC(sceNpClans, sceNpClansGetClanListByNpId); + REG_FUNC(sceNpClans, sceNpClansSearchByProfile); + REG_FUNC(sceNpClans, sceNpClansSearchByName); + REG_FUNC(sceNpClans, sceNpClansGetClanInfo); + REG_FUNC(sceNpClans, sceNpClansUpdateClanInfo); + REG_FUNC(sceNpClans, sceNpClansGetMemberList); + REG_FUNC(sceNpClans, sceNpClansGetMemberInfo); + REG_FUNC(sceNpClans, sceNpClansUpdateMemberInfo); + REG_FUNC(sceNpClans, sceNpClansChangeMemberRole); + REG_FUNC(sceNpClans, sceNpClansGetAutoAcceptStatus); + REG_FUNC(sceNpClans, sceNpClansUpdateAutoAcceptStatus); + REG_FUNC(sceNpClans, sceNpClansJoinClan); + REG_FUNC(sceNpClans, sceNpClansLeaveClan); + REG_FUNC(sceNpClans, sceNpClansKickMember); + REG_FUNC(sceNpClans, sceNpClansSendInvitation); + REG_FUNC(sceNpClans, sceNpClansCancelInvitation); + REG_FUNC(sceNpClans, sceNpClansSendInvitationResponse); + REG_FUNC(sceNpClans, sceNpClansSendMembershipRequest); + REG_FUNC(sceNpClans, sceNpClansCancelMembershipRequest); + REG_FUNC(sceNpClans, sceNpClansSendMembershipResponse); + REG_FUNC(sceNpClans, sceNpClansGetBlacklist); + REG_FUNC(sceNpClans, sceNpClansAddBlacklistEntry); + REG_FUNC(sceNpClans, sceNpClansRemoveBlacklistEntry); + REG_FUNC(sceNpClans, sceNpClansRetrieveAnnouncements); + REG_FUNC(sceNpClans, sceNpClansPostAnnouncement); + REG_FUNC(sceNpClans, sceNpClansRemoveAnnouncement); + REG_FUNC(sceNpClans, sceNpClansPostChallenge); + REG_FUNC(sceNpClans, sceNpClansRetrievePostedChallenges); + REG_FUNC(sceNpClans, sceNpClansRemovePostedChallenge); + REG_FUNC(sceNpClans, sceNpClansRetrieveChallenges); + REG_FUNC(sceNpClans, sceNpClansRemoveChallenge); }); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp index 66ca23a258..9f66688d2c 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp @@ -319,51 +319,51 @@ void sceNpCommerce2_unload() Module sceNpCommerce2("sceNpCommerce2", []() { - sceNpCommerce2.AddFunc(0xeef51be0, sceNpCommerce2ExecuteStoreBrowse); - sceNpCommerce2.AddFunc(0x1fa1b312, sceNpCommerce2GetStoreBrowseUserdata); - sceNpCommerce2.AddFunc(0x3539d233, sceNpCommerce2Init); - sceNpCommerce2.AddFunc(0x4d4a094c, sceNpCommerce2Term); - sceNpCommerce2.AddFunc(0xd9fdcec2, sceNpCommerce2CreateCtx); - sceNpCommerce2.AddFunc(0x6f67ea80, sceNpCommerce2DestroyCtx); - sceNpCommerce2.AddFunc(0xcc18cd2c, sceNpCommerce2CreateSessionStart); - sceNpCommerce2.AddFunc(0x62023e98, sceNpCommerce2CreateSessionAbort); - sceNpCommerce2.AddFunc(0x91f8843d, sceNpCommerce2CreateSessionFinish); - sceNpCommerce2.AddFunc(0x7370d8d0, sceNpCommerce2GetCategoryContentsCreateReq); - sceNpCommerce2.AddFunc(0x371a2edd, sceNpCommerce2GetCategoryContentsStart); - sceNpCommerce2.AddFunc(0xca0ea996, sceNpCommerce2GetCategoryContentsGetResult); - sceNpCommerce2.AddFunc(0xd8a473a3, sceNpCommerce2InitGetCategoryContentsResult); - sceNpCommerce2.AddFunc(0xbd49eab2, sceNpCommerce2GetCategoryInfo); - sceNpCommerce2.AddFunc(0x972ab46c, sceNpCommerce2GetContentInfo); - sceNpCommerce2.AddFunc(0xfc216890, sceNpCommerce2GetCategoryInfoFromContentInfo); - sceNpCommerce2.AddFunc(0xe51a4944, sceNpCommerce2GetGameProductInfoFromContentInfo); - sceNpCommerce2.AddFunc(0x9d9cb96b, sceNpCommerce2DestroyGetCategoryContentsResult); - sceNpCommerce2.AddFunc(0xa975ebb4, sceNpCommerce2GetProductInfoCreateReq); - sceNpCommerce2.AddFunc(0x8f46325b, sceNpCommerce2GetProductInfoStart); - sceNpCommerce2.AddFunc(0xbf5f58ea, sceNpCommerce2GetProductInfoGetResult); - sceNpCommerce2.AddFunc(0xf798f5e3, sceNpCommerce2InitGetProductInfoResult); - sceNpCommerce2.AddFunc(0xef645654, sceNpCommerce2GetGameProductInfo); - sceNpCommerce2.AddFunc(0xef8eafcd, sceNpCommerce2DestroyGetProductInfoResult); - sceNpCommerce2.AddFunc(0xe1e7b5ac, sceNpCommerce2GetProductInfoListCreateReq); - sceNpCommerce2.AddFunc(0x9cde07cc, sceNpCommerce2GetProductInfoListStart); - sceNpCommerce2.AddFunc(0x146618df, sceNpCommerce2GetProductInfoListGetResult); - sceNpCommerce2.AddFunc(0xe0f90e44, sceNpCommerce2InitGetProductInfoListResult); - sceNpCommerce2.AddFunc(0xd9956ce7, sceNpCommerce2GetGameProductInfoFromGetProductInfoListResult); - sceNpCommerce2.AddFunc(0xf6139b58, sceNpCommerce2DestroyGetProductInfoListResult); - sceNpCommerce2.AddFunc(0xec324c8f, sceNpCommerce2GetContentRatingInfoFromGameProductInfo); - sceNpCommerce2.AddFunc(0xac78c1f3, sceNpCommerce2GetContentRatingInfoFromCategoryInfo); - sceNpCommerce2.AddFunc(0x150fdca3, sceNpCommerce2GetContentRatingDescriptor); - sceNpCommerce2.AddFunc(0xdb19194c, sceNpCommerce2GetGameSkuInfoFromGameProductInfo); - sceNpCommerce2.AddFunc(0xda8e322d, sceNpCommerce2GetPrice); - sceNpCommerce2.AddFunc(0x104551a6, sceNpCommerce2DoCheckoutStartAsync); - sceNpCommerce2.AddFunc(0xd43a130e, sceNpCommerce2DoCheckoutFinishAsync); - sceNpCommerce2.AddFunc(0x9825a0fc, sceNpCommerce2DoProductBrowseStartAsync); - sceNpCommerce2.AddFunc(0xb23e3bd1, sceNpCommerce2DoProductBrowseFinishAsync); - sceNpCommerce2.AddFunc(0x6ca9efd4, sceNpCommerce2DoDlListStartAsync); - sceNpCommerce2.AddFunc(0x410d42be, sceNpCommerce2DoDlListFinishAsync); - sceNpCommerce2.AddFunc(0xde7ab33d, sceNpCommerce2DoProductCodeStartAsync); - sceNpCommerce2.AddFunc(0xa9f945b3, sceNpCommerce2DoProductCodeFinishAsync); - sceNpCommerce2.AddFunc(0x3d627d81, sceNpCommerce2GetBGDLAvailability); - sceNpCommerce2.AddFunc(0xa5a863fe, sceNpCommerce2SetBGDLAvailability); - sceNpCommerce2.AddFunc(0x8df0057f, sceNpCommerce2AbortReq); - sceNpCommerce2.AddFunc(0x2a910f05, sceNpCommerce2DestroyReq); + REG_FUNC(sceNpCommerce2, sceNpCommerce2ExecuteStoreBrowse); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetStoreBrowseUserdata); + REG_FUNC(sceNpCommerce2, sceNpCommerce2Init); + REG_FUNC(sceNpCommerce2, sceNpCommerce2Term); + REG_FUNC(sceNpCommerce2, sceNpCommerce2CreateCtx); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DestroyCtx); + REG_FUNC(sceNpCommerce2, sceNpCommerce2CreateSessionStart); + REG_FUNC(sceNpCommerce2, sceNpCommerce2CreateSessionAbort); + REG_FUNC(sceNpCommerce2, sceNpCommerce2CreateSessionFinish); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetCategoryContentsCreateReq); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetCategoryContentsStart); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetCategoryContentsGetResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2InitGetCategoryContentsResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetCategoryInfo); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetContentInfo); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetCategoryInfoFromContentInfo); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetGameProductInfoFromContentInfo); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DestroyGetCategoryContentsResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetProductInfoCreateReq); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetProductInfoStart); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetProductInfoGetResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2InitGetProductInfoResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetGameProductInfo); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DestroyGetProductInfoResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetProductInfoListCreateReq); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetProductInfoListStart); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetProductInfoListGetResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2InitGetProductInfoListResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetGameProductInfoFromGetProductInfoListResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DestroyGetProductInfoListResult); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetContentRatingInfoFromGameProductInfo); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetContentRatingInfoFromCategoryInfo); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetContentRatingDescriptor); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetGameSkuInfoFromGameProductInfo); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetPrice); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DoCheckoutStartAsync); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DoCheckoutFinishAsync); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DoProductBrowseStartAsync); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DoProductBrowseFinishAsync); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DoDlListStartAsync); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DoDlListFinishAsync); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DoProductCodeStartAsync); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DoProductCodeFinishAsync); + REG_FUNC(sceNpCommerce2, sceNpCommerce2GetBGDLAvailability); + REG_FUNC(sceNpCommerce2, sceNpCommerce2SetBGDLAvailability); + REG_FUNC(sceNpCommerce2, sceNpCommerce2AbortReq); + REG_FUNC(sceNpCommerce2, sceNpCommerce2DestroyReq); }); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp index eee6356a71..191977c7b5 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp @@ -455,21 +455,21 @@ void sceNpTrophy_unload() Module sceNpTrophy("sceNpTrophy", []() { - sceNpTrophy.AddFunc(0x079f0e87, sceNpTrophyGetGameProgress); - sceNpTrophy.AddFunc(0x1197b52c, sceNpTrophyRegisterContext); - sceNpTrophy.AddFunc(0x1c25470d, sceNpTrophyCreateHandle); - sceNpTrophy.AddFunc(0x27deda93, sceNpTrophySetSoundLevel); - sceNpTrophy.AddFunc(0x370136fe, sceNpTrophyGetRequiredDiskSpace); - sceNpTrophy.AddFunc(0x3741ecc7, sceNpTrophyDestroyContext); - sceNpTrophy.AddFunc(0x39567781, sceNpTrophyInit); - sceNpTrophy.AddFunc(0x48bd97c7, sceNpTrophyAbortHandle); - sceNpTrophy.AddFunc(0x49d18217, sceNpTrophyGetGameInfo); - sceNpTrophy.AddFunc(0x623cd2dc, sceNpTrophyDestroyHandle); - sceNpTrophy.AddFunc(0x8ceedd21, sceNpTrophyUnlockTrophy); - sceNpTrophy.AddFunc(0xa7fabf4d, sceNpTrophyTerm); - sceNpTrophy.AddFunc(0xb3ac3478, sceNpTrophyGetTrophyUnlockState); - sceNpTrophy.AddFunc(0xbaedf689, sceNpTrophyGetTrophyIcon); - sceNpTrophy.AddFunc(0xe3bf9a28, sceNpTrophyCreateContext); - sceNpTrophy.AddFunc(0xfce6d30a, sceNpTrophyGetTrophyInfo); - sceNpTrophy.AddFunc(0xff299e03, sceNpTrophyGetGameIcon); + REG_FUNC(sceNpTrophy, sceNpTrophyGetGameProgress); + REG_FUNC(sceNpTrophy, sceNpTrophyRegisterContext); + REG_FUNC(sceNpTrophy, sceNpTrophyCreateHandle); + REG_FUNC(sceNpTrophy, sceNpTrophySetSoundLevel); + REG_FUNC(sceNpTrophy, sceNpTrophyGetRequiredDiskSpace); + REG_FUNC(sceNpTrophy, sceNpTrophyDestroyContext); + REG_FUNC(sceNpTrophy, sceNpTrophyInit); + REG_FUNC(sceNpTrophy, sceNpTrophyAbortHandle); + REG_FUNC(sceNpTrophy, sceNpTrophyGetGameInfo); + REG_FUNC(sceNpTrophy, sceNpTrophyDestroyHandle); + REG_FUNC(sceNpTrophy, sceNpTrophyUnlockTrophy); + REG_FUNC(sceNpTrophy, sceNpTrophyTerm); + REG_FUNC(sceNpTrophy, sceNpTrophyGetTrophyUnlockState); + REG_FUNC(sceNpTrophy, sceNpTrophyGetTrophyIcon); + REG_FUNC(sceNpTrophy, sceNpTrophyCreateContext); + REG_FUNC(sceNpTrophy, sceNpTrophyGetTrophyInfo); + REG_FUNC(sceNpTrophy, sceNpTrophyGetGameIcon); }); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp index dc5dc3dcc9..bbfb84c4c1 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp @@ -570,58 +570,58 @@ void sceNpTus_unload() Module sceNpTus("sceNpTus", []() { - sceNpTus.AddFunc(0x8f87a06b, sceNpTusInit); - sceNpTus.AddFunc(0x225aed26, sceNpTusTerm); - sceNpTus.AddFunc(0x7caf58ee, sceNpTusCreateTitleCtx); - sceNpTus.AddFunc(0x2e162a62, sceNpTusDestroyTitleCtx); - sceNpTus.AddFunc(0x1904435e, sceNpTusCreateTransactionCtx); - sceNpTus.AddFunc(0x44eca8b4, sceNpTusDestroyTransactionCtx); - sceNpTus.AddFunc(0x59432970, sceNpTusSetTimeout); - sceNpTus.AddFunc(0x325c6284, sceNpTusAbortTransaction); - sceNpTus.AddFunc(0xb8e8ff22, sceNpTusWaitAsync); - sceNpTus.AddFunc(0x19bce18c, sceNpTusPollAsync); - sceNpTus.AddFunc(0xcc86a8f6, sceNpTusSetMultiSlotVariable); - sceNpTus.AddFunc(0xf819be91, sceNpTusSetMultiSlotVariableVUser); - sceNpTus.AddFunc(0x065b610d, sceNpTusSetMultiSlotVariableAsync); - sceNpTus.AddFunc(0x96a06212, sceNpTusSetMultiSlotVariableVUserAsync); - sceNpTus.AddFunc(0x0423e622, sceNpTusGetMultiSlotVariable); - sceNpTus.AddFunc(0x2357ba9e, sceNpTusGetMultiSlotVariableVUser); - sceNpTus.AddFunc(0xbb2877f2, sceNpTusGetMultiSlotVariableAsync); - sceNpTus.AddFunc(0xfc7d346e, sceNpTusGetMultiSlotVariableVUserAsync); - sceNpTus.AddFunc(0x0d15043b, sceNpTusGetMultiUserVariable); - sceNpTus.AddFunc(0x6c511024, sceNpTusGetMultiUserVariableVUser); - sceNpTus.AddFunc(0xcc7a31cd, sceNpTusGetMultiUserVariableAsync); - sceNpTus.AddFunc(0x9549d22c, sceNpTusGetMultiUserVariableVUserAsync); - sceNpTus.AddFunc(0x94989003, sceNpTusAddAndGetVariable); - sceNpTus.AddFunc(0xf60be06f, sceNpTusAddAndGetVariableVUser); - sceNpTus.AddFunc(0x1fa5c87d, sceNpTusAddAndGetVariableAsync); - sceNpTus.AddFunc(0xa7993bf3, sceNpTusAddAndGetVariableVUserAsync); - sceNpTus.AddFunc(0x47e9424a, sceNpTusTryAndSetVariable); - sceNpTus.AddFunc(0x3602bc80, sceNpTusTryAndSetVariableVUser); - sceNpTus.AddFunc(0xbbb244b7, sceNpTusTryAndSetVariableAsync); - sceNpTus.AddFunc(0x17db7aa7, sceNpTusTryAndSetVariableVUserAsync); - sceNpTus.AddFunc(0xaf985783, sceNpTusDeleteMultiSlotVariable); - sceNpTus.AddFunc(0xc4e51fbf, sceNpTusDeleteMultiSlotVariableVUser); - sceNpTus.AddFunc(0xf5363608, sceNpTusDeleteMultiSlotVariableAsync); - sceNpTus.AddFunc(0xc2e18da8, sceNpTusDeleteMultiSlotVariableVUserAsync); - sceNpTus.AddFunc(0x7d5f0f0e, sceNpTusSetData); - sceNpTus.AddFunc(0x0835deb2, sceNpTusSetDataVUser); - sceNpTus.AddFunc(0xe847341f, sceNpTusSetDataAsync); - sceNpTus.AddFunc(0x9cc0cf44, sceNpTusSetDataVUserAsync); - sceNpTus.AddFunc(0x8ddd0d85, sceNpTusGetData); - sceNpTus.AddFunc(0xae4e590e, sceNpTusGetDataVUser); - sceNpTus.AddFunc(0x5175abb9, sceNpTusGetDataAsync); - sceNpTus.AddFunc(0x38f364b0, sceNpTusGetDataVUserAsync); - sceNpTus.AddFunc(0xc848d425, sceNpTusGetMultiSlotDataStatus); - sceNpTus.AddFunc(0xa3abfadb, sceNpTusGetMultiSlotDataStatusVUser); - sceNpTus.AddFunc(0x651fd79f, sceNpTusGetMultiSlotDataStatusAsync); - sceNpTus.AddFunc(0x2ab21ea9, sceNpTusGetMultiSlotDataStatusVUserAsync); - sceNpTus.AddFunc(0x348dbcb4, sceNpTusGetMultiUserDataStatus); - sceNpTus.AddFunc(0x2d1b9f1a, sceNpTusGetMultiUserDataStatusVUser); - sceNpTus.AddFunc(0xc66ba67e, sceNpTusGetMultiUserDataStatusAsync); - sceNpTus.AddFunc(0x368fec59, sceNpTusGetMultiUserDataStatusVUserAsync); - sceNpTus.AddFunc(0xe0719847, sceNpTusDeleteMultiSlotData); - sceNpTus.AddFunc(0x01711e81, sceNpTusDeleteMultiSlotDataVUser); - sceNpTus.AddFunc(0x3175af23, sceNpTusDeleteMultiSlotDataAsync); - sceNpTus.AddFunc(0xc815b219, sceNpTusDeleteMultiSlotDataVUserAsync); + REG_FUNC(sceNpTus, sceNpTusInit); + REG_FUNC(sceNpTus, sceNpTusTerm); + REG_FUNC(sceNpTus, sceNpTusCreateTitleCtx); + REG_FUNC(sceNpTus, sceNpTusDestroyTitleCtx); + REG_FUNC(sceNpTus, sceNpTusCreateTransactionCtx); + REG_FUNC(sceNpTus, sceNpTusDestroyTransactionCtx); + REG_FUNC(sceNpTus, sceNpTusSetTimeout); + REG_FUNC(sceNpTus, sceNpTusAbortTransaction); + REG_FUNC(sceNpTus, sceNpTusWaitAsync); + REG_FUNC(sceNpTus, sceNpTusPollAsync); + REG_FUNC(sceNpTus, sceNpTusSetMultiSlotVariable); + REG_FUNC(sceNpTus, sceNpTusSetMultiSlotVariableVUser); + REG_FUNC(sceNpTus, sceNpTusSetMultiSlotVariableAsync); + REG_FUNC(sceNpTus, sceNpTusSetMultiSlotVariableVUserAsync); + REG_FUNC(sceNpTus, sceNpTusGetMultiSlotVariable); + REG_FUNC(sceNpTus, sceNpTusGetMultiSlotVariableVUser); + REG_FUNC(sceNpTus, sceNpTusGetMultiSlotVariableAsync); + REG_FUNC(sceNpTus, sceNpTusGetMultiSlotVariableVUserAsync); + REG_FUNC(sceNpTus, sceNpTusGetMultiUserVariable); + REG_FUNC(sceNpTus, sceNpTusGetMultiUserVariableVUser); + REG_FUNC(sceNpTus, sceNpTusGetMultiUserVariableAsync); + REG_FUNC(sceNpTus, sceNpTusGetMultiUserVariableVUserAsync); + REG_FUNC(sceNpTus, sceNpTusAddAndGetVariable); + REG_FUNC(sceNpTus, sceNpTusAddAndGetVariableVUser); + REG_FUNC(sceNpTus, sceNpTusAddAndGetVariableAsync); + REG_FUNC(sceNpTus, sceNpTusAddAndGetVariableVUserAsync); + REG_FUNC(sceNpTus, sceNpTusTryAndSetVariable); + REG_FUNC(sceNpTus, sceNpTusTryAndSetVariableVUser); + REG_FUNC(sceNpTus, sceNpTusTryAndSetVariableAsync); + REG_FUNC(sceNpTus, sceNpTusTryAndSetVariableVUserAsync); + REG_FUNC(sceNpTus, sceNpTusDeleteMultiSlotVariable); + REG_FUNC(sceNpTus, sceNpTusDeleteMultiSlotVariableVUser); + REG_FUNC(sceNpTus, sceNpTusDeleteMultiSlotVariableAsync); + REG_FUNC(sceNpTus, sceNpTusDeleteMultiSlotVariableVUserAsync); + REG_FUNC(sceNpTus, sceNpTusSetData); + REG_FUNC(sceNpTus, sceNpTusSetDataVUser); + REG_FUNC(sceNpTus, sceNpTusSetDataAsync); + REG_FUNC(sceNpTus, sceNpTusSetDataVUserAsync); + REG_FUNC(sceNpTus, sceNpTusGetData); + REG_FUNC(sceNpTus, sceNpTusGetDataVUser); + REG_FUNC(sceNpTus, sceNpTusGetDataAsync); + REG_FUNC(sceNpTus, sceNpTusGetDataVUserAsync); + REG_FUNC(sceNpTus, sceNpTusGetMultiSlotDataStatus); + REG_FUNC(sceNpTus, sceNpTusGetMultiSlotDataStatusVUser); + REG_FUNC(sceNpTus, sceNpTusGetMultiSlotDataStatusAsync); + REG_FUNC(sceNpTus, sceNpTusGetMultiSlotDataStatusVUserAsync); + REG_FUNC(sceNpTus, sceNpTusGetMultiUserDataStatus); + REG_FUNC(sceNpTus, sceNpTusGetMultiUserDataStatusVUser); + REG_FUNC(sceNpTus, sceNpTusGetMultiUserDataStatusAsync); + REG_FUNC(sceNpTus, sceNpTusGetMultiUserDataStatusVUserAsync); + REG_FUNC(sceNpTus, sceNpTusDeleteMultiSlotData); + REG_FUNC(sceNpTus, sceNpTusDeleteMultiSlotDataVUser); + REG_FUNC(sceNpTus, sceNpTusDeleteMultiSlotDataAsync); + REG_FUNC(sceNpTus, sceNpTusDeleteMultiSlotDataVUserAsync); }); diff --git a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp index a28e2b804e..ee1d0e0e7c 100644 --- a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Utilities/Log.h" #include "Emu/Memory/Memory.h" #include "Emu/System.h" #include "Emu/SysCalls/Modules.h" @@ -87,6 +88,139 @@ void ppu_free_tls(u32 thread) } } +std::string ps3_fmt(PPUThread& context, vm::ptr fmt, u32 g_count, u32 f_count, u32 v_count) +{ + std::string result; + + for (char c = *fmt++; c; c = *fmt++) + { + switch (c) + { + case '%': + { + const auto start = fmt - 1; + + // read flags + const bool plus_sign = *fmt == '+' ? fmt++, true : false; + const bool minus_sign = *fmt == '-' ? fmt++, true : false; + const bool space_sign = *fmt == ' ' ? fmt++, true : false; + const bool number_sign = *fmt == '#' ? fmt++, true : false; + const bool zero_padding = *fmt == '0' ? fmt++, true : false; + + // read width + const u32 width = [&]() -> u32 + { + u32 width = 0; + + if (*fmt == '*') + { + fmt++; + return context.get_next_gpr_arg(g_count, f_count, v_count); + } + + while (*fmt - '0' < 10) + { + width = width * 10 + (*fmt++ - '0'); + } + + return width; + }(); + + // read precision + const u32 prec = [&]() -> u32 + { + u32 prec = 0; + + if (*fmt != '.') + { + return 0; + } + + if (*++fmt == '*') + { + fmt++; + return context.get_next_gpr_arg(g_count, f_count, v_count); + } + + while (*fmt - '0' < 10) + { + prec = prec * 10 + (*fmt++ - '0'); + } + + return prec; + }(); + + switch (char cf = *fmt++) + { + case '%': + { + if (plus_sign || minus_sign || space_sign || number_sign || zero_padding || width || prec) break; + + result += '%'; + continue; + } + case 'd': + case 'i': + { + // signed decimal + const s64 value = context.get_next_gpr_arg(g_count, f_count, v_count); + + if (plus_sign || minus_sign || space_sign || number_sign || zero_padding || width || prec) break; + + result += fmt::to_sdec(value); + continue; + } + case 'x': + case 'X': + { + // hexadecimal + const u64 value = context.get_next_gpr_arg(g_count, f_count, v_count); + + if (plus_sign || minus_sign || space_sign || prec) break; + + if (number_sign && value) + { + result += cf == 'x' ? "0x" : "0X"; + } + + const std::string& hex = cf == 'x' ? fmt::to_hex(value) : fmt::toupper(fmt::to_hex(value)); + + if (hex.length() >= width) + { + result += hex; + } + else if (zero_padding) + { + result += std::string(width - hex.length(), '0') + hex; + } + else + { + result += hex + std::string(width - hex.length(), ' '); + } + continue; + } + case 's': + { + // string + auto string = vm::ptr::make(context.get_next_gpr_arg(g_count, f_count, v_count)); + + if (plus_sign || minus_sign || space_sign || number_sign || zero_padding || width || prec) break; + + result += string.get_ptr(); + continue; + } + } + + throw fmt::format("ps3_fmt(): unknown formatting: '%s'", start.get_ptr()); + } + } + + result += c; + } + + return result; +} + int _sys_heap_create_heap(const u32 heap_addr, const u32 align, const u32 size) { sysPrxForUser.Warning("_sys_heap_create_heap(heap_addr=0x%x, align=0x%x, size=0x%x)", heap_addr, align, size); @@ -393,12 +527,26 @@ s32 _sys_spu_printf_detach_thread(PPUThread& CPU, u32 thread) return spu_printf_dtcb(CPU, thread); } -s32 _sys_snprintf(vm::ptr dst, u32 count, vm::ptr fmt) // va_args... +s32 _sys_snprintf(PPUThread& CPU, vm::ptr dst, u32 count, vm::ptr fmt) // va_args... { - sysPrxForUser.Todo("_sys_snprintf(dst_addr=0x%x, count=%d, fmt_addr=0x%x['%s'], ...)", dst.addr(), count, fmt.addr(), fmt.get_ptr()); + sysPrxForUser.Warning("_sys_snprintf(dst=0x%x, count=%d, fmt=0x%x, ...)", dst, count, fmt); - Emu.Pause(); - return 0; + std::string result = ps3_fmt(CPU, fmt, 3, 0, 0); + + sysPrxForUser.Warning("*** '%s' -> '%s'", fmt.get_ptr(), result); + + if (!count) + { + return 0; // ??? + } + else + { + count = (u32)std::min(count - 1, result.size()); + + memcpy(dst.get_ptr(), result.c_str(), count); + dst[count] = 0; + return count; + } } s32 _sys_printf(vm::ptr fmt) // va_args... @@ -411,7 +559,7 @@ s32 _sys_printf(vm::ptr fmt) // va_args... return CELL_OK; } -s32 _unnamed_E75C40F2(u32 dest) +s32 _nid_E75C40F2(u32 dest) { sysPrxForUser.Todo("Unnamed function 0xE75C40F2 (dest=0x%x) -> CELL_ENOENT", dest); @@ -444,66 +592,66 @@ Module sysPrxForUser("sysPrxForUser", []() REG_FUNC(sysPrxForUser, sys_lwmutex_trylock); REG_FUNC(sysPrxForUser, sys_lwmutex_unlock); - sysPrxForUser.AddFunc(0x8461e528, sys_time_get_system_time); + REG_FUNC(sysPrxForUser, sys_time_get_system_time); - sysPrxForUser.AddFunc(0xe6f2c1e7, sys_process_exit); - sysPrxForUser.AddFunc(0x2c847572, _sys_process_atexitspawn); - sysPrxForUser.AddFunc(0x96328741, _sys_process_at_Exitspawn); - sysPrxForUser.AddFunc(0x4f7172c9, sys_process_is_stack); + REG_FUNC(sysPrxForUser, sys_process_exit); + REG_FUNC(sysPrxForUser, _sys_process_atexitspawn); + REG_FUNC(sysPrxForUser, _sys_process_at_Exitspawn); + REG_FUNC(sysPrxForUser, sys_process_is_stack); - sysPrxForUser.AddFunc(0x24a1ea07, sys_ppu_thread_create); - sysPrxForUser.AddFunc(0x350d454e, sys_ppu_thread_get_id); - sysPrxForUser.AddFunc(0xaff080a4, sys_ppu_thread_exit); - sysPrxForUser.AddFunc(0xa3e3be68, sys_ppu_thread_once); + REG_FUNC(sysPrxForUser, sys_ppu_thread_create); + REG_FUNC(sysPrxForUser, sys_ppu_thread_get_id); + REG_FUNC(sysPrxForUser, sys_ppu_thread_exit); + REG_FUNC(sysPrxForUser, sys_ppu_thread_once); - sysPrxForUser.AddFunc(0x26090058, sys_prx_load_module); - sysPrxForUser.AddFunc(0x9f18429d, sys_prx_start_module); - sysPrxForUser.AddFunc(0x80fb0c19, sys_prx_stop_module); - sysPrxForUser.AddFunc(0xf0aece0d, sys_prx_unload_module); - sysPrxForUser.AddFunc(0x42b23552, sys_prx_register_library); - sysPrxForUser.AddFunc(0xd0ea47a7, sys_prx_unregister_library); - sysPrxForUser.AddFunc(0xa5d06bf0, sys_prx_get_module_list); - sysPrxForUser.AddFunc(0x84bb6774, sys_prx_get_module_info); - sysPrxForUser.AddFunc(0xe0998dbf, sys_prx_get_module_id_by_name); - sysPrxForUser.AddFunc(0xaa6d9bff, sys_prx_load_module_on_memcontainer); - sysPrxForUser.AddFunc(0xa2c7ba64, sys_prx_exitspawn_with_level); + REG_FUNC(sysPrxForUser, sys_prx_load_module); + REG_FUNC(sysPrxForUser, sys_prx_start_module); + REG_FUNC(sysPrxForUser, sys_prx_stop_module); + REG_FUNC(sysPrxForUser, sys_prx_unload_module); + REG_FUNC(sysPrxForUser, sys_prx_register_library); + REG_FUNC(sysPrxForUser, sys_prx_unregister_library); + REG_FUNC(sysPrxForUser, sys_prx_get_module_list); + REG_FUNC(sysPrxForUser, sys_prx_get_module_info); + REG_FUNC(sysPrxForUser, sys_prx_get_module_id_by_name); + REG_FUNC(sysPrxForUser, sys_prx_load_module_on_memcontainer); + REG_FUNC(sysPrxForUser, sys_prx_exitspawn_with_level); - sysPrxForUser.AddFunc(0x35168520, _sys_heap_malloc); - //sysPrxForUser.AddFunc(0xaede4b03, _sys_heap_free); - //sysPrxForUser.AddFunc(0x8a561d92, _sys_heap_delete_heap); - sysPrxForUser.AddFunc(0xb2fcf2c8, _sys_heap_create_heap); - sysPrxForUser.AddFunc(0x44265c08, _sys_heap_memalign); + REG_FUNC(sysPrxForUser, _sys_heap_malloc); + //REG_FUNC(sysPrxForUser, _sys_heap_free); + //REG_FUNC(sysPrxForUser, _sys_heap_delete_heap); + REG_FUNC(sysPrxForUser, _sys_heap_create_heap); + REG_FUNC(sysPrxForUser, _sys_heap_memalign); - sysPrxForUser.AddFunc(0xb257540b, sys_mmapper_allocate_memory); - sysPrxForUser.AddFunc(0x70258515, sys_mmapper_allocate_memory_from_container); - sysPrxForUser.AddFunc(0xdc578057, sys_mmapper_map_memory); - sysPrxForUser.AddFunc(0x4643ba6e, sys_mmapper_unmap_memory); - sysPrxForUser.AddFunc(0x409ad939, sys_mmapper_free_memory); + REG_FUNC(sysPrxForUser, sys_mmapper_allocate_memory); + REG_FUNC(sysPrxForUser, sys_mmapper_allocate_memory_from_container); + REG_FUNC(sysPrxForUser, sys_mmapper_map_memory); + REG_FUNC(sysPrxForUser, sys_mmapper_unmap_memory); + REG_FUNC(sysPrxForUser, sys_mmapper_free_memory); - sysPrxForUser.AddFunc(0x1ed454ce, sys_spu_elf_get_information); - sysPrxForUser.AddFunc(0xdb6b3250, sys_spu_elf_get_segments); - sysPrxForUser.AddFunc(0xebe5f72f, sys_spu_image_import); - sysPrxForUser.AddFunc(0xe0da8efd, sys_spu_image_close); + REG_FUNC(sysPrxForUser, sys_spu_elf_get_information); + REG_FUNC(sysPrxForUser, sys_spu_elf_get_segments); + REG_FUNC(sysPrxForUser, sys_spu_image_import); + REG_FUNC(sysPrxForUser, sys_spu_image_close); - sysPrxForUser.AddFunc(0x893305fa, sys_raw_spu_load); - sysPrxForUser.AddFunc(0xb995662e, sys_raw_spu_image_load); + REG_FUNC(sysPrxForUser, sys_raw_spu_load); + REG_FUNC(sysPrxForUser, sys_raw_spu_image_load); - sysPrxForUser.AddFunc(0xda0eb71a, sys_lwcond_create); - sysPrxForUser.AddFunc(0x1c9a942c, sys_lwcond_destroy); - sysPrxForUser.AddFunc(0xef87a695, sys_lwcond_signal); - sysPrxForUser.AddFunc(0xe9a1bd84, sys_lwcond_signal_all); - sysPrxForUser.AddFunc(0x52aadadf, sys_lwcond_signal_to); - sysPrxForUser.AddFunc(0x2a6d9d51, sys_lwcond_wait); + REG_FUNC(sysPrxForUser, sys_lwcond_create); + REG_FUNC(sysPrxForUser, sys_lwcond_destroy); + REG_FUNC(sysPrxForUser, sys_lwcond_signal); + REG_FUNC(sysPrxForUser, sys_lwcond_signal_all); + REG_FUNC(sysPrxForUser, sys_lwcond_signal_to); + REG_FUNC(sysPrxForUser, sys_lwcond_wait); - sysPrxForUser.AddFunc(0x71a8472a, sys_get_random_number); + REG_FUNC(sysPrxForUser, sys_get_random_number); - sysPrxForUser.AddFunc(0x8c2bb498, sys_spinlock_initialize); - sysPrxForUser.AddFunc(0xa285139d, sys_spinlock_lock); - sysPrxForUser.AddFunc(0x722a0254, sys_spinlock_trylock); - sysPrxForUser.AddFunc(0x5267cb35, sys_spinlock_unlock); + REG_FUNC(sysPrxForUser, sys_spinlock_initialize); + REG_FUNC(sysPrxForUser, sys_spinlock_lock); + REG_FUNC(sysPrxForUser, sys_spinlock_trylock); + REG_FUNC(sysPrxForUser, sys_spinlock_unlock); - sysPrxForUser.AddFunc(0x67f9fedb, sys_game_process_exitspawn2); - sysPrxForUser.AddFunc(0xfc52a7a9, sys_game_process_exitspawn); + REG_FUNC(sysPrxForUser, sys_game_process_exitspawn2); + REG_FUNC(sysPrxForUser, sys_game_process_exitspawn); REG_FUNC(sysPrxForUser, _sys_memset); REG_FUNC(sysPrxForUser, _sys_memcpy); @@ -525,5 +673,6 @@ Module sysPrxForUser("sysPrxForUser", []() REG_FUNC(sysPrxForUser, _sys_snprintf); REG_FUNC(sysPrxForUser, _sys_printf); - sysPrxForUser.AddFunc(0xe75c40f2, _unnamed_E75C40F2); // real name is unknown -}); \ No newline at end of file + + REG_UNNAMED(sysPrxForUser, E75C40F2); +}); diff --git a/rpcs3/Emu/SysCalls/Modules/sys_http.cpp b/rpcs3/Emu/SysCalls/Modules/sys_http.cpp index b96bbebafa..94aa8fb720 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_http.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_http.cpp @@ -590,115 +590,115 @@ void sys_http_init() { // (TODO: Find addresses for cellHttpClientSetSendBufferSize and cellHttpClientGetSendBufferSize) - sys_http.AddFunc(0x250c386c, cellHttpInit); - sys_http.AddFunc(0xd276ff1f, cellHttpEnd); - sys_http.AddFunc(0x522180bc, cellHttpsInit); - sys_http.AddFunc(0xe6d4202f, cellHttpsEnd); - sys_http.AddFunc(0x0d896b97, cellHttpSetProxy); - sys_http.AddFunc(0x2a87603a, cellHttpGetProxy); + REG_FUNC(sys_http, cellHttpInit); + REG_FUNC(sys_http, cellHttpEnd); + REG_FUNC(sys_http, cellHttpsInit); + REG_FUNC(sys_http, cellHttpsEnd); + REG_FUNC(sys_http, cellHttpSetProxy); + REG_FUNC(sys_http, cellHttpGetProxy); - sys_http.AddFunc(0x9638f766, cellHttpInitCookie); - sys_http.AddFunc(0x61b2bade, cellHttpEndCookie); - sys_http.AddFunc(0x1b5bdcc6, cellHttpAddCookieWithClientId); - sys_http.AddFunc(0xad6a2e5b, cellHttpSessionCookieFlush); - sys_http.AddFunc(0xf972c733, cellHttpCookieExportWithClientId); - sys_http.AddFunc(0x0d846d63, cellHttpCookieImportWithClientId); - sys_http.AddFunc(0x4d915204, cellHttpClientSetCookieSendCallback); - sys_http.AddFunc(0x13fe767b, cellHttpClientSetCookieRecvCallback); + REG_FUNC(sys_http, cellHttpInitCookie); + REG_FUNC(sys_http, cellHttpEndCookie); + REG_FUNC(sys_http, cellHttpAddCookieWithClientId); + REG_FUNC(sys_http, cellHttpSessionCookieFlush); + REG_FUNC(sys_http, cellHttpCookieExportWithClientId); + REG_FUNC(sys_http, cellHttpCookieImportWithClientId); + REG_FUNC(sys_http, cellHttpClientSetCookieSendCallback); + REG_FUNC(sys_http, cellHttpClientSetCookieRecvCallback); - sys_http.AddFunc(0x4e4ee53a, cellHttpCreateClient); - sys_http.AddFunc(0x980855ac, cellHttpDestroyClient); - sys_http.AddFunc(0x660d42a9, cellHttpClientSetAuthenticationCallback); - sys_http.AddFunc(0xb6feb84b, cellHttpClientSetTransactionStateCallback); - sys_http.AddFunc(0x473cd9f1, cellHttpClientSetRedirectCallback); + REG_FUNC(sys_http, cellHttpCreateClient); + REG_FUNC(sys_http, cellHttpDestroyClient); + REG_FUNC(sys_http, cellHttpClientSetAuthenticationCallback); + REG_FUNC(sys_http, cellHttpClientSetTransactionStateCallback); + REG_FUNC(sys_http, cellHttpClientSetRedirectCallback); - sys_http.AddFunc(0xd7d3cd5d, cellHttpClientSetProxy); - sys_http.AddFunc(0x4d40cf98, cellHttpClientGetProxy); - sys_http.AddFunc(0x40547d8b, cellHttpClientSetVersion); - sys_http.AddFunc(0xdc405507, cellHttpClientGetVersion); - sys_http.AddFunc(0x296a46cf, cellHttpClientSetPipeline); - sys_http.AddFunc(0x2a1f28f6, cellHttpClientGetPipeline); - sys_http.AddFunc(0x5d473170, cellHttpClientSetKeepAlive); - sys_http.AddFunc(0x591c21a8, cellHttpClientGetKeepAlive); - sys_http.AddFunc(0x211d8ba3, cellHttpClientSetAutoRedirect); - sys_http.AddFunc(0x2960e309, cellHttpClientGetAutoRedirect); - sys_http.AddFunc(0x8eaf47a3, cellHttpClientSetAutoAuthentication); - sys_http.AddFunc(0x5980a293, cellHttpClientGetAutoAuthentication); - sys_http.AddFunc(0x6eed4999, cellHttpClientSetAuthenticationCacheStatus); - sys_http.AddFunc(0xfce39343, cellHttpClientGetAuthenticationCacheStatus); - sys_http.AddFunc(0x434419c8, cellHttpClientSetCookieStatus); - sys_http.AddFunc(0xeb9c1e5e, cellHttpClientGetCookieStatus); - sys_http.AddFunc(0xcac9fc34, cellHttpClientSetUserAgent); - sys_http.AddFunc(0xee05b0c1, cellHttpClientGetUserAgent); - sys_http.AddFunc(0xadd66b5c, cellHttpClientSetResponseBufferMax); - sys_http.AddFunc(0x6884cdb7, cellHttpClientGetResponseBufferMax); + REG_FUNC(sys_http, cellHttpClientSetProxy); + REG_FUNC(sys_http, cellHttpClientGetProxy); + REG_FUNC(sys_http, cellHttpClientSetVersion); + REG_FUNC(sys_http, cellHttpClientGetVersion); + REG_FUNC(sys_http, cellHttpClientSetPipeline); + REG_FUNC(sys_http, cellHttpClientGetPipeline); + REG_FUNC(sys_http, cellHttpClientSetKeepAlive); + REG_FUNC(sys_http, cellHttpClientGetKeepAlive); + REG_FUNC(sys_http, cellHttpClientSetAutoRedirect); + REG_FUNC(sys_http, cellHttpClientGetAutoRedirect); + REG_FUNC(sys_http, cellHttpClientSetAutoAuthentication); + REG_FUNC(sys_http, cellHttpClientGetAutoAuthentication); + REG_FUNC(sys_http, cellHttpClientSetAuthenticationCacheStatus); + REG_FUNC(sys_http, cellHttpClientGetAuthenticationCacheStatus); + REG_FUNC(sys_http, cellHttpClientSetCookieStatus); + REG_FUNC(sys_http, cellHttpClientGetCookieStatus); + REG_FUNC(sys_http, cellHttpClientSetUserAgent); + REG_FUNC(sys_http, cellHttpClientGetUserAgent); + REG_FUNC(sys_http, cellHttpClientSetResponseBufferMax); + REG_FUNC(sys_http, cellHttpClientGetResponseBufferMax); - sys_http.AddFunc(0x2033b878, cellHttpClientCloseAllConnections); - sys_http.AddFunc(0x27f86d70, cellHttpClientCloseConnections); - sys_http.AddFunc(0xadc0a4b2, cellHttpClientPollConnections); - sys_http.AddFunc(0x224e1610, cellHttpClientSetRecvTimeout); - sys_http.AddFunc(0xba78e51f, cellHttpClientGetRecvTimeout); - sys_http.AddFunc(0x71714cdc, cellHttpClientSetSendTimeout); - sys_http.AddFunc(0x271a0b06, cellHttpClientGetSendTimeout); - sys_http.AddFunc(0xd7471088, cellHttpClientSetConnTimeout); - sys_http.AddFunc(0x14bfc765, cellHttpClientGetConnTimeout); - sys_http.AddFunc(0x8aa5fcd3, cellHttpClientSetTotalPoolSize); - sys_http.AddFunc(0x070f1020, cellHttpClientGetTotalPoolSize); - sys_http.AddFunc(0xab1c55ab, cellHttpClientSetPerHostPoolSize); - sys_http.AddFunc(0xffc74003, cellHttpClientGetPerHostPoolSize); - sys_http.AddFunc(0x595adee9, cellHttpClientSetPerHostKeepAliveMax); - sys_http.AddFunc(0x46bcc9ff, cellHttpClientGetPerHostKeepAliveMax); - sys_http.AddFunc(0xdc7ed599, cellHttpClientSetPerPipelineMax); - sys_http.AddFunc(0xd06c90a4, cellHttpClientGetPerPipelineMax); - sys_http.AddFunc(0xbf6e3659, cellHttpClientSetRecvBufferSize); - sys_http.AddFunc(0x130150ea, cellHttpClientGetRecvBufferSize); + REG_FUNC(sys_http, cellHttpClientCloseAllConnections); + REG_FUNC(sys_http, cellHttpClientCloseConnections); + REG_FUNC(sys_http, cellHttpClientPollConnections); + REG_FUNC(sys_http, cellHttpClientSetRecvTimeout); + REG_FUNC(sys_http, cellHttpClientGetRecvTimeout); + REG_FUNC(sys_http, cellHttpClientSetSendTimeout); + REG_FUNC(sys_http, cellHttpClientGetSendTimeout); + REG_FUNC(sys_http, cellHttpClientSetConnTimeout); + REG_FUNC(sys_http, cellHttpClientGetConnTimeout); + REG_FUNC(sys_http, cellHttpClientSetTotalPoolSize); + REG_FUNC(sys_http, cellHttpClientGetTotalPoolSize); + REG_FUNC(sys_http, cellHttpClientSetPerHostPoolSize); + REG_FUNC(sys_http, cellHttpClientGetPerHostPoolSize); + REG_FUNC(sys_http, cellHttpClientSetPerHostKeepAliveMax); + REG_FUNC(sys_http, cellHttpClientGetPerHostKeepAliveMax); + REG_FUNC(sys_http, cellHttpClientSetPerPipelineMax); + REG_FUNC(sys_http, cellHttpClientGetPerPipelineMax); + REG_FUNC(sys_http, cellHttpClientSetRecvBufferSize); + REG_FUNC(sys_http, cellHttpClientGetRecvBufferSize); //sys_http.AddFunc(, cellHttpClientSetSendBufferSize); //sys_http.AddFunc(, cellHttpClientGetSendBufferSize); - sys_http.AddFunc(0x0d9c65be, cellHttpClientGetAllHeaders); - sys_http.AddFunc(0xa34c4b6f, cellHttpClientSetHeader); - sys_http.AddFunc(0xd1ec0b25, cellHttpClientGetHeader); - sys_http.AddFunc(0x4b33942a, cellHttpClientAddHeader); - sys_http.AddFunc(0x617eec02, cellHttpClientDeleteHeader); + REG_FUNC(sys_http, cellHttpClientGetAllHeaders); + REG_FUNC(sys_http, cellHttpClientSetHeader); + REG_FUNC(sys_http, cellHttpClientGetHeader); + REG_FUNC(sys_http, cellHttpClientAddHeader); + REG_FUNC(sys_http, cellHttpClientDeleteHeader); - sys_http.AddFunc(0x1395d8d1, cellHttpClientSetSslCallback); - sys_http.AddFunc(0xd8352a40, cellHttpClientSetSslClientCertificate); + REG_FUNC(sys_http, cellHttpClientSetSslCallback); + REG_FUNC(sys_http, cellHttpClientSetSslClientCertificate); - sys_http.AddFunc(0x052a80d9, cellHttpCreateTransaction); - sys_http.AddFunc(0x32f5cae2, cellHttpDestroyTransaction); - sys_http.AddFunc(0x0ef17399, cellHttpTransactionGetUri); - sys_http.AddFunc(0xa0d9223c, cellHttpTransactionCloseConnection); - sys_http.AddFunc(0xd47cc666, cellHttpTransactionReleaseConnection); - sys_http.AddFunc(0x2d52848b, cellHttpTransactionAbortConnection); + REG_FUNC(sys_http, cellHttpCreateTransaction); + REG_FUNC(sys_http, cellHttpDestroyTransaction); + REG_FUNC(sys_http, cellHttpTransactionGetUri); + REG_FUNC(sys_http, cellHttpTransactionCloseConnection); + REG_FUNC(sys_http, cellHttpTransactionReleaseConnection); + REG_FUNC(sys_http, cellHttpTransactionAbortConnection); - sys_http.AddFunc(0xa755b005, cellHttpSendRequest); - sys_http.AddFunc(0xaf73a64e, cellHttpRequestSetContentLength); - sys_http.AddFunc(0x958323cf, cellHttpRequestGetContentLength); - sys_http.AddFunc(0x8e3f7ee1, cellHttpRequestSetChunkedTransferStatus); - sys_http.AddFunc(0x4137a1f6, cellHttpRequestGetChunkedTransferStatus); - sys_http.AddFunc(0x42205fe0, cellHttpRequestGetAllHeaders); - sys_http.AddFunc(0x54f2a4de, cellHttpRequestSetHeader); - sys_http.AddFunc(0x0b9fea5f, cellHttpRequestGetHeader); - sys_http.AddFunc(0xed993147, cellHttpRequestAddHeader); - sys_http.AddFunc(0x16214411, cellHttpRequestDeleteHeader); + REG_FUNC(sys_http, cellHttpSendRequest); + REG_FUNC(sys_http, cellHttpRequestSetContentLength); + REG_FUNC(sys_http, cellHttpRequestGetContentLength); + REG_FUNC(sys_http, cellHttpRequestSetChunkedTransferStatus); + REG_FUNC(sys_http, cellHttpRequestGetChunkedTransferStatus); + REG_FUNC(sys_http, cellHttpRequestGetAllHeaders); + REG_FUNC(sys_http, cellHttpRequestSetHeader); + REG_FUNC(sys_http, cellHttpRequestGetHeader); + REG_FUNC(sys_http, cellHttpRequestAddHeader); + REG_FUNC(sys_http, cellHttpRequestDeleteHeader); - sys_http.AddFunc(0x61c90691, cellHttpRecvResponse); - sys_http.AddFunc(0xbea17389, cellHttpResponseGetAllHeaders); - sys_http.AddFunc(0x4f5d8d20, cellHttpResponseGetHeader); - sys_http.AddFunc(0x464ff889, cellHttpResponseGetContentLength); - sys_http.AddFunc(0x10d0d7fc, cellHttpResponseGetStatusCode); - sys_http.AddFunc(0x6a81b5e4, cellHttpResponseGetStatusLine); + REG_FUNC(sys_http, cellHttpRecvResponse); + REG_FUNC(sys_http, cellHttpResponseGetAllHeaders); + REG_FUNC(sys_http, cellHttpResponseGetHeader); + REG_FUNC(sys_http, cellHttpResponseGetContentLength); + REG_FUNC(sys_http, cellHttpResponseGetStatusCode); + REG_FUNC(sys_http, cellHttpResponseGetStatusLine); - sys_http.AddFunc(0x895c604c, cellHttpTransactionGetSslCipherName); - sys_http.AddFunc(0x34061e49, cellHttpTransactionGetSslCipherId); - sys_http.AddFunc(0x93e938e5, cellHttpTransactionGetSslCipherVersion); - sys_http.AddFunc(0x38954133, cellHttpTransactionGetSslCipherBits); - sys_http.AddFunc(0xe3c424b3, cellHttpTransactionGetSslCipherString); - sys_http.AddFunc(0xad1c6f02, cellHttpTransactionGetSslVersion); - sys_http.AddFunc(0x2a78ff04, cellHttpTransactionGetSslId); + REG_FUNC(sys_http, cellHttpTransactionGetSslCipherName); + REG_FUNC(sys_http, cellHttpTransactionGetSslCipherId); + REG_FUNC(sys_http, cellHttpTransactionGetSslCipherVersion); + REG_FUNC(sys_http, cellHttpTransactionGetSslCipherBits); + REG_FUNC(sys_http, cellHttpTransactionGetSslCipherString); + REG_FUNC(sys_http, cellHttpTransactionGetSslVersion); + REG_FUNC(sys_http, cellHttpTransactionGetSslId); - sys_http.AddFunc(0x65691795, cellHttpClientSetSslVersion); - sys_http.AddFunc(0xccf57336, cellHttpClientGetSslVersion); - sys_http.AddFunc(0x7313c78d, cellHttpClientSetSslIdDestroyCallback); + REG_FUNC(sys_http, cellHttpClientSetSslVersion); + REG_FUNC(sys_http, cellHttpClientGetSslVersion); + REG_FUNC(sys_http, cellHttpClientSetSslIdDestroyCallback); } #endif diff --git a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp index be4a8701a8..6dce42e229 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp @@ -85,320 +85,324 @@ s32 getLastError() return errno; #endif } + #ifdef _WIN32 using pck_len_t = s32; #else using pck_len_t = u32; #endif -// Functions -int sys_net_accept(s32 s, vm::ptr addr, vm::ptr paddrlen) +namespace sys_net_func { - sys_net.Warning("accept(s=%d, family_addr=0x%x, paddrlen=0x%x)", s, addr.addr(), paddrlen.addr()); - if (!addr) { - int ret = accept(s, nullptr, nullptr); + // Functions + s32 accept(s32 s, vm::ptr addr, vm::ptr paddrlen) + { + sys_net.Warning("accept(s=%d, family_addr=0x%x, paddrlen=0x%x)", s, addr.addr(), paddrlen.addr()); + if (!addr) { + int ret = ::accept(s, nullptr, nullptr); + *g_lastError = getLastError(); + return ret; + } + else { + sockaddr _addr; + memcpy(&_addr, addr.get_ptr(), sizeof(sockaddr)); + _addr.sa_family = addr->sa_family; + pck_len_t _paddrlen; + int ret = ::accept(s, &_addr, &_paddrlen); + *paddrlen = _paddrlen; + *g_lastError = getLastError(); + return ret; + } + } + + s32 bind(s32 s, vm::ptr addr, u32 addrlen) + { + sys_net.Warning("bind(s=%d, family_addr=0x%x, addrlen=%d)", s, addr.addr(), addrlen); + sockaddr_in saddr; + memcpy(&saddr, addr.get_ptr(), sizeof(sockaddr_in)); + saddr.sin_family = addr->sin_family; + const char *ipaddr = inet_ntoa(saddr.sin_addr); + sys_net.Warning("binding on %s to port %d", ipaddr, ntohs(saddr.sin_port)); + int ret = ::bind(s, (const sockaddr *)&saddr, addrlen); *g_lastError = getLastError(); return ret; } - else { + + s32 connect(s32 s, vm::ptr addr, u32 addrlen) + { + sys_net.Warning("connect(s=%d, family_addr=0x%x, addrlen=%d)", s, addr.addr(), addrlen); + sockaddr_in saddr; + memcpy(&saddr, addr.get_ptr(), sizeof(sockaddr_in)); + saddr.sin_family = addr->sin_family; + const char *ipaddr = inet_ntoa(saddr.sin_addr); + sys_net.Warning("connecting on %s to port %d", ipaddr, ntohs(saddr.sin_port)); + int ret = ::connect(s, (const sockaddr *)&saddr, addrlen); + *g_lastError = getLastError(); + return ret; + } + + s32 gethostbyaddr() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 gethostbyname() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 getpeername() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 getsockname() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 getsockopt() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 inet_addr(vm::ptr cp) + { + sys_net.Warning("inet_addr(cp_addr=0x%x['%s'])", cp.addr(), cp.get_ptr()); + return htonl(::inet_addr(cp.get_ptr())); // return a big-endian IP address (WTF? function should return LITTLE-ENDIAN value) + } + + s32 inet_aton() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 inet_lnaof() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 inet_makeaddr() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 inet_netof() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 inet_network() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 inet_ntoa() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 inet_ntop() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 inet_pton(s32 af, vm::ptr src, vm::ptr dst) + { + sys_net.Warning("inet_pton(af=%d, src_addr=0x%x, dst_addr=0x%x)", af, src.addr(), dst.addr()); + + return ::inet_pton(af, src.get_ptr(), dst.get_ptr()); + } + + s32 listen(s32 s, s32 backlog) + { + sys_net.Warning("listen(s=%d, backlog=%d)", s, backlog); + int ret = ::listen(s, backlog); + *g_lastError = getLastError(); + return ret; + } + + s32 recv(s32 s, vm::ptr buf, u32 len, s32 flags) + { + sys_net.Warning("recv(s=%d, buf_addr=0x%x, len=%d, flags=0x%x)", s, buf.addr(), len, flags); + + int ret = ::recv(s, buf.get_ptr(), len, flags); + *g_lastError = getLastError(); + return ret; + } + + s32 recvfrom(s32 s, vm::ptr buf, u32 len, s32 flags, vm::ptr addr, vm::ptr paddrlen) + { + sys_net.Warning("recvfrom(s=%d, buf_addr=0x%x, len=%d, flags=0x%x, addr_addr=0x%x, paddrlen=0x%x)", + s, buf.addr(), len, flags, addr.addr(), paddrlen.addr()); + sockaddr _addr; memcpy(&_addr, addr.get_ptr(), sizeof(sockaddr)); _addr.sa_family = addr->sa_family; pck_len_t _paddrlen; - int ret = accept(s, &_addr, &_paddrlen); + int ret = ::recvfrom(s, buf.get_ptr(), len, flags, &_addr, &_paddrlen); *paddrlen = _paddrlen; *g_lastError = getLastError(); return ret; } -} -int sys_net_bind(s32 s, vm::ptr addr, u32 addrlen) -{ - sys_net.Warning("bind(s=%d, family_addr=0x%x, addrlen=%d)", s, addr.addr(), addrlen); - sockaddr_in saddr; - memcpy(&saddr, addr.get_ptr(), sizeof(sockaddr_in)); - saddr.sin_family = addr->sin_family; - const char *ipaddr = inet_ntoa(saddr.sin_addr); - sys_net.Warning("binding on %s to port %d", ipaddr, ntohs(saddr.sin_port)); - int ret = bind(s, (const sockaddr *)&saddr, addrlen); - *g_lastError = getLastError(); - return ret; -} + s32 recvmsg() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } -int sys_net_connect(s32 s, vm::ptr addr, u32 addrlen) -{ - sys_net.Warning("connect(s=%d, family_addr=0x%x, addrlen=%d)", s, addr.addr(), addrlen); - sockaddr_in saddr; - memcpy(&saddr, addr.get_ptr(), sizeof(sockaddr_in)); - saddr.sin_family = addr->sin_family; - const char *ipaddr = inet_ntoa(saddr.sin_addr); - sys_net.Warning("connecting on %s to port %d", ipaddr, ntohs(saddr.sin_port)); - int ret = connect(s, (const sockaddr *) &saddr, addrlen); - *g_lastError = getLastError(); - return ret; -} + s32 send(s32 s, vm::ptr buf, u32 len, s32 flags) + { + sys_net.Warning("send(s=%d, buf_addr=0x%x, len=%d, flags=0x%x)", s, buf.addr(), len, flags); -int gethostbyaddr() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} + int ret = ::send(s, buf.get_ptr(), len, flags); + *g_lastError = getLastError(); + return ret; + } -int gethostbyname() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} + s32 sendmsg() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } -int getpeername() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} + s32 sendto(s32 s, vm::ptr buf, u32 len, s32 flags, vm::ptr addr, u32 addrlen) + { + sys_net.Warning("sendto(s=%d, buf_addr=0x%x, len=%d, flags=0x%x, addr=0x%x, addrlen=%d)", + s, buf.addr(), len, flags, addr.addr(), addrlen); -int getsockname() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} + sockaddr _addr; + memcpy(&_addr, addr.get_ptr(), sizeof(sockaddr)); + _addr.sa_family = addr->sa_family; + int ret = ::sendto(s, buf.get_ptr(), len, flags, &_addr, addrlen); + *g_lastError = getLastError(); + return ret; + } -int getsockopt() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} + s32 setsockopt(s32 s, s32 level, s32 optname, vm::ptr optval, u32 optlen) + { + sys_net.Warning("socket(s=%d, level=%d, optname=%d, optval_addr=0x%x, optlen=%d)", s, level, optname, optval.addr(), optlen); -int sys_net_inet_addr(vm::ptr cp) -{ - sys_net.Warning("inet_addr(cp_addr=0x%x['%s'])", cp.addr(), cp.get_ptr()); - return htonl(inet_addr(cp.get_ptr())); // return a big-endian IP address -} + int ret = ::setsockopt(s, level, optname, optval.get_ptr(), optlen); + *g_lastError = getLastError(); + return ret; + } -int inet_aton() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} + s32 shutdown(s32 s, s32 how) + { + sys_net.Warning("shutdown(s=%d, how=%d)", s, how); + int ret = ::shutdown(s, how); + *g_lastError = getLastError(); + return ret; + } -int inet_lnaof() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} + s32 socket(s32 family, s32 type, s32 protocol) + { + sys_net.Warning("socket(family=%d, type=%d, protocol=%d)", family, type, protocol); + int ret = ::socket(family, type, protocol); + *g_lastError = getLastError(); + return ret; + } -int inet_makeaddr() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int inet_netof() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int inet_network() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int inet_ntoa() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int inet_ntop() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int sys_net_inet_pton(s32 af, vm::ptr src, vm::ptr dst) -{ - sys_net.Warning("inet_pton(af=%d, src_addr=0x%x, dst_addr=0x%x)", af, src.addr(), dst.addr()); - - return inet_pton(af, src.get_ptr(), dst.get_ptr()); -} - -int sys_net_listen(s32 s, s32 backlog) -{ - sys_net.Warning("listen(s=%d, backlog=%d)", s, backlog); - int ret = listen(s, backlog); - *g_lastError = getLastError(); - return ret; -} - -int sys_net_recv(s32 s, vm::ptr buf, u32 len, s32 flags) -{ - sys_net.Warning("recv(s=%d, buf_addr=0x%x, len=%d, flags=0x%x)", s, buf.addr(), len, flags); - - int ret = recv(s, buf.get_ptr(), len, flags); - *g_lastError = getLastError(); - return ret; -} - -int sys_net_recvfrom(s32 s, vm::ptr buf, u32 len, s32 flags, vm::ptr addr, vm::ptr paddrlen) -{ - sys_net.Warning("recvfrom(s=%d, buf_addr=0x%x, len=%d, flags=0x%x, addr_addr=0x%x, paddrlen=0x%x)", - s, buf.addr(), len, flags, addr.addr(), paddrlen.addr()); - - sockaddr _addr; - memcpy(&_addr, addr.get_ptr(), sizeof(sockaddr)); - _addr.sa_family = addr->sa_family; - pck_len_t _paddrlen; - int ret = recvfrom(s, buf.get_ptr(), len, flags, &_addr, &_paddrlen); - *paddrlen = _paddrlen; - *g_lastError = getLastError(); - return ret; -} - -int recvmsg() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int sys_net_send(s32 s, vm::ptr buf, u32 len, s32 flags) -{ - sys_net.Warning("send(s=%d, buf_addr=0x%x, len=%d, flags=0x%x)", s, buf.addr(), len, flags); - - int ret = send(s, buf.get_ptr(), len, flags); - *g_lastError = getLastError(); - return ret; -} - -int sendmsg() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int sys_net_sendto(s32 s, vm::ptr buf, u32 len, s32 flags, vm::ptr addr, u32 addrlen) -{ - sys_net.Warning("sendto(s=%d, buf_addr=0x%x, len=%d, flags=0x%x, addr=0x%x, addrlen=%d)", - s, buf.addr(), len, flags, addr.addr(), addrlen); - - sockaddr _addr; - memcpy(&_addr, addr.get_ptr(), sizeof(sockaddr)); - _addr.sa_family = addr->sa_family; - int ret = sendto(s, buf.get_ptr(), len, flags, &_addr, addrlen); - *g_lastError = getLastError(); - return ret; -} - -int sys_net_setsockopt(s32 s, s32 level, s32 optname, vm::ptr optval, u32 optlen) -{ - sys_net.Warning("socket(s=%d, level=%d, optname=%d, optval_addr=0x%x, optlen=%d)", s, level, optname, optval.addr(), optlen); - - int ret = setsockopt(s, level, optname, optval.get_ptr(), optlen); - *g_lastError = getLastError(); - return ret; -} - -int sys_net_shutdown(s32 s, s32 how) -{ - sys_net.Warning("shutdown(s=%d, how=%d)", s, how); - int ret = shutdown(s, how); - *g_lastError = getLastError(); - return ret; -} - -int sys_net_socket(s32 family, s32 type, s32 protocol) -{ - sys_net.Warning("socket(family=%d, type=%d, protocol=%d)", family, type, protocol); - int ret = socket(family, type, protocol); - *g_lastError = getLastError(); - return ret; -} - -int sys_net_socketclose(s32 s) -{ - sys_net.Warning("socket(s=%d)", s); + s32 socketclose(s32 s) + { + sys_net.Warning("socket(s=%d)", s); #ifdef _WIN32 - int ret = closesocket(s); + int ret = ::closesocket(s); #else - int ret = close(s); + int ret = ::close(s); #endif - *g_lastError = getLastError(); - return ret; + *g_lastError = getLastError(); + return ret; + } + + s32 socketpoll() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } + + s32 socketselect() + { + UNIMPLEMENTED_FUNC(sys_net); + return CELL_OK; + } } -int socketpoll() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int socketselect() -{ - UNIMPLEMENTED_FUNC(sys_net); - return CELL_OK; -} - -int sys_net_initialize_network_ex(vm::ptr param) +s32 sys_net_initialize_network_ex(vm::ptr param) { sys_net.Warning("sys_net_initialize_network_ex(param_addr=0x%x)", param.addr()); g_lastError = vm::ptr::make((u32)Memory.Alloc(4, 1)); #ifdef _WIN32 WSADATA wsaData; - WORD wVersionRequested = MAKEWORD(1,1); + WORD wVersionRequested = MAKEWORD(1, 1); WSAStartup(wVersionRequested, &wsaData); #endif return CELL_OK; } -int sys_net_get_udpp2p_test_param() +s32 sys_net_get_udpp2p_test_param() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_set_udpp2p_test_param() +s32 sys_net_set_udpp2p_test_param() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_get_lib_name_server() +s32 sys_net_get_lib_name_server() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_if_ctl() +s32 sys_net_if_ctl() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_get_netemu_test_param() +s32 sys_net_get_netemu_test_param() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_get_sockinfo() +s32 sys_net_get_sockinfo() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_close_dump() +s32 sys_net_close_dump() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_set_test_param() +s32 sys_net_set_test_param() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_show_nameserver() +s32 sys_net_show_nameserver() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; @@ -410,67 +414,67 @@ u32 _sys_net_errno_loc() return g_lastError.addr(); } -int sys_net_set_resolver_configurations() +s32 sys_net_set_resolver_configurations() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_show_route() +s32 sys_net_show_route() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_read_dump() +s32 sys_net_read_dump() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_abort_resolver() +s32 sys_net_abort_resolver() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_abort_socket() +s32 sys_net_abort_socket() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_set_lib_name_server() +s32 sys_net_set_lib_name_server() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_get_test_param() +s32 sys_net_get_test_param() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_get_sockinfo_ex() +s32 sys_net_get_sockinfo_ex() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_open_dump() +s32 sys_net_open_dump() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_show_ifconfig() +s32 sys_net_show_ifconfig() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_finalize_network() +s32 sys_net_finalize_network() { sys_net.Warning("sys_net_initialize_network_ex()"); Memory.Free(g_lastError.addr()); @@ -481,83 +485,83 @@ int sys_net_finalize_network() return CELL_OK; } -int _sys_net_h_errno_loc() +s32 _sys_net_h_errno_loc() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_set_netemu_test_param() +s32 sys_net_set_netemu_test_param() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } -int sys_net_free_thread_context() +s32 sys_net_free_thread_context() { UNIMPLEMENTED_FUNC(sys_net); return CELL_OK; } +// define additional macro for specific namespace +#define REG_FUNC_(name) add_ppu_func(ModuleFunc(get_function_id(#name), &sys_net, bind_func(sys_net_func::name))) + Module sys_net("sys_net", []() { - // The names of the following functions are modified to avoid overloading problems - sys_net.AddFunc(0xc94f6939, sys_net_accept); - sys_net.AddFunc(0xb0a59804, sys_net_bind); - sys_net.AddFunc(0x64f66d35, sys_net_connect); - //sys_net.AddFunc(0xf7ac8941, sys_net_gethostbyaddr); - //sys_net.AddFunc(0x71f4c717, sys_net_gethostbyname); - //sys_net.AddFunc(0xf9ec2db6, sys_net_getpeername); - //sys_net.AddFunc(0x13efe7f5, sys_net_getsockname); - //sys_net.AddFunc(0x5a045bd1, sys_net_getsockopt); - sys_net.AddFunc(0xdabbc2c0, sys_net_inet_addr); - //sys_net.AddFunc(0xa9a079e0, sys_net_inet_aton); - //sys_net.AddFunc(0x566893ce, sys_net_inet_lnaof); - //sys_net.AddFunc(0xb4152c74, sys_net_inet_makeaddr); - //sys_net.AddFunc(0xe39a62a7, sys_net_inet_netof); - //sys_net.AddFunc(0x506ad863, sys_net_inet_network); - //sys_net.AddFunc(0x858a930b, sys_net_inet_ntoa); - //sys_net.AddFunc(0xc98a3146, sys_net_inet_ntop); - sys_net.AddFunc(0x8af3825e, sys_net_inet_pton); - sys_net.AddFunc(0x28e208bb, sys_net_listen); - //sys_net.AddFunc(, sys_net_ntohl); - //sys_net.AddFunc(, sys_net_ntohs); - sys_net.AddFunc(0xfba04f37, sys_net_recv); - sys_net.AddFunc(0x1f953b9f, sys_net_recvfrom); - //sys_net.AddFunc(0xc9d09c34, sys_net_recvmsg); - sys_net.AddFunc(0xdc751b40, sys_net_send); - //sys_net.AddFunc(0xad09481b, sys_net_sendmsg); - sys_net.AddFunc(0x9647570b, sys_net_sendto); - sys_net.AddFunc(0x88f03575, sys_net_setsockopt); - sys_net.AddFunc(0xa50777c6, sys_net_shutdown); - sys_net.AddFunc(0x9c056962, sys_net_socket); - sys_net.AddFunc(0x6db6e8cd, sys_net_socketclose); - //sys_net.AddFunc(0x051ee3ee, sys_net_socketpoll); - //sys_net.AddFunc(0x3f09e20a, sys_net_socketselect); + REG_FUNC_(accept); + REG_FUNC_(bind); + REG_FUNC_(connect); + REG_FUNC_(gethostbyaddr); + REG_FUNC_(gethostbyname); + REG_FUNC_(getpeername); + REG_FUNC_(getsockname); + REG_FUNC_(getsockopt); + REG_FUNC_(inet_addr); + REG_FUNC_(inet_aton); + REG_FUNC_(inet_lnaof); + REG_FUNC_(inet_makeaddr); + REG_FUNC_(inet_netof); + REG_FUNC_(inet_network); + REG_FUNC_(inet_ntoa); + REG_FUNC_(inet_ntop); + REG_FUNC_(inet_pton); + REG_FUNC_(listen); + REG_FUNC_(recv); + REG_FUNC_(recvfrom); + REG_FUNC_(recvmsg); + REG_FUNC_(send); + REG_FUNC_(sendmsg); + REG_FUNC_(sendto); + REG_FUNC_(setsockopt); + REG_FUNC_(shutdown); + REG_FUNC_(socket); + REG_FUNC_(socketclose); + REG_FUNC_(socketpoll); + REG_FUNC_(socketselect); - sys_net.AddFunc(0x139a9e9b, sys_net_initialize_network_ex); - sys_net.AddFunc(0x05bd4438, sys_net_get_udpp2p_test_param); - sys_net.AddFunc(0x10b81ed6, sys_net_set_udpp2p_test_param); - sys_net.AddFunc(0x1d14d6e4, sys_net_get_lib_name_server); - sys_net.AddFunc(0x27fb339d, sys_net_if_ctl); - sys_net.AddFunc(0x368823c0, sys_net_get_netemu_test_param); - sys_net.AddFunc(0x3b27c780, sys_net_get_sockinfo); - sys_net.AddFunc(0x44328aa2, sys_net_close_dump); - sys_net.AddFunc(0x4ab0b9b9, sys_net_set_test_param); - sys_net.AddFunc(0x5420e419, sys_net_show_nameserver); - sys_net.AddFunc(0x6005cde1, _sys_net_errno_loc); - sys_net.AddFunc(0x7687d48c, sys_net_set_resolver_configurations); - sys_net.AddFunc(0x79b61646, sys_net_show_route); - sys_net.AddFunc(0x89c9917c, sys_net_read_dump); - sys_net.AddFunc(0x8ccf05ed, sys_net_abort_resolver); - sys_net.AddFunc(0x8d1b77fb, sys_net_abort_socket); - sys_net.AddFunc(0x9a318259, sys_net_set_lib_name_server); - sys_net.AddFunc(0xa5a86557, sys_net_get_test_param); - sys_net.AddFunc(0xa765d029, sys_net_get_sockinfo_ex); - sys_net.AddFunc(0xab447704, sys_net_open_dump); - sys_net.AddFunc(0xb48636c4, sys_net_show_ifconfig); - sys_net.AddFunc(0xb68d5625, sys_net_finalize_network); - sys_net.AddFunc(0xc9157d30, _sys_net_h_errno_loc); - sys_net.AddFunc(0xe2434507, sys_net_set_netemu_test_param); - sys_net.AddFunc(0xfdb8f926, sys_net_free_thread_context); + REG_FUNC(sys_net, sys_net_initialize_network_ex); + REG_FUNC(sys_net, sys_net_get_udpp2p_test_param); + REG_FUNC(sys_net, sys_net_set_udpp2p_test_param); + REG_FUNC(sys_net, sys_net_get_lib_name_server); + REG_FUNC(sys_net, sys_net_if_ctl); + REG_FUNC(sys_net, sys_net_get_netemu_test_param); + REG_FUNC(sys_net, sys_net_get_sockinfo); + REG_FUNC(sys_net, sys_net_close_dump); + REG_FUNC(sys_net, sys_net_set_test_param); + REG_FUNC(sys_net, sys_net_show_nameserver); + REG_FUNC(sys_net, _sys_net_errno_loc); + REG_FUNC(sys_net, sys_net_set_resolver_configurations); + REG_FUNC(sys_net, sys_net_show_route); + REG_FUNC(sys_net, sys_net_read_dump); + REG_FUNC(sys_net, sys_net_abort_resolver); + REG_FUNC(sys_net, sys_net_abort_socket); + REG_FUNC(sys_net, sys_net_set_lib_name_server); + REG_FUNC(sys_net, sys_net_get_test_param); + REG_FUNC(sys_net, sys_net_get_sockinfo_ex); + REG_FUNC(sys_net, sys_net_open_dump); + REG_FUNC(sys_net, sys_net_show_ifconfig); + REG_FUNC(sys_net, sys_net_finalize_network); + REG_FUNC(sys_net, _sys_net_h_errno_loc); + REG_FUNC(sys_net, sys_net_set_netemu_test_param); + REG_FUNC(sys_net, sys_net_free_thread_context); }); diff --git a/rpcs3/Emu/SysCalls/SC_FUNC.h b/rpcs3/Emu/SysCalls/SC_FUNC.h index 1a025f2f63..84605cab03 100644 --- a/rpcs3/Emu/SysCalls/SC_FUNC.h +++ b/rpcs3/Emu/SysCalls/SC_FUNC.h @@ -1,12 +1,7 @@ #pragma once #include "Emu/Cell/PPUThread.h" -class func_caller -{ -public: - virtual void operator()(PPUThread& CPU) = 0; - virtual ~func_caller(){}; -}; +typedef void(*ppu_func_caller)(PPUThread&); namespace ppu_func_detail { @@ -164,87 +159,56 @@ namespace ppu_func_detail }; template - class func_binder; + struct func_binder; template - class func_binder : public func_caller - { - typedef void(*func_t)(T...); - const func_t m_call; - - public: - func_binder(func_t call) - : func_caller() - , m_call(call) - { - } - - virtual void operator()(PPUThread& CPU) - { - call(m_call, iterate<0, 0, 0, T...>(CPU)); - } - }; - - template - class func_binder : public func_caller + struct func_binder { typedef void(*func_t)(PPUThread&, T...); - const func_t m_call; - public: - func_binder(func_t call) - : func_caller() - , m_call(call) + static void do_call(PPUThread& CPU, func_t _func) { - } - - virtual void operator()(PPUThread& CPU) - { - call(m_call, std::tuple_cat(std::tuple(CPU), iterate<0, 0, 0, T...>(CPU))); + call(_func, std::tuple_cat(std::tuple(CPU), iterate<0, 0, 0, T...>(CPU))); } }; - template - class func_binder : public func_caller + template + struct func_binder { - typedef RT(*func_t)(T...); - const func_t m_call; + typedef void(*func_t)(T...); - public: - func_binder(func_t call) - : func_caller() - , m_call(call) + static void do_call(PPUThread& CPU, func_t _func) { - } - - virtual void operator()(PPUThread& CPU) - { - bind_result::value>::func(CPU, call(m_call, iterate<0, 0, 0, T...>(CPU))); + call(_func, iterate<0, 0, 0, T...>(CPU)); } }; template - class func_binder : public func_caller + struct func_binder { typedef RT(*func_t)(PPUThread&, T...); - const func_t m_call; - public: - func_binder(func_t call) - : func_caller() - , m_call(call) + static void do_call(PPUThread& CPU, func_t _func) { + bind_result::value>::func(CPU, call(_func, std::tuple_cat(std::tuple(CPU), iterate<0, 0, 0, T...>(CPU)))); } + }; - virtual void operator()(PPUThread& CPU) + template + struct func_binder + { + typedef RT(*func_t)(T...); + + static void do_call(PPUThread& CPU, func_t _func) { - bind_result::value>::func(CPU, call(m_call, std::tuple_cat(std::tuple(CPU), iterate<0, 0, 0, T...>(CPU)))); + bind_result::value>::func(CPU, call(_func, iterate<0, 0, 0, T...>(CPU))); } }; } -template -func_caller* bind_func(RT(*call)(T...)) +template __forceinline void call_ppu_func(PPUThread& CPU, RT(*func)(T...)) { - return new ppu_func_detail::func_binder(call); + ppu_func_detail::func_binder::do_call(CPU, func); } + +#define bind_func(func) [](PPUThread& CPU){ call_ppu_func(CPU, func); } diff --git a/rpcs3/Emu/SysCalls/Static.cpp b/rpcs3/Emu/SysCalls/Static.cpp deleted file mode 100644 index 677b32c970..0000000000 --- a/rpcs3/Emu/SysCalls/Static.cpp +++ /dev/null @@ -1,217 +0,0 @@ -#include "stdafx.h" -#include "rpcs3/Ini.h" -#include "Utilities/Log.h" -#include "Emu/SysCalls/Modules.h" -#include "Static.h" - -void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base) -{ - u32* data = (u32*)ptr; size /= 4; - - if(!Ini.HLEHookStFunc.GetValue()) - return; - - // TODO: optimize search - for (u32 i = 0; i < size; i++) - { - for (u32 j = 0; j < m_static_funcs_list.size(); j++) - { - if ((data[i] & m_static_funcs_list[j]->ops[0].mask) == m_static_funcs_list[j]->ops[0].crc) - { - bool found = true; - u32 can_skip = 0; - for (u32 k = i, x = 0; x + 1 <= m_static_funcs_list[j]->ops.size(); k++, x++) - { - if (k >= size) - { - found = false; - break; - } - - // skip NOP - if (data[k] == se32(0x60000000)) - { - x--; - continue; - } - - const u32 mask = m_static_funcs_list[j]->ops[x].mask; - const u32 crc = m_static_funcs_list[j]->ops[x].crc; - - if (!mask) - { - // TODO: define syntax - if (crc < 4) // skip various number of instructions that don't match next pattern entry - { - can_skip += crc; - k--; // process this position again - } - else if (data[k] != crc) // skippable pattern ("optional" instruction), no mask allowed - { - k--; - if (can_skip) // cannot define this behaviour properly - { - LOG_WARNING(LOADER, "StaticAnalyse(): can_skip = %d (unchanged)", can_skip); - } - } - else - { - if (can_skip) // cannot define this behaviour properly - { - LOG_WARNING(LOADER, "StaticAnalyse(): can_skip = %d (set to 0)", can_skip); - can_skip = 0; - } - } - } - else if ((data[k] & mask) != crc) // masked pattern - { - if (can_skip) - { - can_skip--; - } - else - { - found = false; - break; - } - } - else - { - can_skip = 0; - } - } - if (found) - { - LOG_NOTICE(LOADER, "Function '%s' hooked (addr=0x%x)", m_static_funcs_list[j]->name, i * 4 + base); - m_static_funcs_list[j]->found++; - data[i+0] = re32(0x39600000 | j); // li r11, j - data[i+1] = se32(0x44000042); // sc 2 - data[i+2] = se32(0x4e800020); // blr - i += 2; // skip modified code - } - } - } - } - - // check function groups - for (u32 i = 0; i < m_static_funcs_list.size(); i++) - { - if (m_static_funcs_list[i]->found) // start from some group - { - const u64 group = m_static_funcs_list[i]->group; - - enum GroupSearchResult : u32 - { - GSR_SUCCESS = 0, // every function from this group has been found once - GSR_MISSING = 1, // (error) some function not found - GSR_EXCESS = 2, // (error) some function found twice or more - }; - u32 res = GSR_SUCCESS; - - // analyse - for (u32 j = 0; j < m_static_funcs_list.size(); j++) if (m_static_funcs_list[j]->group == group) - { - u32 count = m_static_funcs_list[j]->found; - - if (count == 0) // not found - { - // check if this function has been found with different pattern - for (u32 k = 0; k < m_static_funcs_list.size(); k++) if (m_static_funcs_list[k]->group == group) - { - if (k != j && m_static_funcs_list[k]->ptr == m_static_funcs_list[j]->ptr) - { - count += m_static_funcs_list[k]->found; - } - } - if (count == 0) - { - res |= GSR_MISSING; - LOG_ERROR(LOADER, "Function '%s' not found", m_static_funcs_list[j]->name); - } - else if (count > 1) - { - res |= GSR_EXCESS; - } - } - else if (count == 1) // found - { - // ensure that this function has NOT been found with different pattern - for (u32 k = 0; k < m_static_funcs_list.size(); k++) if (m_static_funcs_list[k]->group == group) - { - if (k != j && m_static_funcs_list[k]->ptr == m_static_funcs_list[j]->ptr) - { - if (m_static_funcs_list[k]->found) - { - res |= GSR_EXCESS; - LOG_ERROR(LOADER, "Function '%s' hooked twice", m_static_funcs_list[j]->name); - } - } - } - } - else - { - res |= GSR_EXCESS; - LOG_ERROR(LOADER, "Function '%s' hooked twice", m_static_funcs_list[j]->name); - } - } - - // clear data - for (u32 j = 0; j < m_static_funcs_list.size(); j++) - { - if (m_static_funcs_list[j]->group == group) m_static_funcs_list[j]->found = 0; - } - - char name[9] = "????????"; - - *(u64*)name = group; - - if (res == GSR_SUCCESS) - { - LOG_SUCCESS(LOADER, "Function group [%s] successfully hooked", std::string(name, 9).c_str()); - } - else - { - LOG_ERROR(LOADER, "Function group [%s] failed:%s%s", std::string(name, 9).c_str(), - (res & GSR_MISSING ? " missing;" : ""), - (res & GSR_EXCESS ? " excess;" : "")); - } - } - } -} - -void StaticFuncManager::StaticExecute(PPUThread& CPU, u32 code) -{ - if (code < m_static_funcs_list.size()) - { - (*m_static_funcs_list[code]->func)(CPU); - } - else - { - LOG_ERROR(LOADER, "StaticExecute(%d): unknown function or illegal opcode", code); - } -} - -void StaticFuncManager::StaticFinalize() -{ - for (SFunc *s : m_static_funcs_list) - { - delete s; - } - m_static_funcs_list.clear(); -} - -void StaticFuncManager::push_back(SFunc *ele) -{ - m_static_funcs_list.push_back(ele); -} - -SFunc *StaticFuncManager::operator[](size_t i) -{ - return m_static_funcs_list[i]; -} - -StaticFuncManager::~StaticFuncManager() -{ - StaticFinalize(); -} - diff --git a/rpcs3/Emu/SysCalls/Static.h b/rpcs3/Emu/SysCalls/Static.h deleted file mode 100644 index 5714148455..0000000000 --- a/rpcs3/Emu/SysCalls/Static.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -struct SFunc; - -class PPUThread; - -class StaticFuncManager -{ - std::vector m_static_funcs_list; -public: - void StaticAnalyse(void* ptr, u32 size, u32 base); - void StaticExecute(PPUThread& CPU, u32 code); - void StaticFinalize(); - void push_back(SFunc *ele); - SFunc *operator[](size_t i); - ~StaticFuncManager(); -}; diff --git a/rpcs3/Emu/SysCalls/SysCalls.cpp b/rpcs3/Emu/SysCalls/SysCalls.cpp index 53612a418c..6a6ed229d9 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.cpp +++ b/rpcs3/Emu/SysCalls/SysCalls.cpp @@ -42,17 +42,16 @@ namespace detail } } -void default_syscall(PPUThread& CPU); -static func_caller *null_func = bind_func(default_syscall); +void null_func(PPUThread& CPU); -static const int kSyscallTableLength = 1024; +const int kSyscallTableLength = 1024; // UNS = Unused // ROOT = Root // DBG = Debug // PM = Product Mode // AuthID = Authentication ID -static func_caller* sc_table[kSyscallTableLength] = +const ppu_func_caller sc_table[1024] = { null_func, bind_func(sys_process_getpid), //1 (0x001) @@ -897,25 +896,7 @@ static func_caller* sc_table[kSyscallTableLength] = null_func, null_func, null_func, bind_func(cellGcmCallback), //1023 UNS }; -/** HACK: Used to delete func_caller objects that get allocated and stored in sc_table (above). -* The destructor of this static object gets called when the program shuts down. -*/ -struct SyscallTableCleaner_t -{ - SyscallTableCleaner_t() {} - ~SyscallTableCleaner_t() - { - for (int i = 0; i < kSyscallTableLength; ++i) - { - if (sc_table[i] != null_func) - delete sc_table[i]; - } - - delete null_func; - } -} SyscallTableCleaner_t; - -void default_syscall(PPUThread& CPU) +void null_func(PPUThread& CPU) { u32 code = (u32)CPU.GPR[11]; //TODO: remove this @@ -952,7 +933,7 @@ void SysCalls::DoSyscall(PPUThread& CPU, u32 code) if(code < 1024) { - (*sc_table[code])(CPU); + sc_table[code](CPU); return; } @@ -967,4 +948,4 @@ IdManager& SysCallBase::GetIdManager() const bool SysCallBase::RemoveId(u32 id) { return Emu.GetIdManager().RemoveID(id); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/lv2/cellFs.cpp b/rpcs3/Emu/SysCalls/lv2/cellFs.cpp index 6363355a76..6695207b54 100644 --- a/rpcs3/Emu/SysCalls/lv2/cellFs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/cellFs.cpp @@ -1053,47 +1053,47 @@ Module sys_fs("sys_fs", []() g_FsAioReadCur = 0; aio_init = false; - sys_fs.AddFunc(0x718bf5f8, cellFsOpen); - sys_fs.AddFunc(0xb1840b53, cellFsSdataOpen); - sys_fs.AddFunc(0x6d3bb15b, cellFsSdataOpenByFd); - sys_fs.AddFunc(0x4d5ff8e2, cellFsRead); - sys_fs.AddFunc(0xecdcf2ab, cellFsWrite); - sys_fs.AddFunc(0x2cb51f0d, cellFsClose); - sys_fs.AddFunc(0x3f61245c, cellFsOpendir); - sys_fs.AddFunc(0x5c74903d, cellFsReaddir); - sys_fs.AddFunc(0xff42dcc3, cellFsClosedir); - sys_fs.AddFunc(0x7de6dced, cellFsStat); - sys_fs.AddFunc(0xef3efa34, cellFsFstat); - sys_fs.AddFunc(0xba901fe6, cellFsMkdir); - sys_fs.AddFunc(0xf12eecc8, cellFsRename); - sys_fs.AddFunc(0x99406d0b, cellFsChmod); - sys_fs.AddFunc(0x967a162b, cellFsFsync); - sys_fs.AddFunc(0x2796fdf3, cellFsRmdir); - sys_fs.AddFunc(0x7f4677a8, cellFsUnlink); - sys_fs.AddFunc(0xa397d042, cellFsLseek); - sys_fs.AddFunc(0x0e2939e5, cellFsFtruncate); - sys_fs.AddFunc(0xc9dc3ac5, cellFsTruncate); - sys_fs.AddFunc(0xcb588dba, cellFsFGetBlockSize); - sys_fs.AddFunc(0xc1c507e7, cellFsAioRead); - sys_fs.AddFunc(0x4cef342e, cellFsAioWrite); - sys_fs.AddFunc(0xdb869f20, cellFsAioInit); - sys_fs.AddFunc(0x9f951810, cellFsAioFinish); - sys_fs.AddFunc(0x1a108ab7, cellFsGetBlockSize); - sys_fs.AddFunc(0xaa3b4bcd, cellFsGetFreeSize); - sys_fs.AddFunc(0x0d5b4a14, cellFsReadWithOffset); - sys_fs.AddFunc(0x9b882495, cellFsGetDirectoryEntries); - sys_fs.AddFunc(0x2664c8ae, cellFsStReadInit); - sys_fs.AddFunc(0xd73938df, cellFsStReadFinish); - sys_fs.AddFunc(0xb3afee8b, cellFsStReadGetRingBuf); - sys_fs.AddFunc(0xcf34969c, cellFsStReadGetStatus); - sys_fs.AddFunc(0xbd273a88, cellFsStReadGetRegid); - sys_fs.AddFunc(0x8df28ff9, cellFsStReadStart); - sys_fs.AddFunc(0xf8e5d9a0, cellFsStReadStop); - sys_fs.AddFunc(0x27800c6b, cellFsStRead); - sys_fs.AddFunc(0x190912f6, cellFsStReadGetCurrentAddr); - sys_fs.AddFunc(0x81f33783, cellFsStReadPutCurrentAddr); - sys_fs.AddFunc(0x8f71c5b2, cellFsStReadWait); - sys_fs.AddFunc(0x866f6aec, cellFsStReadWaitCallback); - sys_fs.AddFunc(0x02671310, cellFsSetDefaultContainer); - sys_fs.AddFunc(0x75f16dc5, cellFsSetIoBufferFromDefaultContainer); + REG_FUNC(sys_fs, cellFsOpen); + REG_FUNC(sys_fs, cellFsSdataOpen); + REG_FUNC(sys_fs, cellFsSdataOpenByFd); + REG_FUNC(sys_fs, cellFsRead); + REG_FUNC(sys_fs, cellFsWrite); + REG_FUNC(sys_fs, cellFsClose); + REG_FUNC(sys_fs, cellFsOpendir); + REG_FUNC(sys_fs, cellFsReaddir); + REG_FUNC(sys_fs, cellFsClosedir); + REG_FUNC(sys_fs, cellFsStat); + REG_FUNC(sys_fs, cellFsFstat); + REG_FUNC(sys_fs, cellFsMkdir); + REG_FUNC(sys_fs, cellFsRename); + REG_FUNC(sys_fs, cellFsChmod); + REG_FUNC(sys_fs, cellFsFsync); + REG_FUNC(sys_fs, cellFsRmdir); + REG_FUNC(sys_fs, cellFsUnlink); + REG_FUNC(sys_fs, cellFsLseek); + REG_FUNC(sys_fs, cellFsFtruncate); + REG_FUNC(sys_fs, cellFsTruncate); + REG_FUNC(sys_fs, cellFsFGetBlockSize); + REG_FUNC(sys_fs, cellFsAioRead); + REG_FUNC(sys_fs, cellFsAioWrite); + REG_FUNC(sys_fs, cellFsAioInit); + REG_FUNC(sys_fs, cellFsAioFinish); + REG_FUNC(sys_fs, cellFsGetBlockSize); + REG_FUNC(sys_fs, cellFsGetFreeSize); + REG_FUNC(sys_fs, cellFsReadWithOffset); + REG_FUNC(sys_fs, cellFsGetDirectoryEntries); + REG_FUNC(sys_fs, cellFsStReadInit); + REG_FUNC(sys_fs, cellFsStReadFinish); + REG_FUNC(sys_fs, cellFsStReadGetRingBuf); + REG_FUNC(sys_fs, cellFsStReadGetStatus); + REG_FUNC(sys_fs, cellFsStReadGetRegid); + REG_FUNC(sys_fs, cellFsStReadStart); + REG_FUNC(sys_fs, cellFsStReadStop); + REG_FUNC(sys_fs, cellFsStRead); + REG_FUNC(sys_fs, cellFsStReadGetCurrentAddr); + REG_FUNC(sys_fs, cellFsStReadPutCurrentAddr); + REG_FUNC(sys_fs, cellFsStReadWait); + REG_FUNC(sys_fs, cellFsStReadWaitCallback); + REG_FUNC(sys_fs, cellFsSetDefaultContainer); + REG_FUNC(sys_fs, cellFsSetIoBufferFromDefaultContainer); }); diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 4927d38377..cae1afd595 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -7,7 +7,6 @@ #include "Emu/GameInfo.h" #include "Emu/ARMv7/PSVFuncList.h" #include "Emu/ARMv7/PSVObjectList.h" -#include "Emu/SysCalls/Static.h" #include "Emu/SysCalls/ModuleManager.h" #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/SPUThread.h" @@ -57,7 +56,6 @@ Emulator::Emulator() , m_audio_manager(new AudioManager()) , m_callback_manager(new CallbackManager()) , m_event_manager(new EventManager()) - , m_sfunc_manager(new StaticFuncManager()) , m_module_manager(new ModuleManager()) , m_sync_prim_manager(new SyncPrimManager()) , m_vfs(new VFS()) @@ -77,7 +75,6 @@ Emulator::~Emulator() delete m_audio_manager; delete m_callback_manager; delete m_event_manager; - delete m_sfunc_manager; delete m_module_manager; delete m_sync_prim_manager; delete m_vfs; @@ -379,8 +376,6 @@ void Emulator::Stop() // TODO: check finalization order - clear_ps3_functions(); - SavePoints(BreakPointsDBName); m_break_points.clear(); m_marked_points.clear(); @@ -397,7 +392,6 @@ void Emulator::Stop() GetMouseManager().Close(); GetCallbackManager().Clear(); GetModuleManager().Close(); - GetSFuncManager().StaticFinalize(); GetSyncPrimManager().Close(); CurGameInfo.Reset(); diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index a5a94f0ea9..d011428d0a 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -21,7 +21,6 @@ class CallbackManager; class CPUThread; class EventManager; class ModuleManager; -class StaticFuncManager; class SyncPrimManager; struct VFS; @@ -100,7 +99,6 @@ class Emulator AudioManager* m_audio_manager; CallbackManager* m_callback_manager; EventManager* m_event_manager; - StaticFuncManager* m_sfunc_manager; ModuleManager* m_module_manager; SyncPrimManager* m_sync_prim_manager; VFS* m_vfs; @@ -163,7 +161,6 @@ public: std::vector& GetBreakPoints() { return m_break_points; } std::vector& GetMarkedPoints() { return m_marked_points; } EventManager& GetEventManager() { return *m_event_manager; } - StaticFuncManager& GetSFuncManager() { return *m_sfunc_manager; } ModuleManager& GetModuleManager() { return *m_module_manager; } SyncPrimManager& GetSyncPrimManager() { return *m_sync_prim_manager; } diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 72f992a999..21de6c9d81 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -542,13 +542,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) cbox_hle_loglvl ->SetSelection(Ini.HLELogLvl.GetValue()); cbox_sys_lang ->SetSelection(Ini.SysLanguage.GetValue()); - // Enable/Disable parameters - chbox_audio_dump->Enable(Emu.IsStopped()); - chbox_audio_conv->Enable(Emu.IsStopped()); - chbox_hle_logging->Enable(Emu.IsStopped()); - chbox_rsx_logging->Enable(Emu.IsStopped()); - chbox_hle_hook_stfunc->Enable(Emu.IsStopped()); - s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_spu_decoder->Add(cbox_spu_decoder, wxSizerFlags().Border(wxALL, 5).Expand()); diff --git a/rpcs3/Loader/ELF64.cpp b/rpcs3/Loader/ELF64.cpp index dfb12aee06..d1f646f72e 100644 --- a/rpcs3/Loader/ELF64.cpp +++ b/rpcs3/Loader/ELF64.cpp @@ -7,7 +7,6 @@ #include "Emu/Memory/Memory.h" #include "Emu/System.h" #include "Emu/SysCalls/SysCalls.h" -#include "Emu/SysCalls/Static.h" #include "Emu/SysCalls/ModuleManager.h" #include "Emu/SysCalls/lv2/sys_prx.h" #include "Emu/Cell/PPUInstrTable.h" @@ -399,7 +398,7 @@ namespace loader for (auto& f : m.second.exports) { - add_ps3_func(ModuleFunc(f.first, module, nullptr, vm::ptr::make(f.second))); + add_ppu_func(ModuleFunc(f.first, module, nullptr, vm::ptr::make(f.second))); } for (auto& f : m.second.imports) @@ -409,13 +408,13 @@ namespace loader u32 index; - auto func = get_ps3_func_by_nid(nid, &index); + auto func = get_ppu_func_by_nid(nid, &index); if (!func) { LOG_ERROR(LOADER, "Unimplemented function '%s' (0x%x)", SysCalls::GetHLEFuncName(nid), addr); - index = add_ps3_func(ModuleFunc(nid, module, nullptr)); + index = add_ppu_func(ModuleFunc(nid, module, nullptr)); } else { @@ -532,7 +531,7 @@ namespace loader { m_stream->Seek(handler::get_stream_offset() + phdr.p_offset); m_stream->Read(phdr.p_vaddr.get_ptr(), phdr.p_filesz); - Emu.GetSFuncManager().StaticAnalyse(phdr.p_vaddr.get_ptr(), (u32)phdr.p_filesz, phdr.p_vaddr.addr()); + hook_ppu_funcs((u32*)phdr.p_vaddr.get_ptr(), vm::cast(phdr.p_filesz)); } } break; @@ -630,13 +629,13 @@ namespace loader u32 index; - auto func = get_ps3_func_by_nid(nid, &index); + auto func = get_ppu_func_by_nid(nid, &index); if (!func) { LOG_ERROR(LOADER, "Unimplemented function '%s' in '%s' module (0x%x)", SysCalls::GetHLEFuncName(nid), module_name, addr); - index = add_ps3_func(ModuleFunc(nid, module, nullptr)); + index = add_ppu_func(ModuleFunc(nid, module, nullptr)); } else { diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index d60ea9a10a..31e2be03dc 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -278,7 +278,6 @@ - @@ -513,7 +512,6 @@ - diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 8a8751b80e..acb7bbc576 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -131,9 +131,6 @@ Emu\SysCalls - - Emu\SysCalls - Emu\SysCalls @@ -1228,9 +1225,6 @@ Emu\SysCalls - - Emu\SysCalls - Utilities\SimpleIni