Kaynağa Gözat

Refactor: pass the entire Config object to the emulator.

master
Ben Kurtovic 8 yıl önce
ebeveyn
işleme
cbe14eadcd
3 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. +1
    -1
      crater.c
  2. +2
    -2
      src/emulator.c
  3. +2
    -1
      src/emulator.h

+ 1
- 1
crater.c Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

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

#include <stdbool.h>

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

/* Functions */

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

Yükleniyor…
İptal
Kaydet