pokemon_data.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #ifndef POKEMON_DATA_H
  2. #define POKEMON_DATA_H
  3. #pragma once
  4. /* NOTE: These map to the Gen 1 character set! */
  5. /* TODO: It may make more sense to put this in a const array as a LUT,
  6. * e.g. t['F'], t['l'], t['i'], t['p'], t['e'], t['r'], t['\0']
  7. * As this could be an easier translation for each letter to build a string
  8. * to set names and things on the fly in the flipper. Need to explore that.
  9. * once I get to that point.
  10. */
  11. #define TERM_ 0x50
  12. #define SPACE_ 0x7f
  13. #define A_ 0x80
  14. #define B_ 0x81
  15. #define C_ 0x82
  16. #define D_ 0x83
  17. #define E_ 0x84
  18. #define F_ 0x85
  19. #define G_ 0x86
  20. #define H_ 0x87
  21. #define I_ 0x88
  22. #define J_ 0x89
  23. #define K_ 0x8a
  24. #define L_ 0x8b
  25. #define M_ 0x8c
  26. #define N_ 0x8d
  27. #define O_ 0x8e
  28. #define P_ 0x8f
  29. #define Q_ 0x90
  30. #define R_ 0x91
  31. #define S_ 0x92
  32. #define T_ 0x93
  33. #define U_ 0x94
  34. #define V_ 0x95
  35. #define W_ 0x96
  36. #define X_ 0x97
  37. #define Y_ 0x98
  38. #define Z_ 0x99
  39. #define O_PAREN_ 0x9a
  40. #define C_PAREN_ 0x9b
  41. #define COLON_ 0x9c
  42. #define SEMI_ 0x9d
  43. #define O_BRACKET_ 0x9e
  44. #define C_BRACKET_ 0x9f
  45. #define a_ 0xa0
  46. #define b_ 0xa1
  47. #define c_ 0xa2
  48. #define d_ 0xa3
  49. #define e_ 0xa4
  50. #define f_ 0xa5
  51. #define g_ 0xa6
  52. #define h_ 0xa7
  53. #define i_ 0xa8
  54. #define j_ 0xa9
  55. #define k_ 0xaa
  56. #define l_ 0xab
  57. #define m_ 0xac
  58. #define n_ 0xad
  59. #define o_ 0xae
  60. #define p_ 0xaf
  61. #define q_ 0xb0
  62. #define r_ 0xb1
  63. #define s_ 0xb2
  64. #define t_ 0xb3
  65. #define u_ 0xb4
  66. #define v_ 0xb5
  67. #define w_ 0xb6
  68. #define x_ 0xb7
  69. #define y_ 0xb8
  70. #define z_ 0xb9
  71. #define e_ACCENT_ 0xba
  72. #define d_TICK_ 0xbb
  73. #define l_TICK_ 0xbc
  74. #define s_TICK_ 0xbd
  75. #define t_TICK_ 0xbe
  76. #define v_TICK_ 0xbf
  77. #define S_QUOTE_ 0xe0
  78. #define PK_ 0xe1
  79. #define MN_ 0xe2
  80. #define DASH_ 0xe3
  81. #define r_TICK_ 0xe4
  82. #define m_TICK_ 0xe5
  83. #define QUESTION_ 0xe6
  84. #define EXCLAIM_ 0xe7
  85. #define PERIOD_ 0xe8
  86. #define R_ARR_ 0xec
  87. #define D_ARR_ 0xee
  88. #define MALE_ 0xef
  89. #define FEMALE_ 0xf5
  90. #define _0_ 0xf6
  91. #define _1_ 0xf7
  92. #define _2_ 0xf8
  93. #define _3_ 0xf9
  94. #define _4_ 0xfa
  95. #define _5_ 0xfb
  96. #define _6_ 0xfc
  97. #define _7_ 0xfd
  98. #define _8_ 0xfe
  99. #define _9_ 0xff
  100. /* NOTE: These are all opposite endianness on the flipper than they are in the
  101. * GB/Z80. e.g. a uint16_t value of 0x2c01 translates to 0x012c. Does flipper
  102. * API have calls to swap endianness?
  103. */
  104. struct __attribute__((__packed__)) pokemon_structure {
  105. uint8_t species;
  106. uint16_t hp;
  107. uint8_t level;
  108. uint8_t status_condition;
  109. uint8_t type[2];
  110. uint8_t catch_held;
  111. uint8_t move[4];
  112. uint16_t orig_trainer;
  113. uint8_t exp[3];
  114. uint16_t hp_ev;
  115. uint16_t atk_ev;
  116. uint16_t def_ev;
  117. uint16_t spd_ev;
  118. uint16_t special_ev;
  119. uint16_t iv;
  120. uint8_t move_pp[4];
  121. uint8_t level_again;
  122. uint16_t max_hp;
  123. uint16_t atk;
  124. uint16_t def;
  125. uint16_t spd;
  126. uint16_t special;
  127. };
  128. struct __attribute__((__packed__)) name {
  129. unsigned char str[11];
  130. };
  131. struct __attribute__((__packed__)) trade_data_block {
  132. unsigned char trainer_name[11];
  133. uint8_t party_cnt;
  134. uint8_t party_members[7]; // Unsure if last byte always needs to be 0xff for terminator
  135. struct pokemon_structure party[6];
  136. struct name ot_name[6];
  137. struct name nickname[6];
  138. };
  139. typedef struct trade_data_block TradeBlock;
  140. #endif /* POKEMON_DATA_H */