home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
demos
/
genesis.dms
/
genesis.adf
/
IFFData.doc
< prev
next >
Wrap
Text File
|
1990-12-30
|
9KB
|
213 lines
****************************************************************************
IffD V1.0
Copyright © 1990 AUSTEX Software
Written by P N GOULDING and S J SMITH
****************************************************************************
PURPOSE
~~~~~~~
The purpose of this program is to allow a user to load an IFF brush (or
picture), then resave in the format desired. As Iff files are normally
compacted that can't be used in programs unless you uncompact them. This
is obviously not acceptible if you need to place an object on screen FAST.
This utility is for programmers with access to an assembly that allows a
person to "include" binary files eg. Devpac, Argasm, and others which use
the "INCBIN" (or similar) command.
UPDATE HISTORY
~~~~~~~~~~~~~~
*Internal AUSTEX use only *
27-08-89 V0.1 Commenced this utility, Cli command to read an ILBM file and
resave it as a Linkable Object file of uncompacted data.
12-09-89 V0.2 Fixed bug in Get_Cmap routine, now handles all picture
24-09-90 V0.3 Fixed bug with Save_Object routine.
13-10-89 V0.4 Fixed bug with GET_DATA routine, was using Ble instead of
BLS.
07-01-90 V0.5 Time to optimise the size and speed. Been through and cut out
about 1000 bytes, mainly reducing large error messages. Now down to
1800 bytes. More to go yet.
12-01-90 Commenced V0.6 Decided to open a backdrop window and use intuition
to end the program rather then using the LMB directly.
16-06-90 Commenced V0.8 (Whatever happened to V0.7??)
Well, decided not to save it as an Object file anymore, now will be
saved as a straight data file with a small Special structure in the
beginning. Designed to be used with the INCBIN command on most
assembers.
28-06-90 Commenced V0.9 Big Deal! Just cleaned up the code a bit and fixed
small bug with the saved filename. Got rid of a bit of code that was
a illegal. It was only saving 20 - 25 bytes anyway.
26-08-90 Commenced V1.0 * Now releasable as FREEWARE *
Changed from a CLI command to intuition format. This is the beginning
of some major changes. A window with gadgets selecting 3 different
data formats (Plane, Sprite or Attached Sprite) and 5 different
Structures (Special, Simple, VSprite, Bobs, or None).
20-10-90 Slightly modified the Attatched Sprite format saved, allows two
blank longwords between each sprite data.
USING
~~~~~
The program runs from CLI or workbench. to use from Cli type
"Iffd <FILENAME>" (dont type the quotes or angle brackets). FILENAME is the
name of the picture or brush to be loaded and is optional.
To run from workbench "doubleclick" on the IffD icon to load the
application, or alternately, Hold the Shift button down, click on the Icon
of a file you wish to load, then "doubleclick" on the IffD icon. It will
now load the application program and the selected picture or brush.
Once the program is loaded a window is opened on the workbench. There are
three groups of gadgets in this window. (As below)
|---------------------------------------------------|
| ---------- ------------------------------- |
| | Planes | | © 1990 AUSTEX SOFTWARE | |
| ---------- ------------------------------- |
| ---------- ---------- --------- --------- |
| |ASprite | | Special| |VSprite| | Load | |
| ---------- ---------- --------- --------- |
| ---------- ---------- --------- --------- |
| | Sprite | | Simple | | Bobs | | Save | |
| ---------- ---------- --------- --------- |
|---------------------------------------------------|
The group on the right are obviously for loading/saving files. Only
Interleaved Bitmap (ILBM) files can be loaded. These are the normal Iff
files save by paint applications (Brushes or pictures). Clicking on these
gadgets will bring up an Arp requester. NOTE: if Arp isn't in your Libs
directory then these two gadgets will be ghosted (switched off).
If there is any problem loading a file, then a simple error message will
be displayed in the Status Window (The one containing "© 1990 Austex
Software").
DATA FORMATS
~~~~~~~~~~~~
When a ILBM file has been loaded, you will notice that one,
or two, of the gadgets on the left will be Ghosted. These are the "Data
format" group of gadgets. The three data formats are:
PLANES: This means the data will be saved as 1 bitmap plane of data
for each plane depth (plane 1, then plane 2, plane 3, etc....)
ASPRITE: This saves the data in Attached sprite format, (16 colour
sprite), this is 2 normal sprites following each other. When using Sprite
data (Either Attached or normal) it will be neccessary to place the control
word at the beginning of the sprite data and the end of the sprite data.
This can be done as follows:
Sprite0
dc.w $30a0,$4000 <-- Control words for hardware sprites
incbin sprite0.dat <-- Data file produced by IFFD
dc.l 0 <-- Control Long word to switch off
the sprite
For the attached sprite, there is two blank longwords between the two data
hunks. These are the end control word for the first sprite and the start
control word for the second sprite, they need to be set by the program
using the sprites.
SPRITE: Saves data in a normal sprite format. (Read hardware manual
for the last two data formats). To use the either of the sprite data formats
the brush loaded in must be 16 pixels wide. Also for SPRITE it must be 2
bitplanes deep and for ASPRITE it must be 4 bitplanes deep (any height is
acceptable). A data format which is not sutiable for either of these will
cause that particular gadget to be ghosted. Naturally any form can be saved
as PLANES data.
The middle group of gadgets is the "Structure type" gadgets. Selecting
one of these will include that structure at the beginning of the file.
The SPECIAL structure is not a commodore structure, it is one we at AUSTEX
like for ourselves. The structure is as follows:
Structure Special,0
WORD Sp_Colours ; Number of colour register words
WORD Sp_Depth ; Number of Bitplanes
LONG Sp_Length ; Length of 1 plane of Data
WORD Sp_height ; Height of 1 plane of data
WORD Sp_width ; Pixel Width of 1 plane of data
LABEL Sp_Size
The SIMPLE structure is a simple sprite structure as in the commodore
include files. Only the ss_height value is setup by IFFD, but the data
and colour registers are a fixed distance from the structure and can be
easily setup by a program. All other values are zeroed
The VSprite structure is the same as Commodore includes. The values setup
are vs_height, vs_width, vs_depth, all other values are zeroed. Once
again, since the imagedata and colour registers are a fixed distance from
the structure, they can be setup by the program using this data.
The Bobs structure is the same as Commodore includes. The only values
setup are same as VSprite structure above.
Following the structure is the colour registers, one word for each
colour register. The value saved is same as that required by the
hardware. Eg. white is $0FFF, upper nibble is zeroed, next three nibbles
are the Red, Green, Blue values.
Following the Colour registers is the actual data in the format selected.
If no structure gadget is highlighted then only the uncompacted data will
be saved, No structure, and No colour registers.
The following is an example of the data saved with PLANES selected for data
format and SPECIAL for structure type
0000: 00080003 00000084 00B00140 0E000A00 ...........Ê....
^ ^ ^ ^ ^ ^ First colour register ($0E00)
| | | | | Word pixel width of data ($140)
| | | | Word height of data ($B0)
| | | the length of each plane of data ($84)
| | the number of planes of data (3)
| The number of colour registers (8)
0010: 0D800FE0 08F00080 0FFF000F 00000000 ...à.ð..........
^ ^ The start of the first plane of data
| still on colour registers
0020: 1C000000 00000200 00000000 03800000 ................
0030: 000003C0 00000000 01E00000 000001F0 ...À.....à.....ð
^ The rest of this file is just the picture, (or brush
sprite etc.) , data.
These structure makes it easy to make a general routine for displaying the
data.
FUTURE
~~~~~~
If you have any suggestions to make this a more usefull application then
write and tell us. I have heard that there is a similar style of program
put out by KEFRENS but I have not seen it. So I can not compare the two
programs. Perhaps somebody with the KEFRENS program would like to send me
a copy (I'm assuming its P.D. of course)
If anybody would like the original assembly source code for this program
then send two 3.5 Disks and $25 (Australian) to the following address and I
will return one disk with the source on it. (I'll keep the other to cover
mailing expense). The $25 is the cost of the Source code to buy. Hey!
you can't expect everything for free.
AUSTEX Software
PO BOX 48
KIRWAN
QUEENSLAND 4817
AUSTRALIA.
---------------------------------------------------------------------------