Well, here's a question. Do you ever see cases in SimEarth where the compression data doesn't match the output size?
For example, when decompressing data from
$766e0 in Itadaki Street 2:
0017FC/000A43 Decompress bit set, doing lookback decompression
0017FC/000A45 Original value: 03f9
0017FC/000A45 Lookback: 003f bytes, readPtr 17bc
0017FC/000A45 Length: 0c (12)
0017FC/000A45 Copying byte ff
0017FD/000A45 Copying byte 00
0017FE/000A45 Copying byte ff
0017FF/000A45 Copying byte 00
001800/000A45 Copying byte 00
001801/000A45 Copying byte 00
001802/000A45 Copying byte 00
001803/000A45 Copying byte 00
001804/000A45 Copying byte 00
001805/000A45 Copying byte 00
001806/000A45 Copying byte 00
001807/000A45 Copying byte 00
PHP Fatal error: Uncaught Exception:
somehow wrote more data than expected? wrote 6152, expected 6144
in /home/xkeeper/Documents/Repo/ita2/data/decompressor.php:86
This happens with several offsets. Initially I thought it was my fault, but it happens fairly often, the final portion of the decompression is "00", and I'd assume that if there was something fundamentally wrong with my decompression algo that it would break everything, not result in otherwise perfect files.
It's also possible that the decompressor in-game immediately aborts if it reaches the write size; mine will continue until it finishes copying from a loopback command. I haven't looked at the disassembly today to confirm it.
____________________
(Lv 235 with 201081292 EXP)