示例#1
0
        private void Update()
        {
            if (wrapper != null)
            {
                wrapper.Update();
            }
            if (LibretroWrapper.tex != null)
            {
                Display.material.mainTexture = LibretroWrapper.tex;
            }

            // debug input
            //if (Input.GetButton("B")) Debug.Log("B");
            //if (Input.GetButton("Y")) Debug.Log("Y");
            //if (Input.GetButton("SELECT")) Debug.Log("SELECT");
            //if (Input.GetButton("START")) Debug.Log("START");
            //if (Input.GetAxisRaw("DpadX") >= 1.0f) Debug.Log("UP");
            //if (Input.GetAxisRaw("DpadX") <= -1.0f) Debug.Log("DOWN");
            //if (Input.GetAxisRaw("DpadY") >= 1.0f) Debug.Log("RIGHT");
            //if (Input.GetAxisRaw("DpadY") <= -1.0f) Debug.Log("LEFT");
            //if (Input.GetButton("A")) Debug.Log("A");
            //if (Input.GetButton("X")) Debug.Log("X");
            //if (Input.GetButton("L")) Debug.Log("L");
            //if (Input.GetButton("R")) Debug.Log("R");
        }
示例#2
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();
            }
        }
示例#3
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;
            }
        }