An emulator, assembler, and disassembler for the Sega Game Gear
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

40 rindas
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. #pragma once
  4. #include <stdint.h>
  5. #include <stdlib.h>
  6. #define ROM_SIZE_MIN (32 << 10) // 32 KB
  7. #define ROM_SIZE_MAX ( 1 << 20) // 1 MB
  8. #define HEADER_SIZE 16
  9. /* Error strings */
  10. static const char* rom_err_isdir = "Is a directory";
  11. static const char* rom_err_notfile = "Is not a regular file";
  12. static const char* rom_err_badsize = "Invalid size";
  13. static const char* rom_err_badread = "Couldn't read the entire file";
  14. static const char* rom_err_badheader = "Invalid header";
  15. /* Structs */
  16. typedef struct {
  17. char *name;
  18. uint8_t *data;
  19. size_t size;
  20. uint16_t reported_checksum;
  21. uint16_t expected_checksum;
  22. uint32_t product_code;
  23. uint8_t version;
  24. uint8_t region_code;
  25. } ROM;
  26. /* Functions */
  27. const char* rom_open(ROM**, const char*);
  28. void rom_close(ROM*);
  29. const char* rom_region(const ROM*);