Exemplo n.º 1
0
        private void Update()
        {
            if (gameLoaded)
            {
                _frameTimer += Time.deltaTime;
                double timePerFrame = 1 / targetFPS;
                if (!double.IsNaN(wrapper.GetAVInfo().timing.fps))
                {
                    timePerFrame = 1 / wrapper.GetAVInfo().timing.fps;
                    targetFPS    = (float)wrapper.GetAVInfo().timing.fps;
                }

                if (overrideSpeed)
                {
                    timePerFrame = 1f / boostedFPS;
                }

                while (_frameTimer >= timePerFrame)
                {
                    wrapper.Update();
                    _frameTimer -= timePerFrame;
                }

                if (Input.GetKeyDown(KeyCode.G))
                {
                    saveState();
                }
                else if (Input.GetKeyDown(KeyCode.H))
                {
                    loadState();
                }
                else if (Input.GetKeyDown(KeyCode.J))
                {
                    unloadROM();
                }

                if (LibretroWrapper.tex != null)
                {
                    Display.material.mainTexture = LibretroWrapper.tex;
                }
            }

            if (Input.GetKeyDown(KeyCode.PageUp))
            {
                loadGame();
            }
        }
Exemplo n.º 2
0
        private void Update()
        {
            if (wrapper != null)
            {
                _frameTimer += Time.deltaTime;
                float timePerFrame = 1f / (float)wrapper.GetAVInfo().timing.fps;

                while (_frameTimer >= timePerFrame)
                {
                    wrapper.Update();
                    _frameTimer -= timePerFrame;
                }
            }
            if (LibretroWrapper.tex != null)
            {
                Display.material.mainTexture = LibretroWrapper.tex;
            }
        }