示例#1
0
文件: PSP.cs 项目: tunstek/BizHawk
        public PSP(CoreComm comm, string isopath)
        {
            ServiceProvider = new BasicServiceProvider(this);
            if (attachedcore != null)
            {
                attachedcore.Dispose();
                attachedcore = null;
            }
            CoreComm = comm;

            glcontext = CoreComm.RequestGLContext(3, 0, true);
            CoreComm.ActivateGLContext(glcontext);

            logcallback = new PPSSPPDll.LogCB(LogCallbackFunc);

            bool good = PPSSPPDll.BizInit(isopath, logcallback);

            LogFlush();
            if (!good)
            {
                throw new Exception("PPSSPP Init failed!");
            }

            CoreComm.RomStatusDetails = "It puts the scythe in the chicken or it gets the abyss again!";

            attachedcore = this;
        }
示例#2
0
        public PSP(CoreComm comm, string isopath)
        {
            ServiceProvider = new BasicServiceProvider(this);
            if (attachedcore != null)
            {
                attachedcore.Dispose();
                attachedcore = null;
            }
            CoreComm = comm;

            logcallback = new PPSSPPDll.LogCB(LogCallbackFunc);

            bool good = PPSSPPDll.init(isopath, logcallback);

            LogFlush();
            if (!good)
            {
                throw new Exception("PPSSPP Init failed!");
            }
            vidhandle = GCHandle.Alloc(screenbuffer, GCHandleType.Pinned);
            PPSSPPDll.setvidbuff(vidhandle.AddrOfPinnedObject());

            CoreComm.VsyncDen         = 1;
            CoreComm.VsyncNum         = 60;
            CoreComm.RomStatusDetails = "It puts the scythe in the chicken or it gets the abyss again!";

            attachedcore = this;
        }
示例#3
0
 public void FrameAdvance(bool render, bool rendersound = true)
 {
     PPSSPPDll.advance();
     // problem 1: audio can be 48khz, if a particular core parameter is set.  we're not accounting for that.
     // problem 2: we seem to be getting approximately the right amount of output, but with
     // a lot of jitter on the per-frame buffer size
     nsampavail = PPSSPPDll.mixsound(audiobuffer, audiobuffer.Length / 2);
     LogFlush();
     //Console.WriteLine("Audio Service: {0}", nsampavail);
 }
示例#4
0
文件: PSP.cs 项目: tunstek/BizHawk
        public void Dispose()
        {
            if (!disposed)
            {
                PPSSPPDll.BizClose();
                logcallback = null;
                disposed    = true;
                LogFlush();

                Console.WriteLine("PSP Core Disposed.");
            }
        }
示例#5
0
 public void Dispose()
 {
     if (!disposed)
     {
         vidhandle.Free();
         PPSSPPDll.setvidbuff(IntPtr.Zero);
         PPSSPPDll.die();
         logcallback = null;
         disposed    = true;
         LogFlush();
         Console.WriteLine("PSP Core Disposed.");
     }
 }
示例#6
0
文件: PSP.cs 项目: tunstek/BizHawk
        public bool FrameAdvance(IController controller, bool render, bool rendersound = true)
        {
            Frame++;
            UpdateInput(controller);
            PPSSPPDll.BizAdvance(screenbuffer, input);

            // problem 1: audio can be 48khz, if a particular core parameter is set.  we're not accounting for that.
            // problem 2: we seem to be getting approximately the right amount of output, but with
            // a lot of jitter on the per-frame buffer size

            nsampavail = PPSSPPDll.MixSound(audiobuffer, audiobuffer.Length / 2);
            //Console.WriteLine(nsampavail);

            //nsampavail = PPSSPPDll.mixsound(audiobuffer, audiobuffer.Length / 2);
            LogFlush();
            //Console.WriteLine("Audio Service: {0}", nsampavail);

            return(true);
        }