Exemple #1
0
        public virtual void step()
        {
            ThreadManForUser threadMan = Modules.ThreadManForUserModule;

            for (int?thid = deferredThreadWakeupQueue.poll(); thid != null; thid = deferredThreadWakeupQueue.poll())
            {
                //if (log.DebugEnabled)
                {
                    Console.WriteLine("really waking thread " + thid.ToString("x") + "(" + threadMan.getThreadName(thid.Value) + ")");
                }
                threadMan.hleUnblockThread(thid);

                ExternalGE.onGeStopWaitList();
            }
        }
Exemple #2
0
        public virtual void hleAudioBlockingOutput(int threadId, SoundChannel channel, int addr, int leftVolume, int rightVolume)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("hleAudioBlockingOutput {0}", channel.ToString()));
            }

            if (addr == 0)
            {
                // If another thread is also sending audio data on this channel,
                // do not wait for the channel to be drained, unblock the thread now.
                ThreadManForUser    threadMan = Modules.ThreadManForUserModule;
                SceKernelThreadInfo thread    = threadMan.getThreadById(threadId);
                if (thread != null)
                {
                    thread.cpuContext._v0 = channel.SampleLength;
                    threadMan.hleUnblockThread(threadId);
                }
                channel.Busy = false;
            }
            else if (!channel.OutputBlocking)
            {
                ThreadManForUser    threadMan = Modules.ThreadManForUserModule;
                SceKernelThreadInfo thread    = threadMan.getThreadById(threadId);
                if (thread != null)
                {
                    changeChannelVolume(channel, leftVolume, rightVolume);
                    int ret = doAudioOutput(channel, addr);
                    thread.cpuContext._v0 = ret;
                    threadMan.hleUnblockThread(threadId);
                }
                channel.Busy = false;
            }
            else
            {
                blockThreadOutput(threadId, channel, addr, leftVolume, rightVolume);
            }
        }