Amos AGA Extension (Build V.312) AGA Extension Code Copyright '95 - Nigel Critten AGA Extension All Copyrights '95 - Michael Prince AGA Extension Distribution Copyright '95 - Formerly Joe Jenkins Exclusive Worldwide distribution rights now F1 Licenceware as of Oct 20 1995 Any bug reports to be reported to the following - Telephone - (After 8.30pm) Michael Prince 01332 273679 Letter - Michael Prince,5 Hall Park Close,Littleover,Derby,DE23 6GZ Disclaimer - All the above take no responsibility for any damage or loss to software or hardware which may occur if you use this extension.You do so at your own risk. Please Note - This extension is LicenceWare and may not be distributed by anyone other than F1 Licenceware and their official distributers. If you are installing the AMOS Pro version you'll have to manually enter the extension name into the extension list at number 20. Even though most graphic functions in this extension are slightly faster than their 32 colour counterparts you can get a 15% speed increase if you use AMOS Classic 1.35/1.36.e Installing The AGA Extension For AMOSPro - 1) Goto the Config menu. 2) Load the Interpreter. 3) Load the Default Configuration. 4) Click on Set Loaded Extensions. 5) Type in at line 20 (excluding speech marks) "AMOSPro_AGA.Lib". Due to the way Amos works Sprites,Bobs and Mouse related commands may react in a corrupting way on screen. Future versions will take care of this. Bugs Fixed From Build V.251 - 1) Sprites had a bad habit of appearing at random. 2) AMOS patched so you can now use the Change Mouse command with AGA screens. 3) RAW Image data can now be held in Fast Memory and copied straight to the screen from there. 4) Screencopy and Blocks were known to misbehave if they went off the screen anywhere, sanity checking has been put in to clip these and they should behave themselves from now on (I hope!). 5) If you quit out of a program that held a AGA screen open and used the Default comand to get your system back to normal (which is the only offical way of doing it) then the next time you ran the program the AGA screens wouldn't open and you were left with a normal AMOS screen.This was due to not clearing a flag that told the system that the screens were open. Bugs Fixed and Extra Commands From Build V.269 - 1) Extension fixed to work with both AMOSPro and on a CD32. 2) AGA Screen command added. 3) AGA Front Screen command added. 4) Second version of the AGA Colour command added. 5) AGA Use Font command added. 6) AGA Spack (Picture packer) command added. 7) AGA Unpack (Picture unpacker) command added. 8) AGA Sprite Mode command added. 9) AGA Text command now supports clipping. 10) AGA Screenopen command now bug free. AGA Extension Commands Supported - AGA Screen Open Synopsis - AGA Screen Open screen number. Function - Opens a custom screen 320X256X8.This routine sets up the copper list and brings the new screen to the front. Inputs - screen number - The number of the screen you want to open.It can not already exist,ranges from 0-7. Result - A newly created screen ready for use. Bugs - At the present time each screen has to share a common palette. AGA Screen Close Synopsis - AGA Sreen Close screen number. Function - Closes a custom screen opened with AGA Screen Open. Inputs - screen number - The number of the screen you want to close. Result - Screen closed. Bugs - If you have more than one screen open and you close the top screen you will have to use AGA Front Screen to bring a new screen to the front. AGA Screen Synopsis - AGA Screen screen number. Function - Brings the requested screen to the front,the focus is applied to this screen so all future drawing operations will be carried out on this screen. Inputs - screen number - The number of the screen to have the focus. Result - All future drawing operations are now carried out on this screen. Bugs - None known. AGA Front Screen Synopsis - AGA Front Screen screen number Function - Brings the requested screen to the front,hiding all others. Inputs - screen number - The number of the screen you want in front. Results - Desired screen brought to the front or Error message if screen wasn't opened. Bugs - None known. AGA Load Bitplanes Synopsis - AGA Load Bitplanes bank To screen Function - Copies RAW Bitplane data from a memory bank to the screens' bitplanes in effect loading a picture. Inputs - bank - The Amos memory bank that has the Bitplane Data in. screen - The destination screen that will get the picture loaded Result - RAW data turned into a picture. Note - As of this version there is no need for the bank to be in Chip ram.This has the effect of speeding up the screen display on 020+ machines as 020+ machines are faster than the Blitter for these operations. Bugs - This is a replacement for the Load IFF command in AMOS.To turn your picture into RAW data requires a convertor.The Shareware program PicCon supplied with this disk will do the trick but remember to register if you frequently use it. For an example of loading a picture see "Loading_AGA_GFX.Amos" supplied on the disk. Also read "Using PicCon For AGA Extension" at the bottom of the page. AGA Screen Copy Synopsis - AGA Screen Copy source To destination AGA Screen Copy source,sx,sy,w,h To destination,dx,dy Function - Copies a screen or part of a screen to a different area of the same screen or another. Inputs - source - The source screen. - destination - The destination screen. - sx,sy - The x and y coordinates of the top left of the copy area - w,h - The width and height or the copy area. - dx,dy - The x and y coordinates of the destination. Result - Selected area of graphics moved to destination. Clipping - Supports clipping. Bugs - None known. AGA Draw Mode Synopsis - AGA Draw Mode n Function - Changes the drawing mode for all future drawing operations for the current screen. Inouts - n - The mode can include: Jam1 = 0 Jam2 = 1 XOR = 2 INVV = 4 Result - Drawing mode changed.For more info see Gr Writting in the AMOS Manual. Bugs - None known. AGA Cls Synopsis - AGA Cls [ink] Function - Clears all or part of the screen. Inputs - ink - colour you want area to clear to. Result - Screen cleared (in optional colour) Bugs - None Known AGA Ink Synopsis - AGA Ink colour Function - Changes the current drawing pen so all futrure drawing operations will be the selected colour. Inputs - colour - The colour you want to change the pen to.Value should fall in the range of 0 - 255.If it goes over 255 it will wrap around again. Result - Colour changed to the value selected. Bugs - None Known AGA Colour Synopsis - AGA Colour n,r,g,b Function - Changes a colour in the copper list to reflect the new colour value.All values should be 8bit so $FFF does not equal white but $FF,$FF,$FF does. Inputs - n - Colour number range from 0 - 255 r - red colour value range from 0 - $FF g - Green colour value range from 0 - $FF b - Blue colour value range from 0 - $FF Result - Specified colour changed to new values. Bugs - None Known. AGA Colour Synopsis - n = AGA Colour(n) Function - Returns a LONGWORD for the colour 'n' . Examples below. Red = $00FF0000 Blue = $000000FF Green = $0000FF00 Inputs - n - Palette index you want colour infomation on. N ranges from 0 to 255 Results - A LONGWORD containing the colour value. AGA Box Synopsis - AGA Box x1,y1 To x2,y2 Function - Draws a box with the top left set by x1,y1 and bottom right by x2,y2. Inputs - x1,y1 - Top left coordinate. - x2,y2 - Bottom right coordinate. Result - Draws a box at the specifed coordinates. Clipping - Supports clipping Bugs - None Known. AGA Bar Synopsis - AGA Bar x1,y1 To x2,y2 Function - Draws a bar with the top left set by x1,y1 and bottom right set by x2,y2. Inputs - x1,y1 - Top left coordinate. - x2,y2 - Bottom right coordinate. Result - Draws a bar at the specified coordinates. Clipping - Supports clipping. Bugs - None Known. AGA Text Synopsis - AGA Text x,y,t$ Function - Writes t$ to the screen at x,y coordinates. Inputs - x,y - Coordinates where the text will start from. - t$ - Text string you want written to the screen. Result - Your specified text printed to the current screen at x,y. Clipping - Supports clipping. Bugs - None known. AGA Use Font Synopsis - AGA Use Font name$,size,style Function - Selects which font to use without having to use Get Disc Fonts or any of the other Amos Font related commands.Also allows you to specify the exact font when installing Hard Drive software so you will always get the font you want, rather than the one that just happens to be at number 1 or whatever number you choose. Inputs - name$ - The name of the font eg.Topaz.font size - The font size eg.9 style - The style value from the below table. 0=Plain 2=Bold 4=Italic 6=Bold/Italic 8=Underlined You can achieve other combinations by adding the values together Eg. a value of 10=Bold/Underlined = Bold(2)+Underlined(8) Eg. AGA Use Font "Topaz.font",8,0 = A size 8,plain Topaz font. Notes - This function can also use Scalable Fonts.To change the current font directory 'Pro users use the Assign command while Classic users will have to use Assign from the §hell. Result - Your specified font parameters selected. Bugs - You can't use the style parameter with scalable fonts yet... AGA Get Block Synopsis - AGA Get Block n,x,y,w,h,mask Function - Grabs a block and stores it for later use and allocates all the needed memory for the operation.Allows upto 4000 blocks to be grabbed with numbers from 1 to 4000. Inputs - n - Block number. - x,y - Top left of the block. - w,h - The width and height of the block. - mask - True if you want a mask,false if you don't.You cannot allocate a mask afterwards. Result - Your specified block stored into memory ready for use. Notes - Load - "Demo4_Using_AGA_Blocks.Amos" for an example. Bugs - If you try to overwrite a block you will lose the memory that the previous block was using,so remember to AGA Del Block first. AGA Put Block Synopsis - DS Put Block n,x,y Function - Places a previously allocated block onto the current screen at coordinates x,y. Inputs - n - Block number. - x,y - X and y coordinates of where the block will be placed. Result - Specified block is pasted at coordinates x,y. Notes - Load - "Demo4_Using_AGA_Blocks.Amos" for an exmaple. Clipping - Supports clipping. Bugs - None known. AGA Clip Synopsis - AGA Clip n Function - Turns Clipping on/off.By turning Clipping off the program won't test for any graphics going over the screens' boundary so you should see a slight increase in speed,but any graphics going over the boundary will cause a error.Turning Clipping on will allow the program to check for graphics going over the screens' boundary but at a slight loss off speed. Inputs - n - True if you want Clipping on or False if you don't. Result - Clipping turned on or off. Bugs - Check to see if the graphics command your using supports clipping at the moment. AGA Del Block Synopsis - AGA Del Block n Function - Deletes a block previously allocated with AGA Get Block. Inputs - n - Block number. Result - Specified block deleted. Bugs - None known. AGA Get Palette Bank Synopsis - AGA Get Palette Bank bank To screen Function - Loads the colour palette using a bank full of palette entries,the bank can be created using PicCon with the palette output set to 8bit. Inputs - bank - Bank that contains the palette infomation. - screen - Screen you want the palette to effect.Even though screens use custom palettes it may not always be this way so if you use this value correctly then your programs will work with any future version of the extension. Results - Palette loaded from specified bank. Bugs - None known. AGA Sprite Mode Synopsis - AGA Sprite Mode res Function - Changes the resolution of the mouse pointer. Inputs - res - resolution of the pointer. 0 = Low Res Sprites 1 = Medium Res Sprites 2 = High Res Sprites Sprite resolutions are set for all sprites. Results - Sprite resolution set to specified value. Bugs - None known. AGA Spack Synopsis - AGA Spack screen to bank Function - Compacts a screen and places the contents in a bank,the bank being allocated for you. Inputs - screen - screen number you want packed. bank - destination bank that will recieve packed screen. Results - A bank containing a packed picture with the header Aga.Pic. The header being the name of the actual bank when you use the Listbank command. Notes - Due to the limitations of RLE it is quite possible for the packed picture to be larger than the original RAW data! So use the compactor with caution!! To save the data held in the bank just use the Save command remembering that any file name should have the .abk ending. Eg. Save "My_Pic.abk",(Bank number with picture data in) Load - "Demo2_Spack.Amos" for an example. Bugs - None known. AGA Unpack Synopsis - AGA Unpack bank to screen Function - Unpacks a screen previoulsy packed using AGA Spack. Note it will not unpack AMOS packed screens. Inputs - bank - a bank number containing the packed data. The bank should have the header Aga.pic. screen - the screen you want the data placed in, if the screen isn't opened then one will be opened for you. Results - Your picture unpacked. Notes - This command will use the Akiko or compatable chip if found. To load a picture into a bank use Load then use the AGA Unpack command. Eg. Load "My_Pic.abk",(Bank number) AGA Unpack (Bank number) to (Screen number) Load - "Demo1_Unpack.Amos" for example. You'll get a quicker unpacking time if your using the Akiko or compatable chip! Bugs - None known. Using PicCon For AGA Extension PicCon is a Shareware picture convertor so if you plan on using the software frequently please register it! Remember the AGA extension can only handle a 320X256X8 picture. 1) Load your picture in by using the Open Picture command. 2) Set to Binary in Save Data As.. option. 3) Save the image using the Save Image option prefixing the name with .pic 4) Save the palette using the Save Palette option prefixing the name with .pal That should leave you with two files - Example.pic (Your PICture held in binary format) Example.pal (Your PALette held in binary format) Next load Amos I'll use an example program to demonstrate the loading of a PicCon converted picture into Amos. 1) Load "Demo3_Loading_AGA_Pic.Amos" from your Extension disk. 2) Line 11 reserves 82000 bytes in Bank 4 for the picture data. 3) Line 14 reserves 2000 bytes in Bank 5 for the palette data. 4) Line 16 loads the picture data into Bank 4. 5) Line 17 loads the palette data into Bank 5. 6) Line 18 grabs the palette data from Bank 5. 7) Line 19 loads the picture data from Bank 4 to screen 1. Please remember that this extension won't get updated to include any commands you want unless it's supported by everyone using it. If you've paid to use this,Thank You,if not then this will most probably be the last version of the AGA extension that is written. Possible Commands To Be Covered In Version 2 - 1) More geometric functions ie.Circle,Filled Circle,Polyline,Point etc. 2) Fill (and Fill type). 3) CPU,FPU detecting commands. 4) CD32 controller support. 5) 3 Button mouse support. 6) Faster mousezones and zone checking routines. 7) Seperate palettes for seperate screens. 8) Hires screens. 9) Interlaced screens. 10) 16 colour mouse pointer. Plus many more... Michael Prince