# Chrono Trigger insertor (chronotools) EXAMPLE configuration file
#
# Copyright (C) 2002,2003 the Chronotools project
# http://bisqwit.iki.fi/source/chronotools.html
#
[general]
characterset = "iso-8859-15"
gamename     = "CHRONO TRIGGER"

# Chrono Trigger is originally a 32 Mbit ROM.
# You can extend it to 48 Mbit or 64 Mbit by changing this value.
# Values 32, 48 and 64 are supported.
romsize = 32



[font]
# 8x8 font file
font8fn        = "ct8fn.tga"
# dialog font file
font12fn       = "ct16fn.tga"
# Filename for condensed font (not required), see [vwf8] section
font8vfn       = "ct8fnV.tga"

# Set this if you want to use prerendering for the VWF8.
prerender_vwf8 = true

# Where does the dialog font begin.
begin = $A0

# The dictionary ends where font starts.
# The dictionary begins at $21.
# Small dictionary = bad compression.
# Bad compression = problems when patching.
#
# Note also: Characters >= $100 requires twice
# the space of characters < $100. So use them
# for the rarest symbols only.
# So be careful.
#
# Also note that 8pix strings (status screen, items, ...)
# can only use the first $100 symbols of the font.

# Which character means "no such character"
nonchar = "¶"

# Map of the 12pix font.
font12_00 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_10 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_20 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_30 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_40 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_50 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_60 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_70 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_80 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_90 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_A0 = "ABCDEFGH" "IJKLMNOP"
font12_B0 = "QRSTUVWX" "YZabcdef"
font12_C0 = "ghijklmn" "opqrstuv"
font12_D0 = "wxyz0123" "456789!?"
font12_E0 = "/«»:&()'" ".,=-+%# "
font12_F0 = "°¶##¶¶¶¶" "¶·¶()¶¶_"
font12_100= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_110= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_120= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_130= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_140= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_150= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_160= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_170= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_180= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_190= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_1A0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_1B0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_1C0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_1D0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_1E0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_1F0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_200= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_210= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_220= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_230= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_240= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_250= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_260= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_270= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_280= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_290= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_2A0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_2B0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_2C0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_2D0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_2E0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font12_2F0= "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
def12sym $EE "[musicsymbol]"
def12sym $F0 "[heartsymbol]"
def12sym $F1 "..."
# Define symbols that must not change their
# position when the game rearranges the fonts.
# Reason: Used in person names in various fonts.
# Reason: Used in item/monster/tech names with various fonts.
lock12syms "ABCDEFGHIJ"
lock12syms "KLMNOPQRST"
lock12syms "UVWXYZ!?/#"
lock12syms "abcdefghij"
lock12syms "klmnopqrst"
lock12syms "uvwxyz=-+%"
lock12syms "0123456789"
lock12syms "«»:&()'., _"

# Map of the 8x8 font.
font8_00 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_10 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_20 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶*"
font8_30 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_40 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_50 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_60 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_70 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_80 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_90 = "¶¶¶¶¶¶¶¶" "¶¶¶¶¶¶¶¶"
font8_A0 = "ABCDEFGH" "IJKLMNOP"
font8_B0 = "QRSTUVWX" "YZabcdef"
font8_C0 = "ghijklmn" "opqrstuv"
font8_D0 = "wxyz0123" "456789!?"
font8_E0 = "/«»:&()'" ".,=-+%# "
font8_F0 = "°¶##¶¶¶¶" "¶·¶()¶¶_"
def8sym $20 "[bladesymbol]"
def8sym $21 "[bowsymbol]"
def8sym $22 "[gunsymbol]"
def8sym $23 "[armsymbol]"
def8sym $24 "[swordsymbol]"
def8sym $25 "[fistsymbol]"
def8sym $26 "[scythesymbol]"
def8sym $27 "[helmsymbol]"
def8sym $28 "[armorsymbol]"
def8sym $29 "[ringsymbol]"
def8sym $2E "[shieldsymbol]"
def8sym $2F "[starsymbol]"
def8sym $62 "[handpart1]"
def8sym $63 "[handpart1]"
def8sym $67 "[hpmeter0]"
def8sym $68 "[hpmeter1]"
def8sym $69 "[hpmeter2]"
def8sym $6A "[hpmeter3]"
def8sym $6B "[hpmeter4]"
def8sym $6C "[hpmeter5]"
def8sym $6D "[hpmeter6]"
def8sym $6E "[hpmeter7]"
def8sym $6F "[hpmeter8]"
# Define symbols that must not change their
# position when the game rearranges the fonts
lock8syms "ABCDEFGHIJ"
lock8syms "KLMNOPQRST"
lock8syms "UVWXYZ!?/#"
lock8syms "abcdefghij"
lock8syms "klmnopqrst"
lock8syms "uvwxyz=-+%"
lock8syms "0123456789"
lock8syms "«»:&()'., _"

# Item symbols:
lock8syms $20 $21 $22 $23 $24 $25 $26 $27
lock8syms $28 $29 $2A $2B $2C $2D $2E $2F
lock8syms $5B $5C
lock8syms $60 $61 $62 $63 $64 $65 $66 $67
lock8syms $68 $69 $6A $6B $6C $6D $6E $6F


# typeface examples:

## Define a cursive typeface.
##  Defined as offset=128
##  Region $120..$180. Condensed by 1 pixel per char.
#typeface "[i]" "[/i]" 128 $120 $180 1

## Define a bold typeface.
##  Defined as offset=224
##  Region $180..$1E0. No condenses.
#typeface "[b]" "[/b]" 224 $180 $1E0 0

# Use thin numbers in status screens?
use_thin_numbers = true

# Display equipment count at equipment screen?
display_eq_count = true

# How many characters to store in
# a fast vector instead of a slower map.
# May speed up conversions between character sets.
# Example: 256 caches the entire latin-1.
# Changing this does not affect the generated patches.
charcachesize = 256

# Where rearrangements are logged to
log_rearrange = "ct_font.log"


[patch]
# Which files we'll create
patchfn_hdr   = "ctpatch-hdr.ips"
patchfn_nohdr = "ctpatch-nohdr.ips"
# This setting is to work around some stupid limited patchers
maxhunksize   = 20000
use_rle       = false

clear_free_space = false


[readin]
scriptfn = "ct.txt"


[dumper]
# Output files of ctdump:
font8fn    = "ct8fn.tga"
font12fn   = "ct16fn.tga"

# ROM map will be stored to this file. It's not required.
log_map    = "ct_map.log"
log_ptr    = ""

attempt_unwrap = true

# Which locations to dump. Numbers vary from $0 to $200.
#  $17 is the game reset, it allows changing player names.
#  These events can not be dumped:
#    $66..$6E
#    $E7..$EB
#   $140..$142
#   $176
dump_events $017
# You can specify multiple events on the line, as in:
# dump_events $017 $01B $01C $143 $144

[wrap]
# Log wrappings? Set to empty to disable
log_wraps    = "ct_wrap.log"

# Verify if wrapping caused problems.
verify_wraps = false

# How many pixels at max.
# 256 is the width of screen;
# minus 8 (left border)
# minus 8 (right border)
# is 240.
maxtextwidth = 240


[mem]
# When dumping, pointer tables will be stored to this file.
# When inserting, patch addresses will be logged to this file.
# It's not required. Set to "" to disable.
log_addrs = "ct_addr.log"


[dictionary]
# Rebuild?
rebuild            = false
# Apply dictionary? Recommended *always*
apply              = true

# Rebuild settings:
# Bigger numbers mean more time consumed (and sometimes better compression),
# smaller numbers mean faster dictionary rebuild.
# Maximum length of a generated dictionary word
# Try:
#  8:8:2
#  10:3:1
#  16:8:2
#  6:2:1

# Minimum length of the dictionary word.
# Smaller = uses more time!
# Good value is 2. Don't set it smaller.
min_word_length     = 2

# Maximum length of the dictionary word.
# Bigger = uses more time!
# Good values are between 4-20.
max_word_length     = 3

# Maximum recursion in generated dictionary word
# Bigger = uses more time!
# Usually a little smaller than max_word_length is good.
max_reuse_count     = 0

# Maximum internal spaces in the generated dictionary word
# Bigger = uses more time! Generally 1 or 2 is enough. 0 works too.
max_spaces_per_word = 1

# Try to find longer keys using the uncompressed data?
# If you enable it, it uses more time and probably creates a worse dictionary anyway.
use_improve_test    = false

# Whether to obsolete substrings when superkeys are found.
# If you enable it, it uses more time and usually creates a better dictionary.
use_redefine        = true

# Whether to restart the whole thing when invented a "good" new root.
# This requires that either "use_redefine" or "use_improve_test" is enabled.
# If you enable this, the process will take eternities (time will be approx. cubed).
restart_many_times  = true

# When restart(ing)_many_times, whether to try to save some time.
use_quick_regen     = true


# Apply settings
# Sort before applying. Almost never good.
# Don't use with dictionaries generated with ctinsert!
sort_before_apply = false

# Where to write the dictionary:
outputfn          = "ct_dict.log"


[images]
# Addresses are ROM-based

# The battle mode selection screen images
putimage $3FF008 "active1.tga"
putimage $3FF488 "active2.tga"
# Elemental images
putimage $3FD5E4 "elem1.tga"
putimage $3FD764 "elem2.tga"
putimage $3FD8E4 "elem3.tga"
putimage $3FDA64 "elem4.tga"
# Character faces
#putimage $3F0000 "face1.tga"
#putimage $3F0480 "face2.tga"
#putimage $3F0900 "face3.tga"
#putimage $3F0D80 "face4.tga"
#putimage $3F1200 "face5.tga"
#putimage $3F1680 "face6.tga"
#putimage $3F1B00 "face7.tga"
# Epoch
#putimage $3FEB88 "face8.tga"

# Pointer offs addr, pointer seg addr, original location,
# original compressed size, segment, filename
packedimage $3E0048 $3E004A $3E6002 3149 "titlegfx.tga"

#FIXME: find the ptr loc of these
packedimage $027220 $02738C $038000 2924 "eraes.tga"
#packedimage $xxxxxx $yyyyyy $05DA88 1647 "eratimes.tga"


[compiler]
loophelpername = "LoopHelper"
outchelpername = "OutcHelper"
magicvarname   = "c"




[conjugator]
# Setup each conjugation.
#  First param:
#    The function name that handles the conjugation
#    (as defined in file codefn)
#  Second param:
#    List of instances in your script that will
#    be replaced with conjugation code when inserting.
#  Third param:
#    String that represents the maximum length
#    the conjugation adds to the name
#
# c=crono m=marle l=lucca r=robo f=frog a=ayla u=magus e=epoch
# 1=member1 2=member2 3=member3

# Example:
#setup "Do_N" "
# cCronon,mMarlen,lLuccan,lLucan,rRobon,fFrogn,fFrogin,
# aAylan,uMaguksen,uMagusin,eEpochin,
# 1[member1]:n,2[member2]:n,3[member3]:n" "ken"



[linker]
#add_call_of syntax:
# add_call_of <func_name> <call_address> <nop_after_call> <rts_after_that>

# Addresses are SNES-based

## VWF8 (options: runtime rendering, or pre-rendering)
#load_code "ct-vwf8.o65"
#load_code "ct-vwf8-prerender.o65"

# VWF for items: Have your item list in *i11 format and use:
#add_call_of "EquipLeftItemFunc"  $C2A5AA 4  false
#add_call_of "EquipRightItemFunc" $C2F2DC 1  true
#add_call_of "ItemListFunc"       $C2B053 13 false
#add_call_of "EquipLeftHelper"    $C2A57D 14  false
#add_call_of "EquipLeftHelper2"   $C2A5B6 2   false
#add_call_of "BattleItemFunc"     $C109C1 32 false
#add_call_of "DialogItemCall"     $C25BA1 36 false

# VWF for techs: Have your tech list in *t11 format and use:
#add_call_of "BattleTechFunc"     $C10B5B 32 false
#add_call_of "BattleTechHelper"   $C10A99 0 false
#add_call_of "DialogTechCall"     $C25A90 55 false 
#add_call_of ""                   $C10ABE 16 false
#add_call_of "TechListFunc"       $C2BDB2 52 true

# If you use long monster names (*m11 instead of *l11):
#add_call_of "BattleMonsterFunc"  $CCED13 60 false
#add_call_of "DialogMonsterCall"  $C25AD2 35 false 

# VWF functions (use if you have the prerendered version)
#add_call_of "DMAHandler_Menu"    $C28414 1 false
#add_call_of "DMAHandler_Battle"  $D1E783 0 false


## SIGNATURE
#load_code "ct-moglogo.o65"
#add_call_of "show_moglogo"       $FDE62F 0 false
#add_image   "moglogo.tga"   "MOGDATA_ADDR"  "PALETTE_ADDR" "PALETTE_SIZE"

## CRONONICK
#load_code "ct-crononick.o65"
#add_call_of "CrononickHandler"   $C25B3B 13 false

## CONJUGATOR
#load_code "ct-conj.o65"
#add_call_of "Conjugator"         $C258C2 1 false

#load_code "timebox.ips"

## RELOCATED STRING TABLES
# Don't use if your romsize is not 48.
# To use enlarged ROM, you also need to change
# every "*z;dialog" to "*Z;dialog" in the script.
#
#load_code "relocstr.o65"
#add_call_of "RoomScriptFunctionB8"  $C03557 20 true


# DISABLES THE JAPANESE LEGACY CODE (FREES THE 8PIX TILES $40-$72)
add_call_of ""                   $C101CA 32 false


[dummysection]
# This line must be here last because of a bug in config parser...
last_dummy_setting = 1
