Chrono Trigger translation development system

0. Contents

This is the documentation of chronotools-1.11.2.
   1. Purpose
   2. How to begin?
   3. Current status
      3.1. Version history
   4. Program list
      4.1. ctdump
      4.2. ctinsert
      4.3. other
         4.3.1. makeips
         4.3.2. unmakeips
         4.3.3. xray
         4.3.4. viewer
         4.3.5. spacefind
         4.3.6. taipus.rb
         4.3.7. sramdump
         4.3.8. base62
   5. Useful features
      5.1. Name conjugation
      5.2. Font/dictionary skew
      5.3. Automatic paragraph wrapping
      5.4. Variable width 8pix font
      5.5. Very configurable
   6. Summary of extra features
   7. Requirements
   8. Copying
      8.1. If you only are interested in some features/parts
   9. Undocumented things
   10. See also
   11. Downloading

1. Purpose

Tools for translating Chrono Trigger to different languages.

Meant to be useful for anyone who wants to become a translator for Chrono Trigger and translate the game to their own language.

These programs do quite much more than just some little editing:

This project has grown together with Bisqwit's Finnish Chrono Trigger translation, but it's not limited to Finnish.
It has been designed to allow as much flexibility as possible.

2. How to begin?

So here's what you do if you want to translate Chrono Trigger. Feel free to contact me in questions you might have about translating/hacking Chrono Trigger.

3. Current status

Chronotools is under active development. Here's the current situation.
Last updated: 2004-01-02

Subject Percentage
Dialog handling 120% everything works, extra features
Dialog font handling 120% everything works, extra features
Status font handling 100% everything works
Character set issues 100% everything works
Compression algorithms 100% everything works
Item/tech/monster font handling 90% tech/monster code is useless
Graphics handling 95% minor details left
Signature feature 100% everything works
Error recovery 20% not many error checks
Documentation 3% if it isn't on this page, it's nowhere

3.1. Version history

Copypaste from the Makefile:
# VERSION 1.0.0  first archived version. dumper works.
# VERSION 1.0.1  working with recompressor, added tools.
# VERSION 1.0.2  updates to patcher
# VERSION 1.0.3  bugfixes to patcher - first working version!
# VERSION 1.0.4  handled fixed strings too
# VERSION 1.0.5  found item descriptions
# VERSION 1.0.6  compressed better
# VERSION 1.0.7  compressed more carefully
# VERSION 1.0.8  documented the script
# VERSION 1.0.9  fixed "..." handling and located the font
# VERSION 1.0.10 had knowledge of character sets
# VERSION 1.0.11 had a working font insertor
# VERSION 1.0.12 had better knowledge of special codes
# VERSION 1.0.13 used 62-base numbers
# VERSION 1.0.14 added taipus.cc
# VERSION 1.0.15 updated FIN/README and ct_fin.txt, but neither are archived
# VERSION 1.0.16 added taipus.rb, fixed homepage urls and fixed mmap error checking.
# VERSION 1.0.17 working again; uses space better; little modularized
# VERSION 1.0.18 more of above
# VERSION 1.0.19 code organising... improved 'i' in 8x8 font.
# VERSION 1.0.20 binpacker changes, some translation done too
# VERSION 1.0.21 more translation, some documentation, font palette changes.
# VERSION 1.0.22 more translation, autowrapping support, conjugation detection code
# VERSION 1.1.0  did some assembly hacking, support for code patching
# VERSION 1.1.1  conjugating conjugating conjugating... work goes on
# VERSION 1.1.2  and so on
# VERSION 1.1.3  and so on... almost working! "case" still doesn't work.
# VERSION 1.1.4  conjugating finally works!
# VERSION 1.1.5  some bugfixes
# VERSION 1.1.6  fixed an allocation bug and optimized the code generator a bit
# VERSION 1.1.7  some translation, more asm changes
# VERSION 1.1.8  syntax changes in the compiler, optimizations
# VERSION 1.1.9  support for font/dictionary size skew
# VERSION 1.1.10 new configuration system. Time to squash bugs.
# VERSION 1.1.11 configuration works, font-enhancement works.
# VERSION 1.2.0  variable-width 8pix font has stepped in, but has many many bugs.
# VERSION 1.2.1  more vwf stuff, backup before doing big changes
# VERSION 1.2.2  vwf stability++, also techniques now vwf. Scrolling bugs.
# VERSION 1.2.3  lots of more translation
# VERSION 1.2.4  8pix system deciphered, more bugs introduced
# VERSION 1.2.5  characterset enlarged by 512, only vwf8 bugs still
# VERSION 1.2.6  using nonstandard hash_map for greatly improved performance
# VERSION 1.2.7  creating another compiler
# VERSION 1.2.8  improved dictionary compression
# VERSION 1.2.9  compiler progress, first windows binaries are working
# VERSION 1.2.10 cursive font support
# VERSION 1.2.11 some translation, compression optimizations
# VERSION 1.3.0  new compression options, font reorganizer, generic typeface engine
# VERSION 1.4.0  image patching support, more font reorganizing support
# VERSION 1.4.1  lots of more translation (I'm archiving it here for my convenience)
# VERSION 1.5.0  end of the compiler project; using assembler (xa65) now.
# VERSION 1.5.1  vwf8 optimizations, assembly experiments
# VERSION 1.5.2  compressed graphics support: decompressor and compressor
# VERSION 1.5.3  better graphics compressor
# VERSION 1.5.4  another archive-only version
# VERSION 1.6.0  signature support (custom compressed image on startup screen)
# VERSION 1.6.1  some remodularizing of code
# VERSION 1.6.2  fixed the vwf8 scrolling problems and some other bugs
# VERSION 1.6.3  battle item lister fixed - no vwf8 problems there now
# VERSION 1.6.4  battle tech lister almost done; dumper: partial jap ROM support
# VERSION 1.6.5  is working on an assembler
# VERSION 1.6.6  has an almost working assembler
# VERSION 1.6.7  has a complete assembler, doesn't require xa65 anymore
# VERSION 1.6.8  patch version
# VERSION 1.6.9  conjugater now partially asm; its compiler is a separate program
# VERSION 1.7.0  some error checking; windows build of the assembler
# VERSION 1.8.0  is GPL
# VERSION 1.8.1  requires separate snescom (not bundled anymore)
# VERSION 1.9.0  unified some configuration parts; added crononick-code support
# VERSION 1.9.1  improved the signature feature; added checksum and ROM name feature
# VERSION 1.9.2  has only documentation updates
# VERSION 1.9.3  includes the forgotten snescode and dictionary modules.
# VERSION 1.10.0 implemented various assembly optimization techniques
# VERSION 1.10.1 updated the docs and the conj.code generator
# VERSION 1.10.2 creates more useful information when dumping
# VERSION 1.10.3 has technological updates but broken VWF8
# VERSION 1.11.0 has technological updates and new item list code with VWF8
# VERSION 1.11.1 adds the documentation core
# VERSION 1.11.2 is a backup before anything catastrophic happens
Users of previous versions are advised to do the following:

4. Program list

4.1. ctdump

Dumps the script and fonts from a given ROM.
Requires chrono-dumpee.smc.
Produces the script file, the font files and a couple of other image files.

Sample of produced script:

;1000ad (Lucca's home)
*z;106 pointerstrings (12pix font)
$F1IO:
[nl]
            You got 1 [item]!
$F1IQ:
LARA: Oh, hi Crono.[nl]
   Lucca's off at Leene Square with[nl]
   her father, Taban, unveiling her new[nl] 
   invention.
$F1IS:
LARA: Lucca and Taban only care[nl]
   about their silly toys!
(Dumped from the English ROM)

The windows version of this program is downloadable on this page.
Usage example: ctdump chrono-uncompressed.smc > ct_eng.txt

sample
Example screenshot in Spanish

4.2. ctinsert

Reinserts the (edited) script and (edited) fonts to a ROM.
Requires the files referenced by ct.cfg (usually ct.txt, ct8fn.tga and ct16fn.tga, elemental images and optional extra fonts and code files).
Produces ctpatch-hdr.ips and ctpatch-nohdr.ips.
Curiously, it doesn't require the ROM.

4.3. other

4.3.1. makeips

makeips compares two ROMs and produces a patch file in IPS format.

4.3.2. unmakeips

unmakeips reads a ROM and an IPS file and produces a patched ROM file.

4.3.3. xray

xray is a libggi-requiring application for browsing the ROM contents.

4.3.4. viewer

viewer requires S-Lang and is a textmode ROM browser originally developed by me for Pokémon hacking.

4.3.5. spacefind

A bin-packing algorithm test.

4.3.6. taipus.rb

This one is publicly available. It conjugates names in Finnish.
It has now been translated to SNES assembly (or sort of).
It works. :)

4.3.7. sramdump

Views a sram dump file in a readable format.

4.3.8. base62

Converts addresses between hex and base62 formats. I.e. $C2:5D4C -> 0eJI and vice versa.
This development system uses base62 in the script dumps to reduce the amount of code written.

5. Useful features

5.1. Name conjugation

It works! It currently has support for conjugating names on fly.
It's very important in Finnish, where you can't just add "'s" to anything to make a genitive.
For example, genitive of name Matti is "Matin", and genitive of name Crono is "Cronon".
The conjugator-engine is a textual script file translated to 65c816 assembly on demand. It can be customized to do conjugation in any language, not just Finnish.

5.2. Font/dictionary skew

It's quite complicated to explain, but shortly said:

In normal Chrono Trigger, the character set is as follows:

In Chronotools,

There are drawbacks though.

Despite these hazards this system might be a lifesaver for someone doing an Estonian, Portuguese or even Thai translation.

Note: The Japanese version of the game is almost exactly the same as the English version. Both have the same engine with only minor changes. If you are going to translate to Chinese or something else that uses thousands of different symbols, you are either going to have to manage with ~700 symbols or have to request some changes to the insertor.

Expanding the character set is a complicated thing because of its configurability. Maybe less options would be better, but then it wouldn't always work.

The compression, btw, generally shrinks the raw script (which is about 2/3 of the size of ct.txt) by a factor of 30...40%.
For a 370 kB script file this means about 30 kB of free ROM space or 74 kB of free dialog text space.

5.3. Automatic paragraph wrapping

It works! The program takes automatically care of proper line lengths, so you don't have to risk running into unexpected too-long-lines or making too short lines in paranoia.
You can force line breaks (like in HTML), but you don't have to.

The image on the right shows this script piece:

Tämä on Leenen Aukio. Sanotaan, että jos
joskus kuulee Leenen Kellon soivan, elää
mielenkiintoisen ja onnellisen elämän!
And is equal to if I had wrote this:
Tämä on Leenen Aukio. Sanotaan, että[nl]
jos joskus kuulee Leenen Kellon soivan,[nl]
elää mielenkiintoisen ja onnellisen[nl]
elämän!

5.4. Variable width 8pix font

It works! Item, monster and technique names in Chrono Trigger are limited to 10 characters (restriction is enforced by both the screen layout and the ROM space).
This is way too little for Finnish, which has long words.

For this reason Chronotools creates a vwf8 engine that allows the game to draw the names in thinner font that fits on the screen.

5.5. Very configurable

I have tried to put almost everything in text-only config files instead of hardcoding it in the programs. You won't be depending on me to do little updates for your purposes.

6. Summary of extra features

These are the visible extra features that games patched by Chronotools may have when compared to the standard English version:

7. Requirements

For source code (if you're a developer):
A POSIX compatible system (like Linux or FreeBSD) with GNU tools (GNU make, GCC etc) is required.
These programs are archived as C++ source code.
For binaries (if you're an unfortunate user stuck with some "Windows"):
I don't have a microsoft-operating system here on my hand, but I have mingw32, which appears to produce working commandline billware binaries. They should work in Windows 2000, Windows 98 and possibly most other Windows systems as well.
If the "download" section doesn't have a recent win32 version, you can download the source and install mingw32 and try to compile the source yourself.
 
I don't offer binaries for any other platforms.
If you fear the text mode and command line, you better change your attitude and start learning :)

The VWF8 code, the [crononick] code (something that was removed in the English release of CT) and the conjugator require an assembler, snescom. Snescom is a GPL'd xa65-compatible 65816 assembler program, and it can be downloaded at http://bisqwit.iki.fi/source/snescom.html .

8. Copying

Chronotools has been written by Joel Yliluoma, a.k.a. Bisqwit,
and is distributed under the terms of the General Public License (GPL).

If you have questions or just want to talk about Chrono Trigger hacking, throw me email.

I've previously stated here that I'm not publishing files because it's a well-known fact that many people in ROM hacking scene aren't very respectful to copyrights.
Well, left to be seen...

8.1. If you only are interested in some features/parts

This system doesn't contain much reusable material, although it now does contain some separate assembly code.
I have made my own systems to compile and link code.
If you're uncertain, send me email and explain your situation.

9. Undocumented things

Things that should be documented some day but currently are not:

10. See also

11. Downloading

The official home page of chronotools is at http://iki.fi/bisqwit/source/chronotools.html.
Check there for new versions.

Generated from ../progdesc.php (last updated: Sun, 4 Jan 2004 15:03:18 +0200)
with docmaker.php (last updated: Fri, 2 Jan 2004 17:31:18 +0200)
at Sun, 4 Jan 2004 15:03:40 +0200