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