From f5d9972d65be971e97ba35581ba158ff587378e3 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 30 Dec 2016 21:12:55 -0800 Subject: [PATCH] Libretro: Fix Game Boy savestates and audio --- CHANGES | 1 + src/platform/libretro/libretro.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index aeca89b3a..065ad1f93 100644 --- a/CHANGES +++ b/CHANGES @@ -34,6 +34,7 @@ Bugfixes: - GB Video: Hblank IRQs should mask LYC=LY IRQs - GB Audio: Reset envelope timer when reseting sound channel - Libretro: Fix disabling BIOS + - Libretro: Fix Game Boy savestates and audio Misc: - PSP2: Improved controller rumble - GB, GBA: Prevent loading null ROMs diff --git a/src/platform/libretro/libretro.c b/src/platform/libretro/libretro.c index b290ee28b..c784cb4b3 100644 --- a/src/platform/libretro/libretro.c +++ b/src/platform/libretro/libretro.c @@ -146,7 +146,7 @@ void retro_get_system_av_info(struct retro_system_av_info* info) { info->geometry.max_width = width; info->geometry.max_height = height; info->geometry.aspect_ratio = width / (double) height; - info->timing.fps = GBA_ARM7TDMI_FREQUENCY / (float) VIDEO_TOTAL_LENGTH; + info->timing.fps = core->frequency(core) / (float) core->frameCycles(core); info->timing.sample_rate = 32768; } @@ -443,14 +443,14 @@ void retro_unload_game(void) { } size_t retro_serialize_size(void) { - return sizeof(struct GBASerializedState); + return core->stateSize(core); } bool retro_serialize(void* data, size_t size) { if (size != retro_serialize_size()) { return false; } - GBASerialize(core->board, data); + core->saveState(core, data); return true; } @@ -458,7 +458,7 @@ bool retro_unserialize(const void* data, size_t size) { if (size != retro_serialize_size()) { return false; } - GBADeserialize(core->board, data); + core->loadState(core, data); return true; }