Bez popisu

gba_compress.h 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. Header file for libgba bios compression functions
  3. Copyright 2003-2004 by Dave Murphy.
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  15. USA.
  16. Please report all bugs and problems through the bug tracker at
  17. "http://sourceforge.net/tracker/?group_id=114505&atid=668551".
  18. */
  19. //---------------------------------------------------------------------------------
  20. #ifndef _gba_compression_h_
  21. #define _gba_compression_h_
  22. //---------------------------------------------------------------------------------
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. typedef struct {
  27. u16 SrcNum; // Source Data Byte Size
  28. u8 SrcBitNum; // 1 Source Data Bit Number
  29. u8 DestBitNum; // 1 Destination Data Bit Number
  30. u32 DestOffset:31; // Number added to Source Data
  31. u32 DestOffset0_On:1; // Flag to add/not add Offset to 0 Data
  32. } BUP;
  33. //---------------------------------------------------------------------------------
  34. // Decompression functions
  35. //---------------------------------------------------------------------------------
  36. void BitUnPack(void *source, void *dest, BUP* bup);
  37. void LZ77UnCompWram(void *source, void *dest);
  38. void LZ77UnCompVram(void *source, void *dest);
  39. void HuffUnComp(void *source, void *dest);
  40. void RLUnCompWram(void *source, void *dest);
  41. void RLUnCompVram(void *source, void *dest);
  42. void Diff8bitUnFilterWram(void *source, void *dest);
  43. void Diff8bitUnFilterVram(void *source, void *dest);
  44. void Diff16bitUnFilter(void *source, void *dest);
  45. //---------------------------------------------------------------------------------
  46. #ifdef __cplusplus
  47. } // extern "C"
  48. #endif
  49. //---------------------------------------------------------------------------------
  50. #endif //_gba_compression_h_
  51. //---------------------------------------------------------------------------------
  52. void BitUnPack(void *source, void *dest, BUP* bup)
  53. //---------------------------------------------------------------------------------
  54. {
  55. SystemCall(16);
  56. }
  57. //---------------------------------------------------------------------------------
  58. void LZ77UnCompWram(void *source, void *dest)
  59. //---------------------------------------------------------------------------------
  60. {
  61. SystemCall(17);
  62. }
  63. //---------------------------------------------------------------------------------
  64. void LZ77UnCompVram(void *source, void *dest)
  65. //---------------------------------------------------------------------------------
  66. {
  67. SystemCall(18);
  68. }
  69. //---------------------------------------------------------------------------------
  70. void HuffUnComp(void *source, void *dest)
  71. //---------------------------------------------------------------------------------
  72. {
  73. SystemCall(19);
  74. }
  75. //---------------------------------------------------------------------------------
  76. void RLUnCompWram(void *source, void *dest)
  77. //--------------------------------------------------------------------------------
  78. {
  79. SystemCall(20);
  80. }
  81. //---------------------------------------------------------------------------------
  82. void RLUnCompVram(void *source, void *dest)
  83. //---------------------------------------------------------------------------------
  84. {
  85. SystemCall(21);
  86. }
  87. //---------------------------------------------------------------------------------
  88. void Diff8bitUnFilterWram(void *source, void *dest)
  89. //---------------------------------------------------------------------------------
  90. {
  91. SystemCall(22);
  92. }
  93. //---------------------------------------------------------------------------------
  94. void Diff8bitUnFilterVram(void *source, void *dest)
  95. //---------------------------------------------------------------------------------
  96. {
  97. SystemCall(23);
  98. }
  99. //---------------------------------------------------------------------------------
  100. void Diff16bitUnFilter(void *source, void *dest)
  101. //---------------------------------------------------------------------------------
  102. {
  103. SystemCall(24);
  104. }