Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mario_golf:compression_details [2017/03/22 10:28]
mib_f8sm9c Changed links
mario_golf:compression_details [2017/06/27 02:11] (current)
skeletons ↷ Page moved from mario_golf_64:compression_details to mario_golf:compression_details
Line 12: Line 12:
 The code is a bit convoluted since the whole process is set up so that you can use a limited-size buffer to hold the compressed data while you convert it. The decompression algorithm can pause once it hits the end of the buffer, load up the next set of data, and then continue with the decompression process. Luckily we don't need to follow this limited method of loading up the data, so most of the code in there can be ignored for reverse-engineering purposes. The code is a bit convoluted since the whole process is set up so that you can use a limited-size buffer to hold the compressed data while you convert it. The decompression algorithm can pause once it hits the end of the buffer, load up the next set of data, and then continue with the decompression process. Luckily we don't need to follow this limited method of loading up the data, so most of the code in there can be ignored for reverse-engineering purposes.
  
-The algorithm is fairly similar to [[sm64:​mio0|MIO0]],​ the biggest difference being that all the data is handled in halfwords (2 byte clumps). The bottom line is that it alternates between copying raw data to the output, and then re-using data previously written to the output. Here's how the algorithm works, given a set of compressed data to decompress:+The algorithm is fairly similar to [[super_mario_64:​mio0|MIO0]],​ the biggest difference being that all the data is handled in halfwords (2 byte clumps). The bottom line is that it alternates between copying raw data to the output, and then re-using data previously written to the output. Here's how the algorithm works, given a set of compressed data to decompress:
  
 1. Ignore the first two halfwords (advance the pointer by 4). 1. Ignore the first two halfwords (advance the pointer by 4).