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.
 
 
 
 
 

34 lines
829 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 <stdint.h>
  5. #include <stdlib.h>
  6. /* Error strings */
  7. static const char* rom_err_isdir = "Is a directory";
  8. static const char* rom_err_notfile = "Is not a regular file";
  9. static const char* rom_err_badsize = "Invalid size";
  10. static const char* rom_err_badread = "Couldn't read the entire file";
  11. static const char* rom_err_badheader = "Invalid header";
  12. /* Structs */
  13. typedef struct {
  14. char *name;
  15. uint8_t *data;
  16. size_t size;
  17. uint16_t checksum;
  18. uint32_t product_code;
  19. uint8_t version;
  20. uint8_t region_code;
  21. } ROM;
  22. /* Functions */
  23. const char* rom_open(ROM**, const char*);
  24. void rom_close(ROM*);
  25. const char* rom_region(const ROM*);