diff --git a/src/Graphics_3DS.c b/src/Graphics_3DS.c index 42025794a..a49f469a9 100644 --- a/src/Graphics_3DS.c +++ b/src/Graphics_3DS.c @@ -119,6 +119,7 @@ void Gfx_Create(void) { Gfx.MaxTexWidth = 512; Gfx.MaxTexHeight = 512; Gfx.Created = true; + gfx_vsync = true; C3D_Init(C3D_DEFAULT_CMDBUF_SIZE); target = C3D_RenderTargetCreate(240, 400, GPU_RB_RGBA8, GPU_RB_DEPTH24_STENCIL8); @@ -326,10 +327,11 @@ void Gfx_SetFpsLimit(cc_bool vsync, float minFrameMs) { } void Gfx_BeginFrame(void) { - C3D_FrameBegin(C3D_FRAME_SYNCDRAW); + int flags = gfx_vsync ? C3D_FRAME_SYNCDRAW : 0; + C3D_FrameBegin(flags); } + void Gfx_Clear(void) { - //Platform_Log1("CLEAR: %i", &clear_color); C3D_RenderTargetClear(target, C3D_CLEAR_ALL, clear_color, 0); C3D_FrameDrawOn(target); } diff --git a/src/Window_3DS.c b/src/Window_3DS.c index 384f8f5e5..d4ce7e309 100644 --- a/src/Window_3DS.c +++ b/src/Window_3DS.c @@ -106,12 +106,14 @@ static void HandleButtons_Launcher(u32 mods) { Input_SetNonRepeatable(CCPAD_DOWN, mods & KEY_DDOWN); } -static void ProcessJoystickInput(circlePosition* pos) { +static void ProcessJoystickInput(circlePosition* pos, double delta) { + float scale = (delta * 60.0) / 8.0f; + // May not be exactly 0 on actual hardware if (Math_AbsI(pos->dx) <= 4) pos->dx = 0; if (Math_AbsI(pos->dy) <= 4) pos->dy = 0; - Event_RaiseRawMove(&PointerEvents.RawMoved, pos->dx / 8.0f, -pos->dy / 8.0f); + Event_RaiseRawMove(&PointerEvents.RawMoved, pos->dx * scale, -pos->dy * scale); } void Window_ProcessEvents(double delta) { @@ -156,14 +158,14 @@ void Window_ProcessEvents(double delta) { if (Input.RawMode) { circlePosition pos; hidCircleRead(&pos); - ProcessJoystickInput(&pos); + ProcessJoystickInput(&pos, delta); } if (Input.RawMode && irrst_result == 0) { circlePosition pos; irrstScanInput(); irrstCstickRead(&pos); - ProcessJoystickInput(&pos); + ProcessJoystickInput(&pos, delta); } } @@ -285,7 +287,6 @@ cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* args) { } cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) { - return ERR_NOT_SUPPORTED; } #endif \ No newline at end of file