*** Please read the file 'Copying' for information about copying/distributing &
*** disclaimer.
Overview
--------
I'm writing this game in a mixture of C and Assembler atm, and I needed to link some large amounts of data into it. I didn't fancy DCDing it all in assembler or the equivalent in C, and I felt it was about time I got to grips with the AOF format anyway, so I knocked this up. It takes a datafile and puts it into an AOF file, defining a global label pointing to it.
Requisites
----------
You'll need FrontEnd 1.13, TaskWindow 0.29, DDEUtils 1.50, Clib 3.75, and FPemulator 2.80 to use the DDE frontend. Actually I don't think all of those are necessary, but they were in the !Run file of the front end to DrLink that I copied the frontend from.
You only need Clib 3.75 to run the CLI version.
Usage
-----
First copy the APP file 'Data2AOF' to your library directory (where your other DDE apps are).
If using the DDE frontend, simply drag the datafile to the iconbar icon, and click select on 'Run', optionally changing the label from the Label submenu.
If no label is entered, the leafname of the datafile is used.
From the command line the syntax is:
data2aof inputfile [-o outputfile] [-l label]
eg.
data2aof test -o test_aof -l mydata
If the output file is omitted, it is placed in the subdirectory 'o' with the same leafname as the source, eg.
data2aof ADFS::Ampy.$.Program.Graphics
produces the output file ADFS::Ampy.$.Program.o.Graphics
If the label is omitted, the leafname of the input file is used, in the above example it would be called 'Graphics'.
The output file can be linked with your C programs, and the data used with:
extern (type)* <label>;
eg. if you want to treat your data as a string, the C code might be:
#include <stdio.h>
extern char *mydata;
int main ()
{
printf ("%s", mydata);
return 0;
}
Don't forget your data file should have the terminating 0.
Files
-----
This archive should contain:
!Data2AOF
|-- !help
|-- !Run
|-- !Sprites
|-- Desc
|-- Docs
| |-- Copying
| |-- Help
|-- Messages
|-- Templates
Data2AOF
Example
|-- c
| |-- example
|-- o
|-- Eg
Source Yes! I included the source code! :)
|-- c
| |-- Data2AOF
|-- h
| |-- Data2AOF
|-- o
The example
-----------
To compile the example, double-click on !Data2AOF, and click on it's iconbar icon. Type 'somedata' into the label submenu, and drag 'Eg' onto the window. Click on run, and save the data file as Example.o.Eg
Use CC to compile 'example.c' and link it with o.Eg
(Drag both Example.c.example and Example.o.Eg to CC's FrontEnd window.)
That's all folks
----------------
Have fun, /\
(--)mpy
(
'Al Sirat' ampy@digibank.demon.co.uk
Chapel Road a.pereira@cs.ucl.ac.uk (Until May 1997)