/******************************************************************************
 * Java CHTDecoder 1.0
 * Copyright (C) 2004 emuWorks
 * by John David Ratliff
/******************************************************************************

CHTDecoder is a program written to decode the ZSNES .CHT files into plain text
(ASCII) files.

I got the idea from 'cracker' on the ZSNES forum. The program for Windows that
was out there doesn't seem to work, and the link to the author's website is
broken.

Basically, you start the program, open the .CHT file, and the codes will be
displayed. If you want to save that data, you can choose Save and save it to
a file.

There is also a TEXT mode. If you start the program from the command prompt,
just specify a .CHT file as an argument. Any number of .CHT files can be
specified. It will decode one after the other. You can redirect the output
to a file with the '>' operator.

Examples of text mode:
  java -jar chtdecoder.jar mario.cht
  java -jar chtdecoder.jar mario.cht > mario.cht.txt
  
The first will decode mario.cht file to standard output. The second will
output to a file in the same directory named "mario.cht.txt". The directory
must (obviously) be writable for this to work.

/******************************************************************************
 * Notes, Bugs, and Other Miscellany
/******************************************************************************

  CHTDecoder is written in Java 1.1. It should work on nearly every OS on the
  planet (even Mac OS <= 9).
  
  If you do not have a Java Virtual Machine, you can use the applet version at
  http://games.technoplaza.net/CHTDecoder/. You must be using a Java capable
  browser such as Internet Explorer or Mozilla (aka Gecko, Netscape)
  
  The text mode can not be used from the applet version.

  Because Java 1.1 did not have Drag&Drop support, this program does not
  either. This means you cannot simply drag a .CHT file onto the window, you
  must use the Open button. Sorry, I had to sacrifice a few features for
  total platform compatibility.
  
  The file dialog in the GUI mode does not filter based on file type. Java 1.1
  did not implement the code associated with FilenameFilters and FileDialogs,
  so there is little I can do about this other than writing my own FileDialog
  or using Java 1.2 (neither of which I am currently willing to do for time
  and compatibility reasons, respectively).
  
  This program is based on my examination of .CHT files from ZSNES WIP 0907. I
  did not have any .CHT files to test with before starting this project, so I
  made a test file to try it out. What I learned from that test file may or may
  not be correct. It seems to work, but I cannot guarantee that. Please contact
  me if it doesn't seem to work right.
  
  Because .CHT files are binary, any file can be opened, and the program will
  probably spit out some data that might look probable (or might look like
  garbage, who knows). Nothing can be done about this since I can't filter
  files in Java 1.1. Just make sure you open a .CHT file.
  
  This program should not damage your computer in any way, but there is no
  warranty. You're on your own if it blows up and takes your system with it.
  See the GNU GPL for more information. http://www.gnu.org
  
  Want to contact me? Use my online feedback form at
  http://www.technoplaza.net/feedback.php
  
  Sorry, no email contact. Too many spammers out there to post an email 
  address.
/******************************************************************************