From 16a45f7b92efdb88c4d3ebee784e446118e8c4ad Mon Sep 17 00:00:00 2001 From: BearOso Date: Mon, 20 Mar 2023 16:15:15 -0500 Subject: [PATCH] libretro: Get rid of EndScreenRefreshCallback. Just use S9xSyncSpeed, which was there all along. --- gfx.cpp | 15 --------------- gfx.h | 6 ------ libretro/libretro.cpp | 6 ++---- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/gfx.cpp b/gfx.cpp index 2a2e132c..142c70a2 100644 --- a/gfx.cpp +++ b/gfx.cpp @@ -98,9 +98,6 @@ bool8 S9xGraphicsInit (void) } } - GFX.EndScreenRefreshCallback = NULL; - GFX.EndScreenRefreshCallbackData = NULL; - return (TRUE); } @@ -110,9 +107,6 @@ void S9xGraphicsDeinit (void) if (GFX.SubScreen) { free(GFX.SubScreen); GFX.SubScreen = NULL; } if (GFX.ZBuffer) { free(GFX.ZBuffer); GFX.ZBuffer = NULL; } if (GFX.SubZBuffer) { free(GFX.SubZBuffer); GFX.SubZBuffer = NULL; } - - GFX.EndScreenRefreshCallback = NULL; - GFX.EndScreenRefreshCallbackData = NULL; } void S9xGraphicsScreenResize (void) @@ -268,15 +262,6 @@ void S9xEndScreenRefresh (void) } } } - - if (GFX.EndScreenRefreshCallback) - GFX.EndScreenRefreshCallback(GFX.EndScreenRefreshCallbackData); -} - -void S9xSetEndScreenRefreshCallback(const SGFX::Callback cb, void *const data) -{ - GFX.EndScreenRefreshCallback = cb; - GFX.EndScreenRefreshCallbackData = data; } void RenderLine (uint8 C) diff --git a/gfx.h b/gfx.h index 9cd649bf..91678813 100644 --- a/gfx.h +++ b/gfx.h @@ -11,8 +11,6 @@ struct SGFX { - typedef void (*Callback)(void *); - const uint32 Pitch = sizeof(uint16) * MAX_SNES_WIDTH; const uint32 RealPPL = MAX_SNES_WIDTH; // true PPL of Screen buffer const uint32 ScreenSize = MAX_SNES_WIDTH * MAX_SNES_HEIGHT; @@ -68,9 +66,6 @@ struct SGFX std::string InfoString; uint32 InfoStringTimeout; char FrameDisplayString[256]; - - Callback EndScreenRefreshCallback; - void *EndScreenRefreshCallbackData; }; struct SBG @@ -206,7 +201,6 @@ struct COLOR_SUB void S9xStartScreenRefresh (void); void S9xEndScreenRefresh (void); -void S9xSetEndScreenRefreshCallback(SGFX::Callback cb, void *data); void S9xBuildDirectColourMaps (void); void RenderLine (uint8); void S9xComputeClipWindows (void); diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 4f0767cc..e7ade809 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -749,8 +749,8 @@ static void update_variables(void) } } -static void S9xEndScreenRefreshCallback(void*) -{ +void S9xSyncSpeed() { + if (Settings.Mute) { S9xClearSamples(); return; @@ -1371,7 +1371,6 @@ void retro_init(void) ntsc_screen_buffer = (uint16*) calloc(1, MAX_SNES_WIDTH_NTSC * 2 * (MAX_SNES_HEIGHT + 16)); snes_ntsc_buffer = ntsc_screen_buffer + (MAX_SNES_WIDTH_NTSC >> 1) * 16; S9xGraphicsInit(); - S9xSetEndScreenRefreshCallback(S9xEndScreenRefreshCallback, NULL); S9xInitInputDevices(); for (int i = 0; i < 2; i++) @@ -2082,7 +2081,6 @@ bool8 S9xContinueUpdate(int width, int height) // Dummy functions that should probably be implemented correctly later. void S9xParsePortConfig(ConfigFile&, int) {} -void S9xSyncSpeed() {} const char* S9xStringInput(const char* in) { return in; } #ifdef _WIN32