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.

1234567891011121314151617181920212223242526272829303132333435
  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 "util_alloc.h"
  7. #define INVALID_SIZE_CODE 0x8
  8. #define BINARY_FMT "0b%u%u%u%u%u%u%u%u" // Used by register dumpers
  9. #define BINARY_VAL(data) \
  10. (data & (1 << 7) ? 1 : 0), \
  11. (data & (1 << 6) ? 1 : 0), \
  12. (data & (1 << 5) ? 1 : 0), \
  13. (data & (1 << 4) ? 1 : 0), \
  14. (data & (1 << 3) ? 1 : 0), \
  15. (data & (1 << 2) ? 1 : 0), \
  16. (data & (1 << 1) ? 1 : 0), \
  17. (data & (1 << 0) ? 1 : 0)
  18. /* Functions */
  19. uint8_t bcd_encode(uint8_t);
  20. uint8_t bcd_decode(uint8_t);
  21. uint64_t get_time_ns();
  22. bool is_valid_symbol_char(char, bool);
  23. const char* region_code_to_string(uint8_t);
  24. uint8_t region_string_to_code(const char*);
  25. size_t size_code_to_bytes(uint8_t);
  26. uint8_t size_bytes_to_code(size_t);
  27. uint16_t compute_checksum(const uint8_t*, size_t, uint8_t);
  28. const char* get_third_party_developer(uint8_t);