ai64: Batch archive extractor for IDE64 users

ai64 allows you to comvert complete directory structures containing c64 programs into IDE64 compatible copy of the whole structure. For example try running it on a complete copy of Arnold Game Archive, before burning a CD for IDE64 usage. Most of the archive will be converted to prg and d64 files. The program is licensed under GPL v3.

Latest version: v1.4, released on 25th of March, 2010.

Demo Result

You can see a demo of what this program can make from the various zip, rar, zipcode, lnx, t64, d64 and more archive files on the c64.rulez.org FTP site.

What does it do?

The program will walk recursively in the sepcified source directory, convert all files to c64 usable format and copy them into the destination directory structure. Thus from all your ZIP, T64, etc files, you will just have a big directory which is directly usable on your IDE64 CDROM.

Currently the following formats are handled (anything can be nested, e.g. d64 in zip and so on):

TXT

not copied

DIZ

not copied

ME

not copied

NFO

not copied

COM

not copied

EXE

not copied

DEL

not copied (D64 extraction dirt)

ZIP

uncompressed and re-processed

D64

extraced if 1 file only and BAM is valid. Hi-score files - if identified - are ignored if there is only 1 more file. Some BAM validation messages in names/headers are taken into consideration.)

T64

extraced to files (if there is a single file named "FILE" is inside, the name of the original t64 is used when saving it to prg.)

P00

extracted to normal files

PRG

copied as is

TAR

extracted and re-processed

GZ

extracted and re-processed

TGZ

extracted and re-processed

RAR

extracted and re-processed

LNX

converted to d64 and re-processed

ZIPCODE

(1!,2!..) converted to d64 and re-processed

Files starting with dot are not copied (Unix hidden files, FTP site messages).

Not listed files: copied as is.

Support is missing for: BZIP2, LHA (lzh).

All the stored files are saved with characters which are readable on C64. Filenames are converted to 16 + extension, IDE64 can handle this length (requires 0.9x or higher IDEDOS). Already existing files are not overwritten, the new file will get "-1", "-2".. index, thus running the program twice will create all destination files twice.

When the whole directory structure conversion is finished, ai64 will take another long walk. It will rearrange all the directories which contains more than 100 files, to make sure there are no more than 100 files in a directory (easier to handle on c64, MAN, etc). The created subdirs will be called "ai100-X", "ai200-X" and so on, where "X" means the first word of the first program in that dirctory. E.g. "ai300-blackjack".

Installation

Edit ai64 executable file if necessary:

Customize the location of your php interpreter in the first line.

Set the location of your d64list program or comment out that line to bypass analizig d64 contents.

Make sure the $tmp_dir is far from any important locations, because the program will run thousands of "rm -rf" commands inside it (honestly, I create a "lion2" user just to run the program, you never know... especially while developing it.) See ramdisk tip below.

Customize the location of "cbmconvert" executable as well.

Make sure the other decompress executables are on your path.

There are some other configurations in the source's head.

Usage

Collect the c64 stuff what you want to convert into a directory structure

Run "ai64.php sourcedirname destinationdirname"

ai64.php [options] original_dir destination_dir

-s path/name

Skip to this file before staring processing(Use this to continue after something went wrong)

-x ,

Use ',' as file extension separator (default is '.')

-v

Verbose, list succesfully processed files

-w

Force windows compatible file naming

-h

Print this help

If ".php" is not registered to your PHP interpreter, you may need to type "php ai64.php" instead, assuming php.exe is on your PATH.

The conversion process of one CD (600 MB) takes a lot of time.

There is no warranty of any kind. So I advice again, to create a temporary user which cannot write your home directory, and run the whole conversion by that user!

Convers with dot as separator. Linux file naming conventions. Useful when burning a CD for use with IDE64.

Tips

Using Ramdisk or TmpFS

Since the program creates and deletes a LOT OF TEMPORARY FILES while uncomressing the archives, it is a good idea to choose a temporary dir (configred in the script) in RAM.

Using tmpfs (recommended)

mount -t tmpfs none /mnt/rdchown lion2:lion2 /mnt/rd

Using ramdisk (more complicated)

Usually Linux distros have ramdisk by default, to find it see:

ls /dev/ram*dmesg | grep -i ramdisk

The second one also displays the size, what you can configure with the "ramdisk_size=64000" (64MB) kernel parameter at boot time (bootloader config). I use the following small shell script as root, before converting:

mke2fs -m 0 /dev/ram0mount /dev/ram0 /mnt/rdchown lion2:lion2 /mnt/rd

Logging the errors

There is no option in the program to log the error messages, but it is very simple using standard Unix tool, "tee" (-a is for append, if needed).

ai64.php orig_dir dest_dir 2>&1 | tee -a errorlog.txt

Contact

Feedback and patches are welcomed, use the contact menu on this site. For updates look at this page.

Exisitng editors for text data DjVu files are quite limited, like for example DjVuSmooth. So I've implemented a new editor in JavaScript, that allows editing both the strucutre of the text (paragraphs, lines, words,...) and the coordinates of the text boxes by simply dragging with the mouse, features like create, delete, merge are also available.