private LibSameboy.Buttons FrameAdvancePrep(IController controller) { uint b = 0; for (var i = 0; i < 8; i++) { b <<= 1; if (controller.IsPressed(GB_BUTTON_ORDER_IN_BITMASK[i])) { b |= 1; } } if (controller.IsPressed("Power")) { LibSameboy.sameboy_reset(SameboyState); } IsLagFrame = true; LibSameboy.sameboy_settracecallback(SameboyState, Tracer.IsEnabled() ? _tracecb : null); return((LibSameboy.Buttons)b); }