CONVERTER DOCS - -- ---====ooOOoo====--- -- - Preface: ~~~~~~~~ The program 'CONVERTER' is SHAREWARE. If you start using it regularly, please send a fee of 10 pounds (UK) to - Steve Chalmers, 10 Overton Park, Dyce, Aberdeen, AB2 OFT, SCOTLAND. Send the fee along with your name, address and version number of CONVERTER that you are using. This will entitle you to updates as and when they appear, help with any problems and news of other programs that I have written. Of course if you don't use CONVERTER then don't bother..... CONVERTER is freely distributable by any means (i.e. by post or on Bulletin Boards and suchlike) as long as the following points are adhered to: 1) All of the files must be included in their original form without additions, deletions, or modifications of any kind. 2) All copyright notices must remain intact. 3) CONVERTER may not be sold commercially without my consent. 4) CONVERTER must not appear on any electronic service that claims copyright to uploaded programs, either alone or as part of a collection. 5) CONVERTER must also not appear on any magazine disk or similar for mass distribution without prior notification to myself. As a final note to the above, CONVERTER may be freely used by anyone who requires it for the development of software (for commercial release or otherwise), so long as you have made a donation. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Disclaimer: ~~~~~~~~~~~ You use CONVERTER entirely at your own risk. I do not guarantee its fitness for any purpose. I accept no responsibility for any damage done to software or hardware during its use. Note for NTSC users: CONVERTER runs in PAL mode only. However, if anyone out there would like an NTSC version, get in touch with me at the above address and I will code a version for you for a small fee. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The following files should be distributed together: CONVERTER CONVERTER.INFO CONVERTER.DOC CONVERTER.DOC.INFO CONVERTER is a stand alone file, NO other files are required for its use. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CONFIGURATION REQUIREMENTS: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ CONVERTER requires the following system components: - Amiga 500/1000/2000 (PAL versions only) - Kickstart V1.2 or V1.3 (Should, fingers crossed, work on V1.4) - 512Kbytes RAM or greater (CONVERTER needs 80Kbytes for itself) CONVERTER supports the following storage devices: - up to 3 floppy disk drives (DF0:, DF1:, DF2:) - 1 or more hard disks with partitions DH0: to DH3: - RAM disk - Recoverable RAM disk (RAD: and VD0:) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LOADING CONVERTER: ~~~~~~~~~~~~~~~~~~ From CLI Change your directory to the one where CONVERTER is held. Then type 'CONVERTER' at the prompt. No stack adjustment is required. From Workbench Double click on the 'CONVERTER' icon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ What is CONVERTER ??? ~~~~~~~~~~~~~~~~~~~~~ Well, Graphic images can be stored in a variety of formats. CONVERTER is a utility that allows you to transfer graphical images between different formats, e.g. IFF to Bitmap, ST to AMIGA or vice versa. If you are a programmer who is involved in graphical manipulation you should find this a useful utility. Before I start, I will assume that you know the basics of how the AMIGA displays graphic images etc. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MOUSE FUNCTIONS: ~~~~~~~~~~~~~~~ CONVERTER uses the mouse for virtually all program functions. To select a function simply click on the relevant gadget using the left mouse button. The right mouse button is used to scroll the display up, down, left or right to view an entire graphic. This is performed by moving the mouse in the required direction whilst holding down the right mouse button. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OK, I will now attempt to explain the purpose behind all the gadgets and menus in CONVERTER, (I assume you have already loaded it, and seen all the menus and gadgets). Firstly, I shall explain the use of the file requester that is displayed whenever a load or save operation is to be performed. FILE REQUESTER: ~~~~~~~~~~~~~~~ Clicking on a LOAD or SAVE gadget gives you the file requester. To call up a list of the files in the current directory click on DIR or click on one of the 10 device names shown. After this, all the files and sub-directories of that device will be shown along with their length (in decimal). You can move to a sub-directory just by clicking on its name. Clicking on the up/down arrows scroll through the list of files and directories. Alternatively, you can use the cursor up/down keys. Once you have found the file you want, click on its name and it will appear below the box next to 'FILE:'. In the save mode, you can type in a new file name by clicking on the 'FILE:' strip. KEYS: Shift - left cursor : Start of line Shift - right cursor : end of line TAB : clear line Once you have chosen your file, or typed in a new file name, you can save/load that file by clicking the 'OK' gadget. (Or by double clicking on the filename). Clicking on EXIT or CANCEL will abort the operation. To avoid loading the directory every time the file requester is entered, the directory is stored in memory. This means that if you saved a file, it will not appear until you click on DIR for a reload of the directory. The save and load directories are stored separately, so you can have them pointing to different directories. NOTE: If the selected device does not exist or there is no disk in the drive, then the Workbench screen will appear and with it a standard AMIGA requester asking you to insert a disk etc. Just click on CANCEL and you will return to CONVERTER. If the AMIGA seems to have frozen after attempting to directory a disk etc, try pressing F10. This will take you to the Workbench or CLI screen where there may be a system requester (This slipped past my checking!). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I'll now describe each menu in turn...... IFF MENU: ~~~~~~~~~ From this menu you can load or save IFF graphic files. The graphic to be loaded can be of any width or height (memory permitting). The graphic modes supported are: Palettes of 2,4,8,16,32,64,4096 colours. Lo-res, Hi-res, Interlace, Med-res, Ham, Extra Half-Brite, Overscan, Brushes, Masks (Saving with Stencil on in DELUXE PAINT produces a mask along with the main graphic data), DELUXE PAINT stencil files (ILBM with only a mask, you may have to change colours to default after loading). In fact it will load any pictures/brushes saved by DELUXE PAINT and most other art packages that adhere to the IFF standards as well. IMPORTANT NOTE: ~~~~~~~~~~~~~~ Although CONVERTER can handle INTERLACE mode graphics, when files of such a format are loaded, the program will display the graphic in normal 256 pixel non-interlaced mode. (i.e. the graphic will be double its normal height). Please note that this 'feature' does not affect the actual manipulation of interlaced graphics and all program functions will work. (CONVERTER still knows that the graphic is Interlaced!) When you load a graphic it will appear above the control panel. NOTE: In IFF files, the actual width of the graphic is always a multiple of 16. Therefore if you saved a brush with a width of 4 pixels then this is saved as a graphic of width 16 (Rounded UP to the nearest multiple of 16). This, however, does not affect your graphic when it is loaded in. The only difference is that when you look at the information about the loaded graphic it shows a width of 16 pixels and not 4. Bitmap widths are always a multiple of 16 (This is a hardware restriction). The SAVE gadget allows you to save the currently displayed graphic as an IFF file. When you click on the 'Selected bitmap save' another gadget will appear. You can type the number of the bitmap you want saved in this gadget.(0-6) You can see each individual bitmap by using the DISPLAY SETUP menu. The bitmap chosen in that menu will automatically be entered into the selected bitmap save gadget, ready for saving. Therefore, you can save out a single bitmap as an IFF file. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BITMAP MENU: ~~~~~~~~~~~~ This menu allows you to Load and Save the graphics bitmaps in a variety of different formats. There are two main ways of saving the graphics bitmap data. These are: SEQUENTIAL: Each bitmap of the graphic is stored one after the other. e.g. 1st line of 1st bitmap 2nd line of 1st bitmap : : nth line of 1st bitmap 1st line of 2nd bitmap 2nd line of 2nd bitmap : : nth line of 2nd bitmap . : : 1st line of last bitmap : : nth line of last bitmap where n is the height of the graphic INTERLEAVED: Each bitmap is interleaved with each other. Like an non-crunched IFF BODY chunk. e.g.. 1st line of 1st bitmap 1st line of 2nd bitmap : 1st line of last bitmap 2nd line of 1st bitmap 2nd line of 2nd bitmap : 2nd line of last bitmap . : nth line of 1st bitmap nth line of 2nd bitmap : nth line of last bitmap where n is the height of the graphic The middle and right gadget columns hold the Load/Save options. You can select whether to use sequential or interleaved mode. The mask gadget allows you to Save/Load with a mask. When clicked on, another gadget appears which lets you specify if you want the mask placed before or after the main graphic's bitmaps within the file. In Interleaved mode, the mask is interleaved (before/after) with the other bitmaps. A mask is a bitmap that is made up by combining all the graphics into one. Each bitmap is logically OR'ed with each other into one bitmap. The mask is the same size as the other bitmaps. The mask is not used when displaying a graphic but is mainly needed for merging operations with the Blitter. The Colourmap gadget allows you to save the 32 colours of the graphic within the same file as the bitmaps. When clicked on, another gadget appears which lets you specify if you want the colourmap data placed before or after the main graphic's bitmaps within the file. The colourmap saved contains all 32 colours. Each colour is a word, hence 64 bytes in total are saved. The 'Save Height Specified' gadget allows you to specify the height of the graphic that is to be saved. Enter your height into the height gadget on the left of the screen. It will not save heights greater than the height of the current graphic being displayed. NOTE: There are no size details (width etc.) or mode data saved along with the bitmaps. OK, enough of saving, now on to loading.... The right hand gadget column holds the Bitmap Load options. These let you specify the width, height, depth and the mode (Ham/Halfbrite) of the graphic to be loaded. The width is rounded up to the nearest multiple of 16. Mask and Colourmap details also apply to the file to be loaded. The Load gadget allows you to load ANY file. If it is your own, then you should know it's sizes and format. But if it is not, then a bit of testing is required. I put a quick exit to the DISPLAY SETUP menu, since it is very handy when trying to get the correct setup. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SPRITE MENU: ~~~~~~~~~~~~ This allows you to save any loaded graphic as sprites. The sprite can be saved as source code (ASCII text file), ready for insertion into your own program source code, or as a binary file. Also, the sprite saved can be either 4 or 16 colours. The graphic loaded in can be of any height and width but must be 4 or 16 colours. The 'Sprites To Save' gadget allows you to specify the amount of sprites to save. Up to 20 sprites can be saved at once. The first sprite saved is taken from the top-left corner of the graphic. Then it works right for the next sprite, and so on, until the number you specified has been reached. The height of the sprite is equal to the height of the graphic loaded, but the width of the sprite is 16 pixels. The format of the saved file is as follows: 2 words (both zero) for the control words sprite graphic data (2 words for each line) 2 words (both zero) marking the end of the sprite. A 16 colour sprite is actually 2 sprites joined together. The 16 colour sprite saved is 2 sprites in the above format. The first one having the graphic data of bitmaps 0,1 and the second of bitmaps 2,3. The 'Forced Save' gadget disables the bitmap checking. This allows you to draw your sprite in the upper 16 colours of a 32 colour palette and you can save it perfectly. The sprite will be garbage if it uses any of the lower 16 colours. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ COLOURMAP MENU: ~~~~~~~~~~~~~~~ Ever found yourself requiring the colour values of a graphic so that you can include it in your own program, but the only way of getting them is to write out all the colours by hand by looking at each colour in an art package?. Well you're saved!.... CONVERTER can do it for you. CONVERTER allows you to save the colourmap of the current graphic as a source or binary file (all 32 colours are saved). On the AMIGA the hardware registers $dff180,$dff182....$dff1be hold each of the 32 colours. I have included the option of saving the hardware register values (just the offset from $dff000) along with the colour data. For example, A source code save with the hardware registers looks like this: dc.w $180,$000,$182,$cfb,$184,$eb6,$186,$ba4 dc.w $188,$d92,$18a,$c80,$18c,$973,$18e,$665 dc.w $190,$354,$192,$d62,$194,$731,$196,$333 dc.w $198,$a53,$19a,$841,$19c,$773,$19e,$564 dc.w $1a0,$674,$1a2,$0ef,$1a4,$09d,$1a6,$f22 dc.w $1a8,$9d9,$1aa,$f00,$1ac,$c00,$1ae,$fff dc.w $1b0,$505,$1b2,$531,$1b4,$011,$1b6,$222 dc.w $1b8,$443,$1ba,$672,$1bc,$886,$1be,$1de e.g. The $180 is the hardware register offset value and the following word is its colour ($000 - black). The above can be inserted straight into a copperlist! (That is the main reason for having the Colourmap save) The first 16 colours of a palette can be saved out starting with the hardware registers $1a0,$1a2 etc. This is to allow the lower 16 colours of any graphic to be stored in the appropriate place for inserting into a copperlist or whatever. The LOAD option in the Colourmap menu allows you to load just the colourmap from any IFF picture. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DISPLAY SETUP MENU: ~~~~~~~~~~~~~~~~~~~ This menu displays some useful information about the current graphic. It also allows you to see each bitmap separately. When you initially enter this menu, the graphic display area will go black, but don't worry, your graphic is still OK. On the left there are 6 gadgets. These are the bitmap controls. By clicking on one of these, you will see that bitmap of the your graphic. The bitmap shown is automatically entered into the 'Selected Bitmap Save' gadget in the IFF menu, ready for saving. Here is an explanation of the information shown: WIDTH : This is the width of the graphic. It is not the screen width. HEIGHT : This the height of the graphic, not the screen height. DEPTH : This is the number of bitmaps the graphic has. 1 bitmap is a 2 colour graphic, 2 is 4 colour 3 is 8 colour , 4 is 16 , 5 is 32 6 is 64 or 4096 ,depending on mode (ham or half-brite) BITMAP SIZE : This is the amount of memory taken up by one bitmap. BITMAP SIZE = (WIDTH/8) * HEIGHT Width is divided by 8 so as convert from bit to byte width. GFX SIZE : This is the total amount of memory taken up by the graphic. GFX SIZE = BITMAP SIZE * DEPTH Both hex and decimal values are given. Along the bottom of the screen, the amount of free chip memory and the total free memory (Chip and Fast RAM) is shown in KBytes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ST DEGAS .PI1 FILES MENU: ~~~~~~~~~~~~~~~~~~~~~~~~ If you need to transfer pics to or from the ATARI ST, then CONVERTER can do it for you. A standard (or so I've been told) picture file format on the ATARI ST is the .PI1 format used by the DEGAS ELITE art package. (The .PI1 is the extension added to the filename when saved in DEGAS). CONVERTER can load in these files and then save them in whatever format you wish (IFF/Bitmaps etc). Also CONVERTER allows you to save the current graphic as an .PI1 file. Transferring the files to and from AMIGA/ST should be done using a file transfer utility (such as 'DOS-2-DOS' or similar). In the future, I may upgrade CONVERTER so that it can read/write directly to a formatted ST disk to cut out the need for file transfer. If anyone reading this has such a routine for the AMIGA and is willing to share it, then I would be grateful if you could get in touch. Ok then, on the menu you can see the standard SAVE/LOAD options and there are also three other gadgets... LOAD OPTION : Allows you to double the value of the colours that are loaded from the .PI1 file. Why double the colours? The AMIGA has a palette of 4096 colours. Each colour is made up of red,green and blue (RGB) components. Each of the components can range from 0 to 15 (As in the DELUXE PAINT palette window). But the ST has only got a palette of 256 colours and, more importantly, its RGB components can only range from 0 to 7. Therefore, the brightest white on the ST is 7,7,7 (RGB) while on the AMIGA it is $FFF (15,15,15 RGB). So for the best colour match, the ST colour values should be doubled. SAVE OPTION : When you are saving the file you can halve the value of the colours to get a closer colour match when the file is loaded back on the ST. N.B. During testing I found that, if the colours were not halved, the ST art packages freaked out!! FORCED SAVE: The .PI1 files have a strict format (described below).The picture to be saved must be 16 colours (4 bitmaps). With forced save on you can override the bitmap check, so you can save graphics with more or less bitmaps. 4 bitmaps are always saved. If you have more they will be truncated and the picture will be affected. If you have less then blank bitmaps are added to make it up to the 4 required. NOTE: The picture size must be : width = 320 height = 200 depth = 4 (16 colours) Pictures with heights greater than 200 pixels are truncated to 200. It took me ages to get my hands on the format so here is the actual file structure for anyone who needs it. ST DEGAS .PI1 FILE FORMAT: File is made up of four parts : HEADER COLOURMAP BODY TRAILER These are as follows:- HEADER 1 word Holds display mode. 0-lo, 1-med, 2-hi COLOURMAP 16 words 16 colours, RGB word 0-7 for each colour component BODY 32000 bytes 1st word of 1 bm, 1st word of 2 bm 1st word of 3 bm, 1st word of 4 bm 2nd word of 1 bm, 2nd word of 2 bm 2nd word of 3 bm, 2nd word of 4 bm etc.. Screen size always 320_ x 200| x 4/ TRAILER 32 bytes (4 colour cycling variables) 4 words left colour cycles 4 words right colour cycles 4 words cycle directions 4 words cycle speeds A final sentence on the ST file format.... NEOCHROME IS DEAD!? or so I have been led to believe. If not and you think I should include a Load/Save for it then drop me a line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BLOCK CUTOUT MENU: ~~~~~~~~~~~~~~~~~~ The main reason that I wrote CONVERTER was to make make life easier when inserting graphics into a game I am currently writing. The block cutout feature is more for my use but maybe some of you will find a use for it. Basically, it takes the current graphic and splits it into 16x16 blocks.Each block is saved one after the other. Each block can be saved out with either sequential or interleaved bitmaps as with the bitmap save. Block cutout just saves you from having to do multiple IFF loads and Bitmap saves with each separate block. Restrictions: The graphic width must be a multiple of 16 pixels. The graphic height must be a multiple of 16 pixels. The graphic can be of any depth. The blocks that are cut out are 16 x 16 pixels. Saved format: The blocks are cut starting with the block in the top-left corner and working across the way. Upon reaching the end, it drops down a block and starts from the left again. This repeats until the bottom of the graphic is reached. Each blocks' data is separate. e.g. for sequential save, the file format is: (For a 2 bitmap graphic) Top-left block : 1st line of 1st bitmap (line is 16 bits) 2nd line of 1st bitmap : 16th line of 1st bitmap 1st line of 2nd bitmap : 16th line of 2nd bitmap Top-2nd from left : 1st line of 1st bitmap : 16th line of 1st bitmap 1st line of 2nd bitmap : 16th line of 2nd bitmap etc. E.G. For interleaved save, the file format is: (For a 2 bitmap graphic) Top-left block : 1st line of 1st bitmap (line is 16 bits) 1st line of 2nd bitmap 2nd line of 1st bitmap 2nd line of 2nd bitmap : 16th line of 1st bitmap 16th line of 2nd bitmap Top-2nd from left : 1st line of 1st bitmap 1st line of 2nd bitmap 2nd line of 1st bitmap 2nd line of 2nd bitmap : 16th line of 1st bitmap 16th line of 2nd bitmap etc. If you like this function but require a different block size then contact me and I will change it for you. If you use this feature, then you may be interested in another one of my utilities 'MAPPER' which allows you to create level maps visually, using IFF pictures containing the blocks. Interested? If so then contact me for a demo version. (so ends free plug!) OK, That's it for the functions of the program. Now for a few extra bits plus the credits... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAIN MENU: ~~~~~~~~~ Apart from the menus described above, the main menu also has the following gadgets : Wipe Memory: This gadget fills all non-allocated memory (memory not being used by any program) with zeros, both chip and fast memory. It does no harm the CONVERTER or any other task currently running. There will be a slight delay and everything will freeze while it carries out the wipe, so no need to put the peril sensitive sunglasses on just yet!. N.B. There is no advantage by using this other than tidying things up for using other programs afterwards. It does nothing to affect CONVERTER or enhance its performance. Exit: Exits CONVERTER! You will be given a prompt, reply Y to exit the program. On all other menus exit will bring you back to the previous screen. Help: HELP is available on each of the CONVERTERS menu screens and gives a summary of the functions of that menu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ KEYBOARD SHORTCUTS: ~~~~~~~~~~~~~~~~~~ D : View Full Screen (Click left mouse button to exit) Cursor Keys : Scroll screen Up/Down/Left/Right B : Bitmap menu V : Display setup menu C : IFF menu Space Bar : Main menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE FUTURE: ~~~~~~~~~~ I can't think of anything else to add to CONVERTER just now. But if you can, then I will appreciate any new ideas. If there are any standard formats out there that I have missed then let me know. (e.g. PC formats?) Contact me at the address at the start of this file. Also, any constructive comments will be welcome. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CREDITS: ~~~~~~~ Thanks to: ~~~~~~~~~~ Andy Smith For comments, icons and grammar checking!. Kevin Holland For all his constructive comments. Hisoft Ltd. For DEVPAC 2 (The best!) Copyrights: ~~~~~~~~~~ Degas Elite is copyright of Electonic Arts. Neochrome is copyright of Atari Corp. Dos-2-Dos is copyright of Central Coast Software Deluxe Paint is copyright of Electronic Arts. Mapper is copyright of Steve Chalmers Commodore and Amiga are trademarks of Commodore Business Machines Inc. Atari and ST are trademarks of Atari Corp. And finally.... CONVERTER V1.00 Written between November 1989 and May 1990 Copyright 1990 Steve Chalmers. All Rights Reserved. THE END - - - ----===oOo===--- - - -