public virtual int sceGeSetCallback(TPointer cbdata_addr) { pspGeCallbackData cbdata = new pspGeCallbackData(); cbdata.read(cbdata_addr); // The cbid returned has a value in the range [0..15]. int cbid = SceUidManager.getNewId(geCallbackPurpose, 0, 15); if (cbid == SceUidManager.INVALID_ID) { Console.WriteLine(string.Format("sceGeSetCallback no more callback ID available")); return(SceKernelErrors.ERROR_OUT_OF_MEMORY); } //if (log.DebugEnabled) { Console.WriteLine(string.Format("sceGeSetCallback signalFunc=0x{0:X8}, signalArg=0x{1:X8}, finishFunc=0x{2:X8}, finishArg=0x{3:X8}, result cbid=0x{4:X}", cbdata.signalFunction, cbdata.signalArgument, cbdata.finishFunction, cbdata.finishArgument, cbid)); } ThreadManForUser threadMan = Modules.ThreadManForUserModule; SceKernelCallbackInfo callbackSignal = threadMan.hleKernelCreateCallback("GeCallbackSignal", cbdata.signalFunction, cbdata.signalArgument); SceKernelCallbackInfo callbackFinish = threadMan.hleKernelCreateCallback("GeCallbackFinish", cbdata.finishFunction, cbdata.finishArgument); signalCallbacks[cbid] = callbackSignal; finishCallbacks[cbid] = callbackFinish; return(cbid); }
public virtual int sceNpMatching2CreateContext(TPointer communicationId, TPointer passPhrase, TPointer16 ctxId, int unknown) { //if (log.DebugEnabled) { Console.WriteLine(string.Format("sceNpMatching2CreateContext communicationId={0}, passPhrase={1}", Utilities.getMemoryDump(communicationId.Address, 12), Utilities.getMemoryDump(passPhrase.Address, 128))); } // Returning a ctxId in range [1..7] int uid = SceUidManager.getNewId(idContextPurpose, 1, 7); if (uid == SceUidManager.INVALID_ID) { return(-1); } contextMap[uid] = new MatchingContext(); //if (log.DebugEnabled) { Console.WriteLine(string.Format("sceNpMatching2CreateContext returning 0x{0:X}", uid)); } ctxId.Value = uid; return(0); }