An emulator, assembler, and disassembler for the Sega Game Gear
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

32 lines
677 B

  1. /* Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. #include <unistd.h>
  4. #include "iomanager.h"
  5. #include "logging.h"
  6. /*
  7. Emulate a Game Gear. Handle I/O with the host computer.
  8. Block until emulation is finished.
  9. */
  10. void iomanager_emulate(GameGear *gg)
  11. {
  12. DEBUG("IOManager powering GameGear")
  13. gamegear_power(gg, true);
  14. #ifdef DEBUG_MODE
  15. z80_dump_registers(&gg->cpu);
  16. #endif
  17. // TODO: use SDL events
  18. while (1) {
  19. gamegear_simulate(gg);
  20. usleep(1000 * 1000 / 60);
  21. }
  22. DEBUG("IOManager unpowering GameGear")
  23. gamegear_power(gg, false);
  24. }