Add-in development tools for fx-9860G and fx-CG 50, to use with GCC and gint.
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.

g1a.h 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //---
  2. // fxg1a:g1a - Add-in header for Casio's G1A format
  3. //---
  4. #ifndef FX_G1A
  5. #define FX_G1A
  6. #include <stdint.h>
  7. /* TODO: eStrips are not supported yet */
  8. struct estrip
  9. {
  10. uint8_t data[80];
  11. };
  12. /* G1A file header with 0x200 bytes. When output to a file the standard part
  13. (first 0x20 bytes) of this header is bit-inverted, but the non-inverted
  14. version makes a lot more sens so we'll be using it. */
  15. struct header
  16. { /* Offset Size Value */
  17. char magic[8]; /* 0x000 8 "USBPower" */
  18. uint8_t mcs_type; /* 0x008 1 0xf3 (AddIn) */
  19. uint8_t seq1[5]; /* 0x009 5 0x0010001000 */
  20. uint8_t control1; /* 0x00e 1 *0x13 + 0x41 */
  21. uint8_t seq2; /* 0x00f 1 0x01 */
  22. uint32_t filesize_be1; /* 0x010 4 File size, big endian */
  23. uint8_t control2; /* 0x014 1 *0x13 + 0xb8 */
  24. uint8_t _1; /* 0x015 1 ??? */
  25. uint16_t checksum; /* 0x016 2 BE sum of 8 shorts at 0x300 */
  26. uint8_t _2[6]; /* 0x018 6 ??? */
  27. uint16_t mcs_objects; /* 0x01e 2 MCS-only, unused */
  28. char internal[8]; /* 0x020 8 Internal app name with '@' */
  29. uint8_t _3[3]; /* 0x028 3 ??? */
  30. uint8_t estrips; /* 0x02b 1 Number of estrips (0..4) */
  31. uint8_t _4[4]; /* 0x02c 4 ??? */
  32. char version[10]; /* 0x030 10 Version "MM.mm.pppp" */
  33. uint8_t _5[2]; /* 0x03a 2 ??? */
  34. char date[14]; /* 0x03c 14 Build date "yyyy.MMdd.hhmm" */
  35. uint8_t _6[2]; /* 0x04a 2 ??? */
  36. uint8_t icon[68]; /* 0x04c 68 30*17 monochrome icon */
  37. struct estrip estrip1; /* 0x090 80 eStrip 1 */
  38. struct estrip estrip2; /* 0x0e0 80 eStrip 2 */
  39. struct estrip estrip3; /* 0x130 80 eStrip 3 */
  40. struct estrip estrip4; /* 0x180 80 eStrip 4 */
  41. uint8_t _7[4]; /* 0x1d0 4 ??? */
  42. char name[8]; /* 0x1d4 8 Add-in name */
  43. uint8_t _8[20]; /* 0x1dc 20 ??? */
  44. uint32_t filesize_be2; /* 0x1f0 4 File size, big endian */
  45. uint8_t _9[12]; /* 0x1f4 12 ??? */
  46. };
  47. /* A full g1a file, suitable for use with pointers */
  48. struct g1a
  49. {
  50. struct header header;
  51. uint8_t code[];
  52. };
  53. #endif /* FX_G1A */