Home » Archimedes archive » Micro User » MU 1991-07.adf » PD-Stuff » Fractals/!AFGSprite/!Help/Readme
Fractals/!AFGSprite/!Help/Readme
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Micro User » MU 1991-07.adf » PD-Stuff |
Filename: | Fractals/!AFGSprite/!Help/Readme |
Read OK: | ✔ |
File size: | 38A4 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
________________________________________________________________________ / \ | !AFGSprite v1.0: AFG Sprite Editor | | 18 May 1991 | | by Mike Curnow | \________________________________________________________________________/ Introduction ============ !AFGSprite is a utility designed to allow sprites in AFG1 format to be manipulated in ways other than !Paint, and to allow conversion of standard sprites into AFG1 format. The AFG sprite format simply allows the parameters used to create a sprite to be stored within the sprite file - they are totally compatible with standard sprites. Full details on their format is given later. Basic Usage =========== Double click on the !AFGSprite icon to load it onto the icon bar. Then drag a sprite onto the icon bar - only Mode 13 and Mode 15 sprites are accepted. If the sprite is not an AFG sprite, then you are asked for confirmation to convert the sprite to AFG1 format. The full menu options are now available, either from the icon bar or from the sprite window. To view the sprite click select on the icon bar, which will open a full screen window in Mode 15 - this can be changed to Mode 13 to speed up the colour change options. The menu options allow editing of the sprite variables and alteration of the sprite colours, including a fancy animation facility. Full Operation Information ========================== !AFGSprite requires a considerable amount of storage : 64k for itself, twice the sprite size being edited and a Mode 13/15 screen. Note that the sprite storage area is dynamically aquired when required. It also requires the floating point emulator. Automatic Last Display Save --------------------------- All operations which modify the image will save the current display in memory, except for Invert which is self cancelling and Animate which automatically restores the display. The prior image may be recalled by selecting Previous from the menu. Thus you can change the colours to grey or Black and White, then quickly back out to the previous display. To maintain further images use the load and save facilities. The Menu Options ---------------- The menu options are available from the icon bar or from the full screen window. All options except Hide and Animate will work from the icon bar, though obviously you will not see colour effects until you open the window. Pressing Adjust instead of Select will keep the menu open. DATA : Leads to submenus allowing viewing and editing of the variables associated with this sprite. Note that changing these values may render the sprite unusable in the originating program. Program : Displays the program name used to create the sprite. This may be up to 11 characters long. Variables: Shows the program variables including their types which are: I=Integer, F=BASIC floating point, D=ARM double floating point, S=String with a maximum length shown in the L column. Click on the Value field to allow changing of the data. Numbers are accepted in standard BASIC formats. Add : Allows a new variable to be added - click on the variable type. For strings first select the maximum length, allowing +1 for the string terminator (a null byte). Delete : Allows the last variable to be deleted. A warning box is displayed asking for confirmation of the operation - click OK to proceed and CANCEL to abandon. DISPLAY : controls the screen display. Hide : Closes the sprite window. Re-open by selecting the icon bar. Previous : Returns the sprite to the state prior to the last change (not the previous sprite). Mode : Allows switching to Mode 13 or Mode 15 for viewing of the sprite. Mode 13 will speed up colour changes and animation at the expense of a messy menu display. EFFECTS : allows the sprite colours to be altered. These effects are designed primarily for images where colours are assigned from 255 to 0 on a iterative basis, ie. as done in a Mandelbrot calculation. Invert : Inverts the colours used for the display. This can improve looks. Selecting invert again restores the colours. B&W : converts the display to Black & White. This will show how the image will look if printed in monotone. Black is used for even colours and white for odd colours. Grey : converts the display to 12 grey levels, which can produce a better printed image than B&W. Use Invert before grey to change the order of grey tones. Cycle 8 : Adds or subtracts 8 from each colour causing a colour shift. Clicking with Select subtracts, Adjust adds. Cycle 1 : Adds or subtracts 1 from each colour causing a colour shift. Clicking with Select subtracts, Adjust adds. Animate 1 : Simulates animation by continuous cycling of the colour by 1. Use Mode 13 if you do not have an ARM-3 to give a reasonable speed. To change the direction use Invert prior to animation. The mouse buttons whilst in animation operate as follows: Select: pause the animation Menu : end the animation Adjust: re-start after a pause Animation works best on Mandelbrots and Julias where there are spirals of colours - it can be quite an hypnotic effect! Animate 2 : Similar to Animate 1 except the colour 0 (black) is left unchanged which can help to reduce flicker when there are large areas of black on display. The penaly is a slight reduction in speed. Refer to the programming section for information on the technique used. SAVE: Allows the sprite to be saved in the normal RISC OS manner, including all variable and colour changes. Known Limitations ----------------- AFGSprite is only designed to operate with full screen 256 colour sprites. An accuracy loss will occur on type D variables - these are currently processed to type F accuracy. Does anyone have a routine to convert character to ARM double format? This is required to overcome this problem. Programming Note ---------------- AFGSprite is written in a mixture of Basic and Assembler. Most of the Wimp processing is contained within the BASIC library Wimplib. The ARM floating point to character routines and assembler are contained within FPLib. I can supply documentation on their use if you require. The colour cycling and animation routines are the only area of special note. Normally colour cycling is achieved by programming the palette - this is not possible in 256 colour modes since Acorn were too miserly to provide a full 256 colour palette (only 16 colours in fact). To change colours therefore it is necessary to physically update every byte of the screen display (160k in Mode 15). Much is said on the speed of the Archimedes but when you attempt to process a whole screen of data you suddenly realise that it is not that fast after all, and I am lucky enough to have a 30MHz ARM-3! The animation routines sprint along as fast as possible by updating 16 bytes of data in each screen access. Why 16? Firstly the memory chip controller works a bit faster when accessing data on 16 byte boundaries. The other reason is that the memory on the Archimedes is cheap and nasty slow stuff running at 4MHz. What this means is that the processor speed is halved whenever memory access occurs (much more with the ARM-3 unfortunately). Limiting memory accesses therefore allows the processor to operate at full speed as much as possible. The clever bit was working out how to add 1 to each byte of a register without a carry into the next�byte. The animate routine gets around this problem by subtracting by 1 unless the byte is zero, in which case it sets it to 255. Two macros are used to save coding all the routine long hand since we merely do the same process for each byte in 4 registers. As a guide to how good the ARM-3 processor is, it performs the Animate 2 in Mode 15 quicker than an Animate 1 in Mode 13 with a standard 8Mhz ARM. Optimised assembler routines such as this run 5 times faster - the extra speed increase comes from its use of a 4k cache of high speed instruction memory. Once you have tried one you'll find the standard Archie dead slow! AFG Sprite Files ---------------- Saving a screen image (via *Screendump) is the simplest way to preserve a hard won image. One disadvantage is that you need to create a separate record of the parameters required to generate sprite, and how do you remember which program generated what image? To solve this problem I propose the AFG Sprite standard. An AFG sprite is simply a standard sprite file which has embedded control information describing the originating program and parameters. They are compatible with !Paint and !Draw, but are restricted to only one set of control information per sprite file ie. I recommend to store only one sprite per file. AFG Sprite Layout: The following is how the sprite looks in memory. On file the 1st word is omitted. The values are in decimal unless preceded by '&' for hex. Name Offset Len. Function ------------------------------- Size 0 4 Total sprite area length } Standard sprite Number 4 4 Number of sprites } area header Sproff 8 4 Offset to 1st sprite } Freeoff 12 4 Offset to free area } AFGver 16 4 AFG1 ie. &31474641 : identifies an AFG v1 sprite Check this value to verify AFG1 sprites. Pgmname 20 12 Program name and version id, zero terminated string. Check this to determine if the sprite belongs to your program when loading. eg. "Julia v10" Varnum 32 1 number of control variables to follow (may be 0). Varlen 33 1 Variable length in bytes & type. These are: 4=integer 5=Basic floating point 8=Double floating point (Assembler & C) 12=Extended floating point &80+string length=String, zero terminated (not CR). 34..nn 1 Length types of other variables vardata nn n variable data, word aligned .. . Sprhdr ss 44 Sprite header } Standard sprite format sprdata dd nn Sprite data In a non-AFG sprite Sproff contains 16 since there is no additional information. In an AFG sprite Sproff will contain 16+length of AFG control information. Checking AFGver and Pgmname when loading a sprite allows your program to verify an acceptable sprite. Varnum must be set to the number of variables that follow. Variables are identified by their length, or +128 for strings. There will be one or more Varlen fields in contiguous bytes. The variable data itself then follows, each variable starting on a word boundary. Nb. BASIC uses a carriage return (CR) to terminate strings, RiscOS & C uses a zero byte. To store a zero terminated string in BASIC use $x%="String"+CHR$0 and allow for the two extra bytes for the 0 & CR in the length. To retrieve the string use S$=LEFT$($x%) which will strip off the trailing zero byte. The complete code for creating an AFG sprite in BASIC is now given: 10 REM Reserve storage for a Mode 13 sprite (80k) + control info 20 AFGlen=32:Sprlen=80*1024+44+16+AFGlen 30 DIM S% Sprlen 40 REM Initialise the sprite area 50 !S%=Sprlen:S%!8=16+AFGlen 60 SYS "OS_SpriteOp",256+9,S% 70 REM Set up AFG Header 80 $(S%+16)="AFG1" 90 $(S%+20)="Myprog v10"+CHR$0:REM Max 10 chars in name 100 S%?32=2:REM 2 variables in this example 110 S%?33=5:REM 1st variable is a BASIC float 120 S%?34=4:REM 2nd variable is an integer 130 float=2.345:int%=128:REM variables to store 140 |(S%+36)=float:REM Float variable, on word boundary 150 S%!44=int%:REM Integer variable, on word boundary 160 REM Now create a sprite for full screen Mode 13 plotting 170 SYS "OS_SpriteOp",256+15,S%,"MySprite",0,320,256,13 180 REM Set up a variable to allow writing straight to a sprite 190 SprAdr%=S%+16+AFGlen+44 You can now store 256 colour bytes values at SprAdr%?offset - you don't even need to be in mode 13! To complete the program and save the sprite use: SYS "OS_SpriteOp",256+12,S%,"Filename" To load a sprite a similar section of code is required : 10 REM Reserve storage for a Mode 13 sprite (80k) + control info 20 AFGlen=32:Sprlen=80*1024+44+16+AFGlen 30 DIM S% Sprlen 40 REM Initialise the sprite area 50 !S%=Sprlen:S%!8=16+AFGlen 60 SYS "OS_SpriteOp",256+9,S% 70 REM Now load the sprite (Use X version to trap errors) 80 SYS "XOS_SpriteOp",256+10,S%,"Filename" TO Err% 90 IF S%!16<>&31474641 THEN PRINT"Not An AFG1 Sprite":END 100 IF LEFT$($(S%+20))<>"Myprog v10" THEN PRINT"Not My Sprite":END 110 REM Pick up variables from last time 120 float=|(S%+36):int%=S%!44 Phew! Sorry if that was a bit heavy going (which is why I supply the code above), but storing all the relevant information in this way gets around the problem of separate control files. If you are wondering why the number and type of variables is specified, this is for programs that store varying parameters and for !AFGSprite. History ======= v1.00 18/05/91 Initial public version. Final Boring Copywright Notice ============================== The copywright of this material belongs to Mike Curnow except for the !Help application which belongs to J R�ling. This software may be passed on to others as long as NO CHARGES ARE LEVIED except to cover costs. Archimedes Fractal Group (AFG) ============================== This software is part of the Archimedes Fractal Group collection. If you have obtained this software outside of the AFG and would like to find out more about Fractals on the Archimedes, contact me (the AFG administrator) at the address below. Send a SAE and a disk to get a free AFG demo disk. Mike Curnow, 30 Bowen Drive, West Dulwich, London SE21 8PN <<<< MAY THE CHAOS BE WITH YOU! >>>>
00000000 20 20 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f | ______________| 00000010 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f |________________| * 00000040 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 0a 20 2f 20 20 20 |__________. / | 00000050 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000090 20 20 20 20 20 5c 0a 7c 20 20 20 20 20 20 20 20 | \.| | 000000a0 20 20 20 20 20 20 20 20 21 41 46 47 53 70 72 69 | !AFGSpri| 000000b0 74 65 20 76 31 2e 30 3a 20 41 46 47 20 53 70 72 |te v1.0: AFG Spr| 000000c0 69 74 65 20 45 64 69 74 6f 72 20 20 20 20 20 20 |ite Editor | 000000d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000000e0 20 20 7c 0a 7c 20 20 20 20 20 20 20 20 20 20 20 | |.| | 000000f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000100 20 20 20 31 38 20 4d 61 79 20 31 39 39 31 20 20 | 18 May 1991 | 00000110 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c | || 00000130 0a 7c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.| | 00000140 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 79 | by| 00000150 20 4d 69 6b 65 20 43 75 72 6e 6f 77 20 20 20 20 | Mike Curnow | 00000160 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000170 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 20 5c | |. \| 00000180 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f |________________| * 000001c0 5f 5f 5f 5f 5f 5f 5f 5f 2f 20 0a 0a 49 6e 74 72 |________/ ..Intr| 000001d0 6f 64 75 63 74 69 6f 6e 0a 3d 3d 3d 3d 3d 3d 3d |oduction.=======| 000001e0 3d 3d 3d 3d 3d 0a 21 41 46 47 53 70 72 69 74 65 |=====.!AFGSprite| 000001f0 20 69 73 20 61 20 75 74 69 6c 69 74 79 20 64 65 | is a utility de| 00000200 73 69 67 6e 65 64 20 74 6f 20 61 6c 6c 6f 77 20 |signed to allow | 00000210 73 70 72 69 74 65 73 20 69 6e 20 41 46 47 31 20 |sprites in AFG1 | 00000220 66 6f 72 6d 61 74 20 74 6f 20 62 65 0a 6d 61 6e |format to be.man| 00000230 69 70 75 6c 61 74 65 64 20 69 6e 20 77 61 79 73 |ipulated in ways| 00000240 20 6f 74 68 65 72 20 74 68 61 6e 20 21 50 61 69 | other than !Pai| 00000250 6e 74 2c 20 61 6e 64 20 74 6f 20 61 6c 6c 6f 77 |nt, and to allow| 00000260 20 63 6f 6e 76 65 72 73 69 6f 6e 20 6f 66 20 73 | conversion of s| 00000270 74 61 6e 64 61 72 64 0a 73 70 72 69 74 65 73 20 |tandard.sprites | 00000280 69 6e 74 6f 20 41 46 47 31 20 66 6f 72 6d 61 74 |into AFG1 format| 00000290 2e 20 54 68 65 20 41 46 47 20 73 70 72 69 74 65 |. The AFG sprite| 000002a0 20 66 6f 72 6d 61 74 20 73 69 6d 70 6c 79 20 61 | format simply a| 000002b0 6c 6c 6f 77 73 20 74 68 65 20 70 61 72 61 6d 65 |llows the parame| 000002c0 74 65 72 73 0a 75 73 65 64 20 74 6f 20 63 72 65 |ters.used to cre| 000002d0 61 74 65 20 61 20 73 70 72 69 74 65 20 74 6f 20 |ate a sprite to | 000002e0 62 65 20 73 74 6f 72 65 64 20 77 69 74 68 69 6e |be stored within| 000002f0 20 74 68 65 20 73 70 72 69 74 65 20 66 69 6c 65 | the sprite file| 00000300 20 2d 20 74 68 65 79 20 61 72 65 0a 74 6f 74 61 | - they are.tota| 00000310 6c 6c 79 20 63 6f 6d 70 61 74 69 62 6c 65 20 77 |lly compatible w| 00000320 69 74 68 20 73 74 61 6e 64 61 72 64 20 73 70 72 |ith standard spr| 00000330 69 74 65 73 2e 20 46 75 6c 6c 20 64 65 74 61 69 |ites. Full detai| 00000340 6c 73 20 6f 6e 20 74 68 65 69 72 20 66 6f 72 6d |ls on their form| 00000350 61 74 20 69 73 0a 67 69 76 65 6e 20 6c 61 74 65 |at is.given late| 00000360 72 2e 0a 0a 42 61 73 69 63 20 55 73 61 67 65 0a |r...Basic Usage.| 00000370 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 44 6f 75 62 |===========.Doub| 00000380 6c 65 20 63 6c 69 63 6b 20 6f 6e 20 74 68 65 20 |le click on the | 00000390 21 41 46 47 53 70 72 69 74 65 20 69 63 6f 6e 20 |!AFGSprite icon | 000003a0 74 6f 20 6c 6f 61 64 20 69 74 20 6f 6e 74 6f 20 |to load it onto | 000003b0 74 68 65 20 69 63 6f 6e 20 62 61 72 2e 20 54 68 |the icon bar. Th| 000003c0 65 6e 20 64 72 61 67 0a 61 20 73 70 72 69 74 65 |en drag.a sprite| 000003d0 20 6f 6e 74 6f 20 74 68 65 20 69 63 6f 6e 20 62 | onto the icon b| 000003e0 61 72 20 2d 20 6f 6e 6c 79 20 4d 6f 64 65 20 31 |ar - only Mode 1| 000003f0 33 20 61 6e 64 20 4d 6f 64 65 20 31 35 20 73 70 |3 and Mode 15 sp| 00000400 72 69 74 65 73 20 61 72 65 20 61 63 63 65 70 74 |rites are accept| 00000410 65 64 2e 0a 49 66 20 74 68 65 20 73 70 72 69 74 |ed..If the sprit| 00000420 65 20 69 73 20 6e 6f 74 20 61 6e 20 41 46 47 20 |e is not an AFG | 00000430 73 70 72 69 74 65 2c 20 74 68 65 6e 20 79 6f 75 |sprite, then you| 00000440 20 61 72 65 20 61 73 6b 65 64 20 66 6f 72 20 63 | are asked for c| 00000450 6f 6e 66 69 72 6d 61 74 69 6f 6e 20 74 6f 0a 63 |onfirmation to.c| 00000460 6f 6e 76 65 72 74 20 74 68 65 20 73 70 72 69 74 |onvert the sprit| 00000470 65 20 74 6f 20 41 46 47 31 20 66 6f 72 6d 61 74 |e to AFG1 format| 00000480 2e 0a 0a 54 68 65 20 66 75 6c 6c 20 6d 65 6e 75 |...The full menu| 00000490 20 6f 70 74 69 6f 6e 73 20 61 72 65 20 6e 6f 77 | options are now| 000004a0 20 61 76 61 69 6c 61 62 6c 65 2c 20 65 69 74 68 | available, eith| 000004b0 65 72 20 66 72 6f 6d 20 74 68 65 20 69 63 6f 6e |er from the icon| 000004c0 20 62 61 72 20 6f 72 20 66 72 6f 6d 0a 74 68 65 | bar or from.the| 000004d0 20 73 70 72 69 74 65 20 77 69 6e 64 6f 77 2e 20 | sprite window. | 000004e0 54 6f 20 76 69 65 77 20 74 68 65 20 73 70 72 69 |To view the spri| 000004f0 74 65 20 63 6c 69 63 6b 20 73 65 6c 65 63 74 20 |te click select | 00000500 6f 6e 20 74 68 65 20 69 63 6f 6e 20 62 61 72 2c |on the icon bar,| 00000510 20 77 68 69 63 68 0a 77 69 6c 6c 20 6f 70 65 6e | which.will open| 00000520 20 61 20 66 75 6c 6c 20 73 63 72 65 65 6e 20 77 | a full screen w| 00000530 69 6e 64 6f 77 20 69 6e 20 4d 6f 64 65 20 31 35 |indow in Mode 15| 00000540 20 2d 20 74 68 69 73 20 63 61 6e 20 62 65 20 63 | - this can be c| 00000550 68 61 6e 67 65 64 20 74 6f 20 4d 6f 64 65 20 31 |hanged to Mode 1| 00000560 33 0a 74 6f 20 73 70 65 65 64 20 75 70 20 74 68 |3.to speed up th| 00000570 65 20 63 6f 6c 6f 75 72 20 63 68 61 6e 67 65 20 |e colour change | 00000580 6f 70 74 69 6f 6e 73 2e 20 54 68 65 20 6d 65 6e |options. The men| 00000590 75 20 6f 70 74 69 6f 6e 73 20 61 6c 6c 6f 77 20 |u options allow | 000005a0 65 64 69 74 69 6e 67 20 6f 66 20 74 68 65 0a 73 |editing of the.s| 000005b0 70 72 69 74 65 20 76 61 72 69 61 62 6c 65 73 20 |prite variables | 000005c0 61 6e 64 20 61 6c 74 65 72 61 74 69 6f 6e 20 6f |and alteration o| 000005d0 66 20 74 68 65 20 73 70 72 69 74 65 20 63 6f 6c |f the sprite col| 000005e0 6f 75 72 73 2c 20 69 6e 63 6c 75 64 69 6e 67 20 |ours, including | 000005f0 61 20 66 61 6e 63 79 0a 61 6e 69 6d 61 74 69 6f |a fancy.animatio| 00000600 6e 20 66 61 63 69 6c 69 74 79 2e 0a 0a 46 75 6c |n facility...Ful| 00000610 6c 20 4f 70 65 72 61 74 69 6f 6e 20 49 6e 66 6f |l Operation Info| 00000620 72 6d 61 74 69 6f 6e 0a 3d 3d 3d 3d 3d 3d 3d 3d |rmation.========| 00000630 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 00000640 3d 3d 0a 21 41 46 47 53 70 72 69 74 65 20 72 65 |==.!AFGSprite re| 00000650 71 75 69 72 65 73 20 61 20 63 6f 6e 73 69 64 65 |quires a conside| 00000660 72 61 62 6c 65 20 61 6d 6f 75 6e 74 20 6f 66 20 |rable amount of | 00000670 73 74 6f 72 61 67 65 20 3a 20 36 34 6b 20 66 6f |storage : 64k fo| 00000680 72 20 69 74 73 65 6c 66 2c 20 74 77 69 63 65 0a |r itself, twice.| 00000690 74 68 65 20 73 70 72 69 74 65 20 73 69 7a 65 20 |the sprite size | 000006a0 62 65 69 6e 67 20 65 64 69 74 65 64 20 61 6e 64 |being edited and| 000006b0 20 61 20 4d 6f 64 65 20 31 33 2f 31 35 20 73 63 | a Mode 13/15 sc| 000006c0 72 65 65 6e 2e 20 4e 6f 74 65 20 74 68 61 74 20 |reen. Note that | 000006d0 74 68 65 20 73 70 72 69 74 65 0a 73 74 6f 72 61 |the sprite.stora| 000006e0 67 65 20 61 72 65 61 20 69 73 20 64 79 6e 61 6d |ge area is dynam| 000006f0 69 63 61 6c 6c 79 20 61 71 75 69 72 65 64 20 77 |ically aquired w| 00000700 68 65 6e 20 72 65 71 75 69 72 65 64 2e 20 49 74 |hen required. It| 00000710 20 61 6c 73 6f 20 72 65 71 75 69 72 65 73 20 74 | also requires t| 00000720 68 65 0a 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e |he.floating poin| 00000730 74 20 65 6d 75 6c 61 74 6f 72 2e 0a 0a 41 75 74 |t emulator...Aut| 00000740 6f 6d 61 74 69 63 20 4c 61 73 74 20 44 69 73 70 |omatic Last Disp| 00000750 6c 61 79 20 53 61 76 65 0a 2d 2d 2d 2d 2d 2d 2d |lay Save.-------| 00000760 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00000770 2d 2d 2d 2d 0a 41 6c 6c 20 6f 70 65 72 61 74 69 |----.All operati| 00000780 6f 6e 73 20 77 68 69 63 68 20 6d 6f 64 69 66 79 |ons which modify| 00000790 20 74 68 65 20 69 6d 61 67 65 20 77 69 6c 6c 20 | the image will | 000007a0 73 61 76 65 20 74 68 65 20 63 75 72 72 65 6e 74 |save the current| 000007b0 20 64 69 73 70 6c 61 79 20 69 6e 0a 6d 65 6d 6f | display in.memo| 000007c0 72 79 2c 20 65 78 63 65 70 74 20 66 6f 72 20 49 |ry, except for I| 000007d0 6e 76 65 72 74 20 77 68 69 63 68 20 69 73 20 73 |nvert which is s| 000007e0 65 6c 66 20 63 61 6e 63 65 6c 6c 69 6e 67 20 61 |elf cancelling a| 000007f0 6e 64 20 41 6e 69 6d 61 74 65 20 77 68 69 63 68 |nd Animate which| 00000800 0a 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 72 |.automatically r| 00000810 65 73 74 6f 72 65 73 20 74 68 65 20 64 69 73 70 |estores the disp| 00000820 6c 61 79 2e 20 54 68 65 20 70 72 69 6f 72 20 69 |lay. The prior i| 00000830 6d 61 67 65 20 6d 61 79 20 62 65 20 72 65 63 61 |mage may be reca| 00000840 6c 6c 65 64 20 62 79 0a 73 65 6c 65 63 74 69 6e |lled by.selectin| 00000850 67 20 50 72 65 76 69 6f 75 73 20 66 72 6f 6d 20 |g Previous from | 00000860 74 68 65 20 6d 65 6e 75 2e 20 54 68 75 73 20 79 |the menu. Thus y| 00000870 6f 75 20 63 61 6e 20 63 68 61 6e 67 65 20 74 68 |ou can change th| 00000880 65 20 63 6f 6c 6f 75 72 73 20 74 6f 20 67 72 65 |e colours to gre| 00000890 79 20 6f 72 0a 42 6c 61 63 6b 20 61 6e 64 20 57 |y or.Black and W| 000008a0 68 69 74 65 2c 20 74 68 65 6e 20 71 75 69 63 6b |hite, then quick| 000008b0 6c 79 20 62 61 63 6b 20 6f 75 74 20 74 6f 20 74 |ly back out to t| 000008c0 68 65 20 70 72 65 76 69 6f 75 73 20 64 69 73 70 |he previous disp| 000008d0 6c 61 79 2e 20 54 6f 20 6d 61 69 6e 74 61 69 6e |lay. To maintain| 000008e0 0a 66 75 72 74 68 65 72 20 69 6d 61 67 65 73 20 |.further images | 000008f0 75 73 65 20 74 68 65 20 6c 6f 61 64 20 61 6e 64 |use the load and| 00000900 20 73 61 76 65 20 66 61 63 69 6c 69 74 69 65 73 | save facilities| 00000910 2e 0a 0a 54 68 65 20 4d 65 6e 75 20 4f 70 74 69 |...The Menu Opti| 00000920 6f 6e 73 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |ons.------------| 00000930 2d 2d 2d 2d 0a 54 68 65 20 6d 65 6e 75 20 6f 70 |----.The menu op| 00000940 74 69 6f 6e 73 20 61 72 65 20 61 76 61 69 6c 61 |tions are availa| 00000950 62 6c 65 20 66 72 6f 6d 20 74 68 65 20 69 63 6f |ble from the ico| 00000960 6e 20 62 61 72 20 6f 72 20 66 72 6f 6d 20 74 68 |n bar or from th| 00000970 65 20 66 75 6c 6c 20 73 63 72 65 65 6e 0a 77 69 |e full screen.wi| 00000980 6e 64 6f 77 2e 20 41 6c 6c 20 6f 70 74 69 6f 6e |ndow. All option| 00000990 73 20 65 78 63 65 70 74 20 48 69 64 65 20 61 6e |s except Hide an| 000009a0 64 20 41 6e 69 6d 61 74 65 20 77 69 6c 6c 20 77 |d Animate will w| 000009b0 6f 72 6b 20 66 72 6f 6d 20 74 68 65 20 69 63 6f |ork from the ico| 000009c0 6e 20 62 61 72 2c 0a 74 68 6f 75 67 68 20 6f 62 |n bar,.though ob| 000009d0 76 69 6f 75 73 6c 79 20 79 6f 75 20 77 69 6c 6c |viously you will| 000009e0 20 6e 6f 74 20 73 65 65 20 63 6f 6c 6f 75 72 20 | not see colour | 000009f0 65 66 66 65 63 74 73 20 75 6e 74 69 6c 20 79 6f |effects until yo| 00000a00 75 20 6f 70 65 6e 20 74 68 65 20 77 69 6e 64 6f |u open the windo| 00000a10 77 2e 0a 50 72 65 73 73 69 6e 67 20 41 64 6a 75 |w..Pressing Adju| 00000a20 73 74 20 69 6e 73 74 65 61 64 20 6f 66 20 53 65 |st instead of Se| 00000a30 6c 65 63 74 20 77 69 6c 6c 20 6b 65 65 70 20 74 |lect will keep t| 00000a40 68 65 20 6d 65 6e 75 20 6f 70 65 6e 2e 0a 0a 44 |he menu open...D| 00000a50 41 54 41 20 3a 20 4c 65 61 64 73 20 74 6f 20 73 |ATA : Leads to s| 00000a60 75 62 6d 65 6e 75 73 20 61 6c 6c 6f 77 69 6e 67 |ubmenus allowing| 00000a70 20 76 69 65 77 69 6e 67 20 61 6e 64 20 65 64 69 | viewing and edi| 00000a80 74 69 6e 67 20 6f 66 20 74 68 65 20 76 61 72 69 |ting of the vari| 00000a90 61 62 6c 65 73 0a 61 73 73 6f 63 69 61 74 65 64 |ables.associated| 00000aa0 20 77 69 74 68 20 74 68 69 73 20 73 70 72 69 74 | with this sprit| 00000ab0 65 2e 20 4e 6f 74 65 20 74 68 61 74 20 63 68 61 |e. Note that cha| 00000ac0 6e 67 69 6e 67 20 74 68 65 73 65 20 76 61 6c 75 |nging these valu| 00000ad0 65 73 20 6d 61 79 20 72 65 6e 64 65 72 20 74 68 |es may render th| 00000ae0 65 0a 73 70 72 69 74 65 20 75 6e 75 73 61 62 6c |e.sprite unusabl| 00000af0 65 20 69 6e 20 74 68 65 20 6f 72 69 67 69 6e 61 |e in the origina| 00000b00 74 69 6e 67 20 70 72 6f 67 72 61 6d 2e 0a 0a 20 |ting program... | 00000b10 20 50 72 6f 67 72 61 6d 20 20 3a 20 44 69 73 70 | Program : Disp| 00000b20 6c 61 79 73 20 74 68 65 20 70 72 6f 67 72 61 6d |lays the program| 00000b30 20 6e 61 6d 65 20 75 73 65 64 20 74 6f 20 63 72 | name used to cr| 00000b40 65 61 74 65 20 74 68 65 20 73 70 72 69 74 65 2e |eate the sprite.| 00000b50 20 54 68 69 73 20 6d 61 79 0a 20 20 20 20 20 20 | This may. | 00000b60 20 20 20 20 20 20 20 62 65 20 75 70 20 74 6f 20 | be up to | 00000b70 31 31 20 63 68 61 72 61 63 74 65 72 73 20 6c 6f |11 characters lo| 00000b80 6e 67 2e 0a 20 20 56 61 72 69 61 62 6c 65 73 3a |ng.. Variables:| 00000b90 20 53 68 6f 77 73 20 74 68 65 20 70 72 6f 67 72 | Shows the progr| 00000ba0 61 6d 20 76 61 72 69 61 62 6c 65 73 20 69 6e 63 |am variables inc| 00000bb0 6c 75 64 69 6e 67 20 74 68 65 69 72 20 74 79 70 |luding their typ| 00000bc0 65 73 20 77 68 69 63 68 20 61 72 65 3a 0a 20 20 |es which are:. | 00000bd0 20 20 20 20 20 20 20 20 20 20 20 49 3d 49 6e 74 | I=Int| 00000be0 65 67 65 72 2c 20 46 3d 42 41 53 49 43 20 66 6c |eger, F=BASIC fl| 00000bf0 6f 61 74 69 6e 67 20 70 6f 69 6e 74 2c 20 44 3d |oating point, D=| 00000c00 41 52 4d 20 64 6f 75 62 6c 65 20 66 6c 6f 61 74 |ARM double float| 00000c10 69 6e 67 20 70 6f 69 6e 74 2c 0a 20 20 20 20 20 |ing point,. | 00000c20 20 20 20 20 20 20 20 20 53 3d 53 74 72 69 6e 67 | S=String| 00000c30 20 77 69 74 68 20 61 20 6d 61 78 69 6d 75 6d 20 | with a maximum | 00000c40 6c 65 6e 67 74 68 20 73 68 6f 77 6e 20 69 6e 20 |length shown in | 00000c50 74 68 65 20 4c 20 63 6f 6c 75 6d 6e 2e 0a 20 20 |the L column.. | 00000c60 20 20 20 20 20 20 20 20 20 20 20 43 6c 69 63 6b | Click| 00000c70 20 6f 6e 20 74 68 65 20 56 61 6c 75 65 20 66 69 | on the Value fi| 00000c80 65 6c 64 20 74 6f 20 61 6c 6c 6f 77 20 63 68 61 |eld to allow cha| 00000c90 6e 67 69 6e 67 20 6f 66 20 74 68 65 20 64 61 74 |nging of the dat| 00000ca0 61 2e 20 4e 75 6d 62 65 72 73 0a 20 20 20 20 20 |a. Numbers. | 00000cb0 20 20 20 20 20 20 20 20 61 72 65 20 61 63 63 65 | are acce| 00000cc0 70 74 65 64 20 69 6e 20 73 74 61 6e 64 61 72 64 |pted in standard| 00000cd0 20 42 41 53 49 43 20 66 6f 72 6d 61 74 73 2e 20 | BASIC formats. | 00000ce0 0a 20 20 41 64 64 20 20 20 20 20 20 3a 20 41 6c |. Add : Al| 00000cf0 6c 6f 77 73 20 61 20 6e 65 77 20 76 61 72 69 61 |lows a new varia| 00000d00 62 6c 65 20 74 6f 20 62 65 20 61 64 64 65 64 20 |ble to be added | 00000d10 2d 20 63 6c 69 63 6b 20 6f 6e 20 74 68 65 20 76 |- click on the v| 00000d20 61 72 69 61 62 6c 65 20 74 79 70 65 2e 0a 20 20 |ariable type.. | 00000d30 20 20 20 20 20 20 20 20 20 20 20 46 6f 72 20 73 | For s| 00000d40 74 72 69 6e 67 73 20 66 69 72 73 74 20 73 65 6c |trings first sel| 00000d50 65 63 74 20 74 68 65 20 6d 61 78 69 6d 75 6d 20 |ect the maximum | 00000d60 6c 65 6e 67 74 68 2c 20 61 6c 6c 6f 77 69 6e 67 |length, allowing| 00000d70 20 2b 31 20 66 6f 72 0a 20 20 20 20 20 20 20 20 | +1 for. | 00000d80 20 20 20 20 20 74 68 65 20 73 74 72 69 6e 67 20 | the string | 00000d90 74 65 72 6d 69 6e 61 74 6f 72 20 28 61 20 6e 75 |terminator (a nu| 00000da0 6c 6c 20 62 79 74 65 29 2e 0a 20 20 44 65 6c 65 |ll byte).. Dele| 00000db0 74 65 20 20 20 3a 20 41 6c 6c 6f 77 73 20 74 68 |te : Allows th| 00000dc0 65 20 6c 61 73 74 20 76 61 72 69 61 62 6c 65 20 |e last variable | 00000dd0 74 6f 20 62 65 20 64 65 6c 65 74 65 64 2e 20 41 |to be deleted. A| 00000de0 20 77 61 72 6e 69 6e 67 20 62 6f 78 20 69 73 0a | warning box is.| 00000df0 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 | dis| 00000e00 70 6c 61 79 65 64 20 61 73 6b 69 6e 67 20 66 6f |played asking fo| 00000e10 72 20 63 6f 6e 66 69 72 6d 61 74 69 6f 6e 20 6f |r confirmation o| 00000e20 66 20 74 68 65 20 6f 70 65 72 61 74 69 6f 6e 20 |f the operation | 00000e30 2d 20 63 6c 69 63 6b 20 4f 4b 0a 20 20 20 20 20 |- click OK. | 00000e40 20 20 20 20 20 20 20 20 74 6f 20 70 72 6f 63 65 | to proce| 00000e50 65 64 20 61 6e 64 20 43 41 4e 43 45 4c 20 74 6f |ed and CANCEL to| 00000e60 20 61 62 61 6e 64 6f 6e 2e 0a 0a 44 49 53 50 4c | abandon...DISPL| 00000e70 41 59 20 3a 20 63 6f 6e 74 72 6f 6c 73 20 74 68 |AY : controls th| 00000e80 65 20 73 63 72 65 65 6e 20 64 69 73 70 6c 61 79 |e screen display| 00000e90 2e 0a 20 20 48 69 64 65 20 20 20 20 20 3a 20 43 |.. Hide : C| 00000ea0 6c 6f 73 65 73 20 74 68 65 20 73 70 72 69 74 65 |loses the sprite| 00000eb0 20 77 69 6e 64 6f 77 2e 20 52 65 2d 6f 70 65 6e | window. Re-open| 00000ec0 20 62 79 20 73 65 6c 65 63 74 69 6e 67 20 74 68 | by selecting th| 00000ed0 65 20 69 63 6f 6e 20 62 61 72 2e 0a 20 20 50 72 |e icon bar.. Pr| 00000ee0 65 76 69 6f 75 73 20 3a 20 52 65 74 75 72 6e 73 |evious : Returns| 00000ef0 20 74 68 65 20 73 70 72 69 74 65 20 74 6f 20 74 | the sprite to t| 00000f00 68 65 20 73 74 61 74 65 20 70 72 69 6f 72 20 74 |he state prior t| 00000f10 6f 20 74 68 65 20 6c 61 73 74 20 63 68 61 6e 67 |o the last chang| 00000f20 65 20 28 6e 6f 74 0a 20 20 20 20 20 20 20 20 20 |e (not. | 00000f30 20 20 20 20 74 68 65 20 70 72 65 76 69 6f 75 73 | the previous| 00000f40 20 73 70 72 69 74 65 29 2e 0a 20 20 4d 6f 64 65 | sprite).. Mode| 00000f50 20 20 20 20 20 3a 20 41 6c 6c 6f 77 73 20 73 77 | : Allows sw| 00000f60 69 74 63 68 69 6e 67 20 74 6f 20 4d 6f 64 65 20 |itching to Mode | 00000f70 31 33 20 6f 72 20 4d 6f 64 65 20 31 35 20 66 6f |13 or Mode 15 fo| 00000f80 72 20 76 69 65 77 69 6e 67 20 6f 66 20 74 68 65 |r viewing of the| 00000f90 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 73 70 |. sp| 00000fa0 72 69 74 65 2e 20 4d 6f 64 65 20 31 33 20 77 69 |rite. Mode 13 wi| 00000fb0 6c 6c 20 73 70 65 65 64 20 75 70 20 63 6f 6c 6f |ll speed up colo| 00000fc0 75 72 20 63 68 61 6e 67 65 73 20 61 6e 64 20 61 |ur changes and a| 00000fd0 6e 69 6d 61 74 69 6f 6e 20 61 74 0a 20 20 20 20 |nimation at. | 00000fe0 20 20 20 20 20 20 20 20 20 74 68 65 20 65 78 70 | the exp| 00000ff0 65 6e 73 65 20 6f 66 20 61 20 6d 65 73 73 79 20 |ense of a messy | 00001000 6d 65 6e 75 20 64 69 73 70 6c 61 79 2e 0a 0a 45 |menu display...E| 00001010 46 46 45 43 54 53 20 3a 20 61 6c 6c 6f 77 73 20 |FFECTS : allows | 00001020 74 68 65 20 73 70 72 69 74 65 20 63 6f 6c 6f 75 |the sprite colou| 00001030 72 73 20 74 6f 20 62 65 20 61 6c 74 65 72 65 64 |rs to be altered| 00001040 2e 20 54 68 65 73 65 20 65 66 66 65 63 74 73 20 |. These effects | 00001050 61 72 65 0a 64 65 73 69 67 6e 65 64 20 70 72 69 |are.designed pri| 00001060 6d 61 72 69 6c 79 20 66 6f 72 20 69 6d 61 67 65 |marily for image| 00001070 73 20 77 68 65 72 65 20 63 6f 6c 6f 75 72 73 20 |s where colours | 00001080 61 72 65 20 61 73 73 69 67 6e 65 64 20 66 72 6f |are assigned fro| 00001090 6d 20 32 35 35 20 74 6f 20 30 20 6f 6e 20 61 0a |m 255 to 0 on a.| 000010a0 69 74 65 72 61 74 69 76 65 20 62 61 73 69 73 2c |iterative basis,| 000010b0 20 69 65 2e 20 61 73 20 64 6f 6e 65 20 69 6e 20 | ie. as done in | 000010c0 61 20 4d 61 6e 64 65 6c 62 72 6f 74 20 63 61 6c |a Mandelbrot cal| 000010d0 63 75 6c 61 74 69 6f 6e 2e 0a 20 20 49 6e 76 65 |culation.. Inve| 000010e0 72 74 20 20 20 20 3a 20 49 6e 76 65 72 74 73 20 |rt : Inverts | 000010f0 74 68 65 20 63 6f 6c 6f 75 72 73 20 75 73 65 64 |the colours used| 00001100 20 66 6f 72 20 74 68 65 20 64 69 73 70 6c 61 79 | for the display| 00001110 2e 20 54 68 69 73 20 63 61 6e 20 69 6d 70 72 6f |. This can impro| 00001120 76 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |ve. | 00001130 20 6c 6f 6f 6b 73 2e 20 53 65 6c 65 63 74 69 6e | looks. Selectin| 00001140 67 20 69 6e 76 65 72 74 20 61 67 61 69 6e 20 72 |g invert again r| 00001150 65 73 74 6f 72 65 73 20 74 68 65 20 63 6f 6c 6f |estores the colo| 00001160 75 72 73 2e 0a 20 20 42 26 57 20 20 20 20 20 20 |urs.. B&W | 00001170 20 3a 20 63 6f 6e 76 65 72 74 73 20 74 68 65 20 | : converts the | 00001180 64 69 73 70 6c 61 79 20 74 6f 20 42 6c 61 63 6b |display to Black| 00001190 20 26 20 57 68 69 74 65 2e 20 54 68 69 73 20 77 | & White. This w| 000011a0 69 6c 6c 20 73 68 6f 77 20 68 6f 77 20 74 68 65 |ill show how the| 000011b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 |. i| 000011c0 6d 61 67 65 20 77 69 6c 6c 20 6c 6f 6f 6b 20 69 |mage will look i| 000011d0 66 20 70 72 69 6e 74 65 64 20 69 6e 20 6d 6f 6e |f printed in mon| 000011e0 6f 74 6f 6e 65 2e 20 42 6c 61 63 6b 20 69 73 20 |otone. Black is | 000011f0 75 73 65 64 20 66 6f 72 20 65 76 65 6e 0a 20 20 |used for even. | 00001200 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6c 6f | colo| 00001210 75 72 73 20 61 6e 64 20 77 68 69 74 65 20 66 6f |urs and white fo| 00001220 72 20 6f 64 64 20 63 6f 6c 6f 75 72 73 2e 0a 20 |r odd colours.. | 00001230 20 47 72 65 79 20 20 20 20 20 20 3a 20 63 6f 6e | Grey : con| 00001240 76 65 72 74 73 20 74 68 65 20 64 69 73 70 6c 61 |verts the displa| 00001250 79 20 74 6f 20 31 32 20 67 72 65 79 20 6c 65 76 |y to 12 grey lev| 00001260 65 6c 73 2c 20 77 68 69 63 68 20 63 61 6e 20 70 |els, which can p| 00001270 72 6f 64 75 63 65 20 61 0a 20 20 20 20 20 20 20 |roduce a. | 00001280 20 20 20 20 20 20 20 62 65 74 74 65 72 20 70 72 | better pr| 00001290 69 6e 74 65 64 20 69 6d 61 67 65 20 74 68 61 6e |inted image than| 000012a0 20 42 26 57 2e 20 55 73 65 20 49 6e 76 65 72 74 | B&W. Use Invert| 000012b0 20 62 65 66 6f 72 65 20 67 72 65 79 20 74 6f 0a | before grey to.| 000012c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 | ch| 000012d0 61 6e 67 65 20 74 68 65 20 6f 72 64 65 72 20 6f |ange the order o| 000012e0 66 20 67 72 65 79 20 74 6f 6e 65 73 2e 0a 20 20 |f grey tones.. | 000012f0 43 79 63 6c 65 20 38 20 20 20 3a 20 41 64 64 73 |Cycle 8 : Adds| 00001300 20 6f 72 20 73 75 62 74 72 61 63 74 73 20 38 20 | or subtracts 8 | 00001310 66 72 6f 6d 20 65 61 63 68 20 63 6f 6c 6f 75 72 |from each colour| 00001320 20 63 61 75 73 69 6e 67 20 61 20 63 6f 6c 6f 75 | causing a colou| 00001330 72 20 73 68 69 66 74 2e 0a 20 20 20 20 20 20 20 |r shift.. | 00001340 20 20 20 20 20 20 20 43 6c 69 63 6b 69 6e 67 20 | Clicking | 00001350 77 69 74 68 20 53 65 6c 65 63 74 20 73 75 62 74 |with Select subt| 00001360 72 61 63 74 73 2c 20 41 64 6a 75 73 74 20 61 64 |racts, Adjust ad| 00001370 64 73 2e 0a 20 20 43 79 63 6c 65 20 31 20 20 20 |ds.. Cycle 1 | 00001380 3a 20 41 64 64 73 20 6f 72 20 73 75 62 74 72 61 |: Adds or subtra| 00001390 63 74 73 20 31 20 66 72 6f 6d 20 65 61 63 68 20 |cts 1 from each | 000013a0 63 6f 6c 6f 75 72 20 63 61 75 73 69 6e 67 20 61 |colour causing a| 000013b0 20 63 6f 6c 6f 75 72 20 73 68 69 66 74 2e 0a 20 | colour shift.. | 000013c0 20 20 20 20 20 20 20 20 20 20 20 20 20 43 6c 69 | Cli| 000013d0 63 6b 69 6e 67 20 77 69 74 68 20 53 65 6c 65 63 |cking with Selec| 000013e0 74 20 73 75 62 74 72 61 63 74 73 2c 20 41 64 6a |t subtracts, Adj| 000013f0 75 73 74 20 61 64 64 73 2e 0a 20 20 41 6e 69 6d |ust adds.. Anim| 00001400 61 74 65 20 31 20 3a 20 53 69 6d 75 6c 61 74 65 |ate 1 : Simulate| 00001410 73 20 61 6e 69 6d 61 74 69 6f 6e 20 62 79 20 63 |s animation by c| 00001420 6f 6e 74 69 6e 75 6f 75 73 20 63 79 63 6c 69 6e |ontinuous cyclin| 00001430 67 20 6f 66 20 74 68 65 20 63 6f 6c 6f 75 72 20 |g of the colour | 00001440 62 79 20 31 2e 0a 20 20 20 20 20 20 20 20 20 20 |by 1.. | 00001450 20 20 20 20 55 73 65 20 4d 6f 64 65 20 31 33 20 | Use Mode 13 | 00001460 69 66 20 79 6f 75 20 64 6f 20 6e 6f 74 20 68 61 |if you do not ha| 00001470 76 65 20 61 6e 20 41 52 4d 2d 33 20 74 6f 20 67 |ve an ARM-3 to g| 00001480 69 76 65 20 61 20 72 65 61 73 6f 6e 61 62 6c 65 |ive a reasonable| 00001490 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 |. s| 000014a0 70 65 65 64 2e 20 54 6f 20 63 68 61 6e 67 65 20 |peed. To change | 000014b0 74 68 65 20 64 69 72 65 63 74 69 6f 6e 20 75 73 |the direction us| 000014c0 65 20 49 6e 76 65 72 74 20 70 72 69 6f 72 20 74 |e Invert prior t| 000014d0 6f 20 61 6e 69 6d 61 74 69 6f 6e 2e 0a 20 20 20 |o animation.. | 000014e0 20 20 20 20 20 20 20 20 20 20 20 54 68 65 20 6d | The m| 000014f0 6f 75 73 65 20 62 75 74 74 6f 6e 73 20 77 68 69 |ouse buttons whi| 00001500 6c 73 74 20 69 6e 20 61 6e 69 6d 61 74 69 6f 6e |lst in animation| 00001510 20 6f 70 65 72 61 74 65 20 61 73 20 66 6f 6c 6c | operate as foll| 00001520 6f 77 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 |ows:. | 00001530 20 20 20 20 20 53 65 6c 65 63 74 3a 20 70 61 75 | Select: pau| 00001540 73 65 20 74 68 65 20 61 6e 69 6d 61 74 69 6f 6e |se the animation| 00001550 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00001560 20 4d 65 6e 75 20 20 3a 20 65 6e 64 20 74 68 65 | Menu : end the| 00001570 20 61 6e 69 6d 61 74 69 6f 6e 0a 20 20 20 20 20 | animation. | 00001580 20 20 20 20 20 20 20 20 20 20 20 41 64 6a 75 73 | Adjus| 00001590 74 3a 20 72 65 2d 73 74 61 72 74 20 61 66 74 65 |t: re-start afte| 000015a0 72 20 61 20 70 61 75 73 65 0a 20 20 20 20 20 20 |r a pause. | 000015b0 20 20 20 20 20 20 20 20 41 6e 69 6d 61 74 69 6f | Animatio| 000015c0 6e 20 77 6f 72 6b 73 20 62 65 73 74 20 6f 6e 20 |n works best on | 000015d0 4d 61 6e 64 65 6c 62 72 6f 74 73 20 61 6e 64 20 |Mandelbrots and | 000015e0 4a 75 6c 69 61 73 20 77 68 65 72 65 20 74 68 65 |Julias where the| 000015f0 72 65 20 61 72 65 0a 20 20 20 20 20 20 20 20 20 |re are. | 00001600 20 20 20 20 20 73 70 69 72 61 6c 73 20 6f 66 20 | spirals of | 00001610 63 6f 6c 6f 75 72 73 20 2d 20 69 74 20 63 61 6e |colours - it can| 00001620 20 62 65 20 71 75 69 74 65 20 61 6e 20 68 79 70 | be quite an hyp| 00001630 6e 6f 74 69 63 20 65 66 66 65 63 74 21 0a 20 20 |notic effect!. | 00001640 41 6e 69 6d 61 74 65 20 32 20 3a 20 53 69 6d 69 |Animate 2 : Simi| 00001650 6c 61 72 20 74 6f 20 41 6e 69 6d 61 74 65 20 31 |lar to Animate 1| 00001660 20 65 78 63 65 70 74 20 74 68 65 20 63 6f 6c 6f | except the colo| 00001670 75 72 20 30 20 28 62 6c 61 63 6b 29 20 69 73 20 |ur 0 (black) is | 00001680 6c 65 66 74 0a 20 20 20 20 20 20 20 20 20 20 20 |left. | 00001690 20 20 20 75 6e 63 68 61 6e 67 65 64 20 77 68 69 | unchanged whi| 000016a0 63 68 20 63 61 6e 20 68 65 6c 70 20 74 6f 20 72 |ch can help to r| 000016b0 65 64 75 63 65 20 66 6c 69 63 6b 65 72 20 77 68 |educe flicker wh| 000016c0 65 6e 20 74 68 65 72 65 20 61 72 65 20 6c 61 72 |en there are lar| 000016d0 67 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |ge. | 000016e0 20 61 72 65 61 73 20 6f 66 20 62 6c 61 63 6b 20 | areas of black | 000016f0 6f 6e 20 64 69 73 70 6c 61 79 2e 20 54 68 65 20 |on display. The | 00001700 70 65 6e 61 6c 79 20 69 73 20 61 20 73 6c 69 67 |penaly is a slig| 00001710 68 74 20 72 65 64 75 63 74 69 6f 6e 20 69 6e 0a |ht reduction in.| 00001720 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 70 | sp| 00001730 65 65 64 2e 20 52 65 66 65 72 20 74 6f 20 74 68 |eed. Refer to th| 00001740 65 20 70 72 6f 67 72 61 6d 6d 69 6e 67 20 73 65 |e programming se| 00001750 63 74 69 6f 6e 20 66 6f 72 20 69 6e 66 6f 72 6d |ction for inform| 00001760 61 74 69 6f 6e 20 6f 6e 20 74 68 65 0a 20 20 20 |ation on the. | 00001770 20 20 20 20 20 20 20 20 20 20 20 74 65 63 68 6e | techn| 00001780 69 71 75 65 20 75 73 65 64 2e 0a 0a 53 41 56 45 |ique used...SAVE| 00001790 3a 20 41 6c 6c 6f 77 73 20 74 68 65 20 73 70 72 |: Allows the spr| 000017a0 69 74 65 20 74 6f 20 62 65 20 73 61 76 65 64 20 |ite to be saved | 000017b0 69 6e 20 74 68 65 20 6e 6f 72 6d 61 6c 20 52 49 |in the normal RI| 000017c0 53 43 20 4f 53 20 6d 61 6e 6e 65 72 2c 20 69 6e |SC OS manner, in| 000017d0 63 6c 75 64 69 6e 67 0a 61 6c 6c 20 76 61 72 69 |cluding.all vari| 000017e0 61 62 6c 65 20 61 6e 64 20 63 6f 6c 6f 75 72 20 |able and colour | 000017f0 63 68 61 6e 67 65 73 2e 0a 0a 4b 6e 6f 77 6e 20 |changes...Known | 00001800 4c 69 6d 69 74 61 74 69 6f 6e 73 0a 2d 2d 2d 2d |Limitations.----| 00001810 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 41 46 |-------------.AF| 00001820 47 53 70 72 69 74 65 20 69 73 20 6f 6e 6c 79 20 |GSprite is only | 00001830 64 65 73 69 67 6e 65 64 20 74 6f 20 6f 70 65 72 |designed to oper| 00001840 61 74 65 20 77 69 74 68 20 66 75 6c 6c 20 73 63 |ate with full sc| 00001850 72 65 65 6e 20 32 35 36 20 63 6f 6c 6f 75 72 20 |reen 256 colour | 00001860 73 70 72 69 74 65 73 2e 0a 41 6e 20 61 63 63 75 |sprites..An accu| 00001870 72 61 63 79 20 6c 6f 73 73 20 77 69 6c 6c 20 6f |racy loss will o| 00001880 63 63 75 72 20 6f 6e 20 74 79 70 65 20 44 20 76 |ccur on type D v| 00001890 61 72 69 61 62 6c 65 73 20 2d 20 74 68 65 73 65 |ariables - these| 000018a0 20 61 72 65 20 63 75 72 72 65 6e 74 6c 79 0a 70 | are currently.p| 000018b0 72 6f 63 65 73 73 65 64 20 74 6f 20 74 79 70 65 |rocessed to type| 000018c0 20 46 20 61 63 63 75 72 61 63 79 2e 20 44 6f 65 | F accuracy. Doe| 000018d0 73 20 61 6e 79 6f 6e 65 20 68 61 76 65 20 61 20 |s anyone have a | 000018e0 72 6f 75 74 69 6e 65 20 74 6f 20 63 6f 6e 76 65 |routine to conve| 000018f0 72 74 0a 63 68 61 72 61 63 74 65 72 20 74 6f 20 |rt.character to | 00001900 41 52 4d 20 64 6f 75 62 6c 65 20 66 6f 72 6d 61 |ARM double forma| 00001910 74 3f 20 54 68 69 73 20 69 73 20 72 65 71 75 69 |t? This is requi| 00001920 72 65 64 20 74 6f 20 6f 76 65 72 63 6f 6d 65 20 |red to overcome | 00001930 74 68 69 73 20 70 72 6f 62 6c 65 6d 2e 0a 0a 50 |this problem...P| 00001940 72 6f 67 72 61 6d 6d 69 6e 67 20 4e 6f 74 65 0a |rogramming Note.| 00001950 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001960 0a 41 46 47 53 70 72 69 74 65 20 69 73 20 77 72 |.AFGSprite is wr| 00001970 69 74 74 65 6e 20 69 6e 20 61 20 6d 69 78 74 75 |itten in a mixtu| 00001980 72 65 20 6f 66 20 42 61 73 69 63 20 61 6e 64 20 |re of Basic and | 00001990 41 73 73 65 6d 62 6c 65 72 2e 20 4d 6f 73 74 20 |Assembler. Most | 000019a0 6f 66 20 74 68 65 20 57 69 6d 70 0a 70 72 6f 63 |of the Wimp.proc| 000019b0 65 73 73 69 6e 67 20 69 73 20 63 6f 6e 74 61 69 |essing is contai| 000019c0 6e 65 64 20 77 69 74 68 69 6e 20 74 68 65 20 42 |ned within the B| 000019d0 41 53 49 43 20 6c 69 62 72 61 72 79 20 57 69 6d |ASIC library Wim| 000019e0 70 6c 69 62 2e 20 54 68 65 20 41 52 4d 20 66 6c |plib. The ARM fl| 000019f0 6f 61 74 69 6e 67 0a 70 6f 69 6e 74 20 74 6f 20 |oating.point to | 00001a00 63 68 61 72 61 63 74 65 72 20 72 6f 75 74 69 6e |character routin| 00001a10 65 73 20 61 6e 64 20 61 73 73 65 6d 62 6c 65 72 |es and assembler| 00001a20 20 61 72 65 20 63 6f 6e 74 61 69 6e 65 64 20 77 | are contained w| 00001a30 69 74 68 69 6e 20 46 50 4c 69 62 2e 20 49 20 63 |ithin FPLib. I c| 00001a40 61 6e 0a 73 75 70 70 6c 79 20 64 6f 63 75 6d 65 |an.supply docume| 00001a50 6e 74 61 74 69 6f 6e 20 6f 6e 20 74 68 65 69 72 |ntation on their| 00001a60 20 75 73 65 20 69 66 20 79 6f 75 20 72 65 71 75 | use if you requ| 00001a70 69 72 65 2e 0a 0a 54 68 65 20 63 6f 6c 6f 75 72 |ire...The colour| 00001a80 20 63 79 63 6c 69 6e 67 20 61 6e 64 20 61 6e 69 | cycling and ani| 00001a90 6d 61 74 69 6f 6e 20 72 6f 75 74 69 6e 65 73 20 |mation routines | 00001aa0 61 72 65 20 74 68 65 20 6f 6e 6c 79 20 61 72 65 |are the only are| 00001ab0 61 20 6f 66 20 73 70 65 63 69 61 6c 20 6e 6f 74 |a of special not| 00001ac0 65 2e 0a 4e 6f 72 6d 61 6c 6c 79 20 63 6f 6c 6f |e..Normally colo| 00001ad0 75 72 20 63 79 63 6c 69 6e 67 20 69 73 20 61 63 |ur cycling is ac| 00001ae0 68 69 65 76 65 64 20 62 79 20 70 72 6f 67 72 61 |hieved by progra| 00001af0 6d 6d 69 6e 67 20 74 68 65 20 70 61 6c 65 74 74 |mming the palett| 00001b00 65 20 2d 20 74 68 69 73 20 69 73 20 6e 6f 74 0a |e - this is not.| 00001b10 70 6f 73 73 69 62 6c 65 20 69 6e 20 32 35 36 20 |possible in 256 | 00001b20 63 6f 6c 6f 75 72 20 6d 6f 64 65 73 20 73 69 6e |colour modes sin| 00001b30 63 65 20 41 63 6f 72 6e 20 77 65 72 65 20 74 6f |ce Acorn were to| 00001b40 6f 20 6d 69 73 65 72 6c 79 20 74 6f 20 70 72 6f |o miserly to pro| 00001b50 76 69 64 65 20 61 20 66 75 6c 6c 0a 32 35 36 20 |vide a full.256 | 00001b60 63 6f 6c 6f 75 72 20 70 61 6c 65 74 74 65 20 28 |colour palette (| 00001b70 6f 6e 6c 79 20 31 36 20 63 6f 6c 6f 75 72 73 20 |only 16 colours | 00001b80 69 6e 20 66 61 63 74 29 2e 20 54 6f 20 63 68 61 |in fact). To cha| 00001b90 6e 67 65 20 63 6f 6c 6f 75 72 73 20 74 68 65 72 |nge colours ther| 00001ba0 65 66 6f 72 65 20 69 74 0a 69 73 20 6e 65 63 65 |efore it.is nece| 00001bb0 73 73 61 72 79 20 74 6f 20 70 68 79 73 69 63 61 |ssary to physica| 00001bc0 6c 6c 79 20 75 70 64 61 74 65 20 65 76 65 72 79 |lly update every| 00001bd0 20 62 79 74 65 20 6f 66 20 74 68 65 20 73 63 72 | byte of the scr| 00001be0 65 65 6e 20 64 69 73 70 6c 61 79 20 28 31 36 30 |een display (160| 00001bf0 6b 20 69 6e 0a 4d 6f 64 65 20 31 35 29 2e 0a 0a |k in.Mode 15)...| 00001c00 4d 75 63 68 20 69 73 20 73 61 69 64 20 6f 6e 20 |Much is said on | 00001c10 74 68 65 20 73 70 65 65 64 20 6f 66 20 74 68 65 |the speed of the| 00001c20 20 41 72 63 68 69 6d 65 64 65 73 20 62 75 74 20 | Archimedes but | 00001c30 77 68 65 6e 20 79 6f 75 20 61 74 74 65 6d 70 74 |when you attempt| 00001c40 20 74 6f 20 70 72 6f 63 65 73 73 0a 61 20 77 68 | to process.a wh| 00001c50 6f 6c 65 20 73 63 72 65 65 6e 20 6f 66 20 64 61 |ole screen of da| 00001c60 74 61 20 79 6f 75 20 73 75 64 64 65 6e 6c 79 20 |ta you suddenly | 00001c70 72 65 61 6c 69 73 65 20 74 68 61 74 20 69 74 20 |realise that it | 00001c80 69 73 20 6e 6f 74 20 74 68 61 74 20 66 61 73 74 |is not that fast| 00001c90 20 61 66 74 65 72 0a 61 6c 6c 2c 20 61 6e 64 20 | after.all, and | 00001ca0 49 20 61 6d 20 6c 75 63 6b 79 20 65 6e 6f 75 67 |I am lucky enoug| 00001cb0 68 20 74 6f 20 68 61 76 65 20 61 20 33 30 4d 48 |h to have a 30MH| 00001cc0 7a 20 41 52 4d 2d 33 21 20 54 68 65 20 61 6e 69 |z ARM-3! The ani| 00001cd0 6d 61 74 69 6f 6e 20 72 6f 75 74 69 6e 65 73 0a |mation routines.| 00001ce0 73 70 72 69 6e 74 20 61 6c 6f 6e 67 20 61 73 20 |sprint along as | 00001cf0 66 61 73 74 20 61 73 20 70 6f 73 73 69 62 6c 65 |fast as possible| 00001d00 20 62 79 20 75 70 64 61 74 69 6e 67 20 31 36 20 | by updating 16 | 00001d10 62 79 74 65 73 20 6f 66 20 64 61 74 61 20 69 6e |bytes of data in| 00001d20 20 65 61 63 68 20 73 63 72 65 65 6e 0a 61 63 63 | each screen.acc| 00001d30 65 73 73 2e 0a 0a 57 68 79 20 31 36 3f 20 46 69 |ess...Why 16? Fi| 00001d40 72 73 74 6c 79 20 74 68 65 20 6d 65 6d 6f 72 79 |rstly the memory| 00001d50 20 63 68 69 70 20 63 6f 6e 74 72 6f 6c 6c 65 72 | chip controller| 00001d60 20 77 6f 72 6b 73 20 61 20 62 69 74 20 66 61 73 | works a bit fas| 00001d70 74 65 72 20 77 68 65 6e 20 61 63 63 65 73 73 69 |ter when accessi| 00001d80 6e 67 0a 64 61 74 61 20 6f 6e 20 31 36 20 62 79 |ng.data on 16 by| 00001d90 74 65 20 62 6f 75 6e 64 61 72 69 65 73 2e 20 54 |te boundaries. T| 00001da0 68 65 20 6f 74 68 65 72 20 72 65 61 73 6f 6e 20 |he other reason | 00001db0 69 73 20 74 68 61 74 20 74 68 65 20 6d 65 6d 6f |is that the memo| 00001dc0 72 79 20 6f 6e 20 74 68 65 0a 41 72 63 68 69 6d |ry on the.Archim| 00001dd0 65 64 65 73 20 69 73 20 63 68 65 61 70 20 61 6e |edes is cheap an| 00001de0 64 20 6e 61 73 74 79 20 73 6c 6f 77 20 73 74 75 |d nasty slow stu| 00001df0 66 66 20 72 75 6e 6e 69 6e 67 20 61 74 20 34 4d |ff running at 4M| 00001e00 48 7a 2e 20 57 68 61 74 20 74 68 69 73 20 6d 65 |Hz. What this me| 00001e10 61 6e 73 20 69 73 0a 74 68 61 74 20 74 68 65 20 |ans is.that the | 00001e20 70 72 6f 63 65 73 73 6f 72 20 73 70 65 65 64 20 |processor speed | 00001e30 69 73 20 68 61 6c 76 65 64 20 77 68 65 6e 65 76 |is halved whenev| 00001e40 65 72 20 6d 65 6d 6f 72 79 20 61 63 63 65 73 73 |er memory access| 00001e50 20 6f 63 63 75 72 73 20 28 6d 75 63 68 20 6d 6f | occurs (much mo| 00001e60 72 65 0a 77 69 74 68 20 74 68 65 20 41 52 4d 2d |re.with the ARM-| 00001e70 33 20 75 6e 66 6f 72 74 75 6e 61 74 65 6c 79 29 |3 unfortunately)| 00001e80 2e 20 4c 69 6d 69 74 69 6e 67 20 6d 65 6d 6f 72 |. Limiting memor| 00001e90 79 20 61 63 63 65 73 73 65 73 20 74 68 65 72 65 |y accesses there| 00001ea0 66 6f 72 65 20 61 6c 6c 6f 77 73 20 74 68 65 0a |fore allows the.| 00001eb0 70 72 6f 63 65 73 73 6f 72 20 74 6f 20 6f 70 65 |processor to ope| 00001ec0 72 61 74 65 20 61 74 20 66 75 6c 6c 20 73 70 65 |rate at full spe| 00001ed0 65 64 20 61 73 20 6d 75 63 68 20 61 73 20 70 6f |ed as much as po| 00001ee0 73 73 69 62 6c 65 2e 0a 0a 54 68 65 20 63 6c 65 |ssible...The cle| 00001ef0 76 65 72 20 62 69 74 20 77 61 73 20 77 6f 72 6b |ver bit was work| 00001f00 69 6e 67 20 6f 75 74 20 68 6f 77 20 74 6f 20 61 |ing out how to a| 00001f10 64 64 20 31 20 74 6f 20 65 61 63 68 20 62 79 74 |dd 1 to each byt| 00001f20 65 20 6f 66 20 61 20 72 65 67 69 73 74 65 72 0a |e of a register.| 00001f30 77 69 74 68 6f 75 74 20 61 20 63 61 72 72 79 20 |without a carry | 00001f40 69 6e 74 6f 20 74 68 65 20 6e 65 78 74 a0 62 79 |into the next.by| 00001f50 74 65 2e 20 54 68 65 20 61 6e 69 6d 61 74 65 20 |te. The animate | 00001f60 72 6f 75 74 69 6e 65 20 67 65 74 73 20 61 72 6f |routine gets aro| 00001f70 75 6e 64 20 74 68 69 73 0a 70 72 6f 62 6c 65 6d |und this.problem| 00001f80 20 62 79 20 73 75 62 74 72 61 63 74 69 6e 67 20 | by subtracting | 00001f90 62 79 20 31 20 75 6e 6c 65 73 73 20 74 68 65 20 |by 1 unless the | 00001fa0 62 79 74 65 20 69 73 20 7a 65 72 6f 2c 20 69 6e |byte is zero, in| 00001fb0 20 77 68 69 63 68 20 63 61 73 65 20 69 74 20 73 | which case it s| 00001fc0 65 74 73 0a 69 74 20 74 6f 20 32 35 35 2e 20 54 |ets.it to 255. T| 00001fd0 77 6f 20 6d 61 63 72 6f 73 20 61 72 65 20 75 73 |wo macros are us| 00001fe0 65 64 20 74 6f 20 73 61 76 65 20 63 6f 64 69 6e |ed to save codin| 00001ff0 67 20 61 6c 6c 20 74 68 65 20 72 6f 75 74 69 6e |g all the routin| 00002000 65 20 6c 6f 6e 67 20 68 61 6e 64 0a 73 69 6e 63 |e long hand.sinc| 00002010 65 20 77 65 20 6d 65 72 65 6c 79 20 64 6f 20 74 |e we merely do t| 00002020 68 65 20 73 61 6d 65 20 70 72 6f 63 65 73 73 20 |he same process | 00002030 66 6f 72 20 65 61 63 68 20 62 79 74 65 20 69 6e |for each byte in| 00002040 20 34 20 72 65 67 69 73 74 65 72 73 2e 0a 0a 41 | 4 registers...A| 00002050 73 20 61 20 67 75 69 64 65 20 74 6f 20 68 6f 77 |s a guide to how| 00002060 20 67 6f 6f 64 20 74 68 65 20 41 52 4d 2d 33 20 | good the ARM-3 | 00002070 70 72 6f 63 65 73 73 6f 72 20 69 73 2c 20 69 74 |processor is, it| 00002080 20 70 65 72 66 6f 72 6d 73 20 74 68 65 20 41 6e | performs the An| 00002090 69 6d 61 74 65 20 32 20 69 6e 0a 4d 6f 64 65 20 |imate 2 in.Mode | 000020a0 31 35 20 71 75 69 63 6b 65 72 20 74 68 61 6e 20 |15 quicker than | 000020b0 61 6e 20 41 6e 69 6d 61 74 65 20 31 20 69 6e 20 |an Animate 1 in | 000020c0 4d 6f 64 65 20 31 33 20 77 69 74 68 20 61 20 73 |Mode 13 with a s| 000020d0 74 61 6e 64 61 72 64 20 38 4d 68 7a 20 41 52 4d |tandard 8Mhz ARM| 000020e0 2e 0a 4f 70 74 69 6d 69 73 65 64 20 61 73 73 65 |..Optimised asse| 000020f0 6d 62 6c 65 72 20 72 6f 75 74 69 6e 65 73 20 73 |mbler routines s| 00002100 75 63 68 20 61 73 20 74 68 69 73 20 72 75 6e 20 |uch as this run | 00002110 35 20 74 69 6d 65 73 20 66 61 73 74 65 72 20 2d |5 times faster -| 00002120 20 74 68 65 20 65 78 74 72 61 0a 73 70 65 65 64 | the extra.speed| 00002130 20 69 6e 63 72 65 61 73 65 20 63 6f 6d 65 73 20 | increase comes | 00002140 66 72 6f 6d 20 69 74 73 20 75 73 65 20 6f 66 20 |from its use of | 00002150 61 20 34 6b 20 63 61 63 68 65 20 6f 66 20 68 69 |a 4k cache of hi| 00002160 67 68 20 73 70 65 65 64 20 69 6e 73 74 72 75 63 |gh speed instruc| 00002170 74 69 6f 6e 0a 6d 65 6d 6f 72 79 2e 20 4f 6e 63 |tion.memory. Onc| 00002180 65 20 79 6f 75 20 68 61 76 65 20 74 72 69 65 64 |e you have tried| 00002190 20 6f 6e 65 20 79 6f 75 27 6c 6c 20 66 69 6e 64 | one you'll find| 000021a0 20 74 68 65 20 73 74 61 6e 64 61 72 64 20 41 72 | the standard Ar| 000021b0 63 68 69 65 20 64 65 61 64 20 73 6c 6f 77 21 0a |chie dead slow!.| 000021c0 0a 41 46 47 20 53 70 72 69 74 65 20 46 69 6c 65 |.AFG Sprite File| 000021d0 73 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |s.--------------| 000021e0 2d 2d 0a 53 61 76 69 6e 67 20 61 20 73 63 72 65 |--.Saving a scre| 000021f0 65 6e 20 69 6d 61 67 65 20 28 76 69 61 20 2a 53 |en image (via *S| 00002200 63 72 65 65 6e 64 75 6d 70 29 20 69 73 20 74 68 |creendump) is th| 00002210 65 20 73 69 6d 70 6c 65 73 74 20 77 61 79 20 74 |e simplest way t| 00002220 6f 20 70 72 65 73 65 72 76 65 20 61 0a 68 61 72 |o preserve a.har| 00002230 64 20 77 6f 6e 20 69 6d 61 67 65 2e 20 4f 6e 65 |d won image. One| 00002240 20 64 69 73 61 64 76 61 6e 74 61 67 65 20 69 73 | disadvantage is| 00002250 20 74 68 61 74 20 79 6f 75 20 6e 65 65 64 20 74 | that you need t| 00002260 6f 20 63 72 65 61 74 65 20 61 20 73 65 70 61 72 |o create a separ| 00002270 61 74 65 0a 72 65 63 6f 72 64 20 6f 66 20 74 68 |ate.record of th| 00002280 65 20 70 61 72 61 6d 65 74 65 72 73 20 72 65 71 |e parameters req| 00002290 75 69 72 65 64 20 74 6f 20 67 65 6e 65 72 61 74 |uired to generat| 000022a0 65 20 73 70 72 69 74 65 2c 20 61 6e 64 20 68 6f |e sprite, and ho| 000022b0 77 20 64 6f 20 79 6f 75 0a 72 65 6d 65 6d 62 65 |w do you.remembe| 000022c0 72 20 77 68 69 63 68 20 70 72 6f 67 72 61 6d 20 |r which program | 000022d0 67 65 6e 65 72 61 74 65 64 20 77 68 61 74 20 69 |generated what i| 000022e0 6d 61 67 65 3f 0a 0a 54 6f 20 73 6f 6c 76 65 20 |mage?..To solve | 000022f0 74 68 69 73 20 70 72 6f 62 6c 65 6d 20 49 20 70 |this problem I p| 00002300 72 6f 70 6f 73 65 20 74 68 65 20 41 46 47 20 53 |ropose the AFG S| 00002310 70 72 69 74 65 20 73 74 61 6e 64 61 72 64 2e 20 |prite standard. | 00002320 41 6e 20 41 46 47 0a 73 70 72 69 74 65 20 69 73 |An AFG.sprite is| 00002330 20 73 69 6d 70 6c 79 20 61 20 73 74 61 6e 64 61 | simply a standa| 00002340 72 64 20 73 70 72 69 74 65 20 66 69 6c 65 20 77 |rd sprite file w| 00002350 68 69 63 68 20 68 61 73 20 65 6d 62 65 64 64 65 |hich has embedde| 00002360 64 20 63 6f 6e 74 72 6f 6c 0a 69 6e 66 6f 72 6d |d control.inform| 00002370 61 74 69 6f 6e 20 64 65 73 63 72 69 62 69 6e 67 |ation describing| 00002380 20 74 68 65 20 6f 72 69 67 69 6e 61 74 69 6e 67 | the originating| 00002390 20 70 72 6f 67 72 61 6d 20 61 6e 64 20 70 61 72 | program and par| 000023a0 61 6d 65 74 65 72 73 2e 20 54 68 65 79 20 61 72 |ameters. They ar| 000023b0 65 0a 63 6f 6d 70 61 74 69 62 6c 65 20 77 69 74 |e.compatible wit| 000023c0 68 20 21 50 61 69 6e 74 20 61 6e 64 20 21 44 72 |h !Paint and !Dr| 000023d0 61 77 2c 20 62 75 74 20 61 72 65 20 72 65 73 74 |aw, but are rest| 000023e0 72 69 63 74 65 64 20 74 6f 20 6f 6e 6c 79 20 6f |ricted to only o| 000023f0 6e 65 20 73 65 74 20 6f 66 0a 63 6f 6e 74 72 6f |ne set of.contro| 00002400 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 70 65 |l information pe| 00002410 72 20 73 70 72 69 74 65 20 66 69 6c 65 20 69 65 |r sprite file ie| 00002420 2e 20 49 20 72 65 63 6f 6d 6d 65 6e 64 20 74 6f |. I recommend to| 00002430 20 73 74 6f 72 65 20 6f 6e 6c 79 20 6f 6e 65 20 | store only one | 00002440 73 70 72 69 74 65 0a 70 65 72 20 66 69 6c 65 2e |sprite.per file.| 00002450 0a 0a 41 46 47 20 53 70 72 69 74 65 20 4c 61 79 |..AFG Sprite Lay| 00002460 6f 75 74 3a 0a 54 68 65 20 66 6f 6c 6c 6f 77 69 |out:.The followi| 00002470 6e 67 20 69 73 20 68 6f 77 20 74 68 65 20 73 70 |ng is how the sp| 00002480 72 69 74 65 20 6c 6f 6f 6b 73 20 69 6e 20 6d 65 |rite looks in me| 00002490 6d 6f 72 79 2e 20 4f 6e 20 66 69 6c 65 20 74 68 |mory. On file th| 000024a0 65 20 31 73 74 20 77 6f 72 64 20 69 73 0a 6f 6d |e 1st word is.om| 000024b0 69 74 74 65 64 2e 20 54 68 65 20 76 61 6c 75 65 |itted. The value| 000024c0 73 20 61 72 65 20 69 6e 20 64 65 63 69 6d 61 6c |s are in decimal| 000024d0 20 75 6e 6c 65 73 73 20 70 72 65 63 65 64 65 64 | unless preceded| 000024e0 20 62 79 20 27 26 27 20 66 6f 72 20 68 65 78 2e | by '&' for hex.| 000024f0 0a 0a 4e 61 6d 65 20 20 20 4f 66 66 73 65 74 20 |..Name Offset | 00002500 20 4c 65 6e 2e 20 20 46 75 6e 63 74 69 6f 6e 0a | Len. Function.| 00002510 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00002520 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 |--------------- | 00002530 0a 53 69 7a 65 20 20 20 20 20 20 30 20 20 20 20 |.Size 0 | 00002540 20 20 34 20 20 20 54 6f 74 61 6c 20 73 70 72 69 | 4 Total spri| 00002550 74 65 20 61 72 65 61 20 6c 65 6e 67 74 68 20 20 |te area length | 00002560 20 20 20 20 20 7d 20 53 74 61 6e 64 61 72 64 20 | } Standard | 00002570 73 70 72 69 74 65 20 0a 4e 75 6d 62 65 72 20 20 |sprite .Number | 00002580 20 20 34 20 20 20 20 20 20 34 20 20 20 4e 75 6d | 4 4 Num| 00002590 62 65 72 20 6f 66 20 73 70 72 69 74 65 73 20 20 |ber of sprites | 000025a0 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 61 72 | } ar| 000025b0 65 61 20 68 65 61 64 65 72 0a 53 70 72 6f 66 66 |ea header.Sproff| 000025c0 20 20 20 20 38 20 20 20 20 20 20 34 20 20 20 4f | 8 4 O| 000025d0 66 66 73 65 74 20 74 6f 20 31 73 74 20 73 70 72 |ffset to 1st spr| 000025e0 69 74 65 20 20 20 20 20 20 20 20 20 20 20 7d 0a |ite }.| 000025f0 46 72 65 65 6f 66 66 20 20 31 32 20 20 20 20 20 |Freeoff 12 | 00002600 20 34 20 20 20 4f 66 66 73 65 74 20 74 6f 20 66 | 4 Offset to f| 00002610 72 65 65 20 61 72 65 61 20 20 20 20 20 20 20 20 |ree area | 00002620 20 20 20 20 7d 0a 41 46 47 76 65 72 20 20 20 31 | }.AFGver 1| 00002630 36 20 20 20 20 20 20 34 20 20 20 41 46 47 31 20 |6 4 AFG1 | 00002640 69 65 2e 20 26 33 31 34 37 34 36 34 31 20 3a 20 |ie. &31474641 : | 00002650 69 64 65 6e 74 69 66 69 65 73 20 61 6e 20 41 46 |identifies an AF| 00002660 47 20 76 31 20 73 70 72 69 74 65 0a 20 20 20 20 |G v1 sprite. | 00002670 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002680 20 43 68 65 63 6b 20 74 68 69 73 20 76 61 6c 75 | Check this valu| 00002690 65 20 74 6f 20 76 65 72 69 66 79 20 41 46 47 31 |e to verify AFG1| 000026a0 20 73 70 72 69 74 65 73 2e 20 0a 50 67 6d 6e 61 | sprites. .Pgmna| 000026b0 6d 65 20 20 32 30 20 20 20 20 20 31 32 20 20 20 |me 20 12 | 000026c0 50 72 6f 67 72 61 6d 20 6e 61 6d 65 20 61 6e 64 |Program name and| 000026d0 20 76 65 72 73 69 6f 6e 20 69 64 2c 20 7a 65 72 | version id, zer| 000026e0 6f 20 74 65 72 6d 69 6e 61 74 65 64 20 73 74 72 |o terminated str| 000026f0 69 6e 67 2e 0a 20 20 20 20 20 20 20 20 20 20 20 |ing.. | 00002700 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 20 | Check | 00002710 74 68 69 73 20 74 6f 20 64 65 74 65 72 6d 69 6e |this to determin| 00002720 65 20 69 66 20 74 68 65 20 73 70 72 69 74 65 20 |e if the sprite | 00002730 62 65 6c 6f 6e 67 73 20 74 6f 20 79 6f 75 72 0a |belongs to your.| 00002740 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002750 20 20 20 20 20 70 72 6f 67 72 61 6d 20 77 68 65 | program whe| 00002760 6e 20 6c 6f 61 64 69 6e 67 2e 20 65 67 2e 20 22 |n loading. eg. "| 00002770 4a 75 6c 69 61 20 76 31 30 22 0a 56 61 72 6e 75 |Julia v10".Varnu| 00002780 6d 20 20 20 33 32 20 20 20 20 20 20 31 20 20 20 |m 32 1 | 00002790 6e 75 6d 62 65 72 20 6f 66 20 63 6f 6e 74 72 6f |number of contro| 000027a0 6c 20 76 61 72 69 61 62 6c 65 73 20 74 6f 20 66 |l variables to f| 000027b0 6f 6c 6c 6f 77 20 28 6d 61 79 20 62 65 20 30 29 |ollow (may be 0)| 000027c0 2e 0a 56 61 72 6c 65 6e 20 20 20 33 33 20 20 20 |..Varlen 33 | 000027d0 20 20 20 31 20 20 20 56 61 72 69 61 62 6c 65 20 | 1 Variable | 000027e0 6c 65 6e 67 74 68 20 69 6e 20 62 79 74 65 73 20 |length in bytes | 000027f0 26 20 74 79 70 65 2e 20 54 68 65 73 65 20 61 72 |& type. These ar| 00002800 65 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |e:. | 00002810 20 20 20 20 20 20 20 20 20 20 34 3d 69 6e 74 65 | 4=inte| 00002820 67 65 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 |ger. | 00002830 20 20 20 20 20 20 20 20 20 20 20 35 3d 42 61 73 | 5=Bas| 00002840 69 63 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e |ic floating poin| 00002850 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |t. | 00002860 20 20 20 20 20 20 20 20 20 38 3d 44 6f 75 62 6c | 8=Doubl| 00002870 65 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74 |e floating point| 00002880 20 28 41 73 73 65 6d 62 6c 65 72 20 26 20 43 29 | (Assembler & C)| 00002890 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000028a0 20 20 20 20 20 20 20 31 32 3d 45 78 74 65 6e 64 | 12=Extend| 000028b0 65 64 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e |ed floating poin| 000028c0 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |t. | 000028d0 20 20 20 20 20 20 20 26 38 30 2b 73 74 72 69 6e | &80+strin| 000028e0 67 20 6c 65 6e 67 74 68 3d 53 74 72 69 6e 67 2c |g length=String,| 000028f0 20 7a 65 72 6f 20 74 65 72 6d 69 6e 61 74 65 64 | zero terminated| 00002900 20 28 6e 6f 74 20 43 52 29 2e 0a 20 20 20 20 20 | (not CR).. | 00002910 20 20 20 20 33 34 2e 2e 6e 6e 20 20 31 20 20 20 | 34..nn 1 | 00002920 4c 65 6e 67 74 68 20 74 79 70 65 73 20 6f 66 20 |Length types of | 00002930 6f 74 68 65 72 20 76 61 72 69 61 62 6c 65 73 0a |other variables.| 00002940 76 61 72 64 61 74 61 20 20 6e 6e 20 20 20 20 20 |vardata nn | 00002950 20 6e 20 20 20 76 61 72 69 61 62 6c 65 20 64 61 | n variable da| 00002960 74 61 2c 20 77 6f 72 64 20 61 6c 69 67 6e 65 64 |ta, word aligned| 00002970 0a 2e 2e 20 20 20 20 20 20 20 20 2e 0a 53 70 72 |... ..Spr| 00002980 68 64 72 20 20 20 73 73 20 20 20 20 20 34 34 20 |hdr ss 44 | 00002990 20 20 53 70 72 69 74 65 20 68 65 61 64 65 72 20 | Sprite header | 000029a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000029b0 20 7d 20 53 74 61 6e 64 61 72 64 20 73 70 72 69 | } Standard spri| 000029c0 74 65 20 66 6f 72 6d 61 74 0a 73 70 72 64 61 74 |te format.sprdat| 000029d0 61 20 20 64 64 20 20 20 20 20 6e 6e 20 20 20 53 |a dd nn S| 000029e0 70 72 69 74 65 20 64 61 74 61 0a 0a 49 6e 20 61 |prite data..In a| 000029f0 20 6e 6f 6e 2d 41 46 47 20 73 70 72 69 74 65 20 | non-AFG sprite | 00002a00 53 70 72 6f 66 66 20 63 6f 6e 74 61 69 6e 73 20 |Sproff contains | 00002a10 31 36 20 73 69 6e 63 65 20 74 68 65 72 65 20 69 |16 since there i| 00002a20 73 20 6e 6f 20 61 64 64 69 74 69 6f 6e 61 6c 0a |s no additional.| 00002a30 69 6e 66 6f 72 6d 61 74 69 6f 6e 2e 20 49 6e 20 |information. In | 00002a40 61 6e 20 41 46 47 20 73 70 72 69 74 65 20 53 70 |an AFG sprite Sp| 00002a50 72 6f 66 66 20 77 69 6c 6c 20 63 6f 6e 74 61 69 |roff will contai| 00002a60 6e 20 31 36 2b 6c 65 6e 67 74 68 20 6f 66 20 41 |n 16+length of A| 00002a70 46 47 20 63 6f 6e 74 72 6f 6c 0a 69 6e 66 6f 72 |FG control.infor| 00002a80 6d 61 74 69 6f 6e 2e 20 43 68 65 63 6b 69 6e 67 |mation. Checking| 00002a90 20 41 46 47 76 65 72 20 61 6e 64 20 50 67 6d 6e | AFGver and Pgmn| 00002aa0 61 6d 65 20 77 68 65 6e 20 6c 6f 61 64 69 6e 67 |ame when loading| 00002ab0 20 61 20 73 70 72 69 74 65 20 61 6c 6c 6f 77 73 | a sprite allows| 00002ac0 20 79 6f 75 72 0a 70 72 6f 67 72 61 6d 20 74 6f | your.program to| 00002ad0 20 76 65 72 69 66 79 20 61 6e 20 61 63 63 65 70 | verify an accep| 00002ae0 74 61 62 6c 65 20 73 70 72 69 74 65 2e 0a 0a 56 |table sprite...V| 00002af0 61 72 6e 75 6d 20 6d 75 73 74 20 62 65 20 73 65 |arnum must be se| 00002b00 74 20 74 6f 20 74 68 65 20 6e 75 6d 62 65 72 20 |t to the number | 00002b10 6f 66 20 76 61 72 69 61 62 6c 65 73 20 74 68 61 |of variables tha| 00002b20 74 20 66 6f 6c 6c 6f 77 2e 20 56 61 72 69 61 62 |t follow. Variab| 00002b30 6c 65 73 20 61 72 65 0a 69 64 65 6e 74 69 66 69 |les are.identifi| 00002b40 65 64 20 62 79 20 74 68 65 69 72 20 6c 65 6e 67 |ed by their leng| 00002b50 74 68 2c 20 6f 72 20 2b 31 32 38 20 66 6f 72 20 |th, or +128 for | 00002b60 73 74 72 69 6e 67 73 2e 20 54 68 65 72 65 20 77 |strings. There w| 00002b70 69 6c 6c 20 62 65 20 6f 6e 65 20 6f 72 20 6d 6f |ill be one or mo| 00002b80 72 65 0a 56 61 72 6c 65 6e 20 66 69 65 6c 64 73 |re.Varlen fields| 00002b90 20 69 6e 20 63 6f 6e 74 69 67 75 6f 75 73 20 62 | in contiguous b| 00002ba0 79 74 65 73 2e 20 54 68 65 20 76 61 72 69 61 62 |ytes. The variab| 00002bb0 6c 65 20 64 61 74 61 20 69 74 73 65 6c 66 20 74 |le data itself t| 00002bc0 68 65 6e 20 66 6f 6c 6c 6f 77 73 2c 0a 65 61 63 |hen follows,.eac| 00002bd0 68 20 76 61 72 69 61 62 6c 65 20 73 74 61 72 74 |h variable start| 00002be0 69 6e 67 20 6f 6e 20 61 20 77 6f 72 64 20 62 6f |ing on a word bo| 00002bf0 75 6e 64 61 72 79 2e 0a 0a 4e 62 2e 20 42 41 53 |undary...Nb. BAS| 00002c00 49 43 20 75 73 65 73 20 61 20 63 61 72 72 69 61 |IC uses a carria| 00002c10 67 65 20 72 65 74 75 72 6e 20 28 43 52 29 20 74 |ge return (CR) t| 00002c20 6f 20 74 65 72 6d 69 6e 61 74 65 20 73 74 72 69 |o terminate stri| 00002c30 6e 67 73 2c 20 52 69 73 63 4f 53 20 26 20 43 20 |ngs, RiscOS & C | 00002c40 75 73 65 73 0a 61 20 7a 65 72 6f 20 62 79 74 65 |uses.a zero byte| 00002c50 2e 20 54 6f 20 73 74 6f 72 65 20 61 20 7a 65 72 |. To store a zer| 00002c60 6f 20 74 65 72 6d 69 6e 61 74 65 64 20 73 74 72 |o terminated str| 00002c70 69 6e 67 20 69 6e 20 42 41 53 49 43 20 75 73 65 |ing in BASIC use| 00002c80 0a 24 78 25 3d 22 53 74 72 69 6e 67 22 2b 43 48 |.$x%="String"+CH| 00002c90 52 24 30 20 61 6e 64 20 61 6c 6c 6f 77 20 66 6f |R$0 and allow fo| 00002ca0 72 20 74 68 65 20 74 77 6f 20 65 78 74 72 61 20 |r the two extra | 00002cb0 62 79 74 65 73 20 66 6f 72 20 74 68 65 20 30 20 |bytes for the 0 | 00002cc0 26 20 43 52 20 69 6e 20 74 68 65 0a 6c 65 6e 67 |& CR in the.leng| 00002cd0 74 68 2e 20 54 6f 20 72 65 74 72 69 65 76 65 20 |th. To retrieve | 00002ce0 74 68 65 20 73 74 72 69 6e 67 20 75 73 65 20 53 |the string use S| 00002cf0 24 3d 4c 45 46 54 24 28 24 78 25 29 20 77 68 69 |$=LEFT$($x%) whi| 00002d00 63 68 20 77 69 6c 6c 20 73 74 72 69 70 20 6f 66 |ch will strip of| 00002d10 66 20 74 68 65 0a 74 72 61 69 6c 69 6e 67 20 7a |f the.trailing z| 00002d20 65 72 6f 20 62 79 74 65 2e 0a 0a 54 68 65 20 63 |ero byte...The c| 00002d30 6f 6d 70 6c 65 74 65 20 63 6f 64 65 20 66 6f 72 |omplete code for| 00002d40 20 63 72 65 61 74 69 6e 67 20 61 6e 20 41 46 47 | creating an AFG| 00002d50 20 73 70 72 69 74 65 20 69 6e 20 42 41 53 49 43 | sprite in BASIC| 00002d60 20 69 73 20 6e 6f 77 20 67 69 76 65 6e 3a 0a 0a | is now given:..| 00002d70 20 20 20 20 31 30 20 52 45 4d 20 52 65 73 65 72 | 10 REM Reser| 00002d80 76 65 20 73 74 6f 72 61 67 65 20 66 6f 72 20 61 |ve storage for a| 00002d90 20 4d 6f 64 65 20 31 33 20 73 70 72 69 74 65 20 | Mode 13 sprite | 00002da0 28 38 30 6b 29 20 2b 20 63 6f 6e 74 72 6f 6c 20 |(80k) + control | 00002db0 69 6e 66 6f 0a 20 20 20 20 32 30 20 41 46 47 6c |info. 20 AFGl| 00002dc0 65 6e 3d 33 32 3a 53 70 72 6c 65 6e 3d 38 30 2a |en=32:Sprlen=80*| 00002dd0 31 30 32 34 2b 34 34 2b 31 36 2b 41 46 47 6c 65 |1024+44+16+AFGle| 00002de0 6e 0a 20 20 20 20 33 30 20 44 49 4d 20 53 25 20 |n. 30 DIM S% | 00002df0 53 70 72 6c 65 6e 0a 20 20 20 20 34 30 20 52 45 |Sprlen. 40 RE| 00002e00 4d 20 49 6e 69 74 69 61 6c 69 73 65 20 74 68 65 |M Initialise the| 00002e10 20 73 70 72 69 74 65 20 61 72 65 61 0a 20 20 20 | sprite area. | 00002e20 20 35 30 20 21 53 25 3d 53 70 72 6c 65 6e 3a 53 | 50 !S%=Sprlen:S| 00002e30 25 21 38 3d 31 36 2b 41 46 47 6c 65 6e 0a 20 20 |%!8=16+AFGlen. | 00002e40 20 20 36 30 20 53 59 53 20 22 4f 53 5f 53 70 72 | 60 SYS "OS_Spr| 00002e50 69 74 65 4f 70 22 2c 32 35 36 2b 39 2c 53 25 0a |iteOp",256+9,S%.| 00002e60 20 20 20 20 37 30 20 52 45 4d 20 53 65 74 20 75 | 70 REM Set u| 00002e70 70 20 41 46 47 20 48 65 61 64 65 72 0a 20 20 20 |p AFG Header. | 00002e80 20 38 30 20 24 28 53 25 2b 31 36 29 3d 22 41 46 | 80 $(S%+16)="AF| 00002e90 47 31 22 0a 20 20 20 20 39 30 20 24 28 53 25 2b |G1". 90 $(S%+| 00002ea0 32 30 29 3d 22 4d 79 70 72 6f 67 20 76 31 30 22 |20)="Myprog v10"| 00002eb0 2b 43 48 52 24 30 3a 52 45 4d 20 4d 61 78 20 31 |+CHR$0:REM Max 1| 00002ec0 30 20 63 68 61 72 73 20 69 6e 20 6e 61 6d 65 0a |0 chars in name.| 00002ed0 20 20 20 31 30 30 20 53 25 3f 33 32 3d 32 3a 52 | 100 S%?32=2:R| 00002ee0 45 4d 20 32 20 76 61 72 69 61 62 6c 65 73 20 69 |EM 2 variables i| 00002ef0 6e 20 74 68 69 73 20 65 78 61 6d 70 6c 65 0a 20 |n this example. | 00002f00 20 20 31 31 30 20 53 25 3f 33 33 3d 35 3a 52 45 | 110 S%?33=5:RE| 00002f10 4d 20 31 73 74 20 76 61 72 69 61 62 6c 65 20 69 |M 1st variable i| 00002f20 73 20 61 20 42 41 53 49 43 20 66 6c 6f 61 74 0a |s a BASIC float.| 00002f30 20 20 20 31 32 30 20 53 25 3f 33 34 3d 34 3a 52 | 120 S%?34=4:R| 00002f40 45 4d 20 32 6e 64 20 76 61 72 69 61 62 6c 65 20 |EM 2nd variable | 00002f50 69 73 20 61 6e 20 69 6e 74 65 67 65 72 0a 20 20 |is an integer. | 00002f60 20 31 33 30 20 66 6c 6f 61 74 3d 32 2e 33 34 35 | 130 float=2.345| 00002f70 3a 69 6e 74 25 3d 31 32 38 3a 52 45 4d 20 76 61 |:int%=128:REM va| 00002f80 72 69 61 62 6c 65 73 20 74 6f 20 73 74 6f 72 65 |riables to store| 00002f90 0a 20 20 20 31 34 30 20 7c 28 53 25 2b 33 36 29 |. 140 |(S%+36)| 00002fa0 3d 66 6c 6f 61 74 3a 52 45 4d 20 46 6c 6f 61 74 |=float:REM Float| 00002fb0 20 76 61 72 69 61 62 6c 65 2c 20 6f 6e 20 77 6f | variable, on wo| 00002fc0 72 64 20 62 6f 75 6e 64 61 72 79 0a 20 20 20 31 |rd boundary. 1| 00002fd0 35 30 20 53 25 21 34 34 3d 69 6e 74 25 3a 52 45 |50 S%!44=int%:RE| 00002fe0 4d 20 49 6e 74 65 67 65 72 20 76 61 72 69 61 62 |M Integer variab| 00002ff0 6c 65 2c 20 6f 6e 20 77 6f 72 64 20 62 6f 75 6e |le, on word boun| 00003000 64 61 72 79 0a 20 20 20 31 36 30 20 52 45 4d 20 |dary. 160 REM | 00003010 4e 6f 77 20 63 72 65 61 74 65 20 61 20 73 70 72 |Now create a spr| 00003020 69 74 65 20 66 6f 72 20 66 75 6c 6c 20 73 63 72 |ite for full scr| 00003030 65 65 6e 20 4d 6f 64 65 20 31 33 20 70 6c 6f 74 |een Mode 13 plot| 00003040 74 69 6e 67 0a 20 20 20 31 37 30 20 53 59 53 20 |ting. 170 SYS | 00003050 22 4f 53 5f 53 70 72 69 74 65 4f 70 22 2c 32 35 |"OS_SpriteOp",25| 00003060 36 2b 31 35 2c 53 25 2c 22 4d 79 53 70 72 69 74 |6+15,S%,"MySprit| 00003070 65 22 2c 30 2c 33 32 30 2c 32 35 36 2c 31 33 0a |e",0,320,256,13.| 00003080 20 20 20 31 38 30 20 52 45 4d 20 53 65 74 20 75 | 180 REM Set u| 00003090 70 20 61 20 76 61 72 69 61 62 6c 65 20 74 6f 20 |p a variable to | 000030a0 61 6c 6c 6f 77 20 77 72 69 74 69 6e 67 20 73 74 |allow writing st| 000030b0 72 61 69 67 68 74 20 74 6f 20 61 20 73 70 72 69 |raight to a spri| 000030c0 74 65 0a 20 20 20 31 39 30 20 53 70 72 41 64 72 |te. 190 SprAdr| 000030d0 25 3d 53 25 2b 31 36 2b 41 46 47 6c 65 6e 2b 34 |%=S%+16+AFGlen+4| 000030e0 34 0a 0a 59 6f 75 20 63 61 6e 20 6e 6f 77 20 73 |4..You can now s| 000030f0 74 6f 72 65 20 32 35 36 20 63 6f 6c 6f 75 72 20 |tore 256 colour | 00003100 62 79 74 65 73 20 76 61 6c 75 65 73 20 61 74 20 |bytes values at | 00003110 53 70 72 41 64 72 25 3f 6f 66 66 73 65 74 20 2d |SprAdr%?offset -| 00003120 20 79 6f 75 20 64 6f 6e 27 74 20 65 76 65 6e 0a | you don't even.| 00003130 6e 65 65 64 20 74 6f 20 62 65 20 69 6e 20 6d 6f |need to be in mo| 00003140 64 65 20 31 33 21 20 54 6f 20 63 6f 6d 70 6c 65 |de 13! To comple| 00003150 74 65 20 74 68 65 20 70 72 6f 67 72 61 6d 20 61 |te the program a| 00003160 6e 64 20 73 61 76 65 20 74 68 65 20 73 70 72 69 |nd save the spri| 00003170 74 65 20 75 73 65 3a 0a 20 20 20 20 20 20 20 53 |te use:. S| 00003180 59 53 20 22 4f 53 5f 53 70 72 69 74 65 4f 70 22 |YS "OS_SpriteOp"| 00003190 2c 32 35 36 2b 31 32 2c 53 25 2c 22 46 69 6c 65 |,256+12,S%,"File| 000031a0 6e 61 6d 65 22 0a 0a 54 6f 20 6c 6f 61 64 20 61 |name"..To load a| 000031b0 20 73 70 72 69 74 65 20 61 20 73 69 6d 69 6c 61 | sprite a simila| 000031c0 72 20 73 65 63 74 69 6f 6e 20 6f 66 20 63 6f 64 |r section of cod| 000031d0 65 20 69 73 20 72 65 71 75 69 72 65 64 20 3a 0a |e is required :.| 000031e0 0a 20 20 20 20 31 30 20 52 45 4d 20 52 65 73 65 |. 10 REM Rese| 000031f0 72 76 65 20 73 74 6f 72 61 67 65 20 66 6f 72 20 |rve storage for | 00003200 61 20 4d 6f 64 65 20 31 33 20 73 70 72 69 74 65 |a Mode 13 sprite| 00003210 20 28 38 30 6b 29 20 2b 20 63 6f 6e 74 72 6f 6c | (80k) + control| 00003220 20 69 6e 66 6f 0a 20 20 20 20 32 30 20 41 46 47 | info. 20 AFG| 00003230 6c 65 6e 3d 33 32 3a 53 70 72 6c 65 6e 3d 38 30 |len=32:Sprlen=80| 00003240 2a 31 30 32 34 2b 34 34 2b 31 36 2b 41 46 47 6c |*1024+44+16+AFGl| 00003250 65 6e 0a 20 20 20 20 33 30 20 44 49 4d 20 53 25 |en. 30 DIM S%| 00003260 20 53 70 72 6c 65 6e 0a 20 20 20 20 34 30 20 52 | Sprlen. 40 R| 00003270 45 4d 20 49 6e 69 74 69 61 6c 69 73 65 20 74 68 |EM Initialise th| 00003280 65 20 73 70 72 69 74 65 20 61 72 65 61 0a 20 20 |e sprite area. | 00003290 20 20 35 30 20 21 53 25 3d 53 70 72 6c 65 6e 3a | 50 !S%=Sprlen:| 000032a0 53 25 21 38 3d 31 36 2b 41 46 47 6c 65 6e 0a 20 |S%!8=16+AFGlen. | 000032b0 20 20 20 36 30 20 53 59 53 20 22 4f 53 5f 53 70 | 60 SYS "OS_Sp| 000032c0 72 69 74 65 4f 70 22 2c 32 35 36 2b 39 2c 53 25 |riteOp",256+9,S%| 000032d0 0a 20 20 20 20 37 30 20 52 45 4d 20 4e 6f 77 20 |. 70 REM Now | 000032e0 6c 6f 61 64 20 74 68 65 20 73 70 72 69 74 65 20 |load the sprite | 000032f0 28 55 73 65 20 58 20 76 65 72 73 69 6f 6e 20 74 |(Use X version t| 00003300 6f 20 74 72 61 70 20 65 72 72 6f 72 73 29 0a 20 |o trap errors). | 00003310 20 20 20 38 30 20 53 59 53 20 22 58 4f 53 5f 53 | 80 SYS "XOS_S| 00003320 70 72 69 74 65 4f 70 22 2c 32 35 36 2b 31 30 2c |priteOp",256+10,| 00003330 53 25 2c 22 46 69 6c 65 6e 61 6d 65 22 20 54 4f |S%,"Filename" TO| 00003340 20 45 72 72 25 0a 20 20 20 20 39 30 20 49 46 20 | Err%. 90 IF | 00003350 53 25 21 31 36 3c 3e 26 33 31 34 37 34 36 34 31 |S%!16<>&31474641| 00003360 20 54 48 45 4e 20 50 52 49 4e 54 22 4e 6f 74 20 | THEN PRINT"Not | 00003370 41 6e 20 41 46 47 31 20 53 70 72 69 74 65 22 3a |An AFG1 Sprite":| 00003380 45 4e 44 0a 20 20 20 31 30 30 20 49 46 20 4c 45 |END. 100 IF LE| 00003390 46 54 24 28 24 28 53 25 2b 32 30 29 29 3c 3e 22 |FT$($(S%+20))<>"| 000033a0 4d 79 70 72 6f 67 20 76 31 30 22 20 54 48 45 4e |Myprog v10" THEN| 000033b0 20 50 52 49 4e 54 22 4e 6f 74 20 4d 79 20 53 70 | PRINT"Not My Sp| 000033c0 72 69 74 65 22 3a 45 4e 44 0a 20 20 20 31 31 30 |rite":END. 110| 000033d0 20 52 45 4d 20 50 69 63 6b 20 75 70 20 76 61 72 | REM Pick up var| 000033e0 69 61 62 6c 65 73 20 66 72 6f 6d 20 6c 61 73 74 |iables from last| 000033f0 20 74 69 6d 65 0a 20 20 20 31 32 30 20 66 6c 6f | time. 120 flo| 00003400 61 74 3d 7c 28 53 25 2b 33 36 29 3a 69 6e 74 25 |at=|(S%+36):int%| 00003410 3d 53 25 21 34 34 0a 0a 50 68 65 77 21 20 53 6f |=S%!44..Phew! So| 00003420 72 72 79 20 69 66 20 74 68 61 74 20 77 61 73 20 |rry if that was | 00003430 61 20 62 69 74 20 68 65 61 76 79 20 67 6f 69 6e |a bit heavy goin| 00003440 67 20 28 77 68 69 63 68 20 69 73 20 77 68 79 20 |g (which is why | 00003450 49 20 73 75 70 70 6c 79 20 74 68 65 20 63 6f 64 |I supply the cod| 00003460 65 0a 61 62 6f 76 65 29 2c 20 62 75 74 20 73 74 |e.above), but st| 00003470 6f 72 69 6e 67 20 61 6c 6c 20 74 68 65 20 72 65 |oring all the re| 00003480 6c 65 76 61 6e 74 20 69 6e 66 6f 72 6d 61 74 69 |levant informati| 00003490 6f 6e 20 69 6e 20 74 68 69 73 20 77 61 79 20 67 |on in this way g| 000034a0 65 74 73 20 61 72 6f 75 6e 64 20 74 68 65 0a 70 |ets around the.p| 000034b0 72 6f 62 6c 65 6d 20 6f 66 20 73 65 70 61 72 61 |roblem of separa| 000034c0 74 65 20 63 6f 6e 74 72 6f 6c 20 66 69 6c 65 73 |te control files| 000034d0 2e 0a 0a 49 66 20 79 6f 75 20 61 72 65 20 77 6f |...If you are wo| 000034e0 6e 64 65 72 69 6e 67 20 77 68 79 20 74 68 65 20 |ndering why the | 000034f0 6e 75 6d 62 65 72 20 61 6e 64 20 74 79 70 65 20 |number and type | 00003500 6f 66 20 76 61 72 69 61 62 6c 65 73 20 69 73 20 |of variables is | 00003510 73 70 65 63 69 66 69 65 64 2c 20 74 68 69 73 0a |specified, this.| 00003520 69 73 20 66 6f 72 20 70 72 6f 67 72 61 6d 73 20 |is for programs | 00003530 74 68 61 74 20 73 74 6f 72 65 20 76 61 72 79 69 |that store varyi| 00003540 6e 67 20 70 61 72 61 6d 65 74 65 72 73 20 61 6e |ng parameters an| 00003550 64 20 66 6f 72 20 21 41 46 47 53 70 72 69 74 65 |d for !AFGSprite| 00003560 2e 0a 0a 0a 48 69 73 74 6f 72 79 0a 3d 3d 3d 3d |....History.====| 00003570 3d 3d 3d 0a 76 31 2e 30 30 20 20 31 38 2f 30 35 |===.v1.00 18/05| 00003580 2f 39 31 20 20 49 6e 69 74 69 61 6c 20 70 75 62 |/91 Initial pub| 00003590 6c 69 63 20 76 65 72 73 69 6f 6e 2e 0a 0a 0a 46 |lic version....F| 000035a0 69 6e 61 6c 20 42 6f 72 69 6e 67 20 43 6f 70 79 |inal Boring Copy| 000035b0 77 72 69 67 68 74 20 4e 6f 74 69 63 65 0a 3d 3d |wright Notice.==| 000035c0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 000035d0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 54 68 65 |============.The| 000035e0 20 63 6f 70 79 77 72 69 67 68 74 20 6f 66 20 74 | copywright of t| 000035f0 68 69 73 20 6d 61 74 65 72 69 61 6c 20 62 65 6c |his material bel| 00003600 6f 6e 67 73 20 74 6f 20 4d 69 6b 65 20 43 75 72 |ongs to Mike Cur| 00003610 6e 6f 77 20 65 78 63 65 70 74 20 66 6f 72 20 74 |now except for t| 00003620 68 65 20 21 48 65 6c 70 0a 61 70 70 6c 69 63 61 |he !Help.applica| 00003630 74 69 6f 6e 20 77 68 69 63 68 20 62 65 6c 6f 6e |tion which belon| 00003640 67 73 20 74 6f 20 4a 20 52 d6 6c 69 6e 67 2e 20 |gs to J R.ling. | 00003650 54 68 69 73 20 73 6f 66 74 77 61 72 65 20 6d 61 |This software ma| 00003660 79 20 62 65 20 70 61 73 73 65 64 20 6f 6e 20 74 |y be passed on t| 00003670 6f 0a 6f 74 68 65 72 73 20 61 73 20 6c 6f 6e 67 |o.others as long| 00003680 20 61 73 20 4e 4f 20 43 48 41 52 47 45 53 20 41 | as NO CHARGES A| 00003690 52 45 20 4c 45 56 49 45 44 20 65 78 63 65 70 74 |RE LEVIED except| 000036a0 20 74 6f 20 63 6f 76 65 72 20 63 6f 73 74 73 2e | to cover costs.| 000036b0 0a 0a 0a 41 72 63 68 69 6d 65 64 65 73 20 46 72 |...Archimedes Fr| 000036c0 61 63 74 61 6c 20 47 72 6f 75 70 20 28 41 46 47 |actal Group (AFG| 000036d0 29 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |).==============| 000036e0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 000036f0 0a 54 68 69 73 20 73 6f 66 74 77 61 72 65 20 69 |.This software i| 00003700 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 41 72 |s part of the Ar| 00003710 63 68 69 6d 65 64 65 73 20 46 72 61 63 74 61 6c |chimedes Fractal| 00003720 20 47 72 6f 75 70 20 63 6f 6c 6c 65 63 74 69 6f | Group collectio| 00003730 6e 2e 20 49 66 20 79 6f 75 0a 68 61 76 65 20 6f |n. If you.have o| 00003740 62 74 61 69 6e 65 64 20 74 68 69 73 20 73 6f 66 |btained this sof| 00003750 74 77 61 72 65 20 6f 75 74 73 69 64 65 20 6f 66 |tware outside of| 00003760 20 74 68 65 20 41 46 47 20 61 6e 64 20 77 6f 75 | the AFG and wou| 00003770 6c 64 20 6c 69 6b 65 20 74 6f 20 66 69 6e 64 20 |ld like to find | 00003780 6f 75 74 0a 6d 6f 72 65 20 61 62 6f 75 74 20 46 |out.more about F| 00003790 72 61 63 74 61 6c 73 20 6f 6e 20 74 68 65 20 41 |ractals on the A| 000037a0 72 63 68 69 6d 65 64 65 73 2c 20 63 6f 6e 74 61 |rchimedes, conta| 000037b0 63 74 20 6d 65 20 28 74 68 65 20 41 46 47 20 61 |ct me (the AFG a| 000037c0 64 6d 69 6e 69 73 74 72 61 74 6f 72 29 20 61 74 |dministrator) at| 000037d0 0a 74 68 65 20 61 64 64 72 65 73 73 20 62 65 6c |.the address bel| 000037e0 6f 77 2e 20 53 65 6e 64 20 61 20 53 41 45 20 61 |ow. Send a SAE a| 000037f0 6e 64 20 61 20 64 69 73 6b 20 74 6f 20 67 65 74 |nd a disk to get| 00003800 20 61 20 66 72 65 65 20 41 46 47 20 64 65 6d 6f | a free AFG demo| 00003810 20 64 69 73 6b 2e 0a 0a 4d 69 6b 65 20 43 75 72 | disk...Mike Cur| 00003820 6e 6f 77 2c 0a 33 30 20 42 6f 77 65 6e 20 44 72 |now,.30 Bowen Dr| 00003830 69 76 65 2c 0a 57 65 73 74 20 44 75 6c 77 69 63 |ive,.West Dulwic| 00003840 68 2c 0a 4c 6f 6e 64 6f 6e 0a 53 45 32 31 20 38 |h,.London.SE21 8| 00003850 50 4e 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 |PN.. | 00003860 20 20 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 | . | 00003870 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c | <| 00003880 3c 3c 3c 20 4d 41 59 20 54 48 45 20 43 48 41 4f |<<< MAY THE CHAO| 00003890 53 20 42 45 20 57 49 54 48 20 59 4f 55 21 20 3e |S BE WITH YOU! >| 000038a0 3e 3e 3e 0a |>>>.| 000038a4