* ============================================================== * IMAGE PROCESSOR v2 ExtDump format information, by Dilwyn Jones * ============================================================== * Shows how to create a machine code extension to add a screen * dump to your specification outside of Image Processor 2. * * Created with "Computer One" assembler & editor, 4 August 1992 * Assembled version is DUMMY_ExtDump_bin on the disk, which you * can LRESPR prior to using Image Processor if required. * The assembled version on the disk is just 34 bytes long,if you * want to use RESPR/LBYTES/CALL instead:- * edmp = RESPR(34) * LBYTES flp1_DUMMY_ExtDump_cde,edmp * CALL edmp * * It is also possible to use QLiberator to compile a BASIC * program as an 'external' (using the $$external directive) * if preferred, although that will be a much larger piece * of compiled code (and slower), but simpler to write! * * This creates a BASIC extension called 'ExtDump' to act as * a 'dummy' extension (which simply does nothing except * preventing an error if no External Dump routine is * present! * * Image Processor 2 drives the external dump as a normal BASIC * extension and supplies 5 parameters, as follows: * ExtDump printer$,address,invert_or_not,passes%,mode% * (1) printer$ is a string with the printer channel device name * e.g. ser1 * (2) address is a floating point value with the address of the * base of the screen. This is actually a copy of the screen * in memory and will not be at the standard screen #1 or #2 * video memory locations. Although the address is sent as a * floating point number,it is recoverable as a long word by * fetching the parameter with CA.GTLIN to make life easier. * (3) Invert_or_not is sent as a floating point,but is actually * only ever 0 (don't invert) or 1 (invert, please), and can * be recovered as an integer if required.It would have been * easier if this was sent as an integer,but it's a floating * point value inside Image Processor, for internal reasons. * Although you should fetch this parameter value to be able * to get at the later parameters, you can ignore it and let * your routine 'do its own thing'. * (4) Passes% is sent as a 16 bit integer and is a value from 0 * to 9, with the number of passes of the print head to make * for each line of printing. As with (3) above, you can, if * you want to, ignore its value and let your routine do its * own thing. * (5) Mode% This is a 16 bit value containing either 4 (MODE 4) * or 8 (screen MODE 8), to tell you the screen mode of the * picture to be printed. You are advised not to ignore this * since it is not possible to check the screen mode of this * picture any other way (the QL 's current display mode is * not necessarily the same). At the time of writing this, * no other values are sent apart from 4 or 8 (e.g.Thor MODE * 12 is not supported), although this may change later if a * new display adaptor device becomes available and Image * Processor is altered to work with new display modes. * * CODE TO LINK IN BASIC EXTENSION:- move.w $110,a0 ;BP.INIT vector lea define,a1 ;pointer to definition table jsr (a0) ;call vector to link in extensions rts ; and go back to SuperBASIC define dc.w 1 ;approximately 1 new procedure dc.w extdmp-* ;where is it? dc.b 7,"ExtDump" ;name of the extension dc.w 0 ;end of new procedures list dc.w 0 ;approximately 0 functions dc.w 0 ;end of functions list * install your machine code here - all I've done is to put in an * instruction to clear register d0 to prevent an error report & an * immediate RTS instruction to jump back to the calling routines, * without doing anything except preventing an error by being here! extdmp clr.w d0 ;make sure of no error on return! rts ;go back to the calling program.