示例#1
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(_tracer.Enabled ? _tracecb : null);

            IsLagFrame = LibmGBA.BizAdvance(
                _core,
                VBANext.GetButtons(controller),
                render ? _videobuff : _dummyvideobuff,
                ref _nsamp,
                rendersound ? _soundbuff : _dummysoundbuff,
                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();

            return(true);
        }
示例#2
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")));

            //autodetection may have progressed.
            //this isn't a great time to do it, but we have to do it some time. maybe it's the best time.
            WireMemoryDomainPointers_SaveRam();

            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);
        }