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.
 
 
 
 
 

43 lines
962 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. #pragma once
  4. #include <stdbool.h>
  5. #include <stdint.h>
  6. #include "io.h"
  7. #include "mmu.h"
  8. #include "rom.h"
  9. #include "z80.h"
  10. #define GG_FPS 60
  11. #define GG_EXC_BUFF_SIZE 128
  12. /* Structs, etc. */
  13. struct GameGear;
  14. typedef void (*GGFrameCallback)(struct GameGear*);
  15. typedef struct GameGear {
  16. Z80 cpu;
  17. MMU mmu;
  18. VDP vdp;
  19. IO io;
  20. bool powered;
  21. GGFrameCallback callback;
  22. char exc_buffer[GG_EXC_BUFF_SIZE];
  23. } GameGear;
  24. /* Functions */
  25. GameGear* gamegear_create();
  26. void gamegear_destroy(GameGear*);
  27. void gamegear_load(GameGear*, const ROM*);
  28. void gamegear_simulate(GameGear*);
  29. void gamegear_power_off(GameGear*);
  30. void gamegear_set_callback(GameGear*, GGFrameCallback);
  31. void gamegear_clear_callback(GameGear*);
  32. const char* gamegear_get_exception(GameGear*);
  33. void gamegear_print_state(const GameGear*);