pst-ttuf.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. | TIGCC Program Starter - ttunpack decompression support (fast & large version)
  2. | Copyright (C) 2004-2005 Samuel Stearley, Kevin Kofler
  3. |
  4. | THE LICENSE:
  5. |
  6. | wxWindows Library Licence, Version 3.1
  7. | ======================================
  8. |
  9. | Copyright (C) 1998-2005 Julian Smart, Robert Roebling et al
  10. |
  11. | Everyone is permitted to copy and distribute verbatim copies
  12. | of this licence document, but changing it is not allowed.
  13. |
  14. | WXWINDOWS LIBRARY LICENCE
  15. | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  16. |
  17. | This library is free software; you can redistribute it and/or modify it
  18. | under the terms of the GNU Library General Public Licence as published by
  19. | the Free Software Foundation; either version 2 of the Licence, or (at
  20. | your option) any later version.
  21. |
  22. | This library is distributed in the hope that it will be useful, but
  23. | WITHOUT ANY WARRANTY; without even the implied warranty of
  24. | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
  25. | General Public Licence for more details.
  26. |
  27. | You should have received a copy of the GNU Library General Public Licence
  28. | along with this software, usually in a file named COPYING.LIB. If not,
  29. | write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  30. | Boston, MA 02111-1307 USA.
  31. |
  32. | EXCEPTION NOTICE
  33. |
  34. | 1. As a special exception, the copyright holders of this library give
  35. | permission for additional uses of the text contained in this release of
  36. | the library as licenced under the wxWindows Library Licence, applying
  37. | either version 3.1 of the Licence, or (at your option) any later version of
  38. | the Licence as published by the copyright holders of version
  39. | 3.1 of the Licence document.
  40. |
  41. | 2. The exception is that you may use, copy, link, modify and distribute
  42. | under your own terms, binary object code versions of works based
  43. | on the Library.
  44. |
  45. | 3. If you copy code from files distributed under the terms of the GNU
  46. | General Public Licence or the GNU Library General Public Licence into a
  47. | copy of this library, as this licence permits, the exception does not
  48. | apply to the code that you add in this way. To avoid misleading anyone as
  49. | to the status of such modified files, you must delete this exception
  50. | notice from such code and/or adjust the licensing conditions notice
  51. | accordingly.
  52. |
  53. | 4. If you write modifications of your own for this library, it is your
  54. | choice whether to permit this exception to apply to your modifications.
  55. | If you do not wish that, you must delete the exception notice from such
  56. | code and/or adjust the licensing conditions notice accordingly.
  57. | GET_UNCOMPRESSED_SIZE inline function
  58. | INPUT: %a3.l: pointer to compressed data
  59. | OUTPUT: %d6.l: uncompressed size
  60. | SIDE EFFECTS: throws a Data Type error if not a valid compressed program
  61. | may throw a Memory error
  62. | may advance %a3 for later decompression
  63. | DESTROYS: %d0-%d2/%a0-%a1
  64. .macro GET_UNCOMPRESSED_SIZE
  65. | Get the length of the variable.
  66. moveq.l #0,%d6
  67. move.w (%a3)+,%d6
  68. | Get a pointer to the data type of the variable.
  69. lea.l -1(%a3,%d6.l),%a0
  70. | Check if it has type "ppg".
  71. cmp.b #0xf8,(%a0)
  72. jbne invalid_archive
  73. tst.b -(%a0)
  74. jbne invalid_archive
  75. cmp.b #'g',-(%a0)
  76. jbne invalid_archive
  77. moveq.l #'p',%d0
  78. cmp.b -(%a0),%d0
  79. jbne invalid_archive
  80. cmp.b -(%a0),%d0
  81. jbne invalid_archive
  82. tst.b -(%a0)
  83. jbeq valid_archive
  84. | We don't need to check the magic number in the ttunpack header,
  85. | the decompression routine does that already.
  86. invalid_archive:
  87. .word 0xA000+210 | ER_DATATYPE
  88. valid_archive:
  89. | Get the uncompressed size.
  90. move.w (%a3),%d6
  91. rol.w #8,%d6
  92. .endm
  93. | MEM_TO_MEM_DECOMPRESS inline function
  94. | INPUT: %a3.l: pointer to compressed data
  95. | %a0.l: pointer to buffer for uncompressed data
  96. | %d6.l: uncompressed size
  97. | OUTPUT: %a4.l: pointer to uncompressed data
  98. | SIDE EFFECTS: may throw a Memory or Data Type error
  99. | DESTROYS: %d0-%d2/%a0-%a2
  100. .macro MEM_TO_MEM_DECOMPRESS
  101. pea.l (%a0) | destination
  102. pea.l (%a3) | source
  103. move.l %a0,%a4 | satisfy output constraint
  104. jbsr ttunpack_decompress
  105. addq.l #8,%a7
  106. tst.w %d0
  107. jbne invalid_archive
  108. .endm
  109. .text
  110. ttunpack_decompress:
  111. .word 18663
  112. .word 7998
  113. .word 11375
  114. .word 44
  115. .word 10863
  116. .word 48
  117. .word 18414
  118. .word 15
  119. .word 31232
  120. .word 6702
  121. .word 6
  122. .word 32264
  123. .word 28676
  124. .word 3118
  125. .word 84
  126. .word 2
  127. .word 26236
  128. .word 3118
  129. .word 80
  130. .word 3
  131. .word 26228
  132. .word 28678
  133. .word 3118
  134. .word 8
  135. .word 10
  136. .word 26218
  137. .word 3118
  138. .word 128
  139. .word 11
  140. .word 26210
  141. .word 28679
  142. .word 29184
  143. .word 4654
  144. .word 9
  145. .word 10241
  146. .word 20801
  147. .word 25172
  148. .word 28677
  149. .word 29184
  150. .word 4654
  151. .word 12
  152. .word 8769
  153. .word 23361
  154. .word 28230
  155. .word 29696
  156. .word 2498
  157. .word 21314
  158. .word -6086
  159. .word -6083
  160. .word 28672
  161. .word 4115
  162. .word 19958
  163. .word 16
  164. .word 18938
  165. .word 60
  166. .word 18948
  167. .word 26116
  168. .word 18938
  169. .word 82
  170. .word 20463
  171. .word -260
  172. .word 9295
  173. .word 16922
  174. .word 28672
  175. .word 29191
  176. .word 30208
  177. .word 451
  178. .word 5312
  179. .word 21315
  180. .word 26362
  181. .word 21056
  182. .word 20937
  183. .word -14
  184. .word 9295
  185. .word 7198
  186. .word 20180
  187. .word 28672
  188. .word 20463
  189. .word 260
  190. .word 17408
  191. .word 19679
  192. .word 31992
  193. .word 20085
  194. .word 6848
  195. .word 7942
  196. .word 12319
  197. .word 7198
  198. .word 4102
  199. .word -4504
  200. .word 4610
  201. .word -15872
  202. .word -19963
  203. .word 26348
  204. .word 21902
  205. .word 7198
  206. .word -25020
  207. .word 25092
  208. .word 7198
  209. .word 20551
  210. .word 24832
  211. .word 272
  212. .word 13824
  213. .word 21312
  214. .word 26488
  215. .word 24832
  216. .word 262
  217. .word 20992
  218. .word 26156
  219. .word 22851
  220. .word 26044
  221. .word 22595
  222. .word 4614
  223. .word 18497
  224. .word 7966
  225. .word 12831
  226. .word 4638
  227. .word 7169
  228. .word -4439
  229. .word 28927
  230. .word 4097
  231. .word 16129
  232. .word 4639
  233. .word 16885
  234. .word 0
  235. .word 4120
  236. .word -12287
  237. .word 6848
  238. .word 20939
  239. .word -8
  240. .word 20180
  241. .word 21760
  242. .word 12809
  243. .word 26396
  244. .word -7320
  245. .word 29184
  246. .word 4033
  247. .word 21313
  248. .word -15866
  249. .word -25015
  250. .word 25098
  251. .word 7198
  252. .word 7937
  253. .word 12831
  254. .word 4614
  255. .word 20551
  256. .word -4503
  257. .word -32703
  258. .word 29184
  259. .word 7936
  260. .word 12831
  261. .word 7942
  262. .word 12319
  263. .word 7198
  264. .word 4102
  265. .word -4504
  266. .word 4608
  267. .word 17921
  268. .word 18049
  269. .word 16885
  270. .word 6144
  271. .word 6872
  272. .word 20939
  273. .word -4
  274. .word 20180
  275. .word 21255
  276. .word 3846
  277. .word 26474
  278. .word 18951
  279. .word 26116
  280. .word 32264
  281. .word 7198
  282. .word 21255
  283. .word 3846
  284. .word 26368
  285. .word 198
  286. .word 18951
  287. .word 26116
  288. .word 32264
  289. .word 7198
  290. .word 24944
  291. .word 5632
  292. .word 27164
  293. .word -10749
  294. .word 21255
  295. .word 3846
  296. .word 22208
  297. .word -27136
  298. .word 18951
  299. .word 26116
  300. .word 32264
  301. .word 7198
  302. .word 24920
  303. .word 21248
  304. .word 16131
  305. .word 7808
  306. .word 13855
  307. .word 24910
  308. .word 3072
  309. .word 32
  310. .word 25606
  311. .word 4147
  312. .word 0
  313. .word 24602
  314. .word -6392
  315. .word 4614
  316. .word 22343
  317. .word 25098
  318. .word 7198
  319. .word 7937
  320. .word 12831
  321. .word 4614
  322. .word 20551
  323. .word -4503
  324. .word 513
  325. .word 7
  326. .word -32767
  327. .word 6848
  328. .word 20939
  329. .word -4
  330. .word 20180
  331. .word 18951
  332. .word 26116
  333. .word 32264
  334. .word 7198
  335. .word 7942
  336. .word 12831
  337. .word 7198
  338. .word 4614
  339. .word -4503
  340. .word 30463
  341. .word 5633
  342. .word 16885
  343. .word 14336
  344. .word 6872
  345. .word 6872
  346. .word 20180
  347. .word 28672
  348. .word 12807
  349. .word 4032
  350. .word 21312
  351. .word -13312
  352. .word -17152
  353. .word 26118
  354. .word 4118
  355. .word 17920
  356. .word 20545
  357. .word -28110
  358. .word 0
  359. .word 3073
  360. .word 8
  361. .word 25860
  362. .word 29192
  363. .word 21063
  364. .word -25023
  365. .word 25092
  366. .word 20551
  367. .word 7198
  368. .word 28672
  369. .word 21249
  370. .word 26390
  371. .word 4032
  372. .word 21312
  373. .word -16378
  374. .word -25023
  375. .word 25098
  376. .word 7198
  377. .word 7936
  378. .word 12319
  379. .word 4102
  380. .word 20551
  381. .word -4504
  382. .word 960
  383. .word 20085
  384. .word 18951
  385. .word 26116
  386. .word 32264
  387. .word 7198
  388. .word 7942
  389. .word 12319
  390. .word 4126
  391. .word 7168
  392. .word -4504
  393. .word 4613
  394. .word 6658
  395. .word -13824
  396. .word 17922
  397. .word -16382
  398. .word 17922
  399. .word -32767
  400. .word 6848
  401. .word 20180