瀏覽代碼

Refactor: pass the entire Config object to the emulator.

master
Ben Kurtovic 8 年之前
父節點
當前提交
cbe14eadcd
共有 3 個檔案被更改,包括 5 行新增4 行删除
  1. +1
    -1
      crater.c
  2. +2
    -2
      src/emulator.c
  3. +2
    -1
      src/emulator.h

+ 1
- 1
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);
}
}


+ 2
- 2
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);


+ 2
- 1
src/emulator.h 查看文件

@@ -5,8 +5,9 @@

#include <stdbool.h>

#include "config.h"
#include "rom.h"

/* Functions */

void emulate(ROM*, bool, unsigned);
void emulate(ROM*, Config*);

Loading…
取消
儲存