Skip to content

LachlanStuart/u6snes

Repository files navigation

u6snes

Command-line tools for working with data files in Ultima 6 on the SNES

Decompressing LZW data

usage: decompress.py [-h] [--debug [DEBUG]] in_path out_path

positional arguments:
  in_path          Input file path, optionally suffixed by colon then a byte
                   offset e.g. rom.sfc:0x80ff or rom.sfc:65535 (prefix with 0x
                   for hex)
  out_path         Output file path, optionally suffixed by colon then an
                   offset to write a range into an existing file

optional arguments:
  -h, --help       show this help message and exit
  --debug [DEBUG]  (Optional) Path to write a debug file listing compressed
                   strings

Compressing LZW data

usage: compress.py [-h] [--debug [DEBUG]] in_path out_path

positional arguments:
  in_path          Input file path, optionally suffixed by colon then a byte
                   offset e.g. rom.sfc:0x80ff or rom.sfc:65535 (prefix with 0x
                   for hex)
  out_path         Output file path, optionally suffixed by colon then an
                   offset to write a range into an existing file

optional arguments:
  -h, --help       show this help message and exit
  --debug [DEBUG]  (Optional) Path to write a debug file listing compressed
                   strings

Modding workflow

# Make a copy of your ROM to write modifications to
cp u6.sfc u6_modded.sfc

# Extract dialog file
./decompress.py u6.sfc:0x48000 dialog1.raw

# Make changes to dialog1.raw

# Reinsert dialog file into modded ROM
./compress.py dialog1.raw u6_modded.sfc:0x48000

List of compressed files

This list was generated by scanning every 16 byte-aligned section of the USA ROM for valid-looking LZW streams. It may not be 100% accurate.

Start address End address Compressed size Decompressed size Free space at end Compression ratio Recompresses? Purpose
01d700 01fef6 10230 bytes 17479 bytes 1.71 : 1 266 bytes ✔️
028060 029c62 7170 bytes 12132 bytes 1.69 : 1 46 bytes ✔️ Title screen graphics
029e50 02dda1 16209 bytes 21824 bytes 1.35 : 1 15 bytes 1 byte larger Intro graphics (loaded 1st before intro cutscene)
02ddb0 02e586 2006 bytes 30720 bytes 15.3 : 1 10 bytes 1 byte larger Intro graphics (loaded 3rd before intro cutscene)
02e590 02efd5 2629 bytes 5088 bytes 1.94 : 1 60 bytes 3 bytes smaller Intro graphics (loaded 2nd before intro cutscene)
02f1d0 02f913 1859 bytes 3488 bytes 1.88 : 1 13 bytes ✔️ End cutscene graphics
02f920 02fdb9 1177 bytes 11520 bytes 9.79 : 1 583 bytes ✔️ End cutscene graphics
048000 049cf0 7408 bytes 12026 bytes 1.62 : 1 16 bytes ✔️ Dialog (companions, Lord British, etc.)
049d00 04b861 7009 bytes 11033 bytes 1.57 : 1 159 bytes ✔️ Dialog
04b900 04de05 9477 bytes 15210 bytes 1.60 : 1 251 bytes ✔️ Dialog
04df00 04fd90 7824 bytes 12516 bytes 1.60 : 1 624 bytes ✔️ Dialog
050000 051a05 6661 bytes 10516 bytes 1.58 : 1 251 bytes ✔️ Dialog
051b00 0538c2 7618 bytes 11630 bytes 1.53 : 1 62 bytes ✔️ Dialog
053900 055ed4 9684 bytes 15469 bytes 1.60 : 1 172 bytes Same size, different bytes Dialog
055f80 057919 6553 bytes 9989 bytes 1.52 : 1 1767 bytes ✔️ Dialog
058000 05ba14 14868 bytes 24387 bytes 1.64 : 1 108 bytes ✔️ Dialog
05ba80 05d416 6550 bytes 10140 bytes 1.55 : 1 106 bytes ✔️ Dialog
05d480 05fd95 10517 bytes 16964 bytes 1.61 : 1 619 bytes ✔️ Dialog
060000 061955 6485 bytes 10356 bytes 1.60 : 1 171 bytes ✔️ Dialog
061a00 062dca 5066 bytes 7948 bytes 1.57 : 1 54 bytes 1 byte larger Dialog
062e00 065d95 12181 bytes 19966 bytes 1.64 : 1 107 bytes ✔️ Dialog
065e00 06710a 4874 bytes 9484 bytes 1.95 : 1 118 bytes 1 byte larger Dialog
067180 0678d5 1877 bytes 2656 bytes 1.42 : 1 1835 bytes ✔️ Dialog
068000 069e0a 7690 bytes 11885 bytes 1.55 : 1 118 bytes ✔️ Dialog
069e80 06ba70 7152 bytes 11291 bytes 1.58 : 1 272 bytes ✔️ Dialog
06bb80 06d3da 6234 bytes 9525 bytes 1.53 : 1 166 bytes ✔️ Dialog
06d480 06fa93 9747 bytes 16443 bytes 1.69 : 1 1389 bytes ✔️ Dialog
070000 0715e0 5600 bytes 8335 bytes 1.49 : 1 32 bytes 2 bytes smaller
071600 073651 8273 bytes 12570 bytes 1.52 : 1 47 bytes 2 bytes smaller
073680 075007 6535 bytes 10274 bytes 1.57 : 1 121 bytes 10 bytes smaller
075080 075a44 2500 bytes 3619 bytes 1.45 : 1 60 bytes ✔️ ? Loaded 1st outside castle
075a80 0761be 1854 bytes 2494 bytes 1.35 : 1 66 bytes ✔️ ? Loaded 1st in castle tower
076200 076968 1896 bytes 2602 bytes 1.37 : 1 24 bytes 1 byte smaller
076980 0770ea 1898 bytes 2629 bytes 1.39 : 1 22 bytes ✔️
077100 0779ca 2250 bytes 3043 bytes 1.35 : 1 1590 bytes ✔️
096b00 0977fb 3323 bytes 23762 bytes 7.15 : 1 5 bytes 1 byte larger Map data? Loaded 2nd outside castle
09d000 09d943 2371 bytes 16898 bytes 7.13 : 1 189 bytes 6 bytes smaller Map data? Loaded 2nd in castle tower
09da00 09e1ef 2031 bytes 15380 bytes 7.57 : 1 273 bytes 2 bytes smaller
09e300 09ebd3 2259 bytes 16700 bytes 7.39 : 1 45 bytes 3 bytes larger
09ec00 09f488 2184 bytes 13928 bytes 6.38 : 1 120 bytes ✔️
09f500 09f92f 1071 bytes 6536 bytes 6.10 : 1 1745 bytes 1 byte larger
0bf100 0bf81a 1818 bytes 2710 bytes 1.49 : 1 2022 bytes ✔️
0cd400 0cea21 5665 bytes 8164 bytes 1.44 : 1 95 bytes Same size, different bytes
0cea80 0cfcf1 4721 bytes 6682 bytes 1.42 : 1 783 bytes 1 byte larger Tile data
0d0000 0d2133 8499 bytes 12492 bytes 1.47 : 1 77 bytes 3 bytes larger Tile data
0d2180 0d41e3 8291 bytes 13397 bytes 1.62 : 1 29 bytes ✔️ Tile data
0d4200 0d65e5 9189 bytes 14189 bytes 1.54 : 1 27 bytes 1 byte smaller Tile data in castle
0d6600 0d67b1 433 bytes 701 bytes 1.62 : 1 79 bytes 2 bytes larger
0d6800 0d6d2c 1324 bytes 1632 bytes 1.23 : 1 84 bytes 1 byte larger
0d6d80 0d6f8a 522 bytes 783 bytes 1.50 : 1 118 bytes ✔️
0d7000 0d7230 560 bytes 807 bytes 1.44 : 1 80 bytes ✔️
0d7280 0d7495 533 bytes 847 bytes 1.59 : 1 107 bytes 1 byte larger
0d7500 0d7c4e 1870 bytes 3091 bytes 1.65 : 1 946 bytes ✔️
0d8000 0d94da 5338 bytes 7352 bytes 1.38 : 1 38 bytes 1 byte smaller️
0d9500 0da2b2 3506 bytes 5175 bytes 1.48 : 1 78 bytes 3 bytes smaller
0da300 0dc0d3 7635 bytes 12026 bytes 1.58 : 1 45 bytes Same size, different bytes Tile data
0dc100 0de067 8039 bytes 11655 bytes 1.45 : 1 153 bytes ✔️ Tile data
0de100 0df199 4249 bytes 6094 bytes 1.43 : 1 103 bytes ✔️ Tile data
0df200 0dfdd1 3025 bytes 4492 bytes 1.48 : 1 559 bytes ✔️
0e0000 0e0fa9 4009 bytes 5472 bytes 1.36 : 1 87 bytes ✔️
0e1000 0e31ae 8622 bytes 12729 bytes 1.48 : 1 82 bytes 3 bytes smaller
0e3200 0e47ba 5562 bytes 7625 bytes 1.37 : 1 70 bytes Same size, different bytes

About

Command-line tools for working with data files in Ultima 6 on the SNES

Resources

License

Stars

Watchers

Forks