mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-01 04:51:49 +01:00
Implement _sys_printf and sys_prx improvements
This commit is contained in:
parent
91f67b683b
commit
c12af57bdd
@ -1,4 +1,5 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "Utilities/Log.h"
|
||||||
#include "Emu/Memory/Memory.h"
|
#include "Emu/Memory/Memory.h"
|
||||||
#include "Emu/System.h"
|
#include "Emu/System.h"
|
||||||
#include "Emu/SysCalls/Modules.h"
|
#include "Emu/SysCalls/Modules.h"
|
||||||
@ -127,6 +128,16 @@ std::string ps3_fmt(PPUThread& context, vm::cptr<char> fmt, u32 g_count, u32 f_c
|
|||||||
result += string.get_ptr();
|
result += string.get_ptr();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
case 'u':
|
||||||
|
{
|
||||||
|
// unsigned decimal
|
||||||
|
const u64 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_udec(value);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw EXCEPTION("Unknown formatting: '%s'", start.get_ptr());
|
throw EXCEPTION("Unknown formatting: '%s'", start.get_ptr());
|
||||||
@ -332,12 +343,14 @@ s32 _sys_snprintf(PPUThread& ppu, vm::ptr<char> dst, u32 count, vm::cptr<char> f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 _sys_printf(vm::cptr<char> fmt, ppu_va_args_t va_args)
|
s32 _sys_printf(PPUThread& ppu, vm::cptr<char> fmt, ppu_va_args_t va_args)
|
||||||
{
|
{
|
||||||
sysPrxForUser.Todo("_sys_printf(fmt=*0x%x, ...)", fmt);
|
sysPrxForUser.Warning("_sys_printf(fmt=*0x%x, ...)", fmt);
|
||||||
|
std::string result = ps3_fmt(ppu, fmt, va_args.g_count, va_args.f_count, va_args.v_count);
|
||||||
|
|
||||||
// probably, assertion failed
|
LOG_ERROR(TTY, result);
|
||||||
throw EXCEPTION("%s", fmt.get_ptr());
|
|
||||||
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 _sys_sprintf()
|
s32 _sys_sprintf()
|
||||||
|
@ -260,9 +260,13 @@ s32 sys_prx_get_module_id_by_address()
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 sys_prx_get_module_id_by_name()
|
s32 sys_prx_get_module_id_by_name(vm::cptr<char> name, u64 flags, vm::ptr<sys_prx_get_module_id_by_name_option_t> pOpt)
|
||||||
{
|
{
|
||||||
sys_prx.Todo("sys_prx_get_module_id_by_name()");
|
const char *realName = name.get_ptr();
|
||||||
|
sys_prx.Todo("sys_prx_get_module_id_by_name(name=%s, flags=%d, pOpt=*0x%x)", realName, flags, pOpt);
|
||||||
|
|
||||||
|
//if (realName == "?") ...
|
||||||
|
|
||||||
return CELL_PRX_ERROR_UNKNOWN_MODULE;
|
return CELL_PRX_ERROR_UNKNOWN_MODULE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +101,12 @@ struct sys_prx_param_t
|
|||||||
be_t<u32> unk2;
|
be_t<u32> unk2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct sys_prx_get_module_id_by_name_option_t
|
||||||
|
{
|
||||||
|
be_t<u64> size;
|
||||||
|
vm::ptr<void> base;
|
||||||
|
};
|
||||||
|
|
||||||
// PRX file headers
|
// PRX file headers
|
||||||
struct sys_prx_module_info_t
|
struct sys_prx_module_info_t
|
||||||
{
|
{
|
||||||
@ -125,7 +131,6 @@ struct sys_prx_relocation_info_t
|
|||||||
vm::bptr<void, u64> ptr;
|
vm::bptr<void, u64> ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Data types
|
// Data types
|
||||||
struct sys_prx_load_module_option_t
|
struct sys_prx_load_module_option_t
|
||||||
{
|
{
|
||||||
@ -180,7 +185,7 @@ s32 sys_prx_unload_module(s32 id, u64 flags, vm::ptr<sys_prx_unload_module_optio
|
|||||||
s32 sys_prx_get_module_list();
|
s32 sys_prx_get_module_list();
|
||||||
s32 sys_prx_get_my_module_id();
|
s32 sys_prx_get_my_module_id();
|
||||||
s32 sys_prx_get_module_id_by_address();
|
s32 sys_prx_get_module_id_by_address();
|
||||||
s32 sys_prx_get_module_id_by_name();
|
s32 sys_prx_get_module_id_by_name(vm::cptr<char> name, u64 flags, vm::ptr<sys_prx_get_module_id_by_name_option_t> pOpt);
|
||||||
s32 sys_prx_get_module_info();
|
s32 sys_prx_get_module_info();
|
||||||
s32 sys_prx_register_library(vm::ptr<void> library);
|
s32 sys_prx_register_library(vm::ptr<void> library);
|
||||||
s32 sys_prx_unregister_library(vm::ptr<void> library);
|
s32 sys_prx_unregister_library(vm::ptr<void> library);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user