Human68k CUI emulator with sound.
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.

xdump.c 451B

12345678910111213141516
  1. #include <stdio.h>
  2. #include "tools.h"
  3. int main(int argc, char **argv) {
  4. size_t len = 0;
  5. uint8_t *data = load_file(argv[1], &len);
  6. #define READ_LONG(x) ((data[x] << 24) | (data[x + 1] << 16) | (data[x + 2] << 8) | data[x + 3])
  7. uint32_t text_size = READ_LONG(0x0c);
  8. for(int i = 0; i < text_size; i+=2) {
  9. if(i % 16 == 0 && i > 0) printf("\n");
  10. printf("0x%02x%02x, ", data[0x40 + i], data[0x41 + i]);
  11. }
  12. printf("\n");
  13. free(data);
  14. return 0;
  15. }