Ejemplo n.º 1
0
        public virtual int sceKernelLoadExecBufferVSHUsbWlan(int bufferSize, TPointer bufferAddr, TPointer param)
        {
            SceKernelLoadExecVSHParam loadExecParam = new SceKernelLoadExecVSHParam();

            loadExecParam.read(param);

            int argSize = 0;
            int argAddr = 0;

            if (param.NotNull)
            {
                argSize = loadExecParam.args;
                argAddr = loadExecParam.argp;
                Console.WriteLine(string.Format("sceKernelLoadExecBufferVSHUsbWlan param={0}", loadExecParam));
            }

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("sceKernelLoadExecBufferVSHUsbWlan buffAddr: {0}", Utilities.getMemoryDump(bufferAddr.Address, System.Math.Min(bufferSize, 1024))));
            }

            sbyte[]    moduleBytes  = bufferAddr.getArray8(bufferSize);
            ByteBuffer moduleBuffer = ByteBuffer.wrap(moduleBytes);

            return(Modules.LoadExecForUserModule.hleKernelLoadExec(moduleBuffer, argSize, argAddr, null, null));
        }
Ejemplo n.º 2
0
        public virtual int sceKernelExitVSHVSH_660(TPointer param)
        {
            SceKernelLoadExecVSHParam loadExecVSHParam = new SceKernelLoadExecVSHParam();

            loadExecVSHParam.read(param);

            if (param.NotNull)
            {
                Console.WriteLine(string.Format("sceKernelExitVSHVSH_660 param={0}", loadExecVSHParam));
            }

            return(0);
        }
Ejemplo n.º 3
0
        public virtual int sceKernelExitVSHKernel(TPointer param)
        {
            SceKernelLoadExecVSHParam loadExecVSHParam = new SceKernelLoadExecVSHParam();

            loadExecVSHParam.read(param);

            //  Test in real PSP in  "Hatsune Miku Project Diva Extend" chinese patched version, same effect as sceKernelExitGame
            if (param.NotNull)
            {
                Console.WriteLine(string.Format("sceKernelExitVSHKernel param={0}", loadExecVSHParam));
            }
            Emulator.PauseEmu();
            RuntimeContext.reset();
            Modules.ThreadManForUserModule.stop();
            return(0);
        }
Ejemplo n.º 4
0
        public virtual int sceKernelLoadExecVSHMs2(PspString filename, TPointer param)
        {
            SceKernelLoadExecVSHParam loadExecVSHParam = new SceKernelLoadExecVSHParam();

            loadExecVSHParam.read(param);

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("sceKernelLoadExecVSHMs2 param: {0}", loadExecVSHParam));
                if (loadExecVSHParam.args > 0)
                {
                    Console.WriteLine(string.Format("sceKernelLoadExecVSHMs2 argp: {0}", Utilities.getMemoryDump(loadExecVSHParam.argp, loadExecVSHParam.args)));
                }
                if (loadExecVSHParam.vshmainArgsSize > 0)
                {
                    Console.WriteLine(string.Format("sceKernelLoadExecVSHMs2 vshmainArgs: {0}", Utilities.getMemoryDump(loadExecVSHParam.vshmainArgs, loadExecVSHParam.vshmainArgsSize)));
                }
            }

            if (loadExecVSHParam.args > 0 && loadExecVSHParam.argp != 0)
            {
                string arg = Utilities.readStringNZ(loadExecVSHParam.argp, loadExecVSHParam.args);
                if (arg.StartsWith("disc0:", StringComparison.Ordinal))
                {
                    Modules.IoFileMgrForUserModule.setfilepath("disc0/");
                }
                else if (arg.StartsWith("ms0:", StringComparison.Ordinal))
                {
                    int dirIndex = arg.LastIndexOf('/');
                    if (dirIndex >= 0)
                    {
                        Modules.IoFileMgrForUserModule.setfilepath(Settings.Instance.getDirectoryMapping("ms0") + arg.Substring(4, dirIndex - 4));
                    }
                }
            }

            return(Modules.LoadExecForUserModule.hleKernelLoadExec(filename, loadExecVSHParam.args, loadExecVSHParam.argp));
        }