home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / utilities / iff2bin207.lzh / IFF2Binary.doc < prev    next >
Encoding:
Text File  |  1994-11-23  |  4.7 KB  |  163 lines

  1.  
  2.  
  3.  
  4.  
  5.             IFF2BINARY FILE CONVERTER DOCS
  6.  
  7. WHAT IS IFF2Binary?
  8.  
  9.     IFF2Binary is a utility which converts iff pics to binary or alink/blink 
  10. linkable object code.
  11.  
  12.  
  13. WHAT DO I NEED TO USE IT?
  14.  
  15.     The only thing you need is the IFF.Library (it is probably on the board you 
  16. downloaded this archive from) in your boot disks libs: directory...
  17.  
  18.  
  19.  
  20.  
  21.  
  22.             
  23. USAGE: IFF2Binary <IFF-filename> [<Save-Filename Root> <Options> [<Options> ....]]
  24.       
  25.     Options:
  26.              -h                  Help\n");
  27.              -a <label root>     ALINK compatable Object Module
  28.              -b <label root>     BLINK compatable Object Module
  29.              -i                  Binary Include Module (For use with 'INCBIN')
  30.              -n                  No ColorMap
  31.        
  32. NOTE: if no options are present, option '-i' is assumed..\n\n");
  33.  
  34.  
  35.  
  36. The -i Option:
  37.  
  38.           The '-i' option coverts any IFF file to a bitmap that can\n");
  39.         be included in assembly programs using the 'INCBIN' preprocessor\n");
  40.         command.  The program generates 2 files, <filename root>.data 
  41.     and <filename root>.cmap. The .data file contains the bitmap and the 
  42.     .cmap file contains the colormap of the picture. IFF2Binary automatically
  43.     adds the suffixes to the filename. The bitplanes are stored one after the
  44.     other. So to get at them you must offset the start position by LEN 
  45.     (that is returned by the program) to get to the 2nd bit plane. (i.e. bitplane 1
  46.     is at $C0000) and LEN is $1F40 (8,000 bytes) then bitplane 2 is at
  47.      address $DF40 and so on)
  48.       
  49.  
  50.     Note: an alternate way of getting LEN is: (WIDTH/40)*HEIGHT
  51.                   Where:
  52.                  WIDTH  is the picture width
  53.                 HEIGHT is the picture height 
  54.         
  55.  
  56.  
  57. The -a <Label Root> Option:\n");
  58.       The  '-a' option converts an IFF file to an ALINK (AmigaDos) compatable object 
  59.     file that can be linked with the user code. In this case, the bitplanes will be
  60.     defined seperatly as:
  61.  
  62.              _<Label Root>Bitplane Number
  63.        
  64.     and the screen dimensions and ViewModes are defined as:
  65.  
  66.                _<Label Root>Width
  67.                _<Label Root>Height
  68.                _<Label Root>Depth
  69.               _<Label Root>Cmap
  70.                _<Label Root>Modes
  71.  
  72.     I.E., If the label root 'picture' is used and has 2 bitplanes the prior 
  73.     are defined as:
  74.  
  75.                _picture1
  76.         _picture2    
  77.         _pictureWidth
  78.         _pictureHeight
  79.         _pictureDepth    
  80.         _pictureCmap
  81.         _pictureModes        
  82.  
  83.     To reference them in a C program (using a Lattice C compiler as an example)
  84.     you would use:
  85.  
  86.         #include <exec/types.h>
  87.  
  88.         extern UWORD far picture1     ;
  89.         extern UWORD far picture2     ;
  90.         extern UWORD far pictureWidth ;
  91.         extern UWORD far pictureHeight;
  92.         extern UWORD far pictureDepth ;
  93.         extern UWORD far pictureCmap[];
  94.         extern UWROD far pictureModes ;
  95.  
  96.     then, to use the picture you would set up the Viewport and with the following
  97.     lines you would define the hieght, width, depth, and modes:
  98.  
  99.         my_vport.Height = pictureHeight ;
  100.         my_vport.Width  = pictureWidth  ;
  101.         my_vport.Depth  = pictureDepth  ;
  102.         my_vport.Modes  = pictureModes  ;
  103.  
  104.     You would the set up the color map:
  105.  
  106.         my_vport.ColorMap = (struct ColorMap *)GetColorMap( 32 ) ;
  107.     
  108.         pointer = (word *)my_vport.colorMap->ColorTable ;
  109.  
  110.         for(loop=0;loop<32;loop++) *pointer++ = pictureCmap[loop] ;
  111.  
  112.     The bitplanes are loaded into the bitplane structure by the next few lines:
  113.  
  114.         my_bplane.Planes[0] = &picture1 ;
  115.         my_bplane.Planes[1] = &picture2 ;
  116.  
  117.       note that you DONOT need to allocate rasters for memory. this is automatically
  118.       done when the program loads into memory since the bitplanes are loaded into
  119.       chipmem directly.
  120.  
  121.  
  122.     For Assemblers, you reference by:
  123.  
  124.         XREF    _picture1
  125.         XREF    _picture2
  126.         XREF    _pictureHeight
  127.         XREF    _pictureWidth
  128.         XREF    _pictureDepth
  129.         XREF    _pictureModes
  130.         XREF    _pictureCmap
  131.  
  132.     You then set up you viewport and Move.W the height,width,depth and modes to
  133.     their proper places the the viewport structure. then you would get the colormap
  134.     and Move.W the colors stored in _pictureCmap color list into the colortable.
  135.     it is much like the above C code but it would be in machine code.
  136.  
  137.  
  138. The -b Option:
  139.             The '-b' option is similar to the '-a' option but it converts an IFF file to
  140.      a BLINK ( Lattice C ) compatable object file that can be linked with the user
  141.      code.
  142.            
  143. The -n Option:
  144.              The '-n' option prevents the colormap of an IFF to be saved.
  145.        
  146.  
  147. NOTE: If no save file type (either -a,-b, or -i) is specified, file type -i is assumed.
  148.       
  149.  
  150.  
  151.  
  152.      This program is shareware and if you find it useful, a $5 donation
  153.        to further the programmers efforts would be greatly appreciated.
  154.  
  155.                                  Send Donations to:
  156.        
  157.                            Joe Sera
  158.                     103-06 ave. L 
  159.                      Brooklyn, N.Y. 11236
  160.        
  161.        If you have any questions, you can contact me at MIDI-MAGIC BBS (718)846-6941.
  162.        Leave all mail in care of 'Sigop Devious'.
  163.