home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 61.dms / 61.adf / doc.files / readme.doc < prev   
Text File  |  1986-03-21  |  8KB  |  198 lines

  1.         Overview of IFF example source files
  2.                Feb. 4, 1986
  3.  
  4.  
  5. This source code is distributed as public domain software.
  6. Use it to help write robust IFF-compatible programs.
  7.  
  8. Caveat: Electronic Arts developed this code, and is releasing it to
  9. promote the success of the Amiga.  EA does not have the resources 
  10. to supply support for this code.
  11.  
  12. For support, Amiga software developers contact Commodore directly.
  13.  
  14.  
  15. 1. Files in the directory.
  16.  
  17.     README  .DOC    This document.
  18.     BACKGRND.DOC    Tutorial on some techniques used in these example
  19.             programs.
  20.  
  21.     COMPILER.H    Portability file to isolate compiler idiosyncrasies.
  22.     GREENHIL.H    Greenhills C version of COMPILER.H (plain vanilla).
  23.     IBMLATTI.H    IBM PC Lattice C 3.03 version of COMPILER.H.
  24.  
  25.     INTUALL .H    A super-include file for Amiga include files.
  26.  
  27.     REMALLOC.H    Header for RemAlloc subroutines.
  28.     REMALLOC.C    Memory ALLOCators which REMember the size allocated,
  29.             for simpler freeing.
  30.  
  31.     GIO     .H    Header file for Generic I/O speed up package.
  32.     GIO     .C    Generic I/O speed up routines (a disk cache).
  33.     GIOCALL .C    Outline of example GIO client.
  34.         To turn on the GIO package, change a switch in GIO.H,
  35.         add GIO.O to the linker control file, and recompile.
  36.  
  37.     IFF     .H      Header file for general IFF read/write support.
  38.     IFFR    .C      IFF reade support routines.
  39.     IFFW    .C      IFF writer support routines.
  40.         These routines do a lot of the work for reading and writing
  41.         IFF files robustly. The reader and writer are separate since
  42.         some programs don't need both.
  43.  
  44.     IFFCHECK.C      IFF checker utility source (very handy for debugging).
  45.     IFFCHECK.LNK    IFF checker utility linker control file.
  46.     IFFCHECK        Amiga runnable object program.
  47.         The IFF checker scans an IFF file, checks it for syntax
  48.         errors, and prints an outline of its contents.
  49.  
  50.     PACKER  .H      Header for byte run encoder (compressor) subroutines.
  51.     PACKER  .C      Run encoder subroutines.
  52.     UNPACKER.C      Run decoder subroutines.
  53.         This run encoder/decoder is used for ILBM raster images.
  54.  
  55.     ILBM    .H      Header for ILBM (raster image file) subroutines.
  56.     ILBMR   .C      ILBM reader support routines. Uses IFFR.
  57.     ILBMW   .C      ILBM writer support routines. Uses IFFW.
  58.  
  59.     READPICT.H    Header for ReadPicture subroutines.
  60.     READPICT.C    ReadPicture subroutines read an ILBM file into an
  61.             Amiga BitMap in RAM. Uses ILBMR and IFFR.
  62.  
  63.     SHOWILBM.C      Example program that reads and displays an ILBM file.
  64.     SHOWILBM.LNK    Linker control file for ShowILBM program.
  65.     SHOWILBM        Amiga runnable object program ShowILBM.
  66.     SHOWILBM.INFO    So you can run ShowILBM under the Amiga workbench.
  67.  
  68.     PUTPICT .H    Header for PutPict subroutines.
  69.     PUTPICT .C    PutPict subroutines write an Amiga BitMap from RAM
  70.             to an ILBM file. Uses ILBMW and IFFW.
  71.  
  72.     RAW2ILBM.C      Example program that reads a "raw" raster image file
  73.             and writes the image as an ILBM file.
  74.     RAW2ILBM.LNK    Linker control file for Raw2ILBM.
  75.     RAW2ILBM    Amiga runnable object program.
  76.  
  77.     ILBM2Raw.C      Example program that reads an image as an ILBM file
  78.             and writes the image as a "raw" raster image file.
  79.     ILBM2Raw.LNK    Linker control file for ILBM2Raw.
  80.     ILBM2Raw    Amiga runnable object program.
  81.  
  82.     BMPrintC.C    Subroutine that actually does the text dump.
  83.     ILBMDump.C      Example program that reads an image as an ILBM file
  84.             and writes the image as a text file containing
  85.             C data initialization statements for either a
  86.             BOB or a Sprite.
  87.     ILBMDump.LNK    Linker control file for ILBMDump.
  88.     ILBMDump    Amiga runnable object program.
  89.  
  90.     ZapIcon        Amiga runnable program that creates a tool icon from
  91.             an ILBM (i.e., a brush saved from DPaint).
  92.             Usage: zapicon brushname toolname
  93.  
  94.     IFFCHECG.LNK    Link file for IFFCheck including GIO.
  95.     SHOWILBG.LNK    Link file for ShowILBM including GIO.
  96.     RAW2ILBG.LNK    Link file for Raw2ILBM including GIO.
  97.  
  98.             -- All ".BAT" files are MS-DOS batch files --
  99.     COMPILE .BAT    Batch file to compile all the IFF source code.
  100.     LINK    .BAT    Batch file to link IFFCheck, ShowILBM, & Raw2ILBM.
  101.     LINKGIO .BAT    Batch file to link the 3 programs with GIO.
  102.  
  103.     SOURCE  .BAT    Batch file to copy/print/etc. all the source files.
  104.     NotSrc  .BAT    Batch file to copy/print/etc. all the other files.
  105.     RELEASE .BAT    Batch file to copy/print/etc. all the files.
  106.     AllIFFO .BAT    Combine iff primitives into one file alliff.o.
  107.  
  108.     startup .txt    Becomes s/Startup-Sequence on Amiga IFF disk.
  109.  
  110.     dragon        A picture of a dragon, in ILBM format.
  111.     dragon    .info    Amiga icon for dragon.
  112.     dragon    .c    Dragon as a BOB as C data statements, using ILBMDump.
  113.     mumbo    .info    Dragon as an icon for an imagined tool 'mumbo',
  114.             using ZapIcon.
  115.  
  116.     bird3to8    A picture containing frames # 3 thru 8 of a
  117.             flying eagle, in ILBM format.
  118.     bird3to8.lo3    A picture containing frames # 3 thru 8 of a
  119.             flying eagle, in RAW format, low-resolution,
  120.             3-bitplanes.
  121.     bird3to8.info    Amiga icon.
  122.     bird0to2    Frames # 0 thru 2 of flying eagle.
  123.     bird0to2.info    Amiga icon.
  124.  
  125. 2. About the development environment.
  126.  
  127. This source code is built for the Lattice 68000 C cross-compiler from the IBM
  128. PC and the MetaComCo Amiga linker. You may have to make changes to suit other
  129. development tools, another development machine, or another target machine.
  130.  
  131. These programs use C header files supplied by Commodore for the Amiga
  132. computer. If you need them, contact Commodore. Dependencies on the runtime
  133. environment are pretty localized, so ports should be easy.
  134.  
  135.  
  136. If you don't have Commodore's EXEC/TYPES.H file, here are some global IFF
  137. definitions you'll need:
  138.  
  139. typedef long        LONG;        /* signed   32-bit number */
  140. typedef unsigned long    ULONG;        /* unsigned 32-bit number */
  141. typedef short        WORD;        /* signed   16-bit number */
  142. typedef unsigned short    UWORD;        /* unsigned 16-bit number */
  143. typedef char        BYTE;        /* signed    8-bit number */
  144. typedef unsigned char    UBYTE;        /* unsigned  8-bit number */
  145. typedef short        BOOL;
  146. #define NULL        0
  147.  
  148.  
  149. 3. Compiler ideosyncracies.
  150.  
  151. The Lattice C compiler running on the IBM PC supports a recent addition to
  152. the C language: the ability to typecheck procedure arguments (templates).
  153. Believe me, typechecking is useful! The more bugs I find at compile time,
  154. the less I have to find at run time.
  155.  
  156. The programmer asks for this typechecking via an "extern" statement like this:
  157.     extern IFFP Seek(BPTR, LONG, LONG);
  158. or a "typedef" statement like this:
  159.     typedef IFFP ClientProc(struct _GroupContext *);
  160.  
  161. Unfortunately, this chokes other C compilers. If you have such a compiler,
  162. you have to comment out the stuff in parentheses. The above two examples
  163. become:
  164.     extern IFFP Seek(/* BPTR, LONG, LONG */);
  165. or a "typedef" statement like this:
  166.     typedef IFFP ClientProc(/* struct _GroupContext * */);
  167. Don't remove the parentheses!
  168.  
  169. The header file COMPILER.H defines macros to isolate the compiler
  170. dependencies. The macro FDwAT ("function definitions with argument
  171. types") switches on/off the argument type declarations in the header files
  172. in this directory.
  173.  
  174.  
  175. 4. RemAlloc subroutines.
  176.  
  177. The "REMembering ALLOCator" is a useful little subroutine package included
  178. here. It saves you from having to remember the size of each node you
  179. allocate. (Why doesn't the Amiga allocator do this?)
  180.  
  181.  
  182. 5. Optional buffered file I/O package GIO.
  183.  
  184. Amiga file I/O can be greatly sped up by use of a RAM buffer. So we now have
  185. a layer of software that provides optional buffering. The "option" is
  186. controlled by changing a "#define" inside the header file GIO.H, adding
  187. GIO.O to your link file, recompiling, and recompiling. When turned off,
  188. this layer becomes just a layer of macro calls between the IFFR and IFFW
  189. modules and the AmigaDOS routines they call.
  190.  
  191. This RAM buffer speeds things up when you're doing numerous small Writes
  192. and/or Seeks while writing. The general IFF writer IFFW.C tends to do this.
  193. It should be extended to optimize reading, too.
  194.  
  195. If you are not using IFF, and already Write in chunks of 256 bytes or more,
  196. don't bother using GIO.
  197.  
  198.