Refactor main function and improve file dialog implementation

- Cleaned up formatting in main function for better readability.
- Simplified platform initialization in LoadConfigFile and GetConfigDirectory functions.
- Introduced wrapper methods for file dialog operations to enhance modularity and maintainability.
- Improved code clarity by adjusting line breaks and spacing in various functions.
This commit is contained in:
scawful
2025-09-26 12:43:42 -04:00
parent 41a5b952e4
commit a28ca03cba
5 changed files with 30 additions and 24 deletions

View File

@@ -3,8 +3,8 @@
#include <cstdint>
#include <functional>
#include <vector>
#include <string>
#include <vector>
namespace yaze {
namespace emu {

View File

@@ -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;

View File

@@ -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;