home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilsd / dataaof / !Data2AOF / Docs / Help < prev   
Encoding:
Text File  |  1995-07-03  |  3.0 KB  |  105 lines

  1.  
  2.                                     Data2AOF
  3.                                    -========-
  4.  
  5. Copyright © 1995, A. M. Pereira
  6. Ampy/Maelstrom Software.
  7.  
  8. *** Please read the file 'Copying' for information about copying/distributing &
  9. *** disclaimer.
  10.  
  11. Overview
  12. --------
  13. 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.
  14.  
  15. Requisites
  16. ----------
  17. 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.
  18.  
  19. You only need Clib 3.75 to run the CLI version.
  20.  
  21. Usage
  22. -----
  23. First copy the APP file 'Data2AOF' to your library directory (where your other DDE apps are).
  24.  
  25. 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.
  26.  
  27. If no label is entered, the leafname of the datafile is used.
  28.  
  29. From the command line the syntax is:
  30.  
  31. data2aof inputfile [-o outputfile] [-l label]
  32.  
  33. eg.
  34.  
  35. data2aof test -o test_aof -l mydata
  36.  
  37. If the output file is omitted, it is placed in the subdirectory 'o' with the same leafname as the source, eg.
  38.  
  39. data2aof ADFS::Ampy.$.Program.Graphics
  40.  
  41. produces the output file ADFS::Ampy.$.Program.o.Graphics
  42.  
  43. If the label is omitted, the leafname of the input file is used, in the above example it would be called 'Graphics'.
  44.  
  45. The output file can be linked with your C programs, and the data used with:
  46.  
  47. extern (type)* <label>;
  48.  
  49. eg. if you want to treat your data as a string, the C code might be:
  50.  
  51. #include <stdio.h>
  52. extern char *mydata;
  53.  
  54. int main ()
  55. {
  56.     printf ("%s", mydata);
  57.     return 0;
  58. }
  59.  
  60. Don't forget your data file should have the terminating 0.
  61.  
  62. Files
  63. -----
  64.  
  65. This archive should contain:
  66. !Data2AOF
  67.    |-- !help
  68.    |-- !Run
  69.    |-- !Sprites
  70.    |-- Desc
  71.    |-- Docs
  72.    |     |-- Copying
  73.    |     |-- Help
  74.    |-- Messages
  75.    |-- Templates
  76. Data2AOF
  77. Example
  78.    |-- c
  79.    |    |-- example
  80.    |-- o
  81.    |-- Eg
  82. Source            Yes! I included the source code! :)
  83.    |-- c
  84.    |    |-- Data2AOF
  85.    |-- h
  86.    |    |-- Data2AOF
  87.    |-- o
  88.  
  89. The example
  90. -----------
  91. 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
  92. Use CC to compile 'example.c' and link it with o.Eg
  93. (Drag both Example.c.example and Example.o.Eg to CC's FrontEnd window.)
  94.  
  95. That's all folks
  96. ----------------
  97.  
  98. Have fun, /\
  99.          (--)mpy
  100.            (
  101. 'Al Sirat'                 ampy@digibank.demon.co.uk
  102. Chapel Road                a.pereira@cs.ucl.ac.uk (Until May 1997)
  103. Swanmore
  104. Southampton SO32 2QA
  105. UK