/******************************************************************************* * wxCHTDecoder 1.5 * Copyright (C) 2004 emuWorks * by John David Ratliff ******************************************************************************/ /******************************************************************************* * Introduction ******************************************************************************/ wxCHTDecoder is a program written to decode the SNES emulator .CHT files (used by ZSNES and Snes9x) into plain text files. The idea came from a request on the ZSNES Message Board by 'cracker'. The only other program out there did not seem to work. There are many versions of this program. I originally wrote it in Java. A person on the message board didn't like Java and wanted to write a perl version. Since it was GPL, I didn't mind. Later on, a PHP version was mentioned. Neither of the people who suggested these new verions wrote them in a very timely fashion. Having lots of free time, I decided to write them. Now there is a C++ version. I've always wanted to create a graphical program in C that wasn't in MFC, but until I found wxWidgets, I would never have had the capability. Enter wxCHTDecoder, a C++ version of my Java code (with some minor alterations) using the wxWidgets library. 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. You can also drag .CHT files onto the window. There is also a text (console) mode. If you start the program from the console, just specify a .CHT file as an argument. Any number of .CHT files can be specified. It will decode one after the other. The results will be written to files (the filename is chtfile.txt where chtfile is the name of the .CHT file argument). If for some reason the chtfile.txt cannot be opened, the output is directed at the console. The program will not overwrite files that already exists, so if for some reason chtfile.txt already exists, it will output to the console instead. You can use ./wxchtdecoder --help for usage information. There are only a few options. -h for help, -v for version, -f will open any file as a .CHT file (which could be a disaster, but it's not on by default -- but some .CHT files are slightly off-spec) Examples of text mode: ./wxchtdecoder mario.cht ./wxchtdecoder mario.cht lufia.cht metroid3.cht /******************************************************************************* * Installation ******************************************************************************/ Under Windows, you can download the binary version. It comes with everything needed to run the program. Just double-click the wxchtdecoder.exe file and the program will start. You can also compile it from the source yourself if you prefer. You will need to get wxWidgets 2.4.2 or later from http://www.wxwidgets.org. The Mac version requires wxWidgets 2.5.3 or later, but it only tests for 2.4.2 (but the 2.4 wxMac library has too many bugs to actually work, even 2.4 CVS has been tested not to work) I have done away with the Makefiles in favor the GNU autoconf system. You can configure in UNIX or msys/mingw and it will generate a Makefile. For most systems you can do something like ./configure && make && make install-strip Starting with version 1.5, the final version I hope, I have included binaries for each supported platform (Windows, Linux GTK, and Mac OS-X). You may get better results compiling yourself (Linux uses GTK 1.2 for example, and GTK 2 may provide superior performance). I am working on a gentoo ebuild, but at the pace ebuilds get added to portage, who knows when it might be added. Still, you might try 'emerge wxchtdecoder' and see what happens. /******************************************************************************* * Revision History ******************************************************************************/ Version 1.5 - October 20, 2004 Fixed some problems in the source which prevented the Mac version from running properly. Added Mac and Linux/GTK 1.2 binaries. Added command line options to force opening of potentially invalid .CHT files. Added support for opening potentially invalid .CHT files in GUI mode. Fixed DragNDrop support for filenames with spaces in them (maybe this was only a bug in the GTK version, but I didn't notice until now). Version 1.4 - October 18, 2004 Fixed a bug in the CHTCode class. I don't think it would crash, but I'm not 100% sure it wouldn't either. Version 1.3 - October 15, 2004 Fixed improper ANSI string with Unicode string macros. wxCHTDecoder should now work in ANSI or UNICODE. Replaced Makefile with autoconf. Fixed the GTK dialog issues where no file filter was used. Added wxCHTDecoder namespace for all the classes in wxCHTDecoder. Added --enable-msys option for msys console version. Removed Alloc from string buffers as it is unnecessary. Version 1.2 - October 13, 2004 Fixed the console output problem in Windows. Added GNU Makefile for VC++ 7 (gmake -f Makefile.vc7) Version 1.1 - Octover 12, 2004 Cleaned up the code a bit. Removed Java-like code that isn't necessary. Fixed the Makefile to recompile the dependencies properly. Added DragNDrop support. Added Text Mode support. Version 1.0 - October 10, 2004 Initial Version /******************************************************************************* * Bugs and Known Issues ******************************************************************************/ If you want to use text mode in msys (running the program from msys sh), then you should use the --enable-msys configure flag. This will mean you get no text output if you run it from the windows command console (cmd.exe), but the program will still work. However, the win32 version will lock the console in msys and you will have to manually close it. Since most people do not use msys, this should not be a big problem. The configure script does not properly configure things on Mac OS-X. I don't have access to a Mac at home, and have only limited access to Macs at my alma mater. If you want to compile on a Mac with OS-X (I don't have access to a Mac OS <= 9 machine), here is what I did: Get wxMac 2.5.3 from http://www.wxwidgets.org Put wxMac-2.5.3.tar.bz2 and wxchtdecoder-1.5 in ~ directory (for me /Users/jdratlif, but it will differ for you obviously) Open Terminal cd ~/ mkdir build cd build bzcat ~/wxMac-2.5.3.tar.bz2 | tar x cd wxMac-2.5.3 mkdir release-build cd release-build ../configure --disable-shared --disable-unicode --disable--debug \ --enable-optimise --enable-monolithic make cd ~/build bzcat ~/wxchtdecoder-1.5.tar.bz2 cd wxchtdecoder-1.5 ./configure --with-wx-prefix=~/build/wxMac-2.5.3/release-build make strip src/wxchtdecoder export PATH=~/build/wxMac-2.5.3/release-build:$PATH `wx-config --rezflags` src/wxchtdecoder This took well over an hour on a university Mac G4 800 MHz with OS-X Panther (10.3). 99% of the time is for compiling wxMac. Unless you are planning on modifying wxchtdecoder, I highly recommend you simply use the provided Mac OS-X binary. /******************************************************************************* * Contact Information ******************************************************************************/ The latest version of wxCHTDecoder can always be found at emuWorks http://games.technoplaza.net You can contact us using our online feedback form at http://www.technoplaza.net/feedback.php