From cbe14eadcdea2b64b19df456bca8f4712c46b22c Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 30 Apr 2016 22:26:33 -0500 Subject: [PATCH] Refactor: pass the entire Config object to the emulator. --- crater.c | 2 +- src/emulator.c | 4 ++-- src/emulator.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crater.c b/crater.c index b4138df..5f80ec2 100644 --- a/crater.c +++ b/crater.c @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) retval = EXIT_FAILURE; } else { printf("crater: emulating: %s\n", rom.name); - emulate(&rom, config->fullscreen, config->scale); + emulate(&rom, config); rom_close(&rom); } } diff --git a/src/emulator.c b/src/emulator.c index 1347f1f..66a9336 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -130,11 +130,11 @@ static void cleanup_graphics() Block until emulation is finished. */ -void emulate(ROM *rom, bool fullscreen, unsigned scale) +void emulate(ROM *rom, Config *config) { emu.gg = gamegear_create(); signal(SIGINT, handle_sigint); - setup_graphics(fullscreen, scale); + setup_graphics(config->fullscreen, config->scale); gamegear_attach_callback(emu.gg, frame_callback); gamegear_attach_display(emu.gg, emu.pixels); diff --git a/src/emulator.h b/src/emulator.h index d4b52b6..7d25244 100644 --- a/src/emulator.h +++ b/src/emulator.h @@ -5,8 +5,9 @@ #include +#include "config.h" #include "rom.h" /* Functions */ -void emulate(ROM*, bool, unsigned); +void emulate(ROM*, Config*);