
MAKE_DGI and MAKE_DGX are tools created for my needs in game developments for
GEM environment.

To facilitate compatibility to the VDI, MFDB structure (see TOS.HYP doc dev)
is employed as header. Palette may be present or absent, each colors encoded
in VDI way (1 INT from 0 to 1000 for each componentof R, V, B). 
The raster images are stored in standard format (planar, not interleaved)
so that they can be transformed to the specific format of the screen 
(official Atari, strange graphic cards, new enhanced screenmodes)
at game start.

Rasters images are always a multiple of 16px in width. 
Bitplanes number is kept (16 colors remains 16c, 256 colors remains 256c, etc).

The convertors use the PARX.SYS read methods (RIM). GIF modules is mainly
employed. 

Generated formats VDI, DGI and DGX are never packed (to reduce loading time,
generaly loaded from hard disk with space).


 MAKE_DGI : GIF to DGI or VDI convertor

Usage : scans one 16/256 colors image (usualy GIF) or all of a folder and
converts it to DGI or VDI format. DGI is the old image format for DGEM. 
VDI is the format used for Rosemary's Racoon Strip Game.

Save routines are located in MAKE_DGI.GFA.
Load routines are located in DGEM.GFA and others.

- DGI format:

20 bytes informations for MDFB 
The first 4 bytes = "_DGI" are supposed to be replaced by a pointer.

Next bytes -> raster image in VDI standard mode (planar, not interleaved)

Since most graphics share the same palette, it's better to have the palette
in a separated common file. So no palette datas in DGI files.

- VDI format:

20 bytes informations for MDFB (see TOS.HYP doc dev)
The first 4 bytes = "_DGI" are supposed to be replaced by a pointer.

Next bytes -> palette: 16*3 or 256*3 INTs (96 or 1536 bytes)
                       (1 INT for each R, V, B, value from 0 to 1000)

Next bytes -> raster image in VDI standard mode (planar, not interleaved)

- for TC images:

20 bytes informations for MDFB (see TOS.HYP doc dev)
The first 4 bytes = "_DGI" or "_VDI" are supposed to be replaced by a pointer.
The bitplanes number is 24.

Next bytes -> raster image separated in R, then V, then B
              (1 byte for each R or V or B pixel component)


 MAKE_DGX : GIFs to DGX convertor/aggregator

Usage : scans all images of a folder (typicaly GIFs in 16 or 256 colors), 
converts it to DGI format and gathers all them into a containor DGX file which
name is [name of the folder].DGX, generated besides the folder.

Does not handle TC images.

This util was written to group numerous images, to avoid files allocation
table overloads on disks. It's convenient to group into family sprites, such
as animations, or depending on the nature of elements.

Save routines are located in MAKE_DGX.GFA.
Load routines are located in DGEM.GFA and others.

1 LONG ("_DGX")
then list of...
1 INT : offset from start, to the DGI structure
8 CHAR : was the name without extension of the DGI file
2 bytes : unused (nullbyte + an offset for parity address)
Then list of DGI structures...

NB: the "remap with 256c" is a trick used for DGEM, it does not keep the 16c
(4 bitplanes), but uses the EXTENDED.P08 file (256c palette, managed by D2M
software) to convert and color-remap a 16c to 256c images.
This trick help me to manage additionnal colors used in Dungeon Master for
several monsters.



Disclaimer: use it at your own risk. GFA sources are provided for
general knownledge and possible bugfix.

Rajah Lone
https://ptonthat.fr
