Exemple #1
0
        public int sceKernelStartModule(CpuThreadState CpuThreadState, int ModuleId, int ArgumentsSize,
                                        uint ArgumentsPointer, int *Status, SceKernelSMOption *SceKernelSMOption)
        {
            var Module = Modules.Get(ModuleId);

            if (Module.Loaded)
            {
                var NewCpuThreadState = new CpuThreadState(CpuThreadState.CpuProcessor);
                NewCpuThreadState.CopyRegistersFrom(CpuThreadState);
                NewCpuThreadState.Gp           = Module.InitInfo.Gp;
                NewCpuThreadState.CallerModule = Module;

                var ThreadId = (int)ThreadManForUser.sceKernelCreateThread(NewCpuThreadState, "ModuleThread",
                                                                           Module.InitInfo.Pc, 10, 1024, PspThreadAttributes.ClearStack, null);
                ThreadManForUser.sceKernelStartThread(NewCpuThreadState, ThreadId, ArgumentsSize, ArgumentsPointer);
            }

            //throw(new NotImplementedException());
            if (Status != null)
            {
                *Status = 0;
            }
            return(0);
        }