Example #1
0
        public void FrameAdvance(bool render, bool rendersound = true)
        {
            Frame++;
            if (Controller["Power"])
            {
                LibmGBA.BizReset(core);
            }

            IsLagFrame = LibmGBA.BizAdvance(core, VBANext.GetButtons(Controller), videobuff, ref nsamp, soundbuff,
                                            RTCTime(),
                                            (short)Controller.GetFloat("Tilt X"),
                                            (short)Controller.GetFloat("Tilt Y"),
                                            (short)Controller.GetFloat("Tilt Z"),
                                            (byte)(255 - Controller.GetFloat("Light Sensor")));

            if (IsLagFrame)
            {
                LagCount++;
            }
            // this should be called in hblank on the appropriate line, but until we implement that, just do it here
            if (_scanlinecb != null)
            {
                _scanlinecb();
            }
        }
Example #2
0
        public void FrameAdvance(IController controller, bool render, bool rendersound = true)
        {
            Frame++;
            if (controller.IsPressed("Power"))
            {
                LibmGBA.BizReset(_core);

                // BizReset caused memorydomain pointers to change.
                WireMemoryDomainPointers();
            }

            IsLagFrame = LibmGBA.BizAdvance(
                _core,
                VBANext.GetButtons(controller),
                _videobuff,
                ref _nsamp,
                _soundbuff,
                RTCTime(),
                (short)controller.GetFloat("Tilt X"),
                (short)controller.GetFloat("Tilt Y"),
                (short)controller.GetFloat("Tilt Z"),
                (byte)(255 - controller.GetFloat("Light Sensor")));

            if (IsLagFrame)
            {
                LagCount++;
            }

            // this should be called in hblank on the appropriate line, but until we implement that, just do it here
            _scanlinecb?.Invoke();
        }
Example #3
0
        public bool FrameAdvance(IController controller, bool render, bool renderSound = true)
        {
            Frame++;
            if (controller.IsPressed("Power"))
            {
                LibmGBA.BizReset(Core);

                // BizReset caused memorydomain pointers to change.
                WireMemoryDomainPointers();
            }

            LibmGBA.BizSetTraceCallback(Core, Tracer.Enabled ? _tracecb : null);

            IsLagFrame = LibmGBA.BizAdvance(
                Core,
                LibmGBA.GetButtons(controller),
                render ? _videobuff : _dummyvideobuff,
                ref _nsamp,
                renderSound ? _soundbuff : _dummysoundbuff,
                RTCTime(),
                (short)controller.AxisValue("Tilt X"),
                (short)controller.AxisValue("Tilt Y"),
                (short)controller.AxisValue("Tilt Z"),
                (byte)(255 - controller.AxisValue("Light Sensor")));

            if (IsLagFrame)
            {
                LagCount++;
            }

            // this should be called in hblank on the appropriate line, but until we implement that, just do it here
            _scanlinecb?.Invoke();

            return(true);
        }