[358]downtown_nekketsu_research.txt
Downtown Nekketsu Monogatari The game uses LZ77 compression for it's tiles, sprites, and possibly tilemaps. The header is 4 bytes long. first two bytes(word) = the number of uncompressed bytes third byte = ???, push onto the stack, pulled back after # of uncompressed byte reached. (Seems to de discarded afterwards - might be dependent on the code that calls the decompression routine.) fourth byte = nothing - skipped over by the decompression routine.
Read moreRead less
Downtown Nekketsu Monogatari
----------------------------
The game uses LZ77 compression for it's tiles, sprites, and possibly tilemaps.
The header is 4 bytes long.
first two bytes(word) = the number of uncompressed bytes
third byte = ???, push onto the stack, pulled back after # of uncompressed
byte reached. (Seems to de discarded afterwards - might be dependent on the
code that calls the decompression routine.)
fourth byte = nothing - skipped over by the decompression routine.
bit seven of the control byte:
1= block transfer from a previous data location of the destination block.
0= new data from the source to the destination block.
if bit=0, then the value is & $7F then incremented by 1. This is the number
of bytes to read/transfer from source to destination.
if bit=1, then a subtraction address is built:
bits 0-6 are stored into the MSB ZP variable.
a new byte is read from the source string.
bits 0-3 are added to 3 for the number of bytes to transfer.
bits 0-7 are stored into LSB ZP variable (bits 0-3 are shifted out, see below).
A 16bit right shift by 4 is performed on MSB/LSB, used to subtract from the
current pointer, and stored in a temp ZP location (source address pointing
within the build area).
That gives a sliding window of $800 bytes and a length of $12
$6084 bank $74 and $46884 in ISO is the string for the second set of fonts (bottom of
the screen text).