diff --git a/src/app/core/platform/file_dialog.cc b/src/app/core/platform/file_dialog.cc index 5e33ad7e..7ad5ed1d 100644 --- a/src/app/core/platform/file_dialog.cc +++ b/src/app/core/platform/file_dialog.cc @@ -51,13 +51,12 @@ std::string LoadFile(const std::string &filename) { std::string LoadConfigFile(const std::string &filename) { std::string contents; - Platform platform; #if defined(_WIN32) - platform = Platform::kWindows; + Platform platform = Platform::kWindows; #elif defined(__APPLE__) - platform = Platform::kMacOS; + Platform platform = Platform::kMacOS; #else - platform = Platform::kLinux; + Platform platform = Platform::kLinux; #endif std::string filepath = GetConfigDirectory() + "/" + filename; std::ifstream file(filepath); @@ -81,19 +80,18 @@ void SaveFile(const std::string &filename, const std::string &contents) { std::string GetConfigDirectory() { std::string config_directory = ".yaze"; - Platform platform; #if defined(__APPLE__) && defined(__MACH__) #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1 - platform = Platform::kiOS; + Platform platform = Platform::kiOS; #elif TARGET_OS_MAC == 1 - platform = Platform::kMacOS; + Platform platform = Platform::kMacOS; #endif #elif defined(_WIN32) - platform = Platform::kWindows; + Platform platform = Platform::kWindows; #elif defined(__linux__) - platform = Platform::kLinux; + Platform platform = Platform::kLinux; #else - platform = Platform::kUnknown; + Platform platform = Platform::kUnknown; #endif switch (platform) { case Platform::kWindows: diff --git a/src/app/emu/audio/spc700.h b/src/app/emu/audio/spc700.h index dc854bb7..5d7bb715 100644 --- a/src/app/emu/audio/spc700.h +++ b/src/app/emu/audio/spc700.h @@ -3,8 +3,8 @@ #include #include -#include #include +#include namespace yaze { namespace emu { diff --git a/src/app/emu/emu.cc b/src/app/emu/emu.cc index 6c433156..b5a27aa0 100644 --- a/src/app/emu/emu.cc +++ b/src/app/emu/emu.cc @@ -22,8 +22,10 @@ int main(int argc, char **argv) { absl::FailureSignalHandlerOptions options; options.symbolize_stacktrace = true; - options.use_alternate_stack = false; // Disable alternate stack to avoid shutdown conflicts - options.alarm_on_failure_secs = false; // Disable alarm to avoid false positives during SDL cleanup + options.use_alternate_stack = + false; // Disable alternate stack to avoid shutdown conflicts + options.alarm_on_failure_secs = + false; // Disable alarm to avoid false positives during SDL cleanup options.call_previous_handler = true; absl::InstallFailureSignalHandler(options); @@ -183,9 +185,9 @@ int main(int argc, char **argv) { SDL_PauseAudioDevice(audio_device_, 1); SDL_CloseAudioDevice(audio_device_); delete[] audio_buffer_; - //ImGui_ImplSDLRenderer2_Shutdown(); - //ImGui_ImplSDL2_Shutdown(); - //ImGui::DestroyContext(); + // ImGui_ImplSDLRenderer2_Shutdown(); + // ImGui_ImplSDL2_Shutdown(); + // ImGui::DestroyContext(); SDL_Quit(); return EXIT_SUCCESS; diff --git a/src/app/emu/memory/dma.cc b/src/app/emu/memory/dma.cc index a73be058..8ddcc1d7 100644 --- a/src/app/emu/memory/dma.cc +++ b/src/app/emu/memory/dma.cc @@ -245,7 +245,8 @@ void InitHdma(Snes* snes, MemoryImpl* memory, bool do_sync, int cpu_cycles) { snes->Read((channel[i].a_bank << 16) | channel[i].table_addr++); snes->RunCycles(8); channel[i].size |= - snes->Read((channel[i].a_bank << 16) | channel[i].table_addr++) << 8; + snes->Read((channel[i].a_bank << 16) | channel[i].table_addr++) + << 8; } channel[i].do_transfer = true; } @@ -286,7 +287,8 @@ void DoHdma(Snes* snes, MemoryImpl* memory, bool do_sync, int cycles) { channel[i].b_addr + bAdrOffsets[channel[i].mode][j], channel[i].from_b); } else { - TransferByte(snes, memory, channel[i].table_addr++, channel[i].a_bank, + TransferByte(snes, memory, channel[i].table_addr++, + channel[i].a_bank, channel[i].b_addr + bAdrOffsets[channel[i].mode][j], channel[i].from_b); } @@ -317,7 +319,8 @@ void DoHdma(Snes* snes, MemoryImpl* memory, bool do_sync, int cycles) { } snes->RunCycles(8); channel[i].size |= - snes->Read((channel[i].a_bank << 16) | channel[i].table_addr++) << 8; + snes->Read((channel[i].a_bank << 16) | channel[i].table_addr++) + << 8; } if (channel[i].rep_count == 0) channel[i].terminated = true; channel[i].do_transfer = true; diff --git a/src/app/main.cc b/src/app/main.cc index ea5094dc..cdc2fc1b 100644 --- a/src/app/main.cc +++ b/src/app/main.cc @@ -15,17 +15,20 @@ using namespace yaze; DEFINE_FLAG(std::string, rom_file, "", "The ROM file to load."); -int main(int argc, char** argv) { +int main(int argc, char **argv) { absl::InitializeSymbolizer(argv[0]); - + // Configure failure signal handler to be less aggressive // This prevents false positives during SDL/graphics cleanup absl::FailureSignalHandlerOptions options; options.symbolize_stacktrace = true; - options.use_alternate_stack = false; // Avoid conflicts with normal stack during cleanup - options.alarm_on_failure_secs = false; // Don't set alarms that can trigger on natural leaks + options.use_alternate_stack = + false; // Avoid conflicts with normal stack during cleanup + options.alarm_on_failure_secs = + false; // Don't set alarms that can trigger on natural leaks options.call_previous_handler = true; // Allow system handlers to also run - options.writerfn = nullptr; // Use default writer to avoid custom handling issues + options.writerfn = + nullptr; // Use default writer to avoid custom handling issues absl::InstallFailureSignalHandler(options); yaze::util::FlagParser parser(yaze::util::global_flag_registry()); RETURN_IF_EXCEPTION(parser.Parse(argc, argv));