An emulator, assembler, and disassembler for the Sega Game Gear
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

51 lignes
979 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 "gamegear.h"
  4. #include "logging.h"
  5. /*
  6. Create and return a pointer to a new GameGear object.
  7. If memory could not be allocated, OUT_OF_MEMORY() is triggered.
  8. */
  9. GameGear* gamegear_create()
  10. {
  11. GameGear *gg = malloc(sizeof(GameGear));
  12. if (!gg)
  13. OUT_OF_MEMORY()
  14. gg->rom = NULL;
  15. return gg;
  16. }
  17. /*
  18. Destroy a previously-allocated GameGear object.
  19. Does *not* destroy any loaded ROM objects.
  20. */
  21. void gamegear_destroy(GameGear* gg)
  22. {
  23. free(gg);
  24. }
  25. /*
  26. Load a ROM image into the GameGear object.
  27. Does *not* steal the reference to the ROM object.
  28. */
  29. void gamegear_load(GameGear* gg, ROM* rom)
  30. {
  31. gg->rom = rom;
  32. }
  33. /*
  34. Powers a GameGear object, beginning emulation.
  35. This function call blocks until the GameGear is powered off.
  36. */
  37. void gamegear_power(GameGear* gg)
  38. {
  39. // TODO
  40. }