ttebkgen.c 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. /******************************************************************************
  2. *
  3. * project name: TI-68k Developer Utilities
  4. * file name: ttebkgen.c
  5. * initial date: 24/08/2000
  6. * authors: thomas.nussbaumer@gmx.net
  7. * description: executes all steps till a complete eBook
  8. *
  9. ******************************************************************************/
  10. /*
  11. This file is part of TI-68k Developer Utilities.
  12. This file is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU Lesser General Public
  14. License as published by the Free Software Foundation; either
  15. version 2.1 of the License, or (at your option) any later version.
  16. As a special exception, UNMODIFIED copies of ttebkgen may also be
  17. redistributed or sold without source code, for any purpose. (The Lesser
  18. General Public License restrictions do apply in other respects; for example,
  19. they cover modification of the program.) This exception notice must be
  20. removed on modified copies of this file.
  21. This program is distributed in the hope that it will be useful,
  22. but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  24. Lesser General Public License for more details.
  25. You should have received a copy of the GNU Lesser General Public
  26. License along with this library; if not, write to the Free Software
  27. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #include <stdio.h>
  30. #include <stdlib.h>
  31. #include <string.h>
  32. #include <ctype.h>
  33. #include <time.h>
  34. #include "tt.h" // generic defines
  35. #include "ttversion.h" // TI-68k Developer Utilities version info
  36. #include "revtools.h" // automatic cvs version extraction
  37. #ifdef FILE_REVISION
  38. #undef FILE_REVISION
  39. #endif
  40. #define FILE_REVISION "1.10"
  41. #define EMBEDDED_USE
  42. #include "ttsplit.c"
  43. #include "ttebkmeta.h"
  44. #include "packhead.h" // compressed header definition
  45. #include "ttdos2ebk.c"
  46. #include "ttarchive.h"
  47. #include "bin2oth.c"
  48. #include "ttarchive.c"
  49. #undef EMBEDDED_USE
  50. //=============================================================================
  51. // outputs usage information of this tool
  52. //=============================================================================
  53. void PrintUsage() {
  54. PRINT_ID("TTEbkGen");
  55. fprintf(USAGE_OUT, "Usage: ttebkgen [flags] <infile> <varname> \"description\"\n\n"\
  56. "-t titlefile ... own title image - see Note (8)\n"\
  57. "-89 ... generate ONLY TI89 ebook\n"\
  58. "-92 ... generate ONLY TI92p ebook\n"\
  59. "-v ... verbose (unsets -quiet)\n"\
  60. "-quiet ... don't output standard messages (unsets -v)\n"\
  61. "-keepfiles ... keep all temporary generated files (for debugging only)\n\n"\
  62. "the infile must contain the complete text of the final ebook.\n"\
  63. "split points must be marked within the inputfile with tag\n"\
  64. "<--split--> on a single line.\n"\
  65. "NOTES:\n"\
  66. " (1) the maximum uncompressed size of a ebook part is 65518 bytes.\n"\
  67. " (2) the final size of the ebook cannot extend 65608 bytes\n"\
  68. " (including PC header infos)\n"\
  69. " (3) if a part is too long, define more splitpoints in the infile\n"\
  70. " (4) if the complete text will not fit into one ebook, split\n"\
  71. " the text into two or more ebooks\n"\
  72. " (5) varname is used as outfile name and as varname on the calculator\n"\
  73. " (6) don't forget to enclose the description in quotes !!\n"\
  74. " (7) just the first 19 character of the description are used\n"\
  75. " (8) titlefile must be a 4-grayscale pic with 160x100 pixels in binary form\n"\
  76. " generated with ImageStudio (not compressed binary)\n\n");
  77. }
  78. char* tmptitlename = "tt_tf00.bin";
  79. char* titlename = 0;
  80. unsigned char default_image[] = {
  81. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  82. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  83. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  84. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  85. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  86. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  87. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,
  88. 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  89. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,
  90. 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  91. 0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x0e,
  92. 0x00,0x7f,0xff,0x80,0x60,0x00,0x00,0x00,0x00,0x00,
  93. 0x00,0x00,0x00,0x00,0x00,0x1e,0xff,0xff,0xff,0xef,
  94. 0xff,0xf7,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  95. 0x00,0x00,0x00,0x00,0x00,0x1e,0xcf,0xff,0xfc,0xef,
  96. 0xff,0xff,0xfb,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  97. 0x00,0x00,0x00,0x00,0x00,0x1e,0xbf,0xff,0xff,0xef,
  98. 0xf0,0x03,0xfc,0x00,0x63,0x00,0x00,0x00,0x00,0x00,
  99. 0x00,0x00,0x00,0x00,0x00,0x1e,0xff,0xff,0xff,0xaf,
  100. 0xf0,0x03,0xfc,0x00,0x63,0x00,0x00,0x00,0x00,0x00,
  101. 0x00,0x00,0x00,0x00,0x00,0x1e,0x7f,0xc0,0x7f,0xce,
  102. 0x70,0x03,0xff,0xf0,0x63,0x00,0x00,0x00,0x00,0x00,
  103. 0x00,0x00,0x00,0x00,0x00,0x1e,0xff,0xc0,0x7f,0xce,
  104. 0x70,0x03,0xff,0xe0,0x63,0x00,0x00,0x00,0x00,0x00,
  105. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xce,
  106. 0x70,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  107. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xfe,
  108. 0x70,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  109. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xfe,
  110. 0x70,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  111. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xfe,
  112. 0x70,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  113. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xfe,
  114. 0x70,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  115. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xfe,
  116. 0x70,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  117. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xfe,
  118. 0x70,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  119. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  120. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  121. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  122. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  123. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  124. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  125. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  126. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  127. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  128. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  129. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  130. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  131. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  132. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  133. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  134. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  135. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  136. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  137. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  138. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  139. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  140. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  141. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  142. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  143. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  144. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  145. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  146. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  147. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  148. 0xf0,0x03,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  149. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  150. 0xf0,0x07,0xfb,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  151. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x7f,0xff,
  152. 0xf0,0x07,0xff,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  153. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x1f,0xff,
  154. 0xf0,0x7f,0xff,0x80,0x63,0x00,0x00,0x00,0x00,0x00,
  155. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  156. 0xf0,0x00,0x1f,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  157. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  158. 0xf0,0x00,0x1f,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  159. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  160. 0xf0,0x00,0x1f,0xc0,0x63,0x00,0x00,0x00,0x00,0x00,
  161. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  162. 0xf0,0x00,0x3f,0xe0,0x63,0x00,0x00,0x00,0x00,0x00,
  163. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0x80,0x00,0x1f,
  164. 0xff,0xff,0xff,0xff,0xe3,0x00,0x00,0x00,0x00,0x00,
  165. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0xff,0xff,0xff,
  166. 0xff,0xff,0xff,0xff,0xe3,0x00,0x00,0x00,0x00,0x00,
  167. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0xff,0xff,0xff,
  168. 0xff,0xff,0xff,0xff,0xe3,0x00,0x00,0x00,0x00,0x00,
  169. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0xd7,0xd7,0xef,
  170. 0xff,0xff,0xff,0xff,0xe3,0x00,0x00,0x00,0x00,0x00,
  171. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0x7f,0xfc,0xdf,
  172. 0xf0,0x00,0x00,0x00,0xe3,0x00,0x00,0x00,0x00,0x00,
  173. 0x00,0x00,0x00,0x00,0x00,0x18,0xc1,0xfc,0xef,0xb9,
  174. 0xef,0xff,0xff,0xfe,0xff,0x00,0x00,0x00,0x00,0x00,
  175. 0x00,0x00,0x00,0x00,0x00,0x18,0xc7,0xf0,0x07,0xf9,
  176. 0xec,0xff,0xff,0xce,0xff,0x00,0x00,0x00,0x00,0x00,
  177. 0x00,0x00,0x00,0x00,0x00,0x18,0xdf,0xe0,0x00,0xf9,
  178. 0xeb,0xff,0xff,0xfe,0xff,0x00,0x00,0x00,0x00,0x00,
  179. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0xc0,0x00,0xf9,
  180. 0xef,0xff,0xff,0xfa,0xff,0x00,0x00,0x00,0x00,0x00,
  181. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0x81,0xff,0xf9,
  182. 0xe7,0xfc,0x07,0xfc,0xe7,0x00,0x00,0x00,0x00,0x00,
  183. 0x00,0x00,0x00,0x00,0x00,0x18,0x7f,0x87,0xc0,0x39,
  184. 0xef,0xfc,0x07,0xfc,0xe7,0x00,0x00,0x00,0x00,0x00,
  185. 0x00,0x00,0x00,0x00,0x00,0x18,0x7f,0x1f,0x80,0x1f,
  186. 0xff,0xff,0xc7,0xfc,0xe7,0x00,0x00,0x00,0x00,0x00,
  187. 0x00,0x00,0x00,0x00,0x00,0x18,0xfe,0x7e,0x00,0x1f,
  188. 0xff,0xff,0xc7,0xff,0xe7,0x00,0x00,0x00,0x00,0x00,
  189. 0x00,0x00,0x00,0x00,0x00,0x19,0xfe,0xfc,0x00,0x1b,
  190. 0xff,0xff,0xc7,0xff,0xe7,0x00,0x00,0x00,0x00,0x00,
  191. 0x00,0x00,0x00,0x00,0x00,0x19,0xff,0xf8,0x00,0x01,
  192. 0xff,0xff,0xc7,0xff,0xe7,0x00,0x00,0x00,0x00,0x00,
  193. 0x00,0x00,0x00,0x00,0x00,0x19,0xff,0xf8,0x00,0x01,
  194. 0xff,0xff,0xc7,0xff,0xe7,0x00,0x00,0x00,0x00,0x00,
  195. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfd,0xf0,0x00,0x01,
  196. 0xff,0xff,0xc7,0xff,0xe7,0x00,0x00,0x00,0x00,0x00,
  197. 0x00,0x00,0x00,0x00,0x00,0x1b,0xff,0xf0,0x00,0x01,
  198. 0xff,0xff,0xc7,0xff,0xe7,0x00,0x00,0x00,0x00,0x00,
  199. 0x00,0x00,0x00,0x00,0x00,0x1b,0xff,0xf0,0x00,0x01,
  200. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  201. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xe0,0x00,0x01,
  202. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  203. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xe0,0x00,0x01,
  204. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  205. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xe0,0x00,0x01,
  206. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  207. 0x00,0x00,0x00,0x00,0x00,0x1f,0xfd,0xe0,0x00,0x01,
  208. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  209. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfd,0xe0,0x00,0x01,
  210. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  211. 0x00,0x00,0x00,0x00,0x00,0x1b,0xff,0xe0,0x00,0x01,
  212. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  213. 0x00,0x00,0x00,0x00,0x00,0x19,0xff,0xe0,0x00,0x01,
  214. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  215. 0x00,0x00,0x00,0x00,0x00,0x19,0xfe,0xe0,0x00,0x01,
  216. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  217. 0x00,0x00,0x00,0x00,0x00,0x19,0xff,0xe0,0x00,0x01,
  218. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  219. 0x00,0x00,0x00,0x00,0x00,0x19,0xff,0xe0,0x00,0x01,
  220. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  221. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0x60,0x00,0x21,
  222. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  223. 0x00,0x00,0x00,0x00,0x00,0x18,0x7f,0xe0,0x00,0x61,
  224. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  225. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0xf0,0x00,0xe1,
  226. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  227. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0xf0,0x01,0xc1,
  228. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  229. 0x00,0x00,0x00,0x00,0x00,0x18,0xcf,0xe0,0x07,0xc1,
  230. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  231. 0x00,0x00,0x00,0x00,0x00,0x18,0xc3,0xfd,0xcf,0x01,
  232. 0xff,0xff,0xc7,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  233. 0x00,0x00,0x00,0x00,0x00,0x18,0xc2,0xff,0xfe,0x01,
  234. 0xff,0xff,0xc1,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  235. 0x00,0x00,0x00,0x00,0x00,0x18,0xc1,0xa7,0xd0,0x03,
  236. 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  237. 0x00,0x00,0x00,0x00,0x00,0x18,0xc0,0xfe,0x00,0x07,
  238. 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  239. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  240. 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  241. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  242. 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  243. 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x03,0xff,0xc0,
  244. 0x0f,0xf8,0x00,0x01,0xff,0x00,0x00,0x00,0x00,0x00,
  245. 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,
  246. 0x0f,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  247. 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,
  248. 0x0f,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  249. 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
  250. 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  251. 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
  252. 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
  253. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  254. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  255. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  256. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  257. 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x03,0x80,0x00,
  258. 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,
  259. 0x00,0x00,0x00,0x7c,0x00,0x00,0x70,0x07,0xc0,0x00,
  260. 0x1f,0xef,0x1e,0x1e,0x03,0x9e,0x1e,0x00,0x00,0x00,
  261. 0x00,0x00,0x00,0x7e,0x00,0x00,0x70,0x07,0x00,0x00,
  262. 0x0f,0xf7,0xbf,0x3f,0x07,0xbf,0x3f,0x04,0x00,0x00,
  263. 0x00,0x00,0x3c,0x77,0x3c,0x3c,0x76,0x0f,0x9e,0x36,
  264. 0x03,0x87,0x3b,0xbb,0x87,0x3b,0x9b,0x86,0x00,0x00,
  265. 0x00,0x00,0x7e,0x7f,0x7e,0x7e,0x7f,0x07,0xff,0x3f,
  266. 0x03,0x87,0x1f,0xbb,0x8f,0x3b,0x87,0x86,0x00,0x00,
  267. 0x00,0x00,0x7f,0x7e,0x77,0x77,0x7e,0x07,0x3b,0xbf,
  268. 0x03,0x87,0x3f,0x1f,0x8e,0x1f,0x8f,0x3f,0x80,0x00,
  269. 0x00,0x00,0x7f,0x77,0x77,0x77,0x7c,0x07,0x3b,0xb8,
  270. 0x03,0x87,0x3b,0x8f,0x8e,0x0f,0x9e,0x1f,0xc0,0x00,
  271. 0x00,0x00,0x72,0x77,0x77,0x77,0x7c,0x07,0x3b,0xb8,
  272. 0x03,0x87,0x3b,0x87,0x9e,0x07,0xbc,0x06,0x00,0x00,
  273. 0x00,0x00,0x3d,0x7f,0x3f,0x3f,0x76,0x07,0x1f,0xb8,
  274. 0x03,0x8f,0x1f,0x9f,0x1c,0x1f,0x3f,0x06,0x00,0x00,
  275. 0x00,0x00,0x1e,0x3e,0x1e,0x1e,0x33,0x03,0x0f,0x18,
  276. 0x01,0x87,0x8f,0x0e,0x3c,0x0e,0x1f,0x82,0x00,0x00,
  277. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  278. 0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,
  279. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  280. 0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,
  281. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  282. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  283. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  284. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  285. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  286. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  287. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,
  288. 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  289. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,
  290. 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  291. 0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x1e,
  292. 0x00,0x7f,0xff,0xc0,0x60,0x00,0x00,0x00,0x00,0x00,
  293. 0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x1e,
  294. 0x00,0x0f,0xfc,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  295. 0x00,0x00,0x00,0x00,0x00,0x1e,0x1f,0x80,0x7e,0x1e,
  296. 0x00,0x07,0xfc,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  297. 0x00,0x00,0x00,0x00,0x00,0x1e,0x3f,0x80,0x7f,0x1e,
  298. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  299. 0x00,0x00,0x00,0x00,0x00,0x1e,0x7f,0x80,0x7f,0x9e,
  300. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  301. 0x00,0x00,0x00,0x00,0x00,0x1e,0xff,0x80,0x7f,0xde,
  302. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  303. 0x00,0x00,0x00,0x00,0x00,0x1e,0xff,0x80,0x7f,0xde,
  304. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  305. 0x00,0x00,0x00,0x00,0x00,0x1e,0xff,0x80,0x7f,0xfe,
  306. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  307. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  308. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  309. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  310. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  311. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  312. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  313. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  314. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  315. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  316. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  317. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  318. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  319. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  320. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  321. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  322. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  323. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  324. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  325. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  326. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  327. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  328. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  329. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  330. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  331. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  332. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  333. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  334. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  335. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  336. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  337. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  338. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  339. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  340. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  341. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  342. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  343. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  344. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  345. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  346. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  347. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  348. 0x00,0x07,0xf8,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  349. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x7f,0xfe,
  350. 0x00,0x07,0xfc,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  351. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x00,0x3f,0xfe,
  352. 0x00,0x0f,0xfc,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  353. 0x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0x00,0x07,0xfe,
  354. 0x00,0x7f,0xff,0xc0,0x60,0x00,0x00,0x00,0x00,0x00,
  355. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,
  356. 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  357. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,
  358. 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  359. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,
  360. 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  361. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,
  362. 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
  363. 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x01,
  364. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  365. 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x01,
  366. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  367. 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x01,
  368. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  369. 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0f,0xe0,0x11,
  370. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  371. 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xff,0xfe,0x11,
  372. 0xe0,0x00,0x00,0x01,0xe0,0x00,0x00,0x00,0x00,0x00,
  373. 0x00,0x00,0x00,0x00,0x00,0x18,0x03,0xff,0x1f,0xf1,
  374. 0xe0,0x00,0x00,0x01,0xe0,0x00,0x00,0x00,0x00,0x00,
  375. 0x00,0x00,0x00,0x00,0x00,0x18,0x07,0xf8,0x03,0xf1,
  376. 0xe1,0xf8,0x07,0xe1,0xe0,0x00,0x00,0x00,0x00,0x00,
  377. 0x00,0x00,0x00,0x00,0x00,0x18,0x0f,0xe0,0x01,0xf1,
  378. 0xe3,0xf8,0x07,0xf1,0xe0,0x00,0x00,0x00,0x00,0x00,
  379. 0x00,0x00,0x00,0x00,0x00,0x18,0x1f,0xc0,0x00,0x71,
  380. 0xe7,0xf8,0x07,0xf9,0xe0,0x00,0x00,0x00,0x00,0x00,
  381. 0x00,0x00,0x00,0x00,0x00,0x18,0x3f,0x80,0x00,0x71,
  382. 0xef,0xf8,0x07,0xfd,0xe0,0x00,0x00,0x00,0x00,0x00,
  383. 0x00,0x00,0x00,0x00,0x00,0x18,0x7f,0x00,0x00,0x31,
  384. 0xef,0xf8,0x07,0xfd,0xe0,0x00,0x00,0x00,0x00,0x00,
  385. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0x00,0x00,0x31,
  386. 0xef,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  387. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0x00,0x00,0x11,
  388. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  389. 0x00,0x00,0x00,0x00,0x00,0x19,0xfe,0x00,0x00,0x11,
  390. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  391. 0x00,0x00,0x00,0x00,0x00,0x19,0xfe,0x00,0x00,0x01,
  392. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  393. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfe,0x00,0x00,0x01,
  394. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  395. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfe,0x00,0x00,0x01,
  396. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  397. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfc,0x00,0x00,0x01,
  398. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  399. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfc,0x00,0x00,0x01,
  400. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  401. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfc,0x00,0x00,0x01,
  402. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  403. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfc,0x00,0x00,0x01,
  404. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  405. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfc,0x00,0x00,0x01,
  406. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  407. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfe,0x00,0x00,0x01,
  408. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  409. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfe,0x00,0x00,0x01,
  410. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  411. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfe,0x00,0x00,0x01,
  412. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  413. 0x00,0x00,0x00,0x00,0x00,0x1b,0xfe,0x00,0x00,0x01,
  414. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  415. 0x00,0x00,0x00,0x00,0x00,0x19,0xfe,0x00,0x00,0x01,
  416. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  417. 0x00,0x00,0x00,0x00,0x00,0x19,0xfe,0x00,0x00,0x01,
  418. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  419. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0x00,0x00,0x01,
  420. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  421. 0x00,0x00,0x00,0x00,0x00,0x18,0xff,0x00,0x00,0x11,
  422. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  423. 0x00,0x00,0x00,0x00,0x00,0x18,0x7f,0x80,0x00,0x31,
  424. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  425. 0x00,0x00,0x00,0x00,0x00,0x18,0x3f,0x80,0x00,0x71,
  426. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  427. 0x00,0x00,0x00,0x00,0x00,0x18,0x1f,0xc0,0x00,0xe1,
  428. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  429. 0x00,0x00,0x00,0x00,0x00,0x18,0x0f,0xf0,0x03,0x81,
  430. 0xff,0xf8,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  431. 0x00,0x00,0x00,0x00,0x00,0x18,0x07,0xfe,0x3f,0x01,
  432. 0xff,0xf0,0x03,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  433. 0x00,0x00,0x00,0x00,0x00,0x18,0x01,0xff,0xfc,0x01,
  434. 0xff,0x80,0x00,0x7f,0xe0,0x00,0x00,0x00,0x00,0x00,
  435. 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x1f,0xe0,0x01,
  436. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  437. 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x01,
  438. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  439. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  440. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  441. 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
  442. 0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
  443. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  444. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  445. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  446. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  447. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  448. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  449. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  450. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  451. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  452. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  453. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  454. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  455. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  456. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  457. 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x03,0x80,0x00,
  458. 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,
  459. 0x00,0x00,0x00,0x7c,0x00,0x00,0x60,0x06,0x00,0x00,
  460. 0x1f,0xef,0x1e,0x1e,0x03,0x1e,0x1e,0x00,0x00,0x00,
  461. 0x00,0x00,0x00,0x66,0x00,0x00,0x60,0x06,0x00,0x00,
  462. 0x03,0x06,0x33,0x33,0x06,0x33,0x33,0x04,0x00,0x00,
  463. 0x00,0x00,0x3c,0x66,0x3c,0x3c,0x66,0x0f,0x9e,0x36,
  464. 0x03,0x06,0x33,0x33,0x06,0x33,0x03,0x04,0x00,0x00,
  465. 0x00,0x00,0x66,0x7c,0x66,0x66,0x6c,0x06,0x33,0x3e,
  466. 0x03,0x06,0x1e,0x33,0x0c,0x33,0x06,0x04,0x00,0x00,
  467. 0x00,0x00,0x7e,0x66,0x66,0x66,0x78,0x06,0x33,0x30,
  468. 0x03,0x06,0x33,0x1f,0x0c,0x1f,0x0c,0x3f,0x80,0x00,
  469. 0x00,0x00,0x60,0x66,0x66,0x66,0x78,0x06,0x33,0x30,
  470. 0x03,0x06,0x33,0x03,0x0c,0x03,0x18,0x04,0x00,0x00,
  471. 0x00,0x00,0x62,0x66,0x66,0x66,0x6c,0x06,0x33,0x30,
  472. 0x03,0x06,0x33,0x06,0x18,0x06,0x30,0x04,0x00,0x00,
  473. 0x00,0x00,0x3c,0x7c,0x3c,0x3c,0x66,0x06,0x1e,0x30,
  474. 0x03,0x0f,0x1e,0x1c,0x18,0x1c,0x3f,0x04,0x00,0x00,
  475. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  476. 0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,
  477. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  478. 0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,
  479. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  480. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
  481. //=============================================================================
  482. // delete temporary files
  483. //=============================================================================
  484. void CleanUp(int keepfiles) {
  485. int i;
  486. char tmpname[100];
  487. if (!keepfiles) {
  488. for (i=0;i<1000;i++) {
  489. sprintf(tmpname,"tictp%03d.txt",i); // splitted input files
  490. if (remove(tmpname)) break;
  491. }
  492. for (i=0;i<1000;i++) {
  493. sprintf(tmpname,"tictp%03d.tmp",i); // converted input files
  494. if (remove(tmpname)) break;
  495. }
  496. remove("tict.txt");
  497. remove("tictbook.cfg");
  498. if (tmptitlename == titlename) remove(tmptitlename);
  499. }
  500. }
  501. //=============================================================================
  502. // copies files
  503. //=============================================================================
  504. int FileCopy(char* source, char* dest) {
  505. FILE* fp_src = fopen(source,"rb");
  506. FILE* fp_dest;
  507. int c;
  508. if (!fp_src) return 0;
  509. if (!(fp_dest = fopen(dest,"wb"))) {
  510. fclose(fp_src);
  511. return 0;
  512. }
  513. do {
  514. c = fgetc(fp_src);
  515. if (c == EOF) break;
  516. fputc(c,fp_dest);
  517. }
  518. while (1);
  519. fclose(fp_src);
  520. fclose(fp_dest);
  521. return 1;
  522. }
  523. #define EBK_NOTSPECIFIED 0
  524. #define EBK_TI89VERSION 1
  525. #define EBK_TI92PVERSION 2
  526. //=============================================================================
  527. // a main is a main is main .....
  528. //=============================================================================
  529. int main(int argc, char* argv[]) {
  530. char* infilename = 0;
  531. char* varname = 0;
  532. char* description = 0;
  533. FILE* fp;
  534. char buffer[1024];
  535. char tmpname[1024];
  536. int i;
  537. int count;
  538. int keep = 0;
  539. char* ttdos2ebk_params[3];
  540. //char* ttpack_params[4];
  541. char* ttarchive_params[8];
  542. //char* ttbin2bin_params[2];
  543. int ebk_type = EBK_NOTSPECIFIED;
  544. int verbose = 0;
  545. int quiet = 0;
  546. ttdos2ebk_params[0] = "";
  547. ttdos2ebk_params[1] = tmpname;
  548. ttdos2ebk_params[2] = buffer;
  549. if (argc < 4) {
  550. PrintUsage();
  551. return 1;
  552. }
  553. // parse arguments
  554. for (i=1; i<argc; i++) {
  555. if (!strcmp(argv[i], "-keepfiles")) keep = 1;
  556. else if (!strcmp(argv[i], "-89")) ebk_type |= EBK_TI89VERSION;
  557. else if (!strcmp(argv[i], "-92")) ebk_type |= EBK_TI92PVERSION;
  558. else if (!strcmp(argv[i], "-v")) quiet=0,verbose=1;
  559. else if (!strcmp(argv[i], "-quiet")) quiet=1,verbose=0;
  560. else if (!strcmp(argv[i], "-t")) {
  561. if (i == argc-1) {
  562. PrintUsage();
  563. return 1;
  564. }
  565. i++;
  566. titlename = argv[i];
  567. }
  568. else if (!infilename) infilename = argv[i];
  569. else if (!varname) varname = argv[i];
  570. else if (!description) description = argv[i];
  571. else {
  572. PrintUsage();
  573. return 1;
  574. }
  575. }
  576. if (!infilename || !varname || !description) {
  577. PrintUsage();
  578. return 1;
  579. }
  580. CleanUp(0); // delete old files to make sure we won't process them
  581. if (ebk_type == EBK_NOTSPECIFIED) {
  582. ebk_type = EBK_TI89VERSION | EBK_TI92PVERSION;
  583. }
  584. if (!quiet) PRINT_ID("TTEbkGen");
  585. //--------------------------------------------
  586. // if no title file is given, generate default
  587. // title file
  588. //--------------------------------------------
  589. if (!titlename) {
  590. FILE *f;
  591. titlename = tmptitlename;
  592. if (!(f = fopen(titlename,"wb"))) {
  593. fprintf(stderr,"ERROR: cannot generate temporary titlefile %s\n",titlename);
  594. return 1;
  595. }
  596. if (fwrite(default_image,4000,1,f) != 1) {
  597. fprintf(stderr,"ERROR: cannot generate temporary titlefile %s\n",titlename);
  598. return 1;
  599. }
  600. fclose(f);
  601. }
  602. //--------------------------------------------------------
  603. // check if files exists and if title file is of size 4000
  604. //--------------------------------------------------------
  605. if (!(fp=fopen(infilename,"r"))) {
  606. fprintf(stderr,"ERROR: infile %s doesn't exists\n",infilename);
  607. CleanUp(keep);
  608. return 1;
  609. }
  610. fclose(fp);
  611. if (!(fp=fopen(titlename,"rb"))) {
  612. fprintf(stderr,"ERROR: titlefile %s doesn't exists\n",titlename);
  613. CleanUp(keep);
  614. return 1;
  615. }
  616. fseek(fp,0,SEEK_END);
  617. if (ftell(fp) != 4000) {
  618. fprintf(stderr,"ERROR: titlefile %s is not of size 4000\n",titlename);
  619. fclose(fp);
  620. CleanUp(keep);
  621. return 1;
  622. }
  623. fclose(fp);
  624. //-------------------------------------------------------------------------
  625. // copy inputfile to "tict.txt" ...
  626. //-------------------------------------------------------------------------
  627. if (verbose) fprintf(stdout,"copying inputfile to tict.txt ...\n");
  628. if (!FileCopy(infilename,"tict.txt")) {
  629. CleanUp(keep);
  630. return 1;
  631. }
  632. //-------------------------------------------------------------------------
  633. // split "tict.txt" into "tictp000.txt", "tictp001.txt" ...
  634. //-------------------------------------------------------------------------
  635. if (verbose) fprintf(stdout,"splitting tict.txt ...\n");
  636. {
  637. char* parameters[] = {"","-s","<--split-->","-t","tict.txt"};
  638. if (TTSplit(5,parameters)) {
  639. CleanUp(keep);
  640. return 1;
  641. }
  642. }
  643. //--------------------------------------------------------
  644. // converting files "tictp000.txt" into "tictp000.ebk"
  645. //--------------------------------------------------------
  646. if (verbose) fprintf(stdout,"converting parts ...\n");
  647. for (i=0;i<1000;i++) {
  648. sprintf(tmpname,"tictp%03d.txt",i);
  649. fp = fopen(tmpname,"r");
  650. if (!fp) break;
  651. fclose(fp);
  652. sprintf(buffer,"tictp%03d.tmp",i);
  653. if (TTDos2Ebk(3,ttdos2ebk_params)) {
  654. CleanUp(keep);
  655. return 1;
  656. }
  657. }
  658. count = i;
  659. if (count == 0) {
  660. fprintf(stderr,"ERROR: no data to process further\n");
  661. CleanUp(keep);
  662. return 1;
  663. }
  664. //--------------------------------------------------------
  665. // generating ebook
  666. //--------------------------------------------------------
  667. if (verbose) fprintf(stdout,"generatic ebook .....");
  668. fp = fopen("tictbook.cfg","w");
  669. if (!fp) {
  670. fprintf(stderr,"ERROR: cannot generate tictbook.cfg\n");
  671. CleanUp(keep);
  672. return 1;
  673. }
  674. fprintf(fp,"#%s\n",description);
  675. fprintf(fp,"%s title 0 0 compress\n",titlename);
  676. for (i=0;i<count;i++) fprintf(fp,"tictp%03d.tmp p%03d 0 0 compress\n",i,i);
  677. fclose(fp);
  678. if (ebk_type & EBK_TI89VERSION) {
  679. ttarchive_params[0] = "";
  680. ttarchive_params[1] = (verbose) ? "-v" : "-quiet";
  681. ttarchive_params[2] = "-89";
  682. ttarchive_params[3] = "-e";
  683. ttarchive_params[4] = "ebk";
  684. ttarchive_params[5] = "tictbook.cfg";
  685. ttarchive_params[6] = varname;
  686. ttarchive_params[7] = "tictebks";
  687. if (TTArchive(8,ttarchive_params)) {
  688. fprintf(stderr,"ERROR: eBook %s.89y generation failed.\n",varname);
  689. CleanUp(keep);
  690. return 1;
  691. }
  692. if (!quiet) fprintf(stdout,"eBook %s.89y sucessfully generated.\n",varname);
  693. }
  694. if (ebk_type & EBK_TI92PVERSION) {
  695. ttarchive_params[0] = "";
  696. ttarchive_params[1] = (verbose) ? "-v" : "-quiet";
  697. ttarchive_params[2] = "-92";
  698. ttarchive_params[3] = "-e";
  699. ttarchive_params[4] = "ebk";
  700. ttarchive_params[5] = "tictbook.cfg";
  701. ttarchive_params[6] = varname;
  702. ttarchive_params[7] = "tictebks";
  703. if (TTArchive(8,ttarchive_params)) {
  704. fprintf(stderr,"ERROR: eBook %s.9xy generation failed.\n",varname);
  705. CleanUp(keep);
  706. return 1;
  707. }
  708. if (!quiet) fprintf(stdout,"eBook %s.9xy sucessfully generated.\n",varname);
  709. }
  710. CleanUp(keep);
  711. return 0;
  712. }
  713. //#############################################################################
  714. //###################### NO MORE FAKES BEYOND THIS LINE #######################
  715. //#############################################################################
  716. //
  717. //=============================================================================
  718. // Revision History
  719. //=============================================================================
  720. //
  721. // Revision 1.10 2009/01/25 Lionel Debroux
  722. // Changes by Romain Liévin and/or me for 64-bit compatibility.
  723. // Adapt to new version display (revtools.h).
  724. //
  725. // Revision 1.9 2002/03/14 11:27:19 tnussb
  726. // (1) new commandline parameter -89 (generate only TI89 ebook)
  727. // (2) new commandline parameter -92 (generate only TI92p ebook)
  728. // (3) new commandline parameter -v (verbose)
  729. // (4) new commandline parameter -quiet (suppress standard messages)
  730. // (5) TTBin2Bin usage replaced by second call to TTArchive
  731. // (6) TTPack usage removed (is now handled by TTArchive itself)
  732. //
  733. // Revision 1.8 2002/03/04 14:35:02 tnussb
  734. // No use of external TIGCC Tools anymore, but using now compiled-in versions.
  735. // This way this tool can be distributed by its own without the need of a
  736. // TIGCC Tools Suite installation.
  737. //
  738. // Revision 1.7 2002/02/07 09:49:37 tnussb
  739. // all local includes changed, because header files are now located in pctools folder
  740. //
  741. // Revision 1.6 2000/11/28 00:08:29 Thomas Nussbaumer
  742. // using now USAGE_OUT stream for usage info
  743. //
  744. // Revision 1.5 2000/10/18 23:21:35 Thomas Nussbaumer
  745. // filecopy is done now by own routine instead of a system call to support
  746. // linux
  747. //
  748. // Revision 1.4 2000/10/01 15:06:13 Thomas Nussbaumer
  749. // using now default title image if none is specified
  750. //
  751. // Revision 1.3 2000/08/26 19:07:09 Thomas Nussbaumer
  752. // using now inline split tag (much easier to handle than an external splitfile)
  753. //
  754. // Revision 1.2 2000/08/25 18:10:33 Thomas Nussbaumer
  755. // some corrections to usage text
  756. //
  757. // Revision 1.1 2000/08/25 18:06:30 Thomas Nussbaumer
  758. // initial version
  759. //
  760. //
  761. //