Various fixes (Trophy, Gcm corrections, stack alloc) (#2894)

* Fixed sys_get_random_number generating less bytes than needed, and ceiling the buffer size in 0x1000 instead of failing
* Corrected alignment check in libgcm
* Now calling callback of sceNpManagerRegisterCallback
* Fixed trophies
This commit is contained in:
Ofek 2017-09-02 14:43:44 +03:00 committed by Ivan
parent d3f13ab8a3
commit caab400258
7 changed files with 45 additions and 20 deletions

View file

@ -8,6 +8,7 @@
#include "Crypto/unself.h"
#include "cellRtc.h"
#include "sceNp.h"
#include "cellSysutil.h"
logs::channel sceNp("sceNp");
@ -905,13 +906,23 @@ s32 sceNpLookupTitleSmallStorageAsync()
s32 sceNpManagerRegisterCallback(vm::ptr<SceNpManagerCallback> callback, vm::ptr<void> arg)
{
sceNp.todo("sceNpManagerRegisterCallback(callback=*0x%x, arg=*0x%x)", callback, arg);
sceNp.warning("sceNpManagerRegisterCallback(callback=*0x%x, arg=*0x%x)", callback, arg);
if (!callback)
{
return SCE_NP_ERROR_INVALID_ARGUMENT;
}
sysutil_register_cb([=](ppu_thread& ppu)->s32
{
callback(ppu, SCE_NP_MANAGER_STATUS_OFFLINE, CELL_OK, arg.addr());
return CELL_OK;
});
// TODO:
// * Save the callback somewhere for future updates once network is implemented
// * If register is called again, created cb needs to be canceled
return CELL_OK;
}