From f0fa93fa2be1bb945bc61413b0539496848a0ae2 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 26 Sep 2025 11:33:15 -0400 Subject: [PATCH] Refactor CMake configuration and improve emulation timing calculations - Updated CMakeLists.txt to disable additional optional components (EMU and Z3ED) in minimal builds for better build management. - Refactored emulation timing calculations in emu.cc to use consistent method naming conventions, enhancing code readability and maintainability. --- CMakeLists.txt | 4 +++- src/app/emu/emu.cc | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e484e16..2e951374 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,9 +32,11 @@ option(YAZE_ENABLE_EXPERIMENTAL_TESTS "Enable experimental/unstable tests" ON) option(YAZE_ENABLE_UI_TESTS "Enable ImGui Test Engine UI testing" ON) option(YAZE_MINIMAL_BUILD "Minimal build for CI (disable optional features)" OFF) -# Disable UI tests in minimal builds +# Disable optional components in minimal builds if(YAZE_MINIMAL_BUILD) set(YAZE_ENABLE_UI_TESTS OFF CACHE BOOL "Disabled for minimal build" FORCE) + set(YAZE_BUILD_EMU OFF CACHE BOOL "Disabled for minimal build" FORCE) + set(YAZE_BUILD_Z3ED OFF CACHE BOOL "Disabled for minimal build" FORCE) endif() set(YAZE_TEST_ROM_PATH "${CMAKE_BINARY_DIR}/bin/zelda3.sfc" CACHE STRING "Path to test ROM file") diff --git a/src/app/emu/emu.cc b/src/app/emu/emu.cc index 3b4f11b9..6c433156 100644 --- a/src/app/emu/emu.cc +++ b/src/app/emu/emu.cc @@ -107,8 +107,8 @@ int main(int argc, char **argv) { if (rom_.is_loaded()) { rom_data_ = rom_.vector(); snes_.Init(rom_data_); - wanted_frames_ = 1.0 / (snes_.Memory().pal_timing() ? 50.0 : 60.0); - wanted_samples_ = 48000 / (snes_.Memory().pal_timing() ? 50 : 60); + wanted_frames_ = 1.0 / (snes_.memory().pal_timing() ? 50.0 : 60.0); + wanted_samples_ = 48000 / (snes_.memory().pal_timing() ? 50 : 60); loaded = true; } @@ -120,8 +120,8 @@ int main(int argc, char **argv) { if (rom_.is_loaded()) { rom_data_ = rom_.vector(); snes_.Init(rom_data_); - wanted_frames_ = 1.0 / (snes_.Memory().pal_timing() ? 50.0 : 60.0); - wanted_samples_ = 48000 / (snes_.Memory().pal_timing() ? 50 : 60); + wanted_frames_ = 1.0 / (snes_.memory().pal_timing() ? 50.0 : 60.0); + wanted_samples_ = 48000 / (snes_.memory().pal_timing() ? 50 : 60); loaded = true; } SDL_free(event.drop.file);