Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

LZSS? Compression

Featured Replies

  • Author
  • Localization

FarOut, posted Thu Aug 16, 2018 3:14 am (37571)


I have decompressed this TIM file of a PS1 game by using the game's ASM code, but I need to re-compress it now.

It seems to be a LZSS-like compression. 1st byte is 0x01, the next 4 bytes are the final size, the rest is the compressed data, with 2-byte flags to declare literal and compressed. Compressed bytes are 16-bit too: 5 bits for length (plus 3) and 11 bits for distance (plus 1).

See the attached files for compressed and uncompressed files.

This is what I've tried without success:
Code:
comtype lzss "11 5 2 2 0"
IDString "\x01"
get SIZE long
savepos OFFSET
get ZSIZE asize
math ZSIZE - OFFSET
clog test OFFSET ZSIZE SIZE


Any help would be infinitely appreciated!
  • Author
  • Localization

aluigi, posted Tue Aug 21, 2018 3:20 am (37732)


Code:
log MEMORY_FILE 0 0
put 0x01 byte MEMORY_FILE
get SIZE asize
put SIZE long MEMORY_FILE
append
comtype lzss_compress "11 5 2 2 0"
clog MEMORY_FILE 0 SIZE SIZE
append
get SIZE asize MEMORY_FILE
log "new_file.dat" 0 SIZE MEMORY_FILE
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.