示例#1
0
        public int sceKernelTryReceiveMsgPipe(MsgPipeId PipeId, byte *Message, int Size, int WaitMode, int *ResultSizeAddr)
        {
            var MsgPipe = MessagePipeList.Get(PipeId);

            MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
            return(0);
        }
示例#2
0
        public int sceKernelDeleteMsgPipe(MsgPipeId PipeId)
        {
            var MsgPipe = MessagePipeList.Get(PipeId);

            MsgPipe.Delete();
            MessagePipeList.Remove(PipeId);
            return(0);
        }
示例#3
0
        public int sceKernelTrySendMsgPipe(MsgPipeId PipeId, byte *Message, int Size, int WaitMode, int *ResultSizeAddr)
        {
            var MsgPipe = MessagePipeList.Get(PipeId);

            MsgPipe.Enqueue(Message, Size);
            if (ResultSizeAddr != null)
            {
                *ResultSizeAddr = Size;
            }
            return(0);
        }
示例#4
0
        public int sceKernelSendMsgPipe(MsgPipeId PipeId, byte *Message, int Size, int WaitMode, int *ResultSizeAddr, uint *Timeout)
        {
            if (Timeout != null)
            {
                throw (new NotImplementedException());
            }

#if DEBUG_MSG_PIPES
            Console.Error.WriteLine("sceKernelSendMsgPipe");
#endif

            bool Transferred = false;
            while (!Transferred)
            {
                var MsgPipe = MessagePipeList.Get(PipeId);
                try
                {
                    //bool WaitiMsgPipe.OnAvailableForRecv.Count
                    MsgPipe.Enqueue(Message, Size);
                    HleState.ThreadManager.Current.CpuThreadState.Yield();
                    Transferred = true;
                }
                catch (SceKernelException)
                {
                    //throw(new NotImplementedException());
                    HleState.ThreadManager.Current.SetWaitAndPrepareWakeUp(HleThread.WaitType.None, "sceKernelSendMsgPipe", WakeUpCallback =>
                    {
#if DEBUG_MSG_PIPES
                        Console.Error.WriteLine("sceKernelSendMsgPipe.wait");
#endif
                        MsgPipe.OnAvailableForSend.Enqueue(() =>
                        {
#if DEBUG_MSG_PIPES
                            Console.Error.WriteLine("sceKernelSendMsgPipe.awake");
#endif
                            WakeUpCallback();
                        });
                    }, HandleCallbacks: false);
                }
            }

            return(0);
        }
 public int sceKernelCancelMsgPipe(MsgPipeId uid, int *psend, int *precv)
 {
     throw (new NotImplementedException());
 }
 public int sceKernelTrySendMsgPipe(MsgPipeId PipeId, byte* Message, int Size, int WaitMode, int* ResultSizeAddr)
 {
     var MsgPipe = MessagePipeList.Get(PipeId);
     MsgPipe.Enqueue(Message, Size);
     if (ResultSizeAddr != null)
     {
         *ResultSizeAddr = Size;
     }
     return 0;
 }
 public int sceKernelTryReceiveMsgPipe(MsgPipeId PipeId, byte* Message, int Size, int WaitMode, int* ResultSizeAddr)
 {
     var MsgPipe = MessagePipeList.Get(PipeId);
     MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
     return 0;
 }
        public int sceKernelSendMsgPipe(MsgPipeId PipeId, byte* Message, int Size, int WaitMode, int* ResultSizeAddr, uint* Timeout)
        {
            if (Timeout != null)
            {
                Logger.Unimplemented("sceKernelSendMsgPipe.Timeout != null");
            }

            #if DEBUG_MSG_PIPES
            Console.Error.WriteLine("sceKernelSendMsgPipe");
            #endif

            bool Transferred = false;
            while (!Transferred)
            {
                var MsgPipe = MessagePipeList.Get(PipeId);
                try
                {
                    //bool WaitiMsgPipe.OnAvailableForRecv.Count
                    MsgPipe.Enqueue(Message, Size);
                    ThreadManager.Current.CpuThreadState.Yield();
                    Transferred = true;
                }
                catch (SceKernelException)
                {
                    //throw(new NotImplementedException());
                    ThreadManager.Current.SetWaitAndPrepareWakeUp(HleThread.WaitType.None, "sceKernelSendMsgPipe", MsgPipe, WakeUpCallback =>
                    {
            #if DEBUG_MSG_PIPES
                        Console.Error.WriteLine("sceKernelSendMsgPipe.wait");
            #endif
                        MsgPipe.OnAvailableForSend.Enqueue(() =>
                        {
            #if DEBUG_MSG_PIPES
                            Console.Error.WriteLine("sceKernelSendMsgPipe.awake");
            #endif
                            WakeUpCallback();
                        });
                    }, HandleCallbacks: false);
                }
            }

            return 0;
        }
 public int sceKernelReferMsgPipeStatus(MsgPipeId PipeId, /*SceKernelMppInfo*/void* SceKernelMppInfo)
 {
     throw(new NotImplementedException());
 }
 public int sceKernelDeleteMsgPipe(MsgPipeId PipeId)
 {
     var MsgPipe = MessagePipeList.Get(PipeId);
     MsgPipe.Delete();
     MessagePipeList.Remove(PipeId);
     return 0;
 }
示例#11
0
 public int sceKernelCancelMsgPipe(MsgPipeId uid, int *psend, int *precv)
 {
     throw (new NotImplementedException());
 }
示例#12
0
 public int sceKernelReferMsgPipeStatus(MsgPipeId PipeId, /*SceKernelMppInfo*/ void *SceKernelMppInfo)
 {
     throw(new NotImplementedException());
 }
        public int sceKernelReceiveMsgPipe(MsgPipeId PipeId, byte* Message, int Size, int WaitMode, int* ResultSizeAddr, uint* Timeout)
        {
            if (Timeout != null) throw(new NotImplementedException());

            #if DEBUG_MSG_PIPES
            Console.Error.WriteLine("sceKernelReceiveMsgPipe");
            #endif

            bool Transferred = false;
            var MsgPipe = MessagePipeList.Get(PipeId);
            while (!Transferred)
            {
                try
                {
                    MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
                    Transferred = true;
                }
                catch (SceKernelException)
                {
                    HleState.ThreadManager.Current.SetWaitAndPrepareWakeUp(HleThread.WaitType.None, "sceKernelReceiveMsgPipe", WakeUpCallback =>
                    {
            #if DEBUG_MSG_PIPES
                        Console.Error.WriteLine("sceKernelReceiveMsgPipe.wait");
            #endif

                        MsgPipe.OnAvailableForRecv.Enqueue(() =>
                        {
            #if DEBUG_MSG_PIPES
                            Console.Error.WriteLine("sceKernelReceiveMsgPipe.awake");
            #endif
                            WakeUpCallback();
                        });

                    }, HandleCallbacks: false);
                }
            }
            return 0;
        }