Skip to content

Super Nintendo · Compression / Decompression

Koei Decompress

By darkmoon2321

About this project

This program is used to compress and decompress graphics/data/some text from several Koei games for the SNES. This program has been confirmed to work with Romance of the Three Kingdoms III and IV, Gemfire, and Genghis Khan II. It should work with any other Koei game that uses the same compression format.

Results of a decompression will be stored in a file with the extension .kdf (Koei decompressed file). Results of a compression will be stored in a file with the extension .kcf (Koei compressed file). In addition to these file types, running a decompression will also generate a file with a .dat extension. This file holds information regarding the hex offsets of compressed data in the ROM, corresponding locations in the .kdf file, and also the size of the sequence in bytes both compressed and uncompressed. Once the data is decompressed, graphics data can be easily viewed using a different tool, such as TileLayerPro.

Run times vary, with decompression of the entire ROM taking sometimes over a minute to handle, depending on your computer. Re-compressing individual sequences should no longer take a long time in V1.1. The largest individual sequences I have found in Koei games are about 20kB when decompressed. Compressing anything significantly larger than this could take awhile, as compression is much slower than decompression.

V1.1: Fixed a problem with a variable that would cause errors at the end of a compression sequence. Also made improvements to the efficiency of the compression algorithm, making it run significantly faster.

Original game requirements

See the release instructions.

Creator credits

darkmoon2321
Listed creator

RELEASE 1.1

Readme & instructions

ReadMe.txt

Koei Decompress V1.1 by darkmoon2321 Readme.txt This program was intended to decompress/compress data from several Koei games for the SNES. This program has been confirmed to work with Romance of the Three Kingdoms III and IV, Gemfire, Uncharted Waters: New Horizons, and Genghis Khan II. It should work with any other Koei game that uses the same compression format.

Read moreRead less
Koei Decompress
V1.1

by darkmoon2321

Readme.txt

This program was intended to decompress/compress data from several Koei games for the SNES.
This program has been confirmed to work with Romance of the Three Kingdoms III and IV, 
Gemfire, Uncharted Waters: New Horizons, and Genghis Khan II.  It should work with any
other Koei game that uses the same compression format.

To use this program, place ROMs or other data that you wish to process in the same folder as 
the program.  When you run the program, you will be given the option to compress or 
decompress data, and you will be prompted to enter the filename containing your starting 
data.  If you are decompressing data, you will be given a few options.

Option 1: Filters decompressed results for graphical data.  Only decompressed data that 
appears to be in tile format will appear in the output.
Option 2: Filters decompressed results for text.  Searches for data that contains a large 
proportion of alpha-numeric characters.  So far, only Romance of the Three Kingdoms 4 has 
been known to compress text using this algorithm.
Option 3: Decompress a single sequence of data from the ROM or file, given an offset for the 
start point.  You may either enter the offset in decimal or hexadecimal.  To enter the 
offset in hexadecimal, prefix the offset with '0x'.  The decompression will stop after a 
single sequence is completed.  If a valid sequence is not found, an error message will be shown.
Option 4: Decompress everything.  This will output all potentially valid decompression 
sequences to a file.  This will include graphical data, text, and binary data that happens 
to be compressed.

Results of the decompression will be stored in a file with the extension .kdf (Koei 
decompressed file).  Results of the compression will be stored in a file with the extension 
.kcf (Koei compressed file).  In addition to these file types, running a decompression will 
also generate a file with a .dat extension.  This file holds information regarding the hex 
offsets of compressed data in the ROM, corresponding locations in the .kdf file, and also 
the size of the sequence in bytes both compressed and uncompressed.  Once the data is
decompressed, graphics data can be easily viewed using a different tool, such as
TileLayerPro.

Run times vary, with decompression of the entire ROM taking sometimes over a minute to
handle, depending on your computer.  Re-compressing individual sequences should no longer
take a long time in V1.1.  The largest individual sequences I have found in Koei games are
about 20kB when decompressed.  Compressing anything significantly larger than this could take
awhile, as compression is much slower than decompression.

The source code for this program is included to allow for user modifications or extension.  
I am not a professional programmer, so be fore-warned about poor commenting and not 
following ISO guidelines.  I apologize in advance if you are trying to read my code :)

Release History:
10/20/14 V1.0 Initial Release
11/3/14  V1.1 Fixed a problem with readControl that would cause errors at the end of a
              compression sequence.  Also made improvements to the efficiency of the
              compression algorithm, making it run significantly faster.

Download ReadMe.txt ↓

FROM THE COMMUNITY

Player reviews

0 reviews
No ratings yet

Played this project? Tell other players how it holds up.

Your take on Koei Decompress

Spam has been overwhelming. To help us approve your review, sign up and introduce yourself in the Introductions forum so we know you’re not a bot.

Sign in with your Retro Replay account to rate this project and share your experience.

Sign in to review