Home » Archimedes archive » Micro User » MU 1992-05.adf » PD » Fractal/!Fractal/Help/!Interface/ReadMe
Fractal/!Fractal/Help/!Interface/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 1992-05.adf » PD |
Filename: | Fractal/!Fractal/Help/!Interface/ReadMe |
Read OK: | ✔ |
File size: | A3F5 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
!Fractal Interfaces Last updated 21/03/92 =================== --------------------- This document describes the !Fractal interfaces and is provided for programmers wanting to add their own routines to !Fractal. Fractal functions can be programmed for !Fractal in ARM assembler, C or a mixture of both. To use C contact Mike Curnow to obtain the necessary source. For ARM assembler all the necessary material is provided, including FPlib and some complete sample source skeletons to get you quickly under way. To get the best from !Fractal you will need a C compiler - either Acorn's or Beebug's. Assembler routines have access to a subset of the functionality of C because BASIC's ARM assembler does not produce object files. Also writing C routines for !Fractal is a lot easier than doing it in Assembler! The first part of this document contains information relevant to ARM and C, and is followed by language specific details. It is biased towards C because this document is the central reference to !Fractal's internal operation. To get your routine added permanently to !Fractal send the source and program documentation to Mike Curnow. The source is necessary to enable the routine to be re-compiled as !Fractal changes. You will receive full credit for your work. Overview ======== !Fractal provides the main Wimp interfaces and common processing routines. Fractal specific functions need only be concerned with generating the image. However optional interfaces are available to access the Wimp environment to allow more sophisticated fractal routines to be developed. In all cases it is essential to use only the provided interfaces and material. If you require additional functionality and support contact Mike Curnow so that the requirement can be reviewed and added to !Fractal. It is also essential to make your routines as maintainable as possible by using variables and symbolic definitions rather than hard coding values that may need to be changed at a later date. !Fractal drives function routines by notifying them of desktop events in a simplified manner. A control block is used to pass data to and from !Fractal. Plotting ======== The main purpose of your routine is to generate an image. Images are always in 256 colour mode, but may be of any size and x/y resolution (ie. any 256 colour mode). !Fractal provides image details to allow your routine cope with this - do not however try to obtain mode variables yourself because the image mode and screen modes can be different. Your routine is not aware if it is plotting to the screen or to a sprite, but it can use either direct memory access (the quickest) or the standard VDU calls such as OS_Plot. The VDU calls not acceptable are MODE change, palette change, etc. You should use the provided palette table to convert your logical colour into a VDU colour (more info later). When the plot_ded flag is on, you may plot until a menu mouse click is detected or plotting is complete. Alternatively, and when plot_ded is off, you must return to !Fractal at frequent intervals (say 1/20 second) to allow desktop multi-tasking. Zooming And Panning: Where possible you should allow for zooming and re-positioning of your image. !Fractal contains some support for this (define your function with fZoom support), but your routine will need to handle the magnification and offset. The x0,y0,w and h variables are assumed by !Fractal to represent the following values: ______ | | \ | | h The units are whatever is relevant to your function y0_|______| / |<- w -> x0 For functions such as Mandelbrots, zooming is handled by calculating the x & y delta values for each screen pixel: delta_x=w/im_w delta_y=h/im_h where im_w and im_h are the width and height of the image in pixels. For functions which use VDU plotting using OS_Units, the variables above should be some imaginary internal plotting units. To convert your units to OS_units the following scalars need to be calculated: scalar_x=(initial w/w)*(im_osx/initial w) Nb. brackets not really scalar_y=(initial h/h)*(im_osy/initial h) necessary To plot a point you then use PLOT func,x*scalar_x,y*scalar_y where x & y have been calculated by your program in internal units. The easiest way to support panning is to define the graphics origin prior to plotting. A suitable algorithm would be: ORIGIN (initial x0-x0)*scalar_x,(initial y0-y0)*scalar_y See the Sample assembler routine for an example of the above calculations. By selecting appropriate units you can reduce the calculations to: scalar_x=im_osx/w scalar_y=im_osx/y ORIGIN -x0*scalar_x,-y0*scalar_y Using such calculations helps to provide mode independence. X/Y Pixel Plotting: Mandelbrot type functions calculate the colour of each individual pixel. To support this !Fractal provides a fast X/Y plotter which calls your function for each pixel to be plotted. Full details are given later. Speed: where possible, provide speed ups. The Mandelbrot function for example uses three different routines, depending on the current zoom level. At lower zoom levels it uses integer arithmetic to speed up the generation process. Colours and Palette: In 256 colour modes there are logical colours (as used by GCOL + TINT) and physical colours (as stored on screen). !Fractal uses physical colours in its palette handling. Thus colour 0 (black) means low or not plottable, and 255 is high or maximum value. For functions such as Mandelbrots the colour is the number of iterations used. If you want physical colours 0-255 and use GCOL/TINT, then you should use the provided palette translate table (field im.pall) to translate your colour into the GCOL/TINT value. The table im.palp converts a logical colour number into its physical equivalent, whilst im.prgb converts a number in BBGGRRTT format to its physical equivalent. --------------------------------------------------------- | Note: in the following notes NIY=Not Implemented Yet. | --------------------------------------------------------- Function Definition =================== Each fractal function is defined by the following function block. mname (12 byte string): The unique name of the fractal function as shown in the menu. RiscOS file naming conventions apply, ie no spaces or periods etc. fcall (4 byte pointer): Address of the function entry point. ft (4 byte flags) : The function type. Flag settings are given below. xyrtn (4 byte pointer): Address of your x/y plotter, if supported. nvars (4 byte integer): Number of editable function variables. May be 0. vsize (4 byte integer): Total size of variables from 0-3500 bytes. wsize (4 byte integer): Size of work area required, if any d (4 byte pointer): Address of work area provided by !Fractal vars (AFG2 format) : 0 or more variables used to generate the image. vname (array of 12 byte strings): Names of the editable variables. The variables are stored with the sprite image. Editable variables are those accessible from the Image->Data menu. The function may have other variables which are not editable from this menu entry. The editable variables must come first, followed by the rest. After this comes an array containing the names of the variables as used in the Image->Data dialogue box. AFG2 variables are stored word aligned as follows: t: variable type - 3=float, 4=integer, 8=double, 128=string a: array count. 0=none, >0 means this variable is repeated +a times, but with only one AFG header. (Not supported for editable variables or strings). s: variable size excluding header, but including all array elements. For strings this is the maximum string length. Strings should be terminated with a zero byte. d: the data itself, word aligned. Function Types -------------- These flags settings describe the function to !Fractal. fZoom :Zoomable function. The variables x0,y0,w & h must be the first 4 variables of the function and must be type double (floating point). x0,y0 are the values of the bottom left of the screen, w=width and h=height. The values themselves are dependent on the function. !Fractal will automatically update these variables when a user zooms and pans around the image. fInf :Infinite function. The function continues plotting until the user selects Stop from the menu. fnoclear:When on, the prior will not be cleared on a redraw. A function can turn his on and off as required. This allows composite images to be created. fxy :The function uses x/y pixel plotting. See the X/Y Plotting Driver for full details. fe.... flags enable the related !Fractal function call: femenu :The function has it's own menu structure to be added to the main menu. fesprlod:The function will accept sprite file loads. feptr :Wimp pointer entering/leaving window events are required by the function. NIY fekeyinp:Wimp key press events are supported by the function. fedatald:Function can accept data load requests. fedatwdw:Function has its own data entry window. fdataerr: this bit is turned on by !Fractal when your data validation routine has rejected user input as invalid, and prevents a re-draw being performed until reset. This flag will be reset by !Fractal when the data is corrected, or when Init/Init Zoom are pressed. If your routine resets the data of its own accord, you should ensure this bit is cleared. Function Calls ============== Some calls are always made, others are only passed on if the event is enabled. Associated with each call is a parameter block which is described in the next section. However the first parameter is always a return code used to return basic information, which YOU MUST SET TO 0 unless stated. Other than setting the return code, simple functions only really need to respond to the fplot (do a plot) and fdatachk (verify data input) calls. The other functions provide additional facilities if you need them. finit ----- This call is made when !Fractal initialises and allows the function to initialise itself. The Templates file is open for template loading; heap_alloc may be called to request dynamic storage; loadfile may be called to load assembler subroutines etc. fselect ------- This call is made when the function has been selected by the user, to enable the creation of windows and any other initialisation. fdeselect --------- This call is made when the function has been de-selected by the user. Windows should be deleted and any temporary memory freed. fplotinit --------- This call is made when a new image is about to be drawn. The screen/sprite will have been cleared (unless fnoclear is set in the function definition), and all VDU variables set to their defaults. The function should do any pre-processing required, such as activating x/y plotting (see later) or set the origin. If the plot_fp flag is on (in plot.flags) then you should use a floating point routine rather than integer, if you provide both. This lets the user control the accuracy. This is used by the Mandelbrot & Julia routines. fplot ----- This call is made repeatedly after fplotinit until the image is completed unless x/y plotting is being used. Image completion is signalled by the function setting the return code to -1. On the first call the program is in dedicated mode which is maintained until the image is complete or the user presses Adjust on the mouse. The function can either use OS_Mouse to detect this event, or return to !Fractal which will perform the check. When not in dedicated mode (plot_ded flag off) the function must return every 1/20 second or so to allow desktop processing to continue. When switching from dedicated to non-dedicated mode the fields plot_addr and plot_base may be changed to reflect switching from the screen to a sprite, so these fields must be re-accessed on each plot call. This call is not made if the function uses x/y plotting. fdatachk -------- This call is made after the user has typed in new data variables or after zooming. The function should verify the values and if not acceptable, either return the address of an error message (in field errmsg) or correct the value. Return with return code=0 for OK and return code=1 if 1 or more values were invalid. If your function has the fZoom flag set, !Fractal automatically checks that the width and height are >0. fdatainit --------- This call is made when the user has requested the variables to be reset to their inital (default) values. All function variables should be reset accordingly, including zoom ones. fmenuinit (only if femenu enabled) --------- This call is made just prior to displaying the Wimp menu. The function should build its sub-menu structure and return its address as the second parameter, or return a handle of a window (dialogue box). fmenuclick (only if femenu enabled) ---------- The user has clicked over a menu selection belonging to the function. !Fractal passess the address of the integer array describing the menu selection made as returned by the Wimp. The array has a size of 10 where menu[0] refers to the top level of the menu structure and menu[1] will be the first item from your menu structure. Each array element contains the relative menu item number that was selected. The list is terminated by an element containing -1. !Fractal makes a pre-check for menu[1] not containing -1 (ie. no sub-menu selection made). The function should carry out any processing required. Set a return code of 1 to force a re-plot. fzoominit --------- This call is made on pressing Init Zoom. All zoom variables should be reset to their defaults. fkeyinp (only if fekeyinp enabled) ------- The user has pressed a key whilst the mouse was over a !Fractal window, and !Fractal does not understand how to process this key. This call allows users to navigate private data entry panels by the cursor keys etc. Set the return code to 0 if the key was processed, or -1 if not understood. See the IFS source for an example. fdataload (only if fedatald enabled) --------- The user has dragged a text file containing data for a function to !Fractal, and !Fractal could not automatically process the file. !Fractal passes the name of the file (in fname) to allow the function process it as required. The first line of text files must contain the function name (mname). See the IFS source for an example. fhelp ----- The !Help application has asked for help on a window and it is not a !Fractal window. Your routine should check the window handle passed and return a pointer to the id used within the <Frac$Dir>.helptext file to describe this window. The id is the same as the 1st parameter on each line of this file, the 2nd parameter is the icon number, and the 3rd is up to 200 characters of help text. See the IFS function for an example. fxypos ------ To get the image x/y value for any particular point call xy_start. Event fxypos will occur when the user presses select over the image. Only valid for functions defined as zoomable. Mandelbrots use this to select the Julia Real and Imaginary components. Set a return code of 1 to force a replot. fwdwclick (only if femenu enabled) --------- The user has clicked inside an unknown window/icon. The function should inspect the passed window handle and icon number to see if it should process it. On exit set the return code as follows: -1 : window click un-recognised (ie. do nothing) 0 : window click processed 1 : force a re-plot of the fractal 2 : close the menu structure See the IFS source for an example. fdatasave --------- A "Save As" operation for a function has completed. The full file name (in fname) is passed to the function to enable the file to be saved. To enable this process call the routine user_save to obtain the window handle of a "Save As" dialogue box which you then place in the function's own submenu structure. !Fractal automatically handles the dragging or click on the Ok button, checks for a valid filename, and then issues the fdatasave call. Typically the data will be saved in text format to allow re-loading by the fdataload operation. See the IFS source for an example. fnewrotation & fnewelevation ---------------------------- These function calls are made when the user has clicked on the rotation and elevation adjust icons. !Fractal passes the new angle to the function so that it can update it's own copy if interested. The function can also override the value - for instance to prevent the elevation going below 0-degrees - by updating the passed angle. Note that there are 4 function calls available to get and set these angles at other times. See threed.c for usage of these calls. fdatawdw (only if fedatwdw enabled) -------- The user has clicked on the numbers tool icon. This call is made to allow the function open its data entry window instead of the Image->Data window. The screen co-ordinates of the top left corner are passed as a suggested opening position. See ifs.c for an example. fsubmenu -------- A submenu is to be opened because the menu item has the wimp_MSUBLINKMSG flag set. This allows functions to dynamically create their own windows. The function should return the submenu pointer or a window handle. See c.ifs for an example. fspriteload (only if fesprlod set) ----------- A sprite file containing sprites in a 256 colour mode has been dragged onto a !Fractal window. The filename is passed - use the fsprite_load function to load the file. See the Fault function. Function Parameters =================== When a function is called, it is passed 2 parameters: 1) an integer containing the function call number. You should always refer to these by the symbolic names above. (in R0 for assembler routines). 2) the address of the function control block (in R1 for assembler). The layout of function control blocks is dependent on the function. The first parameter is always an integer (retc) that is used to pass back a return code to !Fractal. Return codes are documented in the Function Call section. Nb. The data types refer to the names used in C. * after the data type means a pointer to that type of data. finit: No additional information passed. fselect: No additional information passed. fdeselect: No additional information passed. fplotinit and fplot: The following information is passed: ------------------- integer x,y: The current image co-ordinates in pixels. On fplotinit x=0 and y=max. y co-ord-1, ie. the top left corner of the image. These values should be updated by x/y plotting functions as they procede. char * addr: current plot address. The function can update this value as it procedes. On fplotinit the value is the same as base. When switching from screen to sprite !Fractal will set this address based on the current x/y value. Thus functions which use direct image addressing should not be affected therefore by the switch. char * base: the address of the start of the image. This may be the screen or a sprite. The size of the image in bytes=image width*height in pixels. This value may switch from screen to sprite when exiting dedicated mode plotting. integer flags: plot_ded : will be on when in dedicated plotting mode. plot_fp : is on if the user requested use of floating point arithmetic if available. plot_zoom: this is a zoom redraw request, ie. redraw last image but with new co-ords. This flag is for functions that pick random values to tell them to use the previous values, not re-choose them. char * errmsg: if your plot routine needs to end with an error message, place the address of the zero-terminated message text in this field. Do not use Wimp_ReportError, since the error box will become part of the image! The image information control block follows. These values are for reference and will not change during plotting. integer w,h: image width and height in pixels. integer mode: image screen mode number. integer reserved. integer osx,osy: image width and height in OS units. integer xf,yf: The pixel to OS unit multipliers. integer reserved. char * pall: Address of a 256 byte block for converting a colour number into its logical equivalent. This is for routines that use colour 0 as low and colour 255 as high (such as mandelbrots). The table should be used to convert a calculated colour number (from 0 to 255) into a GCOL value (bits 0-5) and TINT value (bits 6-7). ie to set the GCOL value use the palette value AND &3F, and for TINT use palette AND &C0. integer xfs, yfs: The shift factor to convert pixels to OS units. char * palp: Address of a 256 byte table to convert a RiscOS logical colour number to its physical equivalent. Remember that RiscOS logical colours are composed of TTBBGGRR. char * prgb: Address of a 256 byte table to convert a number in the form BBGGRRTT to its physical equivalent. fdatachk -------- char * errmsg: On exit set this to the address of a null terminated string explaining the reason why a data variable is invalid. fdatainit & fzoominit : No additional information passed. --------------------- fmenuinit --------- wimp_menuptr fmenu: The function should set this to the address of a Wimp menu control block or a window handle. fmenuclick ---------- integer menu[10]: An array of numbers, terminated by -1, describing the menu selection made. The first part of a function's submenu will be element menu[1]. A value of 0 means the 1st entry in a sub-menu. fkeyinp ------- wimp_caretstr * c: The address of the caret information returned by the wimp. integer key: The extended ASCII code of the key pressed. See the PRM for the codes used for cursor, function keys etc. fxypos ------ double x,y: the x & y value (in function units) where the user clicked the mouse. fwdwclick --------- wimp_mousestr mouse: The wimp pointer information at the time of the click. fdataload & fspriteload: ----------------------- string * fname: Address of the full path name of the file to be loaded or saved. fnewrotation & fnewelevation: ---------------------------- integer angle: the new rotation or elevation angle. The called function may alter this value to keep it within it's supported range. fdatawdw: -------- wimp_box box: x0 and y1 are set to the co-ordinates for the top left of the data panel. fhelp: ----- wimp_mouse mouse: the mouse details as passed by the !Help application. The window handle (+12) is the main point of interest. char * id: Set this to the address of the window id name as used in the helptext file. fsubmenu: -------- wimp_menustr *ptr: the submenu pointer from the original menu structure. On return set this to the menu pointer or window handle to be opened. Set it to 0 if you use the itemlist_create function to open a window (see c.ifs). integer x,y: the mouse co-ords for the new menu/window. integer menu[10]: An array as for a menu click. See fmenuclick. Work Area --------- The work area addressed by the 'd' field of the function definition is a scratch pad for the function. It is shared amongst functions so don't use it for permanent data such as templates. Whilst a function remains selected it has exclusive use of this area and is a good place for menu structures etc. -------------------------------------------------------------------------- X/Y Plotting Details -------------------- If you implement a function where you colour each pixel dependent on the current x/y value, where your x/y values are mapped onto a pixel, then implementing X/Y plotting should simplify coding and provide better performance. Definition: you must define your function with fZoom, and therefore with x0, y0, width and height as the 1st four parameters (see Plotting section for the meaning of these). Also you must define your function with the fxy flag. Initialisation: When !Fractal makes the fplotinit call, you tell !Fractal 2 things. 1) Address of your plot routine - by placing its address in your function's xyrtn field. 2) Type of input values. The x & y data values must be in double format in your function definition. When your plot routine is called !Fractal will supply the current x/y value to be generated. The x/y values passed can be in two formats: double - by setting plot_dbl flag on in plot_flag fast float - by setting plot_ffp flag on in plot_flag integer - by setting plot_int27 on in plot_flag. Your routine should use the 27 bit fixed point assembler arithmetic functions described later. Plotting: !Fractal calls your plot function passing the current x & y as the first two parameters. ie for plot_int27 & plot_ffp functions, R0=x and R1=y on entry, where x and y are not the pixel x/y, but the values required by your function. Your function must return a value (in R0 for assembler functions) which will be used to set the pixel colour. Notes: !Fractal does not step through the pixel x/y's in sequence. There is no need to plot the colour yourself - just return its value. For assembler x/y plotters there is no need to save the registers except R13 and R14 if you want to use them. Assembler programmers are advised to take a close look at the supplied SampManJul source for a fully implemented version of the necessary code, or SampNewton for a float version. If you use plot_dbl in assembler the following notes apply: 1) F0 is in R0/R1, & F1 in R2/R3 (this is Acorn's standard, not mine!). 2) Float registers F4-F7 MUST be saved if you use them (Acorn again!), and restored on exit. Sample entry code for a plot_dbl function therefore is: .plot ADR R4,save where save is a 32 byte area STMIA R4,{R0-R3} store F0, F1 FNfp("LDFD F0,save") get F0 FNfp("LDFD F1,save+8") get F1 FNfp("STFD F4,save") save floats FNfp("STFD F5,save+8") FNfp("STFD F6,save+16") FNfp("STFD F7,save+24") -------------------------------------------------------------------------- Programming In C ================ All the materials are provided in the separate FracSource directory. The source code and make files are provided in the c directory, header files in the h directory, and pre-compiled routines in the o directory. The Make exec and the associated makefile will need editing to match your own C set up. It is assumed that you have a directory containing all the C material in the Acorn supplied directories. You should therefore only need to change the variable C$Path within 'Make' to point to this directory. To compile, simply double click on the Make file. Floppy Disc Owners: If you only have a single floppy disc then you'll need to create a RAM drive of around 600k to contain the C libraries since you can't get C plus the source onto a 800k disk. The RAM disk should contain clib, library and Risc_OSLib from your C disks. You could set up a disk with these directories all together (Acorn spread them over disks 1 and 2 in C release 3) and copy it to RAM at the start of your Fractal programming session. Don't be tempted to put the Fractal source onto RAM - sooner or later you'll lose your updates! The source code for fractal and other internal functions is not supplied so as to allow me to maintain overall control of this application since I am continuously updating it. If you need additional functionality added, then please write to me with your request. Adding Your Code and Making Changes ----------------------------------- It will be easiest for you to add your code either as a separate c file, or if the routine is short, to the general file called c.function1/c.function2. The various field names documented in the previous sections are all contained in the header h.Fractal. If you must make changes to existing code could you please mark your changes with leading and trailing comments so that I can readily spot it. This will allow me to merge your changes into the master source. Unmarked code will not get implemented. When adding a new routine you need to add it to c.funclist. Firstly add the name of the fractal definition to the array fracs, add an extern fdefn ... prior to this, and increment the variable nfunc. You may use the functions in fractal.h and fcommon.h - see other functions for examples of their usage. Fast Float Support ------------------ The functions in fp.h provide fast float arithmetic. Data must be of type fp_num - the '.i' is used when passing data to the functions, and '.f' when performing normal float arithmetic. Debugging --------- !Fractal traps all abends, and provides an environment allowing simple debugging. If you want to use Acorn's ASD then you need to supply -asd on Fractal's run statement. This will suppress the error trapping so that ASD will gain control. NOTE: if an error occurs during plotting (fplot or fplotinit) it is ESSENTIAL to issue a mode command (ie. *Echo <22><n>) prior to quitting ASD. Failure to do so will hang the machine (which is why !Fractal traps all errors!). You might like to set up a small exec file to do this. Background Information ---------------------- You will notice that I have decided to use "wimp.h" rather than the more powerful routines in win.h and wimpt.h. This arose partly because of my familiarity with the Wimp from ARM programming, and because I was alarmed at the size of code generated by the other routines. The c.MbrotJulia file is a good place to start to see how other functions have been implemented, since it uses a wide variety of facilities, including links to Assembler integer processing routines. The IFS and L-System source contain more advanced routines, including a lot of wimp handling. Please try to keep your routines free from compilation warning messages. My knowledge of C is self taught so I apologise for any crass misuses of the language. I have tried to keep the code as structured and clean as possible, and I hope you will try the same since we will need to read each others source. I am always open to suggestions for improvement (though getting me to admit I was wrong can be tricky at times!). -------------------------------------------------------------------------- Programming In ARM Assembler ============================ Assembler fractal routines are loaded by !Fractal at start up. Each module can contain one or more fractal functions. You are provided with the necessary symbolic definitions to define and access the data passed to your program. There are also some functions that can be called to control the operation of !Fractal itself. All the necessary BASIC libraries and sample programs are provided in the Asm directory. The Asm.sample does not draw a fractal, but illustrates the use of zooming, along with the basic support code required. You are advised to take a copy of Sample and use that as the basis of your routine. Alternatively use the SampManJul source which is a fully working version of a Mandelbrot and Julia plotter and contains most of the functions described below. It uses the x/y plotting functions and is a good place to start if you want to play around with Mandelbrot functions. Asm.SampNewton illustrates the use of the FPELIB (fast 32 bit floating point), and is a fully working version of the main Newton routine. When you have assembled your routine into <Frac$Dir>, you need to modify the !Fractal !Run file to load your program. More than one program can be loaded, just specify -a progname repeatedly as follows: RUN <Frac$Dir>.Fractal -a Sample The following comments go with the sample source. LIBRARY "<Frac$Dir>.Asm.Fraclib":PROCfracvars This library contains all the necessary symbolic definitions as described earlier in this document. You should use these symbolic names at all times to enable support of future releases of !Fractal which are likely to alter the control block offsets etc. Also in the library are functions which assemble a local copy of a control block. The necessary data can be copied to these areas (at fplotinit or fplot time) and then referenced directly in the program, which allows instructions of the form LDR R4,varname instead of LDR R4,[R1,#varname]. Calling PROCfracvars defines all the necessary variables for your program. It may be best to produce a printed listing of the source of Fraclib. LIBRARY "<Frac$Dir>.Asm.FPlib":PROCfpinit This library provides support for assembling floating point instructions, which will be required to provide zooming support. See the FP_Doc file for full information. FOR asm=4 TO 7 STEP 3 P%=0:O%=code% [OPT asm It is necessary to use offset assembly from location 0 because your program is loaded dynamically. Also FPLib requires the use of the variable asm. FNfrachdr This must be the first assembler statement. It defines a value which is checked when !Fractal loads your program to ensure your program has been assembled against the correct release of Fraclib - if it does not match then your routine needs re-assembling against Fraclib. DCD sample Points to a FNfracfunc DCD -1 End of function pointers Next, declare pointers to all of the fractal functions within this module, and terminate the list with -1. .sample FNfracfunc("name",entry_pt,fractal_type,xyrtn,no. of vars,var. size,work_size) This statement defines a fractal function, and is normally placed just preceding the function code itself. entry_pt is a label of the calling point of your program. fractal_type is the various bit settings to desribe the function - use the symbolic names described earlier. xyrtn is the address of your x/y plotter. Normally this is set to 0 in the definition, and set during fplotinit processing. no. of vars defines the number of editable variables, and var. size the total size of these. These variables must come next. work_size : set this to the amount of working storage area required. The address of this area will be at sample+fdefn_d. .varstart FNafg2var(variable type,array size,variable length): variable data .varend Sample uses the .varstart and .varend labels to delimit the program variables so that their size can be calculated by the assembler. Use FNafg2var to define the variable type and size. Variable types are AFG_int (integer), AFG_flt (short float), AFG_dbl (double float), AFG_str (zero terminated string). FNvarname(" name") Use this function to define the names of the variables. This function ensures the names are only 1-11 characters, zero-terminated and padded to 12 bytes. .entry_point FNfenter This must be the 1st statement of your fractal function. It performs essential linkage to Fractal. ; R0=Fractal Event, R1=Address of Data, R13=descending stack. On entry to your program R0 contains the fractal event number - use the symbolic names to decode. R1 contains the address of the fractal event control block. To access the data pointed to by R1 use instructions of the form: LDR R2,[R1,#plot_im_osx] An area of memory from R10-512 to R13 is available as temporary workspace, guaranteed to be at least 256 bytes, but typically what ever is left from the initial Wimpslot in !Run (so increase this if you need more). .exit_point FNfexit This function is used to exit back to Fractal. Do not try MOV PC,R14. FNfinterface Place this function at the end of your module to define the necessary interface routines. SYS "OS_File",10,"<Frac$Dir>.Sample",&FFA,,code%,O% This saves the assembled code as a relocatable module (though it is not eligible for the RMA) in the !Fractal library. Other FracLib Functions ----------------------- FracLib contains other functions which may be of use to assembler programs, such as integer arithmetic. Please feel free to contribute your own functions to this library by sending your Fraclib (with suitable documentation) along with your fractal routine, back to Mike Curnow. fxystart: call this routine to start the fxypos event described earlier. Your function must support zooming (fZoom flag on). When the user clicks over the fractal image, event fxypos is reported to your program, passing the x & y values (double format) at that point. eg. BL fxystart fnewfunc: call this routine to switch to a new function. R0 must point to a zero terminated fractal function name (as in the menu). Mandelbrot's use this to switch to their corresponding Julia set. eg. ADR R0,funcname ; address function BL fnewfunc ; perform switch FNfexit .funcname EQUS "Next func"+CHR$0 Note: functions such as FNfiminfoasm are to be placed directly inside assembler code. FNfiminfoasm Assembles a local copy of the Iminfo control block FNfplotasm Assembles a local copy of the fplot/fplotinit control block FNfmenu_hdr(title$,width%) FNfmenu_item(item$,submenu%,flag%) These assemble a simple WIMP menu structure. title$ : Menu title, 1-12 characters width% : Maximum width of title or item names, in the range 1-12 item$ : Name of the menu item, 1-12 characters. submenu% : -1 if no submenu or a window handle for a dialogue box flag% : use the symbol LAST to declare the last menu item. 27 Bit Fixed Point Functions ---------------------------- These functions support the multiplication of numbers which have 27 binary places, that is numbers in the format: sign bit, 4 bit whole number, an imaginary binary point followed by 27 bits. This provides support for numbers in the range +/- 16 with 8 decimal places but still using integer arithmetic (which is much faster than the floating point emulator). For multiplying you should make a pre-check to ensure the result does not exceed 16. To get numbers into this format use : DCD float<<27 Numbers in this format can be added and subtracted using the normal ADD and SUB instructions. Alternatively, use the following FP instructions: MOV R0,#1<<27 Get multiplier FNfp("FLT F0,R0") To FP format FNfp("LDFD F1,x") Get x value FNfp("MUFD F2,F1,F0") multiply by 1<<27 FNfp("FIX R1,F2") R1=x in integer format to 27 binary places FNm32_27(Rd,Rn,Rm,work) Rd=Rn*Rm Calculates Rd=Rn*Rm to 27 binary place accuracy. Rd, Rn and Rm MUST be different registers and not a work register. This function requires the use of 4 work registers numbered from work to work+3. Setting work to 11 will use R11,R12,R13,R14 which are often 'free' in maths routines - just remember to save & restore R13 & R14 or your program will crash terribly! FNsqr32_27(Rd,Rm,wk1,wk2) Rd=Rm*Rm This squares a number, and is faster than FNm32_27. wk1 and wk2 are 2 work registers. FNm16_27(Rd,Rn,Rm,work) Rd=Rn*Rm This is a high speed version of FNm32_27 which performs the calculation to 13 binary place accuracy (4 decimal places). Rd,Rn and Rm MUST be different registers. Rn & Rm can also be a work register in which case they will be corrupted. This function uses two work registers - work & work+1. FNsqr16_27(Rd,Rm,wk1) Rd=Rm*Rm This squares a number, and is faster than FNm16_27. wk1 is a work register. FNdivfp(Rd,Rn,Rm,work,places) Rd=Rn/Rm This divides 2 numbers. work specifies the 1st of four work registers. Rd,Rn and Rm MUST be different registers. places is the number of binary places in the source number eg. 27 for compatibility with the above functions. There is no check for overflow, whilst dividing by 0 is the same as dividing by 1. FPELib ------ You can use these functions instead of normal floating point instructions to get much needed speed improvement (the FPE isn't any faster in Assembler!). See Asm.SampNewton for an example of usage. Assembler Notes =============== R13 should be preserved at all times, and must be valid when calling the interface routines. To get started it is adviseable to transfer a ready working program. Keep it simple at first, ie. just handle the fplot call to build an image. It is likely you will have to remove hard coded image size values (number of x/y pixels) and use the passed values. Also you will probably have to convert some BASIC code that performs initial set up of values into FP assembler. Addresses: statements of the form .address DCD label will only assemble a relative address, that is the offset from the start of the module, due to the use of offset assembly. One way to overcome this problem is to use the following code instead: ADR R0,pointer real address of pointer LDR R1,pointer offset to location required ADD R0,R0,R1 real address of location required .pointer DCD label-P% offset to location "label" Alternatively you could calculate the real address of the start of your module, then add this value to all pointer constants during finit processing. Debugging --------- Debugging assembler is never easy. Those with access to C can use the supplied ASD (symbolic debugger) to help - see the C section for notes. !Fractal provides facilities to assist in debugging assembler programs. -debug Specify this as the 1st option on the fractal run statement in !Run. At start up time a file called Debug_Info will be written in the !Fractal directory. It will contain the addresses of all loaded files, fractal function definitions and entry points. !Fractal will always trap all errors and display an error box allowing you to cancel or to enter a debug environment (click Cancel). If you click Cancel !Fractal displays the error message and the registers at the time of abend. Note that the PC/R15 is usually 2 instructions past the one that failed, or 1 if a FP instruction was in error. You can enter any OS commands at the prompt - typically these would be MEMORY and MEMORYI to check out your program and data areas. Enter a null line to exit back to the desktop - you will get C's interpretation of events at this point. -------------------------------------------------------------------------- Mike Curnow 30 Bowen Drive, West Dulwich London SE21 8PN 081-670-8818 after 7pm
00000000 21 46 72 61 63 74 61 6c 20 49 6e 74 65 72 66 61 |!Fractal Interfa| 00000010 63 65 73 20 20 20 20 20 20 20 20 20 20 20 20 20 |ces | 00000020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000030 20 20 20 20 20 20 20 4c 61 73 74 20 75 70 64 61 | Last upda| 00000040 74 65 64 20 32 31 2f 30 33 2f 39 32 0a 3d 3d 3d |ted 21/03/92.===| 00000050 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 00000060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000080 20 20 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | ------------| 00000090 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 54 68 69 73 20 64 |---------.This d| 000000a0 6f 63 75 6d 65 6e 74 20 64 65 73 63 72 69 62 65 |ocument describe| 000000b0 73 20 74 68 65 20 21 46 72 61 63 74 61 6c 20 69 |s the !Fractal i| 000000c0 6e 74 65 72 66 61 63 65 73 20 61 6e 64 20 69 73 |nterfaces and is| 000000d0 20 70 72 6f 76 69 64 65 64 20 66 6f 72 0a 70 72 | provided for.pr| 000000e0 6f 67 72 61 6d 6d 65 72 73 20 77 61 6e 74 69 6e |ogrammers wantin| 000000f0 67 20 74 6f 20 61 64 64 20 74 68 65 69 72 20 6f |g to add their o| 00000100 77 6e 20 72 6f 75 74 69 6e 65 73 20 74 6f 20 21 |wn routines to !| 00000110 46 72 61 63 74 61 6c 2e 20 46 72 61 63 74 61 6c |Fractal. Fractal| 00000120 20 66 75 6e 63 74 69 6f 6e 73 0a 63 61 6e 20 62 | functions.can b| 00000130 65 20 70 72 6f 67 72 61 6d 6d 65 64 20 66 6f 72 |e programmed for| 00000140 20 21 46 72 61 63 74 61 6c 20 69 6e 20 41 52 4d | !Fractal in ARM| 00000150 20 61 73 73 65 6d 62 6c 65 72 2c 20 43 20 6f 72 | assembler, C or| 00000160 20 61 20 6d 69 78 74 75 72 65 20 6f 66 20 62 6f | a mixture of bo| 00000170 74 68 2e 20 54 6f 0a 75 73 65 20 43 20 63 6f 6e |th. To.use C con| 00000180 74 61 63 74 20 4d 69 6b 65 20 43 75 72 6e 6f 77 |tact Mike Curnow| 00000190 20 74 6f 20 6f 62 74 61 69 6e 20 74 68 65 20 6e | to obtain the n| 000001a0 65 63 65 73 73 61 72 79 20 73 6f 75 72 63 65 2e |ecessary source.| 000001b0 20 46 6f 72 20 41 52 4d 20 61 73 73 65 6d 62 6c | For ARM assembl| 000001c0 65 72 0a 61 6c 6c 20 74 68 65 20 6e 65 63 65 73 |er.all the neces| 000001d0 73 61 72 79 20 6d 61 74 65 72 69 61 6c 20 69 73 |sary material is| 000001e0 20 70 72 6f 76 69 64 65 64 2c 20 69 6e 63 6c 75 | provided, inclu| 000001f0 64 69 6e 67 20 46 50 6c 69 62 20 61 6e 64 20 73 |ding FPlib and s| 00000200 6f 6d 65 20 63 6f 6d 70 6c 65 74 65 0a 73 61 6d |ome complete.sam| 00000210 70 6c 65 20 73 6f 75 72 63 65 20 73 6b 65 6c 65 |ple source skele| 00000220 74 6f 6e 73 20 74 6f 20 67 65 74 20 79 6f 75 20 |tons to get you | 00000230 71 75 69 63 6b 6c 79 20 75 6e 64 65 72 20 77 61 |quickly under wa| 00000240 79 2e 0a 0a 54 6f 20 67 65 74 20 74 68 65 20 62 |y...To get the b| 00000250 65 73 74 20 66 72 6f 6d 20 21 46 72 61 63 74 61 |est from !Fracta| 00000260 6c 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65 64 20 |l you will need | 00000270 61 20 43 20 63 6f 6d 70 69 6c 65 72 20 2d 20 65 |a C compiler - e| 00000280 69 74 68 65 72 20 41 63 6f 72 6e 27 73 20 6f 72 |ither Acorn's or| 00000290 0a 42 65 65 62 75 67 27 73 2e 20 41 73 73 65 6d |.Beebug's. Assem| 000002a0 62 6c 65 72 20 72 6f 75 74 69 6e 65 73 20 68 61 |bler routines ha| 000002b0 76 65 20 61 63 63 65 73 73 20 74 6f 20 61 20 73 |ve access to a s| 000002c0 75 62 73 65 74 20 6f 66 20 74 68 65 20 66 75 6e |ubset of the fun| 000002d0 63 74 69 6f 6e 61 6c 69 74 79 20 6f 66 0a 43 20 |ctionality of.C | 000002e0 62 65 63 61 75 73 65 20 42 41 53 49 43 27 73 20 |because BASIC's | 000002f0 41 52 4d 20 61 73 73 65 6d 62 6c 65 72 20 64 6f |ARM assembler do| 00000300 65 73 20 6e 6f 74 20 70 72 6f 64 75 63 65 20 6f |es not produce o| 00000310 62 6a 65 63 74 20 66 69 6c 65 73 2e 20 41 6c 73 |bject files. Als| 00000320 6f 20 77 72 69 74 69 6e 67 0a 43 20 72 6f 75 74 |o writing.C rout| 00000330 69 6e 65 73 20 66 6f 72 20 21 46 72 61 63 74 61 |ines for !Fracta| 00000340 6c 20 69 73 20 61 20 6c 6f 74 20 65 61 73 69 65 |l is a lot easie| 00000350 72 20 74 68 61 6e 20 64 6f 69 6e 67 20 69 74 20 |r than doing it | 00000360 69 6e 20 41 73 73 65 6d 62 6c 65 72 21 0a 0a 54 |in Assembler!..T| 00000370 68 65 20 66 69 72 73 74 20 70 61 72 74 20 6f 66 |he first part of| 00000380 20 74 68 69 73 20 64 6f 63 75 6d 65 6e 74 20 63 | this document c| 00000390 6f 6e 74 61 69 6e 73 20 69 6e 66 6f 72 6d 61 74 |ontains informat| 000003a0 69 6f 6e 20 72 65 6c 65 76 61 6e 74 20 74 6f 20 |ion relevant to | 000003b0 41 52 4d 20 61 6e 64 20 43 2c 0a 61 6e 64 20 69 |ARM and C,.and i| 000003c0 73 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 6c 61 |s followed by la| 000003d0 6e 67 75 61 67 65 20 73 70 65 63 69 66 69 63 20 |nguage specific | 000003e0 64 65 74 61 69 6c 73 2e 20 49 74 20 69 73 20 62 |details. It is b| 000003f0 69 61 73 65 64 20 74 6f 77 61 72 64 73 20 43 20 |iased towards C | 00000400 62 65 63 61 75 73 65 0a 74 68 69 73 20 64 6f 63 |because.this doc| 00000410 75 6d 65 6e 74 20 69 73 20 74 68 65 20 63 65 6e |ument is the cen| 00000420 74 72 61 6c 20 72 65 66 65 72 65 6e 63 65 20 74 |tral reference t| 00000430 6f 20 21 46 72 61 63 74 61 6c 27 73 20 69 6e 74 |o !Fractal's int| 00000440 65 72 6e 61 6c 20 6f 70 65 72 61 74 69 6f 6e 2e |ernal operation.| 00000450 0a 0a 54 6f 20 67 65 74 20 79 6f 75 72 20 72 6f |..To get your ro| 00000460 75 74 69 6e 65 20 61 64 64 65 64 20 70 65 72 6d |utine added perm| 00000470 61 6e 65 6e 74 6c 79 20 74 6f 20 21 46 72 61 63 |anently to !Frac| 00000480 74 61 6c 20 73 65 6e 64 20 74 68 65 20 73 6f 75 |tal send the sou| 00000490 72 63 65 20 61 6e 64 0a 70 72 6f 67 72 61 6d 20 |rce and.program | 000004a0 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 74 6f |documentation to| 000004b0 20 4d 69 6b 65 20 43 75 72 6e 6f 77 2e 20 54 68 | Mike Curnow. Th| 000004c0 65 20 73 6f 75 72 63 65 20 69 73 20 6e 65 63 65 |e source is nece| 000004d0 73 73 61 72 79 20 74 6f 20 65 6e 61 62 6c 65 20 |ssary to enable | 000004e0 74 68 65 0a 72 6f 75 74 69 6e 65 20 74 6f 20 62 |the.routine to b| 000004f0 65 20 72 65 2d 63 6f 6d 70 69 6c 65 64 20 61 73 |e re-compiled as| 00000500 20 21 46 72 61 63 74 61 6c 20 63 68 61 6e 67 65 | !Fractal change| 00000510 73 2e 20 59 6f 75 20 77 69 6c 6c 20 72 65 63 65 |s. You will rece| 00000520 69 76 65 20 66 75 6c 6c 20 63 72 65 64 69 74 0a |ive full credit.| 00000530 66 6f 72 20 79 6f 75 72 20 77 6f 72 6b 2e 0a 0a |for your work...| 00000540 4f 76 65 72 76 69 65 77 0a 3d 3d 3d 3d 3d 3d 3d |Overview.=======| 00000550 3d 0a 21 46 72 61 63 74 61 6c 20 70 72 6f 76 69 |=.!Fractal provi| 00000560 64 65 73 20 74 68 65 20 6d 61 69 6e 20 57 69 6d |des the main Wim| 00000570 70 20 69 6e 74 65 72 66 61 63 65 73 20 61 6e 64 |p interfaces and| 00000580 20 63 6f 6d 6d 6f 6e 20 70 72 6f 63 65 73 73 69 | common processi| 00000590 6e 67 20 72 6f 75 74 69 6e 65 73 2e 0a 46 72 61 |ng routines..Fra| 000005a0 63 74 61 6c 20 73 70 65 63 69 66 69 63 20 66 75 |ctal specific fu| 000005b0 6e 63 74 69 6f 6e 73 20 6e 65 65 64 20 6f 6e 6c |nctions need onl| 000005c0 79 20 62 65 20 63 6f 6e 63 65 72 6e 65 64 20 77 |y be concerned w| 000005d0 69 74 68 20 67 65 6e 65 72 61 74 69 6e 67 20 74 |ith generating t| 000005e0 68 65 20 69 6d 61 67 65 2e 0a 48 6f 77 65 76 65 |he image..Howeve| 000005f0 72 20 6f 70 74 69 6f 6e 61 6c 20 69 6e 74 65 72 |r optional inter| 00000600 66 61 63 65 73 20 61 72 65 20 61 76 61 69 6c 61 |faces are availa| 00000610 62 6c 65 20 74 6f 20 61 63 63 65 73 73 20 74 68 |ble to access th| 00000620 65 20 57 69 6d 70 20 65 6e 76 69 72 6f 6e 6d 65 |e Wimp environme| 00000630 6e 74 20 74 6f 0a 61 6c 6c 6f 77 20 6d 6f 72 65 |nt to.allow more| 00000640 20 73 6f 70 68 69 73 74 69 63 61 74 65 64 20 66 | sophisticated f| 00000650 72 61 63 74 61 6c 20 72 6f 75 74 69 6e 65 73 20 |ractal routines | 00000660 74 6f 20 62 65 20 64 65 76 65 6c 6f 70 65 64 2e |to be developed.| 00000670 0a 0a 49 6e 20 61 6c 6c 20 63 61 73 65 73 20 69 |..In all cases i| 00000680 74 20 69 73 20 65 73 73 65 6e 74 69 61 6c 20 74 |t is essential t| 00000690 6f 20 75 73 65 20 6f 6e 6c 79 20 74 68 65 20 70 |o use only the p| 000006a0 72 6f 76 69 64 65 64 20 69 6e 74 65 72 66 61 63 |rovided interfac| 000006b0 65 73 20 61 6e 64 0a 6d 61 74 65 72 69 61 6c 2e |es and.material.| 000006c0 20 49 66 20 79 6f 75 20 72 65 71 75 69 72 65 20 | If you require | 000006d0 61 64 64 69 74 69 6f 6e 61 6c 20 66 75 6e 63 74 |additional funct| 000006e0 69 6f 6e 61 6c 69 74 79 20 61 6e 64 20 73 75 70 |ionality and sup| 000006f0 70 6f 72 74 20 63 6f 6e 74 61 63 74 20 4d 69 6b |port contact Mik| 00000700 65 0a 43 75 72 6e 6f 77 20 73 6f 20 74 68 61 74 |e.Curnow so that| 00000710 20 74 68 65 20 72 65 71 75 69 72 65 6d 65 6e 74 | the requirement| 00000720 20 63 61 6e 20 62 65 20 72 65 76 69 65 77 65 64 | can be reviewed| 00000730 20 61 6e 64 20 61 64 64 65 64 20 74 6f 20 21 46 | and added to !F| 00000740 72 61 63 74 61 6c 2e 20 49 74 20 69 73 0a 61 6c |ractal. It is.al| 00000750 73 6f 20 65 73 73 65 6e 74 69 61 6c 20 74 6f 20 |so essential to | 00000760 6d 61 6b 65 20 79 6f 75 72 20 72 6f 75 74 69 6e |make your routin| 00000770 65 73 20 61 73 20 6d 61 69 6e 74 61 69 6e 61 62 |es as maintainab| 00000780 6c 65 20 61 73 20 70 6f 73 73 69 62 6c 65 20 62 |le as possible b| 00000790 79 20 75 73 69 6e 67 0a 76 61 72 69 61 62 6c 65 |y using.variable| 000007a0 73 20 61 6e 64 20 73 79 6d 62 6f 6c 69 63 20 64 |s and symbolic d| 000007b0 65 66 69 6e 69 74 69 6f 6e 73 20 72 61 74 68 65 |efinitions rathe| 000007c0 72 20 74 68 61 6e 20 68 61 72 64 20 63 6f 64 69 |r than hard codi| 000007d0 6e 67 20 76 61 6c 75 65 73 20 74 68 61 74 20 6d |ng values that m| 000007e0 61 79 0a 6e 65 65 64 20 74 6f 20 62 65 20 63 68 |ay.need to be ch| 000007f0 61 6e 67 65 64 20 61 74 20 61 20 6c 61 74 65 72 |anged at a later| 00000800 20 64 61 74 65 2e 0a 0a 21 46 72 61 63 74 61 6c | date...!Fractal| 00000810 20 64 72 69 76 65 73 20 66 75 6e 63 74 69 6f 6e | drives function| 00000820 20 72 6f 75 74 69 6e 65 73 20 62 79 20 6e 6f 74 | routines by not| 00000830 69 66 79 69 6e 67 20 74 68 65 6d 20 6f 66 20 64 |ifying them of d| 00000840 65 73 6b 74 6f 70 20 65 76 65 6e 74 73 20 69 6e |esktop events in| 00000850 20 61 0a 73 69 6d 70 6c 69 66 69 65 64 20 6d 61 | a.simplified ma| 00000860 6e 6e 65 72 2e 20 41 20 63 6f 6e 74 72 6f 6c 20 |nner. A control | 00000870 62 6c 6f 63 6b 20 69 73 20 75 73 65 64 20 74 6f |block is used to| 00000880 20 70 61 73 73 20 64 61 74 61 20 74 6f 20 61 6e | pass data to an| 00000890 64 20 66 72 6f 6d 0a 21 46 72 61 63 74 61 6c 2e |d from.!Fractal.| 000008a0 0a 0a 50 6c 6f 74 74 69 6e 67 0a 3d 3d 3d 3d 3d |..Plotting.=====| 000008b0 3d 3d 3d 0a 54 68 65 20 6d 61 69 6e 20 70 75 72 |===.The main pur| 000008c0 70 6f 73 65 20 6f 66 20 79 6f 75 72 20 72 6f 75 |pose of your rou| 000008d0 74 69 6e 65 20 69 73 20 74 6f 20 67 65 6e 65 72 |tine is to gener| 000008e0 61 74 65 20 61 6e 20 69 6d 61 67 65 2e 20 49 6d |ate an image. Im| 000008f0 61 67 65 73 20 61 72 65 20 61 6c 77 61 79 73 0a |ages are always.| 00000900 69 6e 20 32 35 36 20 63 6f 6c 6f 75 72 20 6d 6f |in 256 colour mo| 00000910 64 65 2c 20 62 75 74 20 6d 61 79 20 62 65 20 6f |de, but may be o| 00000920 66 20 61 6e 79 20 73 69 7a 65 20 61 6e 64 20 78 |f any size and x| 00000930 2f 79 20 72 65 73 6f 6c 75 74 69 6f 6e 20 28 69 |/y resolution (i| 00000940 65 2e 20 61 6e 79 20 32 35 36 0a 63 6f 6c 6f 75 |e. any 256.colou| 00000950 72 20 6d 6f 64 65 29 2e 20 21 46 72 61 63 74 61 |r mode). !Fracta| 00000960 6c 20 70 72 6f 76 69 64 65 73 20 69 6d 61 67 65 |l provides image| 00000970 20 64 65 74 61 69 6c 73 20 74 6f 20 61 6c 6c 6f | details to allo| 00000980 77 20 79 6f 75 72 20 72 6f 75 74 69 6e 65 20 63 |w your routine c| 00000990 6f 70 65 0a 77 69 74 68 20 74 68 69 73 20 2d 20 |ope.with this - | 000009a0 64 6f 20 6e 6f 74 20 68 6f 77 65 76 65 72 20 74 |do not however t| 000009b0 72 79 20 74 6f 20 6f 62 74 61 69 6e 20 6d 6f 64 |ry to obtain mod| 000009c0 65 20 76 61 72 69 61 62 6c 65 73 20 79 6f 75 72 |e variables your| 000009d0 73 65 6c 66 20 62 65 63 61 75 73 65 20 74 68 65 |self because the| 000009e0 0a 69 6d 61 67 65 20 6d 6f 64 65 20 61 6e 64 20 |.image mode and | 000009f0 73 63 72 65 65 6e 20 6d 6f 64 65 73 20 63 61 6e |screen modes can| 00000a00 20 62 65 20 64 69 66 66 65 72 65 6e 74 2e 0a 0a | be different...| 00000a10 59 6f 75 72 20 72 6f 75 74 69 6e 65 20 69 73 20 |Your routine is | 00000a20 6e 6f 74 20 61 77 61 72 65 20 69 66 20 69 74 20 |not aware if it | 00000a30 69 73 20 70 6c 6f 74 74 69 6e 67 20 74 6f 20 74 |is plotting to t| 00000a40 68 65 20 73 63 72 65 65 6e 20 6f 72 20 74 6f 20 |he screen or to | 00000a50 61 20 73 70 72 69 74 65 2c 0a 62 75 74 20 69 74 |a sprite,.but it| 00000a60 20 63 61 6e 20 75 73 65 20 65 69 74 68 65 72 20 | can use either | 00000a70 64 69 72 65 63 74 20 6d 65 6d 6f 72 79 20 61 63 |direct memory ac| 00000a80 63 65 73 73 20 28 74 68 65 20 71 75 69 63 6b 65 |cess (the quicke| 00000a90 73 74 29 20 6f 72 20 74 68 65 20 73 74 61 6e 64 |st) or the stand| 00000aa0 61 72 64 0a 56 44 55 20 63 61 6c 6c 73 20 73 75 |ard.VDU calls su| 00000ab0 63 68 20 61 73 20 4f 53 5f 50 6c 6f 74 2e 20 54 |ch as OS_Plot. T| 00000ac0 68 65 20 56 44 55 20 63 61 6c 6c 73 20 6e 6f 74 |he VDU calls not| 00000ad0 20 61 63 63 65 70 74 61 62 6c 65 20 61 72 65 20 | acceptable are | 00000ae0 4d 4f 44 45 20 63 68 61 6e 67 65 2c 0a 70 61 6c |MODE change,.pal| 00000af0 65 74 74 65 20 63 68 61 6e 67 65 2c 20 65 74 63 |ette change, etc| 00000b00 2e 20 59 6f 75 20 73 68 6f 75 6c 64 20 75 73 65 |. You should use| 00000b10 20 74 68 65 20 70 72 6f 76 69 64 65 64 20 70 61 | the provided pa| 00000b20 6c 65 74 74 65 20 74 61 62 6c 65 20 74 6f 20 63 |lette table to c| 00000b30 6f 6e 76 65 72 74 0a 79 6f 75 72 20 6c 6f 67 69 |onvert.your logi| 00000b40 63 61 6c 20 63 6f 6c 6f 75 72 20 69 6e 74 6f 20 |cal colour into | 00000b50 61 20 56 44 55 20 63 6f 6c 6f 75 72 20 28 6d 6f |a VDU colour (mo| 00000b60 72 65 20 69 6e 66 6f 20 6c 61 74 65 72 29 2e 0a |re info later)..| 00000b70 20 20 20 20 20 20 20 20 20 20 20 0a 57 68 65 6e | .When| 00000b80 20 74 68 65 20 70 6c 6f 74 5f 64 65 64 20 66 6c | the plot_ded fl| 00000b90 61 67 20 69 73 20 6f 6e 2c 20 79 6f 75 20 6d 61 |ag is on, you ma| 00000ba0 79 20 70 6c 6f 74 20 75 6e 74 69 6c 20 61 20 6d |y plot until a m| 00000bb0 65 6e 75 20 6d 6f 75 73 65 20 63 6c 69 63 6b 20 |enu mouse click | 00000bc0 69 73 0a 64 65 74 65 63 74 65 64 20 6f 72 20 70 |is.detected or p| 00000bd0 6c 6f 74 74 69 6e 67 20 69 73 20 63 6f 6d 70 6c |lotting is compl| 00000be0 65 74 65 2e 20 41 6c 74 65 72 6e 61 74 69 76 65 |ete. Alternative| 00000bf0 6c 79 2c 20 61 6e 64 20 77 68 65 6e 20 70 6c 6f |ly, and when plo| 00000c00 74 5f 64 65 64 20 69 73 20 6f 66 66 2c 0a 79 6f |t_ded is off,.yo| 00000c10 75 20 6d 75 73 74 20 72 65 74 75 72 6e 20 74 6f |u must return to| 00000c20 20 21 46 72 61 63 74 61 6c 20 61 74 20 66 72 65 | !Fractal at fre| 00000c30 71 75 65 6e 74 20 69 6e 74 65 72 76 61 6c 73 20 |quent intervals | 00000c40 28 73 61 79 20 31 2f 32 30 20 73 65 63 6f 6e 64 |(say 1/20 second| 00000c50 29 20 74 6f 20 61 6c 6c 6f 77 0a 64 65 73 6b 74 |) to allow.deskt| 00000c60 6f 70 20 6d 75 6c 74 69 2d 74 61 73 6b 69 6e 67 |op multi-tasking| 00000c70 2e 0a 0a 5a 6f 6f 6d 69 6e 67 20 41 6e 64 20 50 |...Zooming And P| 00000c80 61 6e 6e 69 6e 67 3a 0a 57 68 65 72 65 20 70 6f |anning:.Where po| 00000c90 73 73 69 62 6c 65 20 79 6f 75 20 73 68 6f 75 6c |ssible you shoul| 00000ca0 64 20 61 6c 6c 6f 77 20 66 6f 72 20 7a 6f 6f 6d |d allow for zoom| 00000cb0 69 6e 67 20 61 6e 64 20 72 65 2d 70 6f 73 69 74 |ing and re-posit| 00000cc0 69 6f 6e 69 6e 67 20 6f 66 20 79 6f 75 72 0a 69 |ioning of your.i| 00000cd0 6d 61 67 65 2e 20 21 46 72 61 63 74 61 6c 20 63 |mage. !Fractal c| 00000ce0 6f 6e 74 61 69 6e 73 20 73 6f 6d 65 20 73 75 70 |ontains some sup| 00000cf0 70 6f 72 74 20 66 6f 72 20 74 68 69 73 20 28 64 |port for this (d| 00000d00 65 66 69 6e 65 20 79 6f 75 72 20 66 75 6e 63 74 |efine your funct| 00000d10 69 6f 6e 20 77 69 74 68 0a 66 5a 6f 6f 6d 20 73 |ion with.fZoom s| 00000d20 75 70 70 6f 72 74 29 2c 20 62 75 74 20 79 6f 75 |upport), but you| 00000d30 72 20 72 6f 75 74 69 6e 65 20 77 69 6c 6c 20 6e |r routine will n| 00000d40 65 65 64 20 74 6f 20 68 61 6e 64 6c 65 20 74 68 |eed to handle th| 00000d50 65 20 6d 61 67 6e 69 66 69 63 61 74 69 6f 6e 20 |e magnification | 00000d60 61 6e 64 0a 6f 66 66 73 65 74 2e 20 54 68 65 20 |and.offset. The | 00000d70 78 30 2c 79 30 2c 77 20 61 6e 64 20 68 20 76 61 |x0,y0,w and h va| 00000d80 72 69 61 62 6c 65 73 20 61 72 65 20 61 73 73 75 |riables are assu| 00000d90 6d 65 64 20 62 79 20 21 46 72 61 63 74 61 6c 20 |med by !Fractal | 00000da0 74 6f 20 72 65 70 72 65 73 65 6e 74 20 74 68 65 |to represent the| 00000db0 0a 66 6f 6c 6c 6f 77 69 6e 67 20 76 61 6c 75 65 |.following value| 00000dc0 73 3a 0a 20 20 20 20 20 20 20 5f 5f 5f 5f 5f 5f |s:. ______| 00000dd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000de0 20 20 20 0a 20 20 20 20 20 20 7c 20 20 20 20 20 | . | | 00000df0 20 7c 20 5c 0a 20 20 20 20 20 20 7c 20 20 20 20 | | \. | | 00000e00 20 20 7c 20 68 20 20 20 20 20 20 20 20 54 68 65 | | h The| 00000e10 20 75 6e 69 74 73 20 61 72 65 20 77 68 61 74 65 | units are whate| 00000e20 76 65 72 20 69 73 20 72 65 6c 65 76 61 6e 74 20 |ver is relevant | 00000e30 74 6f 20 79 6f 75 72 20 66 75 6e 63 74 69 6f 6e |to your function| 00000e40 0a 20 20 20 79 30 5f 7c 5f 5f 5f 5f 5f 5f 7c 20 |. y0_|______| | 00000e50 2f 0a 20 20 20 20 20 20 7c 3c 2d 20 77 20 2d 3e |/. |<- w ->| 00000e60 0a 20 20 20 20 20 78 30 0a 0a 46 6f 72 20 66 75 |. x0..For fu| 00000e70 6e 63 74 69 6f 6e 73 20 73 75 63 68 20 61 73 20 |nctions such as | 00000e80 4d 61 6e 64 65 6c 62 72 6f 74 73 2c 20 7a 6f 6f |Mandelbrots, zoo| 00000e90 6d 69 6e 67 20 69 73 20 68 61 6e 64 6c 65 64 20 |ming is handled | 00000ea0 62 79 20 63 61 6c 63 75 6c 61 74 69 6e 67 20 74 |by calculating t| 00000eb0 68 65 20 78 20 26 0a 79 20 64 65 6c 74 61 20 76 |he x &.y delta v| 00000ec0 61 6c 75 65 73 20 66 6f 72 20 65 61 63 68 20 73 |alues for each s| 00000ed0 63 72 65 65 6e 20 70 69 78 65 6c 3a 0a 20 20 20 |creen pixel:. | 00000ee0 20 20 20 64 65 6c 74 61 5f 78 3d 77 2f 69 6d 5f | delta_x=w/im_| 00000ef0 77 20 20 20 20 20 20 20 64 65 6c 74 61 5f 79 3d |w delta_y=| 00000f00 68 2f 69 6d 5f 68 0a 77 68 65 72 65 20 69 6d 5f |h/im_h.where im_| 00000f10 77 20 61 6e 64 20 69 6d 5f 68 20 61 72 65 20 74 |w and im_h are t| 00000f20 68 65 20 77 69 64 74 68 20 61 6e 64 20 68 65 69 |he width and hei| 00000f30 67 68 74 20 6f 66 20 74 68 65 20 69 6d 61 67 65 |ght of the image| 00000f40 20 69 6e 20 70 69 78 65 6c 73 2e 0a 0a 46 6f 72 | in pixels...For| 00000f50 20 66 75 6e 63 74 69 6f 6e 73 20 77 68 69 63 68 | functions which| 00000f60 20 75 73 65 20 56 44 55 20 70 6c 6f 74 74 69 6e | use VDU plottin| 00000f70 67 20 75 73 69 6e 67 20 4f 53 5f 55 6e 69 74 73 |g using OS_Units| 00000f80 2c 20 74 68 65 20 76 61 72 69 61 62 6c 65 73 20 |, the variables | 00000f90 61 62 6f 76 65 0a 73 68 6f 75 6c 64 20 62 65 20 |above.should be | 00000fa0 73 6f 6d 65 20 69 6d 61 67 69 6e 61 72 79 20 69 |some imaginary i| 00000fb0 6e 74 65 72 6e 61 6c 20 70 6c 6f 74 74 69 6e 67 |nternal plotting| 00000fc0 20 75 6e 69 74 73 2e 20 54 6f 20 63 6f 6e 76 65 | units. To conve| 00000fd0 72 74 20 79 6f 75 72 20 75 6e 69 74 73 20 74 6f |rt your units to| 00000fe0 0a 4f 53 5f 75 6e 69 74 73 20 74 68 65 20 66 6f |.OS_units the fo| 00000ff0 6c 6c 6f 77 69 6e 67 20 73 63 61 6c 61 72 73 20 |llowing scalars | 00001000 6e 65 65 64 20 74 6f 20 62 65 20 63 61 6c 63 75 |need to be calcu| 00001010 6c 61 74 65 64 3a 0a 20 20 20 20 20 73 63 61 6c |lated:. scal| 00001020 61 72 5f 78 3d 28 69 6e 69 74 69 61 6c 20 77 2f |ar_x=(initial w/| 00001030 77 29 2a 28 69 6d 5f 6f 73 78 2f 69 6e 69 74 69 |w)*(im_osx/initi| 00001040 61 6c 20 77 29 20 20 20 20 4e 62 2e 20 62 72 61 |al w) Nb. bra| 00001050 63 6b 65 74 73 20 6e 6f 74 20 72 65 61 6c 6c 79 |ckets not really| 00001060 20 0a 20 20 20 20 20 73 63 61 6c 61 72 5f 79 3d | . scalar_y=| 00001070 28 69 6e 69 74 69 61 6c 20 68 2f 68 29 2a 28 69 |(initial h/h)*(i| 00001080 6d 5f 6f 73 79 2f 69 6e 69 74 69 61 6c 20 68 29 |m_osy/initial h)| 00001090 20 20 20 20 20 20 20 20 6e 65 63 65 73 73 61 72 | necessar| 000010a0 79 0a 54 6f 20 70 6c 6f 74 20 61 20 70 6f 69 6e |y.To plot a poin| 000010b0 74 20 79 6f 75 20 74 68 65 6e 20 75 73 65 20 50 |t you then use P| 000010c0 4c 4f 54 20 66 75 6e 63 2c 78 2a 73 63 61 6c 61 |LOT func,x*scala| 000010d0 72 5f 78 2c 79 2a 73 63 61 6c 61 72 5f 79 20 77 |r_x,y*scalar_y w| 000010e0 68 65 72 65 20 78 20 26 20 79 0a 68 61 76 65 20 |here x & y.have | 000010f0 62 65 65 6e 20 63 61 6c 63 75 6c 61 74 65 64 20 |been calculated | 00001100 62 79 20 79 6f 75 72 20 70 72 6f 67 72 61 6d 20 |by your program | 00001110 69 6e 20 69 6e 74 65 72 6e 61 6c 20 75 6e 69 74 |in internal unit| 00001120 73 2e 0a 0a 54 68 65 20 65 61 73 69 65 73 74 20 |s...The easiest | 00001130 77 61 79 20 74 6f 20 73 75 70 70 6f 72 74 20 70 |way to support p| 00001140 61 6e 6e 69 6e 67 20 69 73 20 74 6f 20 64 65 66 |anning is to def| 00001150 69 6e 65 20 74 68 65 20 67 72 61 70 68 69 63 73 |ine the graphics| 00001160 20 6f 72 69 67 69 6e 20 70 72 69 6f 72 20 74 6f | origin prior to| 00001170 0a 70 6c 6f 74 74 69 6e 67 2e 20 41 20 73 75 69 |.plotting. A sui| 00001180 74 61 62 6c 65 20 61 6c 67 6f 72 69 74 68 6d 20 |table algorithm | 00001190 77 6f 75 6c 64 20 62 65 3a 0a 0a 20 20 20 4f 52 |would be:.. OR| 000011a0 49 47 49 4e 20 28 69 6e 69 74 69 61 6c 20 78 30 |IGIN (initial x0| 000011b0 2d 78 30 29 2a 73 63 61 6c 61 72 5f 78 2c 28 69 |-x0)*scalar_x,(i| 000011c0 6e 69 74 69 61 6c 20 79 30 2d 79 30 29 2a 73 63 |nitial y0-y0)*sc| 000011d0 61 6c 61 72 5f 79 0a 0a 53 65 65 20 74 68 65 20 |alar_y..See the | 000011e0 53 61 6d 70 6c 65 20 61 73 73 65 6d 62 6c 65 72 |Sample assembler| 000011f0 20 72 6f 75 74 69 6e 65 20 66 6f 72 20 61 6e 20 | routine for an | 00001200 65 78 61 6d 70 6c 65 20 6f 66 20 74 68 65 20 61 |example of the a| 00001210 62 6f 76 65 20 63 61 6c 63 75 6c 61 74 69 6f 6e |bove calculation| 00001220 73 2e 0a 42 79 20 73 65 6c 65 63 74 69 6e 67 20 |s..By selecting | 00001230 61 70 70 72 6f 70 72 69 61 74 65 20 75 6e 69 74 |appropriate unit| 00001240 73 20 79 6f 75 20 63 61 6e 20 72 65 64 75 63 65 |s you can reduce| 00001250 20 74 68 65 20 63 61 6c 63 75 6c 61 74 69 6f 6e | the calculation| 00001260 73 20 74 6f 3a 0a 20 20 20 20 20 73 63 61 6c 61 |s to:. scala| 00001270 72 5f 78 3d 69 6d 5f 6f 73 78 2f 77 20 20 20 20 |r_x=im_osx/w | 00001280 0a 20 20 20 20 20 73 63 61 6c 61 72 5f 79 3d 69 |. scalar_y=i| 00001290 6d 5f 6f 73 78 2f 79 20 20 20 20 0a 20 20 20 20 |m_osx/y . | 000012a0 20 4f 52 49 47 49 4e 20 2d 78 30 2a 73 63 61 6c | ORIGIN -x0*scal| 000012b0 61 72 5f 78 2c 2d 79 30 2a 73 63 61 6c 61 72 5f |ar_x,-y0*scalar_| 000012c0 79 0a 55 73 69 6e 67 20 73 75 63 68 20 63 61 6c |y.Using such cal| 000012d0 63 75 6c 61 74 69 6f 6e 73 20 68 65 6c 70 73 20 |culations helps | 000012e0 74 6f 20 70 72 6f 76 69 64 65 20 6d 6f 64 65 20 |to provide mode | 000012f0 69 6e 64 65 70 65 6e 64 65 6e 63 65 2e 0a 0a 58 |independence...X| 00001300 2f 59 20 50 69 78 65 6c 20 50 6c 6f 74 74 69 6e |/Y Pixel Plottin| 00001310 67 3a 20 4d 61 6e 64 65 6c 62 72 6f 74 20 74 79 |g: Mandelbrot ty| 00001320 70 65 20 66 75 6e 63 74 69 6f 6e 73 20 63 61 6c |pe functions cal| 00001330 63 75 6c 61 74 65 20 74 68 65 20 63 6f 6c 6f 75 |culate the colou| 00001340 72 20 6f 66 20 65 61 63 68 0a 69 6e 64 69 76 69 |r of each.indivi| 00001350 64 75 61 6c 20 70 69 78 65 6c 2e 20 54 6f 20 73 |dual pixel. To s| 00001360 75 70 70 6f 72 74 20 74 68 69 73 20 21 46 72 61 |upport this !Fra| 00001370 63 74 61 6c 20 70 72 6f 76 69 64 65 73 20 61 20 |ctal provides a | 00001380 66 61 73 74 20 58 2f 59 20 70 6c 6f 74 74 65 72 |fast X/Y plotter| 00001390 20 77 68 69 63 68 0a 63 61 6c 6c 73 20 79 6f 75 | which.calls you| 000013a0 72 20 66 75 6e 63 74 69 6f 6e 20 66 6f 72 20 65 |r function for e| 000013b0 61 63 68 20 70 69 78 65 6c 20 74 6f 20 62 65 20 |ach pixel to be | 000013c0 70 6c 6f 74 74 65 64 2e 20 46 75 6c 6c 20 64 65 |plotted. Full de| 000013d0 74 61 69 6c 73 20 61 72 65 20 67 69 76 65 6e 0a |tails are given.| 000013e0 6c 61 74 65 72 2e 0a 20 20 0a 53 70 65 65 64 3a |later.. .Speed:| 000013f0 20 77 68 65 72 65 20 70 6f 73 73 69 62 6c 65 2c | where possible,| 00001400 20 70 72 6f 76 69 64 65 20 73 70 65 65 64 20 75 | provide speed u| 00001410 70 73 2e 20 54 68 65 20 4d 61 6e 64 65 6c 62 72 |ps. The Mandelbr| 00001420 6f 74 20 66 75 6e 63 74 69 6f 6e 20 66 6f 72 0a |ot function for.| 00001430 65 78 61 6d 70 6c 65 20 75 73 65 73 20 74 68 72 |example uses thr| 00001440 65 65 20 64 69 66 66 65 72 65 6e 74 20 72 6f 75 |ee different rou| 00001450 74 69 6e 65 73 2c 20 64 65 70 65 6e 64 69 6e 67 |tines, depending| 00001460 20 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 20 | on the current | 00001470 7a 6f 6f 6d 20 6c 65 76 65 6c 2e 0a 41 74 20 6c |zoom level..At l| 00001480 6f 77 65 72 20 7a 6f 6f 6d 20 6c 65 76 65 6c 73 |ower zoom levels| 00001490 20 69 74 20 75 73 65 73 20 69 6e 74 65 67 65 72 | it uses integer| 000014a0 20 61 72 69 74 68 6d 65 74 69 63 20 74 6f 20 73 | arithmetic to s| 000014b0 70 65 65 64 20 75 70 20 74 68 65 20 67 65 6e 65 |peed up the gene| 000014c0 72 61 74 69 6f 6e 0a 70 72 6f 63 65 73 73 2e 0a |ration.process..| 000014d0 0a 43 6f 6c 6f 75 72 73 20 61 6e 64 20 50 61 6c |.Colours and Pal| 000014e0 65 74 74 65 3a 20 49 6e 20 32 35 36 20 63 6f 6c |ette: In 256 col| 000014f0 6f 75 72 20 6d 6f 64 65 73 20 74 68 65 72 65 20 |our modes there | 00001500 61 72 65 20 6c 6f 67 69 63 61 6c 20 63 6f 6c 6f |are logical colo| 00001510 75 72 73 20 28 61 73 20 75 73 65 64 0a 62 79 20 |urs (as used.by | 00001520 47 43 4f 4c 20 2b 20 54 49 4e 54 29 20 61 6e 64 |GCOL + TINT) and| 00001530 20 70 68 79 73 69 63 61 6c 20 63 6f 6c 6f 75 72 | physical colour| 00001540 73 20 28 61 73 20 73 74 6f 72 65 64 20 6f 6e 20 |s (as stored on | 00001550 73 63 72 65 65 6e 29 2e 20 21 46 72 61 63 74 61 |screen). !Fracta| 00001560 6c 20 75 73 65 73 0a 70 68 79 73 69 63 61 6c 20 |l uses.physical | 00001570 63 6f 6c 6f 75 72 73 20 69 6e 20 69 74 73 20 70 |colours in its p| 00001580 61 6c 65 74 74 65 20 68 61 6e 64 6c 69 6e 67 2e |alette handling.| 00001590 20 54 68 75 73 20 63 6f 6c 6f 75 72 20 30 20 28 | Thus colour 0 (| 000015a0 62 6c 61 63 6b 29 20 6d 65 61 6e 73 20 6c 6f 77 |black) means low| 000015b0 20 6f 72 0a 6e 6f 74 20 70 6c 6f 74 74 61 62 6c | or.not plottabl| 000015c0 65 2c 20 61 6e 64 20 32 35 35 20 69 73 20 68 69 |e, and 255 is hi| 000015d0 67 68 20 6f 72 20 6d 61 78 69 6d 75 6d 20 76 61 |gh or maximum va| 000015e0 6c 75 65 2e 20 46 6f 72 20 66 75 6e 63 74 69 6f |lue. For functio| 000015f0 6e 73 20 73 75 63 68 20 61 73 0a 4d 61 6e 64 65 |ns such as.Mande| 00001600 6c 62 72 6f 74 73 20 74 68 65 20 63 6f 6c 6f 75 |lbrots the colou| 00001610 72 20 69 73 20 74 68 65 20 6e 75 6d 62 65 72 20 |r is the number | 00001620 6f 66 20 69 74 65 72 61 74 69 6f 6e 73 20 75 73 |of iterations us| 00001630 65 64 2e 0a 0a 49 66 20 79 6f 75 20 77 61 6e 74 |ed...If you want| 00001640 20 70 68 79 73 69 63 61 6c 20 63 6f 6c 6f 75 72 | physical colour| 00001650 73 20 30 2d 32 35 35 20 61 6e 64 20 75 73 65 20 |s 0-255 and use | 00001660 47 43 4f 4c 2f 54 49 4e 54 2c 20 74 68 65 6e 20 |GCOL/TINT, then | 00001670 79 6f 75 20 73 68 6f 75 6c 64 20 75 73 65 20 74 |you should use t| 00001680 68 65 0a 70 72 6f 76 69 64 65 64 20 70 61 6c 65 |he.provided pale| 00001690 74 74 65 20 74 72 61 6e 73 6c 61 74 65 20 74 61 |tte translate ta| 000016a0 62 6c 65 20 28 66 69 65 6c 64 20 69 6d 2e 70 61 |ble (field im.pa| 000016b0 6c 6c 29 20 74 6f 20 74 72 61 6e 73 6c 61 74 65 |ll) to translate| 000016c0 20 79 6f 75 72 20 63 6f 6c 6f 75 72 0a 69 6e 74 | your colour.int| 000016d0 6f 20 74 68 65 20 47 43 4f 4c 2f 54 49 4e 54 20 |o the GCOL/TINT | 000016e0 76 61 6c 75 65 2e 20 54 68 65 20 74 61 62 6c 65 |value. The table| 000016f0 20 69 6d 2e 70 61 6c 70 20 63 6f 6e 76 65 72 74 | im.palp convert| 00001700 73 20 61 20 6c 6f 67 69 63 61 6c 20 63 6f 6c 6f |s a logical colo| 00001710 75 72 20 6e 75 6d 62 65 72 0a 69 6e 74 6f 20 69 |ur number.into i| 00001720 74 73 20 70 68 79 73 69 63 61 6c 20 65 71 75 69 |ts physical equi| 00001730 76 61 6c 65 6e 74 2c 20 77 68 69 6c 73 74 20 69 |valent, whilst i| 00001740 6d 2e 70 72 67 62 20 63 6f 6e 76 65 72 74 73 20 |m.prgb converts | 00001750 61 20 6e 75 6d 62 65 72 20 69 6e 20 42 42 47 47 |a number in BBGG| 00001760 52 52 54 54 0a 66 6f 72 6d 61 74 20 74 6f 20 69 |RRTT.format to i| 00001770 74 73 20 70 68 79 73 69 63 61 6c 20 65 71 75 69 |ts physical equi| 00001780 76 61 6c 65 6e 74 2e 0a 0a 2d 2d 2d 2d 2d 2d 2d |valent...-------| 00001790 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000017c0 2d 2d 0a 7c 20 4e 6f 74 65 3a 20 69 6e 20 74 68 |--.| Note: in th| 000017d0 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 6e 6f 74 65 |e following note| 000017e0 73 20 4e 49 59 3d 4e 6f 74 20 49 6d 70 6c 65 6d |s NIY=Not Implem| 000017f0 65 6e 74 65 64 20 59 65 74 2e 20 7c 0a 2d 2d 2d |ented Yet. |.---| 00001800 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001830 2d 2d 2d 2d 2d 2d 0a 0a 46 75 6e 63 74 69 6f 6e |------..Function| 00001840 20 44 65 66 69 6e 69 74 69 6f 6e 0a 3d 3d 3d 3d | Definition.====| 00001850 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a |===============.| 00001860 45 61 63 68 20 66 72 61 63 74 61 6c 20 66 75 6e |Each fractal fun| 00001870 63 74 69 6f 6e 20 69 73 20 64 65 66 69 6e 65 64 |ction is defined| 00001880 20 62 79 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e | by the followin| 00001890 67 20 66 75 6e 63 74 69 6f 6e 20 62 6c 6f 63 6b |g function block| 000018a0 2e 0a 0a 6d 6e 61 6d 65 20 28 31 32 20 62 79 74 |...mname (12 byt| 000018b0 65 20 73 74 72 69 6e 67 29 3a 20 54 68 65 20 75 |e string): The u| 000018c0 6e 69 71 75 65 20 6e 61 6d 65 20 6f 66 20 74 68 |nique name of th| 000018d0 65 20 66 72 61 63 74 61 6c 20 66 75 6e 63 74 69 |e fractal functi| 000018e0 6f 6e 20 61 73 20 73 68 6f 77 6e 20 69 6e 0a 20 |on as shown in. | 000018f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001900 20 20 20 20 20 20 20 74 68 65 20 6d 65 6e 75 2e | the menu.| 00001910 20 52 69 73 63 4f 53 20 66 69 6c 65 20 6e 61 6d | RiscOS file nam| 00001920 69 6e 67 20 63 6f 6e 76 65 6e 74 69 6f 6e 73 20 |ing conventions | 00001930 61 70 70 6c 79 2c 20 69 65 0a 20 20 20 20 20 20 |apply, ie. | 00001940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001950 20 20 6e 6f 20 73 70 61 63 65 73 20 6f 72 20 70 | no spaces or p| 00001960 65 72 69 6f 64 73 20 65 74 63 2e 0a 66 63 61 6c |eriods etc..fcal| 00001970 6c 20 28 34 20 62 79 74 65 20 70 6f 69 6e 74 65 |l (4 byte pointe| 00001980 72 29 3a 20 41 64 64 72 65 73 73 20 6f 66 20 74 |r): Address of t| 00001990 68 65 20 66 75 6e 63 74 69 6f 6e 20 65 6e 74 72 |he function entr| 000019a0 79 20 70 6f 69 6e 74 2e 0a 66 74 20 20 20 20 28 |y point..ft (| 000019b0 34 20 62 79 74 65 20 66 6c 61 67 73 29 20 20 3a |4 byte flags) :| 000019c0 20 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 74 79 | The function ty| 000019d0 70 65 2e 20 46 6c 61 67 20 73 65 74 74 69 6e 67 |pe. Flag setting| 000019e0 73 20 61 72 65 20 67 69 76 65 6e 20 62 65 6c 6f |s are given belo| 000019f0 77 2e 0a 78 79 72 74 6e 20 28 34 20 62 79 74 65 |w..xyrtn (4 byte| 00001a00 20 70 6f 69 6e 74 65 72 29 3a 20 41 64 64 72 65 | pointer): Addre| 00001a10 73 73 20 6f 66 20 79 6f 75 72 20 78 2f 79 20 70 |ss of your x/y p| 00001a20 6c 6f 74 74 65 72 2c 20 69 66 20 73 75 70 70 6f |lotter, if suppo| 00001a30 72 74 65 64 2e 0a 6e 76 61 72 73 20 28 34 20 62 |rted..nvars (4 b| 00001a40 79 74 65 20 69 6e 74 65 67 65 72 29 3a 20 4e 75 |yte integer): Nu| 00001a50 6d 62 65 72 20 6f 66 20 65 64 69 74 61 62 6c 65 |mber of editable| 00001a60 20 66 75 6e 63 74 69 6f 6e 20 76 61 72 69 61 62 | function variab| 00001a70 6c 65 73 2e 20 4d 61 79 20 62 65 20 30 2e 0a 76 |les. May be 0..v| 00001a80 73 69 7a 65 20 28 34 20 62 79 74 65 20 69 6e 74 |size (4 byte int| 00001a90 65 67 65 72 29 3a 20 54 6f 74 61 6c 20 73 69 7a |eger): Total siz| 00001aa0 65 20 6f 66 20 76 61 72 69 61 62 6c 65 73 20 66 |e of variables f| 00001ab0 72 6f 6d 20 30 2d 33 35 30 30 20 62 79 74 65 73 |rom 0-3500 bytes| 00001ac0 2e 0a 77 73 69 7a 65 20 28 34 20 62 79 74 65 20 |..wsize (4 byte | 00001ad0 69 6e 74 65 67 65 72 29 3a 20 53 69 7a 65 20 6f |integer): Size o| 00001ae0 66 20 77 6f 72 6b 20 61 72 65 61 20 72 65 71 75 |f work area requ| 00001af0 69 72 65 64 2c 20 69 66 20 61 6e 79 0a 64 20 20 |ired, if any.d | 00001b00 20 20 20 28 34 20 62 79 74 65 20 70 6f 69 6e 74 | (4 byte point| 00001b10 65 72 29 3a 20 41 64 64 72 65 73 73 20 6f 66 20 |er): Address of | 00001b20 77 6f 72 6b 20 61 72 65 61 20 70 72 6f 76 69 64 |work area provid| 00001b30 65 64 20 62 79 20 21 46 72 61 63 74 61 6c 0a 76 |ed by !Fractal.v| 00001b40 61 72 73 20 20 28 41 46 47 32 20 66 6f 72 6d 61 |ars (AFG2 forma| 00001b50 74 29 20 20 20 3a 20 30 20 6f 72 20 6d 6f 72 65 |t) : 0 or more| 00001b60 20 76 61 72 69 61 62 6c 65 73 20 75 73 65 64 20 | variables used | 00001b70 74 6f 20 67 65 6e 65 72 61 74 65 20 74 68 65 20 |to generate the | 00001b80 69 6d 61 67 65 2e 0a 76 6e 61 6d 65 20 28 61 72 |image..vname (ar| 00001b90 72 61 79 20 6f 66 20 31 32 20 62 79 74 65 20 73 |ray of 12 byte s| 00001ba0 74 72 69 6e 67 73 29 3a 20 4e 61 6d 65 73 20 6f |trings): Names o| 00001bb0 66 20 74 68 65 20 65 64 69 74 61 62 6c 65 20 76 |f the editable v| 00001bc0 61 72 69 61 62 6c 65 73 2e 0a 0a 54 68 65 20 76 |ariables...The v| 00001bd0 61 72 69 61 62 6c 65 73 20 61 72 65 20 73 74 6f |ariables are sto| 00001be0 72 65 64 20 77 69 74 68 20 74 68 65 20 73 70 72 |red with the spr| 00001bf0 69 74 65 20 69 6d 61 67 65 2e 20 45 64 69 74 61 |ite image. Edita| 00001c00 62 6c 65 20 76 61 72 69 61 62 6c 65 73 20 61 72 |ble variables ar| 00001c10 65 20 74 68 6f 73 65 0a 61 63 63 65 73 73 69 62 |e those.accessib| 00001c20 6c 65 20 66 72 6f 6d 20 74 68 65 20 49 6d 61 67 |le from the Imag| 00001c30 65 2d 3e 44 61 74 61 20 6d 65 6e 75 2e 20 54 68 |e->Data menu. Th| 00001c40 65 20 66 75 6e 63 74 69 6f 6e 20 6d 61 79 20 68 |e function may h| 00001c50 61 76 65 20 6f 74 68 65 72 20 76 61 72 69 61 62 |ave other variab| 00001c60 6c 65 73 0a 77 68 69 63 68 20 61 72 65 20 6e 6f |les.which are no| 00001c70 74 20 65 64 69 74 61 62 6c 65 20 66 72 6f 6d 20 |t editable from | 00001c80 74 68 69 73 20 6d 65 6e 75 20 65 6e 74 72 79 2e |this menu entry.| 00001c90 20 54 68 65 20 65 64 69 74 61 62 6c 65 20 76 61 | The editable va| 00001ca0 72 69 61 62 6c 65 73 20 6d 75 73 74 0a 63 6f 6d |riables must.com| 00001cb0 65 20 66 69 72 73 74 2c 20 66 6f 6c 6c 6f 77 65 |e first, followe| 00001cc0 64 20 62 79 20 74 68 65 20 72 65 73 74 2e 20 41 |d by the rest. A| 00001cd0 66 74 65 72 20 74 68 69 73 20 63 6f 6d 65 73 20 |fter this comes | 00001ce0 61 6e 20 61 72 72 61 79 20 63 6f 6e 74 61 69 6e |an array contain| 00001cf0 69 6e 67 20 74 68 65 0a 6e 61 6d 65 73 20 6f 66 |ing the.names of| 00001d00 20 74 68 65 20 76 61 72 69 61 62 6c 65 73 20 61 | the variables a| 00001d10 73 20 75 73 65 64 20 69 6e 20 74 68 65 20 49 6d |s used in the Im| 00001d20 61 67 65 2d 3e 44 61 74 61 20 64 69 61 6c 6f 67 |age->Data dialog| 00001d30 75 65 20 62 6f 78 2e 0a 0a 41 46 47 32 20 76 61 |ue box...AFG2 va| 00001d40 72 69 61 62 6c 65 73 20 61 72 65 20 73 74 6f 72 |riables are stor| 00001d50 65 64 20 77 6f 72 64 20 61 6c 69 67 6e 65 64 20 |ed word aligned | 00001d60 61 73 20 66 6f 6c 6c 6f 77 73 3a 0a 74 3a 20 76 |as follows:.t: v| 00001d70 61 72 69 61 62 6c 65 20 74 79 70 65 20 2d 20 33 |ariable type - 3| 00001d80 3d 66 6c 6f 61 74 2c 20 34 3d 69 6e 74 65 67 65 |=float, 4=intege| 00001d90 72 2c 20 38 3d 64 6f 75 62 6c 65 2c 20 31 32 38 |r, 8=double, 128| 00001da0 3d 73 74 72 69 6e 67 0a 61 3a 20 61 72 72 61 79 |=string.a: array| 00001db0 20 63 6f 75 6e 74 2e 20 30 3d 6e 6f 6e 65 2c 20 | count. 0=none, | 00001dc0 3e 30 20 6d 65 61 6e 73 20 74 68 69 73 20 76 61 |>0 means this va| 00001dd0 72 69 61 62 6c 65 20 69 73 20 72 65 70 65 61 74 |riable is repeat| 00001de0 65 64 20 2b 61 20 74 69 6d 65 73 2c 20 62 75 74 |ed +a times, but| 00001df0 0a 20 20 20 77 69 74 68 20 6f 6e 6c 79 20 6f 6e |. with only on| 00001e00 65 20 41 46 47 20 68 65 61 64 65 72 2e 20 28 4e |e AFG header. (N| 00001e10 6f 74 20 73 75 70 70 6f 72 74 65 64 20 66 6f 72 |ot supported for| 00001e20 20 65 64 69 74 61 62 6c 65 20 76 61 72 69 61 62 | editable variab| 00001e30 6c 65 73 20 6f 72 0a 20 20 20 73 74 72 69 6e 67 |les or. string| 00001e40 73 29 2e 0a 73 3a 20 76 61 72 69 61 62 6c 65 20 |s)..s: variable | 00001e50 73 69 7a 65 20 65 78 63 6c 75 64 69 6e 67 20 68 |size excluding h| 00001e60 65 61 64 65 72 2c 20 62 75 74 20 69 6e 63 6c 75 |eader, but inclu| 00001e70 64 69 6e 67 20 61 6c 6c 20 61 72 72 61 79 20 65 |ding all array e| 00001e80 6c 65 6d 65 6e 74 73 2e 0a 20 20 20 46 6f 72 20 |lements.. For | 00001e90 73 74 72 69 6e 67 73 20 74 68 69 73 20 69 73 20 |strings this is | 00001ea0 74 68 65 20 6d 61 78 69 6d 75 6d 20 73 74 72 69 |the maximum stri| 00001eb0 6e 67 20 6c 65 6e 67 74 68 2e 20 53 74 72 69 6e |ng length. Strin| 00001ec0 67 73 20 73 68 6f 75 6c 64 20 62 65 0a 20 20 20 |gs should be. | 00001ed0 74 65 72 6d 69 6e 61 74 65 64 20 77 69 74 68 20 |terminated with | 00001ee0 61 20 7a 65 72 6f 20 62 79 74 65 2e 0a 64 3a 20 |a zero byte..d: | 00001ef0 74 68 65 20 64 61 74 61 20 69 74 73 65 6c 66 2c |the data itself,| 00001f00 20 77 6f 72 64 20 61 6c 69 67 6e 65 64 2e 0a 0a | word aligned...| 00001f10 46 75 6e 63 74 69 6f 6e 20 54 79 70 65 73 0a 2d |Function Types.-| 00001f20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 54 68 |-------------.Th| 00001f30 65 73 65 20 66 6c 61 67 73 20 73 65 74 74 69 6e |ese flags settin| 00001f40 67 73 20 64 65 73 63 72 69 62 65 20 74 68 65 20 |gs describe the | 00001f50 66 75 6e 63 74 69 6f 6e 20 74 6f 20 21 46 72 61 |function to !Fra| 00001f60 63 74 61 6c 2e 0a 0a 66 5a 6f 6f 6d 20 20 20 3a |ctal...fZoom :| 00001f70 5a 6f 6f 6d 61 62 6c 65 20 66 75 6e 63 74 69 6f |Zoomable functio| 00001f80 6e 2e 20 54 68 65 20 76 61 72 69 61 62 6c 65 73 |n. The variables| 00001f90 20 78 30 2c 79 30 2c 77 20 26 20 68 20 6d 75 73 | x0,y0,w & h mus| 00001fa0 74 20 62 65 20 74 68 65 20 66 69 72 73 74 0a 34 |t be the first.4| 00001fb0 20 76 61 72 69 61 62 6c 65 73 20 6f 66 20 74 68 | variables of th| 00001fc0 65 20 66 75 6e 63 74 69 6f 6e 20 61 6e 64 20 6d |e function and m| 00001fd0 75 73 74 20 62 65 20 74 79 70 65 20 64 6f 75 62 |ust be type doub| 00001fe0 6c 65 20 28 66 6c 6f 61 74 69 6e 67 20 70 6f 69 |le (floating poi| 00001ff0 6e 74 29 2e 20 78 30 2c 79 30 0a 61 72 65 20 74 |nt). x0,y0.are t| 00002000 68 65 20 76 61 6c 75 65 73 20 6f 66 20 74 68 65 |he values of the| 00002010 20 62 6f 74 74 6f 6d 20 6c 65 66 74 20 6f 66 20 | bottom left of | 00002020 74 68 65 20 73 63 72 65 65 6e 2c 20 77 3d 77 69 |the screen, w=wi| 00002030 64 74 68 20 61 6e 64 20 68 3d 68 65 69 67 68 74 |dth and h=height| 00002040 2e 20 54 68 65 0a 76 61 6c 75 65 73 20 74 68 65 |. The.values the| 00002050 6d 73 65 6c 76 65 73 20 61 72 65 20 64 65 70 65 |mselves are depe| 00002060 6e 64 65 6e 74 20 6f 6e 20 74 68 65 20 66 75 6e |ndent on the fun| 00002070 63 74 69 6f 6e 2e 20 21 46 72 61 63 74 61 6c 20 |ction. !Fractal | 00002080 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c |will automatical| 00002090 6c 79 0a 75 70 64 61 74 65 20 74 68 65 73 65 20 |ly.update these | 000020a0 76 61 72 69 61 62 6c 65 73 20 77 68 65 6e 20 61 |variables when a| 000020b0 20 75 73 65 72 20 7a 6f 6f 6d 73 20 61 6e 64 20 | user zooms and | 000020c0 70 61 6e 73 20 61 72 6f 75 6e 64 20 74 68 65 20 |pans around the | 000020d0 69 6d 61 67 65 2e 0a 0a 66 49 6e 66 20 20 20 20 |image...fInf | 000020e0 3a 49 6e 66 69 6e 69 74 65 20 66 75 6e 63 74 69 |:Infinite functi| 000020f0 6f 6e 2e 20 54 68 65 20 66 75 6e 63 74 69 6f 6e |on. The function| 00002100 20 63 6f 6e 74 69 6e 75 65 73 20 70 6c 6f 74 74 | continues plott| 00002110 69 6e 67 20 75 6e 74 69 6c 20 74 68 65 20 75 73 |ing until the us| 00002120 65 72 0a 73 65 6c 65 63 74 73 20 53 74 6f 70 20 |er.selects Stop | 00002130 66 72 6f 6d 20 74 68 65 20 6d 65 6e 75 2e 0a 0a |from the menu...| 00002140 66 6e 6f 63 6c 65 61 72 3a 57 68 65 6e 20 6f 6e |fnoclear:When on| 00002150 2c 20 74 68 65 20 70 72 69 6f 72 20 77 69 6c 6c |, the prior will| 00002160 20 6e 6f 74 20 62 65 20 63 6c 65 61 72 65 64 20 | not be cleared | 00002170 6f 6e 20 61 20 72 65 64 72 61 77 2e 20 41 20 66 |on a redraw. A f| 00002180 75 6e 63 74 69 6f 6e 20 63 61 6e 0a 74 75 72 6e |unction can.turn| 00002190 20 68 69 73 20 6f 6e 20 61 6e 64 20 6f 66 66 20 | his on and off | 000021a0 61 73 20 72 65 71 75 69 72 65 64 2e 20 54 68 69 |as required. Thi| 000021b0 73 20 61 6c 6c 6f 77 73 20 63 6f 6d 70 6f 73 69 |s allows composi| 000021c0 74 65 20 69 6d 61 67 65 73 20 74 6f 20 62 65 20 |te images to be | 000021d0 63 72 65 61 74 65 64 2e 0a 0a 66 78 79 20 20 20 |created...fxy | 000021e0 20 20 3a 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 | :The function | 000021f0 75 73 65 73 20 78 2f 79 20 70 69 78 65 6c 20 70 |uses x/y pixel p| 00002200 6c 6f 74 74 69 6e 67 2e 20 53 65 65 20 74 68 65 |lotting. See the| 00002210 20 58 2f 59 20 50 6c 6f 74 74 69 6e 67 20 44 72 | X/Y Plotting Dr| 00002220 69 76 65 72 0a 66 6f 72 20 66 75 6c 6c 20 64 65 |iver.for full de| 00002230 74 61 69 6c 73 2e 0a 0a 66 65 2e 2e 2e 2e 20 66 |tails...fe.... f| 00002240 6c 61 67 73 20 65 6e 61 62 6c 65 20 74 68 65 20 |lags enable the | 00002250 72 65 6c 61 74 65 64 20 21 46 72 61 63 74 61 6c |related !Fractal| 00002260 20 66 75 6e 63 74 69 6f 6e 20 63 61 6c 6c 3a 0a | function call:.| 00002270 0a 66 65 6d 65 6e 75 20 20 3a 54 68 65 20 66 75 |.femenu :The fu| 00002280 6e 63 74 69 6f 6e 20 68 61 73 20 69 74 27 73 20 |nction has it's | 00002290 6f 77 6e 20 6d 65 6e 75 20 73 74 72 75 63 74 75 |own menu structu| 000022a0 72 65 20 74 6f 20 62 65 20 61 64 64 65 64 20 74 |re to be added t| 000022b0 6f 20 74 68 65 20 6d 61 69 6e 0a 6d 65 6e 75 2e |o the main.menu.| 000022c0 0a 0a 66 65 73 70 72 6c 6f 64 3a 54 68 65 20 66 |..fesprlod:The f| 000022d0 75 6e 63 74 69 6f 6e 20 77 69 6c 6c 20 61 63 63 |unction will acc| 000022e0 65 70 74 20 73 70 72 69 74 65 20 66 69 6c 65 20 |ept sprite file | 000022f0 6c 6f 61 64 73 2e 0a 0a 66 65 70 74 72 20 20 20 |loads...feptr | 00002300 3a 57 69 6d 70 20 70 6f 69 6e 74 65 72 20 65 6e |:Wimp pointer en| 00002310 74 65 72 69 6e 67 2f 6c 65 61 76 69 6e 67 20 77 |tering/leaving w| 00002320 69 6e 64 6f 77 20 65 76 65 6e 74 73 20 61 72 65 |indow events are| 00002330 20 72 65 71 75 69 72 65 64 20 62 79 20 74 68 65 | required by the| 00002340 0a 66 75 6e 63 74 69 6f 6e 2e 20 4e 49 59 0a 0a |.function. NIY..| 00002350 66 65 6b 65 79 69 6e 70 3a 57 69 6d 70 20 6b 65 |fekeyinp:Wimp ke| 00002360 79 20 70 72 65 73 73 20 65 76 65 6e 74 73 20 61 |y press events a| 00002370 72 65 20 73 75 70 70 6f 72 74 65 64 20 62 79 20 |re supported by | 00002380 74 68 65 20 66 75 6e 63 74 69 6f 6e 2e 0a 0a 66 |the function...f| 00002390 65 64 61 74 61 6c 64 3a 46 75 6e 63 74 69 6f 6e |edatald:Function| 000023a0 20 63 61 6e 20 61 63 63 65 70 74 20 64 61 74 61 | can accept data| 000023b0 20 6c 6f 61 64 20 72 65 71 75 65 73 74 73 2e 0a | load requests..| 000023c0 0a 66 65 64 61 74 77 64 77 3a 46 75 6e 63 74 69 |.fedatwdw:Functi| 000023d0 6f 6e 20 68 61 73 20 69 74 73 20 6f 77 6e 20 64 |on has its own d| 000023e0 61 74 61 20 65 6e 74 72 79 20 77 69 6e 64 6f 77 |ata entry window| 000023f0 2e 0a 0a 66 64 61 74 61 65 72 72 3a 20 74 68 69 |...fdataerr: thi| 00002400 73 20 62 69 74 20 69 73 20 74 75 72 6e 65 64 20 |s bit is turned | 00002410 6f 6e 20 62 79 20 21 46 72 61 63 74 61 6c 20 77 |on by !Fractal w| 00002420 68 65 6e 20 79 6f 75 72 20 64 61 74 61 20 76 61 |hen your data va| 00002430 6c 69 64 61 74 69 6f 6e 0a 72 6f 75 74 69 6e 65 |lidation.routine| 00002440 20 68 61 73 20 72 65 6a 65 63 74 65 64 20 75 73 | has rejected us| 00002450 65 72 20 69 6e 70 75 74 20 61 73 20 69 6e 76 61 |er input as inva| 00002460 6c 69 64 2c 20 61 6e 64 20 70 72 65 76 65 6e 74 |lid, and prevent| 00002470 73 20 61 20 72 65 2d 64 72 61 77 20 62 65 69 6e |s a re-draw bein| 00002480 67 0a 70 65 72 66 6f 72 6d 65 64 20 75 6e 74 69 |g.performed unti| 00002490 6c 20 72 65 73 65 74 2e 20 54 68 69 73 20 66 6c |l reset. This fl| 000024a0 61 67 20 77 69 6c 6c 20 62 65 20 72 65 73 65 74 |ag will be reset| 000024b0 20 62 79 20 21 46 72 61 63 74 61 6c 20 77 68 65 | by !Fractal whe| 000024c0 6e 20 74 68 65 20 64 61 74 61 20 69 73 0a 63 6f |n the data is.co| 000024d0 72 72 65 63 74 65 64 2c 20 6f 72 20 77 68 65 6e |rrected, or when| 000024e0 20 49 6e 69 74 2f 49 6e 69 74 20 5a 6f 6f 6d 20 | Init/Init Zoom | 000024f0 61 72 65 20 70 72 65 73 73 65 64 2e 20 49 66 20 |are pressed. If | 00002500 79 6f 75 72 20 72 6f 75 74 69 6e 65 20 72 65 73 |your routine res| 00002510 65 74 73 20 74 68 65 0a 64 61 74 61 20 6f 66 20 |ets the.data of | 00002520 69 74 73 20 6f 77 6e 20 61 63 63 6f 72 64 2c 20 |its own accord, | 00002530 79 6f 75 20 73 68 6f 75 6c 64 20 65 6e 73 75 72 |you should ensur| 00002540 65 20 74 68 69 73 20 62 69 74 20 69 73 20 63 6c |e this bit is cl| 00002550 65 61 72 65 64 2e 0a 0a 46 75 6e 63 74 69 6f 6e |eared...Function| 00002560 20 43 61 6c 6c 73 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d | Calls.=========| 00002570 3d 3d 3d 3d 3d 0a 53 6f 6d 65 20 63 61 6c 6c 73 |=====.Some calls| 00002580 20 61 72 65 20 61 6c 77 61 79 73 20 6d 61 64 65 | are always made| 00002590 2c 20 6f 74 68 65 72 73 20 61 72 65 20 6f 6e 6c |, others are onl| 000025a0 79 20 70 61 73 73 65 64 20 6f 6e 20 69 66 20 74 |y passed on if t| 000025b0 68 65 20 65 76 65 6e 74 20 69 73 0a 65 6e 61 62 |he event is.enab| 000025c0 6c 65 64 2e 20 41 73 73 6f 63 69 61 74 65 64 20 |led. Associated | 000025d0 77 69 74 68 20 65 61 63 68 20 63 61 6c 6c 20 69 |with each call i| 000025e0 73 20 61 20 70 61 72 61 6d 65 74 65 72 20 62 6c |s a parameter bl| 000025f0 6f 63 6b 20 77 68 69 63 68 20 69 73 20 64 65 73 |ock which is des| 00002600 63 72 69 62 65 64 0a 69 6e 20 74 68 65 20 6e 65 |cribed.in the ne| 00002610 78 74 20 73 65 63 74 69 6f 6e 2e 20 48 6f 77 65 |xt section. Howe| 00002620 76 65 72 20 74 68 65 20 66 69 72 73 74 20 70 61 |ver the first pa| 00002630 72 61 6d 65 74 65 72 20 69 73 20 61 6c 77 61 79 |rameter is alway| 00002640 73 20 61 20 72 65 74 75 72 6e 20 63 6f 64 65 0a |s a return code.| 00002650 75 73 65 64 20 74 6f 20 72 65 74 75 72 6e 20 62 |used to return b| 00002660 61 73 69 63 20 69 6e 66 6f 72 6d 61 74 69 6f 6e |asic information| 00002670 2c 20 77 68 69 63 68 20 59 4f 55 20 4d 55 53 54 |, which YOU MUST| 00002680 20 53 45 54 20 54 4f 20 30 20 75 6e 6c 65 73 73 | SET TO 0 unless| 00002690 20 73 74 61 74 65 64 2e 0a 4f 74 68 65 72 20 74 | stated..Other t| 000026a0 68 61 6e 20 73 65 74 74 69 6e 67 20 74 68 65 20 |han setting the | 000026b0 72 65 74 75 72 6e 20 63 6f 64 65 2c 20 73 69 6d |return code, sim| 000026c0 70 6c 65 20 66 75 6e 63 74 69 6f 6e 73 20 6f 6e |ple functions on| 000026d0 6c 79 20 72 65 61 6c 6c 79 20 6e 65 65 64 20 74 |ly really need t| 000026e0 6f 0a 72 65 73 70 6f 6e 64 20 74 6f 20 74 68 65 |o.respond to the| 000026f0 20 66 70 6c 6f 74 20 28 64 6f 20 61 20 70 6c 6f | fplot (do a plo| 00002700 74 29 20 61 6e 64 20 66 64 61 74 61 63 68 6b 20 |t) and fdatachk | 00002710 28 76 65 72 69 66 79 20 64 61 74 61 20 69 6e 70 |(verify data inp| 00002720 75 74 29 20 63 61 6c 6c 73 2e 20 54 68 65 0a 6f |ut) calls. The.o| 00002730 74 68 65 72 20 66 75 6e 63 74 69 6f 6e 73 20 70 |ther functions p| 00002740 72 6f 76 69 64 65 20 61 64 64 69 74 69 6f 6e 61 |rovide additiona| 00002750 6c 20 66 61 63 69 6c 69 74 69 65 73 20 69 66 20 |l facilities if | 00002760 79 6f 75 20 6e 65 65 64 20 74 68 65 6d 2e 0a 0a |you need them...| 00002770 66 69 6e 69 74 0a 2d 2d 2d 2d 2d 0a 54 68 69 73 |finit.-----.This| 00002780 20 63 61 6c 6c 20 69 73 20 6d 61 64 65 20 77 68 | call is made wh| 00002790 65 6e 20 21 46 72 61 63 74 61 6c 20 69 6e 69 74 |en !Fractal init| 000027a0 69 61 6c 69 73 65 73 20 61 6e 64 20 61 6c 6c 6f |ialises and allo| 000027b0 77 73 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 |ws the function | 000027c0 74 6f 0a 69 6e 69 74 69 61 6c 69 73 65 20 69 74 |to.initialise it| 000027d0 73 65 6c 66 2e 20 54 68 65 20 54 65 6d 70 6c 61 |self. The Templa| 000027e0 74 65 73 20 66 69 6c 65 20 69 73 20 6f 70 65 6e |tes file is open| 000027f0 20 66 6f 72 20 74 65 6d 70 6c 61 74 65 20 6c 6f | for template lo| 00002800 61 64 69 6e 67 3b 0a 68 65 61 70 5f 61 6c 6c 6f |ading;.heap_allo| 00002810 63 20 6d 61 79 20 62 65 20 63 61 6c 6c 65 64 20 |c may be called | 00002820 74 6f 20 72 65 71 75 65 73 74 20 64 79 6e 61 6d |to request dynam| 00002830 69 63 20 73 74 6f 72 61 67 65 3b 20 6c 6f 61 64 |ic storage; load| 00002840 66 69 6c 65 20 6d 61 79 20 62 65 20 63 61 6c 6c |file may be call| 00002850 65 64 0a 74 6f 20 6c 6f 61 64 20 61 73 73 65 6d |ed.to load assem| 00002860 62 6c 65 72 20 73 75 62 72 6f 75 74 69 6e 65 73 |bler subroutines| 00002870 20 65 74 63 2e 0a 0a 66 73 65 6c 65 63 74 0a 2d | etc...fselect.-| 00002880 2d 2d 2d 2d 2d 2d 0a 54 68 69 73 20 63 61 6c 6c |------.This call| 00002890 20 69 73 20 6d 61 64 65 20 77 68 65 6e 20 74 68 | is made when th| 000028a0 65 20 66 75 6e 63 74 69 6f 6e 20 68 61 73 20 62 |e function has b| 000028b0 65 65 6e 20 73 65 6c 65 63 74 65 64 20 62 79 20 |een selected by | 000028c0 74 68 65 20 75 73 65 72 2c 20 74 6f 20 65 6e 61 |the user, to ena| 000028d0 62 6c 65 0a 74 68 65 20 63 72 65 61 74 69 6f 6e |ble.the creation| 000028e0 20 6f 66 20 77 69 6e 64 6f 77 73 20 61 6e 64 20 | of windows and | 000028f0 61 6e 79 20 6f 74 68 65 72 20 69 6e 69 74 69 61 |any other initia| 00002900 6c 69 73 61 74 69 6f 6e 2e 0a 0a 66 64 65 73 65 |lisation...fdese| 00002910 6c 65 63 74 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 54 |lect.---------.T| 00002920 68 69 73 20 63 61 6c 6c 20 69 73 20 6d 61 64 65 |his call is made| 00002930 20 77 68 65 6e 20 74 68 65 20 66 75 6e 63 74 69 | when the functi| 00002940 6f 6e 20 68 61 73 20 62 65 65 6e 20 64 65 2d 73 |on has been de-s| 00002950 65 6c 65 63 74 65 64 20 62 79 20 74 68 65 20 75 |elected by the u| 00002960 73 65 72 2e 0a 57 69 6e 64 6f 77 73 20 73 68 6f |ser..Windows sho| 00002970 75 6c 64 20 62 65 20 64 65 6c 65 74 65 64 20 61 |uld be deleted a| 00002980 6e 64 20 61 6e 79 20 74 65 6d 70 6f 72 61 72 79 |nd any temporary| 00002990 20 6d 65 6d 6f 72 79 20 66 72 65 65 64 2e 0a 0a | memory freed...| 000029a0 66 70 6c 6f 74 69 6e 69 74 0a 2d 2d 2d 2d 2d 2d |fplotinit.------| 000029b0 2d 2d 2d 0a 54 68 69 73 20 63 61 6c 6c 20 69 73 |---.This call is| 000029c0 20 6d 61 64 65 20 77 68 65 6e 20 61 20 6e 65 77 | made when a new| 000029d0 20 69 6d 61 67 65 20 69 73 20 61 62 6f 75 74 20 | image is about | 000029e0 74 6f 20 62 65 20 64 72 61 77 6e 2e 20 54 68 65 |to be drawn. The| 000029f0 20 73 63 72 65 65 6e 2f 73 70 72 69 74 65 0a 77 | screen/sprite.w| 00002a00 69 6c 6c 20 68 61 76 65 20 62 65 65 6e 20 63 6c |ill have been cl| 00002a10 65 61 72 65 64 20 28 75 6e 6c 65 73 73 20 66 6e |eared (unless fn| 00002a20 6f 63 6c 65 61 72 20 69 73 20 73 65 74 20 69 6e |oclear is set in| 00002a30 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 64 65 | the function de| 00002a40 66 69 6e 69 74 69 6f 6e 29 2c 0a 61 6e 64 20 61 |finition),.and a| 00002a50 6c 6c 20 56 44 55 20 76 61 72 69 61 62 6c 65 73 |ll VDU variables| 00002a60 20 73 65 74 20 74 6f 20 74 68 65 69 72 20 64 65 | set to their de| 00002a70 66 61 75 6c 74 73 2e 20 54 68 65 20 66 75 6e 63 |faults. The func| 00002a80 74 69 6f 6e 20 73 68 6f 75 6c 64 20 64 6f 20 61 |tion should do a| 00002a90 6e 79 0a 70 72 65 2d 70 72 6f 63 65 73 73 69 6e |ny.pre-processin| 00002aa0 67 20 72 65 71 75 69 72 65 64 2c 20 73 75 63 68 |g required, such| 00002ab0 20 61 73 20 61 63 74 69 76 61 74 69 6e 67 20 78 | as activating x| 00002ac0 2f 79 20 70 6c 6f 74 74 69 6e 67 20 28 73 65 65 |/y plotting (see| 00002ad0 20 6c 61 74 65 72 29 20 6f 72 20 73 65 74 0a 74 | later) or set.t| 00002ae0 68 65 20 6f 72 69 67 69 6e 2e 0a 0a 49 66 20 74 |he origin...If t| 00002af0 68 65 20 70 6c 6f 74 5f 66 70 20 66 6c 61 67 20 |he plot_fp flag | 00002b00 69 73 20 6f 6e 20 28 69 6e 20 70 6c 6f 74 2e 66 |is on (in plot.f| 00002b10 6c 61 67 73 29 20 74 68 65 6e 20 79 6f 75 20 73 |lags) then you s| 00002b20 68 6f 75 6c 64 20 75 73 65 20 61 20 66 6c 6f 61 |hould use a floa| 00002b30 74 69 6e 67 0a 70 6f 69 6e 74 20 72 6f 75 74 69 |ting.point routi| 00002b40 6e 65 20 72 61 74 68 65 72 20 74 68 61 6e 20 69 |ne rather than i| 00002b50 6e 74 65 67 65 72 2c 20 69 66 20 79 6f 75 20 70 |nteger, if you p| 00002b60 72 6f 76 69 64 65 20 62 6f 74 68 2e 20 54 68 69 |rovide both. Thi| 00002b70 73 20 6c 65 74 73 20 74 68 65 20 75 73 65 72 0a |s lets the user.| 00002b80 63 6f 6e 74 72 6f 6c 20 74 68 65 20 61 63 63 75 |control the accu| 00002b90 72 61 63 79 2e 20 54 68 69 73 20 69 73 20 75 73 |racy. This is us| 00002ba0 65 64 20 62 79 20 74 68 65 20 4d 61 6e 64 65 6c |ed by the Mandel| 00002bb0 62 72 6f 74 20 26 20 4a 75 6c 69 61 20 72 6f 75 |brot & Julia rou| 00002bc0 74 69 6e 65 73 2e 0a 0a 66 70 6c 6f 74 0a 2d 2d |tines...fplot.--| 00002bd0 2d 2d 2d 0a 54 68 69 73 20 63 61 6c 6c 20 69 73 |---.This call is| 00002be0 20 6d 61 64 65 20 72 65 70 65 61 74 65 64 6c 79 | made repeatedly| 00002bf0 20 61 66 74 65 72 20 66 70 6c 6f 74 69 6e 69 74 | after fplotinit| 00002c00 20 75 6e 74 69 6c 20 74 68 65 20 69 6d 61 67 65 | until the image| 00002c10 20 69 73 20 63 6f 6d 70 6c 65 74 65 64 0a 75 6e | is completed.un| 00002c20 6c 65 73 73 20 78 2f 79 20 70 6c 6f 74 74 69 6e |less x/y plottin| 00002c30 67 20 69 73 20 62 65 69 6e 67 20 75 73 65 64 2e |g is being used.| 00002c40 20 49 6d 61 67 65 20 63 6f 6d 70 6c 65 74 69 6f | Image completio| 00002c50 6e 20 69 73 20 73 69 67 6e 61 6c 6c 65 64 20 62 |n is signalled b| 00002c60 79 20 74 68 65 0a 66 75 6e 63 74 69 6f 6e 20 73 |y the.function s| 00002c70 65 74 74 69 6e 67 20 74 68 65 20 72 65 74 75 72 |etting the retur| 00002c80 6e 20 63 6f 64 65 20 74 6f 20 2d 31 2e 20 4f 6e |n code to -1. On| 00002c90 20 74 68 65 20 66 69 72 73 74 20 63 61 6c 6c 20 | the first call | 00002ca0 74 68 65 20 70 72 6f 67 72 61 6d 20 69 73 0a 69 |the program is.i| 00002cb0 6e 20 64 65 64 69 63 61 74 65 64 20 6d 6f 64 65 |n dedicated mode| 00002cc0 20 77 68 69 63 68 20 69 73 20 6d 61 69 6e 74 61 | which is mainta| 00002cd0 69 6e 65 64 20 75 6e 74 69 6c 20 74 68 65 20 69 |ined until the i| 00002ce0 6d 61 67 65 20 69 73 20 63 6f 6d 70 6c 65 74 65 |mage is complete| 00002cf0 20 6f 72 20 74 68 65 0a 75 73 65 72 20 70 72 65 | or the.user pre| 00002d00 73 73 65 73 20 41 64 6a 75 73 74 20 6f 6e 20 74 |sses Adjust on t| 00002d10 68 65 20 6d 6f 75 73 65 2e 20 54 68 65 20 66 75 |he mouse. The fu| 00002d20 6e 63 74 69 6f 6e 20 63 61 6e 20 65 69 74 68 65 |nction can eithe| 00002d30 72 20 75 73 65 20 4f 53 5f 4d 6f 75 73 65 20 74 |r use OS_Mouse t| 00002d40 6f 0a 64 65 74 65 63 74 20 74 68 69 73 20 65 76 |o.detect this ev| 00002d50 65 6e 74 2c 20 6f 72 20 72 65 74 75 72 6e 20 74 |ent, or return t| 00002d60 6f 20 21 46 72 61 63 74 61 6c 20 77 68 69 63 68 |o !Fractal which| 00002d70 20 77 69 6c 6c 20 70 65 72 66 6f 72 6d 20 74 68 | will perform th| 00002d80 65 20 63 68 65 63 6b 2e 0a 0a 57 68 65 6e 20 6e |e check...When n| 00002d90 6f 74 20 69 6e 20 64 65 64 69 63 61 74 65 64 20 |ot in dedicated | 00002da0 6d 6f 64 65 20 28 70 6c 6f 74 5f 64 65 64 20 66 |mode (plot_ded f| 00002db0 6c 61 67 20 6f 66 66 29 20 74 68 65 20 66 75 6e |lag off) the fun| 00002dc0 63 74 69 6f 6e 20 6d 75 73 74 20 72 65 74 75 72 |ction must retur| 00002dd0 6e 0a 65 76 65 72 79 20 31 2f 32 30 20 73 65 63 |n.every 1/20 sec| 00002de0 6f 6e 64 20 6f 72 20 73 6f 20 74 6f 20 61 6c 6c |ond or so to all| 00002df0 6f 77 20 64 65 73 6b 74 6f 70 20 70 72 6f 63 65 |ow desktop proce| 00002e00 73 73 69 6e 67 20 74 6f 20 63 6f 6e 74 69 6e 75 |ssing to continu| 00002e10 65 2e 20 57 68 65 6e 0a 73 77 69 74 63 68 69 6e |e. When.switchin| 00002e20 67 20 66 72 6f 6d 20 64 65 64 69 63 61 74 65 64 |g from dedicated| 00002e30 20 74 6f 20 6e 6f 6e 2d 64 65 64 69 63 61 74 65 | to non-dedicate| 00002e40 64 20 6d 6f 64 65 20 74 68 65 20 66 69 65 6c 64 |d mode the field| 00002e50 73 20 70 6c 6f 74 5f 61 64 64 72 20 61 6e 64 0a |s plot_addr and.| 00002e60 70 6c 6f 74 5f 62 61 73 65 20 6d 61 79 20 62 65 |plot_base may be| 00002e70 20 63 68 61 6e 67 65 64 20 74 6f 20 72 65 66 6c | changed to refl| 00002e80 65 63 74 20 73 77 69 74 63 68 69 6e 67 20 66 72 |ect switching fr| 00002e90 6f 6d 20 74 68 65 20 73 63 72 65 65 6e 20 74 6f |om the screen to| 00002ea0 20 61 20 73 70 72 69 74 65 2c 0a 73 6f 20 74 68 | a sprite,.so th| 00002eb0 65 73 65 20 66 69 65 6c 64 73 20 6d 75 73 74 20 |ese fields must | 00002ec0 62 65 20 72 65 2d 61 63 63 65 73 73 65 64 20 6f |be re-accessed o| 00002ed0 6e 20 65 61 63 68 20 70 6c 6f 74 20 63 61 6c 6c |n each plot call| 00002ee0 2e 0a 0a 54 68 69 73 20 63 61 6c 6c 20 69 73 20 |...This call is | 00002ef0 6e 6f 74 20 6d 61 64 65 20 69 66 20 74 68 65 20 |not made if the | 00002f00 66 75 6e 63 74 69 6f 6e 20 75 73 65 73 20 78 2f |function uses x/| 00002f10 79 20 70 6c 6f 74 74 69 6e 67 2e 0a 0a 66 64 61 |y plotting...fda| 00002f20 74 61 63 68 6b 0a 2d 2d 2d 2d 2d 2d 2d 2d 0a 54 |tachk.--------.T| 00002f30 68 69 73 20 63 61 6c 6c 20 69 73 20 6d 61 64 65 |his call is made| 00002f40 20 61 66 74 65 72 20 74 68 65 20 75 73 65 72 20 | after the user | 00002f50 68 61 73 20 74 79 70 65 64 20 69 6e 20 6e 65 77 |has typed in new| 00002f60 20 64 61 74 61 20 76 61 72 69 61 62 6c 65 73 20 | data variables | 00002f70 6f 72 20 61 66 74 65 72 0a 7a 6f 6f 6d 69 6e 67 |or after.zooming| 00002f80 2e 20 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 73 |. The function s| 00002f90 68 6f 75 6c 64 20 76 65 72 69 66 79 20 74 68 65 |hould verify the| 00002fa0 20 76 61 6c 75 65 73 20 61 6e 64 20 69 66 20 6e | values and if n| 00002fb0 6f 74 20 61 63 63 65 70 74 61 62 6c 65 2c 20 65 |ot acceptable, e| 00002fc0 69 74 68 65 72 0a 72 65 74 75 72 6e 20 74 68 65 |ither.return the| 00002fd0 20 61 64 64 72 65 73 73 20 6f 66 20 61 6e 20 65 | address of an e| 00002fe0 72 72 6f 72 20 6d 65 73 73 61 67 65 20 28 69 6e |rror message (in| 00002ff0 20 66 69 65 6c 64 20 65 72 72 6d 73 67 29 20 6f | field errmsg) o| 00003000 72 20 63 6f 72 72 65 63 74 20 74 68 65 0a 76 61 |r correct the.va| 00003010 6c 75 65 2e 20 52 65 74 75 72 6e 20 77 69 74 68 |lue. Return with| 00003020 20 72 65 74 75 72 6e 20 63 6f 64 65 3d 30 20 66 | return code=0 f| 00003030 6f 72 20 4f 4b 20 61 6e 64 20 72 65 74 75 72 6e |or OK and return| 00003040 20 63 6f 64 65 3d 31 20 69 66 20 31 20 6f 72 20 | code=1 if 1 or | 00003050 6d 6f 72 65 0a 76 61 6c 75 65 73 20 77 65 72 65 |more.values were| 00003060 20 69 6e 76 61 6c 69 64 2e 0a 0a 49 66 20 79 6f | invalid...If yo| 00003070 75 72 20 66 75 6e 63 74 69 6f 6e 20 68 61 73 20 |ur function has | 00003080 74 68 65 20 66 5a 6f 6f 6d 20 66 6c 61 67 20 73 |the fZoom flag s| 00003090 65 74 2c 20 21 46 72 61 63 74 61 6c 20 61 75 74 |et, !Fractal aut| 000030a0 6f 6d 61 74 69 63 61 6c 6c 79 20 63 68 65 63 6b |omatically check| 000030b0 73 20 74 68 61 74 0a 74 68 65 20 77 69 64 74 68 |s that.the width| 000030c0 20 61 6e 64 20 68 65 69 67 68 74 20 61 72 65 20 | and height are | 000030d0 3e 30 2e 0a 0a 66 64 61 74 61 69 6e 69 74 0a 2d |>0...fdatainit.-| 000030e0 2d 2d 2d 2d 2d 2d 2d 2d 0a 54 68 69 73 20 63 61 |--------.This ca| 000030f0 6c 6c 20 69 73 20 6d 61 64 65 20 77 68 65 6e 20 |ll is made when | 00003100 74 68 65 20 75 73 65 72 20 68 61 73 20 72 65 71 |the user has req| 00003110 75 65 73 74 65 64 20 74 68 65 20 76 61 72 69 61 |uested the varia| 00003120 62 6c 65 73 20 74 6f 20 62 65 20 72 65 73 65 74 |bles to be reset| 00003130 20 74 6f 0a 74 68 65 69 72 20 69 6e 69 74 61 6c | to.their inital| 00003140 20 28 64 65 66 61 75 6c 74 29 20 76 61 6c 75 65 | (default) value| 00003150 73 2e 20 41 6c 6c 20 66 75 6e 63 74 69 6f 6e 20 |s. All function | 00003160 76 61 72 69 61 62 6c 65 73 20 73 68 6f 75 6c 64 |variables should| 00003170 20 62 65 20 72 65 73 65 74 0a 61 63 63 6f 72 64 | be reset.accord| 00003180 69 6e 67 6c 79 2c 20 69 6e 63 6c 75 64 69 6e 67 |ingly, including| 00003190 20 7a 6f 6f 6d 20 6f 6e 65 73 2e 0a 0a 66 6d 65 | zoom ones...fme| 000031a0 6e 75 69 6e 69 74 20 28 6f 6e 6c 79 20 69 66 20 |nuinit (only if | 000031b0 66 65 6d 65 6e 75 20 65 6e 61 62 6c 65 64 29 0a |femenu enabled).| 000031c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 54 68 69 73 20 63 |---------.This c| 000031d0 61 6c 6c 20 69 73 20 6d 61 64 65 20 6a 75 73 74 |all is made just| 000031e0 20 70 72 69 6f 72 20 74 6f 20 64 69 73 70 6c 61 | prior to displa| 000031f0 79 69 6e 67 20 74 68 65 20 57 69 6d 70 20 6d 65 |ying the Wimp me| 00003200 6e 75 2e 20 54 68 65 20 66 75 6e 63 74 69 6f 6e |nu. The function| 00003210 0a 73 68 6f 75 6c 64 20 62 75 69 6c 64 20 69 74 |.should build it| 00003220 73 20 73 75 62 2d 6d 65 6e 75 20 73 74 72 75 63 |s sub-menu struc| 00003230 74 75 72 65 20 61 6e 64 20 72 65 74 75 72 6e 20 |ture and return | 00003240 69 74 73 20 61 64 64 72 65 73 73 20 61 73 20 74 |its address as t| 00003250 68 65 20 73 65 63 6f 6e 64 0a 70 61 72 61 6d 65 |he second.parame| 00003260 74 65 72 2c 20 6f 72 20 72 65 74 75 72 6e 20 61 |ter, or return a| 00003270 20 68 61 6e 64 6c 65 20 6f 66 20 61 20 77 69 6e | handle of a win| 00003280 64 6f 77 20 28 64 69 61 6c 6f 67 75 65 20 62 6f |dow (dialogue bo| 00003290 78 29 2e 0a 0a 66 6d 65 6e 75 63 6c 69 63 6b 20 |x)...fmenuclick | 000032a0 28 6f 6e 6c 79 20 69 66 20 66 65 6d 65 6e 75 20 |(only if femenu | 000032b0 65 6e 61 62 6c 65 64 29 0a 2d 2d 2d 2d 2d 2d 2d |enabled).-------| 000032c0 2d 2d 2d 0a 54 68 65 20 75 73 65 72 20 68 61 73 |---.The user has| 000032d0 20 63 6c 69 63 6b 65 64 20 6f 76 65 72 20 61 20 | clicked over a | 000032e0 6d 65 6e 75 20 73 65 6c 65 63 74 69 6f 6e 20 62 |menu selection b| 000032f0 65 6c 6f 6e 67 69 6e 67 20 74 6f 20 74 68 65 20 |elonging to the | 00003300 66 75 6e 63 74 69 6f 6e 2e 0a 21 46 72 61 63 74 |function..!Fract| 00003310 61 6c 20 70 61 73 73 65 73 73 20 74 68 65 20 61 |al passess the a| 00003320 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 69 6e |ddress of the in| 00003330 74 65 67 65 72 20 61 72 72 61 79 20 64 65 73 63 |teger array desc| 00003340 72 69 62 69 6e 67 20 74 68 65 20 6d 65 6e 75 0a |ribing the menu.| 00003350 73 65 6c 65 63 74 69 6f 6e 20 6d 61 64 65 20 61 |selection made a| 00003360 73 20 72 65 74 75 72 6e 65 64 20 62 79 20 74 68 |s returned by th| 00003370 65 20 57 69 6d 70 2e 20 54 68 65 20 61 72 72 61 |e Wimp. The arra| 00003380 79 20 68 61 73 20 61 20 73 69 7a 65 20 6f 66 20 |y has a size of | 00003390 31 30 20 77 68 65 72 65 0a 6d 65 6e 75 5b 30 5d |10 where.menu[0]| 000033a0 20 72 65 66 65 72 73 20 74 6f 20 74 68 65 20 74 | refers to the t| 000033b0 6f 70 20 6c 65 76 65 6c 20 6f 66 20 74 68 65 20 |op level of the | 000033c0 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 20 61 |menu structure a| 000033d0 6e 64 20 6d 65 6e 75 5b 31 5d 20 77 69 6c 6c 20 |nd menu[1] will | 000033e0 62 65 0a 74 68 65 20 66 69 72 73 74 20 69 74 65 |be.the first ite| 000033f0 6d 20 66 72 6f 6d 20 79 6f 75 72 20 6d 65 6e 75 |m from your menu| 00003400 20 73 74 72 75 63 74 75 72 65 2e 0a 0a 45 61 63 | structure...Eac| 00003410 68 20 61 72 72 61 79 20 65 6c 65 6d 65 6e 74 20 |h array element | 00003420 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 72 65 6c |contains the rel| 00003430 61 74 69 76 65 20 6d 65 6e 75 20 69 74 65 6d 20 |ative menu item | 00003440 6e 75 6d 62 65 72 20 74 68 61 74 20 77 61 73 20 |number that was | 00003450 73 65 6c 65 63 74 65 64 2e 0a 54 68 65 20 6c 69 |selected..The li| 00003460 73 74 20 69 73 20 74 65 72 6d 69 6e 61 74 65 64 |st is terminated| 00003470 20 62 79 20 61 6e 20 65 6c 65 6d 65 6e 74 20 63 | by an element c| 00003480 6f 6e 74 61 69 6e 69 6e 67 20 2d 31 2e 20 21 46 |ontaining -1. !F| 00003490 72 61 63 74 61 6c 20 6d 61 6b 65 73 20 61 0a 70 |ractal makes a.p| 000034a0 72 65 2d 63 68 65 63 6b 20 66 6f 72 20 6d 65 6e |re-check for men| 000034b0 75 5b 31 5d 20 6e 6f 74 20 63 6f 6e 74 61 69 6e |u[1] not contain| 000034c0 69 6e 67 20 2d 31 20 28 69 65 2e 20 6e 6f 20 73 |ing -1 (ie. no s| 000034d0 75 62 2d 6d 65 6e 75 20 73 65 6c 65 63 74 69 6f |ub-menu selectio| 000034e0 6e 20 6d 61 64 65 29 2e 0a 54 68 65 20 66 75 6e |n made)..The fun| 000034f0 63 74 69 6f 6e 20 73 68 6f 75 6c 64 20 63 61 72 |ction should car| 00003500 72 79 20 6f 75 74 20 61 6e 79 20 70 72 6f 63 65 |ry out any proce| 00003510 73 73 69 6e 67 20 72 65 71 75 69 72 65 64 2e 20 |ssing required. | 00003520 53 65 74 20 61 20 72 65 74 75 72 6e 20 63 6f 64 |Set a return cod| 00003530 65 20 6f 66 0a 31 20 74 6f 20 66 6f 72 63 65 20 |e of.1 to force | 00003540 61 20 72 65 2d 70 6c 6f 74 2e 0a 0a 66 7a 6f 6f |a re-plot...fzoo| 00003550 6d 69 6e 69 74 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |minit.---------.| 00003560 54 68 69 73 20 63 61 6c 6c 20 69 73 20 6d 61 64 |This call is mad| 00003570 65 20 6f 6e 20 70 72 65 73 73 69 6e 67 20 49 6e |e on pressing In| 00003580 69 74 20 5a 6f 6f 6d 2e 20 41 6c 6c 20 7a 6f 6f |it Zoom. All zoo| 00003590 6d 20 76 61 72 69 61 62 6c 65 73 20 73 68 6f 75 |m variables shou| 000035a0 6c 64 20 62 65 20 72 65 73 65 74 0a 74 6f 20 74 |ld be reset.to t| 000035b0 68 65 69 72 20 64 65 66 61 75 6c 74 73 2e 0a 0a |heir defaults...| 000035c0 66 6b 65 79 69 6e 70 20 28 6f 6e 6c 79 20 69 66 |fkeyinp (only if| 000035d0 20 66 65 6b 65 79 69 6e 70 20 65 6e 61 62 6c 65 | fekeyinp enable| 000035e0 64 29 0a 2d 2d 2d 2d 2d 2d 2d 0a 54 68 65 20 75 |d).-------.The u| 000035f0 73 65 72 20 68 61 73 20 70 72 65 73 73 65 64 20 |ser has pressed | 00003600 61 20 6b 65 79 20 77 68 69 6c 73 74 20 74 68 65 |a key whilst the| 00003610 20 6d 6f 75 73 65 20 77 61 73 20 6f 76 65 72 20 | mouse was over | 00003620 61 20 21 46 72 61 63 74 61 6c 20 77 69 6e 64 6f |a !Fractal windo| 00003630 77 2c 20 61 6e 64 0a 21 46 72 61 63 74 61 6c 20 |w, and.!Fractal | 00003640 64 6f 65 73 20 6e 6f 74 20 75 6e 64 65 72 73 74 |does not underst| 00003650 61 6e 64 20 68 6f 77 20 74 6f 20 70 72 6f 63 65 |and how to proce| 00003660 73 73 20 74 68 69 73 20 6b 65 79 2e 20 54 68 69 |ss this key. Thi| 00003670 73 20 63 61 6c 6c 20 61 6c 6c 6f 77 73 20 75 73 |s call allows us| 00003680 65 72 73 0a 74 6f 20 6e 61 76 69 67 61 74 65 20 |ers.to navigate | 00003690 70 72 69 76 61 74 65 20 64 61 74 61 20 65 6e 74 |private data ent| 000036a0 72 79 20 70 61 6e 65 6c 73 20 62 79 20 74 68 65 |ry panels by the| 000036b0 20 63 75 72 73 6f 72 20 6b 65 79 73 20 65 74 63 | cursor keys etc| 000036c0 2e 20 53 65 74 20 74 68 65 20 72 65 74 75 72 6e |. Set the return| 000036d0 0a 63 6f 64 65 20 74 6f 20 30 20 69 66 20 74 68 |.code to 0 if th| 000036e0 65 20 6b 65 79 20 77 61 73 20 70 72 6f 63 65 73 |e key was proces| 000036f0 73 65 64 2c 20 6f 72 20 2d 31 20 69 66 20 6e 6f |sed, or -1 if no| 00003700 74 20 75 6e 64 65 72 73 74 6f 6f 64 2e 0a 53 65 |t understood..Se| 00003710 65 20 74 68 65 20 49 46 53 20 73 6f 75 72 63 65 |e the IFS source| 00003720 20 66 6f 72 20 61 6e 20 65 78 61 6d 70 6c 65 2e | for an example.| 00003730 0a 0a 66 64 61 74 61 6c 6f 61 64 20 28 6f 6e 6c |..fdataload (onl| 00003740 79 20 69 66 20 66 65 64 61 74 61 6c 64 20 65 6e |y if fedatald en| 00003750 61 62 6c 65 64 29 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |abled).---------| 00003760 0a 54 68 65 20 75 73 65 72 20 68 61 73 20 64 72 |.The user has dr| 00003770 61 67 67 65 64 20 61 20 74 65 78 74 20 66 69 6c |agged a text fil| 00003780 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20 64 61 74 |e containing dat| 00003790 61 20 66 6f 72 20 61 20 66 75 6e 63 74 69 6f 6e |a for a function| 000037a0 20 74 6f 20 21 46 72 61 63 74 61 6c 2c 0a 61 6e | to !Fractal,.an| 000037b0 64 20 21 46 72 61 63 74 61 6c 20 63 6f 75 6c 64 |d !Fractal could| 000037c0 20 6e 6f 74 20 61 75 74 6f 6d 61 74 69 63 61 6c | not automatical| 000037d0 6c 79 20 70 72 6f 63 65 73 73 20 74 68 65 20 66 |ly process the f| 000037e0 69 6c 65 2e 20 21 46 72 61 63 74 61 6c 20 70 61 |ile. !Fractal pa| 000037f0 73 73 65 73 20 74 68 65 0a 6e 61 6d 65 20 6f 66 |sses the.name of| 00003800 20 74 68 65 20 66 69 6c 65 20 28 69 6e 20 66 6e | the file (in fn| 00003810 61 6d 65 29 20 74 6f 20 61 6c 6c 6f 77 20 74 68 |ame) to allow th| 00003820 65 20 66 75 6e 63 74 69 6f 6e 20 70 72 6f 63 65 |e function proce| 00003830 73 73 20 69 74 20 61 73 20 72 65 71 75 69 72 65 |ss it as require| 00003840 64 2e 0a 54 68 65 20 66 69 72 73 74 20 6c 69 6e |d..The first lin| 00003850 65 20 6f 66 20 74 65 78 74 20 66 69 6c 65 73 20 |e of text files | 00003860 6d 75 73 74 20 63 6f 6e 74 61 69 6e 20 74 68 65 |must contain the| 00003870 20 66 75 6e 63 74 69 6f 6e 20 6e 61 6d 65 20 28 | function name (| 00003880 6d 6e 61 6d 65 29 2e 0a 53 65 65 20 74 68 65 20 |mname)..See the | 00003890 49 46 53 20 73 6f 75 72 63 65 20 66 6f 72 20 61 |IFS source for a| 000038a0 6e 20 65 78 61 6d 70 6c 65 2e 0a 0a 66 68 65 6c |n example...fhel| 000038b0 70 0a 2d 2d 2d 2d 2d 0a 54 68 65 20 21 48 65 6c |p.-----.The !Hel| 000038c0 70 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 68 61 |p application ha| 000038d0 73 20 61 73 6b 65 64 20 66 6f 72 20 68 65 6c 70 |s asked for help| 000038e0 20 6f 6e 20 61 20 77 69 6e 64 6f 77 20 61 6e 64 | on a window and| 000038f0 20 69 74 20 69 73 20 6e 6f 74 20 61 0a 21 46 72 | it is not a.!Fr| 00003900 61 63 74 61 6c 20 77 69 6e 64 6f 77 2e 20 59 6f |actal window. Yo| 00003910 75 72 20 72 6f 75 74 69 6e 65 20 73 68 6f 75 6c |ur routine shoul| 00003920 64 20 63 68 65 63 6b 20 74 68 65 20 77 69 6e 64 |d check the wind| 00003930 6f 77 20 68 61 6e 64 6c 65 20 70 61 73 73 65 64 |ow handle passed| 00003940 20 61 6e 64 0a 72 65 74 75 72 6e 20 61 20 70 6f | and.return a po| 00003950 69 6e 74 65 72 20 74 6f 20 74 68 65 20 69 64 20 |inter to the id | 00003960 75 73 65 64 20 77 69 74 68 69 6e 20 74 68 65 20 |used within the | 00003970 3c 46 72 61 63 24 44 69 72 3e 2e 68 65 6c 70 74 |<Frac$Dir>.helpt| 00003980 65 78 74 20 66 69 6c 65 20 74 6f 0a 64 65 73 63 |ext file to.desc| 00003990 72 69 62 65 20 74 68 69 73 20 77 69 6e 64 6f 77 |ribe this window| 000039a0 2e 20 54 68 65 20 69 64 20 69 73 20 74 68 65 20 |. The id is the | 000039b0 73 61 6d 65 20 61 73 20 74 68 65 20 31 73 74 20 |same as the 1st | 000039c0 70 61 72 61 6d 65 74 65 72 20 6f 6e 20 65 61 63 |parameter on eac| 000039d0 68 20 6c 69 6e 65 0a 6f 66 20 74 68 69 73 20 66 |h line.of this f| 000039e0 69 6c 65 2c 20 74 68 65 20 32 6e 64 20 70 61 72 |ile, the 2nd par| 000039f0 61 6d 65 74 65 72 20 69 73 20 74 68 65 20 69 63 |ameter is the ic| 00003a00 6f 6e 20 6e 75 6d 62 65 72 2c 20 61 6e 64 20 74 |on number, and t| 00003a10 68 65 20 33 72 64 20 69 73 20 75 70 20 74 6f 0a |he 3rd is up to.| 00003a20 32 30 30 20 63 68 61 72 61 63 74 65 72 73 20 6f |200 characters o| 00003a30 66 20 68 65 6c 70 20 74 65 78 74 2e 20 53 65 65 |f help text. See| 00003a40 20 74 68 65 20 49 46 53 20 66 75 6e 63 74 69 6f | the IFS functio| 00003a50 6e 20 66 6f 72 20 61 6e 20 65 78 61 6d 70 6c 65 |n for an example| 00003a60 2e 0a 0a 66 78 79 70 6f 73 0a 2d 2d 2d 2d 2d 2d |...fxypos.------| 00003a70 0a 54 6f 20 67 65 74 20 74 68 65 20 69 6d 61 67 |.To get the imag| 00003a80 65 20 78 2f 79 20 76 61 6c 75 65 20 66 6f 72 20 |e x/y value for | 00003a90 61 6e 79 20 70 61 72 74 69 63 75 6c 61 72 20 70 |any particular p| 00003aa0 6f 69 6e 74 20 63 61 6c 6c 20 78 79 5f 73 74 61 |oint call xy_sta| 00003ab0 72 74 2e 20 45 76 65 6e 74 0a 66 78 79 70 6f 73 |rt. Event.fxypos| 00003ac0 20 77 69 6c 6c 20 6f 63 63 75 72 20 77 68 65 6e | will occur when| 00003ad0 20 74 68 65 20 75 73 65 72 20 70 72 65 73 73 65 | the user presse| 00003ae0 73 20 73 65 6c 65 63 74 20 6f 76 65 72 20 74 68 |s select over th| 00003af0 65 20 69 6d 61 67 65 2e 20 4f 6e 6c 79 20 76 61 |e image. Only va| 00003b00 6c 69 64 0a 66 6f 72 20 66 75 6e 63 74 69 6f 6e |lid.for function| 00003b10 73 20 64 65 66 69 6e 65 64 20 61 73 20 7a 6f 6f |s defined as zoo| 00003b20 6d 61 62 6c 65 2e 20 4d 61 6e 64 65 6c 62 72 6f |mable. Mandelbro| 00003b30 74 73 20 75 73 65 20 74 68 69 73 20 74 6f 20 73 |ts use this to s| 00003b40 65 6c 65 63 74 20 74 68 65 20 4a 75 6c 69 61 0a |elect the Julia.| 00003b50 52 65 61 6c 20 61 6e 64 20 49 6d 61 67 69 6e 61 |Real and Imagina| 00003b60 72 79 20 63 6f 6d 70 6f 6e 65 6e 74 73 2e 20 53 |ry components. S| 00003b70 65 74 20 61 20 72 65 74 75 72 6e 20 63 6f 64 65 |et a return code| 00003b80 20 6f 66 20 31 20 74 6f 20 66 6f 72 63 65 20 61 | of 1 to force a| 00003b90 20 72 65 70 6c 6f 74 2e 0a 0a 66 77 64 77 63 6c | replot...fwdwcl| 00003ba0 69 63 6b 20 28 6f 6e 6c 79 20 69 66 20 66 65 6d |ick (only if fem| 00003bb0 65 6e 75 20 65 6e 61 62 6c 65 64 29 0a 2d 2d 2d |enu enabled).---| 00003bc0 2d 2d 2d 2d 2d 2d 0a 54 68 65 20 75 73 65 72 20 |------.The user | 00003bd0 68 61 73 20 63 6c 69 63 6b 65 64 20 69 6e 73 69 |has clicked insi| 00003be0 64 65 20 61 6e 20 75 6e 6b 6e 6f 77 6e 20 77 69 |de an unknown wi| 00003bf0 6e 64 6f 77 2f 69 63 6f 6e 2e 20 54 68 65 20 66 |ndow/icon. The f| 00003c00 75 6e 63 74 69 6f 6e 20 73 68 6f 75 6c 64 0a 69 |unction should.i| 00003c10 6e 73 70 65 63 74 20 74 68 65 20 70 61 73 73 65 |nspect the passe| 00003c20 64 20 77 69 6e 64 6f 77 20 68 61 6e 64 6c 65 20 |d window handle | 00003c30 61 6e 64 20 69 63 6f 6e 20 6e 75 6d 62 65 72 20 |and icon number | 00003c40 74 6f 20 73 65 65 20 69 66 20 69 74 20 73 68 6f |to see if it sho| 00003c50 75 6c 64 20 70 72 6f 63 65 73 73 0a 69 74 2e 20 |uld process.it. | 00003c60 4f 6e 20 65 78 69 74 20 73 65 74 20 74 68 65 20 |On exit set the | 00003c70 72 65 74 75 72 6e 20 63 6f 64 65 20 61 73 20 66 |return code as f| 00003c80 6f 6c 6c 6f 77 73 3a 0a 20 20 2d 31 20 3a 20 77 |ollows:. -1 : w| 00003c90 69 6e 64 6f 77 20 63 6c 69 63 6b 20 75 6e 2d 72 |indow click un-r| 00003ca0 65 63 6f 67 6e 69 73 65 64 20 28 69 65 2e 20 64 |ecognised (ie. d| 00003cb0 6f 20 6e 6f 74 68 69 6e 67 29 0a 20 20 20 30 20 |o nothing). 0 | 00003cc0 3a 20 77 69 6e 64 6f 77 20 63 6c 69 63 6b 20 70 |: window click p| 00003cd0 72 6f 63 65 73 73 65 64 0a 20 20 20 31 20 3a 20 |rocessed. 1 : | 00003ce0 66 6f 72 63 65 20 61 20 72 65 2d 70 6c 6f 74 20 |force a re-plot | 00003cf0 6f 66 20 74 68 65 20 66 72 61 63 74 61 6c 0a 20 |of the fractal. | 00003d00 20 20 32 20 3a 20 63 6c 6f 73 65 20 74 68 65 20 | 2 : close the | 00003d10 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 0a 53 |menu structure.S| 00003d20 65 65 20 74 68 65 20 49 46 53 20 73 6f 75 72 63 |ee the IFS sourc| 00003d30 65 20 66 6f 72 20 61 6e 20 65 78 61 6d 70 6c 65 |e for an example| 00003d40 2e 0a 0a 66 64 61 74 61 73 61 76 65 0a 2d 2d 2d |...fdatasave.---| 00003d50 2d 2d 2d 2d 2d 2d 0a 41 20 22 53 61 76 65 20 41 |------.A "Save A| 00003d60 73 22 20 6f 70 65 72 61 74 69 6f 6e 20 66 6f 72 |s" operation for| 00003d70 20 61 20 66 75 6e 63 74 69 6f 6e 20 68 61 73 20 | a function has | 00003d80 63 6f 6d 70 6c 65 74 65 64 2e 20 54 68 65 20 66 |completed. The f| 00003d90 75 6c 6c 20 66 69 6c 65 20 6e 61 6d 65 20 28 69 |ull file name (i| 00003da0 6e 0a 66 6e 61 6d 65 29 20 69 73 20 70 61 73 73 |n.fname) is pass| 00003db0 65 64 20 74 6f 20 74 68 65 20 66 75 6e 63 74 69 |ed to the functi| 00003dc0 6f 6e 20 74 6f 20 65 6e 61 62 6c 65 20 74 68 65 |on to enable the| 00003dd0 20 66 69 6c 65 20 74 6f 20 62 65 20 73 61 76 65 | file to be save| 00003de0 64 2e 20 54 6f 20 65 6e 61 62 6c 65 0a 74 68 69 |d. To enable.thi| 00003df0 73 20 70 72 6f 63 65 73 73 20 63 61 6c 6c 20 74 |s process call t| 00003e00 68 65 20 72 6f 75 74 69 6e 65 20 75 73 65 72 5f |he routine user_| 00003e10 73 61 76 65 20 74 6f 20 6f 62 74 61 69 6e 20 74 |save to obtain t| 00003e20 68 65 20 77 69 6e 64 6f 77 20 68 61 6e 64 6c 65 |he window handle| 00003e30 20 6f 66 20 61 0a 22 53 61 76 65 20 41 73 22 20 | of a."Save As" | 00003e40 64 69 61 6c 6f 67 75 65 20 62 6f 78 20 77 68 69 |dialogue box whi| 00003e50 63 68 20 79 6f 75 20 74 68 65 6e 20 70 6c 61 63 |ch you then plac| 00003e60 65 20 69 6e 20 74 68 65 20 66 75 6e 63 74 69 6f |e in the functio| 00003e70 6e 27 73 20 6f 77 6e 20 73 75 62 6d 65 6e 75 0a |n's own submenu.| 00003e80 73 74 72 75 63 74 75 72 65 2e 20 21 46 72 61 63 |structure. !Frac| 00003e90 74 61 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c |tal automaticall| 00003ea0 79 20 68 61 6e 64 6c 65 73 20 74 68 65 20 64 72 |y handles the dr| 00003eb0 61 67 67 69 6e 67 20 6f 72 20 63 6c 69 63 6b 20 |agging or click | 00003ec0 6f 6e 20 74 68 65 20 4f 6b 0a 62 75 74 74 6f 6e |on the Ok.button| 00003ed0 2c 20 63 68 65 63 6b 73 20 66 6f 72 20 61 20 76 |, checks for a v| 00003ee0 61 6c 69 64 20 66 69 6c 65 6e 61 6d 65 2c 20 61 |alid filename, a| 00003ef0 6e 64 20 74 68 65 6e 20 69 73 73 75 65 73 20 74 |nd then issues t| 00003f00 68 65 20 66 64 61 74 61 73 61 76 65 20 63 61 6c |he fdatasave cal| 00003f10 6c 2e 0a 54 79 70 69 63 61 6c 6c 79 20 74 68 65 |l..Typically the| 00003f20 20 64 61 74 61 20 77 69 6c 6c 20 62 65 20 73 61 | data will be sa| 00003f30 76 65 64 20 69 6e 20 74 65 78 74 20 66 6f 72 6d |ved in text form| 00003f40 61 74 20 74 6f 20 61 6c 6c 6f 77 20 72 65 2d 6c |at to allow re-l| 00003f50 6f 61 64 69 6e 67 20 62 79 20 74 68 65 0a 66 64 |oading by the.fd| 00003f60 61 74 61 6c 6f 61 64 20 6f 70 65 72 61 74 69 6f |ataload operatio| 00003f70 6e 2e 20 53 65 65 20 74 68 65 20 49 46 53 20 73 |n. See the IFS s| 00003f80 6f 75 72 63 65 20 66 6f 72 20 61 6e 20 65 78 61 |ource for an exa| 00003f90 6d 70 6c 65 2e 0a 0a 66 6e 65 77 72 6f 74 61 74 |mple...fnewrotat| 00003fa0 69 6f 6e 20 26 20 66 6e 65 77 65 6c 65 76 61 74 |ion & fnewelevat| 00003fb0 69 6f 6e 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |ion.------------| 00003fc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003fd0 0a 54 68 65 73 65 20 66 75 6e 63 74 69 6f 6e 20 |.These function | 00003fe0 63 61 6c 6c 73 20 61 72 65 20 6d 61 64 65 20 77 |calls are made w| 00003ff0 68 65 6e 20 74 68 65 20 75 73 65 72 20 68 61 73 |hen the user has| 00004000 20 63 6c 69 63 6b 65 64 20 6f 6e 20 74 68 65 20 | clicked on the | 00004010 72 6f 74 61 74 69 6f 6e 20 61 6e 64 0a 65 6c 65 |rotation and.ele| 00004020 76 61 74 69 6f 6e 20 61 64 6a 75 73 74 20 69 63 |vation adjust ic| 00004030 6f 6e 73 2e 20 21 46 72 61 63 74 61 6c 20 70 61 |ons. !Fractal pa| 00004040 73 73 65 73 20 74 68 65 20 6e 65 77 20 61 6e 67 |sses the new ang| 00004050 6c 65 20 74 6f 20 74 68 65 20 66 75 6e 63 74 69 |le to the functi| 00004060 6f 6e 20 73 6f 0a 74 68 61 74 20 69 74 20 63 61 |on so.that it ca| 00004070 6e 20 75 70 64 61 74 65 20 69 74 27 73 20 6f 77 |n update it's ow| 00004080 6e 20 63 6f 70 79 20 69 66 20 69 6e 74 65 72 65 |n copy if intere| 00004090 73 74 65 64 2e 20 54 68 65 20 66 75 6e 63 74 69 |sted. The functi| 000040a0 6f 6e 20 63 61 6e 20 61 6c 73 6f 0a 6f 76 65 72 |on can also.over| 000040b0 72 69 64 65 20 74 68 65 20 76 61 6c 75 65 20 2d |ride the value -| 000040c0 20 66 6f 72 20 69 6e 73 74 61 6e 63 65 20 74 6f | for instance to| 000040d0 20 70 72 65 76 65 6e 74 20 74 68 65 20 65 6c 65 | prevent the ele| 000040e0 76 61 74 69 6f 6e 20 67 6f 69 6e 67 20 62 65 6c |vation going bel| 000040f0 6f 77 0a 30 2d 64 65 67 72 65 65 73 20 2d 20 62 |ow.0-degrees - b| 00004100 79 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 70 |y updating the p| 00004110 61 73 73 65 64 20 61 6e 67 6c 65 2e 20 4e 6f 74 |assed angle. Not| 00004120 65 20 74 68 61 74 20 74 68 65 72 65 20 61 72 65 |e that there are| 00004130 20 34 20 66 75 6e 63 74 69 6f 6e 0a 63 61 6c 6c | 4 function.call| 00004140 73 20 61 76 61 69 6c 61 62 6c 65 20 74 6f 20 67 |s available to g| 00004150 65 74 20 61 6e 64 20 73 65 74 20 74 68 65 73 65 |et and set these| 00004160 20 61 6e 67 6c 65 73 20 61 74 20 6f 74 68 65 72 | angles at other| 00004170 20 74 69 6d 65 73 2e 20 53 65 65 20 74 68 72 65 | times. See thre| 00004180 65 64 2e 63 20 66 6f 72 0a 75 73 61 67 65 20 6f |ed.c for.usage o| 00004190 66 20 74 68 65 73 65 20 63 61 6c 6c 73 2e 0a 0a |f these calls...| 000041a0 66 64 61 74 61 77 64 77 20 28 6f 6e 6c 79 20 69 |fdatawdw (only i| 000041b0 66 20 66 65 64 61 74 77 64 77 20 65 6e 61 62 6c |f fedatwdw enabl| 000041c0 65 64 29 0a 2d 2d 2d 2d 2d 2d 2d 2d 0a 54 68 65 |ed).--------.The| 000041d0 20 75 73 65 72 20 68 61 73 20 63 6c 69 63 6b 65 | user has clicke| 000041e0 64 20 6f 6e 20 74 68 65 20 6e 75 6d 62 65 72 73 |d on the numbers| 000041f0 20 74 6f 6f 6c 20 69 63 6f 6e 2e 20 54 68 69 73 | tool icon. This| 00004200 20 63 61 6c 6c 20 69 73 20 6d 61 64 65 20 74 6f | call is made to| 00004210 20 61 6c 6c 6f 77 0a 74 68 65 20 66 75 6e 63 74 | allow.the funct| 00004220 69 6f 6e 20 6f 70 65 6e 20 69 74 73 20 64 61 74 |ion open its dat| 00004230 61 20 65 6e 74 72 79 20 77 69 6e 64 6f 77 20 69 |a entry window i| 00004240 6e 73 74 65 61 64 20 6f 66 20 74 68 65 20 49 6d |nstead of the Im| 00004250 61 67 65 2d 3e 44 61 74 61 20 77 69 6e 64 6f 77 |age->Data window| 00004260 2e 0a 54 68 65 20 73 63 72 65 65 6e 20 63 6f 2d |..The screen co-| 00004270 6f 72 64 69 6e 61 74 65 73 20 6f 66 20 74 68 65 |ordinates of the| 00004280 20 74 6f 70 20 6c 65 66 74 20 63 6f 72 6e 65 72 | top left corner| 00004290 20 61 72 65 20 70 61 73 73 65 64 20 61 73 20 61 | are passed as a| 000042a0 20 73 75 67 67 65 73 74 65 64 0a 6f 70 65 6e 69 | suggested.openi| 000042b0 6e 67 20 70 6f 73 69 74 69 6f 6e 2e 20 53 65 65 |ng position. See| 000042c0 20 69 66 73 2e 63 20 66 6f 72 20 61 6e 20 65 78 | ifs.c for an ex| 000042d0 61 6d 70 6c 65 2e 0a 0a 66 73 75 62 6d 65 6e 75 |ample...fsubmenu| 000042e0 0a 2d 2d 2d 2d 2d 2d 2d 2d 0a 41 20 73 75 62 6d |.--------.A subm| 000042f0 65 6e 75 20 69 73 20 74 6f 20 62 65 20 6f 70 65 |enu is to be ope| 00004300 6e 65 64 20 62 65 63 61 75 73 65 20 74 68 65 20 |ned because the | 00004310 6d 65 6e 75 20 69 74 65 6d 20 68 61 73 20 74 68 |menu item has th| 00004320 65 20 77 69 6d 70 5f 4d 53 55 42 4c 49 4e 4b 4d |e wimp_MSUBLINKM| 00004330 53 47 0a 66 6c 61 67 20 73 65 74 2e 20 54 68 69 |SG.flag set. Thi| 00004340 73 20 61 6c 6c 6f 77 73 20 66 75 6e 63 74 69 6f |s allows functio| 00004350 6e 73 20 74 6f 20 64 79 6e 61 6d 69 63 61 6c 6c |ns to dynamicall| 00004360 79 20 63 72 65 61 74 65 20 74 68 65 69 72 20 6f |y create their o| 00004370 77 6e 20 77 69 6e 64 6f 77 73 2e 20 54 68 65 0a |wn windows. The.| 00004380 66 75 6e 63 74 69 6f 6e 20 73 68 6f 75 6c 64 20 |function should | 00004390 72 65 74 75 72 6e 20 74 68 65 20 73 75 62 6d 65 |return the subme| 000043a0 6e 75 20 70 6f 69 6e 74 65 72 20 6f 72 20 61 20 |nu pointer or a | 000043b0 77 69 6e 64 6f 77 20 68 61 6e 64 6c 65 2e 20 53 |window handle. S| 000043c0 65 65 20 63 2e 69 66 73 20 66 6f 72 0a 61 6e 20 |ee c.ifs for.an | 000043d0 65 78 61 6d 70 6c 65 2e 0a 0a 66 73 70 72 69 74 |example...fsprit| 000043e0 65 6c 6f 61 64 20 28 6f 6e 6c 79 20 69 66 20 66 |eload (only if f| 000043f0 65 73 70 72 6c 6f 64 20 73 65 74 29 0a 2d 2d 2d |esprlod set).---| 00004400 2d 2d 2d 2d 2d 2d 2d 2d 0a 41 20 73 70 72 69 74 |--------.A sprit| 00004410 65 20 66 69 6c 65 20 63 6f 6e 74 61 69 6e 69 6e |e file containin| 00004420 67 20 73 70 72 69 74 65 73 20 69 6e 20 61 20 32 |g sprites in a 2| 00004430 35 36 20 63 6f 6c 6f 75 72 20 6d 6f 64 65 20 68 |56 colour mode h| 00004440 61 73 20 62 65 65 6e 20 64 72 61 67 67 65 64 20 |as been dragged | 00004450 6f 6e 74 6f 0a 61 20 21 46 72 61 63 74 61 6c 20 |onto.a !Fractal | 00004460 77 69 6e 64 6f 77 2e 20 54 68 65 20 66 69 6c 65 |window. The file| 00004470 6e 61 6d 65 20 69 73 20 70 61 73 73 65 64 20 2d |name is passed -| 00004480 20 75 73 65 20 74 68 65 20 66 73 70 72 69 74 65 | use the fsprite| 00004490 5f 6c 6f 61 64 20 66 75 6e 63 74 69 6f 6e 20 74 |_load function t| 000044a0 6f 0a 6c 6f 61 64 20 74 68 65 20 66 69 6c 65 2e |o.load the file.| 000044b0 20 53 65 65 20 74 68 65 20 46 61 75 6c 74 20 66 | See the Fault f| 000044c0 75 6e 63 74 69 6f 6e 2e 0a 0a 46 75 6e 63 74 69 |unction...Functi| 000044d0 6f 6e 20 50 61 72 61 6d 65 74 65 72 73 0a 3d 3d |on Parameters.==| 000044e0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 000044f0 3d 0a 57 68 65 6e 20 61 20 66 75 6e 63 74 69 6f |=.When a functio| 00004500 6e 20 69 73 20 63 61 6c 6c 65 64 2c 20 69 74 20 |n is called, it | 00004510 69 73 20 70 61 73 73 65 64 20 32 20 70 61 72 61 |is passed 2 para| 00004520 6d 65 74 65 72 73 3a 0a 31 29 20 61 6e 20 69 6e |meters:.1) an in| 00004530 74 65 67 65 72 20 63 6f 6e 74 61 69 6e 69 6e 67 |teger containing| 00004540 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 63 61 | the function ca| 00004550 6c 6c 20 6e 75 6d 62 65 72 2e 20 59 6f 75 20 73 |ll number. You s| 00004560 68 6f 75 6c 64 20 61 6c 77 61 79 73 20 72 65 66 |hould always ref| 00004570 65 72 0a 74 6f 20 74 68 65 73 65 20 62 79 20 74 |er.to these by t| 00004580 68 65 20 73 79 6d 62 6f 6c 69 63 20 6e 61 6d 65 |he symbolic name| 00004590 73 20 61 62 6f 76 65 2e 20 28 69 6e 20 52 30 20 |s above. (in R0 | 000045a0 66 6f 72 20 61 73 73 65 6d 62 6c 65 72 20 72 6f |for assembler ro| 000045b0 75 74 69 6e 65 73 29 2e 0a 32 29 20 74 68 65 20 |utines)..2) the | 000045c0 61 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 66 |address of the f| 000045d0 75 6e 63 74 69 6f 6e 20 63 6f 6e 74 72 6f 6c 20 |unction control | 000045e0 62 6c 6f 63 6b 20 28 69 6e 20 52 31 20 66 6f 72 |block (in R1 for| 000045f0 20 61 73 73 65 6d 62 6c 65 72 29 2e 0a 0a 54 68 | assembler)...Th| 00004600 65 20 6c 61 79 6f 75 74 20 6f 66 20 66 75 6e 63 |e layout of func| 00004610 74 69 6f 6e 20 63 6f 6e 74 72 6f 6c 20 62 6c 6f |tion control blo| 00004620 63 6b 73 20 69 73 20 64 65 70 65 6e 64 65 6e 74 |cks is dependent| 00004630 20 6f 6e 20 74 68 65 20 66 75 6e 63 74 69 6f 6e | on the function| 00004640 2e 20 54 68 65 0a 66 69 72 73 74 20 70 61 72 61 |. The.first para| 00004650 6d 65 74 65 72 20 69 73 20 61 6c 77 61 79 73 20 |meter is always | 00004660 61 6e 20 69 6e 74 65 67 65 72 20 28 72 65 74 63 |an integer (retc| 00004670 29 20 74 68 61 74 20 69 73 20 75 73 65 64 20 74 |) that is used t| 00004680 6f 20 70 61 73 73 20 62 61 63 6b 20 61 0a 72 65 |o pass back a.re| 00004690 74 75 72 6e 20 63 6f 64 65 20 74 6f 20 21 46 72 |turn code to !Fr| 000046a0 61 63 74 61 6c 2e 20 52 65 74 75 72 6e 20 63 6f |actal. Return co| 000046b0 64 65 73 20 61 72 65 20 64 6f 63 75 6d 65 6e 74 |des are document| 000046c0 65 64 20 69 6e 20 74 68 65 20 46 75 6e 63 74 69 |ed in the Functi| 000046d0 6f 6e 20 43 61 6c 6c 0a 73 65 63 74 69 6f 6e 2e |on Call.section.| 000046e0 0a 0a 4e 62 2e 20 54 68 65 20 64 61 74 61 20 74 |..Nb. The data t| 000046f0 79 70 65 73 20 72 65 66 65 72 20 74 6f 20 74 68 |ypes refer to th| 00004700 65 20 6e 61 6d 65 73 20 75 73 65 64 20 69 6e 20 |e names used in | 00004710 43 2e 20 2a 20 61 66 74 65 72 20 74 68 65 20 64 |C. * after the d| 00004720 61 74 61 20 74 79 70 65 20 6d 65 61 6e 73 0a 61 |ata type means.a| 00004730 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 61 74 | pointer to that| 00004740 20 74 79 70 65 20 6f 66 20 64 61 74 61 2e 0a 0a | type of data...| 00004750 66 69 6e 69 74 3a 20 4e 6f 20 61 64 64 69 74 69 |finit: No additi| 00004760 6f 6e 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e |onal information| 00004770 20 70 61 73 73 65 64 2e 0a 66 73 65 6c 65 63 74 | passed..fselect| 00004780 3a 20 4e 6f 20 61 64 64 69 74 69 6f 6e 61 6c 20 |: No additional | 00004790 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 70 61 73 73 |information pass| 000047a0 65 64 2e 0a 66 64 65 73 65 6c 65 63 74 3a 20 4e |ed..fdeselect: N| 000047b0 6f 20 61 64 64 69 74 69 6f 6e 61 6c 20 69 6e 66 |o additional inf| 000047c0 6f 72 6d 61 74 69 6f 6e 20 70 61 73 73 65 64 2e |ormation passed.| 000047d0 0a 0a 66 70 6c 6f 74 69 6e 69 74 20 61 6e 64 20 |..fplotinit and | 000047e0 66 70 6c 6f 74 3a 20 54 68 65 20 66 6f 6c 6c 6f |fplot: The follo| 000047f0 77 69 6e 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e |wing information| 00004800 20 69 73 20 70 61 73 73 65 64 3a 0a 2d 2d 2d 2d | is passed:.----| 00004810 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |---------------.| 00004820 69 6e 74 65 67 65 72 20 78 2c 79 3a 20 54 68 65 |integer x,y: The| 00004830 20 63 75 72 72 65 6e 74 20 69 6d 61 67 65 20 63 | current image c| 00004840 6f 2d 6f 72 64 69 6e 61 74 65 73 20 69 6e 20 70 |o-ordinates in p| 00004850 69 78 65 6c 73 2e 20 4f 6e 20 66 70 6c 6f 74 69 |ixels. On fploti| 00004860 6e 69 74 20 78 3d 30 20 61 6e 64 0a 79 3d 6d 61 |nit x=0 and.y=ma| 00004870 78 2e 20 79 20 63 6f 2d 6f 72 64 2d 31 2c 20 69 |x. y co-ord-1, i| 00004880 65 2e 20 74 68 65 20 74 6f 70 20 6c 65 66 74 20 |e. the top left | 00004890 63 6f 72 6e 65 72 20 6f 66 20 74 68 65 20 69 6d |corner of the im| 000048a0 61 67 65 2e 20 54 68 65 73 65 20 76 61 6c 75 65 |age. These value| 000048b0 73 20 73 68 6f 75 6c 64 0a 62 65 20 75 70 64 61 |s should.be upda| 000048c0 74 65 64 20 62 79 20 78 2f 79 20 70 6c 6f 74 74 |ted by x/y plott| 000048d0 69 6e 67 20 66 75 6e 63 74 69 6f 6e 73 20 61 73 |ing functions as| 000048e0 20 74 68 65 79 20 70 72 6f 63 65 64 65 2e 0a 0a | they procede...| 000048f0 63 68 61 72 20 2a 20 61 64 64 72 3a 20 63 75 72 |char * addr: cur| 00004900 72 65 6e 74 20 70 6c 6f 74 20 61 64 64 72 65 73 |rent plot addres| 00004910 73 2e 20 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 |s. The function | 00004920 63 61 6e 20 75 70 64 61 74 65 20 74 68 69 73 20 |can update this | 00004930 76 61 6c 75 65 20 61 73 0a 69 74 20 70 72 6f 63 |value as.it proc| 00004940 65 64 65 73 2e 20 4f 6e 20 66 70 6c 6f 74 69 6e |edes. On fplotin| 00004950 69 74 20 74 68 65 20 76 61 6c 75 65 20 69 73 20 |it the value is | 00004960 74 68 65 20 73 61 6d 65 20 61 73 20 62 61 73 65 |the same as base| 00004970 2e 20 57 68 65 6e 20 73 77 69 74 63 68 69 6e 67 |. When switching| 00004980 20 66 72 6f 6d 0a 73 63 72 65 65 6e 20 74 6f 20 | from.screen to | 00004990 73 70 72 69 74 65 20 21 46 72 61 63 74 61 6c 20 |sprite !Fractal | 000049a0 77 69 6c 6c 20 73 65 74 20 74 68 69 73 20 61 64 |will set this ad| 000049b0 64 72 65 73 73 20 62 61 73 65 64 20 6f 6e 20 74 |dress based on t| 000049c0 68 65 20 63 75 72 72 65 6e 74 20 78 2f 79 0a 76 |he current x/y.v| 000049d0 61 6c 75 65 2e 20 54 68 75 73 20 66 75 6e 63 74 |alue. Thus funct| 000049e0 69 6f 6e 73 20 77 68 69 63 68 20 75 73 65 20 64 |ions which use d| 000049f0 69 72 65 63 74 20 69 6d 61 67 65 20 61 64 64 72 |irect image addr| 00004a00 65 73 73 69 6e 67 20 73 68 6f 75 6c 64 20 6e 6f |essing should no| 00004a10 74 20 62 65 0a 61 66 66 65 63 74 65 64 20 74 68 |t be.affected th| 00004a20 65 72 65 66 6f 72 65 20 62 79 20 74 68 65 20 73 |erefore by the s| 00004a30 77 69 74 63 68 2e 0a 0a 63 68 61 72 20 2a 20 62 |witch...char * b| 00004a40 61 73 65 3a 20 74 68 65 20 61 64 64 72 65 73 73 |ase: the address| 00004a50 20 6f 66 20 74 68 65 20 73 74 61 72 74 20 6f 66 | of the start of| 00004a60 20 74 68 65 20 69 6d 61 67 65 2e 20 54 68 69 73 | the image. This| 00004a70 20 6d 61 79 20 62 65 20 74 68 65 20 73 63 72 65 | may be the scre| 00004a80 65 6e 0a 6f 72 20 61 20 73 70 72 69 74 65 2e 20 |en.or a sprite. | 00004a90 54 68 65 20 73 69 7a 65 20 6f 66 20 74 68 65 20 |The size of the | 00004aa0 69 6d 61 67 65 20 69 6e 20 62 79 74 65 73 3d 69 |image in bytes=i| 00004ab0 6d 61 67 65 20 77 69 64 74 68 2a 68 65 69 67 68 |mage width*heigh| 00004ac0 74 20 69 6e 20 70 69 78 65 6c 73 2e 0a 54 68 69 |t in pixels..Thi| 00004ad0 73 20 76 61 6c 75 65 20 6d 61 79 20 73 77 69 74 |s value may swit| 00004ae0 63 68 20 66 72 6f 6d 20 73 63 72 65 65 6e 20 74 |ch from screen t| 00004af0 6f 20 73 70 72 69 74 65 20 77 68 65 6e 20 65 78 |o sprite when ex| 00004b00 69 74 69 6e 67 20 64 65 64 69 63 61 74 65 64 20 |iting dedicated | 00004b10 6d 6f 64 65 0a 70 6c 6f 74 74 69 6e 67 2e 0a 0a |mode.plotting...| 00004b20 69 6e 74 65 67 65 72 20 66 6c 61 67 73 3a 0a 20 |integer flags:. | 00004b30 20 70 6c 6f 74 5f 64 65 64 20 3a 20 77 69 6c 6c | plot_ded : will| 00004b40 20 62 65 20 6f 6e 20 77 68 65 6e 20 69 6e 20 64 | be on when in d| 00004b50 65 64 69 63 61 74 65 64 20 70 6c 6f 74 74 69 6e |edicated plottin| 00004b60 67 20 6d 6f 64 65 2e 0a 20 20 70 6c 6f 74 5f 66 |g mode.. plot_f| 00004b70 70 20 20 3a 20 69 73 20 6f 6e 20 69 66 20 74 68 |p : is on if th| 00004b80 65 20 75 73 65 72 20 72 65 71 75 65 73 74 65 64 |e user requested| 00004b90 20 75 73 65 20 6f 66 20 66 6c 6f 61 74 69 6e 67 | use of floating| 00004ba0 20 70 6f 69 6e 74 20 61 72 69 74 68 6d 65 74 69 | point arithmeti| 00004bb0 63 20 69 66 0a 20 20 20 20 20 20 20 20 20 20 20 |c if. | 00004bc0 20 20 61 76 61 69 6c 61 62 6c 65 2e 0a 20 20 70 | available.. p| 00004bd0 6c 6f 74 5f 7a 6f 6f 6d 3a 20 74 68 69 73 20 69 |lot_zoom: this i| 00004be0 73 20 61 20 7a 6f 6f 6d 20 72 65 64 72 61 77 20 |s a zoom redraw | 00004bf0 72 65 71 75 65 73 74 2c 20 69 65 2e 20 72 65 64 |request, ie. red| 00004c00 72 61 77 20 6c 61 73 74 20 69 6d 61 67 65 20 62 |raw last image b| 00004c10 75 74 20 77 69 74 68 0a 20 20 20 20 20 20 20 20 |ut with. | 00004c20 20 20 20 20 20 6e 65 77 20 63 6f 2d 6f 72 64 73 | new co-ords| 00004c30 2e 20 54 68 69 73 20 66 6c 61 67 20 69 73 20 66 |. This flag is f| 00004c40 6f 72 20 66 75 6e 63 74 69 6f 6e 73 20 74 68 61 |or functions tha| 00004c50 74 20 70 69 63 6b 20 72 61 6e 64 6f 6d 20 76 61 |t pick random va| 00004c60 6c 75 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 |lues. | 00004c70 20 20 74 6f 20 74 65 6c 6c 20 74 68 65 6d 20 74 | to tell them t| 00004c80 6f 20 75 73 65 20 74 68 65 20 70 72 65 76 69 6f |o use the previo| 00004c90 75 73 20 76 61 6c 75 65 73 2c 20 6e 6f 74 20 72 |us values, not r| 00004ca0 65 2d 63 68 6f 6f 73 65 20 74 68 65 6d 2e 0a 0a |e-choose them...| 00004cb0 63 68 61 72 20 2a 20 65 72 72 6d 73 67 3a 20 69 |char * errmsg: i| 00004cc0 66 20 79 6f 75 72 20 70 6c 6f 74 20 72 6f 75 74 |f your plot rout| 00004cd0 69 6e 65 20 6e 65 65 64 73 20 74 6f 20 65 6e 64 |ine needs to end| 00004ce0 20 77 69 74 68 20 61 6e 20 65 72 72 6f 72 20 6d | with an error m| 00004cf0 65 73 73 61 67 65 2c 0a 70 6c 61 63 65 20 74 68 |essage,.place th| 00004d00 65 20 61 64 64 72 65 73 73 20 6f 66 20 74 68 65 |e address of the| 00004d10 20 7a 65 72 6f 2d 74 65 72 6d 69 6e 61 74 65 64 | zero-terminated| 00004d20 20 6d 65 73 73 61 67 65 20 74 65 78 74 20 69 6e | message text in| 00004d30 20 74 68 69 73 20 66 69 65 6c 64 2e 20 44 6f 20 | this field. Do | 00004d40 6e 6f 74 0a 75 73 65 20 57 69 6d 70 5f 52 65 70 |not.use Wimp_Rep| 00004d50 6f 72 74 45 72 72 6f 72 2c 20 73 69 6e 63 65 20 |ortError, since | 00004d60 74 68 65 20 65 72 72 6f 72 20 62 6f 78 20 77 69 |the error box wi| 00004d70 6c 6c 20 62 65 63 6f 6d 65 20 70 61 72 74 20 6f |ll become part o| 00004d80 66 20 74 68 65 20 69 6d 61 67 65 21 0a 0a 54 68 |f the image!..Th| 00004d90 65 20 69 6d 61 67 65 20 69 6e 66 6f 72 6d 61 74 |e image informat| 00004da0 69 6f 6e 20 63 6f 6e 74 72 6f 6c 20 62 6c 6f 63 |ion control bloc| 00004db0 6b 20 66 6f 6c 6c 6f 77 73 2e 20 54 68 65 73 65 |k follows. These| 00004dc0 20 76 61 6c 75 65 73 20 61 72 65 20 66 6f 72 20 | values are for | 00004dd0 72 65 66 65 72 65 6e 63 65 0a 61 6e 64 20 77 69 |reference.and wi| 00004de0 6c 6c 20 6e 6f 74 20 63 68 61 6e 67 65 20 64 75 |ll not change du| 00004df0 72 69 6e 67 20 70 6c 6f 74 74 69 6e 67 2e 0a 0a |ring plotting...| 00004e00 69 6e 74 65 67 65 72 20 77 2c 68 3a 20 69 6d 61 |integer w,h: ima| 00004e10 67 65 20 77 69 64 74 68 20 61 6e 64 20 68 65 69 |ge width and hei| 00004e20 67 68 74 20 69 6e 20 70 69 78 65 6c 73 2e 0a 0a |ght in pixels...| 00004e30 69 6e 74 65 67 65 72 20 6d 6f 64 65 3a 20 69 6d |integer mode: im| 00004e40 61 67 65 20 73 63 72 65 65 6e 20 6d 6f 64 65 20 |age screen mode | 00004e50 6e 75 6d 62 65 72 2e 0a 69 6e 74 65 67 65 72 20 |number..integer | 00004e60 72 65 73 65 72 76 65 64 2e 0a 0a 69 6e 74 65 67 |reserved...integ| 00004e70 65 72 20 6f 73 78 2c 6f 73 79 3a 20 69 6d 61 67 |er osx,osy: imag| 00004e80 65 20 77 69 64 74 68 20 61 6e 64 20 68 65 69 67 |e width and heig| 00004e90 68 74 20 69 6e 20 4f 53 20 75 6e 69 74 73 2e 0a |ht in OS units..| 00004ea0 0a 69 6e 74 65 67 65 72 20 78 66 2c 79 66 3a 20 |.integer xf,yf: | 00004eb0 54 68 65 20 70 69 78 65 6c 20 74 6f 20 4f 53 20 |The pixel to OS | 00004ec0 75 6e 69 74 20 6d 75 6c 74 69 70 6c 69 65 72 73 |unit multipliers| 00004ed0 2e 0a 0a 69 6e 74 65 67 65 72 20 72 65 73 65 72 |...integer reser| 00004ee0 76 65 64 2e 0a 0a 63 68 61 72 20 2a 20 70 61 6c |ved...char * pal| 00004ef0 6c 3a 20 41 64 64 72 65 73 73 20 6f 66 20 61 20 |l: Address of a | 00004f00 32 35 36 20 62 79 74 65 20 62 6c 6f 63 6b 20 66 |256 byte block f| 00004f10 6f 72 20 63 6f 6e 76 65 72 74 69 6e 67 20 61 20 |or converting a | 00004f20 63 6f 6c 6f 75 72 20 6e 75 6d 62 65 72 20 69 6e |colour number in| 00004f30 74 6f 0a 69 74 73 20 6c 6f 67 69 63 61 6c 20 65 |to.its logical e| 00004f40 71 75 69 76 61 6c 65 6e 74 2e 20 54 68 69 73 20 |quivalent. This | 00004f50 69 73 20 66 6f 72 20 72 6f 75 74 69 6e 65 73 20 |is for routines | 00004f60 74 68 61 74 20 75 73 65 20 63 6f 6c 6f 75 72 20 |that use colour | 00004f70 30 20 61 73 20 6c 6f 77 20 61 6e 64 0a 63 6f 6c |0 as low and.col| 00004f80 6f 75 72 20 32 35 35 20 61 73 20 68 69 67 68 20 |our 255 as high | 00004f90 28 73 75 63 68 20 61 73 20 6d 61 6e 64 65 6c 62 |(such as mandelb| 00004fa0 72 6f 74 73 29 2e 20 54 68 65 20 74 61 62 6c 65 |rots). The table| 00004fb0 20 73 68 6f 75 6c 64 20 62 65 20 75 73 65 64 20 | should be used | 00004fc0 74 6f 0a 63 6f 6e 76 65 72 74 20 61 20 63 61 6c |to.convert a cal| 00004fd0 63 75 6c 61 74 65 64 20 63 6f 6c 6f 75 72 20 6e |culated colour n| 00004fe0 75 6d 62 65 72 20 28 66 72 6f 6d 20 30 20 74 6f |umber (from 0 to| 00004ff0 20 32 35 35 29 20 69 6e 74 6f 20 61 20 47 43 4f | 255) into a GCO| 00005000 4c 20 76 61 6c 75 65 20 28 62 69 74 73 0a 30 2d |L value (bits.0-| 00005010 35 29 20 61 6e 64 20 54 49 4e 54 20 76 61 6c 75 |5) and TINT valu| 00005020 65 20 28 62 69 74 73 20 36 2d 37 29 2e 20 69 65 |e (bits 6-7). ie| 00005030 20 74 6f 20 73 65 74 20 74 68 65 20 47 43 4f 4c | to set the GCOL| 00005040 20 76 61 6c 75 65 20 75 73 65 20 74 68 65 20 70 | value use the p| 00005050 61 6c 65 74 74 65 0a 76 61 6c 75 65 20 41 4e 44 |alette.value AND| 00005060 20 26 33 46 2c 20 61 6e 64 20 66 6f 72 20 54 49 | &3F, and for TI| 00005070 4e 54 20 75 73 65 20 70 61 6c 65 74 74 65 20 41 |NT use palette A| 00005080 4e 44 20 26 43 30 2e 0a 0a 69 6e 74 65 67 65 72 |ND &C0...integer| 00005090 20 78 66 73 2c 20 79 66 73 3a 20 54 68 65 20 73 | xfs, yfs: The s| 000050a0 68 69 66 74 20 66 61 63 74 6f 72 20 74 6f 20 63 |hift factor to c| 000050b0 6f 6e 76 65 72 74 20 70 69 78 65 6c 73 20 74 6f |onvert pixels to| 000050c0 20 4f 53 20 75 6e 69 74 73 2e 0a 0a 63 68 61 72 | OS units...char| 000050d0 20 2a 20 70 61 6c 70 3a 20 41 64 64 72 65 73 73 | * palp: Address| 000050e0 20 6f 66 20 61 20 32 35 36 20 62 79 74 65 20 74 | of a 256 byte t| 000050f0 61 62 6c 65 20 74 6f 20 63 6f 6e 76 65 72 74 20 |able to convert | 00005100 61 20 52 69 73 63 4f 53 20 6c 6f 67 69 63 61 6c |a RiscOS logical| 00005110 20 63 6f 6c 6f 75 72 0a 6e 75 6d 62 65 72 20 74 | colour.number t| 00005120 6f 20 69 74 73 20 70 68 79 73 69 63 61 6c 20 65 |o its physical e| 00005130 71 75 69 76 61 6c 65 6e 74 2e 20 52 65 6d 65 6d |quivalent. Remem| 00005140 62 65 72 20 74 68 61 74 20 52 69 73 63 4f 53 20 |ber that RiscOS | 00005150 6c 6f 67 69 63 61 6c 20 63 6f 6c 6f 75 72 73 20 |logical colours | 00005160 61 72 65 0a 63 6f 6d 70 6f 73 65 64 20 6f 66 20 |are.composed of | 00005170 54 54 42 42 47 47 52 52 2e 0a 0a 63 68 61 72 20 |TTBBGGRR...char | 00005180 2a 20 70 72 67 62 3a 20 41 64 64 72 65 73 73 20 |* prgb: Address | 00005190 6f 66 20 61 20 32 35 36 20 62 79 74 65 20 74 61 |of a 256 byte ta| 000051a0 62 6c 65 20 74 6f 20 63 6f 6e 76 65 72 74 20 61 |ble to convert a| 000051b0 20 6e 75 6d 62 65 72 20 69 6e 20 74 68 65 20 66 | number in the f| 000051c0 6f 72 6d 0a 42 42 47 47 52 52 54 54 20 74 6f 20 |orm.BBGGRRTT to | 000051d0 69 74 73 20 70 68 79 73 69 63 61 6c 20 65 71 75 |its physical equ| 000051e0 69 76 61 6c 65 6e 74 2e 20 66 64 61 74 61 63 68 |ivalent. fdatach| 000051f0 6b 20 2d 2d 2d 2d 2d 2d 2d 2d 20 63 68 61 72 20 |k -------- char | 00005200 2a 20 65 72 72 6d 73 67 3a 20 4f 6e 0a 65 78 69 |* errmsg: On.exi| 00005210 74 20 73 65 74 20 74 68 69 73 20 74 6f 20 74 68 |t set this to th| 00005220 65 20 61 64 64 72 65 73 73 20 6f 66 20 61 20 6e |e address of a n| 00005230 75 6c 6c 20 74 65 72 6d 69 6e 61 74 65 64 20 73 |ull terminated s| 00005240 74 72 69 6e 67 20 65 78 70 6c 61 69 6e 69 6e 67 |tring explaining| 00005250 20 74 68 65 0a 72 65 61 73 6f 6e 20 77 68 79 20 | the.reason why | 00005260 61 20 64 61 74 61 20 76 61 72 69 61 62 6c 65 20 |a data variable | 00005270 69 73 20 69 6e 76 61 6c 69 64 2e 0a 0a 66 64 61 |is invalid...fda| 00005280 74 61 69 6e 69 74 20 26 20 66 7a 6f 6f 6d 69 6e |tainit & fzoomin| 00005290 69 74 20 3a 20 4e 6f 20 61 64 64 69 74 69 6f 6e |it : No addition| 000052a0 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 70 |al information p| 000052b0 61 73 73 65 64 2e 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |assed..---------| 000052c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 6d |------------..fm| 000052d0 65 6e 75 69 6e 69 74 0a 2d 2d 2d 2d 2d 2d 2d 2d |enuinit.--------| 000052e0 2d 0a 77 69 6d 70 5f 6d 65 6e 75 70 74 72 20 66 |-.wimp_menuptr f| 000052f0 6d 65 6e 75 3a 20 54 68 65 20 66 75 6e 63 74 69 |menu: The functi| 00005300 6f 6e 20 73 68 6f 75 6c 64 20 73 65 74 20 74 68 |on should set th| 00005310 69 73 20 74 6f 20 74 68 65 20 61 64 64 72 65 73 |is to the addres| 00005320 73 20 6f 66 20 61 20 57 69 6d 70 0a 6d 65 6e 75 |s of a Wimp.menu| 00005330 20 63 6f 6e 74 72 6f 6c 20 62 6c 6f 63 6b 20 6f | control block o| 00005340 72 20 61 20 77 69 6e 64 6f 77 20 68 61 6e 64 6c |r a window handl| 00005350 65 2e 0a 0a 66 6d 65 6e 75 63 6c 69 63 6b 0a 2d |e...fmenuclick.-| 00005360 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 69 6e 74 65 67 65 |---------.intege| 00005370 72 20 6d 65 6e 75 5b 31 30 5d 3a 20 41 6e 20 61 |r menu[10]: An a| 00005380 72 72 61 79 20 6f 66 20 6e 75 6d 62 65 72 73 2c |rray of numbers,| 00005390 20 74 65 72 6d 69 6e 61 74 65 64 20 62 79 20 2d | terminated by -| 000053a0 31 2c 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 |1, describing th| 000053b0 65 20 6d 65 6e 75 0a 73 65 6c 65 63 74 69 6f 6e |e menu.selection| 000053c0 20 6d 61 64 65 2e 20 54 68 65 20 66 69 72 73 74 | made. The first| 000053d0 20 70 61 72 74 20 6f 66 20 61 20 66 75 6e 63 74 | part of a funct| 000053e0 69 6f 6e 27 73 20 73 75 62 6d 65 6e 75 20 77 69 |ion's submenu wi| 000053f0 6c 6c 20 62 65 20 65 6c 65 6d 65 6e 74 0a 6d 65 |ll be element.me| 00005400 6e 75 5b 31 5d 2e 20 41 20 76 61 6c 75 65 20 6f |nu[1]. A value o| 00005410 66 20 30 20 6d 65 61 6e 73 20 74 68 65 20 31 73 |f 0 means the 1s| 00005420 74 20 65 6e 74 72 79 20 69 6e 20 61 20 73 75 62 |t entry in a sub| 00005430 2d 6d 65 6e 75 2e 0a 0a 66 6b 65 79 69 6e 70 0a |-menu...fkeyinp.| 00005440 2d 2d 2d 2d 2d 2d 2d 0a 77 69 6d 70 5f 63 61 72 |-------.wimp_car| 00005450 65 74 73 74 72 20 2a 20 63 3a 20 54 68 65 20 61 |etstr * c: The a| 00005460 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 63 61 |ddress of the ca| 00005470 72 65 74 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 |ret information | 00005480 72 65 74 75 72 6e 65 64 20 62 79 20 74 68 65 0a |returned by the.| 00005490 77 69 6d 70 2e 0a 69 6e 74 65 67 65 72 20 6b 65 |wimp..integer ke| 000054a0 79 3a 20 54 68 65 20 65 78 74 65 6e 64 65 64 20 |y: The extended | 000054b0 41 53 43 49 49 20 63 6f 64 65 20 6f 66 20 74 68 |ASCII code of th| 000054c0 65 20 6b 65 79 20 70 72 65 73 73 65 64 2e 20 53 |e key pressed. S| 000054d0 65 65 20 74 68 65 20 50 52 4d 20 66 6f 72 20 74 |ee the PRM for t| 000054e0 68 65 0a 63 6f 64 65 73 20 75 73 65 64 20 66 6f |he.codes used fo| 000054f0 72 20 63 75 72 73 6f 72 2c 20 66 75 6e 63 74 69 |r cursor, functi| 00005500 6f 6e 20 6b 65 79 73 20 65 74 63 2e 0a 0a 66 78 |on keys etc...fx| 00005510 79 70 6f 73 0a 2d 2d 2d 2d 2d 2d 0a 64 6f 75 62 |ypos.------.doub| 00005520 6c 65 20 78 2c 79 3a 20 74 68 65 20 78 20 26 20 |le x,y: the x & | 00005530 79 20 76 61 6c 75 65 20 28 69 6e 20 66 75 6e 63 |y value (in func| 00005540 74 69 6f 6e 20 75 6e 69 74 73 29 20 77 68 65 72 |tion units) wher| 00005550 65 20 74 68 65 20 75 73 65 72 20 63 6c 69 63 6b |e the user click| 00005560 65 64 20 74 68 65 0a 6d 6f 75 73 65 2e 0a 0a 66 |ed the.mouse...f| 00005570 77 64 77 63 6c 69 63 6b 0a 2d 2d 2d 2d 2d 2d 2d |wdwclick.-------| 00005580 2d 2d 0a 77 69 6d 70 5f 6d 6f 75 73 65 73 74 72 |--.wimp_mousestr| 00005590 20 6d 6f 75 73 65 3a 20 54 68 65 20 77 69 6d 70 | mouse: The wimp| 000055a0 20 70 6f 69 6e 74 65 72 20 69 6e 66 6f 72 6d 61 | pointer informa| 000055b0 74 69 6f 6e 20 61 74 20 74 68 65 20 74 69 6d 65 |tion at the time| 000055c0 20 6f 66 20 74 68 65 20 63 6c 69 63 6b 2e 0a 0a | of the click...| 000055d0 66 64 61 74 61 6c 6f 61 64 20 26 20 66 73 70 72 |fdataload & fspr| 000055e0 69 74 65 6c 6f 61 64 3a 0a 2d 2d 2d 2d 2d 2d 2d |iteload:.-------| 000055f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00005600 0a 73 74 72 69 6e 67 20 2a 20 66 6e 61 6d 65 3a |.string * fname:| 00005610 20 41 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 | Address of the | 00005620 66 75 6c 6c 20 70 61 74 68 20 6e 61 6d 65 20 6f |full path name o| 00005630 66 20 74 68 65 20 66 69 6c 65 20 74 6f 20 62 65 |f the file to be| 00005640 20 6c 6f 61 64 65 64 20 6f 72 0a 73 61 76 65 64 | loaded or.saved| 00005650 2e 0a 0a 66 6e 65 77 72 6f 74 61 74 69 6f 6e 20 |...fnewrotation | 00005660 26 20 66 6e 65 77 65 6c 65 76 61 74 69 6f 6e 3a |& fnewelevation:| 00005670 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |.---------------| 00005680 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 69 6e |-------------.in| 00005690 74 65 67 65 72 20 61 6e 67 6c 65 3a 20 74 68 65 |teger angle: the| 000056a0 20 6e 65 77 20 72 6f 74 61 74 69 6f 6e 20 6f 72 | new rotation or| 000056b0 20 65 6c 65 76 61 74 69 6f 6e 20 61 6e 67 6c 65 | elevation angle| 000056c0 2e 20 54 68 65 20 63 61 6c 6c 65 64 20 66 75 6e |. The called fun| 000056d0 63 74 69 6f 6e 20 6d 61 79 0a 61 6c 74 65 72 20 |ction may.alter | 000056e0 74 68 69 73 20 76 61 6c 75 65 20 74 6f 20 6b 65 |this value to ke| 000056f0 65 70 20 69 74 20 77 69 74 68 69 6e 20 69 74 27 |ep it within it'| 00005700 73 20 73 75 70 70 6f 72 74 65 64 20 72 61 6e 67 |s supported rang| 00005710 65 2e 0a 0a 66 64 61 74 61 77 64 77 3a 0a 2d 2d |e...fdatawdw:.--| 00005720 2d 2d 2d 2d 2d 2d 0a 77 69 6d 70 5f 62 6f 78 20 |------.wimp_box | 00005730 62 6f 78 3a 20 78 30 20 61 6e 64 20 79 31 20 61 |box: x0 and y1 a| 00005740 72 65 20 73 65 74 20 74 6f 20 74 68 65 20 63 6f |re set to the co| 00005750 2d 6f 72 64 69 6e 61 74 65 73 20 66 6f 72 20 74 |-ordinates for t| 00005760 68 65 20 74 6f 70 20 6c 65 66 74 20 6f 66 20 74 |he top left of t| 00005770 68 65 0a 64 61 74 61 20 70 61 6e 65 6c 2e 0a 0a |he.data panel...| 00005780 66 68 65 6c 70 3a 0a 2d 2d 2d 2d 2d 0a 77 69 6d |fhelp:.-----.wim| 00005790 70 5f 6d 6f 75 73 65 20 6d 6f 75 73 65 3a 20 74 |p_mouse mouse: t| 000057a0 68 65 20 6d 6f 75 73 65 20 64 65 74 61 69 6c 73 |he mouse details| 000057b0 20 61 73 20 70 61 73 73 65 64 20 62 79 20 74 68 | as passed by th| 000057c0 65 20 21 48 65 6c 70 20 61 70 70 6c 69 63 61 74 |e !Help applicat| 000057d0 69 6f 6e 2e 20 54 68 65 0a 77 69 6e 64 6f 77 20 |ion. The.window | 000057e0 68 61 6e 64 6c 65 20 28 2b 31 32 29 20 69 73 20 |handle (+12) is | 000057f0 74 68 65 20 6d 61 69 6e 20 70 6f 69 6e 74 20 6f |the main point o| 00005800 66 20 69 6e 74 65 72 65 73 74 2e 0a 63 68 61 72 |f interest..char| 00005810 20 2a 20 69 64 3a 20 53 65 74 20 74 68 69 73 20 | * id: Set this | 00005820 74 6f 20 74 68 65 20 61 64 64 72 65 73 73 20 6f |to the address o| 00005830 66 20 74 68 65 20 77 69 6e 64 6f 77 20 69 64 20 |f the window id | 00005840 6e 61 6d 65 20 61 73 20 75 73 65 64 20 69 6e 20 |name as used in | 00005850 74 68 65 0a 68 65 6c 70 74 65 78 74 20 66 69 6c |the.helptext fil| 00005860 65 2e 0a 0a 66 73 75 62 6d 65 6e 75 3a 0a 2d 2d |e...fsubmenu:.--| 00005870 2d 2d 2d 2d 2d 2d 0a 77 69 6d 70 5f 6d 65 6e 75 |------.wimp_menu| 00005880 73 74 72 20 2a 70 74 72 3a 20 74 68 65 20 73 75 |str *ptr: the su| 00005890 62 6d 65 6e 75 20 70 6f 69 6e 74 65 72 20 66 72 |bmenu pointer fr| 000058a0 6f 6d 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 |om the original | 000058b0 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 2e 20 |menu structure. | 000058c0 4f 6e 0a 72 65 74 75 72 6e 20 73 65 74 20 74 68 |On.return set th| 000058d0 69 73 20 74 6f 20 74 68 65 20 6d 65 6e 75 20 70 |is to the menu p| 000058e0 6f 69 6e 74 65 72 20 6f 72 20 77 69 6e 64 6f 77 |ointer or window| 000058f0 20 68 61 6e 64 6c 65 20 74 6f 20 62 65 20 6f 70 | handle to be op| 00005900 65 6e 65 64 2e 20 53 65 74 20 69 74 20 74 6f 0a |ened. Set it to.| 00005910 30 20 69 66 20 79 6f 75 20 75 73 65 20 74 68 65 |0 if you use the| 00005920 20 69 74 65 6d 6c 69 73 74 5f 63 72 65 61 74 65 | itemlist_create| 00005930 20 66 75 6e 63 74 69 6f 6e 20 74 6f 20 6f 70 65 | function to ope| 00005940 6e 20 61 20 77 69 6e 64 6f 77 20 28 73 65 65 20 |n a window (see | 00005950 63 2e 69 66 73 29 2e 0a 69 6e 74 65 67 65 72 20 |c.ifs)..integer | 00005960 78 2c 79 3a 20 74 68 65 20 6d 6f 75 73 65 20 63 |x,y: the mouse c| 00005970 6f 2d 6f 72 64 73 20 66 6f 72 20 74 68 65 20 6e |o-ords for the n| 00005980 65 77 20 6d 65 6e 75 2f 77 69 6e 64 6f 77 2e 0a |ew menu/window..| 00005990 69 6e 74 65 67 65 72 20 6d 65 6e 75 5b 31 30 5d |integer menu[10]| 000059a0 3a 20 41 6e 20 61 72 72 61 79 20 61 73 20 66 6f |: An array as fo| 000059b0 72 20 61 20 6d 65 6e 75 20 63 6c 69 63 6b 2e 20 |r a menu click. | 000059c0 53 65 65 20 66 6d 65 6e 75 63 6c 69 63 6b 2e 20 |See fmenuclick. | 000059d0 0a 0a 57 6f 72 6b 20 41 72 65 61 0a 2d 2d 2d 2d |..Work Area.----| 000059e0 2d 2d 2d 2d 2d 0a 54 68 65 20 77 6f 72 6b 20 61 |-----.The work a| 000059f0 72 65 61 20 61 64 64 72 65 73 73 65 64 20 62 79 |rea addressed by| 00005a00 20 74 68 65 20 27 64 27 20 66 69 65 6c 64 20 6f | the 'd' field o| 00005a10 66 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 64 |f the function d| 00005a20 65 66 69 6e 69 74 69 6f 6e 20 69 73 20 61 0a 73 |efinition is a.s| 00005a30 63 72 61 74 63 68 20 70 61 64 20 66 6f 72 20 74 |cratch pad for t| 00005a40 68 65 20 66 75 6e 63 74 69 6f 6e 2e 20 49 74 20 |he function. It | 00005a50 69 73 20 73 68 61 72 65 64 20 61 6d 6f 6e 67 73 |is shared amongs| 00005a60 74 20 66 75 6e 63 74 69 6f 6e 73 20 73 6f 20 64 |t functions so d| 00005a70 6f 6e 27 74 20 75 73 65 20 69 74 0a 66 6f 72 20 |on't use it.for | 00005a80 70 65 72 6d 61 6e 65 6e 74 20 64 61 74 61 20 73 |permanent data s| 00005a90 75 63 68 20 61 73 20 74 65 6d 70 6c 61 74 65 73 |uch as templates| 00005aa0 2e 20 57 68 69 6c 73 74 20 61 20 66 75 6e 63 74 |. Whilst a funct| 00005ab0 69 6f 6e 20 72 65 6d 61 69 6e 73 20 73 65 6c 65 |ion remains sele| 00005ac0 63 74 65 64 20 69 74 0a 68 61 73 20 65 78 63 6c |cted it.has excl| 00005ad0 75 73 69 76 65 20 75 73 65 20 6f 66 20 74 68 69 |usive use of thi| 00005ae0 73 20 61 72 65 61 20 61 6e 64 20 69 73 20 61 20 |s area and is a | 00005af0 67 6f 6f 64 20 70 6c 61 63 65 20 66 6f 72 20 6d |good place for m| 00005b00 65 6e 75 20 73 74 72 75 63 74 75 72 65 73 20 65 |enu structures e| 00005b10 74 63 2e 0a 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |tc...-----------| 00005b20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00005b50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |---------------.| 00005b60 0a 58 2f 59 20 50 6c 6f 74 74 69 6e 67 20 44 65 |.X/Y Plotting De| 00005b70 74 61 69 6c 73 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |tails.----------| 00005b80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 49 66 20 79 6f |----------.If yo| 00005b90 75 20 69 6d 70 6c 65 6d 65 6e 74 20 61 20 66 75 |u implement a fu| 00005ba0 6e 63 74 69 6f 6e 20 77 68 65 72 65 20 79 6f 75 |nction where you| 00005bb0 20 63 6f 6c 6f 75 72 20 65 61 63 68 20 70 69 78 | colour each pix| 00005bc0 65 6c 20 64 65 70 65 6e 64 65 6e 74 20 6f 6e 20 |el dependent on | 00005bd0 74 68 65 0a 63 75 72 72 65 6e 74 20 78 2f 79 20 |the.current x/y | 00005be0 76 61 6c 75 65 2c 20 77 68 65 72 65 20 79 6f 75 |value, where you| 00005bf0 72 20 78 2f 79 20 76 61 6c 75 65 73 20 61 72 65 |r x/y values are| 00005c00 20 6d 61 70 70 65 64 20 6f 6e 74 6f 20 61 20 70 | mapped onto a p| 00005c10 69 78 65 6c 2c 20 74 68 65 6e 0a 69 6d 70 6c 65 |ixel, then.imple| 00005c20 6d 65 6e 74 69 6e 67 20 58 2f 59 20 70 6c 6f 74 |menting X/Y plot| 00005c30 74 69 6e 67 20 73 68 6f 75 6c 64 20 73 69 6d 70 |ting should simp| 00005c40 6c 69 66 79 20 63 6f 64 69 6e 67 20 61 6e 64 20 |lify coding and | 00005c50 70 72 6f 76 69 64 65 20 62 65 74 74 65 72 0a 70 |provide better.p| 00005c60 65 72 66 6f 72 6d 61 6e 63 65 2e 0a 0a 44 65 66 |erformance...Def| 00005c70 69 6e 69 74 69 6f 6e 3a 20 79 6f 75 20 6d 75 73 |inition: you mus| 00005c80 74 20 64 65 66 69 6e 65 20 79 6f 75 72 20 66 75 |t define your fu| 00005c90 6e 63 74 69 6f 6e 20 77 69 74 68 20 66 5a 6f 6f |nction with fZoo| 00005ca0 6d 2c 20 61 6e 64 20 74 68 65 72 65 66 6f 72 65 |m, and therefore| 00005cb0 20 77 69 74 68 20 78 30 2c 0a 79 30 2c 20 77 69 | with x0,.y0, wi| 00005cc0 64 74 68 20 61 6e 64 20 68 65 69 67 68 74 20 61 |dth and height a| 00005cd0 73 20 74 68 65 20 31 73 74 20 66 6f 75 72 20 70 |s the 1st four p| 00005ce0 61 72 61 6d 65 74 65 72 73 20 28 73 65 65 20 50 |arameters (see P| 00005cf0 6c 6f 74 74 69 6e 67 20 73 65 63 74 69 6f 6e 20 |lotting section | 00005d00 66 6f 72 0a 74 68 65 20 6d 65 61 6e 69 6e 67 20 |for.the meaning | 00005d10 6f 66 20 74 68 65 73 65 29 2e 20 41 6c 73 6f 20 |of these). Also | 00005d20 79 6f 75 20 6d 75 73 74 20 64 65 66 69 6e 65 20 |you must define | 00005d30 79 6f 75 72 20 66 75 6e 63 74 69 6f 6e 20 77 69 |your function wi| 00005d40 74 68 20 74 68 65 20 66 78 79 20 66 6c 61 67 2e |th the fxy flag.| 00005d50 0a 0a 49 6e 69 74 69 61 6c 69 73 61 74 69 6f 6e |..Initialisation| 00005d60 3a 20 57 68 65 6e 20 21 46 72 61 63 74 61 6c 20 |: When !Fractal | 00005d70 6d 61 6b 65 73 20 74 68 65 20 66 70 6c 6f 74 69 |makes the fploti| 00005d80 6e 69 74 20 63 61 6c 6c 2c 20 79 6f 75 20 74 65 |nit call, you te| 00005d90 6c 6c 20 21 46 72 61 63 74 61 6c 20 32 0a 74 68 |ll !Fractal 2.th| 00005da0 69 6e 67 73 2e 0a 0a 31 29 20 41 64 64 72 65 73 |ings...1) Addres| 00005db0 73 20 6f 66 20 79 6f 75 72 20 70 6c 6f 74 20 72 |s of your plot r| 00005dc0 6f 75 74 69 6e 65 20 2d 20 62 79 20 70 6c 61 63 |outine - by plac| 00005dd0 69 6e 67 20 69 74 73 20 61 64 64 72 65 73 73 20 |ing its address | 00005de0 69 6e 20 79 6f 75 72 20 66 75 6e 63 74 69 6f 6e |in your function| 00005df0 27 73 0a 78 79 72 74 6e 20 66 69 65 6c 64 2e 0a |'s.xyrtn field..| 00005e00 0a 32 29 20 54 79 70 65 20 6f 66 20 69 6e 70 75 |.2) Type of inpu| 00005e10 74 20 76 61 6c 75 65 73 2e 20 54 68 65 20 78 20 |t values. The x | 00005e20 26 20 79 20 64 61 74 61 20 76 61 6c 75 65 73 20 |& y data values | 00005e30 6d 75 73 74 20 62 65 20 69 6e 20 64 6f 75 62 6c |must be in doubl| 00005e40 65 20 66 6f 72 6d 61 74 20 69 6e 0a 79 6f 75 72 |e format in.your| 00005e50 20 66 75 6e 63 74 69 6f 6e 20 64 65 66 69 6e 69 | function defini| 00005e60 74 69 6f 6e 2e 20 57 68 65 6e 20 79 6f 75 72 20 |tion. When your | 00005e70 70 6c 6f 74 20 72 6f 75 74 69 6e 65 20 69 73 20 |plot routine is | 00005e80 63 61 6c 6c 65 64 20 21 46 72 61 63 74 61 6c 20 |called !Fractal | 00005e90 77 69 6c 6c 0a 73 75 70 70 6c 79 20 74 68 65 20 |will.supply the | 00005ea0 63 75 72 72 65 6e 74 20 78 2f 79 20 76 61 6c 75 |current x/y valu| 00005eb0 65 20 74 6f 20 62 65 20 67 65 6e 65 72 61 74 65 |e to be generate| 00005ec0 64 2e 20 54 68 65 20 78 2f 79 20 76 61 6c 75 65 |d. The x/y value| 00005ed0 73 20 70 61 73 73 65 64 20 63 61 6e 20 62 65 0a |s passed can be.| 00005ee0 69 6e 20 74 77 6f 20 66 6f 72 6d 61 74 73 3a 0a |in two formats:.| 00005ef0 20 20 64 6f 75 62 6c 65 20 2d 20 62 79 20 73 65 | double - by se| 00005f00 74 74 69 6e 67 20 70 6c 6f 74 5f 64 62 6c 20 66 |tting plot_dbl f| 00005f10 6c 61 67 20 6f 6e 20 69 6e 20 70 6c 6f 74 5f 66 |lag on in plot_f| 00005f20 6c 61 67 0a 20 20 66 61 73 74 20 66 6c 6f 61 74 |lag. fast float| 00005f30 20 2d 20 62 79 20 73 65 74 74 69 6e 67 20 70 6c | - by setting pl| 00005f40 6f 74 5f 66 66 70 20 66 6c 61 67 20 6f 6e 20 69 |ot_ffp flag on i| 00005f50 6e 20 70 6c 6f 74 5f 66 6c 61 67 0a 20 20 69 6e |n plot_flag. in| 00005f60 74 65 67 65 72 20 2d 20 62 79 20 73 65 74 74 69 |teger - by setti| 00005f70 6e 67 20 70 6c 6f 74 5f 69 6e 74 32 37 20 6f 6e |ng plot_int27 on| 00005f80 20 69 6e 20 70 6c 6f 74 5f 66 6c 61 67 2e 20 59 | in plot_flag. Y| 00005f90 6f 75 72 20 72 6f 75 74 69 6e 65 20 73 68 6f 75 |our routine shou| 00005fa0 6c 64 20 75 73 65 0a 74 68 65 20 32 37 20 62 69 |ld use.the 27 bi| 00005fb0 74 20 66 69 78 65 64 20 70 6f 69 6e 74 20 61 73 |t fixed point as| 00005fc0 73 65 6d 62 6c 65 72 20 61 72 69 74 68 6d 65 74 |sembler arithmet| 00005fd0 69 63 20 66 75 6e 63 74 69 6f 6e 73 20 64 65 73 |ic functions des| 00005fe0 63 72 69 62 65 64 20 6c 61 74 65 72 2e 0a 0a 50 |cribed later...P| 00005ff0 6c 6f 74 74 69 6e 67 3a 20 21 46 72 61 63 74 61 |lotting: !Fracta| 00006000 6c 20 63 61 6c 6c 73 20 79 6f 75 72 20 70 6c 6f |l calls your plo| 00006010 74 20 66 75 6e 63 74 69 6f 6e 20 70 61 73 73 69 |t function passi| 00006020 6e 67 20 74 68 65 20 63 75 72 72 65 6e 74 20 78 |ng the current x| 00006030 20 26 20 79 20 61 73 20 74 68 65 0a 66 69 72 73 | & y as the.firs| 00006040 74 20 74 77 6f 20 70 61 72 61 6d 65 74 65 72 73 |t two parameters| 00006050 2e 20 69 65 20 66 6f 72 20 70 6c 6f 74 5f 69 6e |. ie for plot_in| 00006060 74 32 37 20 26 20 70 6c 6f 74 5f 66 66 70 20 66 |t27 & plot_ffp f| 00006070 75 6e 63 74 69 6f 6e 73 2c 20 52 30 3d 78 20 61 |unctions, R0=x a| 00006080 6e 64 20 52 31 3d 79 0a 6f 6e 20 65 6e 74 72 79 |nd R1=y.on entry| 00006090 2c 20 77 68 65 72 65 20 78 20 61 6e 64 20 79 20 |, where x and y | 000060a0 61 72 65 20 6e 6f 74 20 74 68 65 20 70 69 78 65 |are not the pixe| 000060b0 6c 20 78 2f 79 2c 20 62 75 74 20 74 68 65 20 76 |l x/y, but the v| 000060c0 61 6c 75 65 73 20 72 65 71 75 69 72 65 64 20 62 |alues required b| 000060d0 79 0a 79 6f 75 72 20 66 75 6e 63 74 69 6f 6e 2e |y.your function.| 000060e0 20 59 6f 75 72 20 66 75 6e 63 74 69 6f 6e 20 6d | Your function m| 000060f0 75 73 74 20 72 65 74 75 72 6e 20 61 20 76 61 6c |ust return a val| 00006100 75 65 20 28 69 6e 20 52 30 20 66 6f 72 20 61 73 |ue (in R0 for as| 00006110 73 65 6d 62 6c 65 72 0a 66 75 6e 63 74 69 6f 6e |sembler.function| 00006120 73 29 20 77 68 69 63 68 20 77 69 6c 6c 20 62 65 |s) which will be| 00006130 20 75 73 65 64 20 74 6f 20 73 65 74 20 74 68 65 | used to set the| 00006140 20 70 69 78 65 6c 20 63 6f 6c 6f 75 72 2e 0a 0a | pixel colour...| 00006150 4e 6f 74 65 73 3a 20 21 46 72 61 63 74 61 6c 20 |Notes: !Fractal | 00006160 64 6f 65 73 20 6e 6f 74 20 73 74 65 70 20 74 68 |does not step th| 00006170 72 6f 75 67 68 20 74 68 65 20 70 69 78 65 6c 20 |rough the pixel | 00006180 78 2f 79 27 73 20 69 6e 20 73 65 71 75 65 6e 63 |x/y's in sequenc| 00006190 65 2e 20 54 68 65 72 65 20 69 73 0a 6e 6f 20 6e |e. There is.no n| 000061a0 65 65 64 20 74 6f 20 70 6c 6f 74 20 74 68 65 20 |eed to plot the | 000061b0 63 6f 6c 6f 75 72 20 79 6f 75 72 73 65 6c 66 20 |colour yourself | 000061c0 2d 20 6a 75 73 74 20 72 65 74 75 72 6e 20 69 74 |- just return it| 000061d0 73 20 76 61 6c 75 65 2e 0a 0a 46 6f 72 20 61 73 |s value...For as| 000061e0 73 65 6d 62 6c 65 72 20 78 2f 79 20 70 6c 6f 74 |sembler x/y plot| 000061f0 74 65 72 73 20 74 68 65 72 65 20 69 73 20 6e 6f |ters there is no| 00006200 20 6e 65 65 64 20 74 6f 20 73 61 76 65 20 74 68 | need to save th| 00006210 65 20 72 65 67 69 73 74 65 72 73 20 65 78 63 65 |e registers exce| 00006220 70 74 20 52 31 33 0a 61 6e 64 20 52 31 34 20 69 |pt R13.and R14 i| 00006230 66 20 79 6f 75 20 77 61 6e 74 20 74 6f 20 75 73 |f you want to us| 00006240 65 20 74 68 65 6d 2e 20 41 73 73 65 6d 62 6c 65 |e them. Assemble| 00006250 72 20 70 72 6f 67 72 61 6d 6d 65 72 73 20 61 72 |r programmers ar| 00006260 65 20 61 64 76 69 73 65 64 20 74 6f 20 74 61 6b |e advised to tak| 00006270 65 20 61 0a 63 6c 6f 73 65 20 6c 6f 6f 6b 20 61 |e a.close look a| 00006280 74 20 74 68 65 20 73 75 70 70 6c 69 65 64 20 53 |t the supplied S| 00006290 61 6d 70 4d 61 6e 4a 75 6c 20 73 6f 75 72 63 65 |ampManJul source| 000062a0 20 66 6f 72 20 61 20 66 75 6c 6c 79 20 69 6d 70 | for a fully imp| 000062b0 6c 65 6d 65 6e 74 65 64 20 76 65 72 73 69 6f 6e |lemented version| 000062c0 0a 6f 66 20 74 68 65 20 6e 65 63 65 73 73 61 72 |.of the necessar| 000062d0 79 20 63 6f 64 65 2c 20 6f 72 20 53 61 6d 70 4e |y code, or SampN| 000062e0 65 77 74 6f 6e 20 66 6f 72 20 61 20 66 6c 6f 61 |ewton for a floa| 000062f0 74 20 76 65 72 73 69 6f 6e 2e 20 49 66 20 79 6f |t version. If yo| 00006300 75 20 75 73 65 0a 70 6c 6f 74 5f 64 62 6c 20 69 |u use.plot_dbl i| 00006310 6e 20 61 73 73 65 6d 62 6c 65 72 20 74 68 65 20 |n assembler the | 00006320 66 6f 6c 6c 6f 77 69 6e 67 20 6e 6f 74 65 73 20 |following notes | 00006330 61 70 70 6c 79 3a 0a 0a 31 29 20 46 30 20 69 73 |apply:..1) F0 is| 00006340 20 69 6e 20 52 30 2f 52 31 2c 20 26 20 46 31 20 | in R0/R1, & F1 | 00006350 69 6e 20 52 32 2f 52 33 20 28 74 68 69 73 20 69 |in R2/R3 (this i| 00006360 73 20 41 63 6f 72 6e 27 73 20 73 74 61 6e 64 61 |s Acorn's standa| 00006370 72 64 2c 20 6e 6f 74 20 6d 69 6e 65 21 29 2e 0a |rd, not mine!)..| 00006380 32 29 20 46 6c 6f 61 74 20 72 65 67 69 73 74 65 |2) Float registe| 00006390 72 73 20 46 34 2d 46 37 20 4d 55 53 54 20 62 65 |rs F4-F7 MUST be| 000063a0 20 73 61 76 65 64 20 69 66 20 79 6f 75 20 75 73 | saved if you us| 000063b0 65 20 74 68 65 6d 20 28 41 63 6f 72 6e 20 61 67 |e them (Acorn ag| 000063c0 61 69 6e 21 29 2c 20 61 6e 64 0a 72 65 73 74 6f |ain!), and.resto| 000063d0 72 65 64 20 6f 6e 20 65 78 69 74 2e 0a 0a 53 61 |red on exit...Sa| 000063e0 6d 70 6c 65 20 65 6e 74 72 79 20 63 6f 64 65 20 |mple entry code | 000063f0 66 6f 72 20 61 20 70 6c 6f 74 5f 64 62 6c 20 66 |for a plot_dbl f| 00006400 75 6e 63 74 69 6f 6e 20 74 68 65 72 65 66 6f 72 |unction therefor| 00006410 65 20 69 73 3a 0a 0a 20 20 20 2e 70 6c 6f 74 0a |e is:.. .plot.| 00006420 20 20 20 41 44 52 20 20 20 20 52 34 2c 73 61 76 | ADR R4,sav| 00006430 65 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 |e wher| 00006440 65 20 73 61 76 65 20 69 73 20 61 20 33 32 20 62 |e save is a 32 b| 00006450 79 74 65 20 61 72 65 61 0a 20 20 20 53 54 4d 49 |yte area. STMI| 00006460 41 20 20 52 34 2c 7b 52 30 2d 52 33 7d 20 20 20 |A R4,{R0-R3} | 00006470 20 20 20 20 20 73 74 6f 72 65 20 46 30 2c 20 46 | store F0, F| 00006480 31 0a 20 20 20 46 4e 66 70 28 22 4c 44 46 44 20 |1. FNfp("LDFD | 00006490 46 30 2c 73 61 76 65 22 29 20 20 20 20 20 67 65 |F0,save") ge| 000064a0 74 20 46 30 0a 20 20 20 46 4e 66 70 28 22 4c 44 |t F0. FNfp("LD| 000064b0 46 44 20 46 31 2c 73 61 76 65 2b 38 22 29 20 20 |FD F1,save+8") | 000064c0 20 67 65 74 20 46 31 0a 20 20 20 46 4e 66 70 28 | get F1. FNfp(| 000064d0 22 53 54 46 44 20 46 34 2c 73 61 76 65 22 29 20 |"STFD F4,save") | 000064e0 20 20 20 20 73 61 76 65 20 66 6c 6f 61 74 73 0a | save floats.| 000064f0 20 20 20 46 4e 66 70 28 22 53 54 46 44 20 46 35 | FNfp("STFD F5| 00006500 2c 73 61 76 65 2b 38 22 29 0a 20 20 20 46 4e 66 |,save+8"). FNf| 00006510 70 28 22 53 54 46 44 20 46 36 2c 73 61 76 65 2b |p("STFD F6,save+| 00006520 31 36 22 29 0a 20 20 20 46 4e 66 70 28 22 53 54 |16"). FNfp("ST| 00006530 46 44 20 46 37 2c 73 61 76 65 2b 32 34 22 29 0a |FD F7,save+24").| 00006540 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |.---------------| 00006550 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00006580 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 50 72 6f 67 |-----------.Prog| 00006590 72 61 6d 6d 69 6e 67 20 49 6e 20 43 0a 3d 3d 3d |ramming In C.===| 000065a0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 20 0a 41 |============= .A| 000065b0 6c 6c 20 74 68 65 20 6d 61 74 65 72 69 61 6c 73 |ll the materials| 000065c0 20 61 72 65 20 70 72 6f 76 69 64 65 64 20 69 6e | are provided in| 000065d0 20 74 68 65 20 73 65 70 61 72 61 74 65 20 46 72 | the separate Fr| 000065e0 61 63 53 6f 75 72 63 65 20 64 69 72 65 63 74 6f |acSource directo| 000065f0 72 79 2e 20 54 68 65 0a 73 6f 75 72 63 65 20 63 |ry. The.source c| 00006600 6f 64 65 20 61 6e 64 20 6d 61 6b 65 20 66 69 6c |ode and make fil| 00006610 65 73 20 61 72 65 20 70 72 6f 76 69 64 65 64 20 |es are provided | 00006620 69 6e 20 74 68 65 20 63 20 64 69 72 65 63 74 6f |in the c directo| 00006630 72 79 2c 20 68 65 61 64 65 72 20 66 69 6c 65 73 |ry, header files| 00006640 20 69 6e 0a 74 68 65 20 68 20 64 69 72 65 63 74 | in.the h direct| 00006650 6f 72 79 2c 20 61 6e 64 20 70 72 65 2d 63 6f 6d |ory, and pre-com| 00006660 70 69 6c 65 64 20 72 6f 75 74 69 6e 65 73 20 69 |piled routines i| 00006670 6e 20 74 68 65 20 6f 20 64 69 72 65 63 74 6f 72 |n the o director| 00006680 79 2e 20 54 68 65 20 4d 61 6b 65 20 65 78 65 63 |y. The Make exec| 00006690 0a 61 6e 64 20 74 68 65 20 61 73 73 6f 63 69 61 |.and the associa| 000066a0 74 65 64 20 6d 61 6b 65 66 69 6c 65 20 77 69 6c |ted makefile wil| 000066b0 6c 20 6e 65 65 64 20 65 64 69 74 69 6e 67 20 74 |l need editing t| 000066c0 6f 20 6d 61 74 63 68 20 79 6f 75 72 20 6f 77 6e |o match your own| 000066d0 20 43 20 73 65 74 20 75 70 2e 20 49 74 0a 69 73 | C set up. It.is| 000066e0 20 61 73 73 75 6d 65 64 20 74 68 61 74 20 79 6f | assumed that yo| 000066f0 75 20 68 61 76 65 20 61 20 64 69 72 65 63 74 6f |u have a directo| 00006700 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 6c |ry containing al| 00006710 6c 20 74 68 65 20 43 20 6d 61 74 65 72 69 61 6c |l the C material| 00006720 20 69 6e 20 74 68 65 0a 41 63 6f 72 6e 20 73 75 | in the.Acorn su| 00006730 70 70 6c 69 65 64 20 64 69 72 65 63 74 6f 72 69 |pplied directori| 00006740 65 73 2e 20 59 6f 75 20 73 68 6f 75 6c 64 20 74 |es. You should t| 00006750 68 65 72 65 66 6f 72 65 20 6f 6e 6c 79 20 6e 65 |herefore only ne| 00006760 65 64 20 74 6f 20 63 68 61 6e 67 65 20 74 68 65 |ed to change the| 00006770 0a 76 61 72 69 61 62 6c 65 20 43 24 50 61 74 68 |.variable C$Path| 00006780 20 77 69 74 68 69 6e 20 27 4d 61 6b 65 27 20 74 | within 'Make' t| 00006790 6f 20 70 6f 69 6e 74 20 74 6f 20 74 68 69 73 20 |o point to this | 000067a0 64 69 72 65 63 74 6f 72 79 2e 20 54 6f 20 63 6f |directory. To co| 000067b0 6d 70 69 6c 65 2c 20 73 69 6d 70 6c 79 0a 64 6f |mpile, simply.do| 000067c0 75 62 6c 65 20 63 6c 69 63 6b 20 6f 6e 20 74 68 |uble click on th| 000067d0 65 20 4d 61 6b 65 20 66 69 6c 65 2e 0a 0a 46 6c |e Make file...Fl| 000067e0 6f 70 70 79 20 44 69 73 63 20 4f 77 6e 65 72 73 |oppy Disc Owners| 000067f0 3a 20 49 66 20 79 6f 75 20 6f 6e 6c 79 20 68 61 |: If you only ha| 00006800 76 65 20 61 20 73 69 6e 67 6c 65 20 66 6c 6f 70 |ve a single flop| 00006810 70 79 20 64 69 73 63 20 74 68 65 6e 20 79 6f 75 |py disc then you| 00006820 27 6c 6c 20 6e 65 65 64 0a 74 6f 20 63 72 65 61 |'ll need.to crea| 00006830 74 65 20 61 20 52 41 4d 20 64 72 69 76 65 20 6f |te a RAM drive o| 00006840 66 20 61 72 6f 75 6e 64 20 36 30 30 6b 20 74 6f |f around 600k to| 00006850 20 63 6f 6e 74 61 69 6e 20 74 68 65 20 43 20 6c | contain the C l| 00006860 69 62 72 61 72 69 65 73 20 73 69 6e 63 65 20 79 |ibraries since y| 00006870 6f 75 0a 63 61 6e 27 74 20 67 65 74 20 43 20 70 |ou.can't get C p| 00006880 6c 75 73 20 74 68 65 20 73 6f 75 72 63 65 20 6f |lus the source o| 00006890 6e 74 6f 20 61 20 38 30 30 6b 20 64 69 73 6b 2e |nto a 800k disk.| 000068a0 20 54 68 65 20 52 41 4d 20 64 69 73 6b 20 73 68 | The RAM disk sh| 000068b0 6f 75 6c 64 20 63 6f 6e 74 61 69 6e 0a 63 6c 69 |ould contain.cli| 000068c0 62 2c 20 6c 69 62 72 61 72 79 20 61 6e 64 20 52 |b, library and R| 000068d0 69 73 63 5f 4f 53 4c 69 62 20 66 72 6f 6d 20 79 |isc_OSLib from y| 000068e0 6f 75 72 20 43 20 64 69 73 6b 73 2e 20 59 6f 75 |our C disks. You| 000068f0 20 63 6f 75 6c 64 20 73 65 74 20 75 70 20 61 20 | could set up a | 00006900 64 69 73 6b 20 77 69 74 68 0a 74 68 65 73 65 20 |disk with.these | 00006910 64 69 72 65 63 74 6f 72 69 65 73 20 61 6c 6c 20 |directories all | 00006920 74 6f 67 65 74 68 65 72 20 28 41 63 6f 72 6e 20 |together (Acorn | 00006930 73 70 72 65 61 64 20 74 68 65 6d 20 6f 76 65 72 |spread them over| 00006940 20 64 69 73 6b 73 20 31 20 61 6e 64 20 32 20 69 | disks 1 and 2 i| 00006950 6e 20 43 0a 72 65 6c 65 61 73 65 20 33 29 20 61 |n C.release 3) a| 00006960 6e 64 20 63 6f 70 79 20 69 74 20 74 6f 20 52 41 |nd copy it to RA| 00006970 4d 20 61 74 20 74 68 65 20 73 74 61 72 74 20 6f |M at the start o| 00006980 66 20 79 6f 75 72 20 46 72 61 63 74 61 6c 20 70 |f your Fractal p| 00006990 72 6f 67 72 61 6d 6d 69 6e 67 0a 73 65 73 73 69 |rogramming.sessi| 000069a0 6f 6e 2e 20 44 6f 6e 27 74 20 62 65 20 74 65 6d |on. Don't be tem| 000069b0 70 74 65 64 20 74 6f 20 70 75 74 20 74 68 65 20 |pted to put the | 000069c0 46 72 61 63 74 61 6c 20 73 6f 75 72 63 65 20 6f |Fractal source o| 000069d0 6e 74 6f 20 52 41 4d 20 2d 20 73 6f 6f 6e 65 72 |nto RAM - sooner| 000069e0 20 6f 72 0a 6c 61 74 65 72 20 79 6f 75 27 6c 6c | or.later you'll| 000069f0 20 6c 6f 73 65 20 79 6f 75 72 20 75 70 64 61 74 | lose your updat| 00006a00 65 73 21 0a 0a 54 68 65 20 73 6f 75 72 63 65 20 |es!..The source | 00006a10 63 6f 64 65 20 66 6f 72 20 66 72 61 63 74 61 6c |code for fractal| 00006a20 20 61 6e 64 20 6f 74 68 65 72 20 69 6e 74 65 72 | and other inter| 00006a30 6e 61 6c 20 66 75 6e 63 74 69 6f 6e 73 20 69 73 |nal functions is| 00006a40 20 6e 6f 74 20 73 75 70 70 6c 69 65 64 20 73 6f | not supplied so| 00006a50 0a 61 73 20 74 6f 20 61 6c 6c 6f 77 20 6d 65 20 |.as to allow me | 00006a60 74 6f 20 6d 61 69 6e 74 61 69 6e 20 6f 76 65 72 |to maintain over| 00006a70 61 6c 6c 20 63 6f 6e 74 72 6f 6c 20 6f 66 20 74 |all control of t| 00006a80 68 69 73 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 |his application | 00006a90 73 69 6e 63 65 20 49 20 61 6d 0a 63 6f 6e 74 69 |since I am.conti| 00006aa0 6e 75 6f 75 73 6c 79 20 75 70 64 61 74 69 6e 67 |nuously updating| 00006ab0 20 69 74 2e 20 49 66 20 79 6f 75 20 6e 65 65 64 | it. If you need| 00006ac0 20 61 64 64 69 74 69 6f 6e 61 6c 20 66 75 6e 63 | additional func| 00006ad0 74 69 6f 6e 61 6c 69 74 79 20 61 64 64 65 64 2c |tionality added,| 00006ae0 20 74 68 65 6e 0a 70 6c 65 61 73 65 20 77 72 69 | then.please wri| 00006af0 74 65 20 74 6f 20 6d 65 20 77 69 74 68 20 79 6f |te to me with yo| 00006b00 75 72 20 72 65 71 75 65 73 74 2e 0a 0a 41 64 64 |ur request...Add| 00006b10 69 6e 67 20 59 6f 75 72 20 43 6f 64 65 20 61 6e |ing Your Code an| 00006b20 64 20 4d 61 6b 69 6e 67 20 43 68 61 6e 67 65 73 |d Making Changes| 00006b30 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |.---------------| 00006b40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00006b50 2d 2d 2d 2d 0a 49 74 20 77 69 6c 6c 20 62 65 20 |----.It will be | 00006b60 65 61 73 69 65 73 74 20 66 6f 72 20 79 6f 75 20 |easiest for you | 00006b70 74 6f 20 61 64 64 20 79 6f 75 72 20 63 6f 64 65 |to add your code| 00006b80 20 65 69 74 68 65 72 20 61 73 20 61 20 73 65 70 | either as a sep| 00006b90 61 72 61 74 65 20 63 20 66 69 6c 65 2c 20 6f 72 |arate c file, or| 00006ba0 0a 69 66 20 74 68 65 20 72 6f 75 74 69 6e 65 20 |.if the routine | 00006bb0 69 73 20 73 68 6f 72 74 2c 20 74 6f 20 74 68 65 |is short, to the| 00006bc0 20 67 65 6e 65 72 61 6c 20 66 69 6c 65 20 63 61 | general file ca| 00006bd0 6c 6c 65 64 20 63 2e 66 75 6e 63 74 69 6f 6e 31 |lled c.function1| 00006be0 2f 63 2e 66 75 6e 63 74 69 6f 6e 32 2e 0a 54 68 |/c.function2..Th| 00006bf0 65 20 76 61 72 69 6f 75 73 20 66 69 65 6c 64 20 |e various field | 00006c00 6e 61 6d 65 73 20 64 6f 63 75 6d 65 6e 74 65 64 |names documented| 00006c10 20 69 6e 20 74 68 65 20 70 72 65 76 69 6f 75 73 | in the previous| 00006c20 20 73 65 63 74 69 6f 6e 73 20 61 72 65 20 61 6c | sections are al| 00006c30 6c 0a 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 74 |l.contained in t| 00006c40 68 65 20 68 65 61 64 65 72 20 68 2e 46 72 61 63 |he header h.Frac| 00006c50 74 61 6c 2e 20 49 66 20 79 6f 75 20 6d 75 73 74 |tal. If you must| 00006c60 20 6d 61 6b 65 20 63 68 61 6e 67 65 73 20 74 6f | make changes to| 00006c70 20 65 78 69 73 74 69 6e 67 20 63 6f 64 65 0a 63 | existing code.c| 00006c80 6f 75 6c 64 20 79 6f 75 20 70 6c 65 61 73 65 20 |ould you please | 00006c90 6d 61 72 6b 20 79 6f 75 72 20 63 68 61 6e 67 65 |mark your change| 00006ca0 73 20 77 69 74 68 20 6c 65 61 64 69 6e 67 20 61 |s with leading a| 00006cb0 6e 64 20 74 72 61 69 6c 69 6e 67 20 63 6f 6d 6d |nd trailing comm| 00006cc0 65 6e 74 73 20 73 6f 0a 74 68 61 74 20 49 20 63 |ents so.that I c| 00006cd0 61 6e 20 72 65 61 64 69 6c 79 20 73 70 6f 74 20 |an readily spot | 00006ce0 69 74 2e 20 54 68 69 73 20 77 69 6c 6c 20 61 6c |it. This will al| 00006cf0 6c 6f 77 20 6d 65 20 74 6f 20 6d 65 72 67 65 20 |low me to merge | 00006d00 79 6f 75 72 20 63 68 61 6e 67 65 73 20 69 6e 74 |your changes int| 00006d10 6f 0a 74 68 65 20 6d 61 73 74 65 72 20 73 6f 75 |o.the master sou| 00006d20 72 63 65 2e 20 55 6e 6d 61 72 6b 65 64 20 63 6f |rce. Unmarked co| 00006d30 64 65 20 77 69 6c 6c 20 6e 6f 74 20 67 65 74 20 |de will not get | 00006d40 69 6d 70 6c 65 6d 65 6e 74 65 64 2e 0a 0a 57 68 |implemented...Wh| 00006d50 65 6e 20 61 64 64 69 6e 67 20 61 20 6e 65 77 20 |en adding a new | 00006d60 72 6f 75 74 69 6e 65 20 79 6f 75 20 6e 65 65 64 |routine you need| 00006d70 20 74 6f 20 61 64 64 20 69 74 20 74 6f 20 63 2e | to add it to c.| 00006d80 66 75 6e 63 6c 69 73 74 2e 20 46 69 72 73 74 6c |funclist. Firstl| 00006d90 79 20 61 64 64 20 74 68 65 0a 6e 61 6d 65 20 6f |y add the.name o| 00006da0 66 20 74 68 65 20 66 72 61 63 74 61 6c 20 64 65 |f the fractal de| 00006db0 66 69 6e 69 74 69 6f 6e 20 74 6f 20 74 68 65 20 |finition to the | 00006dc0 61 72 72 61 79 20 66 72 61 63 73 2c 20 61 64 64 |array fracs, add| 00006dd0 20 61 6e 20 65 78 74 65 72 6e 20 66 64 65 66 6e | an extern fdefn| 00006de0 20 2e 2e 2e 0a 70 72 69 6f 72 20 74 6f 20 74 68 | ....prior to th| 00006df0 69 73 2c 20 61 6e 64 20 69 6e 63 72 65 6d 65 6e |is, and incremen| 00006e00 74 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 6e |t the variable n| 00006e10 66 75 6e 63 2e 0a 0a 59 6f 75 20 6d 61 79 20 75 |func...You may u| 00006e20 73 65 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 73 |se the functions| 00006e30 20 69 6e 20 66 72 61 63 74 61 6c 2e 68 20 61 6e | in fractal.h an| 00006e40 64 20 66 63 6f 6d 6d 6f 6e 2e 68 20 2d 20 73 65 |d fcommon.h - se| 00006e50 65 20 6f 74 68 65 72 20 66 75 6e 63 74 69 6f 6e |e other function| 00006e60 73 0a 66 6f 72 20 65 78 61 6d 70 6c 65 73 20 6f |s.for examples o| 00006e70 66 20 74 68 65 69 72 20 75 73 61 67 65 2e 0a 0a |f their usage...| 00006e80 46 61 73 74 20 46 6c 6f 61 74 20 53 75 70 70 6f |Fast Float Suppo| 00006e90 72 74 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |rt.-------------| 00006ea0 2d 2d 2d 2d 2d 0a 54 68 65 20 66 75 6e 63 74 69 |-----.The functi| 00006eb0 6f 6e 73 20 69 6e 20 66 70 2e 68 20 70 72 6f 76 |ons in fp.h prov| 00006ec0 69 64 65 20 66 61 73 74 20 66 6c 6f 61 74 20 61 |ide fast float a| 00006ed0 72 69 74 68 6d 65 74 69 63 2e 20 44 61 74 61 20 |rithmetic. Data | 00006ee0 6d 75 73 74 20 62 65 20 6f 66 20 74 79 70 65 0a |must be of type.| 00006ef0 66 70 5f 6e 75 6d 20 2d 20 74 68 65 20 27 2e 69 |fp_num - the '.i| 00006f00 27 20 69 73 20 75 73 65 64 20 77 68 65 6e 20 70 |' is used when p| 00006f10 61 73 73 69 6e 67 20 64 61 74 61 20 74 6f 20 74 |assing data to t| 00006f20 68 65 20 66 75 6e 63 74 69 6f 6e 73 2c 20 61 6e |he functions, an| 00006f30 64 20 27 2e 66 27 20 77 68 65 6e 0a 70 65 72 66 |d '.f' when.perf| 00006f40 6f 72 6d 69 6e 67 20 6e 6f 72 6d 61 6c 20 66 6c |orming normal fl| 00006f50 6f 61 74 20 61 72 69 74 68 6d 65 74 69 63 2e 0a |oat arithmetic..| 00006f60 0a 44 65 62 75 67 67 69 6e 67 0a 2d 2d 2d 2d 2d |.Debugging.-----| 00006f70 2d 2d 2d 2d 0a 21 46 72 61 63 74 61 6c 20 74 72 |----.!Fractal tr| 00006f80 61 70 73 20 61 6c 6c 20 61 62 65 6e 64 73 2c 20 |aps all abends, | 00006f90 61 6e 64 20 70 72 6f 76 69 64 65 73 20 61 6e 20 |and provides an | 00006fa0 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 61 6c 6c 6f |environment allo| 00006fb0 77 69 6e 67 20 73 69 6d 70 6c 65 0a 64 65 62 75 |wing simple.debu| 00006fc0 67 67 69 6e 67 2e 20 49 66 20 79 6f 75 20 77 61 |gging. If you wa| 00006fd0 6e 74 20 74 6f 20 75 73 65 20 41 63 6f 72 6e 27 |nt to use Acorn'| 00006fe0 73 20 41 53 44 20 74 68 65 6e 20 79 6f 75 20 6e |s ASD then you n| 00006ff0 65 65 64 20 74 6f 20 73 75 70 70 6c 79 20 2d 61 |eed to supply -a| 00007000 73 64 20 6f 6e 0a 46 72 61 63 74 61 6c 27 73 20 |sd on.Fractal's | 00007010 72 75 6e 20 73 74 61 74 65 6d 65 6e 74 2e 20 54 |run statement. T| 00007020 68 69 73 20 77 69 6c 6c 20 73 75 70 70 72 65 73 |his will suppres| 00007030 73 20 74 68 65 20 65 72 72 6f 72 20 74 72 61 70 |s the error trap| 00007040 70 69 6e 67 20 73 6f 20 74 68 61 74 20 41 53 44 |ping so that ASD| 00007050 0a 77 69 6c 6c 20 67 61 69 6e 20 63 6f 6e 74 72 |.will gain contr| 00007060 6f 6c 2e 0a 0a 4e 4f 54 45 3a 20 69 66 20 61 6e |ol...NOTE: if an| 00007070 20 65 72 72 6f 72 20 6f 63 63 75 72 73 20 64 75 | error occurs du| 00007080 72 69 6e 67 20 70 6c 6f 74 74 69 6e 67 20 28 66 |ring plotting (f| 00007090 70 6c 6f 74 20 6f 72 20 66 70 6c 6f 74 69 6e 69 |plot or fplotini| 000070a0 74 29 20 69 74 20 69 73 0a 45 53 53 45 4e 54 49 |t) it is.ESSENTI| 000070b0 41 4c 20 74 6f 20 69 73 73 75 65 20 61 20 6d 6f |AL to issue a mo| 000070c0 64 65 20 63 6f 6d 6d 61 6e 64 20 28 69 65 2e 20 |de command (ie. | 000070d0 2a 45 63 68 6f 20 3c 32 32 3e 3c 6e 3e 29 20 70 |*Echo <22><n>) p| 000070e0 72 69 6f 72 20 74 6f 20 71 75 69 74 74 69 6e 67 |rior to quitting| 000070f0 20 41 53 44 2e 0a 46 61 69 6c 75 72 65 20 74 6f | ASD..Failure to| 00007100 20 64 6f 20 73 6f 20 77 69 6c 6c 20 68 61 6e 67 | do so will hang| 00007110 20 74 68 65 20 6d 61 63 68 69 6e 65 20 28 77 68 | the machine (wh| 00007120 69 63 68 20 69 73 20 77 68 79 20 21 46 72 61 63 |ich is why !Frac| 00007130 74 61 6c 20 74 72 61 70 73 20 61 6c 6c 0a 65 72 |tal traps all.er| 00007140 72 6f 72 73 21 29 2e 20 59 6f 75 20 6d 69 67 68 |rors!). You migh| 00007150 74 20 6c 69 6b 65 20 74 6f 20 73 65 74 20 75 70 |t like to set up| 00007160 20 61 20 73 6d 61 6c 6c 20 65 78 65 63 20 66 69 | a small exec fi| 00007170 6c 65 20 74 6f 20 64 6f 20 74 68 69 73 2e 0a 0a |le to do this...| 00007180 42 61 63 6b 67 72 6f 75 6e 64 20 49 6e 66 6f 72 |Background Infor| 00007190 6d 61 74 69 6f 6e 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |mation.---------| 000071a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 59 6f |-------------.Yo| 000071b0 75 20 77 69 6c 6c 20 6e 6f 74 69 63 65 20 74 68 |u will notice th| 000071c0 61 74 20 49 20 68 61 76 65 20 64 65 63 69 64 65 |at I have decide| 000071d0 64 20 74 6f 20 75 73 65 20 22 77 69 6d 70 2e 68 |d to use "wimp.h| 000071e0 22 20 72 61 74 68 65 72 20 74 68 61 6e 20 74 68 |" rather than th| 000071f0 65 20 6d 6f 72 65 0a 70 6f 77 65 72 66 75 6c 20 |e more.powerful | 00007200 72 6f 75 74 69 6e 65 73 20 69 6e 20 77 69 6e 2e |routines in win.| 00007210 68 20 61 6e 64 20 77 69 6d 70 74 2e 68 2e 20 54 |h and wimpt.h. T| 00007220 68 69 73 20 61 72 6f 73 65 20 70 61 72 74 6c 79 |his arose partly| 00007230 20 62 65 63 61 75 73 65 20 6f 66 20 6d 79 0a 66 | because of my.f| 00007240 61 6d 69 6c 69 61 72 69 74 79 20 77 69 74 68 20 |amiliarity with | 00007250 74 68 65 20 57 69 6d 70 20 66 72 6f 6d 20 41 52 |the Wimp from AR| 00007260 4d 20 70 72 6f 67 72 61 6d 6d 69 6e 67 2c 20 61 |M programming, a| 00007270 6e 64 20 62 65 63 61 75 73 65 20 49 20 77 61 73 |nd because I was| 00007280 20 61 6c 61 72 6d 65 64 20 61 74 0a 74 68 65 20 | alarmed at.the | 00007290 73 69 7a 65 20 6f 66 20 63 6f 64 65 20 67 65 6e |size of code gen| 000072a0 65 72 61 74 65 64 20 62 79 20 74 68 65 20 6f 74 |erated by the ot| 000072b0 68 65 72 20 72 6f 75 74 69 6e 65 73 2e 0a 0a 54 |her routines...T| 000072c0 68 65 20 63 2e 4d 62 72 6f 74 4a 75 6c 69 61 20 |he c.MbrotJulia | 000072d0 66 69 6c 65 20 69 73 20 61 20 67 6f 6f 64 20 70 |file is a good p| 000072e0 6c 61 63 65 20 74 6f 20 73 74 61 72 74 20 74 6f |lace to start to| 000072f0 20 73 65 65 20 68 6f 77 20 6f 74 68 65 72 20 66 | see how other f| 00007300 75 6e 63 74 69 6f 6e 73 0a 68 61 76 65 20 62 65 |unctions.have be| 00007310 65 6e 20 69 6d 70 6c 65 6d 65 6e 74 65 64 2c 20 |en implemented, | 00007320 73 69 6e 63 65 20 69 74 20 75 73 65 73 20 61 20 |since it uses a | 00007330 77 69 64 65 20 76 61 72 69 65 74 79 20 6f 66 20 |wide variety of | 00007340 66 61 63 69 6c 69 74 69 65 73 2c 20 69 6e 63 6c |facilities, incl| 00007350 75 64 69 6e 67 0a 6c 69 6e 6b 73 20 74 6f 20 41 |uding.links to A| 00007360 73 73 65 6d 62 6c 65 72 20 69 6e 74 65 67 65 72 |ssembler integer| 00007370 20 70 72 6f 63 65 73 73 69 6e 67 20 72 6f 75 74 | processing rout| 00007380 69 6e 65 73 2e 20 54 68 65 20 49 46 53 20 61 6e |ines. The IFS an| 00007390 64 20 4c 2d 53 79 73 74 65 6d 0a 73 6f 75 72 63 |d L-System.sourc| 000073a0 65 20 63 6f 6e 74 61 69 6e 20 6d 6f 72 65 20 61 |e contain more a| 000073b0 64 76 61 6e 63 65 64 20 72 6f 75 74 69 6e 65 73 |dvanced routines| 000073c0 2c 20 69 6e 63 6c 75 64 69 6e 67 20 61 20 6c 6f |, including a lo| 000073d0 74 20 6f 66 20 77 69 6d 70 20 68 61 6e 64 6c 69 |t of wimp handli| 000073e0 6e 67 2e 0a 0a 50 6c 65 61 73 65 20 74 72 79 20 |ng...Please try | 000073f0 74 6f 20 6b 65 65 70 20 79 6f 75 72 20 72 6f 75 |to keep your rou| 00007400 74 69 6e 65 73 20 66 72 65 65 20 66 72 6f 6d 20 |tines free from | 00007410 63 6f 6d 70 69 6c 61 74 69 6f 6e 20 77 61 72 6e |compilation warn| 00007420 69 6e 67 20 6d 65 73 73 61 67 65 73 2e 20 4d 79 |ing messages. My| 00007430 0a 6b 6e 6f 77 6c 65 64 67 65 20 6f 66 20 43 20 |.knowledge of C | 00007440 69 73 20 73 65 6c 66 20 74 61 75 67 68 74 20 73 |is self taught s| 00007450 6f 20 49 20 61 70 6f 6c 6f 67 69 73 65 20 66 6f |o I apologise fo| 00007460 72 20 61 6e 79 20 63 72 61 73 73 20 6d 69 73 75 |r any crass misu| 00007470 73 65 73 20 6f 66 20 74 68 65 0a 6c 61 6e 67 75 |ses of the.langu| 00007480 61 67 65 2e 20 49 20 68 61 76 65 20 74 72 69 65 |age. I have trie| 00007490 64 20 74 6f 20 6b 65 65 70 20 74 68 65 20 63 6f |d to keep the co| 000074a0 64 65 20 61 73 20 73 74 72 75 63 74 75 72 65 64 |de as structured| 000074b0 20 61 6e 64 20 63 6c 65 61 6e 20 61 73 20 70 6f | and clean as po| 000074c0 73 73 69 62 6c 65 2c 0a 61 6e 64 20 49 20 68 6f |ssible,.and I ho| 000074d0 70 65 20 79 6f 75 20 77 69 6c 6c 20 74 72 79 20 |pe you will try | 000074e0 74 68 65 20 73 61 6d 65 20 73 69 6e 63 65 20 77 |the same since w| 000074f0 65 20 77 69 6c 6c 20 6e 65 65 64 20 74 6f 20 72 |e will need to r| 00007500 65 61 64 20 65 61 63 68 20 6f 74 68 65 72 73 0a |ead each others.| 00007510 73 6f 75 72 63 65 2e 20 49 20 61 6d 20 61 6c 77 |source. I am alw| 00007520 61 79 73 20 6f 70 65 6e 20 74 6f 20 73 75 67 67 |ays open to sugg| 00007530 65 73 74 69 6f 6e 73 20 66 6f 72 20 69 6d 70 72 |estions for impr| 00007540 6f 76 65 6d 65 6e 74 20 28 74 68 6f 75 67 68 20 |ovement (though | 00007550 67 65 74 74 69 6e 67 20 6d 65 0a 74 6f 20 61 64 |getting me.to ad| 00007560 6d 69 74 20 49 20 77 61 73 20 77 72 6f 6e 67 20 |mit I was wrong | 00007570 63 61 6e 20 62 65 20 74 72 69 63 6b 79 20 61 74 |can be tricky at| 00007580 20 74 69 6d 65 73 21 29 2e 0a 0a 2d 2d 2d 2d 2d | times!)...-----| 00007590 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000075d0 2d 2d 2d 2d 2d 0a 50 72 6f 67 72 61 6d 6d 69 6e |-----.Programmin| 000075e0 67 20 49 6e 20 41 52 4d 20 41 73 73 65 6d 62 6c |g In ARM Assembl| 000075f0 65 72 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |er.=============| 00007600 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a |===============.| 00007610 41 73 73 65 6d 62 6c 65 72 20 66 72 61 63 74 61 |Assembler fracta| 00007620 6c 20 72 6f 75 74 69 6e 65 73 20 61 72 65 20 6c |l routines are l| 00007630 6f 61 64 65 64 20 62 79 20 21 46 72 61 63 74 61 |oaded by !Fracta| 00007640 6c 20 61 74 20 73 74 61 72 74 20 75 70 2e 20 45 |l at start up. E| 00007650 61 63 68 20 6d 6f 64 75 6c 65 0a 63 61 6e 20 63 |ach module.can c| 00007660 6f 6e 74 61 69 6e 20 6f 6e 65 20 6f 72 20 6d 6f |ontain one or mo| 00007670 72 65 20 66 72 61 63 74 61 6c 20 66 75 6e 63 74 |re fractal funct| 00007680 69 6f 6e 73 2e 20 59 6f 75 20 61 72 65 20 70 72 |ions. You are pr| 00007690 6f 76 69 64 65 64 20 77 69 74 68 20 74 68 65 0a |ovided with the.| 000076a0 6e 65 63 65 73 73 61 72 79 20 73 79 6d 62 6f 6c |necessary symbol| 000076b0 69 63 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 74 |ic definitions t| 000076c0 6f 20 64 65 66 69 6e 65 20 61 6e 64 20 61 63 63 |o define and acc| 000076d0 65 73 73 20 74 68 65 20 64 61 74 61 20 70 61 73 |ess the data pas| 000076e0 73 65 64 20 74 6f 20 79 6f 75 72 0a 70 72 6f 67 |sed to your.prog| 000076f0 72 61 6d 2e 20 54 68 65 72 65 20 61 72 65 20 61 |ram. There are a| 00007700 6c 73 6f 20 73 6f 6d 65 20 66 75 6e 63 74 69 6f |lso some functio| 00007710 6e 73 20 74 68 61 74 20 63 61 6e 20 62 65 20 63 |ns that can be c| 00007720 61 6c 6c 65 64 20 74 6f 20 63 6f 6e 74 72 6f 6c |alled to control| 00007730 20 74 68 65 0a 6f 70 65 72 61 74 69 6f 6e 20 6f | the.operation o| 00007740 66 20 21 46 72 61 63 74 61 6c 20 69 74 73 65 6c |f !Fractal itsel| 00007750 66 2e 0a 0a 41 6c 6c 20 74 68 65 20 6e 65 63 65 |f...All the nece| 00007760 73 73 61 72 79 20 42 41 53 49 43 20 6c 69 62 72 |ssary BASIC libr| 00007770 61 72 69 65 73 20 61 6e 64 20 73 61 6d 70 6c 65 |aries and sample| 00007780 20 70 72 6f 67 72 61 6d 73 20 61 72 65 20 70 72 | programs are pr| 00007790 6f 76 69 64 65 64 20 69 6e 20 74 68 65 0a 41 73 |ovided in the.As| 000077a0 6d 20 64 69 72 65 63 74 6f 72 79 2e 20 54 68 65 |m directory. The| 000077b0 20 41 73 6d 2e 73 61 6d 70 6c 65 20 64 6f 65 73 | Asm.sample does| 000077c0 20 6e 6f 74 20 64 72 61 77 20 61 20 66 72 61 63 | not draw a frac| 000077d0 74 61 6c 2c 20 62 75 74 20 69 6c 6c 75 73 74 72 |tal, but illustr| 000077e0 61 74 65 73 20 74 68 65 0a 75 73 65 20 6f 66 20 |ates the.use of | 000077f0 7a 6f 6f 6d 69 6e 67 2c 20 61 6c 6f 6e 67 20 77 |zooming, along w| 00007800 69 74 68 20 74 68 65 20 62 61 73 69 63 20 73 75 |ith the basic su| 00007810 70 70 6f 72 74 20 63 6f 64 65 20 72 65 71 75 69 |pport code requi| 00007820 72 65 64 2e 20 59 6f 75 20 61 72 65 20 61 64 76 |red. You are adv| 00007830 69 73 65 64 0a 74 6f 20 74 61 6b 65 20 61 20 63 |ised.to take a c| 00007840 6f 70 79 20 6f 66 20 53 61 6d 70 6c 65 20 61 6e |opy of Sample an| 00007850 64 20 75 73 65 20 74 68 61 74 20 61 73 20 74 68 |d use that as th| 00007860 65 20 62 61 73 69 73 20 6f 66 20 79 6f 75 72 20 |e basis of your | 00007870 72 6f 75 74 69 6e 65 2e 0a 0a 41 6c 74 65 72 6e |routine...Altern| 00007880 61 74 69 76 65 6c 79 20 75 73 65 20 74 68 65 20 |atively use the | 00007890 53 61 6d 70 4d 61 6e 4a 75 6c 20 73 6f 75 72 63 |SampManJul sourc| 000078a0 65 20 77 68 69 63 68 20 69 73 20 61 20 66 75 6c |e which is a ful| 000078b0 6c 79 20 77 6f 72 6b 69 6e 67 20 76 65 72 73 69 |ly working versi| 000078c0 6f 6e 20 6f 66 0a 61 20 4d 61 6e 64 65 6c 62 72 |on of.a Mandelbr| 000078d0 6f 74 20 61 6e 64 20 4a 75 6c 69 61 20 70 6c 6f |ot and Julia plo| 000078e0 74 74 65 72 20 61 6e 64 20 63 6f 6e 74 61 69 6e |tter and contain| 000078f0 73 20 6d 6f 73 74 20 6f 66 20 74 68 65 20 66 75 |s most of the fu| 00007900 6e 63 74 69 6f 6e 73 20 64 65 73 63 72 69 62 65 |nctions describe| 00007910 64 0a 62 65 6c 6f 77 2e 20 49 74 20 75 73 65 73 |d.below. It uses| 00007920 20 74 68 65 20 78 2f 79 20 70 6c 6f 74 74 69 6e | the x/y plottin| 00007930 67 20 66 75 6e 63 74 69 6f 6e 73 20 61 6e 64 20 |g functions and | 00007940 69 73 20 61 20 67 6f 6f 64 20 70 6c 61 63 65 20 |is a good place | 00007950 74 6f 20 73 74 61 72 74 20 69 66 0a 79 6f 75 20 |to start if.you | 00007960 77 61 6e 74 20 74 6f 20 70 6c 61 79 20 61 72 6f |want to play aro| 00007970 75 6e 64 20 77 69 74 68 20 4d 61 6e 64 65 6c 62 |und with Mandelb| 00007980 72 6f 74 20 66 75 6e 63 74 69 6f 6e 73 2e 0a 0a |rot functions...| 00007990 41 73 6d 2e 53 61 6d 70 4e 65 77 74 6f 6e 20 69 |Asm.SampNewton i| 000079a0 6c 6c 75 73 74 72 61 74 65 73 20 74 68 65 20 75 |llustrates the u| 000079b0 73 65 20 6f 66 20 74 68 65 20 46 50 45 4c 49 42 |se of the FPELIB| 000079c0 20 28 66 61 73 74 20 33 32 20 62 69 74 20 66 6c | (fast 32 bit fl| 000079d0 6f 61 74 69 6e 67 0a 70 6f 69 6e 74 29 2c 20 61 |oating.point), a| 000079e0 6e 64 20 69 73 20 61 20 66 75 6c 6c 79 20 77 6f |nd is a fully wo| 000079f0 72 6b 69 6e 67 20 76 65 72 73 69 6f 6e 20 6f 66 |rking version of| 00007a00 20 74 68 65 20 6d 61 69 6e 20 4e 65 77 74 6f 6e | the main Newton| 00007a10 20 72 6f 75 74 69 6e 65 2e 0a 0a 57 68 65 6e 20 | routine...When | 00007a20 79 6f 75 20 68 61 76 65 20 61 73 73 65 6d 62 6c |you have assembl| 00007a30 65 64 20 79 6f 75 72 20 72 6f 75 74 69 6e 65 20 |ed your routine | 00007a40 69 6e 74 6f 20 3c 46 72 61 63 24 44 69 72 3e 2c |into <Frac$Dir>,| 00007a50 20 79 6f 75 20 6e 65 65 64 20 74 6f 20 6d 6f 64 | you need to mod| 00007a60 69 66 79 20 74 68 65 0a 21 46 72 61 63 74 61 6c |ify the.!Fractal| 00007a70 20 21 52 75 6e 20 66 69 6c 65 20 74 6f 20 6c 6f | !Run file to lo| 00007a80 61 64 20 79 6f 75 72 20 70 72 6f 67 72 61 6d 2e |ad your program.| 00007a90 20 4d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 70 | More than one p| 00007aa0 72 6f 67 72 61 6d 20 63 61 6e 20 62 65 0a 6c 6f |rogram can be.lo| 00007ab0 61 64 65 64 2c 20 6a 75 73 74 20 73 70 65 63 69 |aded, just speci| 00007ac0 66 79 20 2d 61 20 70 72 6f 67 6e 61 6d 65 20 72 |fy -a progname r| 00007ad0 65 70 65 61 74 65 64 6c 79 20 61 73 20 66 6f 6c |epeatedly as fol| 00007ae0 6c 6f 77 73 3a 0a 0a 20 20 20 52 55 4e 20 3c 46 |lows:.. RUN <F| 00007af0 72 61 63 24 44 69 72 3e 2e 46 72 61 63 74 61 6c |rac$Dir>.Fractal| 00007b00 20 2d 61 20 53 61 6d 70 6c 65 0a 0a 54 68 65 20 | -a Sample..The | 00007b10 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6d 6d 65 6e |following commen| 00007b20 74 73 20 67 6f 20 77 69 74 68 20 74 68 65 20 73 |ts go with the s| 00007b30 61 6d 70 6c 65 20 73 6f 75 72 63 65 2e 0a 0a 4c |ample source...L| 00007b40 49 42 52 41 52 59 20 22 3c 46 72 61 63 24 44 69 |IBRARY "<Frac$Di| 00007b50 72 3e 2e 41 73 6d 2e 46 72 61 63 6c 69 62 22 3a |r>.Asm.Fraclib":| 00007b60 50 52 4f 43 66 72 61 63 76 61 72 73 0a 54 68 69 |PROCfracvars.Thi| 00007b70 73 20 6c 69 62 72 61 72 79 20 63 6f 6e 74 61 69 |s library contai| 00007b80 6e 73 20 61 6c 6c 20 74 68 65 20 6e 65 63 65 73 |ns all the neces| 00007b90 73 61 72 79 20 73 79 6d 62 6f 6c 69 63 20 64 65 |sary symbolic de| 00007ba0 66 69 6e 69 74 69 6f 6e 73 20 61 73 20 64 65 73 |finitions as des| 00007bb0 63 72 69 62 65 64 0a 65 61 72 6c 69 65 72 20 69 |cribed.earlier i| 00007bc0 6e 20 74 68 69 73 20 64 6f 63 75 6d 65 6e 74 2e |n this document.| 00007bd0 20 59 6f 75 20 73 68 6f 75 6c 64 20 75 73 65 20 | You should use | 00007be0 74 68 65 73 65 20 73 79 6d 62 6f 6c 69 63 20 6e |these symbolic n| 00007bf0 61 6d 65 73 20 61 74 20 61 6c 6c 20 74 69 6d 65 |ames at all time| 00007c00 73 0a 74 6f 20 65 6e 61 62 6c 65 20 73 75 70 70 |s.to enable supp| 00007c10 6f 72 74 20 6f 66 20 66 75 74 75 72 65 20 72 65 |ort of future re| 00007c20 6c 65 61 73 65 73 20 6f 66 20 21 46 72 61 63 74 |leases of !Fract| 00007c30 61 6c 20 77 68 69 63 68 20 61 72 65 20 6c 69 6b |al which are lik| 00007c40 65 6c 79 20 74 6f 20 61 6c 74 65 72 0a 74 68 65 |ely to alter.the| 00007c50 20 63 6f 6e 74 72 6f 6c 20 62 6c 6f 63 6b 20 6f | control block o| 00007c60 66 66 73 65 74 73 20 65 74 63 2e 20 41 6c 73 6f |ffsets etc. Also| 00007c70 20 69 6e 20 74 68 65 20 6c 69 62 72 61 72 79 20 | in the library | 00007c80 61 72 65 20 66 75 6e 63 74 69 6f 6e 73 20 77 68 |are functions wh| 00007c90 69 63 68 0a 61 73 73 65 6d 62 6c 65 20 61 20 6c |ich.assemble a l| 00007ca0 6f 63 61 6c 20 63 6f 70 79 20 6f 66 20 61 20 63 |ocal copy of a c| 00007cb0 6f 6e 74 72 6f 6c 20 62 6c 6f 63 6b 2e 20 54 68 |ontrol block. Th| 00007cc0 65 20 6e 65 63 65 73 73 61 72 79 20 64 61 74 61 |e necessary data| 00007cd0 20 63 61 6e 20 62 65 20 63 6f 70 69 65 64 0a 74 | can be copied.t| 00007ce0 6f 20 74 68 65 73 65 20 61 72 65 61 73 20 28 61 |o these areas (a| 00007cf0 74 20 66 70 6c 6f 74 69 6e 69 74 20 6f 72 20 66 |t fplotinit or f| 00007d00 70 6c 6f 74 20 74 69 6d 65 29 20 61 6e 64 20 74 |plot time) and t| 00007d10 68 65 6e 20 72 65 66 65 72 65 6e 63 65 64 20 64 |hen referenced d| 00007d20 69 72 65 63 74 6c 79 20 69 6e 0a 74 68 65 20 70 |irectly in.the p| 00007d30 72 6f 67 72 61 6d 2c 20 77 68 69 63 68 20 61 6c |rogram, which al| 00007d40 6c 6f 77 73 20 69 6e 73 74 72 75 63 74 69 6f 6e |lows instruction| 00007d50 73 20 6f 66 20 74 68 65 20 66 6f 72 6d 20 4c 44 |s of the form LD| 00007d60 52 20 52 34 2c 76 61 72 6e 61 6d 65 20 69 6e 73 |R R4,varname ins| 00007d70 74 65 61 64 20 6f 66 0a 4c 44 52 20 52 34 2c 5b |tead of.LDR R4,[| 00007d80 52 31 2c 23 76 61 72 6e 61 6d 65 5d 2e 20 43 61 |R1,#varname]. Ca| 00007d90 6c 6c 69 6e 67 20 50 52 4f 43 66 72 61 63 76 61 |lling PROCfracva| 00007da0 72 73 20 64 65 66 69 6e 65 73 20 61 6c 6c 20 74 |rs defines all t| 00007db0 68 65 20 6e 65 63 65 73 73 61 72 79 0a 76 61 72 |he necessary.var| 00007dc0 69 61 62 6c 65 73 20 66 6f 72 20 79 6f 75 72 20 |iables for your | 00007dd0 70 72 6f 67 72 61 6d 2e 20 49 74 20 6d 61 79 20 |program. It may | 00007de0 62 65 20 62 65 73 74 20 74 6f 20 70 72 6f 64 75 |be best to produ| 00007df0 63 65 20 61 20 70 72 69 6e 74 65 64 20 6c 69 73 |ce a printed lis| 00007e00 74 69 6e 67 20 6f 66 0a 74 68 65 20 73 6f 75 72 |ting of.the sour| 00007e10 63 65 20 6f 66 20 46 72 61 63 6c 69 62 2e 0a 0a |ce of Fraclib...| 00007e20 4c 49 42 52 41 52 59 20 22 3c 46 72 61 63 24 44 |LIBRARY "<Frac$D| 00007e30 69 72 3e 2e 41 73 6d 2e 46 50 6c 69 62 22 3a 50 |ir>.Asm.FPlib":P| 00007e40 52 4f 43 66 70 69 6e 69 74 0a 54 68 69 73 20 6c |ROCfpinit.This l| 00007e50 69 62 72 61 72 79 20 70 72 6f 76 69 64 65 73 20 |ibrary provides | 00007e60 73 75 70 70 6f 72 74 20 66 6f 72 20 61 73 73 65 |support for asse| 00007e70 6d 62 6c 69 6e 67 20 66 6c 6f 61 74 69 6e 67 20 |mbling floating | 00007e80 70 6f 69 6e 74 20 69 6e 73 74 72 75 63 74 69 6f |point instructio| 00007e90 6e 73 2c 0a 77 68 69 63 68 20 77 69 6c 6c 20 62 |ns,.which will b| 00007ea0 65 20 72 65 71 75 69 72 65 64 20 74 6f 20 70 72 |e required to pr| 00007eb0 6f 76 69 64 65 20 7a 6f 6f 6d 69 6e 67 20 73 75 |ovide zooming su| 00007ec0 70 70 6f 72 74 2e 20 53 65 65 20 74 68 65 20 46 |pport. See the F| 00007ed0 50 5f 44 6f 63 20 66 69 6c 65 20 66 6f 72 0a 66 |P_Doc file for.f| 00007ee0 75 6c 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2e |ull information.| 00007ef0 0a 0a 46 4f 52 20 61 73 6d 3d 34 20 54 4f 20 37 |..FOR asm=4 TO 7| 00007f00 20 53 54 45 50 20 33 0a 50 25 3d 30 3a 4f 25 3d | STEP 3.P%=0:O%=| 00007f10 63 6f 64 65 25 0a 5b 4f 50 54 20 61 73 6d 0a 49 |code%.[OPT asm.I| 00007f20 74 20 69 73 20 6e 65 63 65 73 73 61 72 79 20 74 |t is necessary t| 00007f30 6f 20 75 73 65 20 6f 66 66 73 65 74 20 61 73 73 |o use offset ass| 00007f40 65 6d 62 6c 79 20 66 72 6f 6d 20 6c 6f 63 61 74 |embly from locat| 00007f50 69 6f 6e 20 30 20 62 65 63 61 75 73 65 20 79 6f |ion 0 because yo| 00007f60 75 72 20 70 72 6f 67 72 61 6d 0a 69 73 20 6c 6f |ur program.is lo| 00007f70 61 64 65 64 20 64 79 6e 61 6d 69 63 61 6c 6c 79 |aded dynamically| 00007f80 2e 20 41 6c 73 6f 20 46 50 4c 69 62 20 72 65 71 |. Also FPLib req| 00007f90 75 69 72 65 73 20 74 68 65 20 75 73 65 20 6f 66 |uires the use of| 00007fa0 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 61 73 | the variable as| 00007fb0 6d 2e 0a 0a 46 4e 66 72 61 63 68 64 72 0a 54 68 |m...FNfrachdr.Th| 00007fc0 69 73 20 6d 75 73 74 20 62 65 20 74 68 65 20 66 |is must be the f| 00007fd0 69 72 73 74 20 61 73 73 65 6d 62 6c 65 72 20 73 |irst assembler s| 00007fe0 74 61 74 65 6d 65 6e 74 2e 20 49 74 20 64 65 66 |tatement. It def| 00007ff0 69 6e 65 73 20 61 20 76 61 6c 75 65 20 77 68 69 |ines a value whi| 00008000 63 68 20 69 73 0a 63 68 65 63 6b 65 64 20 77 68 |ch is.checked wh| 00008010 65 6e 20 21 46 72 61 63 74 61 6c 20 6c 6f 61 64 |en !Fractal load| 00008020 73 20 79 6f 75 72 20 70 72 6f 67 72 61 6d 20 74 |s your program t| 00008030 6f 20 65 6e 73 75 72 65 20 79 6f 75 72 20 70 72 |o ensure your pr| 00008040 6f 67 72 61 6d 20 68 61 73 20 62 65 65 6e 0a 61 |ogram has been.a| 00008050 73 73 65 6d 62 6c 65 64 20 61 67 61 69 6e 73 74 |ssembled against| 00008060 20 74 68 65 20 63 6f 72 72 65 63 74 20 72 65 6c | the correct rel| 00008070 65 61 73 65 20 6f 66 20 46 72 61 63 6c 69 62 20 |ease of Fraclib | 00008080 2d 20 69 66 20 69 74 20 64 6f 65 73 20 6e 6f 74 |- if it does not| 00008090 20 6d 61 74 63 68 20 74 68 65 6e 0a 79 6f 75 72 | match then.your| 000080a0 20 72 6f 75 74 69 6e 65 20 6e 65 65 64 73 20 72 | routine needs r| 000080b0 65 2d 61 73 73 65 6d 62 6c 69 6e 67 20 61 67 61 |e-assembling aga| 000080c0 69 6e 73 74 20 46 72 61 63 6c 69 62 2e 0a 0a 44 |inst Fraclib...D| 000080d0 43 44 20 73 61 6d 70 6c 65 20 20 20 20 20 20 20 |CD sample | 000080e0 20 20 20 20 20 20 20 20 20 20 20 20 50 6f 69 6e | Poin| 000080f0 74 73 20 74 6f 20 61 20 46 4e 66 72 61 63 66 75 |ts to a FNfracfu| 00008100 6e 63 0a 44 43 44 20 2d 31 20 20 20 20 20 20 20 |nc.DCD -1 | 00008110 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00008120 45 6e 64 20 6f 66 20 66 75 6e 63 74 69 6f 6e 20 |End of function | 00008130 70 6f 69 6e 74 65 72 73 0a 4e 65 78 74 2c 20 64 |pointers.Next, d| 00008140 65 63 6c 61 72 65 20 70 6f 69 6e 74 65 72 73 20 |eclare pointers | 00008150 74 6f 20 61 6c 6c 20 6f 66 20 74 68 65 20 66 72 |to all of the fr| 00008160 61 63 74 61 6c 20 66 75 6e 63 74 69 6f 6e 73 20 |actal functions | 00008170 77 69 74 68 69 6e 20 74 68 69 73 20 6d 6f 64 75 |within this modu| 00008180 6c 65 2c 0a 61 6e 64 20 74 65 72 6d 69 6e 61 74 |le,.and terminat| 00008190 65 20 74 68 65 20 6c 69 73 74 20 77 69 74 68 20 |e the list with | 000081a0 2d 31 2e 0a 0a 2e 73 61 6d 70 6c 65 20 46 4e 66 |-1....sample FNf| 000081b0 72 61 63 66 75 6e 63 28 22 6e 61 6d 65 22 2c 65 |racfunc("name",e| 000081c0 6e 74 72 79 5f 70 74 2c 66 72 61 63 74 61 6c 5f |ntry_pt,fractal_| 000081d0 74 79 70 65 2c 78 79 72 74 6e 2c 6e 6f 2e 20 6f |type,xyrtn,no. o| 000081e0 66 20 76 61 72 73 2c 76 61 72 2e 0a 73 69 7a 65 |f vars,var..size| 000081f0 2c 77 6f 72 6b 5f 73 69 7a 65 29 0a 54 68 69 73 |,work_size).This| 00008200 20 73 74 61 74 65 6d 65 6e 74 20 64 65 66 69 6e | statement defin| 00008210 65 73 20 61 20 66 72 61 63 74 61 6c 20 66 75 6e |es a fractal fun| 00008220 63 74 69 6f 6e 2c 20 61 6e 64 20 69 73 20 6e 6f |ction, and is no| 00008230 72 6d 61 6c 6c 79 20 70 6c 61 63 65 64 20 6a 75 |rmally placed ju| 00008240 73 74 0a 70 72 65 63 65 64 69 6e 67 20 74 68 65 |st.preceding the| 00008250 20 66 75 6e 63 74 69 6f 6e 20 63 6f 64 65 20 69 | function code i| 00008260 74 73 65 6c 66 2e 0a 65 6e 74 72 79 5f 70 74 20 |tself..entry_pt | 00008270 69 73 20 61 20 6c 61 62 65 6c 20 6f 66 20 74 68 |is a label of th| 00008280 65 20 63 61 6c 6c 69 6e 67 20 70 6f 69 6e 74 20 |e calling point | 00008290 6f 66 20 79 6f 75 72 20 70 72 6f 67 72 61 6d 2e |of your program.| 000082a0 0a 66 72 61 63 74 61 6c 5f 74 79 70 65 20 69 73 |.fractal_type is| 000082b0 20 74 68 65 20 76 61 72 69 6f 75 73 20 62 69 74 | the various bit| 000082c0 20 73 65 74 74 69 6e 67 73 20 74 6f 20 64 65 73 | settings to des| 000082d0 72 69 62 65 20 74 68 65 20 66 75 6e 63 74 69 6f |ribe the functio| 000082e0 6e 20 2d 20 75 73 65 20 74 68 65 0a 73 79 6d 62 |n - use the.symb| 000082f0 6f 6c 69 63 20 6e 61 6d 65 73 20 64 65 73 63 72 |olic names descr| 00008300 69 62 65 64 20 65 61 72 6c 69 65 72 2e 0a 78 79 |ibed earlier..xy| 00008310 72 74 6e 20 69 73 20 74 68 65 20 61 64 64 72 65 |rtn is the addre| 00008320 73 73 20 6f 66 20 79 6f 75 72 20 78 2f 79 20 70 |ss of your x/y p| 00008330 6c 6f 74 74 65 72 2e 20 4e 6f 72 6d 61 6c 6c 79 |lotter. Normally| 00008340 20 74 68 69 73 20 69 73 20 73 65 74 20 74 6f 20 | this is set to | 00008350 30 20 69 6e 20 74 68 65 0a 64 65 66 69 6e 69 74 |0 in the.definit| 00008360 69 6f 6e 2c 20 61 6e 64 20 73 65 74 20 64 75 72 |ion, and set dur| 00008370 69 6e 67 20 66 70 6c 6f 74 69 6e 69 74 20 70 72 |ing fplotinit pr| 00008380 6f 63 65 73 73 69 6e 67 2e 0a 6e 6f 2e 20 6f 66 |ocessing..no. of| 00008390 20 76 61 72 73 20 64 65 66 69 6e 65 73 20 74 68 | vars defines th| 000083a0 65 20 6e 75 6d 62 65 72 20 6f 66 20 65 64 69 74 |e number of edit| 000083b0 61 62 6c 65 20 76 61 72 69 61 62 6c 65 73 2c 20 |able variables, | 000083c0 61 6e 64 20 76 61 72 2e 20 73 69 7a 65 20 74 68 |and var. size th| 000083d0 65 0a 74 6f 74 61 6c 20 73 69 7a 65 20 6f 66 20 |e.total size of | 000083e0 74 68 65 73 65 2e 20 54 68 65 73 65 20 76 61 72 |these. These var| 000083f0 69 61 62 6c 65 73 20 6d 75 73 74 20 63 6f 6d 65 |iables must come| 00008400 20 6e 65 78 74 2e 0a 77 6f 72 6b 5f 73 69 7a 65 | next..work_size| 00008410 20 3a 20 73 65 74 20 74 68 69 73 20 74 6f 20 74 | : set this to t| 00008420 68 65 20 61 6d 6f 75 6e 74 20 6f 66 20 77 6f 72 |he amount of wor| 00008430 6b 69 6e 67 20 73 74 6f 72 61 67 65 20 61 72 65 |king storage are| 00008440 61 20 72 65 71 75 69 72 65 64 2e 20 54 68 65 0a |a required. The.| 00008450 61 64 64 72 65 73 73 20 6f 66 20 74 68 69 73 20 |address of this | 00008460 61 72 65 61 20 77 69 6c 6c 20 62 65 20 61 74 20 |area will be at | 00008470 73 61 6d 70 6c 65 2b 66 64 65 66 6e 5f 64 2e 0a |sample+fdefn_d..| 00008480 0a 2e 76 61 72 73 74 61 72 74 0a 46 4e 61 66 67 |..varstart.FNafg| 00008490 32 76 61 72 28 76 61 72 69 61 62 6c 65 20 74 79 |2var(variable ty| 000084a0 70 65 2c 61 72 72 61 79 20 73 69 7a 65 2c 76 61 |pe,array size,va| 000084b0 72 69 61 62 6c 65 20 6c 65 6e 67 74 68 29 3a 20 |riable length): | 000084c0 76 61 72 69 61 62 6c 65 20 64 61 74 61 0a 2e 76 |variable data..v| 000084d0 61 72 65 6e 64 20 0a 53 61 6d 70 6c 65 20 75 73 |arend .Sample us| 000084e0 65 73 20 74 68 65 20 2e 76 61 72 73 74 61 72 74 |es the .varstart| 000084f0 20 61 6e 64 20 2e 76 61 72 65 6e 64 20 6c 61 62 | and .varend lab| 00008500 65 6c 73 20 74 6f 20 64 65 6c 69 6d 69 74 20 74 |els to delimit t| 00008510 68 65 20 70 72 6f 67 72 61 6d 0a 76 61 72 69 61 |he program.varia| 00008520 62 6c 65 73 20 73 6f 20 74 68 61 74 20 74 68 65 |bles so that the| 00008530 69 72 20 73 69 7a 65 20 63 61 6e 20 62 65 20 63 |ir size can be c| 00008540 61 6c 63 75 6c 61 74 65 64 20 62 79 20 74 68 65 |alculated by the| 00008550 20 61 73 73 65 6d 62 6c 65 72 2e 20 55 73 65 0a | assembler. Use.| 00008560 46 4e 61 66 67 32 76 61 72 20 74 6f 20 64 65 66 |FNafg2var to def| 00008570 69 6e 65 20 74 68 65 20 76 61 72 69 61 62 6c 65 |ine the variable| 00008580 20 74 79 70 65 20 61 6e 64 20 73 69 7a 65 2e 20 | type and size. | 00008590 56 61 72 69 61 62 6c 65 20 74 79 70 65 73 20 61 |Variable types a| 000085a0 72 65 20 41 46 47 5f 69 6e 74 0a 28 69 6e 74 65 |re AFG_int.(inte| 000085b0 67 65 72 29 2c 20 41 46 47 5f 66 6c 74 20 28 73 |ger), AFG_flt (s| 000085c0 68 6f 72 74 20 66 6c 6f 61 74 29 2c 20 41 46 47 |hort float), AFG| 000085d0 5f 64 62 6c 20 28 64 6f 75 62 6c 65 20 66 6c 6f |_dbl (double flo| 000085e0 61 74 29 2c 20 41 46 47 5f 73 74 72 20 28 7a 65 |at), AFG_str (ze| 000085f0 72 6f 0a 74 65 72 6d 69 6e 61 74 65 64 20 73 74 |ro.terminated st| 00008600 72 69 6e 67 29 2e 0a 0a 46 4e 76 61 72 6e 61 6d |ring)...FNvarnam| 00008610 65 28 22 20 20 20 20 20 20 20 6e 61 6d 65 22 29 |e(" name")| 00008620 0a 55 73 65 20 74 68 69 73 20 66 75 6e 63 74 69 |.Use this functi| 00008630 6f 6e 20 74 6f 20 64 65 66 69 6e 65 20 74 68 65 |on to define the| 00008640 20 6e 61 6d 65 73 20 6f 66 20 74 68 65 20 76 61 | names of the va| 00008650 72 69 61 62 6c 65 73 2e 20 54 68 69 73 20 66 75 |riables. This fu| 00008660 6e 63 74 69 6f 6e 0a 65 6e 73 75 72 65 73 20 74 |nction.ensures t| 00008670 68 65 20 6e 61 6d 65 73 20 61 72 65 20 6f 6e 6c |he names are onl| 00008680 79 20 31 2d 31 31 20 63 68 61 72 61 63 74 65 72 |y 1-11 character| 00008690 73 2c 20 7a 65 72 6f 2d 74 65 72 6d 69 6e 61 74 |s, zero-terminat| 000086a0 65 64 20 61 6e 64 20 70 61 64 64 65 64 20 74 6f |ed and padded to| 000086b0 20 31 32 0a 62 79 74 65 73 2e 0a 0a 2e 65 6e 74 | 12.bytes....ent| 000086c0 72 79 5f 70 6f 69 6e 74 0a 46 4e 66 65 6e 74 65 |ry_point.FNfente| 000086d0 72 0a 54 68 69 73 20 6d 75 73 74 20 62 65 20 74 |r.This must be t| 000086e0 68 65 20 31 73 74 20 73 74 61 74 65 6d 65 6e 74 |he 1st statement| 000086f0 20 6f 66 20 79 6f 75 72 20 66 72 61 63 74 61 6c | of your fractal| 00008700 20 66 75 6e 63 74 69 6f 6e 2e 20 49 74 20 70 65 | function. It pe| 00008710 72 66 6f 72 6d 73 0a 65 73 73 65 6e 74 69 61 6c |rforms.essential| 00008720 20 6c 69 6e 6b 61 67 65 20 74 6f 20 46 72 61 63 | linkage to Frac| 00008730 74 61 6c 2e 0a 3b 20 52 30 3d 46 72 61 63 74 61 |tal..; R0=Fracta| 00008740 6c 20 45 76 65 6e 74 2c 20 52 31 3d 41 64 64 72 |l Event, R1=Addr| 00008750 65 73 73 20 6f 66 20 44 61 74 61 2c 20 52 31 33 |ess of Data, R13| 00008760 3d 64 65 73 63 65 6e 64 69 6e 67 20 73 74 61 63 |=descending stac| 00008770 6b 2e 0a 4f 6e 20 65 6e 74 72 79 20 74 6f 20 79 |k..On entry to y| 00008780 6f 75 72 20 70 72 6f 67 72 61 6d 20 52 30 20 63 |our program R0 c| 00008790 6f 6e 74 61 69 6e 73 20 74 68 65 20 66 72 61 63 |ontains the frac| 000087a0 74 61 6c 20 65 76 65 6e 74 20 6e 75 6d 62 65 72 |tal event number| 000087b0 20 2d 20 75 73 65 20 74 68 65 0a 73 79 6d 62 6f | - use the.symbo| 000087c0 6c 69 63 20 6e 61 6d 65 73 20 74 6f 20 64 65 63 |lic names to dec| 000087d0 6f 64 65 2e 20 52 31 20 63 6f 6e 74 61 69 6e 73 |ode. R1 contains| 000087e0 20 74 68 65 20 61 64 64 72 65 73 73 20 6f 66 20 | the address of | 000087f0 74 68 65 20 66 72 61 63 74 61 6c 20 65 76 65 6e |the fractal even| 00008800 74 0a 63 6f 6e 74 72 6f 6c 20 62 6c 6f 63 6b 2e |t.control block.| 00008810 20 54 6f 20 61 63 63 65 73 73 20 74 68 65 20 64 | To access the d| 00008820 61 74 61 20 70 6f 69 6e 74 65 64 20 74 6f 20 62 |ata pointed to b| 00008830 79 20 52 31 20 75 73 65 20 69 6e 73 74 72 75 63 |y R1 use instruc| 00008840 74 69 6f 6e 73 20 6f 66 20 74 68 65 0a 66 6f 72 |tions of the.for| 00008850 6d 3a 0a 20 20 20 20 20 20 20 4c 44 52 20 52 32 |m:. LDR R2| 00008860 2c 5b 52 31 2c 23 70 6c 6f 74 5f 69 6d 5f 6f 73 |,[R1,#plot_im_os| 00008870 78 5d 0a 0a 41 6e 20 61 72 65 61 20 6f 66 20 6d |x]..An area of m| 00008880 65 6d 6f 72 79 20 66 72 6f 6d 20 52 31 30 2d 35 |emory from R10-5| 00008890 31 32 20 74 6f 20 52 31 33 20 69 73 20 61 76 61 |12 to R13 is ava| 000088a0 69 6c 61 62 6c 65 20 61 73 20 74 65 6d 70 6f 72 |ilable as tempor| 000088b0 61 72 79 20 77 6f 72 6b 73 70 61 63 65 2c 0a 67 |ary workspace,.g| 000088c0 75 61 72 61 6e 74 65 65 64 20 74 6f 20 62 65 20 |uaranteed to be | 000088d0 61 74 20 6c 65 61 73 74 20 32 35 36 20 62 79 74 |at least 256 byt| 000088e0 65 73 2c 20 62 75 74 20 74 79 70 69 63 61 6c 6c |es, but typicall| 000088f0 79 20 77 68 61 74 20 65 76 65 72 20 69 73 20 6c |y what ever is l| 00008900 65 66 74 20 66 72 6f 6d 0a 74 68 65 20 69 6e 69 |eft from.the ini| 00008910 74 69 61 6c 20 57 69 6d 70 73 6c 6f 74 20 69 6e |tial Wimpslot in| 00008920 20 21 52 75 6e 20 28 73 6f 20 69 6e 63 72 65 61 | !Run (so increa| 00008930 73 65 20 74 68 69 73 20 69 66 20 79 6f 75 20 6e |se this if you n| 00008940 65 65 64 20 6d 6f 72 65 29 2e 0a 0a 2e 65 78 69 |eed more)....exi| 00008950 74 5f 70 6f 69 6e 74 0a 46 4e 66 65 78 69 74 0a |t_point.FNfexit.| 00008960 54 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 69 73 |This function is| 00008970 20 75 73 65 64 20 74 6f 20 65 78 69 74 20 62 61 | used to exit ba| 00008980 63 6b 20 74 6f 20 46 72 61 63 74 61 6c 2e 20 44 |ck to Fractal. D| 00008990 6f 20 6e 6f 74 20 74 72 79 20 4d 4f 56 20 50 43 |o not try MOV PC| 000089a0 2c 52 31 34 2e 0a 0a 46 4e 66 69 6e 74 65 72 66 |,R14...FNfinterf| 000089b0 61 63 65 0a 50 6c 61 63 65 20 74 68 69 73 20 66 |ace.Place this f| 000089c0 75 6e 63 74 69 6f 6e 20 61 74 20 74 68 65 20 65 |unction at the e| 000089d0 6e 64 20 6f 66 20 79 6f 75 72 20 6d 6f 64 75 6c |nd of your modul| 000089e0 65 20 74 6f 20 64 65 66 69 6e 65 20 74 68 65 20 |e to define the | 000089f0 6e 65 63 65 73 73 61 72 79 0a 69 6e 74 65 72 66 |necessary.interf| 00008a00 61 63 65 20 72 6f 75 74 69 6e 65 73 2e 0a 0a 53 |ace routines...S| 00008a10 59 53 20 22 4f 53 5f 46 69 6c 65 22 2c 31 30 2c |YS "OS_File",10,| 00008a20 22 3c 46 72 61 63 24 44 69 72 3e 2e 53 61 6d 70 |"<Frac$Dir>.Samp| 00008a30 6c 65 22 2c 26 46 46 41 2c 2c 63 6f 64 65 25 2c |le",&FFA,,code%,| 00008a40 4f 25 0a 54 68 69 73 20 73 61 76 65 73 20 74 68 |O%.This saves th| 00008a50 65 20 61 73 73 65 6d 62 6c 65 64 20 63 6f 64 65 |e assembled code| 00008a60 20 61 73 20 61 20 72 65 6c 6f 63 61 74 61 62 6c | as a relocatabl| 00008a70 65 20 6d 6f 64 75 6c 65 20 28 74 68 6f 75 67 68 |e module (though| 00008a80 20 69 74 20 69 73 20 6e 6f 74 0a 65 6c 69 67 69 | it is not.eligi| 00008a90 62 6c 65 20 66 6f 72 20 74 68 65 20 52 4d 41 29 |ble for the RMA)| 00008aa0 20 69 6e 20 74 68 65 20 21 46 72 61 63 74 61 6c | in the !Fractal| 00008ab0 20 6c 69 62 72 61 72 79 2e 0a 0a 4f 74 68 65 72 | library...Other| 00008ac0 20 46 72 61 63 4c 69 62 20 46 75 6e 63 74 69 6f | FracLib Functio| 00008ad0 6e 73 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |ns.-------------| 00008ae0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 46 72 61 63 4c |----------.FracL| 00008af0 69 62 20 63 6f 6e 74 61 69 6e 73 20 6f 74 68 65 |ib contains othe| 00008b00 72 20 66 75 6e 63 74 69 6f 6e 73 20 77 68 69 63 |r functions whic| 00008b10 68 20 6d 61 79 20 62 65 20 6f 66 20 75 73 65 20 |h may be of use | 00008b20 74 6f 20 61 73 73 65 6d 62 6c 65 72 20 70 72 6f |to assembler pro| 00008b30 67 72 61 6d 73 2c 0a 73 75 63 68 20 61 73 20 69 |grams,.such as i| 00008b40 6e 74 65 67 65 72 20 61 72 69 74 68 6d 65 74 69 |nteger arithmeti| 00008b50 63 2e 20 50 6c 65 61 73 65 20 66 65 65 6c 20 66 |c. Please feel f| 00008b60 72 65 65 20 74 6f 20 63 6f 6e 74 72 69 62 75 74 |ree to contribut| 00008b70 65 20 79 6f 75 72 20 6f 77 6e 0a 66 75 6e 63 74 |e your own.funct| 00008b80 69 6f 6e 73 20 74 6f 20 74 68 69 73 20 6c 69 62 |ions to this lib| 00008b90 72 61 72 79 20 62 79 20 73 65 6e 64 69 6e 67 20 |rary by sending | 00008ba0 79 6f 75 72 20 46 72 61 63 6c 69 62 20 28 77 69 |your Fraclib (wi| 00008bb0 74 68 20 73 75 69 74 61 62 6c 65 0a 64 6f 63 75 |th suitable.docu| 00008bc0 6d 65 6e 74 61 74 69 6f 6e 29 20 61 6c 6f 6e 67 |mentation) along| 00008bd0 20 77 69 74 68 20 79 6f 75 72 20 66 72 61 63 74 | with your fract| 00008be0 61 6c 20 72 6f 75 74 69 6e 65 2c 20 62 61 63 6b |al routine, back| 00008bf0 20 74 6f 20 4d 69 6b 65 20 43 75 72 6e 6f 77 2e | to Mike Curnow.| 00008c00 0a 0a 66 78 79 73 74 61 72 74 3a 20 63 61 6c 6c |..fxystart: call| 00008c10 20 74 68 69 73 20 72 6f 75 74 69 6e 65 20 74 6f | this routine to| 00008c20 20 73 74 61 72 74 20 74 68 65 20 66 78 79 70 6f | start the fxypo| 00008c30 73 20 65 76 65 6e 74 20 64 65 73 63 72 69 62 65 |s event describe| 00008c40 64 20 65 61 72 6c 69 65 72 2e 0a 59 6f 75 72 20 |d earlier..Your | 00008c50 66 75 6e 63 74 69 6f 6e 20 6d 75 73 74 20 73 75 |function must su| 00008c60 70 70 6f 72 74 20 7a 6f 6f 6d 69 6e 67 20 28 66 |pport zooming (f| 00008c70 5a 6f 6f 6d 20 66 6c 61 67 20 6f 6e 29 2e 20 57 |Zoom flag on). W| 00008c80 68 65 6e 20 74 68 65 20 75 73 65 72 20 63 6c 69 |hen the user cli| 00008c90 63 6b 73 0a 6f 76 65 72 20 74 68 65 20 66 72 61 |cks.over the fra| 00008ca0 63 74 61 6c 20 69 6d 61 67 65 2c 20 65 76 65 6e |ctal image, even| 00008cb0 74 20 66 78 79 70 6f 73 20 69 73 20 72 65 70 6f |t fxypos is repo| 00008cc0 72 74 65 64 20 74 6f 20 79 6f 75 72 20 70 72 6f |rted to your pro| 00008cd0 67 72 61 6d 2c 20 70 61 73 73 69 6e 67 0a 74 68 |gram, passing.th| 00008ce0 65 20 78 20 26 20 79 20 76 61 6c 75 65 73 20 28 |e x & y values (| 00008cf0 64 6f 75 62 6c 65 20 66 6f 72 6d 61 74 29 20 61 |double format) a| 00008d00 74 20 74 68 61 74 20 70 6f 69 6e 74 2e 0a 20 20 |t that point.. | 00008d10 20 20 65 67 2e 20 20 20 20 42 4c 20 66 78 79 73 | eg. BL fxys| 00008d20 74 61 72 74 0a 0a 66 6e 65 77 66 75 6e 63 3a 20 |tart..fnewfunc: | 00008d30 63 61 6c 6c 20 74 68 69 73 20 72 6f 75 74 69 6e |call this routin| 00008d40 65 20 74 6f 20 73 77 69 74 63 68 20 74 6f 20 61 |e to switch to a| 00008d50 20 6e 65 77 20 66 75 6e 63 74 69 6f 6e 2e 20 52 | new function. R| 00008d60 30 20 6d 75 73 74 20 70 6f 69 6e 74 20 74 6f 20 |0 must point to | 00008d70 61 0a 7a 65 72 6f 20 74 65 72 6d 69 6e 61 74 65 |a.zero terminate| 00008d80 64 20 66 72 61 63 74 61 6c 20 66 75 6e 63 74 69 |d fractal functi| 00008d90 6f 6e 20 6e 61 6d 65 20 28 61 73 20 69 6e 20 74 |on name (as in t| 00008da0 68 65 20 6d 65 6e 75 29 2e 20 4d 61 6e 64 65 6c |he menu). Mandel| 00008db0 62 72 6f 74 27 73 20 75 73 65 0a 74 68 69 73 20 |brot's use.this | 00008dc0 74 6f 20 73 77 69 74 63 68 20 74 6f 20 74 68 65 |to switch to the| 00008dd0 69 72 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 |ir corresponding| 00008de0 20 4a 75 6c 69 61 20 73 65 74 2e 0a 20 20 20 20 | Julia set.. | 00008df0 65 67 2e 20 20 20 20 41 44 52 20 52 30 2c 66 75 |eg. ADR R0,fu| 00008e00 6e 63 6e 61 6d 65 20 20 20 20 20 20 20 3b 20 61 |ncname ; a| 00008e10 64 64 72 65 73 73 20 66 75 6e 63 74 69 6f 6e 0a |ddress function.| 00008e20 20 20 20 20 20 20 20 20 20 20 20 42 4c 20 20 66 | BL f| 00008e30 6e 65 77 66 75 6e 63 20 20 20 20 20 20 20 20 20 |newfunc | 00008e40 20 3b 20 70 65 72 66 6f 72 6d 20 73 77 69 74 63 | ; perform switc| 00008e50 68 0a 20 20 20 20 20 20 20 20 20 20 20 46 4e 66 |h. FNf| 00008e60 65 78 69 74 0a 20 20 20 20 2e 66 75 6e 63 6e 61 |exit. .funcna| 00008e70 6d 65 20 20 45 51 55 53 20 22 4e 65 78 74 20 66 |me EQUS "Next f| 00008e80 75 6e 63 22 2b 43 48 52 24 30 0a 0a 4e 6f 74 65 |unc"+CHR$0..Note| 00008e90 3a 20 66 75 6e 63 74 69 6f 6e 73 20 73 75 63 68 |: functions such| 00008ea0 20 61 73 20 46 4e 66 69 6d 69 6e 66 6f 61 73 6d | as FNfiminfoasm| 00008eb0 20 61 72 65 20 74 6f 20 62 65 20 70 6c 61 63 65 | are to be place| 00008ec0 64 20 64 69 72 65 63 74 6c 79 20 69 6e 73 69 64 |d directly insid| 00008ed0 65 0a 61 73 73 65 6d 62 6c 65 72 20 63 6f 64 65 |e.assembler code| 00008ee0 2e 0a 0a 46 4e 66 69 6d 69 6e 66 6f 61 73 6d 20 |...FNfiminfoasm | 00008ef0 20 20 20 20 41 73 73 65 6d 62 6c 65 73 20 61 20 | Assembles a | 00008f00 6c 6f 63 61 6c 20 63 6f 70 79 20 6f 66 20 74 68 |local copy of th| 00008f10 65 20 49 6d 69 6e 66 6f 20 63 6f 6e 74 72 6f 6c |e Iminfo control| 00008f20 20 62 6c 6f 63 6b 0a 46 4e 66 70 6c 6f 74 61 73 | block.FNfplotas| 00008f30 6d 20 20 20 20 20 20 20 41 73 73 65 6d 62 6c 65 |m Assemble| 00008f40 73 20 61 20 6c 6f 63 61 6c 20 63 6f 70 79 20 6f |s a local copy o| 00008f50 66 20 74 68 65 20 66 70 6c 6f 74 2f 66 70 6c 6f |f the fplot/fplo| 00008f60 74 69 6e 69 74 20 63 6f 6e 74 72 6f 6c 20 62 6c |tinit control bl| 00008f70 6f 63 6b 0a 0a 46 4e 66 6d 65 6e 75 5f 68 64 72 |ock..FNfmenu_hdr| 00008f80 28 74 69 74 6c 65 24 2c 77 69 64 74 68 25 29 0a |(title$,width%).| 00008f90 46 4e 66 6d 65 6e 75 5f 69 74 65 6d 28 69 74 65 |FNfmenu_item(ite| 00008fa0 6d 24 2c 73 75 62 6d 65 6e 75 25 2c 66 6c 61 67 |m$,submenu%,flag| 00008fb0 25 29 0a 54 68 65 73 65 20 61 73 73 65 6d 62 6c |%).These assembl| 00008fc0 65 20 61 20 73 69 6d 70 6c 65 20 57 49 4d 50 20 |e a simple WIMP | 00008fd0 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 2e 0a |menu structure..| 00008fe0 74 69 74 6c 65 24 20 20 20 3a 20 4d 65 6e 75 20 |title$ : Menu | 00008ff0 74 69 74 6c 65 2c 20 31 2d 31 32 20 63 68 61 72 |title, 1-12 char| 00009000 61 63 74 65 72 73 0a 77 69 64 74 68 25 20 20 20 |acters.width% | 00009010 3a 20 4d 61 78 69 6d 75 6d 20 77 69 64 74 68 20 |: Maximum width | 00009020 6f 66 20 74 69 74 6c 65 20 6f 72 20 69 74 65 6d |of title or item| 00009030 20 6e 61 6d 65 73 2c 20 69 6e 20 74 68 65 20 72 | names, in the r| 00009040 61 6e 67 65 20 31 2d 31 32 0a 69 74 65 6d 24 20 |ange 1-12.item$ | 00009050 20 20 20 3a 20 4e 61 6d 65 20 6f 66 20 74 68 65 | : Name of the| 00009060 20 6d 65 6e 75 20 69 74 65 6d 2c 20 31 2d 31 32 | menu item, 1-12| 00009070 20 63 68 61 72 61 63 74 65 72 73 2e 0a 73 75 62 | characters..sub| 00009080 6d 65 6e 75 25 20 3a 20 2d 31 20 69 66 20 6e 6f |menu% : -1 if no| 00009090 20 73 75 62 6d 65 6e 75 20 6f 72 20 61 20 77 69 | submenu or a wi| 000090a0 6e 64 6f 77 20 68 61 6e 64 6c 65 20 66 6f 72 20 |ndow handle for | 000090b0 61 20 64 69 61 6c 6f 67 75 65 20 62 6f 78 0a 66 |a dialogue box.f| 000090c0 6c 61 67 25 20 20 20 20 3a 20 75 73 65 20 74 68 |lag% : use th| 000090d0 65 20 73 79 6d 62 6f 6c 20 4c 41 53 54 20 74 6f |e symbol LAST to| 000090e0 20 64 65 63 6c 61 72 65 20 74 68 65 20 6c 61 73 | declare the las| 000090f0 74 20 6d 65 6e 75 20 69 74 65 6d 2e 0a 0a 32 37 |t menu item...27| 00009100 20 42 69 74 20 46 69 78 65 64 20 50 6f 69 6e 74 | Bit Fixed Point| 00009110 20 46 75 6e 63 74 69 6f 6e 73 0a 2d 2d 2d 2d 2d | Functions.-----| 00009120 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00009130 2d 2d 2d 2d 2d 2d 2d 0a 54 68 65 73 65 20 66 75 |-------.These fu| 00009140 6e 63 74 69 6f 6e 73 20 73 75 70 70 6f 72 74 20 |nctions support | 00009150 74 68 65 20 6d 75 6c 74 69 70 6c 69 63 61 74 69 |the multiplicati| 00009160 6f 6e 20 6f 66 20 6e 75 6d 62 65 72 73 20 77 68 |on of numbers wh| 00009170 69 63 68 20 68 61 76 65 20 32 37 20 62 69 6e 61 |ich have 27 bina| 00009180 72 79 0a 70 6c 61 63 65 73 2c 20 74 68 61 74 20 |ry.places, that | 00009190 69 73 20 6e 75 6d 62 65 72 73 20 69 6e 20 74 68 |is numbers in th| 000091a0 65 20 66 6f 72 6d 61 74 3a 20 73 69 67 6e 20 62 |e format: sign b| 000091b0 69 74 2c 20 34 20 62 69 74 20 77 68 6f 6c 65 20 |it, 4 bit whole | 000091c0 6e 75 6d 62 65 72 2c 20 61 6e 0a 69 6d 61 67 69 |number, an.imagi| 000091d0 6e 61 72 79 20 62 69 6e 61 72 79 20 70 6f 69 6e |nary binary poin| 000091e0 74 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 32 37 |t followed by 27| 000091f0 20 62 69 74 73 2e 20 54 68 69 73 20 70 72 6f 76 | bits. This prov| 00009200 69 64 65 73 20 73 75 70 70 6f 72 74 20 66 6f 72 |ides support for| 00009210 0a 6e 75 6d 62 65 72 73 20 69 6e 20 74 68 65 20 |.numbers in the | 00009220 72 61 6e 67 65 20 2b 2f 2d 20 31 36 20 77 69 74 |range +/- 16 wit| 00009230 68 20 38 20 64 65 63 69 6d 61 6c 20 70 6c 61 63 |h 8 decimal plac| 00009240 65 73 20 62 75 74 20 73 74 69 6c 6c 20 75 73 69 |es but still usi| 00009250 6e 67 20 69 6e 74 65 67 65 72 0a 61 72 69 74 68 |ng integer.arith| 00009260 6d 65 74 69 63 20 28 77 68 69 63 68 20 69 73 20 |metic (which is | 00009270 6d 75 63 68 20 66 61 73 74 65 72 20 74 68 61 6e |much faster than| 00009280 20 74 68 65 20 66 6c 6f 61 74 69 6e 67 20 70 6f | the floating po| 00009290 69 6e 74 20 65 6d 75 6c 61 74 6f 72 29 2e 20 46 |int emulator). F| 000092a0 6f 72 0a 6d 75 6c 74 69 70 6c 79 69 6e 67 20 79 |or.multiplying y| 000092b0 6f 75 20 73 68 6f 75 6c 64 20 6d 61 6b 65 20 61 |ou should make a| 000092c0 20 70 72 65 2d 63 68 65 63 6b 20 74 6f 20 65 6e | pre-check to en| 000092d0 73 75 72 65 20 74 68 65 20 72 65 73 75 6c 74 20 |sure the result | 000092e0 64 6f 65 73 20 6e 6f 74 20 65 78 63 65 65 64 0a |does not exceed.| 000092f0 31 36 2e 0a 0a 54 6f 20 67 65 74 20 6e 75 6d 62 |16...To get numb| 00009300 65 72 73 20 69 6e 74 6f 20 74 68 69 73 20 66 6f |ers into this fo| 00009310 72 6d 61 74 20 75 73 65 20 3a 20 20 20 44 43 44 |rmat use : DCD| 00009320 20 66 6c 6f 61 74 3c 3c 32 37 0a 4e 75 6d 62 65 | float<<27.Numbe| 00009330 72 73 20 69 6e 20 74 68 69 73 20 66 6f 72 6d 61 |rs in this forma| 00009340 74 20 63 61 6e 20 62 65 20 61 64 64 65 64 20 61 |t can be added a| 00009350 6e 64 20 73 75 62 74 72 61 63 74 65 64 20 75 73 |nd subtracted us| 00009360 69 6e 67 20 74 68 65 20 6e 6f 72 6d 61 6c 20 41 |ing the normal A| 00009370 44 44 20 61 6e 64 0a 53 55 42 20 69 6e 73 74 72 |DD and.SUB instr| 00009380 75 63 74 69 6f 6e 73 2e 20 41 6c 74 65 72 6e 61 |uctions. Alterna| 00009390 74 69 76 65 6c 79 2c 20 75 73 65 20 74 68 65 20 |tively, use the | 000093a0 66 6f 6c 6c 6f 77 69 6e 67 20 46 50 20 69 6e 73 |following FP ins| 000093b0 74 72 75 63 74 69 6f 6e 73 3a 0a 20 20 20 20 20 |tructions:. | 000093c0 20 4d 4f 56 20 52 30 2c 23 31 3c 3c 32 37 20 20 | MOV R0,#1<<27 | 000093d0 20 20 20 20 20 20 20 20 20 20 20 47 65 74 20 6d | Get m| 000093e0 75 6c 74 69 70 6c 69 65 72 0a 20 20 20 20 20 20 |ultiplier. | 000093f0 46 4e 66 70 28 22 46 4c 54 20 46 30 2c 52 30 22 |FNfp("FLT F0,R0"| 00009400 29 20 20 20 20 20 20 20 20 20 54 6f 20 46 50 20 |) To FP | 00009410 66 6f 72 6d 61 74 0a 20 20 20 20 20 20 46 4e 66 |format. FNf| 00009420 70 28 22 4c 44 46 44 20 46 31 2c 78 22 29 20 20 |p("LDFD F1,x") | 00009430 20 20 20 20 20 20 20 47 65 74 20 78 20 76 61 6c | Get x val| 00009440 75 65 0a 20 20 20 20 20 20 46 4e 66 70 28 22 4d |ue. FNfp("M| 00009450 55 46 44 20 46 32 2c 46 31 2c 46 30 22 29 20 20 |UFD F2,F1,F0") | 00009460 20 20 20 6d 75 6c 74 69 70 6c 79 20 62 79 20 31 | multiply by 1| 00009470 3c 3c 32 37 0a 20 20 20 20 20 20 46 4e 66 70 28 |<<27. FNfp(| 00009480 22 46 49 58 20 52 31 2c 46 32 22 29 20 20 20 20 |"FIX R1,F2") | 00009490 20 20 20 20 20 52 31 3d 78 20 69 6e 20 69 6e 74 | R1=x in int| 000094a0 65 67 65 72 20 66 6f 72 6d 61 74 20 74 6f 20 32 |eger format to 2| 000094b0 37 20 62 69 6e 61 72 79 20 70 6c 61 63 65 73 0a |7 binary places.| 000094c0 0a 46 4e 6d 33 32 5f 32 37 28 52 64 2c 52 6e 2c |.FNm32_27(Rd,Rn,| 000094d0 52 6d 2c 77 6f 72 6b 29 20 20 20 20 52 64 3d 52 |Rm,work) Rd=R| 000094e0 6e 2a 52 6d 0a 43 61 6c 63 75 6c 61 74 65 73 20 |n*Rm.Calculates | 000094f0 52 64 3d 52 6e 2a 52 6d 20 74 6f 20 32 37 20 62 |Rd=Rn*Rm to 27 b| 00009500 69 6e 61 72 79 20 70 6c 61 63 65 20 61 63 63 75 |inary place accu| 00009510 72 61 63 79 2e 0a 52 64 2c 20 52 6e 20 61 6e 64 |racy..Rd, Rn and| 00009520 20 52 6d 20 4d 55 53 54 20 62 65 20 64 69 66 66 | Rm MUST be diff| 00009530 65 72 65 6e 74 20 72 65 67 69 73 74 65 72 73 20 |erent registers | 00009540 61 6e 64 20 6e 6f 74 20 61 20 77 6f 72 6b 20 72 |and not a work r| 00009550 65 67 69 73 74 65 72 2e 20 54 68 69 73 0a 66 75 |egister. This.fu| 00009560 6e 63 74 69 6f 6e 20 72 65 71 75 69 72 65 73 20 |nction requires | 00009570 74 68 65 20 75 73 65 20 6f 66 20 34 20 77 6f 72 |the use of 4 wor| 00009580 6b 20 72 65 67 69 73 74 65 72 73 20 6e 75 6d 62 |k registers numb| 00009590 65 72 65 64 20 66 72 6f 6d 20 77 6f 72 6b 20 74 |ered from work t| 000095a0 6f 20 77 6f 72 6b 2b 33 2e 0a 53 65 74 74 69 6e |o work+3..Settin| 000095b0 67 20 77 6f 72 6b 20 74 6f 20 31 31 20 77 69 6c |g work to 11 wil| 000095c0 6c 20 75 73 65 20 52 31 31 2c 52 31 32 2c 52 31 |l use R11,R12,R1| 000095d0 33 2c 52 31 34 20 77 68 69 63 68 20 61 72 65 20 |3,R14 which are | 000095e0 6f 66 74 65 6e 20 27 66 72 65 65 27 20 69 6e 20 |often 'free' in | 000095f0 6d 61 74 68 73 0a 72 6f 75 74 69 6e 65 73 20 2d |maths.routines -| 00009600 20 6a 75 73 74 20 72 65 6d 65 6d 62 65 72 20 74 | just remember t| 00009610 6f 20 73 61 76 65 20 26 20 72 65 73 74 6f 72 65 |o save & restore| 00009620 20 52 31 33 20 26 20 52 31 34 20 6f 72 20 79 6f | R13 & R14 or yo| 00009630 75 72 20 70 72 6f 67 72 61 6d 20 77 69 6c 6c 0a |ur program will.| 00009640 63 72 61 73 68 20 74 65 72 72 69 62 6c 79 21 0a |crash terribly!.| 00009650 0a 46 4e 73 71 72 33 32 5f 32 37 28 52 64 2c 52 |.FNsqr32_27(Rd,R| 00009660 6d 2c 77 6b 31 2c 77 6b 32 29 20 20 52 64 3d 52 |m,wk1,wk2) Rd=R| 00009670 6d 2a 52 6d 0a 54 68 69 73 20 73 71 75 61 72 65 |m*Rm.This square| 00009680 73 20 61 20 6e 75 6d 62 65 72 2c 20 61 6e 64 20 |s a number, and | 00009690 69 73 20 66 61 73 74 65 72 20 74 68 61 6e 20 46 |is faster than F| 000096a0 4e 6d 33 32 5f 32 37 2e 20 77 6b 31 20 61 6e 64 |Nm32_27. wk1 and| 000096b0 20 77 6b 32 20 61 72 65 20 32 20 77 6f 72 6b 0a | wk2 are 2 work.| 000096c0 72 65 67 69 73 74 65 72 73 2e 0a 0a 46 4e 6d 31 |registers...FNm1| 000096d0 36 5f 32 37 28 52 64 2c 52 6e 2c 52 6d 2c 77 6f |6_27(Rd,Rn,Rm,wo| 000096e0 72 6b 29 20 20 20 20 52 64 3d 52 6e 2a 52 6d 0a |rk) Rd=Rn*Rm.| 000096f0 54 68 69 73 20 69 73 20 61 20 68 69 67 68 20 73 |This is a high s| 00009700 70 65 65 64 20 76 65 72 73 69 6f 6e 20 6f 66 20 |peed version of | 00009710 46 4e 6d 33 32 5f 32 37 20 77 68 69 63 68 20 70 |FNm32_27 which p| 00009720 65 72 66 6f 72 6d 73 20 74 68 65 20 63 61 6c 63 |erforms the calc| 00009730 75 6c 61 74 69 6f 6e 20 74 6f 0a 31 33 20 62 69 |ulation to.13 bi| 00009740 6e 61 72 79 20 70 6c 61 63 65 20 61 63 63 75 72 |nary place accur| 00009750 61 63 79 20 28 34 20 64 65 63 69 6d 61 6c 20 70 |acy (4 decimal p| 00009760 6c 61 63 65 73 29 2e 20 52 64 2c 52 6e 20 61 6e |laces). Rd,Rn an| 00009770 64 20 52 6d 20 4d 55 53 54 20 62 65 20 64 69 66 |d Rm MUST be dif| 00009780 66 65 72 65 6e 74 0a 72 65 67 69 73 74 65 72 73 |ferent.registers| 00009790 2e 20 52 6e 20 26 20 52 6d 20 63 61 6e 20 61 6c |. Rn & Rm can al| 000097a0 73 6f 20 62 65 20 61 20 77 6f 72 6b 20 72 65 67 |so be a work reg| 000097b0 69 73 74 65 72 20 69 6e 20 77 68 69 63 68 20 63 |ister in which c| 000097c0 61 73 65 20 74 68 65 79 20 77 69 6c 6c 20 62 65 |ase they will be| 000097d0 0a 63 6f 72 72 75 70 74 65 64 2e 20 54 68 69 73 |.corrupted. This| 000097e0 20 66 75 6e 63 74 69 6f 6e 20 75 73 65 73 20 74 | function uses t| 000097f0 77 6f 20 77 6f 72 6b 20 72 65 67 69 73 74 65 72 |wo work register| 00009800 73 20 2d 20 77 6f 72 6b 20 26 20 77 6f 72 6b 2b |s - work & work+| 00009810 31 2e 0a 0a 46 4e 73 71 72 31 36 5f 32 37 28 52 |1...FNsqr16_27(R| 00009820 64 2c 52 6d 2c 77 6b 31 29 20 20 52 64 3d 52 6d |d,Rm,wk1) Rd=Rm| 00009830 2a 52 6d 0a 54 68 69 73 20 73 71 75 61 72 65 73 |*Rm.This squares| 00009840 20 61 20 6e 75 6d 62 65 72 2c 20 61 6e 64 20 69 | a number, and i| 00009850 73 20 66 61 73 74 65 72 20 74 68 61 6e 20 46 4e |s faster than FN| 00009860 6d 31 36 5f 32 37 2e 20 77 6b 31 20 69 73 20 61 |m16_27. wk1 is a| 00009870 20 77 6f 72 6b 20 72 65 67 69 73 74 65 72 2e 0a | work register..| 00009880 0a 46 4e 64 69 76 66 70 28 52 64 2c 52 6e 2c 52 |.FNdivfp(Rd,Rn,R| 00009890 6d 2c 77 6f 72 6b 2c 70 6c 61 63 65 73 29 20 20 |m,work,places) | 000098a0 52 64 3d 52 6e 2f 52 6d 0a 54 68 69 73 20 64 69 |Rd=Rn/Rm.This di| 000098b0 76 69 64 65 73 20 32 20 6e 75 6d 62 65 72 73 2e |vides 2 numbers.| 000098c0 20 77 6f 72 6b 20 73 70 65 63 69 66 69 65 73 20 | work specifies | 000098d0 74 68 65 20 31 73 74 20 6f 66 20 66 6f 75 72 20 |the 1st of four | 000098e0 77 6f 72 6b 20 72 65 67 69 73 74 65 72 73 2e 20 |work registers. | 000098f0 52 64 2c 52 6e 0a 61 6e 64 20 52 6d 20 4d 55 53 |Rd,Rn.and Rm MUS| 00009900 54 20 62 65 20 64 69 66 66 65 72 65 6e 74 20 72 |T be different r| 00009910 65 67 69 73 74 65 72 73 2e 20 70 6c 61 63 65 73 |egisters. places| 00009920 20 69 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f | is the number o| 00009930 66 20 62 69 6e 61 72 79 20 70 6c 61 63 65 73 20 |f binary places | 00009940 69 6e 0a 74 68 65 20 73 6f 75 72 63 65 20 6e 75 |in.the source nu| 00009950 6d 62 65 72 20 65 67 2e 20 32 37 20 66 6f 72 20 |mber eg. 27 for | 00009960 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20 77 69 |compatibility wi| 00009970 74 68 20 74 68 65 20 61 62 6f 76 65 20 66 75 6e |th the above fun| 00009980 63 74 69 6f 6e 73 2e 20 54 68 65 72 65 0a 69 73 |ctions. There.is| 00009990 20 6e 6f 20 63 68 65 63 6b 20 66 6f 72 20 6f 76 | no check for ov| 000099a0 65 72 66 6c 6f 77 2c 20 77 68 69 6c 73 74 20 64 |erflow, whilst d| 000099b0 69 76 69 64 69 6e 67 20 62 79 20 30 20 69 73 20 |ividing by 0 is | 000099c0 74 68 65 20 73 61 6d 65 20 61 73 20 64 69 76 69 |the same as divi| 000099d0 64 69 6e 67 20 62 79 20 31 2e 0a 0a 46 50 45 4c |ding by 1...FPEL| 000099e0 69 62 0a 2d 2d 2d 2d 2d 2d 0a 59 6f 75 20 63 61 |ib.------.You ca| 000099f0 6e 20 75 73 65 20 74 68 65 73 65 20 66 75 6e 63 |n use these func| 00009a00 74 69 6f 6e 73 20 69 6e 73 74 65 61 64 20 6f 66 |tions instead of| 00009a10 20 6e 6f 72 6d 61 6c 20 66 6c 6f 61 74 69 6e 67 | normal floating| 00009a20 20 70 6f 69 6e 74 20 69 6e 73 74 72 75 63 74 69 | point instructi| 00009a30 6f 6e 73 20 74 6f 0a 67 65 74 20 6d 75 63 68 20 |ons to.get much | 00009a40 6e 65 65 64 65 64 20 73 70 65 65 64 20 69 6d 70 |needed speed imp| 00009a50 72 6f 76 65 6d 65 6e 74 20 28 74 68 65 20 46 50 |rovement (the FP| 00009a60 45 20 69 73 6e 27 74 20 61 6e 79 20 66 61 73 74 |E isn't any fast| 00009a70 65 72 20 69 6e 20 41 73 73 65 6d 62 6c 65 72 21 |er in Assembler!| 00009a80 29 2e 0a 53 65 65 20 41 73 6d 2e 53 61 6d 70 4e |)..See Asm.SampN| 00009a90 65 77 74 6f 6e 20 66 6f 72 20 61 6e 20 65 78 61 |ewton for an exa| 00009aa0 6d 70 6c 65 20 6f 66 20 75 73 61 67 65 2e 0a 0a |mple of usage...| 00009ab0 41 73 73 65 6d 62 6c 65 72 20 4e 6f 74 65 73 0a |Assembler Notes.| 00009ac0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a |===============.| 00009ad0 52 31 33 20 73 68 6f 75 6c 64 20 62 65 20 70 72 |R13 should be pr| 00009ae0 65 73 65 72 76 65 64 20 61 74 20 61 6c 6c 20 74 |eserved at all t| 00009af0 69 6d 65 73 2c 20 61 6e 64 20 6d 75 73 74 20 62 |imes, and must b| 00009b00 65 20 76 61 6c 69 64 20 77 68 65 6e 20 63 61 6c |e valid when cal| 00009b10 6c 69 6e 67 20 74 68 65 0a 69 6e 74 65 72 66 61 |ling the.interfa| 00009b20 63 65 20 72 6f 75 74 69 6e 65 73 2e 0a 0a 54 6f |ce routines...To| 00009b30 20 67 65 74 20 73 74 61 72 74 65 64 20 69 74 20 | get started it | 00009b40 69 73 20 61 64 76 69 73 65 61 62 6c 65 20 74 6f |is adviseable to| 00009b50 20 74 72 61 6e 73 66 65 72 20 61 20 72 65 61 64 | transfer a read| 00009b60 79 20 77 6f 72 6b 69 6e 67 20 70 72 6f 67 72 61 |y working progra| 00009b70 6d 2e 20 4b 65 65 70 20 69 74 0a 73 69 6d 70 6c |m. Keep it.simpl| 00009b80 65 20 61 74 20 66 69 72 73 74 2c 20 69 65 2e 20 |e at first, ie. | 00009b90 6a 75 73 74 20 68 61 6e 64 6c 65 20 74 68 65 20 |just handle the | 00009ba0 66 70 6c 6f 74 20 63 61 6c 6c 20 74 6f 20 62 75 |fplot call to bu| 00009bb0 69 6c 64 20 61 6e 20 69 6d 61 67 65 2e 20 49 74 |ild an image. It| 00009bc0 20 69 73 0a 6c 69 6b 65 6c 79 20 79 6f 75 20 77 | is.likely you w| 00009bd0 69 6c 6c 20 68 61 76 65 20 74 6f 20 72 65 6d 6f |ill have to remo| 00009be0 76 65 20 68 61 72 64 20 63 6f 64 65 64 20 69 6d |ve hard coded im| 00009bf0 61 67 65 20 73 69 7a 65 20 76 61 6c 75 65 73 20 |age size values | 00009c00 28 6e 75 6d 62 65 72 20 6f 66 20 78 2f 79 0a 70 |(number of x/y.p| 00009c10 69 78 65 6c 73 29 20 61 6e 64 20 75 73 65 20 74 |ixels) and use t| 00009c20 68 65 20 70 61 73 73 65 64 20 76 61 6c 75 65 73 |he passed values| 00009c30 2e 20 41 6c 73 6f 20 79 6f 75 20 77 69 6c 6c 20 |. Also you will | 00009c40 70 72 6f 62 61 62 6c 79 20 68 61 76 65 20 74 6f |probably have to| 00009c50 20 63 6f 6e 76 65 72 74 0a 73 6f 6d 65 20 42 41 | convert.some BA| 00009c60 53 49 43 20 63 6f 64 65 20 74 68 61 74 20 70 65 |SIC code that pe| 00009c70 72 66 6f 72 6d 73 20 69 6e 69 74 69 61 6c 20 73 |rforms initial s| 00009c80 65 74 20 75 70 20 6f 66 20 76 61 6c 75 65 73 20 |et up of values | 00009c90 69 6e 74 6f 20 46 50 20 61 73 73 65 6d 62 6c 65 |into FP assemble| 00009ca0 72 2e 0a 20 0a 41 64 64 72 65 73 73 65 73 3a 20 |r.. .Addresses: | 00009cb0 73 74 61 74 65 6d 65 6e 74 73 20 6f 66 20 74 68 |statements of th| 00009cc0 65 20 66 6f 72 6d 20 20 20 20 20 20 2e 61 64 64 |e form .add| 00009cd0 72 65 73 73 20 20 20 20 44 43 44 20 6c 61 62 65 |ress DCD labe| 00009ce0 6c 0a 77 69 6c 6c 20 6f 6e 6c 79 20 61 73 73 65 |l.will only asse| 00009cf0 6d 62 6c 65 20 61 20 72 65 6c 61 74 69 76 65 20 |mble a relative | 00009d00 61 64 64 72 65 73 73 2c 20 74 68 61 74 20 69 73 |address, that is| 00009d10 20 74 68 65 20 6f 66 66 73 65 74 20 66 72 6f 6d | the offset from| 00009d20 20 74 68 65 20 73 74 61 72 74 20 6f 66 0a 74 68 | the start of.th| 00009d30 65 20 6d 6f 64 75 6c 65 2c 20 64 75 65 20 74 6f |e module, due to| 00009d40 20 74 68 65 20 75 73 65 20 6f 66 20 6f 66 66 73 | the use of offs| 00009d50 65 74 20 61 73 73 65 6d 62 6c 79 2e 20 4f 6e 65 |et assembly. One| 00009d60 20 77 61 79 20 74 6f 20 6f 76 65 72 63 6f 6d 65 | way to overcome| 00009d70 20 74 68 69 73 0a 70 72 6f 62 6c 65 6d 20 69 73 | this.problem is| 00009d80 20 74 6f 20 75 73 65 20 74 68 65 20 66 6f 6c 6c | to use the foll| 00009d90 6f 77 69 6e 67 20 63 6f 64 65 20 69 6e 73 74 65 |owing code inste| 00009da0 61 64 3a 0a 0a 20 20 20 20 20 20 20 20 20 41 44 |ad:.. AD| 00009db0 52 20 52 30 2c 70 6f 69 6e 74 65 72 20 20 20 20 |R R0,pointer | 00009dc0 20 20 20 72 65 61 6c 20 61 64 64 72 65 73 73 20 | real address | 00009dd0 6f 66 20 70 6f 69 6e 74 65 72 0a 20 20 20 20 20 |of pointer. | 00009de0 20 20 20 20 4c 44 52 20 52 31 2c 70 6f 69 6e 74 | LDR R1,point| 00009df0 65 72 20 20 20 20 20 20 20 6f 66 66 73 65 74 20 |er offset | 00009e00 74 6f 20 6c 6f 63 61 74 69 6f 6e 20 72 65 71 75 |to location requ| 00009e10 69 72 65 64 0a 20 20 20 20 20 20 20 20 20 41 44 |ired. AD| 00009e20 44 20 52 30 2c 52 30 2c 52 31 20 20 20 20 20 20 |D R0,R0,R1 | 00009e30 20 20 20 72 65 61 6c 20 61 64 64 72 65 73 73 20 | real address | 00009e40 6f 66 20 6c 6f 63 61 74 69 6f 6e 20 72 65 71 75 |of location requ| 00009e50 69 72 65 64 0a 2e 70 6f 69 6e 74 65 72 20 44 43 |ired..pointer DC| 00009e60 44 20 6c 61 62 65 6c 2d 50 25 20 20 20 20 20 20 |D label-P% | 00009e70 20 20 20 6f 66 66 73 65 74 20 74 6f 20 6c 6f 63 | offset to loc| 00009e80 61 74 69 6f 6e 20 22 6c 61 62 65 6c 22 0a 0a 41 |ation "label"..A| 00009e90 6c 74 65 72 6e 61 74 69 76 65 6c 79 20 79 6f 75 |lternatively you| 00009ea0 20 63 6f 75 6c 64 20 63 61 6c 63 75 6c 61 74 65 | could calculate| 00009eb0 20 74 68 65 20 72 65 61 6c 20 61 64 64 72 65 73 | the real addres| 00009ec0 73 20 6f 66 20 74 68 65 20 73 74 61 72 74 20 6f |s of the start o| 00009ed0 66 20 79 6f 75 72 0a 6d 6f 64 75 6c 65 2c 20 74 |f your.module, t| 00009ee0 68 65 6e 20 61 64 64 20 74 68 69 73 20 76 61 6c |hen add this val| 00009ef0 75 65 20 74 6f 20 61 6c 6c 20 70 6f 69 6e 74 65 |ue to all pointe| 00009f00 72 20 63 6f 6e 73 74 61 6e 74 73 20 64 75 72 69 |r constants duri| 00009f10 6e 67 20 66 69 6e 69 74 0a 70 72 6f 63 65 73 73 |ng finit.process| 00009f20 69 6e 67 2e 0a 0a 44 65 62 75 67 67 69 6e 67 0a |ing...Debugging.| 00009f30 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 44 65 62 75 67 67 |---------.Debugg| 00009f40 69 6e 67 20 61 73 73 65 6d 62 6c 65 72 20 69 73 |ing assembler is| 00009f50 20 6e 65 76 65 72 20 65 61 73 79 2e 20 54 68 6f | never easy. Tho| 00009f60 73 65 20 77 69 74 68 20 61 63 63 65 73 73 20 74 |se with access t| 00009f70 6f 20 43 20 63 61 6e 20 75 73 65 20 74 68 65 0a |o C can use the.| 00009f80 73 75 70 70 6c 69 65 64 20 41 53 44 20 28 73 79 |supplied ASD (sy| 00009f90 6d 62 6f 6c 69 63 20 64 65 62 75 67 67 65 72 29 |mbolic debugger)| 00009fa0 20 74 6f 20 68 65 6c 70 20 2d 20 73 65 65 20 74 | to help - see t| 00009fb0 68 65 20 43 20 73 65 63 74 69 6f 6e 20 66 6f 72 |he C section for| 00009fc0 20 6e 6f 74 65 73 2e 0a 21 46 72 61 63 74 61 6c | notes..!Fractal| 00009fd0 20 70 72 6f 76 69 64 65 73 20 66 61 63 69 6c 69 | provides facili| 00009fe0 74 69 65 73 20 74 6f 20 61 73 73 69 73 74 20 69 |ties to assist i| 00009ff0 6e 20 64 65 62 75 67 67 69 6e 67 20 61 73 73 65 |n debugging asse| 0000a000 6d 62 6c 65 72 20 70 72 6f 67 72 61 6d 73 2e 0a |mbler programs..| 0000a010 0a 2d 64 65 62 75 67 0a 53 70 65 63 69 66 79 20 |.-debug.Specify | 0000a020 74 68 69 73 20 61 73 20 74 68 65 20 31 73 74 20 |this as the 1st | 0000a030 6f 70 74 69 6f 6e 20 6f 6e 20 74 68 65 20 66 72 |option on the fr| 0000a040 61 63 74 61 6c 20 72 75 6e 20 73 74 61 74 65 6d |actal run statem| 0000a050 65 6e 74 20 69 6e 20 21 52 75 6e 2e 20 41 74 0a |ent in !Run. At.| 0000a060 73 74 61 72 74 20 75 70 20 74 69 6d 65 20 61 20 |start up time a | 0000a070 66 69 6c 65 20 63 61 6c 6c 65 64 20 44 65 62 75 |file called Debu| 0000a080 67 5f 49 6e 66 6f 20 77 69 6c 6c 20 62 65 20 77 |g_Info will be w| 0000a090 72 69 74 74 65 6e 20 69 6e 20 74 68 65 20 21 46 |ritten in the !F| 0000a0a0 72 61 63 74 61 6c 0a 64 69 72 65 63 74 6f 72 79 |ractal.directory| 0000a0b0 2e 20 49 74 20 77 69 6c 6c 20 63 6f 6e 74 61 69 |. It will contai| 0000a0c0 6e 20 74 68 65 20 61 64 64 72 65 73 73 65 73 20 |n the addresses | 0000a0d0 6f 66 20 61 6c 6c 20 6c 6f 61 64 65 64 20 66 69 |of all loaded fi| 0000a0e0 6c 65 73 2c 20 66 72 61 63 74 61 6c 0a 66 75 6e |les, fractal.fun| 0000a0f0 63 74 69 6f 6e 20 64 65 66 69 6e 69 74 69 6f 6e |ction definition| 0000a100 73 20 61 6e 64 20 65 6e 74 72 79 20 70 6f 69 6e |s and entry poin| 0000a110 74 73 2e 0a 0a 21 46 72 61 63 74 61 6c 20 77 69 |ts...!Fractal wi| 0000a120 6c 6c 20 61 6c 77 61 79 73 20 74 72 61 70 20 61 |ll always trap a| 0000a130 6c 6c 20 65 72 72 6f 72 73 20 61 6e 64 20 64 69 |ll errors and di| 0000a140 73 70 6c 61 79 20 61 6e 20 65 72 72 6f 72 20 62 |splay an error b| 0000a150 6f 78 20 61 6c 6c 6f 77 69 6e 67 20 79 6f 75 0a |ox allowing you.| 0000a160 74 6f 20 63 61 6e 63 65 6c 20 6f 72 20 74 6f 20 |to cancel or to | 0000a170 65 6e 74 65 72 20 61 20 64 65 62 75 67 20 65 6e |enter a debug en| 0000a180 76 69 72 6f 6e 6d 65 6e 74 20 28 63 6c 69 63 6b |vironment (click| 0000a190 20 43 61 6e 63 65 6c 29 2e 0a 0a 49 66 20 79 6f | Cancel)...If yo| 0000a1a0 75 20 63 6c 69 63 6b 20 43 61 6e 63 65 6c 20 21 |u click Cancel !| 0000a1b0 46 72 61 63 74 61 6c 20 64 69 73 70 6c 61 79 73 |Fractal displays| 0000a1c0 20 74 68 65 20 65 72 72 6f 72 20 6d 65 73 73 61 | the error messa| 0000a1d0 67 65 20 61 6e 64 20 74 68 65 20 72 65 67 69 73 |ge and the regis| 0000a1e0 74 65 72 73 20 61 74 0a 74 68 65 20 74 69 6d 65 |ters at.the time| 0000a1f0 20 6f 66 20 61 62 65 6e 64 2e 20 4e 6f 74 65 20 | of abend. Note | 0000a200 74 68 61 74 20 74 68 65 20 50 43 2f 52 31 35 20 |that the PC/R15 | 0000a210 69 73 20 75 73 75 61 6c 6c 79 20 32 20 69 6e 73 |is usually 2 ins| 0000a220 74 72 75 63 74 69 6f 6e 73 20 70 61 73 74 20 74 |tructions past t| 0000a230 68 65 0a 6f 6e 65 20 74 68 61 74 20 66 61 69 6c |he.one that fail| 0000a240 65 64 2c 20 6f 72 20 31 20 69 66 20 61 20 46 50 |ed, or 1 if a FP| 0000a250 20 69 6e 73 74 72 75 63 74 69 6f 6e 20 77 61 73 | instruction was| 0000a260 20 69 6e 20 65 72 72 6f 72 2e 20 59 6f 75 20 63 | in error. You c| 0000a270 61 6e 20 65 6e 74 65 72 20 61 6e 79 20 4f 53 0a |an enter any OS.| 0000a280 63 6f 6d 6d 61 6e 64 73 20 61 74 20 74 68 65 20 |commands at the | 0000a290 70 72 6f 6d 70 74 20 2d 20 74 79 70 69 63 61 6c |prompt - typical| 0000a2a0 6c 79 20 74 68 65 73 65 20 77 6f 75 6c 64 20 62 |ly these would b| 0000a2b0 65 20 4d 45 4d 4f 52 59 20 61 6e 64 20 4d 45 4d |e MEMORY and MEM| 0000a2c0 4f 52 59 49 20 74 6f 0a 63 68 65 63 6b 20 6f 75 |ORYI to.check ou| 0000a2d0 74 20 79 6f 75 72 20 70 72 6f 67 72 61 6d 20 61 |t your program a| 0000a2e0 6e 64 20 64 61 74 61 20 61 72 65 61 73 2e 20 45 |nd data areas. E| 0000a2f0 6e 74 65 72 20 61 20 6e 75 6c 6c 20 6c 69 6e 65 |nter a null line| 0000a300 20 74 6f 20 65 78 69 74 20 62 61 63 6b 20 74 6f | to exit back to| 0000a310 20 74 68 65 0a 64 65 73 6b 74 6f 70 20 2d 20 79 | the.desktop - y| 0000a320 6f 75 20 77 69 6c 6c 20 67 65 74 20 43 27 73 20 |ou will get C's | 0000a330 69 6e 74 65 72 70 72 65 74 61 74 69 6f 6e 20 6f |interpretation o| 0000a340 66 20 65 76 65 6e 74 73 20 61 74 20 74 68 69 73 |f events at this| 0000a350 20 70 6f 69 6e 74 2e 0a 0a 2d 2d 2d 2d 2d 2d 2d | point...-------| 0000a360 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 0000a3a0 2d 2d 2d 0a 0a 4d 69 6b 65 20 43 75 72 6e 6f 77 |---..Mike Curnow| 0000a3b0 0a 33 30 20 42 6f 77 65 6e 20 44 72 69 76 65 2c |.30 Bowen Drive,| 0000a3c0 0a 57 65 73 74 20 44 75 6c 77 69 63 68 0a 4c 6f |.West Dulwich.Lo| 0000a3d0 6e 64 6f 6e 0a 53 45 32 31 20 38 50 4e 0a 30 38 |ndon.SE21 8PN.08| 0000a3e0 31 2d 36 37 30 2d 38 38 31 38 20 61 66 74 65 72 |1-670-8818 after| 0000a3f0 20 37 70 6d 0a | 7pm.| 0000a3f5