Home » Archimedes archive » Archimedes World » AW-1994-06-Disc2.adf » Disk2Jun94 » !AWJune94/Goodies/Zap/!Zap/Docs/E-Zapcalls
!AWJune94/Goodies/Zap/!Zap/Docs/E-Zapcalls
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 » Archimedes World » AW-1994-06-Disc2.adf » Disk2Jun94 |
Filename: | !AWJune94/Goodies/Zap/!Zap/Docs/E-Zapcalls |
Read OK: | ✔ |
File size: | 921A bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
************************************************************************* * >E-ZapCalls Documentation of Zap entry points (how to call Zap) * ************************************************************************* Zap does NOT have a SWI interface as it uses registers R8-R10 to point to data blocks, and these cannot be passed to swi's. To call Zap you will need to know the address of the Zap module workspace (ie it's private word). If you are an extension mode then this will be passed to you in R12 whenever you are called by one of your entry points. However, for the first call you make to Zap, when you add your module to it's list via Zap_Addmode, you will not know it. Then you should use OS_Module 18 to find it. Eg, SYS "XOS_Module",18,"Zap" TO R0,R1,R2,R3,workspace% Now, the first word in Zap's workspace contains the address of a table of Zap's entry points. Thus to call the entry point (documented below) at offset a% I suggest you use the basic macro given below. REM Call Zap at entry offset a% REM Entry: R0-R11=args R12=zap workspace REM Exit : R0-R11=returned values R12 preserved R14 corrupted DEF FNcall(a%) [OPTpass LDR R14,[R12] \ get start of zap table ADD R14,R14,#a% \ address of the sub STMFD R13!,{R14} \ save address on stack MOV R14,PC \ return address (with flags) LDMFD R13!,{PC} \ call the sub ]:="" The names of the routines are listed below in the order in which they appear in the table. Thus the first, Zap_AddMode, is at offset 0. The second, Zap_Claim is at offset 4, etc. These values are defined for you in the program E-Library. In general these routines have the following entry/exit conditions: \E R0-R11=arguments R12=Zap's workspace R13=user stack R14=return address \X R1-R13 preserved. R0 and Flags ALTERED. V set if error and R0=error block Thus if I write: \E R8 \X R1=3 Then I mean that on entry R8 was the window block pointer, R12 zap's workspace etc. And on exit that R1=3, R2-R13 saved, R0 corrupted etc. If I omit the \E or \X then I mean the standard entry/exit conditions hold. Errors should be passed back to Zap by the entry point through which the module was called (with V flag set and R0=error block pointer). Please note that for most calls, Zap must be paged in as the current task! This will be so if you are an extension mode. For a table/summary of the zap call names for including in your source, see the file E-Library. Zap_AddMode Adds a new Zap extension mode. This should be called after the module Zap is loaded, but before it starts up as a new task. Zap need not be paged in for this call. \E R0=address of table of entry points (see file E-Entry) Zap_Claim Claims a block of workspace in Zap's heap. \E R0=number of bytes required \X R0=pointer to the heap block Zap_Ensure Ensures a zap heap block is of a given size. \E R0=pointer to the heap block R1=number of bytes required. \X R0=new heap block pointer of (possibly moved) extended block. (An error is returned if the block couldn't be enlarged). Zap_Free Free a zap heap block after use. \E R0=pointer to heap block to free Zap_MoveBytes Moves a block of memory. The movement may be up or down by any amount. The data is ALWAYS preserved no matter where the destination is. This routine is highly optimised and should be used for moving any large block of data. Zap need not be paged in. \E R1=source byte address R2=destination byte address R3=number of bytes to move \X R1-R3 corrupted Zap_SplitBuffer This splits a file held in Zap at the indicated file offset ready for insertion/deletion of data. It also ensures that file buffer has a given amount of room free. See E-File. \E R0=file offset to split at (new value for f_splito) R1=minimum number of bytes to have free in the split R9=file to be split Zap_NewTxtStatus This updates the screen after changes are made to a file. This is very low level and you should use Zap_Command when possible. Zap_SaveTxtStatus should be called first. \E R0/R1 as for SaveTxtStatus and R2=new input caret offset. Zap_SaveTxtStatus This is a low level call used by Zap_DoCommand when changing a file. You should use Zap_Command/Zap_DoCommand in preference. Any file changes done using this call are NOT saved in the undo buffer. Ie, don't use it. To use it you specify the area of the file to be changed (R0 to R2) and the amount of the change (in R1). After making the change you use Zap_NewTxtStatus to update the screen. Set f_docom to 0 if in doubt. \E R0=file offset of first byte in file to be changed. R1=proposed signed change in size of file. R2=file offset of first character which is unchanged. f_docom,f_dolen,f_dodata must be set up - see e_prevline. Zap_Command This should be used for inserting/deleting/replacing data in a file. Its action is to call the mode entry point named e_command. See E-Entry. The mode's default action is then to call Zap_DoCommand. The commands are automatically placed in the undo buffer. If you are doing a sequence of insertions/deletions then please use Zap_Start/StopOp. Note that the cursor is automatically updated to the end of the inserted/deleted region. To prevent this, set b14 of f_flags, but you MUST restore it after the command returns. \E R0=command number: 1=insert 2=delete 3=replace (forward) 4=replace (backward). Add &10 if command is to be buffered in one block (and thus undone in one key press). R1=file offset for command to take place at. R2=number of bytes being inserted/deleted/replaced. R3=data to insert/replace with for commands 1,3,4. R8=window on file to be altered/0 if none. R9=file to be altered. NB If you don't specify the window then it won't know which mode to call, so this command will just call Zap_DoCommand. Zap_NewWinStatus This recreates a window after some display parameters have changed. Use Zap_SaveWinStatus before changing any parameters. \E R8/R9 Zap_SaveWinStatus This is used before changing any of the 'w_*' window parameters which would effect the display. See E-Window. The current cursor position, scroll offsets etc are saved. After changing the window parameters call Zap_NewWinStatus. Zap will do it's best to recreate the window with the new attributes, preserving the position of the cursor on screen. \E R8/R9 Zap_ReplaceArea This command replaces one area of text with another (not necessarily of the same length) by performing the minimum number of insertions/deletions/simple replaces using Zap_Command. In BASIC mode it also retokenises the line as necessary. This is used during a search and replace. See mode entry point e_replace. \E R1=file offset of original data R2=length of original data R3=address of replacement data R4=length of replacement data R8/R9 Zap_PlotCaret This command plots a caret in its new position automatically removing it from its old position. Ie, it just calls Zap_ClearCaret then Zap_SetCaret. \E R10=caret block Zap_ReflectCaret This acts as Zap_PlotCaret but only uses c_off, updating the c_loff and c_col offsets from this. Ie, it just calls Zap_UpdateCaret then Zap_PlotCaret. \E R10=caret block Zap_SetCaret This updates the area of the window containing the the caret given on entry. Hence it's effect is usually to draw the caret at it's (new) position. See E-Cursors. \E R10=caret block Zap_ClearCaret As for Zap_SetCaret, but it updates the area of the window where the caret last was (stored in the c_o* variables). Hence the caret is in effect removed from its old position. See E-Cursors. \E R10=caret block Zap_DoCommand This acts as Zap_Command but actually performs the action rather than calling the extension mode. \E As for Zap_Command. Zap_ShowCursor This call makes sure that a given cursor can be seen in its window (by changing the scroll offsets if necessary). It does not redraw the cursor in general (though changing the scroll offsets may cause it to be redrawn). \E R10=cursor block of cursor to show Zap_ReadVar Reads one of Zaps internal variables. See the file E-Vars for the numbers. \E R1=variable number. \X R0=variable value. Zap_WriteVar Writes one of zaps internal variables. See the file E-Vars for the numbers. \E R1=variable number R0=new value Zap_SaveFile This saves a file to disc (using f_name as the file name). The file may not actually be saved if a dialogue box is opened. (Eg: 'file is older than version on disc box'). Please note the value of R0 on exit! \E R8/R9 = window to save \X R0=0 => File has been saved to disc - you can now delete it. R0=-1 => File has not yet been saved - warning window opened / data transfer initiated. Zap_FillWords Fast word filling code. The block must be word aligned. Zap need not be paged in. \E R1=word to fill with. R2=address of memory to fill (word aligned). R3=number of bytes to fill (a multiple of 4). \X R0-R3 corrupted. Zap_UpdateLns This updates the line numbers column of a given window. This is usually done automatically by Zap_Command. This is used by the BASIC mode on a renumber. \E R0=first physical line to start from R8/R9 Zap_EachWindow This sub calls a given sub for each window on a given file. Each time it calls the sub pointed to in R10, it sets up R8 for that window. \E R0-R7=args to pass to the sub. R9=file (whose windows you are to call). R10=address of sub to call for each window on this file. The sub called has: \E R0-R7 as set up by you R8/R9 points to the given window \X Must preserve R1-R11 and VS on error etc. Zap_UpdateCaret This sub is called to update a caret position from a given file offset. Save the new offset of the caret in c_off. Call this. Then c_col, c_line, c_loff, c_width will be set up. See E-Cursors. \E R10=caret block Zap_GetWindState Updates the window block R8 (first few entries) by calling Wimp_GetWindowState. \E R8 Zap_StartOp Starts a sequence of operations. This should be used when performing a sequence of calls to Zap_Command. It causes all the file changes to be made with only ONE screen refresh, thus giving a much smoother update. After this has been called, all subsequent calls to Zap_Command before a Zap_StopOp call have their actions concatenated. When you call Zap_StopOp the screen is then updated. You MUST call Zap_StopOp before returning to Wimp_Poll. StartOp/ StopOp's can be nested to any depth (so only the last StopOp actually causes the screen to be updated). \E R9=file which will be operated on. Zap_StopOp Ends a StartOp/StopOp structure. \E R9=file which has been operated on. \X If VC on entry then R0 corrupted and R1-R11 preserved as usual. If VS on entry then error pointer in R0 and V flag status are also preserved. Zap_CallMode Calls a mode entry point. See E-Entry for a list of entry points. The mode called is the mode of the window given in R8. \E R0-R10=parameters R8 R11=mode entry point offset \X As for the given mode entry point. Zap_CallGivenMode Calls a mode entry point of a specified mode. \E R0-R9=parameters R10=mode number R11=entry point offset \X As for the given mode entry point. Zap_ReadMode Read the address of the mode entry point tables. Two pointers are returned. The first (R0) is a pointer to the mode table as stored in the extension module and documented in E-Entry. The second (R1) points to a table of actual addresses to be called, with entry points which were null in the original table converted to addresses and all offsets converted to addresses. In this table, each entry consists of 8 bytes. The first 4 bytes gives the address of the entry point, and the next 4 the value to pass in R11 when the entry point is called. This will obviously vary if some mode entry points are based on other modes. Thus the linked table has the form: e_module #0 module address, module workspace address e_title #8 title address, undefined e_author #16 author address, undefined e_basemode #24 basemode, undefined e_mode #32 mode number, undefined e_init #40 init code addr, value to pass in R11 e_menu #48 wimp menu data, undefined e_len #56 undefined, undefined e_postload #64 postload addr, value to pass in R11 and the rest as for e_postload. I reserved the right to use the undefined words in future. You can change the table entries pointer to in R1, but I don't advise it :-) \E R0=mode number. \X R0=pointer to unlinked table in modes module / <=0 if invalid R1=pointer to linked table in zaps workspace / <=0 if invalid Zap_FindFile Given the name of a file, this call produces a window on that file (loading it if necessary). Path is canonicalised before comparing with currently loaded files. \E R0=file name. \X R8/R9=window on that file. Zap_FindWindow Given a file block pointer of a file already loaded, this call produces a window block pointer of a window on that file (opening it if necessary). \E R9 \X R8 Zap_ConvWindOff Converts a window offset to a window block pointer. See E-Windows. \E R0=offset of a window in the window list /-ve \X R8/R9=window and file /0 Zap_ConvFileOff Converts a file offset to a file block pointer. See E-File. \E R0=offset of a file in the file list/-ve \X R9=pointers to the file block/0 Zap_GetWindOff Converts a window block pointer to a window offset. See E-Windows. \E R8=window block pointer/0 \X R0=offset in the window list/-ve Zap_GetFileOff Converts a file block pointer to a file offset. See E-File. \E R9=file block pointer/0 \X R0=offset in the file list/-ve Zap_GotoOffset This call causes the given cursor to jump to a given file offset, leaving a mark behind at the previous position. \E R0=offset to go to R8-R9=file R10=cursor Zap_JumptoOffset As for GotoOffset but no mark left on jumping. \E R0=offset to go to R8-R9=file R10=cursor Zap_FindOffset Given the (x,y) position in work area characters, finds the file offset of the 'nearest' point in the file. See E-Windows. \E R2=x column (inc margin) R3=y row (from top) \X R0=file offset R1=file offset of physical line start R2/R3 clipped Zap_NewFileTitle Update the titlebars of all windows on a given file. \E R9=file Zap_InsertString Inserts a string at the end of a buffer using Zap_Command. \E R0=zero terminated string R8/R9 Zap_CreateFile Creates an empty file, possibly changing the opt_flags/format via BIC 'mask' EOR 'eor' when creating it. See E-Flags, E-Windows. It calls Zap_CreateWindBlock and Zap_CreateFileBlock etc. \E R0=file type R1=flags mask R2=flags eor R3=format mask R4=format eor \X R8/R9=newly created file (with open window). Zap_NewLinkEntry Adds a new link entry to the f_links list. See E-File for description of the links list format. This is used by throwback. A new block is created if the file name does not match that of the previous link block, or the flags differ. The point of the links is that they are updated when changes are made to the indicated file. \E R0=data word (Ie file offset of link / line number of link depending on flags in R5). R1=filename (Of the file that R0 is an offset in). R4=file offset/-1 (Ie, offset in file list of the file named in R1 if the file is loaded, or -1 if you don't know if the file is loaded or not - usually safest to put as -1). R5=flags (as documented under f_links in E-File). R9=file to which the link should be added - ie this is the throwback buffer file as opposed to R1 which is the file giving the C program / file which was searched through. \X R0=0 if link added to last list entry/1 if new entry created. Zap_DefaultClick Calls the default mouse click handling code. See the entry point e_click. \E R1=depth (0=drag 1=click 2=double click etc) R2=x R3=y R4=buttons R8/R9 as for e_click. Zap_PutCaret Sets standard cursor editing mode and puts the cursor caret at a given file offset in a given file. \E R0=file offset R8/R9=file Zap_DiscardFile Kill a file and all windows on that file without prompting user. \E R9=file Zap_DeleteFile As for Zap_DiscardFile but prompts user if file altered etc. \E R9=file Zap_DiscardWindow Kill a window, and the file if auto-delete is on and this is the last window on that file. Don't prompt user. \E R8/R9 Zap_DeleteWindow As for Zap_DiscardWindow but prompts user if file altered etc. \E R8/R9 Zap_BuildMenu This is zaps 'variable length menu' building sub. See E-Menu for details on Zap's menu format. \E R0=menu name (max 12 chars) R1=address of sub to generate the menu entries R2=address of menu updating sub/0 if none (see E-Menu) R3=address of menu interpret sub for all entries/0 (see E-Menu) R4=menu width in chars R8-R11=values to call the sub in R1 with on the first call. \X R0=pointer to wimp menu structure The sub passed in R1 has the following conditions: \E R0=buffer for you to put the next menu entry in (48 bytes) R5=address of menu structure start } R6=address of current menu entry } you don't need these R7=address of current buf entry } R8-R11=as returned from last call \X R0=index for this entry/-1 if no more entries (see E-Menu) R1-R7 saved R8-R11=updated (ie for your own use). Zap_ClearSel Clears currently selected area. Zap_CreateFileBlock Creates a new file block with currently configured options. f_ptr etc are set up for you. See E-File. Use Zap_Install file to load a file. \E R0=size to make buffer R1=filename of buffer R2/R3=load/exec \X R9=new file block (with file filled with rubbish). Zap_CreateWindBlk Creates a new window block with currently configured options. Window is opened on the screen etc. \E R9=file window is to be on. \X R8=New window on this file. Zap_GetSel Find out what area is selected. \X If CS then no valid selection If CC then R1=file offset R2=selection length R8/R9=file Zap_InsertMark Insert a marker. \E R0=file offset of mark R8/R9 Zap_InstallFile Load a file into zap. \E R0=filename \X R0=window offset of created window / -1 if not loaded. Zap_NewMode Change the display mode of a window. \E R0=new mode number R8/R9 (R8=0 to change options mode) Zap_NewTitle Update the titlebar on a given window. See also Zap_NewFileTitle. \E R8/R9 Zap_CallBaseMode DO NOT USE THIS. This call is now obsolete. Use the call Zap_BaseMode instead. If you use this call it will appear to work perfectly until someone tries to use your mode as a base mode. When this happens an infinite loop occurs which I can't fix. The docs are kept for backwards compatibility. -------------------------------------------------------------------------- As for Zap_CallMode except it calls the base mode instead. The window in R8 identifies the current mode. The entry point called is that of the base mode associated to this current mode. Hence, it would be used by a mode to call a base mode entry point which the current mode has redefined. \E R0-R10=parameters R8 R11=mode entry point offset (see E-Entry) \X As for the given mode entry point. Zap_NewView As for Zap_CreateWindBlk but 'clones' a given window image. The cursor is not put in the window. \E R8/R9=window to clone from (R8=0 then don't clone) Zap_ReadSel Reads the currently selected region into a heap block. You must free the heap block when you have finished with the selection. \X R3=heap block with data and R2=length / R3=0 if no selection Zap_Replace Calls the zap file search and replace code using the current search string. \E R1=0 for selective/1 for global/2 for continue selective R3=start offset in file R4=direction (+1/-1) R8/R9 Zap_Search Calls the zap wildcard search code. \E R0=search string (as typed by user) R1=output type (0=cursor 1=tobuffer 2=none) R3=start offset in file R4=search direction (+1/-1) R5=object type (0=string 2=word 4=assembler instruction) R8/R9 \X If R1=0 or 2 on entry then R0=match offset/-ve if none. Zap_Select Selects a given region, and puts carets back to default mode. \E R2=start offset R3=end offset R8/R9 Zap_AlterSel As for Zap_Select but doesn't restore caret modes. \E R2=start offset R3=end offset R8/R9 Zap_OffLineCol Converts a file offset to and x,y coordinate in the window work area. See also Zap_FindOffset. See E-Windows. \E R0=file offset R8/R9 \X R0=start of line offset R2=column (inc margin) R3=row Zap_AddCommands Adds a table of commands to zap's list. Zap can currently cope with up to 16 tables of commands. This should be called when a module initialises as for Zap_AddMode. Zap need not be mapped into memory for this call. See E-Commands for the table format. \E R0=address of command table (R12=Zaps workspace). Zap_MiniWrite This call sends a stream of characters to the minibuffer. The minibuffer contents is changed but not updated on screen. However, if this call is used within a command, then the minibuffer will updated on screen automatically by Zap. Use Zap_MiniUpdate to force an update, but you shouldn't have to use this. The minibuffer takes the form: <prompt string><mark><user editable field>. The user cannot move the cursor before the 'invisible' mark. The string passed to Zap_MiniWrite may contain the following control codes: 0=string terminator 1=move cursor to mark (ctrl a) 2=8=move cursor back one character (ctrl b) 4=delete character after cursor (ctrl d) 5=move to end of string (ctrl e) 6=9=move cursor forward one character (ctrl f) 11=clear buffer from cursor (ctrl k) 12=clear whole buffer (ctrl l) 21=clear buffer from mark (ctrl u) 28=set mark to current cursor offset 127=delete character before cursor When a command with string parameter is called, R0 points to the user editable part of the string. \E R0=pointer to zero terminated string Zap_MiniPrompt This replaces the prompt string in the minibuffer with the given string. It's main use is for reason code R2=6 when a command with string parameter is called (see E-Commands). The buffer is not updated on screen (see Zap_MiniWrite). Unlike Zap_MiniWrite, the minibuffer cursor is not affected by this call (It remains the same number of characters after the mark). \E R0=new prompt string Zap_MiniUpdate This call updates the minibuffer on screen (if open). This will usually be done automatically by Zap. Zap_AddYankRegion This call adds a region to the cut/paste kill ring. The region you pass it is not copied so must be stable (eg in a heap block). \E R0=address of region + flags: b31 MUST BE SET (If clear then denotes an undo buffer ref). b30 If set, then after yanking this block, it will move onto the block before (ie, yanks many blocks at once). R1=block length (provided b31 of R0 is set). Zap_FindCommand This call converts a command name into a command address by looking it up in Zaps command tables. \E R0=command name terminated by <=32 or :,&," \X R0=command address / 0 if not found Zap_ProcessCommand (see also Zap_CommandString). This makes a call to a Zap command. It should be used for all calls to commands. You can find the address of a command via Zap_FindCommand. You may also call commands which may not have a name! For the entry/exit conditions of commands see the file E-Commands. If the value of R2 is undefined for a command call in the documentation in E-Command then you should set it to ZERO. Thus R2=0 always for argument types except strings. The command will be learnt if the learn flag is set and executed a number of times if the universal argument flag is set. The mode entry point e_aligncaret will be called before all commands with R2=0 on entry. A minibuffer will be opened if the command type is STRING but R0=0 (and R2=0). \E R0-R1=command inputs - dependent on command (see E-Command). Usually R0=pointer to command data R1=length of the data R2=Command action code with flags in top bits. b0-b27 =Action code to be passed on to the command. This is always 0 in standard command calls. b28-b31=Flags to tell Zap_ProcessCommand things. These are filtered out before R2 is passed to the command. b31=Set if command should not be learnt even if in learn mode. b30-b28 reserved. R7=command address (need not point to a command registered in a command table, but must conform to the specs in the file E-Command. Eg, [R7,#-4] must be the flags word). R8-R10=input cursor (or cursor you wish command to act on). \X R1-R13 preserved. If action code=0 on entry then R0=0 or -1 if minibuffer opened. If action code>0 on entry then R0=value in R0 when command returned. Zap_FindKeyEntry This finds the entry corresponding to a given key and keymap. You might use it for redefining the key for instance. The block pointed to on exit has the format: #0 Command address (or 0 if none - key is passed on to wimp) #4 Command parameter, this depends on the command flags b3-7. If these bits are: 0 => #4 undefined (should be 0) 1/2 => #4 is the byte or word to be added to the list to be passed to the command when the key is pressed. 3 => #4=address of string parameter /0 if minibuffer should be used. 4 => #4=address of the data block. \E R0=keymap number R1=zaps key number (0-&1FF) \X R0=entry for this key / 0 if keymap does not exist or key is out of range. Zap_FindLeafName This works out which part of a filename is the leafname. \E R0=filename pointer \X R0=pointer to the leafname part (within the filename). Zap_NewFileName Change the name of a given file. You may have to call Zap_NewFileTitle to update the titlebars (this will usually be done by Zap_SaveFile). \E R0=new file name R9 Zap_CheckFileName Decides whether a filename is a full path name (eg "ADFS::$.Wibble") or just the leaf name of a file (eg "Text1"). Should be used in conjunction with Zap_SaveFile as this will not save files without full path names. \E R0=filename \X R0=0 if it is a full path name / 1 otherwise Zap_GetCurrDir Returns current directory (of the temporary filing system) which should be used as default string in minibuffer file operations. On RISC OS 2, there is no way of reading the current directory so this call returns the root directory on the current disc (via OS_Args 0, OS_FSControl 33, OS_GBPB 5). On RISC OS 3, the current directory is read via OS_Args 0, OS_FSControl 33, and OS_FSControl 54. NB The block it is returned in is not stable over calls to Zap. You may call Zap_MiniWrite passing this block but should copy the string for other calls. \X R0=pointer to 256 byte buffer containing the directory name Zap_MiniWriteC Writes a single character to the minibuffer. See Zap_MiniWrite for the character codes. \E R0=character to insert in minibuffer. Zap_MiniClear Clears minibuffer contents without updating on screen. Resets marks etc. You should use this before using Zap_MiniStart. Zap_MiniStart This starts up the minibuffer. Do not use this call when writing a Zap command. Read the file E-Command to see how the minibuffer works in this case. You never need this call, Zap_ProcessCommand can open a minibuffer at any time if you feed it a string type command and R0=R2=0. \E R7=address of command to be called when return pressed in minibuffer. [R7,#-4] must contain the command flags word as documented in E-Command. R8/R9=window minibuffer should appear at. Zap_MiniEval This turns a string into a number via OS_EvaluateExpression. It is usually called near the start of a command which expects to find a number in the minibuffer. \E R0=string pointer (usually minibuffer pointer passed to you) \X R0=number stored in string/CS if not a valid number. Zap_CommandString (see also Zap_ProcessCommand) This call takes a command (or colon separated list of commands) in string form and executes them as typed. For example if R0="MODE 0" on entry then first of all a call to Zap_FindCommand will be made to find the address of the command "MODE" and then the command will be called via Zap_ProcessCommand with R2=0. \E R0=command string (zero terminated) Set b31 if you don't want the commands to be learnt if in learn mode. \X R0=0 or -1 if the minibuffer has been opened. Zap_ProcessKeys This entry point accesses Zap's main key handling sub so you can simulate keypresses. If you just wish to simulate one key press, then it is easier to use the next call. This call is for multiple keypresses and buffers the data as much as possible before it has to call a command. You must keep calling this command until it returns R0<0 (as it will do if you put R5=-1 on entry - it uses the R5=-1 call to execute the buffered data). \E R0=zap key number of next key to execute (if R5>=0) R5=-1 => there are no more keys to buffer (R0 not defined). 0-&1FF => wimp key number of key to send to Wimp_ProcessKey if no command is attached to the key. &200 => if Wimp_ProcessKey should never be called. R6=length of current buffering (set to 0 on first call) R7=command currently being buffered (if R6>0) R8-R10=input cursor \X R0>=0 if you should call this sub again with the next key (or R5=-1 if there are no more). R0<0 if the command has finished processing all buffered data so you needn't call it again. R6/R7 are updated for the next call. Zap_ProcessAKey This command simulates a key press by calling the above command twice, once with the key and then once with R5=-1. \E R0=zap key number R5=wimp key number (see Zap_ProcessKeys) R8-R10=input caret Zap_OpenWindow The current position of a Zap window can be read easily using the code: MOV R1,R8 : SWI "XWimp_GetWindowState". However, you should not call Wimp_OpenWindow to open a window as Zap has to keep track of the title length and position of the minibuffer etc. You should use this call instead. Use call 0 where possible as it prevents titlebar flicker. \E R0=type of open: 0 => Just changing scroll offsets or height in window stack. Size/position of window NOT changing. 1 => Window may move/change size. Minibuffer, title bar and cursors dealt with accordingly. 2 => Window is a new window. Toggle size data etc reset. 3 => Bring window to front of stack (ignore R1) 4 => Put window to back of stack (ignore R1) 5 => As for 0, but cursor kept within the window if the 'constrict cursor' option is on. (NB type 2 calls type 1 calls type 5 calls type 0) R1=open block (as for Wimp_OpenWindow) R8=window block (NB Usually alter this block and let R1=R8) Zap_RestoreModeWord This call should be used by your e_start entry point. If R8<>0 on entry then it reads the reads the options for the given mode from w_datablock using the call Zap_ModeData, and sets them as the current options. If R8=0 then it does the same thing but sets the default options. \E R0=mode number R8=window to restore options on / 0 for the default options. Zap_SaveModeWord This call should be used by your e_end entry point. If R8<>0 on entry then it reads the words w_flags and w_format and stores the current options in the w_modedata block by use of the call Zap_ModeData. If R8=0 on entry then it reads opt_flags and opt_format and stores them as the default option etc. \E R0=mode number R8=window to save options on / 0 for the default options. Zap_GetModeWord This call reads the contents of your mode word. If R8=0 then it reads opt_moden, otherwise it reads [R8,#w_moden]. This is useful for menu options. \E R1=mode number R8=window to get mode word / 0 for default options mode word \X R0=mode word contents. Zap_PutModeWord As above, but write the value. \E R0=new value for the word R1=mode number R8=window to put mode word / 0 for default options mode word Zap_BaseMode This call replaces Zap_CallBaseMode. It differs in that you must specify which mode is calling. This information is not necessarily available from the block in R8 if another mode is based on yours. The basemode of the mode named in R9 is called via the entry point offset given in R11. Before the entry point is actually called, R9 is converted to the file block pointer of the window specified in R8. Hence any entry point requiring R8 and R9 set up on entry can be called ok. \E R0-R7=parameters for the call R8=window block to be used by the call. R9=mode number making this call (your mode number). R10=parameter for the call (usually cursor block pointer). R11=mode entry point offset (see E-Entry) to call. \X As for the given mode entry point. Zap_ReadWord This call can be used for reading 4 byte from a file buffer. Note that although the offset of the word in the file may be word aligned, it's offset in the buffer may not be due to the split. This call reverses the word if the Big Endian flag is set. \E R0=File offset of the word to be read R8=window (for big endian flag to be read) R9=file \X R0=the word read (padded with zeros if it went off the file end). Zap_ReplaceWord This call replaces a word at the given file offset (inserting if the file offset+4>file length) via Zap_Command. The word is reversed if the big endian flag is set. \E R0=word to replace R1=file offset R8/R9 (R8 used for the big endian flag). Zap_ModeColour This call reads or writes the colour definition table. It will not usually have immediate effect unless you recreate the window (eg Zap_NewWinStatus). You shouldn't usually access this data as Zap handles it all for you, except to write sensible default values (using R8=0) if your mode starts up and finds its mode word is zero. \E R0=colour to write (0-15=wimp colour) / -1 to read (In future versions I may allow &BBGGRR10 24 bit settings as well). R1=mode number R2=Zap colour number of the colour to write/read: 0/1=Background 2=Foreground 3=Selection background 4=selection foreground 5=cursor back 6=cursor for 7=line numbers 8=control chars 9-15 mode dependent extension colours. R8=Window block to read from / 0 for default (!Config) settings. \X R0=colour value read / old value if writing it. NB This is currently a wimp colour (0-15) but may return 24 bit &BBGGRR10 settings in future versions. Zap_FindInput This call works out the current position of the 'input focus' in a window. If the input caret is in this window then it returns it's offset. Otherwise it returns the 'point' position (usually marked by an empty square). \E R8/R9 \X R0=most suitable offset to insert data. Zap_ClipCache This call moves the cache reference point (w_cline/coff/clogl etc) to a given point (using e_clnoff). \E R0=Offset in line to move the cache reference point to. R8/R9 Zap_ModeData This call reads or write the mode dependant options that Zap handles automatically for you. See also Zap_ModeColour. Currently there is only one word per mode storing the width and things like whether auto-indent is on or not. You should use this call with R8=0 to write sensible default values if your mode starts up and finds its mode word is zero. If you don't then the default Text mode values will be used. \E R0=value to write / -1 to read R1=mode number R2=variable number to read write R8=window concerned / 0 for the default (!Config) settings. \X R0=variable value if read / old value if written Variables num: 0 b0-b15 stores the "width" for this mode b16 auto indent bit (b16 of w_format) b17-b21 are reserved b22 hex entry mode bit (b5 of w_flags) b23 overwrite bit (b1 of w_flags) b24-b31 display bits (b8-b15 of w_format) 1+ reserved. Zap_WhichMode This call decides which mode a given file should be displayed in. \E R0=load address of file (containing the filetype) R1=filename pointer / 0 if not known \X R0=flags b0 => Auto load flag is set, no shift test. R10=mode file should be loaded into. Zap_ModeNumber This calls turns a mode name (given by a string) into a mode number. \E R0=mode name string terminated by <= space (&20) \X R0=mode number or -1 if not found. Zap_SendDataSave This call initiates the save protocol, saving data to another window or application via RAM transfer or WimpScrap. It sends the data_save message and all replies are handled automatically. \E R2=path name to use for the data / 0 to use the files R3=destination window handle (or task handle) R4=destination icon handle R5/R6=destination mouse coords (if applicable) R7=0 (non zero values used internally) R8/R9=window to save or R8=0 to save the currently selected area R10=flags b0 => External edit flag (do not use) Zap_Warning Warns the user without generating an error. This opens a window with the given message and pauses for the message to be seen before returning. Wimp Poll is not called. \E R0=warning message R1=time to leave message open in cs (0 for default delay) + flags: b31 => Don't beep when opening the window Zap_AllWindow Calls a given subroutine once for each valid Zap window. See also Zap_EachWindow. \E R0-R7=arguments to pass to the sub R10=address of the sub to call (which must preserve all registers except R0, and is called once for each window with R8/R9 set up to be that window).
00000000 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00000040 2a 2a 2a 2a 2a 2a 2a 2a 2a 0a 2a 20 3e 45 2d 5a |*********.* >E-Z| 00000050 61 70 43 61 6c 6c 73 09 44 6f 63 75 6d 65 6e 74 |apCalls.Document| 00000060 61 74 69 6f 6e 20 6f 66 20 5a 61 70 20 65 6e 74 |ation of Zap ent| 00000070 72 79 20 70 6f 69 6e 74 73 20 28 68 6f 77 20 74 |ry points (how t| 00000080 6f 20 63 61 6c 6c 20 5a 61 70 29 09 2a 0a 2a 2a |o call Zap).*.**| 00000090 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 000000d0 2a 2a 2a 2a 2a 2a 2a 0a 0a 5a 61 70 20 64 6f 65 |*******..Zap doe| 000000e0 73 20 4e 4f 54 20 68 61 76 65 20 61 20 53 57 49 |s NOT have a SWI| 000000f0 20 69 6e 74 65 72 66 61 63 65 20 61 73 20 69 74 | interface as it| 00000100 20 75 73 65 73 20 72 65 67 69 73 74 65 72 73 20 | uses registers | 00000110 52 38 2d 52 31 30 20 74 6f 20 70 6f 69 6e 74 20 |R8-R10 to point | 00000120 74 6f 0a 64 61 74 61 20 62 6c 6f 63 6b 73 2c 20 |to.data blocks, | 00000130 61 6e 64 20 74 68 65 73 65 20 63 61 6e 6e 6f 74 |and these cannot| 00000140 20 62 65 20 70 61 73 73 65 64 20 74 6f 20 73 77 | be passed to sw| 00000150 69 27 73 2e 20 54 6f 20 63 61 6c 6c 20 5a 61 70 |i's. To call Zap| 00000160 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65 64 0a 74 | you will need.t| 00000170 6f 20 6b 6e 6f 77 20 74 68 65 20 61 64 64 72 65 |o know the addre| 00000180 73 73 20 6f 66 20 74 68 65 20 5a 61 70 20 6d 6f |ss of the Zap mo| 00000190 64 75 6c 65 20 77 6f 72 6b 73 70 61 63 65 20 28 |dule workspace (| 000001a0 69 65 20 69 74 27 73 20 70 72 69 76 61 74 65 20 |ie it's private | 000001b0 77 6f 72 64 29 2e 20 49 66 0a 79 6f 75 20 61 72 |word). If.you ar| 000001c0 65 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20 6d |e an extension m| 000001d0 6f 64 65 20 74 68 65 6e 20 74 68 69 73 20 77 69 |ode then this wi| 000001e0 6c 6c 20 62 65 20 70 61 73 73 65 64 20 74 6f 20 |ll be passed to | 000001f0 79 6f 75 20 69 6e 20 52 31 32 20 77 68 65 6e 65 |you in R12 whene| 00000200 76 65 72 20 79 6f 75 0a 61 72 65 20 63 61 6c 6c |ver you.are call| 00000210 65 64 20 62 79 20 6f 6e 65 20 6f 66 20 79 6f 75 |ed by one of you| 00000220 72 20 65 6e 74 72 79 20 70 6f 69 6e 74 73 2e 20 |r entry points. | 00000230 48 6f 77 65 76 65 72 2c 20 66 6f 72 20 74 68 65 |However, for the| 00000240 20 66 69 72 73 74 20 63 61 6c 6c 20 79 6f 75 20 | first call you | 00000250 6d 61 6b 65 0a 74 6f 20 5a 61 70 2c 20 77 68 65 |make.to Zap, whe| 00000260 6e 20 79 6f 75 20 61 64 64 20 79 6f 75 72 20 6d |n you add your m| 00000270 6f 64 75 6c 65 20 74 6f 20 69 74 27 73 20 6c 69 |odule to it's li| 00000280 73 74 20 76 69 61 20 5a 61 70 5f 41 64 64 6d 6f |st via Zap_Addmo| 00000290 64 65 2c 20 79 6f 75 20 77 69 6c 6c 20 6e 6f 74 |de, you will not| 000002a0 0a 6b 6e 6f 77 20 69 74 2e 20 54 68 65 6e 20 79 |.know it. Then y| 000002b0 6f 75 20 73 68 6f 75 6c 64 20 75 73 65 20 4f 53 |ou should use OS| 000002c0 5f 4d 6f 64 75 6c 65 20 31 38 20 74 6f 20 66 69 |_Module 18 to fi| 000002d0 6e 64 20 69 74 2e 20 45 67 2c 0a 0a 20 53 59 53 |nd it. Eg,.. SYS| 000002e0 20 22 58 4f 53 5f 4d 6f 64 75 6c 65 22 2c 31 38 | "XOS_Module",18| 000002f0 2c 22 5a 61 70 22 20 54 4f 20 52 30 2c 52 31 2c |,"Zap" TO R0,R1,| 00000300 52 32 2c 52 33 2c 77 6f 72 6b 73 70 61 63 65 25 |R2,R3,workspace%| 00000310 0a 0a 4e 6f 77 2c 20 74 68 65 20 66 69 72 73 74 |..Now, the first| 00000320 20 77 6f 72 64 20 69 6e 20 5a 61 70 27 73 20 77 | word in Zap's w| 00000330 6f 72 6b 73 70 61 63 65 20 63 6f 6e 74 61 69 6e |orkspace contain| 00000340 73 20 74 68 65 20 61 64 64 72 65 73 73 20 6f 66 |s the address of| 00000350 20 61 20 74 61 62 6c 65 20 6f 66 0a 5a 61 70 27 | a table of.Zap'| 00000360 73 20 65 6e 74 72 79 20 70 6f 69 6e 74 73 2e 20 |s entry points. | 00000370 54 68 75 73 20 74 6f 20 63 61 6c 6c 20 74 68 65 |Thus to call the| 00000380 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 28 64 6f | entry point (do| 00000390 63 75 6d 65 6e 74 65 64 20 62 65 6c 6f 77 29 20 |cumented below) | 000003a0 61 74 20 6f 66 66 73 65 74 0a 61 25 20 49 20 73 |at offset.a% I s| 000003b0 75 67 67 65 73 74 20 79 6f 75 20 75 73 65 20 74 |uggest you use t| 000003c0 68 65 20 62 61 73 69 63 20 6d 61 63 72 6f 20 67 |he basic macro g| 000003d0 69 76 65 6e 20 62 65 6c 6f 77 2e 0a 0a 20 20 20 |iven below... | 000003e0 20 52 45 4d 20 43 61 6c 6c 20 5a 61 70 20 61 74 | REM Call Zap at| 000003f0 20 65 6e 74 72 79 20 6f 66 66 73 65 74 20 61 25 | entry offset a%| 00000400 0a 20 20 20 20 52 45 4d 20 45 6e 74 72 79 3a 20 |. REM Entry: | 00000410 52 30 2d 52 31 31 3d 61 72 67 73 20 52 31 32 3d |R0-R11=args R12=| 00000420 7a 61 70 20 77 6f 72 6b 73 70 61 63 65 0a 20 20 |zap workspace. | 00000430 20 20 52 45 4d 20 45 78 69 74 20 3a 20 52 30 2d | REM Exit : R0-| 00000440 52 31 31 3d 72 65 74 75 72 6e 65 64 20 76 61 6c |R11=returned val| 00000450 75 65 73 20 52 31 32 20 70 72 65 73 65 72 76 65 |ues R12 preserve| 00000460 64 20 52 31 34 20 63 6f 72 72 75 70 74 65 64 0a |d R14 corrupted.| 00000470 20 20 20 20 0a 20 20 20 20 44 45 46 20 46 4e 63 | . DEF FNc| 00000480 61 6c 6c 28 61 25 29 0a 20 20 20 20 5b 4f 50 54 |all(a%). [OPT| 00000490 70 61 73 73 0a 20 20 20 20 4c 44 52 20 52 31 34 |pass. LDR R14| 000004a0 2c 5b 52 31 32 5d 09 09 5c 20 67 65 74 20 73 74 |,[R12]..\ get st| 000004b0 61 72 74 20 6f 66 20 7a 61 70 20 74 61 62 6c 65 |art of zap table| 000004c0 0a 20 20 20 20 41 44 44 20 52 31 34 2c 52 31 34 |. ADD R14,R14| 000004d0 2c 23 61 25 09 09 5c 20 61 64 64 72 65 73 73 20 |,#a%..\ address | 000004e0 6f 66 20 74 68 65 20 73 75 62 0a 20 20 20 20 53 |of the sub. S| 000004f0 54 4d 46 44 20 52 31 33 21 2c 7b 52 31 34 7d 09 |TMFD R13!,{R14}.| 00000500 09 5c 20 73 61 76 65 20 61 64 64 72 65 73 73 20 |.\ save address | 00000510 6f 6e 20 73 74 61 63 6b 0a 20 20 20 20 4d 4f 56 |on stack. MOV| 00000520 20 52 31 34 2c 50 43 09 09 09 5c 20 72 65 74 75 | R14,PC...\ retu| 00000530 72 6e 20 61 64 64 72 65 73 73 20 28 77 69 74 68 |rn address (with| 00000540 20 66 6c 61 67 73 29 0a 20 20 20 20 4c 44 4d 46 | flags). LDMF| 00000550 44 20 52 31 33 21 2c 7b 50 43 7d 09 09 5c 20 63 |D R13!,{PC}..\ c| 00000560 61 6c 6c 20 74 68 65 20 73 75 62 20 0a 20 20 20 |all the sub . | 00000570 20 5d 3a 3d 22 22 0a 0a 54 68 65 20 6e 61 6d 65 | ]:=""..The name| 00000580 73 20 6f 66 20 74 68 65 20 72 6f 75 74 69 6e 65 |s of the routine| 00000590 73 20 61 72 65 20 6c 69 73 74 65 64 20 62 65 6c |s are listed bel| 000005a0 6f 77 20 69 6e 20 74 68 65 20 6f 72 64 65 72 20 |ow in the order | 000005b0 69 6e 20 77 68 69 63 68 20 74 68 65 79 20 61 70 |in which they ap| 000005c0 70 65 61 72 0a 69 6e 20 74 68 65 20 74 61 62 6c |pear.in the tabl| 000005d0 65 2e 20 54 68 75 73 20 74 68 65 20 66 69 72 73 |e. Thus the firs| 000005e0 74 2c 20 5a 61 70 5f 41 64 64 4d 6f 64 65 2c 20 |t, Zap_AddMode, | 000005f0 69 73 20 61 74 20 6f 66 66 73 65 74 20 30 2e 20 |is at offset 0. | 00000600 54 68 65 20 73 65 63 6f 6e 64 2c 0a 5a 61 70 5f |The second,.Zap_| 00000610 43 6c 61 69 6d 20 69 73 20 61 74 20 6f 66 66 73 |Claim is at offs| 00000620 65 74 20 34 2c 20 65 74 63 2e 20 54 68 65 73 65 |et 4, etc. These| 00000630 20 76 61 6c 75 65 73 20 61 72 65 20 64 65 66 69 | values are defi| 00000640 6e 65 64 20 66 6f 72 20 79 6f 75 20 69 6e 20 74 |ned for you in t| 00000650 68 65 0a 70 72 6f 67 72 61 6d 20 45 2d 4c 69 62 |he.program E-Lib| 00000660 72 61 72 79 2e 0a 0a 49 6e 20 67 65 6e 65 72 61 |rary...In genera| 00000670 6c 20 74 68 65 73 65 20 72 6f 75 74 69 6e 65 73 |l these routines| 00000680 20 68 61 76 65 20 74 68 65 20 66 6f 6c 6c 6f 77 | have the follow| 00000690 69 6e 67 20 65 6e 74 72 79 2f 65 78 69 74 20 63 |ing entry/exit c| 000006a0 6f 6e 64 69 74 69 6f 6e 73 3a 0a 0a 20 5c 45 20 |onditions:.. \E | 000006b0 52 30 2d 52 31 31 3d 61 72 67 75 6d 65 6e 74 73 |R0-R11=arguments| 000006c0 20 52 31 32 3d 5a 61 70 27 73 20 77 6f 72 6b 73 | R12=Zap's works| 000006d0 70 61 63 65 20 52 31 33 3d 75 73 65 72 20 73 74 |pace R13=user st| 000006e0 61 63 6b 20 52 31 34 3d 72 65 74 75 72 6e 20 61 |ack R14=return a| 000006f0 64 64 72 65 73 73 0a 20 5c 58 20 52 31 2d 52 31 |ddress. \X R1-R1| 00000700 33 20 70 72 65 73 65 72 76 65 64 2e 20 52 30 20 |3 preserved. R0 | 00000710 61 6e 64 20 46 6c 61 67 73 20 41 4c 54 45 52 45 |and Flags ALTERE| 00000720 44 2e 20 56 20 73 65 74 20 69 66 20 65 72 72 6f |D. V set if erro| 00000730 72 20 61 6e 64 20 52 30 3d 65 72 72 6f 72 20 62 |r and R0=error b| 00000740 6c 6f 63 6b 0a 0a 54 68 75 73 20 69 66 20 49 20 |lock..Thus if I | 00000750 77 72 69 74 65 3a 0a 0a 20 5c 45 20 52 38 0a 20 |write:.. \E R8. | 00000760 5c 58 20 52 31 3d 33 0a 0a 54 68 65 6e 20 49 20 |\X R1=3..Then I | 00000770 6d 65 61 6e 20 74 68 61 74 20 6f 6e 20 65 6e 74 |mean that on ent| 00000780 72 79 20 52 38 20 77 61 73 20 74 68 65 20 77 69 |ry R8 was the wi| 00000790 6e 64 6f 77 20 62 6c 6f 63 6b 20 70 6f 69 6e 74 |ndow block point| 000007a0 65 72 2c 20 52 31 32 20 7a 61 70 27 73 0a 77 6f |er, R12 zap's.wo| 000007b0 72 6b 73 70 61 63 65 20 65 74 63 2e 20 41 6e 64 |rkspace etc. And| 000007c0 20 6f 6e 20 65 78 69 74 20 74 68 61 74 20 52 31 | on exit that R1| 000007d0 3d 33 2c 20 52 32 2d 52 31 33 20 73 61 76 65 64 |=3, R2-R13 saved| 000007e0 2c 20 52 30 20 63 6f 72 72 75 70 74 65 64 20 65 |, R0 corrupted e| 000007f0 74 63 2e 20 49 66 20 49 0a 6f 6d 69 74 20 74 68 |tc. If I.omit th| 00000800 65 20 5c 45 20 6f 72 20 5c 58 20 74 68 65 6e 20 |e \E or \X then | 00000810 49 20 6d 65 61 6e 20 74 68 65 20 73 74 61 6e 64 |I mean the stand| 00000820 61 72 64 20 65 6e 74 72 79 2f 65 78 69 74 20 63 |ard entry/exit c| 00000830 6f 6e 64 69 74 69 6f 6e 73 20 68 6f 6c 64 2e 0a |onditions hold..| 00000840 0a 45 72 72 6f 72 73 20 73 68 6f 75 6c 64 20 62 |.Errors should b| 00000850 65 20 70 61 73 73 65 64 20 62 61 63 6b 20 74 6f |e passed back to| 00000860 20 5a 61 70 20 62 79 20 74 68 65 20 65 6e 74 72 | Zap by the entr| 00000870 79 20 70 6f 69 6e 74 20 74 68 72 6f 75 67 68 20 |y point through | 00000880 77 68 69 63 68 20 74 68 65 0a 6d 6f 64 75 6c 65 |which the.module| 00000890 20 77 61 73 20 63 61 6c 6c 65 64 20 28 77 69 74 | was called (wit| 000008a0 68 20 56 20 66 6c 61 67 20 73 65 74 20 61 6e 64 |h V flag set and| 000008b0 20 52 30 3d 65 72 72 6f 72 20 62 6c 6f 63 6b 20 | R0=error block | 000008c0 70 6f 69 6e 74 65 72 29 2e 20 50 6c 65 61 73 65 |pointer). Please| 000008d0 20 6e 6f 74 65 0a 74 68 61 74 20 66 6f 72 20 6d | note.that for m| 000008e0 6f 73 74 20 63 61 6c 6c 73 2c 20 5a 61 70 20 6d |ost calls, Zap m| 000008f0 75 73 74 20 62 65 20 70 61 67 65 64 20 69 6e 20 |ust be paged in | 00000900 61 73 20 74 68 65 20 63 75 72 72 65 6e 74 20 74 |as the current t| 00000910 61 73 6b 21 20 54 68 69 73 20 77 69 6c 6c 20 62 |ask! This will b| 00000920 65 0a 73 6f 20 69 66 20 79 6f 75 20 61 72 65 20 |e.so if you are | 00000930 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 |an extension mod| 00000940 65 2e 0a 0a 46 6f 72 20 61 20 74 61 62 6c 65 2f |e...For a table/| 00000950 73 75 6d 6d 61 72 79 20 6f 66 20 74 68 65 20 7a |summary of the z| 00000960 61 70 20 63 61 6c 6c 20 6e 61 6d 65 73 20 66 6f |ap call names fo| 00000970 72 20 69 6e 63 6c 75 64 69 6e 67 20 69 6e 20 79 |r including in y| 00000980 6f 75 72 20 73 6f 75 72 63 65 2c 20 73 65 65 0a |our source, see.| 00000990 74 68 65 20 66 69 6c 65 20 45 2d 4c 69 62 72 61 |the file E-Libra| 000009a0 72 79 2e 0a 0a 5a 61 70 5f 41 64 64 4d 6f 64 65 |ry...Zap_AddMode| 000009b0 0a 41 64 64 73 20 61 20 6e 65 77 20 5a 61 70 20 |.Adds a new Zap | 000009c0 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 65 2e 20 |extension mode. | 000009d0 54 68 69 73 20 73 68 6f 75 6c 64 20 62 65 20 63 |This should be c| 000009e0 61 6c 6c 65 64 20 61 66 74 65 72 20 74 68 65 20 |alled after the | 000009f0 6d 6f 64 75 6c 65 20 5a 61 70 20 69 73 0a 6c 6f |module Zap is.lo| 00000a00 61 64 65 64 2c 20 62 75 74 20 62 65 66 6f 72 65 |aded, but before| 00000a10 20 69 74 20 73 74 61 72 74 73 20 75 70 20 61 73 | it starts up as| 00000a20 20 61 20 6e 65 77 20 74 61 73 6b 2e 20 5a 61 70 | a new task. Zap| 00000a30 20 6e 65 65 64 20 6e 6f 74 20 62 65 20 70 61 67 | need not be pag| 00000a40 65 64 20 69 6e 20 66 6f 72 0a 74 68 69 73 20 63 |ed in for.this c| 00000a50 61 6c 6c 2e 0a 09 5c 45 20 52 30 3d 61 64 64 72 |all...\E R0=addr| 00000a60 65 73 73 20 6f 66 20 74 61 62 6c 65 20 6f 66 20 |ess of table of | 00000a70 65 6e 74 72 79 20 70 6f 69 6e 74 73 20 28 73 65 |entry points (se| 00000a80 65 20 66 69 6c 65 20 45 2d 45 6e 74 72 79 29 0a |e file E-Entry).| 00000a90 0a 5a 61 70 5f 43 6c 61 69 6d 0a 43 6c 61 69 6d |.Zap_Claim.Claim| 00000aa0 73 20 61 20 62 6c 6f 63 6b 20 6f 66 20 77 6f 72 |s a block of wor| 00000ab0 6b 73 70 61 63 65 20 69 6e 20 5a 61 70 27 73 20 |kspace in Zap's | 00000ac0 68 65 61 70 2e 0a 09 5c 45 20 52 30 3d 6e 75 6d |heap...\E R0=num| 00000ad0 62 65 72 20 6f 66 20 62 79 74 65 73 20 72 65 71 |ber of bytes req| 00000ae0 75 69 72 65 64 0a 09 5c 58 20 52 30 3d 70 6f 69 |uired..\X R0=poi| 00000af0 6e 74 65 72 20 74 6f 20 74 68 65 20 68 65 61 70 |nter to the heap| 00000b00 20 62 6c 6f 63 6b 0a 0a 5a 61 70 5f 45 6e 73 75 | block..Zap_Ensu| 00000b10 72 65 0a 45 6e 73 75 72 65 73 20 61 20 7a 61 70 |re.Ensures a zap| 00000b20 20 68 65 61 70 20 62 6c 6f 63 6b 20 69 73 20 6f | heap block is o| 00000b30 66 20 61 20 67 69 76 65 6e 20 73 69 7a 65 2e 0a |f a given size..| 00000b40 09 5c 45 20 52 30 3d 70 6f 69 6e 74 65 72 20 74 |.\E R0=pointer t| 00000b50 6f 20 74 68 65 20 68 65 61 70 20 62 6c 6f 63 6b |o the heap block| 00000b60 0a 09 20 20 20 52 31 3d 6e 75 6d 62 65 72 20 6f |.. R1=number o| 00000b70 66 20 62 79 74 65 73 20 72 65 71 75 69 72 65 64 |f bytes required| 00000b80 2e 0a 09 5c 58 20 52 30 3d 6e 65 77 20 68 65 61 |...\X R0=new hea| 00000b90 70 20 62 6c 6f 63 6b 20 70 6f 69 6e 74 65 72 20 |p block pointer | 00000ba0 6f 66 20 28 70 6f 73 73 69 62 6c 79 20 6d 6f 76 |of (possibly mov| 00000bb0 65 64 29 20 65 78 74 65 6e 64 65 64 20 62 6c 6f |ed) extended blo| 00000bc0 63 6b 2e 0a 09 20 20 20 28 41 6e 20 65 72 72 6f |ck... (An erro| 00000bd0 72 20 69 73 20 72 65 74 75 72 6e 65 64 20 69 66 |r is returned if| 00000be0 20 74 68 65 20 62 6c 6f 63 6b 20 63 6f 75 6c 64 | the block could| 00000bf0 6e 27 74 20 62 65 20 65 6e 6c 61 72 67 65 64 29 |n't be enlarged)| 00000c00 2e 0a 0a 5a 61 70 5f 46 72 65 65 0a 46 72 65 65 |...Zap_Free.Free| 00000c10 20 61 20 7a 61 70 20 68 65 61 70 20 62 6c 6f 63 | a zap heap bloc| 00000c20 6b 20 61 66 74 65 72 20 75 73 65 2e 0a 09 5c 45 |k after use...\E| 00000c30 20 52 30 3d 70 6f 69 6e 74 65 72 20 74 6f 20 68 | R0=pointer to h| 00000c40 65 61 70 20 62 6c 6f 63 6b 20 74 6f 20 66 72 65 |eap block to fre| 00000c50 65 0a 0a 5a 61 70 5f 4d 6f 76 65 42 79 74 65 73 |e..Zap_MoveBytes| 00000c60 0a 4d 6f 76 65 73 20 61 20 62 6c 6f 63 6b 20 6f |.Moves a block o| 00000c70 66 20 6d 65 6d 6f 72 79 2e 20 54 68 65 20 6d 6f |f memory. The mo| 00000c80 76 65 6d 65 6e 74 20 6d 61 79 20 62 65 20 75 70 |vement may be up| 00000c90 20 6f 72 20 64 6f 77 6e 20 62 79 20 61 6e 79 20 | or down by any | 00000ca0 61 6d 6f 75 6e 74 2e 20 54 68 65 0a 64 61 74 61 |amount. The.data| 00000cb0 20 69 73 20 41 4c 57 41 59 53 20 70 72 65 73 65 | is ALWAYS prese| 00000cc0 72 76 65 64 20 6e 6f 20 6d 61 74 74 65 72 20 77 |rved no matter w| 00000cd0 68 65 72 65 20 74 68 65 20 64 65 73 74 69 6e 61 |here the destina| 00000ce0 74 69 6f 6e 20 69 73 2e 20 54 68 69 73 20 72 6f |tion is. This ro| 00000cf0 75 74 69 6e 65 20 69 73 0a 68 69 67 68 6c 79 20 |utine is.highly | 00000d00 6f 70 74 69 6d 69 73 65 64 20 61 6e 64 20 73 68 |optimised and sh| 00000d10 6f 75 6c 64 20 62 65 20 75 73 65 64 20 66 6f 72 |ould be used for| 00000d20 20 6d 6f 76 69 6e 67 20 61 6e 79 20 6c 61 72 67 | moving any larg| 00000d30 65 20 62 6c 6f 63 6b 20 6f 66 20 64 61 74 61 2e |e block of data.| 00000d40 20 5a 61 70 0a 6e 65 65 64 20 6e 6f 74 20 62 65 | Zap.need not be| 00000d50 20 70 61 67 65 64 20 69 6e 2e 0a 09 5c 45 20 52 | paged in...\E R| 00000d60 31 3d 73 6f 75 72 63 65 20 62 79 74 65 20 61 64 |1=source byte ad| 00000d70 64 72 65 73 73 0a 09 20 20 20 52 32 3d 64 65 73 |dress.. R2=des| 00000d80 74 69 6e 61 74 69 6f 6e 20 62 79 74 65 20 61 64 |tination byte ad| 00000d90 64 72 65 73 73 0a 09 20 20 20 52 33 3d 6e 75 6d |dress.. R3=num| 00000da0 62 65 72 20 6f 66 20 62 79 74 65 73 20 74 6f 20 |ber of bytes to | 00000db0 6d 6f 76 65 0a 09 5c 58 20 52 31 2d 52 33 20 63 |move..\X R1-R3 c| 00000dc0 6f 72 72 75 70 74 65 64 0a 0a 5a 61 70 5f 53 70 |orrupted..Zap_Sp| 00000dd0 6c 69 74 42 75 66 66 65 72 0a 54 68 69 73 20 73 |litBuffer.This s| 00000de0 70 6c 69 74 73 20 61 20 66 69 6c 65 20 68 65 6c |plits a file hel| 00000df0 64 20 69 6e 20 5a 61 70 20 61 74 20 74 68 65 20 |d in Zap at the | 00000e00 69 6e 64 69 63 61 74 65 64 20 66 69 6c 65 20 6f |indicated file o| 00000e10 66 66 73 65 74 20 72 65 61 64 79 20 66 6f 72 0a |ffset ready for.| 00000e20 69 6e 73 65 72 74 69 6f 6e 2f 64 65 6c 65 74 69 |insertion/deleti| 00000e30 6f 6e 20 6f 66 20 64 61 74 61 2e 20 49 74 20 61 |on of data. It a| 00000e40 6c 73 6f 20 65 6e 73 75 72 65 73 20 74 68 61 74 |lso ensures that| 00000e50 20 66 69 6c 65 20 62 75 66 66 65 72 20 68 61 73 | file buffer has| 00000e60 20 61 20 67 69 76 65 6e 0a 61 6d 6f 75 6e 74 20 | a given.amount | 00000e70 6f 66 20 72 6f 6f 6d 20 66 72 65 65 2e 20 53 65 |of room free. Se| 00000e80 65 20 45 2d 46 69 6c 65 2e 0a 09 5c 45 20 52 30 |e E-File...\E R0| 00000e90 3d 66 69 6c 65 20 6f 66 66 73 65 74 20 74 6f 20 |=file offset to | 00000ea0 73 70 6c 69 74 20 61 74 20 28 6e 65 77 20 76 61 |split at (new va| 00000eb0 6c 75 65 20 66 6f 72 20 66 5f 73 70 6c 69 74 6f |lue for f_splito| 00000ec0 29 0a 09 20 20 20 52 31 3d 6d 69 6e 69 6d 75 6d |).. R1=minimum| 00000ed0 20 6e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 | number of bytes| 00000ee0 20 74 6f 20 68 61 76 65 20 66 72 65 65 20 69 6e | to have free in| 00000ef0 20 74 68 65 20 73 70 6c 69 74 0a 09 20 20 20 52 | the split.. R| 00000f00 39 3d 66 69 6c 65 20 74 6f 20 62 65 20 73 70 6c |9=file to be spl| 00000f10 69 74 0a 0a 5a 61 70 5f 4e 65 77 54 78 74 53 74 |it..Zap_NewTxtSt| 00000f20 61 74 75 73 0a 54 68 69 73 20 75 70 64 61 74 65 |atus.This update| 00000f30 73 20 74 68 65 20 73 63 72 65 65 6e 20 61 66 74 |s the screen aft| 00000f40 65 72 20 63 68 61 6e 67 65 73 20 61 72 65 20 6d |er changes are m| 00000f50 61 64 65 20 74 6f 20 61 20 66 69 6c 65 2e 20 54 |ade to a file. T| 00000f60 68 69 73 20 69 73 20 76 65 72 79 20 6c 6f 77 0a |his is very low.| 00000f70 6c 65 76 65 6c 20 61 6e 64 20 79 6f 75 20 73 68 |level and you sh| 00000f80 6f 75 6c 64 20 75 73 65 20 5a 61 70 5f 43 6f 6d |ould use Zap_Com| 00000f90 6d 61 6e 64 20 77 68 65 6e 20 70 6f 73 73 69 62 |mand when possib| 00000fa0 6c 65 2e 20 5a 61 70 5f 53 61 76 65 54 78 74 53 |le. Zap_SaveTxtS| 00000fb0 74 61 74 75 73 20 73 68 6f 75 6c 64 0a 62 65 20 |tatus should.be | 00000fc0 63 61 6c 6c 65 64 20 66 69 72 73 74 2e 0a 09 5c |called first...\| 00000fd0 45 20 52 30 2f 52 31 20 61 73 20 66 6f 72 20 53 |E R0/R1 as for S| 00000fe0 61 76 65 54 78 74 53 74 61 74 75 73 20 61 6e 64 |aveTxtStatus and| 00000ff0 20 52 32 3d 6e 65 77 20 69 6e 70 75 74 20 63 61 | R2=new input ca| 00001000 72 65 74 20 6f 66 66 73 65 74 2e 0a 0a 5a 61 70 |ret offset...Zap| 00001010 5f 53 61 76 65 54 78 74 53 74 61 74 75 73 0a 54 |_SaveTxtStatus.T| 00001020 68 69 73 20 69 73 20 61 20 6c 6f 77 20 6c 65 76 |his is a low lev| 00001030 65 6c 20 63 61 6c 6c 20 75 73 65 64 20 62 79 20 |el call used by | 00001040 5a 61 70 5f 44 6f 43 6f 6d 6d 61 6e 64 20 77 68 |Zap_DoCommand wh| 00001050 65 6e 20 63 68 61 6e 67 69 6e 67 20 61 20 66 69 |en changing a fi| 00001060 6c 65 2e 20 59 6f 75 0a 73 68 6f 75 6c 64 20 75 |le. You.should u| 00001070 73 65 20 5a 61 70 5f 43 6f 6d 6d 61 6e 64 2f 5a |se Zap_Command/Z| 00001080 61 70 5f 44 6f 43 6f 6d 6d 61 6e 64 20 69 6e 20 |ap_DoCommand in | 00001090 70 72 65 66 65 72 65 6e 63 65 2e 20 41 6e 79 20 |preference. Any | 000010a0 66 69 6c 65 20 63 68 61 6e 67 65 73 20 64 6f 6e |file changes don| 000010b0 65 0a 75 73 69 6e 67 20 74 68 69 73 20 63 61 6c |e.using this cal| 000010c0 6c 20 61 72 65 20 4e 4f 54 20 73 61 76 65 64 20 |l are NOT saved | 000010d0 69 6e 20 74 68 65 20 75 6e 64 6f 20 62 75 66 66 |in the undo buff| 000010e0 65 72 2e 20 49 65 2c 20 64 6f 6e 27 74 20 75 73 |er. Ie, don't us| 000010f0 65 20 69 74 2e 20 54 6f 20 75 73 65 20 69 74 0a |e it. To use it.| 00001100 79 6f 75 20 73 70 65 63 69 66 79 20 74 68 65 20 |you specify the | 00001110 61 72 65 61 20 6f 66 20 74 68 65 20 66 69 6c 65 |area of the file| 00001120 20 74 6f 20 62 65 20 63 68 61 6e 67 65 64 20 28 | to be changed (| 00001130 52 30 20 74 6f 20 52 32 29 20 61 6e 64 20 74 68 |R0 to R2) and th| 00001140 65 20 61 6d 6f 75 6e 74 20 6f 66 0a 74 68 65 20 |e amount of.the | 00001150 63 68 61 6e 67 65 20 28 69 6e 20 52 31 29 2e 20 |change (in R1). | 00001160 41 66 74 65 72 20 6d 61 6b 69 6e 67 20 74 68 65 |After making the| 00001170 20 63 68 61 6e 67 65 20 79 6f 75 20 75 73 65 20 | change you use | 00001180 5a 61 70 5f 4e 65 77 54 78 74 53 74 61 74 75 73 |Zap_NewTxtStatus| 00001190 20 74 6f 0a 75 70 64 61 74 65 20 74 68 65 20 73 | to.update the s| 000011a0 63 72 65 65 6e 2e 20 53 65 74 20 66 5f 64 6f 63 |creen. Set f_doc| 000011b0 6f 6d 20 74 6f 20 30 20 69 66 20 69 6e 20 64 6f |om to 0 if in do| 000011c0 75 62 74 2e 0a 09 5c 45 20 52 30 3d 66 69 6c 65 |ubt...\E R0=file| 000011d0 20 6f 66 66 73 65 74 20 6f 66 20 66 69 72 73 74 | offset of first| 000011e0 20 62 79 74 65 20 69 6e 20 66 69 6c 65 20 74 6f | byte in file to| 000011f0 20 62 65 20 63 68 61 6e 67 65 64 2e 0a 09 20 20 | be changed... | 00001200 20 52 31 3d 70 72 6f 70 6f 73 65 64 20 73 69 67 | R1=proposed sig| 00001210 6e 65 64 20 63 68 61 6e 67 65 20 69 6e 20 73 69 |ned change in si| 00001220 7a 65 20 6f 66 20 66 69 6c 65 2e 0a 09 20 20 20 |ze of file... | 00001230 52 32 3d 66 69 6c 65 20 6f 66 66 73 65 74 20 6f |R2=file offset o| 00001240 66 20 66 69 72 73 74 20 63 68 61 72 61 63 74 65 |f first characte| 00001250 72 20 77 68 69 63 68 20 69 73 20 75 6e 63 68 61 |r which is uncha| 00001260 6e 67 65 64 2e 0a 09 20 20 20 66 5f 64 6f 63 6f |nged... f_doco| 00001270 6d 2c 66 5f 64 6f 6c 65 6e 2c 66 5f 64 6f 64 61 |m,f_dolen,f_doda| 00001280 74 61 20 6d 75 73 74 20 62 65 20 73 65 74 20 75 |ta must be set u| 00001290 70 20 2d 20 73 65 65 20 65 5f 70 72 65 76 6c 69 |p - see e_prevli| 000012a0 6e 65 2e 0a 0a 5a 61 70 5f 43 6f 6d 6d 61 6e 64 |ne...Zap_Command| 000012b0 0a 54 68 69 73 20 73 68 6f 75 6c 64 20 62 65 20 |.This should be | 000012c0 75 73 65 64 20 66 6f 72 20 69 6e 73 65 72 74 69 |used for inserti| 000012d0 6e 67 2f 64 65 6c 65 74 69 6e 67 2f 72 65 70 6c |ng/deleting/repl| 000012e0 61 63 69 6e 67 20 64 61 74 61 20 69 6e 20 61 20 |acing data in a | 000012f0 66 69 6c 65 2e 20 49 74 73 20 0a 61 63 74 69 6f |file. Its .actio| 00001300 6e 20 69 73 20 74 6f 20 63 61 6c 6c 20 74 68 65 |n is to call the| 00001310 20 6d 6f 64 65 20 65 6e 74 72 79 20 70 6f 69 6e | mode entry poin| 00001320 74 20 6e 61 6d 65 64 20 65 5f 63 6f 6d 6d 61 6e |t named e_comman| 00001330 64 2e 20 53 65 65 20 45 2d 45 6e 74 72 79 2e 20 |d. See E-Entry. | 00001340 54 68 65 0a 6d 6f 64 65 27 73 20 64 65 66 61 75 |The.mode's defau| 00001350 6c 74 20 61 63 74 69 6f 6e 20 69 73 20 74 68 65 |lt action is the| 00001360 6e 20 74 6f 20 63 61 6c 6c 20 5a 61 70 5f 44 6f |n to call Zap_Do| 00001370 43 6f 6d 6d 61 6e 64 2e 20 54 68 65 20 63 6f 6d |Command. The com| 00001380 6d 61 6e 64 73 20 61 72 65 0a 61 75 74 6f 6d 61 |mands are.automa| 00001390 74 69 63 61 6c 6c 79 20 70 6c 61 63 65 64 20 69 |tically placed i| 000013a0 6e 20 74 68 65 20 75 6e 64 6f 20 62 75 66 66 65 |n the undo buffe| 000013b0 72 2e 20 49 66 20 79 6f 75 20 61 72 65 20 64 6f |r. If you are do| 000013c0 69 6e 67 20 61 20 73 65 71 75 65 6e 63 65 20 6f |ing a sequence o| 000013d0 66 0a 69 6e 73 65 72 74 69 6f 6e 73 2f 64 65 6c |f.insertions/del| 000013e0 65 74 69 6f 6e 73 20 74 68 65 6e 20 70 6c 65 61 |etions then plea| 000013f0 73 65 20 75 73 65 20 5a 61 70 5f 53 74 61 72 74 |se use Zap_Start| 00001400 2f 53 74 6f 70 4f 70 2e 20 4e 6f 74 65 20 74 68 |/StopOp. Note th| 00001410 61 74 20 74 68 65 20 63 75 72 73 6f 72 0a 69 73 |at the cursor.is| 00001420 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 75 | automatically u| 00001430 70 64 61 74 65 64 20 74 6f 20 74 68 65 20 65 6e |pdated to the en| 00001440 64 20 6f 66 20 74 68 65 20 69 6e 73 65 72 74 65 |d of the inserte| 00001450 64 2f 64 65 6c 65 74 65 64 20 72 65 67 69 6f 6e |d/deleted region| 00001460 2e 20 54 6f 0a 70 72 65 76 65 6e 74 20 74 68 69 |. To.prevent thi| 00001470 73 2c 20 73 65 74 20 62 31 34 20 6f 66 20 66 5f |s, set b14 of f_| 00001480 66 6c 61 67 73 2c 20 62 75 74 20 79 6f 75 20 4d |flags, but you M| 00001490 55 53 54 20 72 65 73 74 6f 72 65 20 69 74 20 61 |UST restore it a| 000014a0 66 74 65 72 20 74 68 65 20 63 6f 6d 6d 61 6e 64 |fter the command| 000014b0 0a 72 65 74 75 72 6e 73 2e 0a 09 5c 45 20 52 30 |.returns...\E R0| 000014c0 3d 63 6f 6d 6d 61 6e 64 20 6e 75 6d 62 65 72 3a |=command number:| 000014d0 20 31 3d 69 6e 73 65 72 74 20 32 3d 64 65 6c 65 | 1=insert 2=dele| 000014e0 74 65 20 33 3d 72 65 70 6c 61 63 65 20 28 66 6f |te 3=replace (fo| 000014f0 72 77 61 72 64 29 0a 09 20 20 20 20 34 3d 72 65 |rward).. 4=re| 00001500 70 6c 61 63 65 20 28 62 61 63 6b 77 61 72 64 29 |place (backward)| 00001510 2e 20 41 64 64 20 26 31 30 20 69 66 20 63 6f 6d |. Add &10 if com| 00001520 6d 61 6e 64 20 69 73 20 74 6f 20 62 65 20 62 75 |mand is to be bu| 00001530 66 66 65 72 65 64 0a 09 20 20 20 20 69 6e 20 6f |ffered.. in o| 00001540 6e 65 20 62 6c 6f 63 6b 20 28 61 6e 64 20 74 68 |ne block (and th| 00001550 75 73 20 75 6e 64 6f 6e 65 20 69 6e 20 6f 6e 65 |us undone in one| 00001560 20 6b 65 79 20 70 72 65 73 73 29 2e 0a 09 20 20 | key press)... | 00001570 20 52 31 3d 66 69 6c 65 20 6f 66 66 73 65 74 20 | R1=file offset | 00001580 66 6f 72 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 74 |for command to t| 00001590 61 6b 65 20 70 6c 61 63 65 20 61 74 2e 0a 09 20 |ake place at... | 000015a0 20 20 52 32 3d 6e 75 6d 62 65 72 20 6f 66 20 62 | R2=number of b| 000015b0 79 74 65 73 20 62 65 69 6e 67 20 69 6e 73 65 72 |ytes being inser| 000015c0 74 65 64 2f 64 65 6c 65 74 65 64 2f 72 65 70 6c |ted/deleted/repl| 000015d0 61 63 65 64 2e 0a 09 20 20 20 52 33 3d 64 61 74 |aced... R3=dat| 000015e0 61 20 74 6f 20 69 6e 73 65 72 74 2f 72 65 70 6c |a to insert/repl| 000015f0 61 63 65 20 77 69 74 68 20 66 6f 72 20 63 6f 6d |ace with for com| 00001600 6d 61 6e 64 73 20 31 2c 33 2c 34 2e 0a 09 20 20 |mands 1,3,4... | 00001610 20 52 38 3d 77 69 6e 64 6f 77 20 6f 6e 20 66 69 | R8=window on fi| 00001620 6c 65 20 74 6f 20 62 65 20 61 6c 74 65 72 65 64 |le to be altered| 00001630 2f 30 20 69 66 20 6e 6f 6e 65 2e 0a 09 20 20 20 |/0 if none... | 00001640 52 39 3d 66 69 6c 65 20 74 6f 20 62 65 20 61 6c |R9=file to be al| 00001650 74 65 72 65 64 2e 0a 09 4e 42 20 49 66 20 79 6f |tered...NB If yo| 00001660 75 20 64 6f 6e 27 74 20 73 70 65 63 69 66 79 20 |u don't specify | 00001670 74 68 65 20 77 69 6e 64 6f 77 20 74 68 65 6e 20 |the window then | 00001680 69 74 20 77 6f 6e 27 74 20 6b 6e 6f 77 20 77 68 |it won't know wh| 00001690 69 63 68 20 6d 6f 64 65 20 74 6f 0a 09 63 61 6c |ich mode to..cal| 000016a0 6c 2c 20 73 6f 20 74 68 69 73 20 63 6f 6d 6d 61 |l, so this comma| 000016b0 6e 64 20 77 69 6c 6c 20 6a 75 73 74 20 63 61 6c |nd will just cal| 000016c0 6c 20 5a 61 70 5f 44 6f 43 6f 6d 6d 61 6e 64 2e |l Zap_DoCommand.| 000016d0 0a 0a 5a 61 70 5f 4e 65 77 57 69 6e 53 74 61 74 |..Zap_NewWinStat| 000016e0 75 73 0a 54 68 69 73 20 72 65 63 72 65 61 74 65 |us.This recreate| 000016f0 73 20 61 20 77 69 6e 64 6f 77 20 61 66 74 65 72 |s a window after| 00001700 20 73 6f 6d 65 20 64 69 73 70 6c 61 79 20 70 61 | some display pa| 00001710 72 61 6d 65 74 65 72 73 20 68 61 76 65 20 63 68 |rameters have ch| 00001720 61 6e 67 65 64 2e 20 55 73 65 0a 5a 61 70 5f 53 |anged. Use.Zap_S| 00001730 61 76 65 57 69 6e 53 74 61 74 75 73 20 62 65 66 |aveWinStatus bef| 00001740 6f 72 65 20 63 68 61 6e 67 69 6e 67 20 61 6e 79 |ore changing any| 00001750 20 70 61 72 61 6d 65 74 65 72 73 2e 0a 09 5c 45 | parameters...\E| 00001760 20 52 38 2f 52 39 0a 09 0a 5a 61 70 5f 53 61 76 | R8/R9...Zap_Sav| 00001770 65 57 69 6e 53 74 61 74 75 73 0a 54 68 69 73 20 |eWinStatus.This | 00001780 69 73 20 75 73 65 64 20 62 65 66 6f 72 65 20 63 |is used before c| 00001790 68 61 6e 67 69 6e 67 20 61 6e 79 20 6f 66 20 74 |hanging any of t| 000017a0 68 65 20 27 77 5f 2a 27 20 77 69 6e 64 6f 77 20 |he 'w_*' window | 000017b0 70 61 72 61 6d 65 74 65 72 73 20 77 68 69 63 68 |parameters which| 000017c0 20 77 6f 75 6c 64 0a 65 66 66 65 63 74 20 74 68 | would.effect th| 000017d0 65 20 64 69 73 70 6c 61 79 2e 20 53 65 65 20 45 |e display. See E| 000017e0 2d 57 69 6e 64 6f 77 2e 20 54 68 65 20 63 75 72 |-Window. The cur| 000017f0 72 65 6e 74 20 63 75 72 73 6f 72 20 70 6f 73 69 |rent cursor posi| 00001800 74 69 6f 6e 2c 20 73 63 72 6f 6c 6c 20 6f 66 66 |tion, scroll off| 00001810 73 65 74 73 0a 65 74 63 20 61 72 65 20 73 61 76 |sets.etc are sav| 00001820 65 64 2e 20 41 66 74 65 72 20 63 68 61 6e 67 69 |ed. After changi| 00001830 6e 67 20 74 68 65 20 77 69 6e 64 6f 77 20 70 61 |ng the window pa| 00001840 72 61 6d 65 74 65 72 73 20 63 61 6c 6c 20 5a 61 |rameters call Za| 00001850 70 5f 4e 65 77 57 69 6e 53 74 61 74 75 73 2e 0a |p_NewWinStatus..| 00001860 5a 61 70 20 77 69 6c 6c 20 64 6f 20 69 74 27 73 |Zap will do it's| 00001870 20 62 65 73 74 20 74 6f 20 72 65 63 72 65 61 74 | best to recreat| 00001880 65 20 74 68 65 20 77 69 6e 64 6f 77 20 77 69 74 |e the window wit| 00001890 68 20 74 68 65 20 6e 65 77 20 61 74 74 72 69 62 |h the new attrib| 000018a0 75 74 65 73 2c 0a 70 72 65 73 65 72 76 69 6e 67 |utes,.preserving| 000018b0 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 20 6f 66 | the position of| 000018c0 20 74 68 65 20 63 75 72 73 6f 72 20 6f 6e 20 73 | the cursor on s| 000018d0 63 72 65 65 6e 2e 0a 09 5c 45 20 52 38 2f 52 39 |creen...\E R8/R9| 000018e0 0a 0a 5a 61 70 5f 52 65 70 6c 61 63 65 41 72 65 |..Zap_ReplaceAre| 000018f0 61 0a 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20 72 |a.This command r| 00001900 65 70 6c 61 63 65 73 20 6f 6e 65 20 61 72 65 61 |eplaces one area| 00001910 20 6f 66 20 74 65 78 74 20 77 69 74 68 20 61 6e | of text with an| 00001920 6f 74 68 65 72 20 28 6e 6f 74 20 6e 65 63 65 73 |other (not neces| 00001930 73 61 72 69 6c 79 20 6f 66 20 74 68 65 0a 73 61 |sarily of the.sa| 00001940 6d 65 20 6c 65 6e 67 74 68 29 20 62 79 20 70 65 |me length) by pe| 00001950 72 66 6f 72 6d 69 6e 67 20 74 68 65 20 6d 69 6e |rforming the min| 00001960 69 6d 75 6d 20 6e 75 6d 62 65 72 20 6f 66 20 69 |imum number of i| 00001970 6e 73 65 72 74 69 6f 6e 73 2f 64 65 6c 65 74 69 |nsertions/deleti| 00001980 6f 6e 73 2f 73 69 6d 70 6c 65 0a 72 65 70 6c 61 |ons/simple.repla| 00001990 63 65 73 20 75 73 69 6e 67 20 5a 61 70 5f 43 6f |ces using Zap_Co| 000019a0 6d 6d 61 6e 64 2e 20 49 6e 20 42 41 53 49 43 20 |mmand. In BASIC | 000019b0 6d 6f 64 65 20 69 74 20 61 6c 73 6f 20 72 65 74 |mode it also ret| 000019c0 6f 6b 65 6e 69 73 65 73 20 74 68 65 20 6c 69 6e |okenises the lin| 000019d0 65 20 61 73 0a 6e 65 63 65 73 73 61 72 79 2e 20 |e as.necessary. | 000019e0 54 68 69 73 20 69 73 20 75 73 65 64 20 64 75 72 |This is used dur| 000019f0 69 6e 67 20 61 20 73 65 61 72 63 68 20 61 6e 64 |ing a search and| 00001a00 20 72 65 70 6c 61 63 65 2e 20 53 65 65 20 6d 6f | replace. See mo| 00001a10 64 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 0a 65 |de entry point.e| 00001a20 5f 72 65 70 6c 61 63 65 2e 0a 09 5c 45 20 52 31 |_replace...\E R1| 00001a30 3d 66 69 6c 65 20 6f 66 66 73 65 74 20 6f 66 20 |=file offset of | 00001a40 6f 72 69 67 69 6e 61 6c 20 64 61 74 61 0a 09 20 |original data.. | 00001a50 20 20 52 32 3d 6c 65 6e 67 74 68 20 6f 66 20 6f | R2=length of o| 00001a60 72 69 67 69 6e 61 6c 20 64 61 74 61 0a 09 20 20 |riginal data.. | 00001a70 20 52 33 3d 61 64 64 72 65 73 73 20 6f 66 20 72 | R3=address of r| 00001a80 65 70 6c 61 63 65 6d 65 6e 74 20 64 61 74 61 0a |eplacement data.| 00001a90 09 20 20 20 52 34 3d 6c 65 6e 67 74 68 20 6f 66 |. R4=length of| 00001aa0 20 72 65 70 6c 61 63 65 6d 65 6e 74 20 64 61 74 | replacement dat| 00001ab0 61 20 52 38 2f 52 39 0a 09 20 20 20 0a 5a 61 70 |a R8/R9.. .Zap| 00001ac0 5f 50 6c 6f 74 43 61 72 65 74 0a 54 68 69 73 20 |_PlotCaret.This | 00001ad0 63 6f 6d 6d 61 6e 64 20 70 6c 6f 74 73 20 61 20 |command plots a | 00001ae0 63 61 72 65 74 20 69 6e 20 69 74 73 20 6e 65 77 |caret in its new| 00001af0 20 70 6f 73 69 74 69 6f 6e 20 61 75 74 6f 6d 61 | position automa| 00001b00 74 69 63 61 6c 6c 79 20 72 65 6d 6f 76 69 6e 67 |tically removing| 00001b10 20 69 74 20 66 72 6f 6d 0a 69 74 73 20 6f 6c 64 | it from.its old| 00001b20 20 70 6f 73 69 74 69 6f 6e 2e 20 49 65 2c 20 69 | position. Ie, i| 00001b30 74 20 6a 75 73 74 20 63 61 6c 6c 73 20 5a 61 70 |t just calls Zap| 00001b40 5f 43 6c 65 61 72 43 61 72 65 74 20 74 68 65 6e |_ClearCaret then| 00001b50 20 5a 61 70 5f 53 65 74 43 61 72 65 74 2e 0a 09 | Zap_SetCaret...| 00001b60 5c 45 20 52 31 30 3d 63 61 72 65 74 20 62 6c 6f |\E R10=caret blo| 00001b70 63 6b 0a 0a 5a 61 70 5f 52 65 66 6c 65 63 74 43 |ck..Zap_ReflectC| 00001b80 61 72 65 74 0a 54 68 69 73 20 61 63 74 73 20 61 |aret.This acts a| 00001b90 73 20 5a 61 70 5f 50 6c 6f 74 43 61 72 65 74 20 |s Zap_PlotCaret | 00001ba0 62 75 74 20 6f 6e 6c 79 20 75 73 65 73 20 63 5f |but only uses c_| 00001bb0 6f 66 66 2c 20 75 70 64 61 74 69 6e 67 20 74 68 |off, updating th| 00001bc0 65 20 63 5f 6c 6f 66 66 20 61 6e 64 20 63 5f 63 |e c_loff and c_c| 00001bd0 6f 6c 0a 6f 66 66 73 65 74 73 20 66 72 6f 6d 20 |ol.offsets from | 00001be0 74 68 69 73 2e 20 49 65 2c 20 69 74 20 6a 75 73 |this. Ie, it jus| 00001bf0 74 20 63 61 6c 6c 73 20 5a 61 70 5f 55 70 64 61 |t calls Zap_Upda| 00001c00 74 65 43 61 72 65 74 20 74 68 65 6e 20 5a 61 70 |teCaret then Zap| 00001c10 5f 50 6c 6f 74 43 61 72 65 74 2e 0a 09 5c 45 20 |_PlotCaret...\E | 00001c20 52 31 30 3d 63 61 72 65 74 20 62 6c 6f 63 6b 0a |R10=caret block.| 00001c30 0a 5a 61 70 5f 53 65 74 43 61 72 65 74 0a 54 68 |.Zap_SetCaret.Th| 00001c40 69 73 20 75 70 64 61 74 65 73 20 74 68 65 20 61 |is updates the a| 00001c50 72 65 61 20 6f 66 20 74 68 65 20 77 69 6e 64 6f |rea of the windo| 00001c60 77 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 |w containing the| 00001c70 20 74 68 65 20 63 61 72 65 74 20 67 69 76 65 6e | the caret given| 00001c80 20 6f 6e 20 65 6e 74 72 79 2e 0a 48 65 6e 63 65 | on entry..Hence| 00001c90 20 69 74 27 73 20 65 66 66 65 63 74 20 69 73 20 | it's effect is | 00001ca0 75 73 75 61 6c 6c 79 20 74 6f 20 64 72 61 77 20 |usually to draw | 00001cb0 74 68 65 20 63 61 72 65 74 20 61 74 20 69 74 27 |the caret at it'| 00001cc0 73 20 28 6e 65 77 29 20 70 6f 73 69 74 69 6f 6e |s (new) position| 00001cd0 2e 20 53 65 65 0a 45 2d 43 75 72 73 6f 72 73 2e |. See.E-Cursors.| 00001ce0 0a 09 5c 45 20 52 31 30 3d 63 61 72 65 74 20 62 |..\E R10=caret b| 00001cf0 6c 6f 63 6b 0a 0a 5a 61 70 5f 43 6c 65 61 72 43 |lock..Zap_ClearC| 00001d00 61 72 65 74 0a 41 73 20 66 6f 72 20 5a 61 70 5f |aret.As for Zap_| 00001d10 53 65 74 43 61 72 65 74 2c 20 62 75 74 20 69 74 |SetCaret, but it| 00001d20 20 75 70 64 61 74 65 73 20 74 68 65 20 61 72 65 | updates the are| 00001d30 61 20 6f 66 20 74 68 65 20 77 69 6e 64 6f 77 20 |a of the window | 00001d40 77 68 65 72 65 20 74 68 65 20 63 61 72 65 74 0a |where the caret.| 00001d50 6c 61 73 74 20 77 61 73 20 28 73 74 6f 72 65 64 |last was (stored| 00001d60 20 69 6e 20 74 68 65 20 63 5f 6f 2a 20 76 61 72 | in the c_o* var| 00001d70 69 61 62 6c 65 73 29 2e 20 48 65 6e 63 65 20 74 |iables). Hence t| 00001d80 68 65 20 63 61 72 65 74 20 69 73 20 69 6e 20 65 |he caret is in e| 00001d90 66 66 65 63 74 20 72 65 6d 6f 76 65 64 0a 66 72 |ffect removed.fr| 00001da0 6f 6d 20 69 74 73 20 6f 6c 64 20 70 6f 73 69 74 |om its old posit| 00001db0 69 6f 6e 2e 20 53 65 65 20 45 2d 43 75 72 73 6f |ion. See E-Curso| 00001dc0 72 73 2e 0a 09 5c 45 20 52 31 30 3d 63 61 72 65 |rs...\E R10=care| 00001dd0 74 20 62 6c 6f 63 6b 0a 0a 5a 61 70 5f 44 6f 43 |t block..Zap_DoC| 00001de0 6f 6d 6d 61 6e 64 0a 54 68 69 73 20 61 63 74 73 |ommand.This acts| 00001df0 20 61 73 20 5a 61 70 5f 43 6f 6d 6d 61 6e 64 20 | as Zap_Command | 00001e00 62 75 74 20 61 63 74 75 61 6c 6c 79 20 70 65 72 |but actually per| 00001e10 66 6f 72 6d 73 20 74 68 65 20 61 63 74 69 6f 6e |forms the action| 00001e20 20 72 61 74 68 65 72 20 74 68 61 6e 0a 63 61 6c | rather than.cal| 00001e30 6c 69 6e 67 20 74 68 65 20 65 78 74 65 6e 73 69 |ling the extensi| 00001e40 6f 6e 20 6d 6f 64 65 2e 0a 09 5c 45 20 41 73 20 |on mode...\E As | 00001e50 66 6f 72 20 5a 61 70 5f 43 6f 6d 6d 61 6e 64 2e |for Zap_Command.| 00001e60 0a 0a 5a 61 70 5f 53 68 6f 77 43 75 72 73 6f 72 |..Zap_ShowCursor| 00001e70 0a 54 68 69 73 20 63 61 6c 6c 20 6d 61 6b 65 73 |.This call makes| 00001e80 20 73 75 72 65 20 74 68 61 74 20 61 20 67 69 76 | sure that a giv| 00001e90 65 6e 20 63 75 72 73 6f 72 20 63 61 6e 20 62 65 |en cursor can be| 00001ea0 20 73 65 65 6e 20 69 6e 20 69 74 73 20 77 69 6e | seen in its win| 00001eb0 64 6f 77 20 28 62 79 0a 63 68 61 6e 67 69 6e 67 |dow (by.changing| 00001ec0 20 74 68 65 20 73 63 72 6f 6c 6c 20 6f 66 66 73 | the scroll offs| 00001ed0 65 74 73 20 69 66 20 6e 65 63 65 73 73 61 72 79 |ets if necessary| 00001ee0 29 2e 20 49 74 20 64 6f 65 73 20 6e 6f 74 20 72 |). It does not r| 00001ef0 65 64 72 61 77 20 74 68 65 20 63 75 72 73 6f 72 |edraw the cursor| 00001f00 0a 69 6e 20 67 65 6e 65 72 61 6c 20 28 74 68 6f |.in general (tho| 00001f10 75 67 68 20 63 68 61 6e 67 69 6e 67 20 74 68 65 |ugh changing the| 00001f20 20 73 63 72 6f 6c 6c 20 6f 66 66 73 65 74 73 20 | scroll offsets | 00001f30 6d 61 79 20 63 61 75 73 65 20 69 74 20 74 6f 20 |may cause it to | 00001f40 62 65 20 72 65 64 72 61 77 6e 29 2e 0a 09 5c 45 |be redrawn)...\E| 00001f50 20 52 31 30 3d 63 75 72 73 6f 72 20 62 6c 6f 63 | R10=cursor bloc| 00001f60 6b 20 6f 66 20 63 75 72 73 6f 72 20 74 6f 20 73 |k of cursor to s| 00001f70 68 6f 77 0a 0a 5a 61 70 5f 52 65 61 64 56 61 72 |how..Zap_ReadVar| 00001f80 0a 52 65 61 64 73 20 6f 6e 65 20 6f 66 20 5a 61 |.Reads one of Za| 00001f90 70 73 20 69 6e 74 65 72 6e 61 6c 20 76 61 72 69 |ps internal vari| 00001fa0 61 62 6c 65 73 2e 20 53 65 65 20 74 68 65 20 66 |ables. See the f| 00001fb0 69 6c 65 20 45 2d 56 61 72 73 20 66 6f 72 20 74 |ile E-Vars for t| 00001fc0 68 65 20 6e 75 6d 62 65 72 73 2e 0a 09 5c 45 20 |he numbers...\E | 00001fd0 52 31 3d 76 61 72 69 61 62 6c 65 20 6e 75 6d 62 |R1=variable numb| 00001fe0 65 72 2e 0a 09 5c 58 20 52 30 3d 76 61 72 69 61 |er...\X R0=varia| 00001ff0 62 6c 65 20 76 61 6c 75 65 2e 0a 0a 5a 61 70 5f |ble value...Zap_| 00002000 57 72 69 74 65 56 61 72 0a 57 72 69 74 65 73 20 |WriteVar.Writes | 00002010 6f 6e 65 20 6f 66 20 7a 61 70 73 20 69 6e 74 65 |one of zaps inte| 00002020 72 6e 61 6c 20 76 61 72 69 61 62 6c 65 73 2e 20 |rnal variables. | 00002030 53 65 65 20 74 68 65 20 66 69 6c 65 20 45 2d 56 |See the file E-V| 00002040 61 72 73 20 66 6f 72 20 74 68 65 20 6e 75 6d 62 |ars for the numb| 00002050 65 72 73 2e 0a 09 5c 45 20 52 31 3d 76 61 72 69 |ers...\E R1=vari| 00002060 61 62 6c 65 20 6e 75 6d 62 65 72 0a 09 20 20 20 |able number.. | 00002070 52 30 3d 6e 65 77 20 76 61 6c 75 65 0a 0a 5a 61 |R0=new value..Za| 00002080 70 5f 53 61 76 65 46 69 6c 65 0a 54 68 69 73 20 |p_SaveFile.This | 00002090 73 61 76 65 73 20 61 20 66 69 6c 65 20 74 6f 20 |saves a file to | 000020a0 64 69 73 63 20 28 75 73 69 6e 67 20 66 5f 6e 61 |disc (using f_na| 000020b0 6d 65 20 61 73 20 74 68 65 20 66 69 6c 65 20 6e |me as the file n| 000020c0 61 6d 65 29 2e 20 54 68 65 20 66 69 6c 65 20 6d |ame). The file m| 000020d0 61 79 20 6e 6f 74 0a 61 63 74 75 61 6c 6c 79 20 |ay not.actually | 000020e0 62 65 20 73 61 76 65 64 20 69 66 20 61 20 64 69 |be saved if a di| 000020f0 61 6c 6f 67 75 65 20 62 6f 78 20 69 73 20 6f 70 |alogue box is op| 00002100 65 6e 65 64 2e 20 28 45 67 3a 20 27 66 69 6c 65 |ened. (Eg: 'file| 00002110 20 69 73 20 6f 6c 64 65 72 20 74 68 61 6e 0a 76 | is older than.v| 00002120 65 72 73 69 6f 6e 20 6f 6e 20 64 69 73 63 20 62 |ersion on disc b| 00002130 6f 78 27 29 2e 20 50 6c 65 61 73 65 20 6e 6f 74 |ox'). Please not| 00002140 65 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 52 |e the value of R| 00002150 30 20 6f 6e 20 65 78 69 74 21 0a 09 5c 45 20 52 |0 on exit!..\E R| 00002160 38 2f 52 39 20 3d 20 77 69 6e 64 6f 77 20 74 6f |8/R9 = window to| 00002170 20 73 61 76 65 0a 09 5c 58 20 52 30 3d 30 20 20 | save..\X R0=0 | 00002180 3d 3e 20 46 69 6c 65 20 68 61 73 20 62 65 65 6e |=> File has been| 00002190 20 73 61 76 65 64 20 74 6f 20 64 69 73 63 20 2d | saved to disc -| 000021a0 20 79 6f 75 20 63 61 6e 20 6e 6f 77 20 64 65 6c | you can now del| 000021b0 65 74 65 20 69 74 2e 0a 09 20 20 20 52 30 3d 2d |ete it... R0=-| 000021c0 31 20 3d 3e 20 46 69 6c 65 20 68 61 73 20 6e 6f |1 => File has no| 000021d0 74 20 79 65 74 20 62 65 65 6e 20 73 61 76 65 64 |t yet been saved| 000021e0 20 2d 20 77 61 72 6e 69 6e 67 20 77 69 6e 64 6f | - warning windo| 000021f0 77 20 6f 70 65 6e 65 64 20 2f 0a 09 20 20 20 09 |w opened /.. .| 00002200 20 20 20 20 64 61 74 61 20 74 72 61 6e 73 66 65 | data transfe| 00002210 72 20 69 6e 69 74 69 61 74 65 64 2e 0a 0a 5a 61 |r initiated...Za| 00002220 70 5f 46 69 6c 6c 57 6f 72 64 73 0a 46 61 73 74 |p_FillWords.Fast| 00002230 20 77 6f 72 64 20 66 69 6c 6c 69 6e 67 20 63 6f | word filling co| 00002240 64 65 2e 20 54 68 65 20 62 6c 6f 63 6b 20 6d 75 |de. The block mu| 00002250 73 74 20 62 65 20 77 6f 72 64 20 61 6c 69 67 6e |st be word align| 00002260 65 64 2e 20 5a 61 70 20 6e 65 65 64 20 6e 6f 74 |ed. Zap need not| 00002270 20 62 65 20 70 61 67 65 64 0a 69 6e 2e 0a 09 5c | be paged.in...\| 00002280 45 20 52 31 3d 77 6f 72 64 20 74 6f 20 66 69 6c |E R1=word to fil| 00002290 6c 20 77 69 74 68 2e 0a 09 20 20 20 52 32 3d 61 |l with... R2=a| 000022a0 64 64 72 65 73 73 20 6f 66 20 6d 65 6d 6f 72 79 |ddress of memory| 000022b0 20 74 6f 20 66 69 6c 6c 20 28 77 6f 72 64 20 61 | to fill (word a| 000022c0 6c 69 67 6e 65 64 29 2e 0a 09 20 20 20 52 33 3d |ligned)... R3=| 000022d0 6e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 |number of bytes | 000022e0 74 6f 20 66 69 6c 6c 20 28 61 20 6d 75 6c 74 69 |to fill (a multi| 000022f0 70 6c 65 20 6f 66 20 34 29 2e 0a 09 5c 58 20 52 |ple of 4)...\X R| 00002300 30 2d 52 33 20 63 6f 72 72 75 70 74 65 64 2e 0a |0-R3 corrupted..| 00002310 0a 5a 61 70 5f 55 70 64 61 74 65 4c 6e 73 0a 54 |.Zap_UpdateLns.T| 00002320 68 69 73 20 75 70 64 61 74 65 73 20 74 68 65 20 |his updates the | 00002330 6c 69 6e 65 20 6e 75 6d 62 65 72 73 20 63 6f 6c |line numbers col| 00002340 75 6d 6e 20 6f 66 20 61 20 67 69 76 65 6e 20 77 |umn of a given w| 00002350 69 6e 64 6f 77 2e 20 54 68 69 73 20 69 73 20 75 |indow. This is u| 00002360 73 75 61 6c 6c 79 20 64 6f 6e 65 0a 61 75 74 6f |sually done.auto| 00002370 6d 61 74 69 63 61 6c 6c 79 20 62 79 20 5a 61 70 |matically by Zap| 00002380 5f 43 6f 6d 6d 61 6e 64 2e 20 54 68 69 73 20 69 |_Command. This i| 00002390 73 20 75 73 65 64 20 62 79 20 74 68 65 20 42 41 |s used by the BA| 000023a0 53 49 43 20 6d 6f 64 65 20 6f 6e 20 61 20 72 65 |SIC mode on a re| 000023b0 6e 75 6d 62 65 72 2e 0a 09 5c 45 20 52 30 3d 66 |number...\E R0=f| 000023c0 69 72 73 74 20 70 68 79 73 69 63 61 6c 20 6c 69 |irst physical li| 000023d0 6e 65 20 74 6f 20 73 74 61 72 74 20 66 72 6f 6d |ne to start from| 000023e0 20 52 38 2f 52 39 0a 0a 5a 61 70 5f 45 61 63 68 | R8/R9..Zap_Each| 000023f0 57 69 6e 64 6f 77 0a 54 68 69 73 20 73 75 62 20 |Window.This sub | 00002400 63 61 6c 6c 73 20 61 20 67 69 76 65 6e 20 73 75 |calls a given su| 00002410 62 20 66 6f 72 20 65 61 63 68 20 77 69 6e 64 6f |b for each windo| 00002420 77 20 6f 6e 20 61 20 67 69 76 65 6e 20 66 69 6c |w on a given fil| 00002430 65 2e 20 45 61 63 68 20 74 69 6d 65 20 69 74 0a |e. Each time it.| 00002440 63 61 6c 6c 73 20 74 68 65 20 73 75 62 20 70 6f |calls the sub po| 00002450 69 6e 74 65 64 20 74 6f 20 69 6e 20 52 31 30 2c |inted to in R10,| 00002460 20 69 74 20 73 65 74 73 20 75 70 20 52 38 20 66 | it sets up R8 f| 00002470 6f 72 20 74 68 61 74 20 77 69 6e 64 6f 77 2e 0a |or that window..| 00002480 09 5c 45 20 52 30 2d 52 37 3d 61 72 67 73 20 74 |.\E R0-R7=args t| 00002490 6f 20 70 61 73 73 20 74 6f 20 74 68 65 20 73 75 |o pass to the su| 000024a0 62 2e 0a 09 20 20 20 52 39 3d 66 69 6c 65 20 28 |b... R9=file (| 000024b0 77 68 6f 73 65 20 77 69 6e 64 6f 77 73 20 79 6f |whose windows yo| 000024c0 75 20 61 72 65 20 74 6f 20 63 61 6c 6c 29 2e 0a |u are to call)..| 000024d0 09 20 20 20 52 31 30 3d 61 64 64 72 65 73 73 20 |. R10=address | 000024e0 6f 66 20 73 75 62 20 74 6f 20 63 61 6c 6c 20 66 |of sub to call f| 000024f0 6f 72 20 65 61 63 68 20 77 69 6e 64 6f 77 20 6f |or each window o| 00002500 6e 20 74 68 69 73 20 66 69 6c 65 2e 0a 09 54 68 |n this file...Th| 00002510 65 20 73 75 62 20 63 61 6c 6c 65 64 20 68 61 73 |e sub called has| 00002520 3a 0a 09 09 5c 45 20 52 30 2d 52 37 20 61 73 20 |:...\E R0-R7 as | 00002530 73 65 74 20 75 70 20 62 79 20 79 6f 75 0a 09 09 |set up by you...| 00002540 20 20 20 52 38 2f 52 39 20 70 6f 69 6e 74 73 20 | R8/R9 points | 00002550 74 6f 20 74 68 65 20 67 69 76 65 6e 20 77 69 6e |to the given win| 00002560 64 6f 77 0a 09 09 5c 58 20 4d 75 73 74 20 70 72 |dow...\X Must pr| 00002570 65 73 65 72 76 65 20 52 31 2d 52 31 31 20 61 6e |eserve R1-R11 an| 00002580 64 20 56 53 20 6f 6e 20 65 72 72 6f 72 20 65 74 |d VS on error et| 00002590 63 2e 0a 0a 5a 61 70 5f 55 70 64 61 74 65 43 61 |c...Zap_UpdateCa| 000025a0 72 65 74 0a 54 68 69 73 20 73 75 62 20 69 73 20 |ret.This sub is | 000025b0 63 61 6c 6c 65 64 20 74 6f 20 75 70 64 61 74 65 |called to update| 000025c0 20 61 20 63 61 72 65 74 20 70 6f 73 69 74 69 6f | a caret positio| 000025d0 6e 20 66 72 6f 6d 20 61 20 67 69 76 65 6e 20 66 |n from a given f| 000025e0 69 6c 65 20 6f 66 66 73 65 74 2e 20 53 61 76 65 |ile offset. Save| 000025f0 0a 74 68 65 20 6e 65 77 20 6f 66 66 73 65 74 20 |.the new offset | 00002600 6f 66 20 74 68 65 20 63 61 72 65 74 20 69 6e 20 |of the caret in | 00002610 63 5f 6f 66 66 2e 20 43 61 6c 6c 20 74 68 69 73 |c_off. Call this| 00002620 2e 20 54 68 65 6e 20 63 5f 63 6f 6c 2c 20 63 5f |. Then c_col, c_| 00002630 6c 69 6e 65 2c 20 63 5f 6c 6f 66 66 2c 0a 63 5f |line, c_loff,.c_| 00002640 77 69 64 74 68 20 77 69 6c 6c 20 62 65 20 73 65 |width will be se| 00002650 74 20 75 70 2e 20 53 65 65 20 45 2d 43 75 72 73 |t up. See E-Curs| 00002660 6f 72 73 2e 0a 09 5c 45 20 52 31 30 3d 63 61 72 |ors...\E R10=car| 00002670 65 74 20 62 6c 6f 63 6b 0a 0a 5a 61 70 5f 47 65 |et block..Zap_Ge| 00002680 74 57 69 6e 64 53 74 61 74 65 0a 55 70 64 61 74 |tWindState.Updat| 00002690 65 73 20 74 68 65 20 77 69 6e 64 6f 77 20 62 6c |es the window bl| 000026a0 6f 63 6b 20 52 38 20 28 66 69 72 73 74 20 66 65 |ock R8 (first fe| 000026b0 77 20 65 6e 74 72 69 65 73 29 20 62 79 20 63 61 |w entries) by ca| 000026c0 6c 6c 69 6e 67 0a 57 69 6d 70 5f 47 65 74 57 69 |lling.Wimp_GetWi| 000026d0 6e 64 6f 77 53 74 61 74 65 2e 0a 09 5c 45 20 52 |ndowState...\E R| 000026e0 38 0a 0a 5a 61 70 5f 53 74 61 72 74 4f 70 0a 53 |8..Zap_StartOp.S| 000026f0 74 61 72 74 73 20 61 20 73 65 71 75 65 6e 63 65 |tarts a sequence| 00002700 20 6f 66 20 6f 70 65 72 61 74 69 6f 6e 73 2e 20 | of operations. | 00002710 54 68 69 73 20 73 68 6f 75 6c 64 20 62 65 20 75 |This should be u| 00002720 73 65 64 20 77 68 65 6e 20 70 65 72 66 6f 72 6d |sed when perform| 00002730 69 6e 67 20 61 0a 73 65 71 75 65 6e 63 65 20 6f |ing a.sequence o| 00002740 66 20 63 61 6c 6c 73 20 74 6f 20 5a 61 70 5f 43 |f calls to Zap_C| 00002750 6f 6d 6d 61 6e 64 2e 20 49 74 20 63 61 75 73 65 |ommand. It cause| 00002760 73 20 61 6c 6c 20 74 68 65 20 66 69 6c 65 20 63 |s all the file c| 00002770 68 61 6e 67 65 73 20 74 6f 20 62 65 20 6d 61 64 |hanges to be mad| 00002780 65 0a 77 69 74 68 20 6f 6e 6c 79 20 4f 4e 45 20 |e.with only ONE | 00002790 73 63 72 65 65 6e 20 72 65 66 72 65 73 68 2c 20 |screen refresh, | 000027a0 74 68 75 73 20 67 69 76 69 6e 67 20 61 20 6d 75 |thus giving a mu| 000027b0 63 68 20 73 6d 6f 6f 74 68 65 72 20 75 70 64 61 |ch smoother upda| 000027c0 74 65 2e 20 41 66 74 65 72 20 74 68 69 73 0a 68 |te. After this.h| 000027d0 61 73 20 62 65 65 6e 20 63 61 6c 6c 65 64 2c 20 |as been called, | 000027e0 61 6c 6c 20 73 75 62 73 65 71 75 65 6e 74 20 63 |all subsequent c| 000027f0 61 6c 6c 73 20 74 6f 20 5a 61 70 5f 43 6f 6d 6d |alls to Zap_Comm| 00002800 61 6e 64 20 62 65 66 6f 72 65 20 61 20 5a 61 70 |and before a Zap| 00002810 5f 53 74 6f 70 4f 70 20 63 61 6c 6c 0a 68 61 76 |_StopOp call.hav| 00002820 65 20 74 68 65 69 72 20 61 63 74 69 6f 6e 73 20 |e their actions | 00002830 63 6f 6e 63 61 74 65 6e 61 74 65 64 2e 20 57 68 |concatenated. Wh| 00002840 65 6e 20 79 6f 75 20 63 61 6c 6c 20 5a 61 70 5f |en you call Zap_| 00002850 53 74 6f 70 4f 70 20 74 68 65 20 73 63 72 65 65 |StopOp the scree| 00002860 6e 20 69 73 20 74 68 65 6e 0a 75 70 64 61 74 65 |n is then.update| 00002870 64 2e 20 59 6f 75 20 4d 55 53 54 20 63 61 6c 6c |d. You MUST call| 00002880 20 5a 61 70 5f 53 74 6f 70 4f 70 20 62 65 66 6f | Zap_StopOp befo| 00002890 72 65 20 72 65 74 75 72 6e 69 6e 67 20 74 6f 20 |re returning to | 000028a0 57 69 6d 70 5f 50 6f 6c 6c 2e 20 53 74 61 72 74 |Wimp_Poll. Start| 000028b0 4f 70 2f 0a 53 74 6f 70 4f 70 27 73 20 63 61 6e |Op/.StopOp's can| 000028c0 20 62 65 20 6e 65 73 74 65 64 20 74 6f 20 61 6e | be nested to an| 000028d0 79 20 64 65 70 74 68 20 28 73 6f 20 6f 6e 6c 79 |y depth (so only| 000028e0 20 74 68 65 20 6c 61 73 74 20 53 74 6f 70 4f 70 | the last StopOp| 000028f0 20 61 63 74 75 61 6c 6c 79 20 63 61 75 73 65 73 | actually causes| 00002900 0a 74 68 65 20 73 63 72 65 65 6e 20 74 6f 20 62 |.the screen to b| 00002910 65 20 75 70 64 61 74 65 64 29 2e 0a 09 5c 45 20 |e updated)...\E | 00002920 52 39 3d 66 69 6c 65 20 77 68 69 63 68 20 77 69 |R9=file which wi| 00002930 6c 6c 20 62 65 20 6f 70 65 72 61 74 65 64 20 6f |ll be operated o| 00002940 6e 2e 0a 0a 5a 61 70 5f 53 74 6f 70 4f 70 0a 45 |n...Zap_StopOp.E| 00002950 6e 64 73 20 61 20 53 74 61 72 74 4f 70 2f 53 74 |nds a StartOp/St| 00002960 6f 70 4f 70 20 73 74 72 75 63 74 75 72 65 2e 0a |opOp structure..| 00002970 09 5c 45 20 52 39 3d 66 69 6c 65 20 77 68 69 63 |.\E R9=file whic| 00002980 68 20 68 61 73 20 62 65 65 6e 20 6f 70 65 72 61 |h has been opera| 00002990 74 65 64 20 6f 6e 2e 0a 09 5c 58 20 49 66 20 56 |ted on...\X If V| 000029a0 43 20 6f 6e 20 65 6e 74 72 79 20 74 68 65 6e 20 |C on entry then | 000029b0 52 30 20 63 6f 72 72 75 70 74 65 64 20 61 6e 64 |R0 corrupted and| 000029c0 20 52 31 2d 52 31 31 20 70 72 65 73 65 72 76 65 | R1-R11 preserve| 000029d0 64 20 61 73 20 75 73 75 61 6c 2e 0a 09 20 20 20 |d as usual... | 000029e0 49 66 20 56 53 20 6f 6e 20 65 6e 74 72 79 20 74 |If VS on entry t| 000029f0 68 65 6e 20 65 72 72 6f 72 20 70 6f 69 6e 74 65 |hen error pointe| 00002a00 72 20 69 6e 20 52 30 20 61 6e 64 20 56 20 66 6c |r in R0 and V fl| 00002a10 61 67 20 73 74 61 74 75 73 20 61 72 65 0a 09 20 |ag status are.. | 00002a20 20 20 61 6c 73 6f 20 70 72 65 73 65 72 76 65 64 | also preserved| 00002a30 2e 0a 0a 5a 61 70 5f 43 61 6c 6c 4d 6f 64 65 0a |...Zap_CallMode.| 00002a40 43 61 6c 6c 73 20 61 20 6d 6f 64 65 20 65 6e 74 |Calls a mode ent| 00002a50 72 79 20 70 6f 69 6e 74 2e 20 53 65 65 20 45 2d |ry point. See E-| 00002a60 45 6e 74 72 79 20 66 6f 72 20 61 20 6c 69 73 74 |Entry for a list| 00002a70 20 6f 66 20 65 6e 74 72 79 20 70 6f 69 6e 74 73 | of entry points| 00002a80 2e 20 54 68 65 20 6d 6f 64 65 0a 63 61 6c 6c 65 |. The mode.calle| 00002a90 64 20 69 73 20 74 68 65 20 6d 6f 64 65 20 6f 66 |d is the mode of| 00002aa0 20 74 68 65 20 77 69 6e 64 6f 77 20 67 69 76 65 | the window give| 00002ab0 6e 20 69 6e 20 52 38 2e 0a 09 5c 45 20 52 30 2d |n in R8...\E R0-| 00002ac0 52 31 30 3d 70 61 72 61 6d 65 74 65 72 73 20 52 |R10=parameters R| 00002ad0 38 20 52 31 31 3d 6d 6f 64 65 20 65 6e 74 72 79 |8 R11=mode entry| 00002ae0 20 70 6f 69 6e 74 20 6f 66 66 73 65 74 0a 09 5c | point offset..\| 00002af0 58 20 41 73 20 66 6f 72 20 74 68 65 20 67 69 76 |X As for the giv| 00002b00 65 6e 20 6d 6f 64 65 20 65 6e 74 72 79 20 70 6f |en mode entry po| 00002b10 69 6e 74 2e 0a 0a 5a 61 70 5f 43 61 6c 6c 47 69 |int...Zap_CallGi| 00002b20 76 65 6e 4d 6f 64 65 0a 43 61 6c 6c 73 20 61 20 |venMode.Calls a | 00002b30 6d 6f 64 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 |mode entry point| 00002b40 20 6f 66 20 61 20 73 70 65 63 69 66 69 65 64 20 | of a specified | 00002b50 6d 6f 64 65 2e 0a 09 5c 45 20 52 30 2d 52 39 3d |mode...\E R0-R9=| 00002b60 70 61 72 61 6d 65 74 65 72 73 20 52 31 30 3d 6d |parameters R10=m| 00002b70 6f 64 65 20 6e 75 6d 62 65 72 20 52 31 31 3d 65 |ode number R11=e| 00002b80 6e 74 72 79 20 70 6f 69 6e 74 20 6f 66 66 73 65 |ntry point offse| 00002b90 74 0a 09 5c 58 20 41 73 20 66 6f 72 20 74 68 65 |t..\X As for the| 00002ba0 20 67 69 76 65 6e 20 6d 6f 64 65 20 65 6e 74 72 | given mode entr| 00002bb0 79 20 70 6f 69 6e 74 2e 0a 0a 5a 61 70 5f 52 65 |y point...Zap_Re| 00002bc0 61 64 4d 6f 64 65 0a 52 65 61 64 20 74 68 65 20 |adMode.Read the | 00002bd0 61 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 6d |address of the m| 00002be0 6f 64 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 |ode entry point | 00002bf0 74 61 62 6c 65 73 2e 20 54 77 6f 20 70 6f 69 6e |tables. Two poin| 00002c00 74 65 72 73 20 61 72 65 20 72 65 74 75 72 6e 65 |ters are returne| 00002c10 64 2e 0a 54 68 65 20 66 69 72 73 74 20 28 52 30 |d..The first (R0| 00002c20 29 20 69 73 20 61 20 70 6f 69 6e 74 65 72 20 74 |) is a pointer t| 00002c30 6f 20 74 68 65 20 6d 6f 64 65 20 74 61 62 6c 65 |o the mode table| 00002c40 20 61 73 20 73 74 6f 72 65 64 20 69 6e 20 74 68 | as stored in th| 00002c50 65 20 65 78 74 65 6e 73 69 6f 6e 0a 6d 6f 64 75 |e extension.modu| 00002c60 6c 65 20 61 6e 64 20 64 6f 63 75 6d 65 6e 74 65 |le and documente| 00002c70 64 20 69 6e 20 45 2d 45 6e 74 72 79 2e 20 54 68 |d in E-Entry. Th| 00002c80 65 20 73 65 63 6f 6e 64 20 28 52 31 29 20 70 6f |e second (R1) po| 00002c90 69 6e 74 73 20 74 6f 20 61 20 74 61 62 6c 65 20 |ints to a table | 00002ca0 6f 66 20 61 63 74 75 61 6c 0a 61 64 64 72 65 73 |of actual.addres| 00002cb0 73 65 73 20 74 6f 20 62 65 20 63 61 6c 6c 65 64 |ses to be called| 00002cc0 2c 20 77 69 74 68 20 65 6e 74 72 79 20 70 6f 69 |, with entry poi| 00002cd0 6e 74 73 20 77 68 69 63 68 20 77 65 72 65 20 6e |nts which were n| 00002ce0 75 6c 6c 20 69 6e 20 74 68 65 20 6f 72 69 67 69 |ull in the origi| 00002cf0 6e 61 6c 0a 74 61 62 6c 65 20 63 6f 6e 76 65 72 |nal.table conver| 00002d00 74 65 64 20 74 6f 20 61 64 64 72 65 73 73 65 73 |ted to addresses| 00002d10 20 61 6e 64 20 61 6c 6c 20 6f 66 66 73 65 74 73 | and all offsets| 00002d20 20 63 6f 6e 76 65 72 74 65 64 20 74 6f 20 61 64 | converted to ad| 00002d30 64 72 65 73 73 65 73 2e 20 49 6e 20 74 68 69 73 |dresses. In this| 00002d40 0a 74 61 62 6c 65 2c 20 65 61 63 68 20 65 6e 74 |.table, each ent| 00002d50 72 79 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 38 |ry consists of 8| 00002d60 20 62 79 74 65 73 2e 20 54 68 65 20 66 69 72 73 | bytes. The firs| 00002d70 74 20 34 20 62 79 74 65 73 20 67 69 76 65 73 20 |t 4 bytes gives | 00002d80 74 68 65 20 61 64 64 72 65 73 73 20 6f 66 0a 74 |the address of.t| 00002d90 68 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 2c 20 |he entry point, | 00002da0 61 6e 64 20 74 68 65 20 6e 65 78 74 20 34 20 74 |and the next 4 t| 00002db0 68 65 20 76 61 6c 75 65 20 74 6f 20 70 61 73 73 |he value to pass| 00002dc0 20 69 6e 20 52 31 31 20 77 68 65 6e 20 74 68 65 | in R11 when the| 00002dd0 20 65 6e 74 72 79 20 70 6f 69 6e 74 0a 69 73 20 | entry point.is | 00002de0 63 61 6c 6c 65 64 2e 20 54 68 69 73 20 77 69 6c |called. This wil| 00002df0 6c 20 6f 62 76 69 6f 75 73 6c 79 20 76 61 72 79 |l obviously vary| 00002e00 20 69 66 20 73 6f 6d 65 20 6d 6f 64 65 20 65 6e | if some mode en| 00002e10 74 72 79 20 70 6f 69 6e 74 73 20 61 72 65 20 62 |try points are b| 00002e20 61 73 65 64 20 6f 6e 0a 6f 74 68 65 72 20 6d 6f |ased on.other mo| 00002e30 64 65 73 2e 20 54 68 75 73 20 74 68 65 20 6c 69 |des. Thus the li| 00002e40 6e 6b 65 64 20 74 61 62 6c 65 20 68 61 73 20 74 |nked table has t| 00002e50 68 65 20 66 6f 72 6d 3a 0a 09 65 5f 6d 6f 64 75 |he form:..e_modu| 00002e60 6c 65 09 23 30 09 6d 6f 64 75 6c 65 20 61 64 64 |le.#0.module add| 00002e70 72 65 73 73 2c 09 6d 6f 64 75 6c 65 20 77 6f 72 |ress,.module wor| 00002e80 6b 73 70 61 63 65 20 61 64 64 72 65 73 73 0a 09 |kspace address..| 00002e90 65 5f 74 69 74 6c 65 09 09 23 38 09 74 69 74 6c |e_title..#8.titl| 00002ea0 65 20 61 64 64 72 65 73 73 2c 09 75 6e 64 65 66 |e address,.undef| 00002eb0 69 6e 65 64 0a 09 65 5f 61 75 74 68 6f 72 09 23 |ined..e_author.#| 00002ec0 31 36 09 61 75 74 68 6f 72 20 61 64 64 72 65 73 |16.author addres| 00002ed0 73 2c 09 75 6e 64 65 66 69 6e 65 64 0a 09 65 5f |s,.undefined..e_| 00002ee0 62 61 73 65 6d 6f 64 65 09 23 32 34 09 62 61 73 |basemode.#24.bas| 00002ef0 65 6d 6f 64 65 2c 09 75 6e 64 65 66 69 6e 65 64 |emode,.undefined| 00002f00 0a 09 65 5f 6d 6f 64 65 09 09 23 33 32 09 6d 6f |..e_mode..#32.mo| 00002f10 64 65 20 6e 75 6d 62 65 72 2c 09 75 6e 64 65 66 |de number,.undef| 00002f20 69 6e 65 64 0a 09 65 5f 69 6e 69 74 09 09 23 34 |ined..e_init..#4| 00002f30 30 09 69 6e 69 74 20 63 6f 64 65 20 61 64 64 72 |0.init code addr| 00002f40 2c 09 76 61 6c 75 65 20 74 6f 20 70 61 73 73 20 |,.value to pass | 00002f50 69 6e 20 52 31 31 0a 09 65 5f 6d 65 6e 75 09 09 |in R11..e_menu..| 00002f60 23 34 38 09 77 69 6d 70 20 6d 65 6e 75 20 64 61 |#48.wimp menu da| 00002f70 74 61 2c 09 75 6e 64 65 66 69 6e 65 64 0a 09 65 |ta,.undefined..e| 00002f80 5f 6c 65 6e 09 09 23 35 36 09 75 6e 64 65 66 69 |_len..#56.undefi| 00002f90 6e 65 64 2c 09 75 6e 64 65 66 69 6e 65 64 0a 09 |ned,.undefined..| 00002fa0 65 5f 70 6f 73 74 6c 6f 61 64 09 23 36 34 09 70 |e_postload.#64.p| 00002fb0 6f 73 74 6c 6f 61 64 20 61 64 64 72 2c 09 76 61 |ostload addr,.va| 00002fc0 6c 75 65 20 74 6f 20 70 61 73 73 20 69 6e 20 52 |lue to pass in R| 00002fd0 31 31 0a 09 20 61 6e 64 20 74 68 65 20 72 65 73 |11.. and the res| 00002fe0 74 20 61 73 20 66 6f 72 20 65 5f 70 6f 73 74 6c |t as for e_postl| 00002ff0 6f 61 64 2e 0a 49 20 72 65 73 65 72 76 65 64 20 |oad..I reserved | 00003000 74 68 65 20 72 69 67 68 74 20 74 6f 20 75 73 65 |the right to use| 00003010 20 74 68 65 20 75 6e 64 65 66 69 6e 65 64 20 77 | the undefined w| 00003020 6f 72 64 73 20 69 6e 20 66 75 74 75 72 65 2e 20 |ords in future. | 00003030 59 6f 75 20 63 61 6e 20 63 68 61 6e 67 65 20 74 |You can change t| 00003040 68 65 0a 74 61 62 6c 65 20 65 6e 74 72 69 65 73 |he.table entries| 00003050 20 70 6f 69 6e 74 65 72 20 74 6f 20 69 6e 20 52 | pointer to in R| 00003060 31 2c 20 62 75 74 20 49 20 64 6f 6e 27 74 20 61 |1, but I don't a| 00003070 64 76 69 73 65 20 69 74 20 3a 2d 29 0a 09 5c 45 |dvise it :-)..\E| 00003080 20 52 30 3d 6d 6f 64 65 20 6e 75 6d 62 65 72 2e | R0=mode number.| 00003090 0a 09 5c 58 20 52 30 3d 70 6f 69 6e 74 65 72 20 |..\X R0=pointer | 000030a0 74 6f 20 75 6e 6c 69 6e 6b 65 64 20 74 61 62 6c |to unlinked tabl| 000030b0 65 20 69 6e 20 6d 6f 64 65 73 20 6d 6f 64 75 6c |e in modes modul| 000030c0 65 20 2f 20 3c 3d 30 20 69 66 20 69 6e 76 61 6c |e / <=0 if inval| 000030d0 69 64 0a 09 20 20 20 52 31 3d 70 6f 69 6e 74 65 |id.. R1=pointe| 000030e0 72 20 74 6f 20 6c 69 6e 6b 65 64 20 74 61 62 6c |r to linked tabl| 000030f0 65 20 69 6e 20 7a 61 70 73 20 77 6f 72 6b 73 70 |e in zaps worksp| 00003100 61 63 65 20 2f 20 3c 3d 30 20 69 66 20 69 6e 76 |ace / <=0 if inv| 00003110 61 6c 69 64 0a 0a 5a 61 70 5f 46 69 6e 64 46 69 |alid..Zap_FindFi| 00003120 6c 65 0a 47 69 76 65 6e 20 74 68 65 20 6e 61 6d |le.Given the nam| 00003130 65 20 6f 66 20 61 20 66 69 6c 65 2c 20 74 68 69 |e of a file, thi| 00003140 73 20 63 61 6c 6c 20 70 72 6f 64 75 63 65 73 20 |s call produces | 00003150 61 20 77 69 6e 64 6f 77 20 6f 6e 20 74 68 61 74 |a window on that| 00003160 20 66 69 6c 65 20 28 6c 6f 61 64 69 6e 67 0a 69 | file (loading.i| 00003170 74 20 69 66 20 6e 65 63 65 73 73 61 72 79 29 2e |t if necessary).| 00003180 20 50 61 74 68 20 69 73 20 63 61 6e 6f 6e 69 63 | Path is canonic| 00003190 61 6c 69 73 65 64 20 62 65 66 6f 72 65 20 63 6f |alised before co| 000031a0 6d 70 61 72 69 6e 67 20 77 69 74 68 20 63 75 72 |mparing with cur| 000031b0 72 65 6e 74 6c 79 0a 6c 6f 61 64 65 64 20 66 69 |rently.loaded fi| 000031c0 6c 65 73 2e 0a 09 5c 45 20 52 30 3d 66 69 6c 65 |les...\E R0=file| 000031d0 20 6e 61 6d 65 2e 0a 09 5c 58 20 52 38 2f 52 39 | name...\X R8/R9| 000031e0 3d 77 69 6e 64 6f 77 20 6f 6e 20 74 68 61 74 20 |=window on that | 000031f0 66 69 6c 65 2e 0a 0a 5a 61 70 5f 46 69 6e 64 57 |file...Zap_FindW| 00003200 69 6e 64 6f 77 0a 47 69 76 65 6e 20 61 20 66 69 |indow.Given a fi| 00003210 6c 65 20 62 6c 6f 63 6b 20 70 6f 69 6e 74 65 72 |le block pointer| 00003220 20 6f 66 20 61 20 66 69 6c 65 20 61 6c 72 65 61 | of a file alrea| 00003230 64 79 20 6c 6f 61 64 65 64 2c 20 74 68 69 73 20 |dy loaded, this | 00003240 63 61 6c 6c 20 70 72 6f 64 75 63 65 73 20 61 0a |call produces a.| 00003250 77 69 6e 64 6f 77 20 62 6c 6f 63 6b 20 70 6f 69 |window block poi| 00003260 6e 74 65 72 20 6f 66 20 61 20 77 69 6e 64 6f 77 |nter of a window| 00003270 20 6f 6e 20 74 68 61 74 20 66 69 6c 65 20 28 6f | on that file (o| 00003280 70 65 6e 69 6e 67 20 69 74 20 69 66 20 6e 65 63 |pening it if nec| 00003290 65 73 73 61 72 79 29 2e 0a 09 5c 45 20 52 39 0a |essary)...\E R9.| 000032a0 09 5c 58 20 52 38 0a 0a 5a 61 70 5f 43 6f 6e 76 |.\X R8..Zap_Conv| 000032b0 57 69 6e 64 4f 66 66 0a 43 6f 6e 76 65 72 74 73 |WindOff.Converts| 000032c0 20 61 20 77 69 6e 64 6f 77 20 6f 66 66 73 65 74 | a window offset| 000032d0 20 74 6f 20 61 20 77 69 6e 64 6f 77 20 62 6c 6f | to a window blo| 000032e0 63 6b 20 70 6f 69 6e 74 65 72 2e 20 53 65 65 20 |ck pointer. See | 000032f0 45 2d 57 69 6e 64 6f 77 73 2e 0a 09 5c 45 20 52 |E-Windows...\E R| 00003300 30 3d 6f 66 66 73 65 74 20 6f 66 20 61 20 77 69 |0=offset of a wi| 00003310 6e 64 6f 77 20 69 6e 20 74 68 65 20 77 69 6e 64 |ndow in the wind| 00003320 6f 77 20 6c 69 73 74 20 2f 2d 76 65 0a 09 5c 58 |ow list /-ve..\X| 00003330 20 52 38 2f 52 39 3d 77 69 6e 64 6f 77 20 61 6e | R8/R9=window an| 00003340 64 20 66 69 6c 65 20 2f 30 0a 0a 5a 61 70 5f 43 |d file /0..Zap_C| 00003350 6f 6e 76 46 69 6c 65 4f 66 66 0a 43 6f 6e 76 65 |onvFileOff.Conve| 00003360 72 74 73 20 61 20 66 69 6c 65 20 6f 66 66 73 65 |rts a file offse| 00003370 74 20 74 6f 20 61 20 66 69 6c 65 20 62 6c 6f 63 |t to a file bloc| 00003380 6b 20 70 6f 69 6e 74 65 72 2e 20 53 65 65 20 45 |k pointer. See E| 00003390 2d 46 69 6c 65 2e 0a 09 5c 45 20 52 30 3d 6f 66 |-File...\E R0=of| 000033a0 66 73 65 74 20 6f 66 20 61 20 66 69 6c 65 20 69 |fset of a file i| 000033b0 6e 20 74 68 65 20 66 69 6c 65 20 6c 69 73 74 2f |n the file list/| 000033c0 2d 76 65 0a 09 5c 58 20 52 39 3d 70 6f 69 6e 74 |-ve..\X R9=point| 000033d0 65 72 73 20 74 6f 20 74 68 65 20 66 69 6c 65 20 |ers to the file | 000033e0 62 6c 6f 63 6b 2f 30 0a 0a 5a 61 70 5f 47 65 74 |block/0..Zap_Get| 000033f0 57 69 6e 64 4f 66 66 0a 43 6f 6e 76 65 72 74 73 |WindOff.Converts| 00003400 20 61 20 77 69 6e 64 6f 77 20 62 6c 6f 63 6b 20 | a window block | 00003410 70 6f 69 6e 74 65 72 20 74 6f 20 61 20 77 69 6e |pointer to a win| 00003420 64 6f 77 20 6f 66 66 73 65 74 2e 20 53 65 65 20 |dow offset. See | 00003430 45 2d 57 69 6e 64 6f 77 73 2e 0a 09 5c 45 20 52 |E-Windows...\E R| 00003440 38 3d 77 69 6e 64 6f 77 20 62 6c 6f 63 6b 20 70 |8=window block p| 00003450 6f 69 6e 74 65 72 2f 30 0a 09 5c 58 20 52 30 3d |ointer/0..\X R0=| 00003460 6f 66 66 73 65 74 20 69 6e 20 74 68 65 20 77 69 |offset in the wi| 00003470 6e 64 6f 77 20 6c 69 73 74 2f 2d 76 65 0a 0a 5a |ndow list/-ve..Z| 00003480 61 70 5f 47 65 74 46 69 6c 65 4f 66 66 0a 43 6f |ap_GetFileOff.Co| 00003490 6e 76 65 72 74 73 20 61 20 66 69 6c 65 20 62 6c |nverts a file bl| 000034a0 6f 63 6b 20 70 6f 69 6e 74 65 72 20 74 6f 20 61 |ock pointer to a| 000034b0 20 66 69 6c 65 20 6f 66 66 73 65 74 2e 20 53 65 | file offset. Se| 000034c0 65 20 45 2d 46 69 6c 65 2e 0a 09 5c 45 20 52 39 |e E-File...\E R9| 000034d0 3d 66 69 6c 65 20 62 6c 6f 63 6b 20 70 6f 69 6e |=file block poin| 000034e0 74 65 72 2f 30 0a 09 5c 58 20 52 30 3d 6f 66 66 |ter/0..\X R0=off| 000034f0 73 65 74 20 69 6e 20 74 68 65 20 66 69 6c 65 20 |set in the file | 00003500 6c 69 73 74 2f 2d 76 65 0a 0a 5a 61 70 5f 47 6f |list/-ve..Zap_Go| 00003510 74 6f 4f 66 66 73 65 74 0a 54 68 69 73 20 63 61 |toOffset.This ca| 00003520 6c 6c 20 63 61 75 73 65 73 20 74 68 65 20 67 69 |ll causes the gi| 00003530 76 65 6e 20 63 75 72 73 6f 72 20 74 6f 20 6a 75 |ven cursor to ju| 00003540 6d 70 20 74 6f 20 61 20 67 69 76 65 6e 20 66 69 |mp to a given fi| 00003550 6c 65 20 6f 66 66 73 65 74 2c 20 6c 65 61 76 69 |le offset, leavi| 00003560 6e 67 20 61 0a 6d 61 72 6b 20 62 65 68 69 6e 64 |ng a.mark behind| 00003570 20 61 74 20 74 68 65 20 70 72 65 76 69 6f 75 73 | at the previous| 00003580 20 70 6f 73 69 74 69 6f 6e 2e 0a 09 5c 45 20 52 | position...\E R| 00003590 30 3d 6f 66 66 73 65 74 20 74 6f 20 67 6f 20 74 |0=offset to go t| 000035a0 6f 20 52 38 2d 52 39 3d 66 69 6c 65 20 52 31 30 |o R8-R9=file R10| 000035b0 3d 63 75 72 73 6f 72 0a 0a 5a 61 70 5f 4a 75 6d |=cursor..Zap_Jum| 000035c0 70 74 6f 4f 66 66 73 65 74 0a 41 73 20 66 6f 72 |ptoOffset.As for| 000035d0 20 47 6f 74 6f 4f 66 66 73 65 74 20 62 75 74 20 | GotoOffset but | 000035e0 6e 6f 20 6d 61 72 6b 20 6c 65 66 74 20 6f 6e 20 |no mark left on | 000035f0 6a 75 6d 70 69 6e 67 2e 0a 09 5c 45 20 52 30 3d |jumping...\E R0=| 00003600 6f 66 66 73 65 74 20 74 6f 20 67 6f 20 74 6f 20 |offset to go to | 00003610 52 38 2d 52 39 3d 66 69 6c 65 20 52 31 30 3d 63 |R8-R9=file R10=c| 00003620 75 72 73 6f 72 0a 0a 5a 61 70 5f 46 69 6e 64 4f |ursor..Zap_FindO| 00003630 66 66 73 65 74 0a 47 69 76 65 6e 20 74 68 65 20 |ffset.Given the | 00003640 28 78 2c 79 29 20 70 6f 73 69 74 69 6f 6e 20 69 |(x,y) position i| 00003650 6e 20 77 6f 72 6b 20 61 72 65 61 20 63 68 61 72 |n work area char| 00003660 61 63 74 65 72 73 2c 20 66 69 6e 64 73 20 74 68 |acters, finds th| 00003670 65 20 66 69 6c 65 20 6f 66 66 73 65 74 20 6f 66 |e file offset of| 00003680 0a 74 68 65 20 27 6e 65 61 72 65 73 74 27 20 70 |.the 'nearest' p| 00003690 6f 69 6e 74 20 69 6e 20 74 68 65 20 66 69 6c 65 |oint in the file| 000036a0 2e 20 53 65 65 20 45 2d 57 69 6e 64 6f 77 73 2e |. See E-Windows.| 000036b0 0a 09 5c 45 20 52 32 3d 78 20 63 6f 6c 75 6d 6e |..\E R2=x column| 000036c0 20 28 69 6e 63 20 6d 61 72 67 69 6e 29 20 52 33 | (inc margin) R3| 000036d0 3d 79 20 72 6f 77 20 28 66 72 6f 6d 20 74 6f 70 |=y row (from top| 000036e0 29 0a 09 5c 58 20 52 30 3d 66 69 6c 65 20 6f 66 |)..\X R0=file of| 000036f0 66 73 65 74 20 52 31 3d 66 69 6c 65 20 6f 66 66 |fset R1=file off| 00003700 73 65 74 20 6f 66 20 70 68 79 73 69 63 61 6c 20 |set of physical | 00003710 6c 69 6e 65 20 73 74 61 72 74 20 52 32 2f 52 33 |line start R2/R3| 00003720 20 63 6c 69 70 70 65 64 0a 0a 5a 61 70 5f 4e 65 | clipped..Zap_Ne| 00003730 77 46 69 6c 65 54 69 74 6c 65 0a 55 70 64 61 74 |wFileTitle.Updat| 00003740 65 20 74 68 65 20 74 69 74 6c 65 62 61 72 73 20 |e the titlebars | 00003750 6f 66 20 61 6c 6c 20 77 69 6e 64 6f 77 73 20 6f |of all windows o| 00003760 6e 20 61 20 67 69 76 65 6e 20 66 69 6c 65 2e 0a |n a given file..| 00003770 09 5c 45 20 52 39 3d 66 69 6c 65 0a 0a 5a 61 70 |.\E R9=file..Zap| 00003780 5f 49 6e 73 65 72 74 53 74 72 69 6e 67 0a 49 6e |_InsertString.In| 00003790 73 65 72 74 73 20 61 20 73 74 72 69 6e 67 20 61 |serts a string a| 000037a0 74 20 74 68 65 20 65 6e 64 20 6f 66 20 61 20 62 |t the end of a b| 000037b0 75 66 66 65 72 20 75 73 69 6e 67 20 5a 61 70 5f |uffer using Zap_| 000037c0 43 6f 6d 6d 61 6e 64 2e 0a 09 5c 45 20 52 30 3d |Command...\E R0=| 000037d0 7a 65 72 6f 20 74 65 72 6d 69 6e 61 74 65 64 20 |zero terminated | 000037e0 73 74 72 69 6e 67 20 52 38 2f 52 39 0a 0a 5a 61 |string R8/R9..Za| 000037f0 70 5f 43 72 65 61 74 65 46 69 6c 65 0a 43 72 65 |p_CreateFile.Cre| 00003800 61 74 65 73 20 61 6e 20 65 6d 70 74 79 20 66 69 |ates an empty fi| 00003810 6c 65 2c 20 70 6f 73 73 69 62 6c 79 20 63 68 61 |le, possibly cha| 00003820 6e 67 69 6e 67 20 74 68 65 20 6f 70 74 5f 66 6c |nging the opt_fl| 00003830 61 67 73 2f 66 6f 72 6d 61 74 20 76 69 61 20 42 |ags/format via B| 00003840 49 43 20 27 6d 61 73 6b 27 0a 45 4f 52 20 27 65 |IC 'mask'.EOR 'e| 00003850 6f 72 27 20 77 68 65 6e 20 63 72 65 61 74 69 6e |or' when creatin| 00003860 67 20 69 74 2e 20 53 65 65 20 45 2d 46 6c 61 67 |g it. See E-Flag| 00003870 73 2c 20 45 2d 57 69 6e 64 6f 77 73 2e 20 49 74 |s, E-Windows. It| 00003880 20 63 61 6c 6c 73 0a 5a 61 70 5f 43 72 65 61 74 | calls.Zap_Creat| 00003890 65 57 69 6e 64 42 6c 6f 63 6b 20 61 6e 64 20 5a |eWindBlock and Z| 000038a0 61 70 5f 43 72 65 61 74 65 46 69 6c 65 42 6c 6f |ap_CreateFileBlo| 000038b0 63 6b 20 65 74 63 2e 0a 09 5c 45 20 52 30 3d 66 |ck etc...\E R0=f| 000038c0 69 6c 65 20 74 79 70 65 0a 09 20 20 20 52 31 3d |ile type.. R1=| 000038d0 66 6c 61 67 73 20 6d 61 73 6b 0a 09 20 20 20 52 |flags mask.. R| 000038e0 32 3d 66 6c 61 67 73 20 65 6f 72 0a 09 20 20 20 |2=flags eor.. | 000038f0 52 33 3d 66 6f 72 6d 61 74 20 6d 61 73 6b 0a 09 |R3=format mask..| 00003900 20 20 20 52 34 3d 66 6f 72 6d 61 74 20 65 6f 72 | R4=format eor| 00003910 0a 09 5c 58 20 52 38 2f 52 39 3d 6e 65 77 6c 79 |..\X R8/R9=newly| 00003920 20 63 72 65 61 74 65 64 20 66 69 6c 65 20 28 77 | created file (w| 00003930 69 74 68 20 6f 70 65 6e 20 77 69 6e 64 6f 77 29 |ith open window)| 00003940 2e 0a 0a 5a 61 70 5f 4e 65 77 4c 69 6e 6b 45 6e |...Zap_NewLinkEn| 00003950 74 72 79 0a 41 64 64 73 20 61 20 6e 65 77 20 6c |try.Adds a new l| 00003960 69 6e 6b 20 65 6e 74 72 79 20 74 6f 20 74 68 65 |ink entry to the| 00003970 20 66 5f 6c 69 6e 6b 73 20 6c 69 73 74 2e 20 53 | f_links list. S| 00003980 65 65 20 45 2d 46 69 6c 65 20 66 6f 72 20 64 65 |ee E-File for de| 00003990 73 63 72 69 70 74 69 6f 6e 20 6f 66 20 74 68 65 |scription of the| 000039a0 0a 6c 69 6e 6b 73 20 6c 69 73 74 20 66 6f 72 6d |.links list form| 000039b0 61 74 2e 20 54 68 69 73 20 69 73 20 75 73 65 64 |at. This is used| 000039c0 20 62 79 20 74 68 72 6f 77 62 61 63 6b 2e 20 41 | by throwback. A| 000039d0 20 6e 65 77 20 62 6c 6f 63 6b 20 69 73 20 63 72 | new block is cr| 000039e0 65 61 74 65 64 20 69 66 20 74 68 65 0a 66 69 6c |eated if the.fil| 000039f0 65 20 6e 61 6d 65 20 64 6f 65 73 20 6e 6f 74 20 |e name does not | 00003a00 6d 61 74 63 68 20 74 68 61 74 20 6f 66 20 74 68 |match that of th| 00003a10 65 20 70 72 65 76 69 6f 75 73 20 6c 69 6e 6b 20 |e previous link | 00003a20 62 6c 6f 63 6b 2c 20 6f 72 20 74 68 65 20 66 6c |block, or the fl| 00003a30 61 67 73 0a 64 69 66 66 65 72 2e 20 54 68 65 20 |ags.differ. The | 00003a40 70 6f 69 6e 74 20 6f 66 20 74 68 65 20 6c 69 6e |point of the lin| 00003a50 6b 73 20 69 73 20 74 68 61 74 20 74 68 65 79 20 |ks is that they | 00003a60 61 72 65 20 75 70 64 61 74 65 64 20 77 68 65 6e |are updated when| 00003a70 20 63 68 61 6e 67 65 73 20 61 72 65 20 6d 61 64 | changes are mad| 00003a80 65 0a 74 6f 20 74 68 65 20 69 6e 64 69 63 61 74 |e.to the indicat| 00003a90 65 64 20 66 69 6c 65 2e 0a 09 5c 45 20 52 30 3d |ed file...\E R0=| 00003aa0 64 61 74 61 20 77 6f 72 64 20 28 49 65 20 66 69 |data word (Ie fi| 00003ab0 6c 65 20 6f 66 66 73 65 74 20 6f 66 20 6c 69 6e |le offset of lin| 00003ac0 6b 20 2f 20 6c 69 6e 65 20 6e 75 6d 62 65 72 20 |k / line number | 00003ad0 6f 66 20 6c 69 6e 6b 0a 09 20 20 20 20 20 20 64 |of link.. d| 00003ae0 65 70 65 6e 64 69 6e 67 20 6f 6e 20 66 6c 61 67 |epending on flag| 00003af0 73 20 69 6e 20 52 35 29 2e 0a 09 20 20 20 52 31 |s in R5)... R1| 00003b00 3d 66 69 6c 65 6e 61 6d 65 20 28 4f 66 20 74 68 |=filename (Of th| 00003b10 65 20 66 69 6c 65 20 74 68 61 74 20 52 30 20 69 |e file that R0 i| 00003b20 73 20 61 6e 20 6f 66 66 73 65 74 20 69 6e 29 2e |s an offset in).| 00003b30 0a 09 20 20 20 52 34 3d 66 69 6c 65 20 6f 66 66 |.. R4=file off| 00003b40 73 65 74 2f 2d 31 20 28 49 65 2c 20 6f 66 66 73 |set/-1 (Ie, offs| 00003b50 65 74 20 69 6e 20 66 69 6c 65 20 6c 69 73 74 20 |et in file list | 00003b60 6f 66 20 74 68 65 20 66 69 6c 65 20 6e 61 6d 65 |of the file name| 00003b70 64 20 69 6e 0a 09 20 20 20 20 20 20 20 52 31 20 |d in.. R1 | 00003b80 69 66 20 74 68 65 20 66 69 6c 65 20 69 73 20 6c |if the file is l| 00003b90 6f 61 64 65 64 2c 20 6f 72 20 2d 31 20 69 66 20 |oaded, or -1 if | 00003ba0 79 6f 75 20 64 6f 6e 27 74 20 6b 6e 6f 77 20 69 |you don't know i| 00003bb0 66 20 74 68 65 20 66 69 6c 65 0a 09 20 20 20 20 |f the file.. | 00003bc0 20 20 20 69 73 20 6c 6f 61 64 65 64 20 6f 72 20 | is loaded or | 00003bd0 6e 6f 74 20 2d 20 75 73 75 61 6c 6c 79 20 73 61 |not - usually sa| 00003be0 66 65 73 74 20 74 6f 20 70 75 74 20 61 73 20 2d |fest to put as -| 00003bf0 31 29 2e 0a 09 20 20 20 52 35 3d 66 6c 61 67 73 |1)... R5=flags| 00003c00 20 28 61 73 20 64 6f 63 75 6d 65 6e 74 65 64 20 | (as documented | 00003c10 75 6e 64 65 72 20 66 5f 6c 69 6e 6b 73 20 69 6e |under f_links in| 00003c20 20 45 2d 46 69 6c 65 29 2e 0a 09 20 20 20 52 39 | E-File)... R9| 00003c30 3d 66 69 6c 65 20 74 6f 20 77 68 69 63 68 20 74 |=file to which t| 00003c40 68 65 20 6c 69 6e 6b 20 73 68 6f 75 6c 64 20 62 |he link should b| 00003c50 65 20 61 64 64 65 64 20 2d 20 69 65 20 74 68 69 |e added - ie thi| 00003c60 73 20 69 73 20 74 68 65 0a 09 20 20 20 20 20 20 |s is the.. | 00003c70 74 68 72 6f 77 62 61 63 6b 20 62 75 66 66 65 72 |throwback buffer| 00003c80 20 66 69 6c 65 20 61 73 20 6f 70 70 6f 73 65 64 | file as opposed| 00003c90 20 74 6f 20 52 31 20 77 68 69 63 68 20 69 73 20 | to R1 which is | 00003ca0 74 68 65 20 66 69 6c 65 20 67 69 76 69 6e 67 0a |the file giving.| 00003cb0 09 20 20 20 20 20 20 74 68 65 20 43 20 70 72 6f |. the C pro| 00003cc0 67 72 61 6d 20 2f 20 66 69 6c 65 20 77 68 69 63 |gram / file whic| 00003cd0 68 20 77 61 73 20 73 65 61 72 63 68 65 64 20 74 |h was searched t| 00003ce0 68 72 6f 75 67 68 2e 0a 09 5c 58 20 52 30 3d 30 |hrough...\X R0=0| 00003cf0 20 69 66 20 6c 69 6e 6b 20 61 64 64 65 64 20 74 | if link added t| 00003d00 6f 20 6c 61 73 74 20 6c 69 73 74 20 65 6e 74 72 |o last list entr| 00003d10 79 2f 31 20 69 66 20 6e 65 77 20 65 6e 74 72 79 |y/1 if new entry| 00003d20 20 63 72 65 61 74 65 64 2e 0a 0a 5a 61 70 5f 44 | created...Zap_D| 00003d30 65 66 61 75 6c 74 43 6c 69 63 6b 0a 43 61 6c 6c |efaultClick.Call| 00003d40 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 6d 6f |s the default mo| 00003d50 75 73 65 20 63 6c 69 63 6b 20 68 61 6e 64 6c 69 |use click handli| 00003d60 6e 67 20 63 6f 64 65 2e 20 53 65 65 20 74 68 65 |ng code. See the| 00003d70 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 65 5f 63 | entry point e_c| 00003d80 6c 69 63 6b 2e 0a 09 5c 45 20 52 31 3d 64 65 70 |lick...\E R1=dep| 00003d90 74 68 20 28 30 3d 64 72 61 67 20 31 3d 63 6c 69 |th (0=drag 1=cli| 00003da0 63 6b 20 32 3d 64 6f 75 62 6c 65 20 63 6c 69 63 |ck 2=double clic| 00003db0 6b 20 65 74 63 29 0a 09 20 20 20 52 32 3d 78 20 |k etc).. R2=x | 00003dc0 52 33 3d 79 0a 09 20 20 20 52 34 3d 62 75 74 74 |R3=y.. R4=butt| 00003dd0 6f 6e 73 0a 09 20 20 20 52 38 2f 52 39 20 61 73 |ons.. R8/R9 as| 00003de0 20 66 6f 72 20 65 5f 63 6c 69 63 6b 2e 0a 0a 5a | for e_click...Z| 00003df0 61 70 5f 50 75 74 43 61 72 65 74 0a 53 65 74 73 |ap_PutCaret.Sets| 00003e00 20 73 74 61 6e 64 61 72 64 20 63 75 72 73 6f 72 | standard cursor| 00003e10 20 65 64 69 74 69 6e 67 20 6d 6f 64 65 20 61 6e | editing mode an| 00003e20 64 20 70 75 74 73 20 74 68 65 20 63 75 72 73 6f |d puts the curso| 00003e30 72 20 63 61 72 65 74 20 61 74 20 61 20 67 69 76 |r caret at a giv| 00003e40 65 6e 20 66 69 6c 65 0a 6f 66 66 73 65 74 20 69 |en file.offset i| 00003e50 6e 20 61 20 67 69 76 65 6e 20 66 69 6c 65 2e 0a |n a given file..| 00003e60 09 5c 45 20 52 30 3d 66 69 6c 65 20 6f 66 66 73 |.\E R0=file offs| 00003e70 65 74 20 52 38 2f 52 39 3d 66 69 6c 65 0a 0a 5a |et R8/R9=file..Z| 00003e80 61 70 5f 44 69 73 63 61 72 64 46 69 6c 65 0a 4b |ap_DiscardFile.K| 00003e90 69 6c 6c 20 61 20 66 69 6c 65 20 61 6e 64 20 61 |ill a file and a| 00003ea0 6c 6c 20 77 69 6e 64 6f 77 73 20 6f 6e 20 74 68 |ll windows on th| 00003eb0 61 74 20 66 69 6c 65 20 77 69 74 68 6f 75 74 20 |at file without | 00003ec0 70 72 6f 6d 70 74 69 6e 67 20 75 73 65 72 2e 0a |prompting user..| 00003ed0 09 5c 45 20 52 39 3d 66 69 6c 65 0a 0a 5a 61 70 |.\E R9=file..Zap| 00003ee0 5f 44 65 6c 65 74 65 46 69 6c 65 0a 41 73 20 66 |_DeleteFile.As f| 00003ef0 6f 72 20 5a 61 70 5f 44 69 73 63 61 72 64 46 69 |or Zap_DiscardFi| 00003f00 6c 65 20 62 75 74 20 70 72 6f 6d 70 74 73 20 75 |le but prompts u| 00003f10 73 65 72 20 69 66 20 66 69 6c 65 20 61 6c 74 65 |ser if file alte| 00003f20 72 65 64 20 65 74 63 2e 0a 09 5c 45 20 52 39 3d |red etc...\E R9=| 00003f30 66 69 6c 65 0a 0a 5a 61 70 5f 44 69 73 63 61 72 |file..Zap_Discar| 00003f40 64 57 69 6e 64 6f 77 0a 4b 69 6c 6c 20 61 20 77 |dWindow.Kill a w| 00003f50 69 6e 64 6f 77 2c 20 61 6e 64 20 74 68 65 20 66 |indow, and the f| 00003f60 69 6c 65 20 69 66 20 61 75 74 6f 2d 64 65 6c 65 |ile if auto-dele| 00003f70 74 65 20 69 73 20 6f 6e 20 61 6e 64 20 74 68 69 |te is on and thi| 00003f80 73 20 69 73 20 74 68 65 20 6c 61 73 74 20 77 69 |s is the last wi| 00003f90 6e 64 6f 77 0a 6f 6e 20 74 68 61 74 20 66 69 6c |ndow.on that fil| 00003fa0 65 2e 20 44 6f 6e 27 74 20 70 72 6f 6d 70 74 20 |e. Don't prompt | 00003fb0 75 73 65 72 2e 0a 09 5c 45 20 52 38 2f 52 39 0a |user...\E R8/R9.| 00003fc0 0a 5a 61 70 5f 44 65 6c 65 74 65 57 69 6e 64 6f |.Zap_DeleteWindo| 00003fd0 77 0a 41 73 20 66 6f 72 20 5a 61 70 5f 44 69 73 |w.As for Zap_Dis| 00003fe0 63 61 72 64 57 69 6e 64 6f 77 20 62 75 74 20 70 |cardWindow but p| 00003ff0 72 6f 6d 70 74 73 20 75 73 65 72 20 69 66 20 66 |rompts user if f| 00004000 69 6c 65 20 61 6c 74 65 72 65 64 20 65 74 63 2e |ile altered etc.| 00004010 0a 09 5c 45 20 52 38 2f 52 39 0a 0a 5a 61 70 5f |..\E R8/R9..Zap_| 00004020 42 75 69 6c 64 4d 65 6e 75 0a 54 68 69 73 20 69 |BuildMenu.This i| 00004030 73 20 7a 61 70 73 20 27 76 61 72 69 61 62 6c 65 |s zaps 'variable| 00004040 20 6c 65 6e 67 74 68 20 6d 65 6e 75 27 20 62 75 | length menu' bu| 00004050 69 6c 64 69 6e 67 20 73 75 62 2e 20 53 65 65 20 |ilding sub. See | 00004060 45 2d 4d 65 6e 75 20 66 6f 72 20 64 65 74 61 69 |E-Menu for detai| 00004070 6c 73 20 6f 6e 0a 5a 61 70 27 73 20 6d 65 6e 75 |ls on.Zap's menu| 00004080 20 66 6f 72 6d 61 74 2e 0a 09 5c 45 20 52 30 3d | format...\E R0=| 00004090 6d 65 6e 75 20 6e 61 6d 65 20 28 6d 61 78 20 31 |menu name (max 1| 000040a0 32 20 63 68 61 72 73 29 0a 09 20 20 20 52 31 3d |2 chars).. R1=| 000040b0 61 64 64 72 65 73 73 20 6f 66 20 73 75 62 20 74 |address of sub t| 000040c0 6f 20 67 65 6e 65 72 61 74 65 20 74 68 65 20 6d |o generate the m| 000040d0 65 6e 75 20 65 6e 74 72 69 65 73 0a 09 20 20 20 |enu entries.. | 000040e0 52 32 3d 61 64 64 72 65 73 73 20 6f 66 20 6d 65 |R2=address of me| 000040f0 6e 75 20 75 70 64 61 74 69 6e 67 20 73 75 62 2f |nu updating sub/| 00004100 30 20 69 66 20 6e 6f 6e 65 20 28 73 65 65 20 45 |0 if none (see E| 00004110 2d 4d 65 6e 75 29 0a 09 20 20 20 52 33 3d 61 64 |-Menu).. R3=ad| 00004120 64 72 65 73 73 20 6f 66 20 6d 65 6e 75 20 69 6e |dress of menu in| 00004130 74 65 72 70 72 65 74 20 73 75 62 20 66 6f 72 20 |terpret sub for | 00004140 61 6c 6c 20 65 6e 74 72 69 65 73 2f 30 20 28 73 |all entries/0 (s| 00004150 65 65 20 45 2d 4d 65 6e 75 29 0a 09 20 20 20 52 |ee E-Menu).. R| 00004160 34 3d 6d 65 6e 75 20 77 69 64 74 68 20 69 6e 20 |4=menu width in | 00004170 63 68 61 72 73 0a 09 20 20 20 52 38 2d 52 31 31 |chars.. R8-R11| 00004180 3d 76 61 6c 75 65 73 20 74 6f 20 63 61 6c 6c 20 |=values to call | 00004190 74 68 65 20 73 75 62 20 69 6e 20 52 31 20 77 69 |the sub in R1 wi| 000041a0 74 68 20 6f 6e 20 74 68 65 20 66 69 72 73 74 20 |th on the first | 000041b0 63 61 6c 6c 2e 0a 09 5c 58 20 52 30 3d 70 6f 69 |call...\X R0=poi| 000041c0 6e 74 65 72 20 74 6f 20 77 69 6d 70 20 6d 65 6e |nter to wimp men| 000041d0 75 20 73 74 72 75 63 74 75 72 65 0a 09 54 68 65 |u structure..The| 000041e0 20 73 75 62 20 70 61 73 73 65 64 20 69 6e 20 52 | sub passed in R| 000041f0 31 20 68 61 73 20 74 68 65 20 66 6f 6c 6c 6f 77 |1 has the follow| 00004200 69 6e 67 20 63 6f 6e 64 69 74 69 6f 6e 73 3a 0a |ing conditions:.| 00004210 09 20 20 20 20 20 5c 45 20 52 30 3d 62 75 66 66 |. \E R0=buff| 00004220 65 72 20 66 6f 72 20 79 6f 75 20 74 6f 20 70 75 |er for you to pu| 00004230 74 20 74 68 65 20 6e 65 78 74 20 6d 65 6e 75 20 |t the next menu | 00004240 65 6e 74 72 79 20 69 6e 20 28 34 38 20 62 79 74 |entry in (48 byt| 00004250 65 73 29 0a 09 09 52 35 3d 61 64 64 72 65 73 73 |es)...R5=address| 00004260 20 6f 66 20 6d 65 6e 75 20 73 74 72 75 63 74 75 | of menu structu| 00004270 72 65 20 73 74 61 72 74 20 7d 0a 09 09 52 36 3d |re start }...R6=| 00004280 61 64 64 72 65 73 73 20 6f 66 20 63 75 72 72 65 |address of curre| 00004290 6e 74 20 6d 65 6e 75 20 65 6e 74 72 79 20 20 20 |nt menu entry | 000042a0 7d 20 79 6f 75 20 64 6f 6e 27 74 20 6e 65 65 64 |} you don't need| 000042b0 20 74 68 65 73 65 0a 09 09 52 37 3d 61 64 64 72 | these...R7=addr| 000042c0 65 73 73 20 6f 66 20 63 75 72 72 65 6e 74 20 62 |ess of current b| 000042d0 75 66 20 65 6e 74 72 79 20 20 20 20 7d 0a 09 09 |uf entry }...| 000042e0 52 38 2d 52 31 31 3d 61 73 20 72 65 74 75 72 6e |R8-R11=as return| 000042f0 65 64 20 66 72 6f 6d 20 6c 61 73 74 20 63 61 6c |ed from last cal| 00004300 6c 0a 09 20 20 20 20 20 5c 58 20 52 30 3d 69 6e |l.. \X R0=in| 00004310 64 65 78 20 66 6f 72 20 74 68 69 73 20 65 6e 74 |dex for this ent| 00004320 72 79 2f 2d 31 20 69 66 20 6e 6f 20 6d 6f 72 65 |ry/-1 if no more| 00004330 20 65 6e 74 72 69 65 73 20 28 73 65 65 20 45 2d | entries (see E-| 00004340 4d 65 6e 75 29 0a 09 20 20 20 20 20 09 52 31 2d |Menu).. .R1-| 00004350 52 37 20 73 61 76 65 64 0a 09 20 20 20 20 20 09 |R7 saved.. .| 00004360 52 38 2d 52 31 31 3d 75 70 64 61 74 65 64 20 28 |R8-R11=updated (| 00004370 69 65 20 66 6f 72 20 79 6f 75 72 20 6f 77 6e 20 |ie for your own | 00004380 75 73 65 29 2e 0a 0a 5a 61 70 5f 43 6c 65 61 72 |use)...Zap_Clear| 00004390 53 65 6c 0a 43 6c 65 61 72 73 20 63 75 72 72 65 |Sel.Clears curre| 000043a0 6e 74 6c 79 20 73 65 6c 65 63 74 65 64 20 61 72 |ntly selected ar| 000043b0 65 61 2e 0a 0a 5a 61 70 5f 43 72 65 61 74 65 46 |ea...Zap_CreateF| 000043c0 69 6c 65 42 6c 6f 63 6b 0a 43 72 65 61 74 65 73 |ileBlock.Creates| 000043d0 20 61 20 6e 65 77 20 66 69 6c 65 20 62 6c 6f 63 | a new file bloc| 000043e0 6b 20 77 69 74 68 20 63 75 72 72 65 6e 74 6c 79 |k with currently| 000043f0 20 63 6f 6e 66 69 67 75 72 65 64 20 6f 70 74 69 | configured opti| 00004400 6f 6e 73 2e 20 66 5f 70 74 72 20 65 74 63 20 61 |ons. f_ptr etc a| 00004410 72 65 20 73 65 74 0a 75 70 20 66 6f 72 20 79 6f |re set.up for yo| 00004420 75 2e 20 53 65 65 20 45 2d 46 69 6c 65 2e 20 55 |u. See E-File. U| 00004430 73 65 20 5a 61 70 5f 49 6e 73 74 61 6c 6c 20 66 |se Zap_Install f| 00004440 69 6c 65 20 74 6f 20 6c 6f 61 64 20 61 20 66 69 |ile to load a fi| 00004450 6c 65 2e 0a 09 5c 45 20 52 30 3d 73 69 7a 65 20 |le...\E R0=size | 00004460 74 6f 20 6d 61 6b 65 20 62 75 66 66 65 72 0a 09 |to make buffer..| 00004470 20 20 20 52 31 3d 66 69 6c 65 6e 61 6d 65 20 6f | R1=filename o| 00004480 66 20 62 75 66 66 65 72 0a 09 20 20 20 52 32 2f |f buffer.. R2/| 00004490 52 33 3d 6c 6f 61 64 2f 65 78 65 63 0a 09 5c 58 |R3=load/exec..\X| 000044a0 20 52 39 3d 6e 65 77 20 66 69 6c 65 20 62 6c 6f | R9=new file blo| 000044b0 63 6b 20 28 77 69 74 68 20 66 69 6c 65 20 66 69 |ck (with file fi| 000044c0 6c 6c 65 64 20 77 69 74 68 20 72 75 62 62 69 73 |lled with rubbis| 000044d0 68 29 2e 0a 09 0a 5a 61 70 5f 43 72 65 61 74 65 |h)....Zap_Create| 000044e0 57 69 6e 64 42 6c 6b 0a 43 72 65 61 74 65 73 20 |WindBlk.Creates | 000044f0 61 20 6e 65 77 20 77 69 6e 64 6f 77 20 62 6c 6f |a new window blo| 00004500 63 6b 20 77 69 74 68 20 63 75 72 72 65 6e 74 6c |ck with currentl| 00004510 79 20 63 6f 6e 66 69 67 75 72 65 64 20 6f 70 74 |y configured opt| 00004520 69 6f 6e 73 2e 20 57 69 6e 64 6f 77 20 69 73 0a |ions. Window is.| 00004530 6f 70 65 6e 65 64 20 6f 6e 20 74 68 65 20 73 63 |opened on the sc| 00004540 72 65 65 6e 20 65 74 63 2e 0a 09 5c 45 20 52 39 |reen etc...\E R9| 00004550 3d 66 69 6c 65 20 77 69 6e 64 6f 77 20 69 73 20 |=file window is | 00004560 74 6f 20 62 65 20 6f 6e 2e 0a 09 5c 58 20 52 38 |to be on...\X R8| 00004570 3d 4e 65 77 20 77 69 6e 64 6f 77 20 6f 6e 20 74 |=New window on t| 00004580 68 69 73 20 66 69 6c 65 2e 0a 09 0a 5a 61 70 5f |his file....Zap_| 00004590 47 65 74 53 65 6c 0a 46 69 6e 64 20 6f 75 74 20 |GetSel.Find out | 000045a0 77 68 61 74 20 61 72 65 61 20 69 73 20 73 65 6c |what area is sel| 000045b0 65 63 74 65 64 2e 0a 09 5c 58 20 49 66 20 43 53 |ected...\X If CS| 000045c0 20 74 68 65 6e 20 6e 6f 20 76 61 6c 69 64 20 73 | then no valid s| 000045d0 65 6c 65 63 74 69 6f 6e 0a 09 20 20 20 49 66 20 |election.. If | 000045e0 43 43 20 74 68 65 6e 20 52 31 3d 66 69 6c 65 20 |CC then R1=file | 000045f0 6f 66 66 73 65 74 20 52 32 3d 73 65 6c 65 63 74 |offset R2=select| 00004600 69 6f 6e 20 6c 65 6e 67 74 68 20 52 38 2f 52 39 |ion length R8/R9| 00004610 3d 66 69 6c 65 0a 0a 5a 61 70 5f 49 6e 73 65 72 |=file..Zap_Inser| 00004620 74 4d 61 72 6b 0a 49 6e 73 65 72 74 20 61 20 6d |tMark.Insert a m| 00004630 61 72 6b 65 72 2e 0a 09 5c 45 20 52 30 3d 66 69 |arker...\E R0=fi| 00004640 6c 65 20 6f 66 66 73 65 74 20 6f 66 20 6d 61 72 |le offset of mar| 00004650 6b 20 52 38 2f 52 39 0a 0a 5a 61 70 5f 49 6e 73 |k R8/R9..Zap_Ins| 00004660 74 61 6c 6c 46 69 6c 65 0a 4c 6f 61 64 20 61 20 |tallFile.Load a | 00004670 66 69 6c 65 20 69 6e 74 6f 20 7a 61 70 2e 0a 09 |file into zap...| 00004680 5c 45 20 52 30 3d 66 69 6c 65 6e 61 6d 65 0a 09 |\E R0=filename..| 00004690 5c 58 20 52 30 3d 77 69 6e 64 6f 77 20 6f 66 66 |\X R0=window off| 000046a0 73 65 74 20 6f 66 20 63 72 65 61 74 65 64 20 77 |set of created w| 000046b0 69 6e 64 6f 77 20 2f 20 2d 31 20 69 66 20 6e 6f |indow / -1 if no| 000046c0 74 20 6c 6f 61 64 65 64 2e 0a 0a 5a 61 70 5f 4e |t loaded...Zap_N| 000046d0 65 77 4d 6f 64 65 0a 43 68 61 6e 67 65 20 74 68 |ewMode.Change th| 000046e0 65 20 64 69 73 70 6c 61 79 20 6d 6f 64 65 20 6f |e display mode o| 000046f0 66 20 61 20 77 69 6e 64 6f 77 2e 0a 09 5c 45 20 |f a window...\E | 00004700 52 30 3d 6e 65 77 20 6d 6f 64 65 20 6e 75 6d 62 |R0=new mode numb| 00004710 65 72 20 52 38 2f 52 39 20 28 52 38 3d 30 20 74 |er R8/R9 (R8=0 t| 00004720 6f 20 63 68 61 6e 67 65 20 6f 70 74 69 6f 6e 73 |o change options| 00004730 20 6d 6f 64 65 29 0a 0a 5a 61 70 5f 4e 65 77 54 | mode)..Zap_NewT| 00004740 69 74 6c 65 0a 55 70 64 61 74 65 20 74 68 65 20 |itle.Update the | 00004750 74 69 74 6c 65 62 61 72 20 6f 6e 20 61 20 67 69 |titlebar on a gi| 00004760 76 65 6e 20 77 69 6e 64 6f 77 2e 20 53 65 65 20 |ven window. See | 00004770 61 6c 73 6f 20 5a 61 70 5f 4e 65 77 46 69 6c 65 |also Zap_NewFile| 00004780 54 69 74 6c 65 2e 0a 09 5c 45 20 52 38 2f 52 39 |Title...\E R8/R9| 00004790 0a 0a 5a 61 70 5f 43 61 6c 6c 42 61 73 65 4d 6f |..Zap_CallBaseMo| 000047a0 64 65 0a 44 4f 20 4e 4f 54 20 55 53 45 20 54 48 |de.DO NOT USE TH| 000047b0 49 53 2e 20 54 68 69 73 20 63 61 6c 6c 20 69 73 |IS. This call is| 000047c0 20 6e 6f 77 20 6f 62 73 6f 6c 65 74 65 2e 20 55 | now obsolete. U| 000047d0 73 65 20 74 68 65 20 63 61 6c 6c 20 5a 61 70 5f |se the call Zap_| 000047e0 42 61 73 65 4d 6f 64 65 0a 69 6e 73 74 65 61 64 |BaseMode.instead| 000047f0 2e 20 49 66 20 79 6f 75 20 75 73 65 20 74 68 69 |. If you use thi| 00004800 73 20 63 61 6c 6c 20 69 74 20 77 69 6c 6c 20 61 |s call it will a| 00004810 70 70 65 61 72 20 74 6f 20 77 6f 72 6b 20 70 65 |ppear to work pe| 00004820 72 66 65 63 74 6c 79 20 75 6e 74 69 6c 20 73 6f |rfectly until so| 00004830 6d 65 6f 6e 65 0a 74 72 69 65 73 20 74 6f 20 75 |meone.tries to u| 00004840 73 65 20 79 6f 75 72 20 6d 6f 64 65 20 61 73 20 |se your mode as | 00004850 61 20 62 61 73 65 20 6d 6f 64 65 2e 20 57 68 65 |a base mode. Whe| 00004860 6e 20 74 68 69 73 20 68 61 70 70 65 6e 73 20 61 |n this happens a| 00004870 6e 20 69 6e 66 69 6e 69 74 65 20 6c 6f 6f 70 0a |n infinite loop.| 00004880 6f 63 63 75 72 73 20 77 68 69 63 68 20 49 20 63 |occurs which I c| 00004890 61 6e 27 74 20 66 69 78 2e 20 54 68 65 20 64 6f |an't fix. The do| 000048a0 63 73 20 61 72 65 20 6b 65 70 74 20 66 6f 72 20 |cs are kept for | 000048b0 62 61 63 6b 77 61 72 64 73 20 63 6f 6d 70 61 74 |backwards compat| 000048c0 69 62 69 6c 69 74 79 2e 0a 2d 2d 2d 2d 2d 2d 2d |ibility..-------| 000048d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00004910 2d 2d 2d 0a 41 73 20 66 6f 72 20 5a 61 70 5f 43 |---.As for Zap_C| 00004920 61 6c 6c 4d 6f 64 65 20 65 78 63 65 70 74 20 69 |allMode except i| 00004930 74 20 63 61 6c 6c 73 20 74 68 65 20 62 61 73 65 |t calls the base| 00004940 20 6d 6f 64 65 20 69 6e 73 74 65 61 64 2e 20 54 | mode instead. T| 00004950 68 65 20 77 69 6e 64 6f 77 20 69 6e 20 52 38 0a |he window in R8.| 00004960 69 64 65 6e 74 69 66 69 65 73 20 74 68 65 20 63 |identifies the c| 00004970 75 72 72 65 6e 74 20 6d 6f 64 65 2e 20 54 68 65 |urrent mode. The| 00004980 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 63 61 6c | entry point cal| 00004990 6c 65 64 20 69 73 20 74 68 61 74 20 6f 66 20 74 |led is that of t| 000049a0 68 65 20 62 61 73 65 20 6d 6f 64 65 0a 61 73 73 |he base mode.ass| 000049b0 6f 63 69 61 74 65 64 20 74 6f 20 74 68 69 73 20 |ociated to this | 000049c0 63 75 72 72 65 6e 74 20 6d 6f 64 65 2e 20 48 65 |current mode. He| 000049d0 6e 63 65 2c 20 69 74 20 77 6f 75 6c 64 20 62 65 |nce, it would be| 000049e0 20 75 73 65 64 20 62 79 20 61 20 6d 6f 64 65 20 | used by a mode | 000049f0 74 6f 20 63 61 6c 6c 0a 61 20 62 61 73 65 20 6d |to call.a base m| 00004a00 6f 64 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 |ode entry point | 00004a10 77 68 69 63 68 20 74 68 65 20 63 75 72 72 65 6e |which the curren| 00004a20 74 20 6d 6f 64 65 20 68 61 73 20 72 65 64 65 66 |t mode has redef| 00004a30 69 6e 65 64 2e 0a 09 5c 45 20 52 30 2d 52 31 30 |ined...\E R0-R10| 00004a40 3d 70 61 72 61 6d 65 74 65 72 73 20 52 38 20 52 |=parameters R8 R| 00004a50 31 31 3d 6d 6f 64 65 20 65 6e 74 72 79 20 70 6f |11=mode entry po| 00004a60 69 6e 74 20 6f 66 66 73 65 74 20 28 73 65 65 20 |int offset (see | 00004a70 45 2d 45 6e 74 72 79 29 0a 09 5c 58 20 41 73 20 |E-Entry)..\X As | 00004a80 66 6f 72 20 74 68 65 20 67 69 76 65 6e 20 6d 6f |for the given mo| 00004a90 64 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 2e 0a |de entry point..| 00004aa0 0a 5a 61 70 5f 4e 65 77 56 69 65 77 0a 41 73 20 |.Zap_NewView.As | 00004ab0 66 6f 72 20 5a 61 70 5f 43 72 65 61 74 65 57 69 |for Zap_CreateWi| 00004ac0 6e 64 42 6c 6b 20 62 75 74 20 27 63 6c 6f 6e 65 |ndBlk but 'clone| 00004ad0 73 27 20 61 20 67 69 76 65 6e 20 77 69 6e 64 6f |s' a given windo| 00004ae0 77 20 69 6d 61 67 65 2e 20 54 68 65 20 63 75 72 |w image. The cur| 00004af0 73 6f 72 20 69 73 20 6e 6f 74 0a 70 75 74 20 69 |sor is not.put i| 00004b00 6e 20 74 68 65 20 77 69 6e 64 6f 77 2e 0a 09 5c |n the window...\| 00004b10 45 20 52 38 2f 52 39 3d 77 69 6e 64 6f 77 20 74 |E R8/R9=window t| 00004b20 6f 20 63 6c 6f 6e 65 20 66 72 6f 6d 20 28 52 38 |o clone from (R8| 00004b30 3d 30 20 74 68 65 6e 20 64 6f 6e 27 74 20 63 6c |=0 then don't cl| 00004b40 6f 6e 65 29 0a 0a 5a 61 70 5f 52 65 61 64 53 65 |one)..Zap_ReadSe| 00004b50 6c 0a 52 65 61 64 73 20 74 68 65 20 63 75 72 72 |l.Reads the curr| 00004b60 65 6e 74 6c 79 20 73 65 6c 65 63 74 65 64 20 72 |ently selected r| 00004b70 65 67 69 6f 6e 20 69 6e 74 6f 20 61 20 68 65 61 |egion into a hea| 00004b80 70 20 62 6c 6f 63 6b 2e 20 59 6f 75 20 6d 75 73 |p block. You mus| 00004b90 74 20 66 72 65 65 20 74 68 65 20 68 65 61 70 0a |t free the heap.| 00004ba0 62 6c 6f 63 6b 20 77 68 65 6e 20 79 6f 75 20 68 |block when you h| 00004bb0 61 76 65 20 66 69 6e 69 73 68 65 64 20 77 69 74 |ave finished wit| 00004bc0 68 20 74 68 65 20 73 65 6c 65 63 74 69 6f 6e 2e |h the selection.| 00004bd0 0a 09 5c 58 20 52 33 3d 68 65 61 70 20 62 6c 6f |..\X R3=heap blo| 00004be0 63 6b 20 77 69 74 68 20 64 61 74 61 20 61 6e 64 |ck with data and| 00004bf0 20 52 32 3d 6c 65 6e 67 74 68 20 2f 20 52 33 3d | R2=length / R3=| 00004c00 30 20 69 66 20 6e 6f 20 73 65 6c 65 63 74 69 6f |0 if no selectio| 00004c10 6e 0a 0a 5a 61 70 5f 52 65 70 6c 61 63 65 0a 43 |n..Zap_Replace.C| 00004c20 61 6c 6c 73 20 74 68 65 20 7a 61 70 20 66 69 6c |alls the zap fil| 00004c30 65 20 73 65 61 72 63 68 20 61 6e 64 20 72 65 70 |e search and rep| 00004c40 6c 61 63 65 20 63 6f 64 65 20 75 73 69 6e 67 20 |lace code using | 00004c50 74 68 65 20 63 75 72 72 65 6e 74 20 73 65 61 72 |the current sear| 00004c60 63 68 20 73 74 72 69 6e 67 2e 0a 09 5c 45 20 52 |ch string...\E R| 00004c70 31 3d 30 20 66 6f 72 20 73 65 6c 65 63 74 69 76 |1=0 for selectiv| 00004c80 65 2f 31 20 66 6f 72 20 67 6c 6f 62 61 6c 2f 32 |e/1 for global/2| 00004c90 20 66 6f 72 20 63 6f 6e 74 69 6e 75 65 20 73 65 | for continue se| 00004ca0 6c 65 63 74 69 76 65 0a 09 20 20 20 52 33 3d 73 |lective.. R3=s| 00004cb0 74 61 72 74 20 6f 66 66 73 65 74 20 69 6e 20 66 |tart offset in f| 00004cc0 69 6c 65 0a 09 20 20 20 52 34 3d 64 69 72 65 63 |ile.. R4=direc| 00004cd0 74 69 6f 6e 20 28 2b 31 2f 2d 31 29 0a 09 20 20 |tion (+1/-1).. | 00004ce0 20 52 38 2f 52 39 0a 0a 5a 61 70 5f 53 65 61 72 | R8/R9..Zap_Sear| 00004cf0 63 68 0a 43 61 6c 6c 73 20 74 68 65 20 7a 61 70 |ch.Calls the zap| 00004d00 20 77 69 6c 64 63 61 72 64 20 73 65 61 72 63 68 | wildcard search| 00004d10 20 63 6f 64 65 2e 0a 09 5c 45 20 52 30 3d 73 65 | code...\E R0=se| 00004d20 61 72 63 68 20 73 74 72 69 6e 67 20 28 61 73 20 |arch string (as | 00004d30 74 79 70 65 64 20 62 79 20 75 73 65 72 29 0a 09 |typed by user)..| 00004d40 20 20 20 52 31 3d 6f 75 74 70 75 74 20 74 79 70 | R1=output typ| 00004d50 65 20 28 30 3d 63 75 72 73 6f 72 20 31 3d 74 6f |e (0=cursor 1=to| 00004d60 62 75 66 66 65 72 20 32 3d 6e 6f 6e 65 29 0a 09 |buffer 2=none)..| 00004d70 20 20 20 52 33 3d 73 74 61 72 74 20 6f 66 66 73 | R3=start offs| 00004d80 65 74 20 69 6e 20 66 69 6c 65 0a 09 20 20 20 52 |et in file.. R| 00004d90 34 3d 73 65 61 72 63 68 20 64 69 72 65 63 74 69 |4=search directi| 00004da0 6f 6e 20 28 2b 31 2f 2d 31 29 0a 09 20 20 20 52 |on (+1/-1).. R| 00004db0 35 3d 6f 62 6a 65 63 74 20 74 79 70 65 20 28 30 |5=object type (0| 00004dc0 3d 73 74 72 69 6e 67 20 32 3d 77 6f 72 64 20 34 |=string 2=word 4| 00004dd0 3d 61 73 73 65 6d 62 6c 65 72 20 69 6e 73 74 72 |=assembler instr| 00004de0 75 63 74 69 6f 6e 29 0a 09 20 20 20 52 38 2f 52 |uction).. R8/R| 00004df0 39 0a 09 5c 58 20 49 66 20 52 31 3d 30 20 6f 72 |9..\X If R1=0 or| 00004e00 20 32 20 6f 6e 20 65 6e 74 72 79 20 74 68 65 6e | 2 on entry then| 00004e10 20 52 30 3d 6d 61 74 63 68 20 6f 66 66 73 65 74 | R0=match offset| 00004e20 2f 2d 76 65 20 69 66 20 6e 6f 6e 65 2e 0a 0a 5a |/-ve if none...Z| 00004e30 61 70 5f 53 65 6c 65 63 74 0a 53 65 6c 65 63 74 |ap_Select.Select| 00004e40 73 20 61 20 67 69 76 65 6e 20 72 65 67 69 6f 6e |s a given region| 00004e50 2c 20 61 6e 64 20 70 75 74 73 20 63 61 72 65 74 |, and puts caret| 00004e60 73 20 62 61 63 6b 20 74 6f 20 64 65 66 61 75 6c |s back to defaul| 00004e70 74 20 6d 6f 64 65 2e 0a 09 5c 45 20 52 32 3d 73 |t mode...\E R2=s| 00004e80 74 61 72 74 20 6f 66 66 73 65 74 20 52 33 3d 65 |tart offset R3=e| 00004e90 6e 64 20 6f 66 66 73 65 74 20 52 38 2f 52 39 0a |nd offset R8/R9.| 00004ea0 0a 5a 61 70 5f 41 6c 74 65 72 53 65 6c 0a 41 73 |.Zap_AlterSel.As| 00004eb0 20 66 6f 72 20 5a 61 70 5f 53 65 6c 65 63 74 20 | for Zap_Select | 00004ec0 62 75 74 20 64 6f 65 73 6e 27 74 20 72 65 73 74 |but doesn't rest| 00004ed0 6f 72 65 20 63 61 72 65 74 20 6d 6f 64 65 73 2e |ore caret modes.| 00004ee0 0a 09 5c 45 20 52 32 3d 73 74 61 72 74 20 6f 66 |..\E R2=start of| 00004ef0 66 73 65 74 20 52 33 3d 65 6e 64 20 6f 66 66 73 |fset R3=end offs| 00004f00 65 74 20 52 38 2f 52 39 0a 0a 5a 61 70 5f 4f 66 |et R8/R9..Zap_Of| 00004f10 66 4c 69 6e 65 43 6f 6c 0a 43 6f 6e 76 65 72 74 |fLineCol.Convert| 00004f20 73 20 61 20 66 69 6c 65 20 6f 66 66 73 65 74 20 |s a file offset | 00004f30 74 6f 20 61 6e 64 20 78 2c 79 20 63 6f 6f 72 64 |to and x,y coord| 00004f40 69 6e 61 74 65 20 69 6e 20 74 68 65 20 77 69 6e |inate in the win| 00004f50 64 6f 77 20 77 6f 72 6b 20 61 72 65 61 2e 20 53 |dow work area. S| 00004f60 65 65 0a 61 6c 73 6f 20 5a 61 70 5f 46 69 6e 64 |ee.also Zap_Find| 00004f70 4f 66 66 73 65 74 2e 20 53 65 65 20 45 2d 57 69 |Offset. See E-Wi| 00004f80 6e 64 6f 77 73 2e 0a 09 5c 45 20 52 30 3d 66 69 |ndows...\E R0=fi| 00004f90 6c 65 20 6f 66 66 73 65 74 20 52 38 2f 52 39 0a |le offset R8/R9.| 00004fa0 09 5c 58 20 52 30 3d 73 74 61 72 74 20 6f 66 20 |.\X R0=start of | 00004fb0 6c 69 6e 65 20 6f 66 66 73 65 74 0a 09 20 20 20 |line offset.. | 00004fc0 52 32 3d 63 6f 6c 75 6d 6e 20 28 69 6e 63 20 6d |R2=column (inc m| 00004fd0 61 72 67 69 6e 29 0a 09 20 20 20 52 33 3d 72 6f |argin).. R3=ro| 00004fe0 77 0a 0a 5a 61 70 5f 41 64 64 43 6f 6d 6d 61 6e |w..Zap_AddComman| 00004ff0 64 73 0a 41 64 64 73 20 61 20 74 61 62 6c 65 20 |ds.Adds a table | 00005000 6f 66 20 63 6f 6d 6d 61 6e 64 73 20 74 6f 20 7a |of commands to z| 00005010 61 70 27 73 20 6c 69 73 74 2e 20 5a 61 70 20 63 |ap's list. Zap c| 00005020 61 6e 20 63 75 72 72 65 6e 74 6c 79 20 63 6f 70 |an currently cop| 00005030 65 20 77 69 74 68 20 75 70 20 74 6f 20 31 36 0a |e with up to 16.| 00005040 74 61 62 6c 65 73 20 6f 66 20 63 6f 6d 6d 61 6e |tables of comman| 00005050 64 73 2e 20 54 68 69 73 20 73 68 6f 75 6c 64 20 |ds. This should | 00005060 62 65 20 63 61 6c 6c 65 64 20 77 68 65 6e 20 61 |be called when a| 00005070 20 6d 6f 64 75 6c 65 20 69 6e 69 74 69 61 6c 69 | module initiali| 00005080 73 65 73 20 61 73 20 66 6f 72 0a 5a 61 70 5f 41 |ses as for.Zap_A| 00005090 64 64 4d 6f 64 65 2e 20 5a 61 70 20 6e 65 65 64 |ddMode. Zap need| 000050a0 20 6e 6f 74 20 62 65 20 6d 61 70 70 65 64 20 69 | not be mapped i| 000050b0 6e 74 6f 20 6d 65 6d 6f 72 79 20 66 6f 72 20 74 |nto memory for t| 000050c0 68 69 73 20 63 61 6c 6c 2e 20 53 65 65 20 45 2d |his call. See E-| 000050d0 43 6f 6d 6d 61 6e 64 73 0a 66 6f 72 20 74 68 65 |Commands.for the| 000050e0 20 74 61 62 6c 65 20 66 6f 72 6d 61 74 2e 0a 09 | table format...| 000050f0 5c 45 20 52 30 3d 61 64 64 72 65 73 73 20 6f 66 |\E R0=address of| 00005100 20 63 6f 6d 6d 61 6e 64 20 74 61 62 6c 65 20 28 | command table (| 00005110 52 31 32 3d 5a 61 70 73 20 77 6f 72 6b 73 70 61 |R12=Zaps workspa| 00005120 63 65 29 2e 0a 09 0a 5a 61 70 5f 4d 69 6e 69 57 |ce)....Zap_MiniW| 00005130 72 69 74 65 0a 54 68 69 73 20 63 61 6c 6c 20 73 |rite.This call s| 00005140 65 6e 64 73 20 61 20 73 74 72 65 61 6d 20 6f 66 |ends a stream of| 00005150 20 63 68 61 72 61 63 74 65 72 73 20 74 6f 20 74 | characters to t| 00005160 68 65 20 6d 69 6e 69 62 75 66 66 65 72 2e 20 54 |he minibuffer. T| 00005170 68 65 20 6d 69 6e 69 62 75 66 66 65 72 0a 63 6f |he minibuffer.co| 00005180 6e 74 65 6e 74 73 20 69 73 20 63 68 61 6e 67 65 |ntents is change| 00005190 64 20 62 75 74 20 6e 6f 74 20 75 70 64 61 74 65 |d but not update| 000051a0 64 20 6f 6e 20 73 63 72 65 65 6e 2e 20 48 6f 77 |d on screen. How| 000051b0 65 76 65 72 2c 20 69 66 20 74 68 69 73 20 63 61 |ever, if this ca| 000051c0 6c 6c 20 69 73 20 75 73 65 64 0a 77 69 74 68 69 |ll is used.withi| 000051d0 6e 20 61 20 63 6f 6d 6d 61 6e 64 2c 20 74 68 65 |n a command, the| 000051e0 6e 20 74 68 65 20 6d 69 6e 69 62 75 66 66 65 72 |n the minibuffer| 000051f0 20 77 69 6c 6c 20 75 70 64 61 74 65 64 20 6f 6e | will updated on| 00005200 20 73 63 72 65 65 6e 20 61 75 74 6f 6d 61 74 69 | screen automati| 00005210 63 61 6c 6c 79 0a 62 79 20 5a 61 70 2e 20 55 73 |cally.by Zap. Us| 00005220 65 20 5a 61 70 5f 4d 69 6e 69 55 70 64 61 74 65 |e Zap_MiniUpdate| 00005230 20 74 6f 20 66 6f 72 63 65 20 61 6e 20 75 70 64 | to force an upd| 00005240 61 74 65 2c 20 62 75 74 20 79 6f 75 20 73 68 6f |ate, but you sho| 00005250 75 6c 64 6e 27 74 20 68 61 76 65 20 74 6f 20 75 |uldn't have to u| 00005260 73 65 0a 74 68 69 73 2e 20 54 68 65 20 6d 69 6e |se.this. The min| 00005270 69 62 75 66 66 65 72 20 74 61 6b 65 73 20 74 68 |ibuffer takes th| 00005280 65 20 66 6f 72 6d 3a 0a 09 3c 70 72 6f 6d 70 74 |e form:..<prompt| 00005290 20 73 74 72 69 6e 67 3e 3c 6d 61 72 6b 3e 3c 75 | string><mark><u| 000052a0 73 65 72 20 65 64 69 74 61 62 6c 65 20 66 69 65 |ser editable fie| 000052b0 6c 64 3e 2e 0a 54 68 65 20 75 73 65 72 20 63 61 |ld>..The user ca| 000052c0 6e 6e 6f 74 20 6d 6f 76 65 20 74 68 65 20 63 75 |nnot move the cu| 000052d0 72 73 6f 72 20 62 65 66 6f 72 65 20 74 68 65 20 |rsor before the | 000052e0 27 69 6e 76 69 73 69 62 6c 65 27 20 6d 61 72 6b |'invisible' mark| 000052f0 2e 20 54 68 65 20 73 74 72 69 6e 67 0a 70 61 73 |. The string.pas| 00005300 73 65 64 20 74 6f 20 5a 61 70 5f 4d 69 6e 69 57 |sed to Zap_MiniW| 00005310 72 69 74 65 20 6d 61 79 20 63 6f 6e 74 61 69 6e |rite may contain| 00005320 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 | the following c| 00005330 6f 6e 74 72 6f 6c 20 63 6f 64 65 73 3a 0a 09 30 |ontrol codes:..0| 00005340 3d 73 74 72 69 6e 67 20 74 65 72 6d 69 6e 61 74 |=string terminat| 00005350 6f 72 0a 09 31 3d 6d 6f 76 65 20 63 75 72 73 6f |or..1=move curso| 00005360 72 20 74 6f 20 6d 61 72 6b 20 28 63 74 72 6c 20 |r to mark (ctrl | 00005370 61 29 0a 09 32 3d 38 3d 6d 6f 76 65 20 63 75 72 |a)..2=8=move cur| 00005380 73 6f 72 20 62 61 63 6b 20 6f 6e 65 20 63 68 61 |sor back one cha| 00005390 72 61 63 74 65 72 20 28 63 74 72 6c 20 62 29 0a |racter (ctrl b).| 000053a0 09 34 3d 64 65 6c 65 74 65 20 63 68 61 72 61 63 |.4=delete charac| 000053b0 74 65 72 20 61 66 74 65 72 20 63 75 72 73 6f 72 |ter after cursor| 000053c0 20 28 63 74 72 6c 20 64 29 0a 09 35 3d 6d 6f 76 | (ctrl d)..5=mov| 000053d0 65 20 74 6f 20 65 6e 64 20 6f 66 20 73 74 72 69 |e to end of stri| 000053e0 6e 67 20 28 63 74 72 6c 20 65 29 0a 09 36 3d 39 |ng (ctrl e)..6=9| 000053f0 3d 6d 6f 76 65 20 63 75 72 73 6f 72 20 66 6f 72 |=move cursor for| 00005400 77 61 72 64 20 6f 6e 65 20 63 68 61 72 61 63 74 |ward one charact| 00005410 65 72 20 28 63 74 72 6c 20 66 29 0a 09 31 31 3d |er (ctrl f)..11=| 00005420 63 6c 65 61 72 20 62 75 66 66 65 72 20 66 72 6f |clear buffer fro| 00005430 6d 20 63 75 72 73 6f 72 20 28 63 74 72 6c 20 6b |m cursor (ctrl k| 00005440 29 0a 09 31 32 3d 63 6c 65 61 72 20 77 68 6f 6c |)..12=clear whol| 00005450 65 20 62 75 66 66 65 72 20 28 63 74 72 6c 20 6c |e buffer (ctrl l| 00005460 29 0a 09 32 31 3d 63 6c 65 61 72 20 62 75 66 66 |)..21=clear buff| 00005470 65 72 20 66 72 6f 6d 20 6d 61 72 6b 20 28 63 74 |er from mark (ct| 00005480 72 6c 20 75 29 0a 09 32 38 3d 73 65 74 20 6d 61 |rl u)..28=set ma| 00005490 72 6b 20 74 6f 20 63 75 72 72 65 6e 74 20 63 75 |rk to current cu| 000054a0 72 73 6f 72 20 6f 66 66 73 65 74 0a 09 31 32 37 |rsor offset..127| 000054b0 3d 64 65 6c 65 74 65 20 63 68 61 72 61 63 74 65 |=delete characte| 000054c0 72 20 62 65 66 6f 72 65 20 63 75 72 73 6f 72 0a |r before cursor.| 000054d0 57 68 65 6e 20 61 20 63 6f 6d 6d 61 6e 64 20 77 |When a command w| 000054e0 69 74 68 20 73 74 72 69 6e 67 20 70 61 72 61 6d |ith string param| 000054f0 65 74 65 72 20 69 73 20 63 61 6c 6c 65 64 2c 20 |eter is called, | 00005500 52 30 20 70 6f 69 6e 74 73 20 74 6f 20 74 68 65 |R0 points to the| 00005510 20 75 73 65 72 0a 65 64 69 74 61 62 6c 65 20 70 | user.editable p| 00005520 61 72 74 20 6f 66 20 74 68 65 20 73 74 72 69 6e |art of the strin| 00005530 67 2e 0a 09 5c 45 20 52 30 3d 70 6f 69 6e 74 65 |g...\E R0=pointe| 00005540 72 20 74 6f 20 7a 65 72 6f 20 74 65 72 6d 69 6e |r to zero termin| 00005550 61 74 65 64 20 73 74 72 69 6e 67 0a 09 0a 5a 61 |ated string...Za| 00005560 70 5f 4d 69 6e 69 50 72 6f 6d 70 74 0a 54 68 69 |p_MiniPrompt.Thi| 00005570 73 20 72 65 70 6c 61 63 65 73 20 74 68 65 20 70 |s replaces the p| 00005580 72 6f 6d 70 74 20 73 74 72 69 6e 67 20 69 6e 20 |rompt string in | 00005590 74 68 65 20 6d 69 6e 69 62 75 66 66 65 72 20 77 |the minibuffer w| 000055a0 69 74 68 20 74 68 65 20 67 69 76 65 6e 20 73 74 |ith the given st| 000055b0 72 69 6e 67 2e 20 49 74 27 73 0a 6d 61 69 6e 20 |ring. It's.main | 000055c0 75 73 65 20 69 73 20 66 6f 72 20 72 65 61 73 6f |use is for reaso| 000055d0 6e 20 63 6f 64 65 20 52 32 3d 36 20 77 68 65 6e |n code R2=6 when| 000055e0 20 61 20 63 6f 6d 6d 61 6e 64 20 77 69 74 68 20 | a command with | 000055f0 73 74 72 69 6e 67 20 70 61 72 61 6d 65 74 65 72 |string parameter| 00005600 20 69 73 0a 63 61 6c 6c 65 64 20 28 73 65 65 20 | is.called (see | 00005610 45 2d 43 6f 6d 6d 61 6e 64 73 29 2e 20 54 68 65 |E-Commands). The| 00005620 20 62 75 66 66 65 72 20 69 73 20 6e 6f 74 20 75 | buffer is not u| 00005630 70 64 61 74 65 64 20 6f 6e 20 73 63 72 65 65 6e |pdated on screen| 00005640 20 28 73 65 65 0a 5a 61 70 5f 4d 69 6e 69 57 72 | (see.Zap_MiniWr| 00005650 69 74 65 29 2e 20 55 6e 6c 69 6b 65 20 5a 61 70 |ite). Unlike Zap| 00005660 5f 4d 69 6e 69 57 72 69 74 65 2c 20 74 68 65 20 |_MiniWrite, the | 00005670 6d 69 6e 69 62 75 66 66 65 72 20 63 75 72 73 6f |minibuffer curso| 00005680 72 20 69 73 20 6e 6f 74 20 61 66 66 65 63 74 65 |r is not affecte| 00005690 64 0a 62 79 20 74 68 69 73 20 63 61 6c 6c 20 28 |d.by this call (| 000056a0 49 74 20 72 65 6d 61 69 6e 73 20 74 68 65 20 73 |It remains the s| 000056b0 61 6d 65 20 6e 75 6d 62 65 72 20 6f 66 20 63 68 |ame number of ch| 000056c0 61 72 61 63 74 65 72 73 20 61 66 74 65 72 20 74 |aracters after t| 000056d0 68 65 20 6d 61 72 6b 29 2e 0a 09 5c 45 20 52 30 |he mark)...\E R0| 000056e0 3d 6e 65 77 20 70 72 6f 6d 70 74 20 73 74 72 69 |=new prompt stri| 000056f0 6e 67 0a 09 0a 5a 61 70 5f 4d 69 6e 69 55 70 64 |ng...Zap_MiniUpd| 00005700 61 74 65 0a 54 68 69 73 20 63 61 6c 6c 20 75 70 |ate.This call up| 00005710 64 61 74 65 73 20 74 68 65 20 6d 69 6e 69 62 75 |dates the minibu| 00005720 66 66 65 72 20 6f 6e 20 73 63 72 65 65 6e 20 28 |ffer on screen (| 00005730 69 66 20 6f 70 65 6e 29 2e 20 54 68 69 73 20 77 |if open). This w| 00005740 69 6c 6c 20 75 73 75 61 6c 6c 79 20 62 65 0a 64 |ill usually be.d| 00005750 6f 6e 65 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c |one automaticall| 00005760 79 20 62 79 20 5a 61 70 2e 0a 0a 5a 61 70 5f 41 |y by Zap...Zap_A| 00005770 64 64 59 61 6e 6b 52 65 67 69 6f 6e 0a 54 68 69 |ddYankRegion.Thi| 00005780 73 20 63 61 6c 6c 20 61 64 64 73 20 61 20 72 65 |s call adds a re| 00005790 67 69 6f 6e 20 74 6f 20 74 68 65 20 63 75 74 2f |gion to the cut/| 000057a0 70 61 73 74 65 20 6b 69 6c 6c 20 72 69 6e 67 2e |paste kill ring.| 000057b0 20 54 68 65 20 72 65 67 69 6f 6e 20 79 6f 75 20 | The region you | 000057c0 70 61 73 73 20 69 74 0a 69 73 20 6e 6f 74 20 63 |pass it.is not c| 000057d0 6f 70 69 65 64 20 73 6f 20 6d 75 73 74 20 62 65 |opied so must be| 000057e0 20 73 74 61 62 6c 65 20 28 65 67 20 69 6e 20 61 | stable (eg in a| 000057f0 20 68 65 61 70 20 62 6c 6f 63 6b 29 2e 0a 09 5c | heap block)...\| 00005800 45 20 52 30 3d 61 64 64 72 65 73 73 20 6f 66 20 |E R0=address of | 00005810 72 65 67 69 6f 6e 20 2b 20 66 6c 61 67 73 3a 0a |region + flags:.| 00005820 09 09 62 33 31 20 4d 55 53 54 20 42 45 20 53 45 |..b31 MUST BE SE| 00005830 54 20 28 49 66 20 63 6c 65 61 72 20 74 68 65 6e |T (If clear then| 00005840 20 64 65 6e 6f 74 65 73 20 61 6e 20 75 6e 64 6f | denotes an undo| 00005850 20 62 75 66 66 65 72 20 72 65 66 29 2e 0a 09 09 | buffer ref)....| 00005860 62 33 30 20 49 66 20 73 65 74 2c 20 74 68 65 6e |b30 If set, then| 00005870 20 61 66 74 65 72 20 79 61 6e 6b 69 6e 67 20 74 | after yanking t| 00005880 68 69 73 20 62 6c 6f 63 6b 2c 20 69 74 20 77 69 |his block, it wi| 00005890 6c 6c 20 6d 6f 76 65 20 6f 6e 74 6f 0a 09 09 09 |ll move onto....| 000058a0 74 68 65 20 62 6c 6f 63 6b 20 62 65 66 6f 72 65 |the block before| 000058b0 20 28 69 65 2c 20 79 61 6e 6b 73 20 6d 61 6e 79 | (ie, yanks many| 000058c0 20 62 6c 6f 63 6b 73 20 61 74 20 6f 6e 63 65 29 | blocks at once)| 000058d0 2e 0a 09 20 20 20 52 31 3d 62 6c 6f 63 6b 20 6c |... R1=block l| 000058e0 65 6e 67 74 68 20 28 70 72 6f 76 69 64 65 64 20 |ength (provided | 000058f0 62 33 31 20 6f 66 20 52 30 20 69 73 20 73 65 74 |b31 of R0 is set| 00005900 29 2e 0a 0a 5a 61 70 5f 46 69 6e 64 43 6f 6d 6d |)...Zap_FindComm| 00005910 61 6e 64 0a 54 68 69 73 20 63 61 6c 6c 20 63 6f |and.This call co| 00005920 6e 76 65 72 74 73 20 61 20 63 6f 6d 6d 61 6e 64 |nverts a command| 00005930 20 6e 61 6d 65 20 69 6e 74 6f 20 61 20 63 6f 6d | name into a com| 00005940 6d 61 6e 64 20 61 64 64 72 65 73 73 20 62 79 20 |mand address by | 00005950 6c 6f 6f 6b 69 6e 67 20 69 74 20 75 70 20 69 6e |looking it up in| 00005960 20 5a 61 70 73 20 63 6f 6d 6d 61 6e 64 20 74 61 | Zaps command ta| 00005970 62 6c 65 73 2e 0a 09 5c 45 20 52 30 3d 63 6f 6d |bles...\E R0=com| 00005980 6d 61 6e 64 20 6e 61 6d 65 20 74 65 72 6d 69 6e |mand name termin| 00005990 61 74 65 64 20 62 79 20 3c 3d 33 32 20 6f 72 20 |ated by <=32 or | 000059a0 3a 2c 26 2c 22 0a 09 5c 58 20 52 30 3d 63 6f 6d |:,&,"..\X R0=com| 000059b0 6d 61 6e 64 20 61 64 64 72 65 73 73 20 2f 20 30 |mand address / 0| 000059c0 20 69 66 20 6e 6f 74 20 66 6f 75 6e 64 0a 09 0a | if not found...| 000059d0 5a 61 70 5f 50 72 6f 63 65 73 73 43 6f 6d 6d 61 |Zap_ProcessComma| 000059e0 6e 64 20 28 73 65 65 20 61 6c 73 6f 20 5a 61 70 |nd (see also Zap| 000059f0 5f 43 6f 6d 6d 61 6e 64 53 74 72 69 6e 67 29 2e |_CommandString).| 00005a00 0a 54 68 69 73 20 6d 61 6b 65 73 20 61 20 63 61 |.This makes a ca| 00005a10 6c 6c 20 74 6f 20 61 20 5a 61 70 20 63 6f 6d 6d |ll to a Zap comm| 00005a20 61 6e 64 2e 20 49 74 20 73 68 6f 75 6c 64 20 62 |and. It should b| 00005a30 65 20 75 73 65 64 20 66 6f 72 20 61 6c 6c 20 63 |e used for all c| 00005a40 61 6c 6c 73 20 74 6f 0a 63 6f 6d 6d 61 6e 64 73 |alls to.commands| 00005a50 2e 20 59 6f 75 20 63 61 6e 20 66 69 6e 64 20 74 |. You can find t| 00005a60 68 65 20 61 64 64 72 65 73 73 20 6f 66 20 61 20 |he address of a | 00005a70 63 6f 6d 6d 61 6e 64 20 76 69 61 20 5a 61 70 5f |command via Zap_| 00005a80 46 69 6e 64 43 6f 6d 6d 61 6e 64 2e 20 59 6f 75 |FindCommand. You| 00005a90 0a 6d 61 79 20 61 6c 73 6f 20 63 61 6c 6c 20 63 |.may also call c| 00005aa0 6f 6d 6d 61 6e 64 73 20 77 68 69 63 68 20 6d 61 |ommands which ma| 00005ab0 79 20 6e 6f 74 20 68 61 76 65 20 61 20 6e 61 6d |y not have a nam| 00005ac0 65 21 20 46 6f 72 20 74 68 65 20 65 6e 74 72 79 |e! For the entry| 00005ad0 2f 65 78 69 74 0a 63 6f 6e 64 69 74 69 6f 6e 73 |/exit.conditions| 00005ae0 20 6f 66 20 63 6f 6d 6d 61 6e 64 73 20 73 65 65 | of commands see| 00005af0 20 74 68 65 20 66 69 6c 65 20 45 2d 43 6f 6d 6d | the file E-Comm| 00005b00 61 6e 64 73 2e 20 49 66 20 74 68 65 20 76 61 6c |ands. If the val| 00005b10 75 65 20 6f 66 20 52 32 20 69 73 0a 75 6e 64 65 |ue of R2 is.unde| 00005b20 66 69 6e 65 64 20 66 6f 72 20 61 20 63 6f 6d 6d |fined for a comm| 00005b30 61 6e 64 20 63 61 6c 6c 20 69 6e 20 74 68 65 20 |and call in the | 00005b40 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 69 6e |documentation in| 00005b50 20 45 2d 43 6f 6d 6d 61 6e 64 20 74 68 65 6e 20 | E-Command then | 00005b60 79 6f 75 0a 73 68 6f 75 6c 64 20 73 65 74 20 69 |you.should set i| 00005b70 74 20 74 6f 20 5a 45 52 4f 2e 20 54 68 75 73 20 |t to ZERO. Thus | 00005b80 52 32 3d 30 20 61 6c 77 61 79 73 20 66 6f 72 20 |R2=0 always for | 00005b90 61 72 67 75 6d 65 6e 74 20 74 79 70 65 73 20 65 |argument types e| 00005ba0 78 63 65 70 74 20 73 74 72 69 6e 67 73 2e 0a 54 |xcept strings..T| 00005bb0 68 65 20 63 6f 6d 6d 61 6e 64 20 77 69 6c 6c 20 |he command will | 00005bc0 62 65 20 6c 65 61 72 6e 74 20 69 66 20 74 68 65 |be learnt if the| 00005bd0 20 6c 65 61 72 6e 20 66 6c 61 67 20 69 73 20 73 | learn flag is s| 00005be0 65 74 20 61 6e 64 20 65 78 65 63 75 74 65 64 20 |et and executed | 00005bf0 61 20 6e 75 6d 62 65 72 20 6f 66 0a 74 69 6d 65 |a number of.time| 00005c00 73 20 69 66 20 74 68 65 20 75 6e 69 76 65 72 73 |s if the univers| 00005c10 61 6c 20 61 72 67 75 6d 65 6e 74 20 66 6c 61 67 |al argument flag| 00005c20 20 69 73 20 73 65 74 2e 20 54 68 65 20 6d 6f 64 | is set. The mod| 00005c30 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 0a 65 5f |e entry point.e_| 00005c40 61 6c 69 67 6e 63 61 72 65 74 20 77 69 6c 6c 20 |aligncaret will | 00005c50 62 65 20 63 61 6c 6c 65 64 20 62 65 66 6f 72 65 |be called before| 00005c60 20 61 6c 6c 20 63 6f 6d 6d 61 6e 64 73 20 77 69 | all commands wi| 00005c70 74 68 20 52 32 3d 30 20 6f 6e 20 65 6e 74 72 79 |th R2=0 on entry| 00005c80 2e 20 41 0a 6d 69 6e 69 62 75 66 66 65 72 20 77 |. A.minibuffer w| 00005c90 69 6c 6c 20 62 65 20 6f 70 65 6e 65 64 20 69 66 |ill be opened if| 00005ca0 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 74 79 70 | the command typ| 00005cb0 65 20 69 73 20 53 54 52 49 4e 47 20 62 75 74 20 |e is STRING but | 00005cc0 52 30 3d 30 20 28 61 6e 64 20 52 32 3d 30 29 2e |R0=0 (and R2=0).| 00005cd0 0a 09 5c 45 20 52 30 2d 52 31 3d 63 6f 6d 6d 61 |..\E R0-R1=comma| 00005ce0 6e 64 20 69 6e 70 75 74 73 20 2d 20 64 65 70 65 |nd inputs - depe| 00005cf0 6e 64 65 6e 74 20 6f 6e 20 63 6f 6d 6d 61 6e 64 |ndent on command| 00005d00 20 28 73 65 65 20 45 2d 43 6f 6d 6d 61 6e 64 29 | (see E-Command)| 00005d10 2e 0a 09 09 55 73 75 61 6c 6c 79 20 52 30 3d 70 |....Usually R0=p| 00005d20 6f 69 6e 74 65 72 20 74 6f 20 63 6f 6d 6d 61 6e |ointer to comman| 00005d30 64 20 64 61 74 61 20 52 31 3d 6c 65 6e 67 74 68 |d data R1=length| 00005d40 20 6f 66 20 74 68 65 20 64 61 74 61 0a 09 20 20 | of the data.. | 00005d50 20 52 32 3d 43 6f 6d 6d 61 6e 64 20 61 63 74 69 | R2=Command acti| 00005d60 6f 6e 20 63 6f 64 65 20 77 69 74 68 20 66 6c 61 |on code with fla| 00005d70 67 73 20 69 6e 20 74 6f 70 20 62 69 74 73 2e 0a |gs in top bits..| 00005d80 09 20 20 20 09 62 30 2d 62 32 37 20 3d 41 63 74 |. .b0-b27 =Act| 00005d90 69 6f 6e 20 63 6f 64 65 20 74 6f 20 62 65 20 70 |ion code to be p| 00005da0 61 73 73 65 64 20 6f 6e 20 74 6f 20 74 68 65 20 |assed on to the | 00005db0 63 6f 6d 6d 61 6e 64 2e 20 54 68 69 73 20 69 73 |command. This is| 00005dc0 0a 09 20 20 20 09 20 20 20 20 20 20 20 20 61 6c |.. . al| 00005dd0 77 61 79 73 20 30 20 69 6e 20 73 74 61 6e 64 61 |ways 0 in standa| 00005de0 72 64 20 63 6f 6d 6d 61 6e 64 20 63 61 6c 6c 73 |rd command calls| 00005df0 2e 0a 09 20 20 20 09 62 32 38 2d 62 33 31 3d 46 |... .b28-b31=F| 00005e00 6c 61 67 73 20 74 6f 20 74 65 6c 6c 20 5a 61 70 |lags to tell Zap| 00005e10 5f 50 72 6f 63 65 73 73 43 6f 6d 6d 61 6e 64 20 |_ProcessCommand | 00005e20 74 68 69 6e 67 73 2e 20 54 68 65 73 65 20 61 72 |things. These ar| 00005e30 65 0a 09 20 20 20 09 09 66 69 6c 74 65 72 65 64 |e.. ..filtered| 00005e40 20 6f 75 74 20 62 65 66 6f 72 65 20 52 32 20 69 | out before R2 i| 00005e50 73 20 70 61 73 73 65 64 20 74 6f 20 74 68 65 20 |s passed to the | 00005e60 63 6f 6d 6d 61 6e 64 2e 0a 09 20 20 20 09 09 62 |command... ..b| 00005e70 33 31 3d 53 65 74 20 69 66 20 63 6f 6d 6d 61 6e |31=Set if comman| 00005e80 64 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 20 |d should not be | 00005e90 6c 65 61 72 6e 74 20 65 76 65 6e 0a 09 20 20 20 |learnt even.. | 00005ea0 09 09 20 20 20 20 69 66 20 69 6e 20 6c 65 61 72 |.. if in lear| 00005eb0 6e 20 6d 6f 64 65 2e 0a 09 09 09 62 33 30 2d 62 |n mode.....b30-b| 00005ec0 32 38 20 72 65 73 65 72 76 65 64 2e 0a 09 20 20 |28 reserved... | 00005ed0 20 52 37 3d 63 6f 6d 6d 61 6e 64 20 61 64 64 72 | R7=command addr| 00005ee0 65 73 73 20 28 6e 65 65 64 20 6e 6f 74 20 70 6f |ess (need not po| 00005ef0 69 6e 74 20 74 6f 20 61 20 63 6f 6d 6d 61 6e 64 |int to a command| 00005f00 20 72 65 67 69 73 74 65 72 65 64 20 69 6e 20 61 | registered in a| 00005f10 0a 09 20 20 20 09 20 20 20 20 63 6f 6d 6d 61 6e |.. . comman| 00005f20 64 20 74 61 62 6c 65 2c 20 62 75 74 20 6d 75 73 |d table, but mus| 00005f30 74 20 63 6f 6e 66 6f 72 6d 20 74 6f 20 74 68 65 |t conform to the| 00005f40 20 73 70 65 63 73 20 69 6e 20 74 68 65 0a 09 20 | specs in the.. | 00005f50 20 20 09 20 20 20 20 66 69 6c 65 20 45 2d 43 6f | . file E-Co| 00005f60 6d 6d 61 6e 64 2e 20 45 67 2c 20 5b 52 37 2c 23 |mmand. Eg, [R7,#| 00005f70 2d 34 5d 20 6d 75 73 74 20 62 65 20 74 68 65 20 |-4] must be the | 00005f80 66 6c 61 67 73 20 77 6f 72 64 29 2e 0a 09 20 20 |flags word)... | 00005f90 20 52 38 2d 52 31 30 3d 69 6e 70 75 74 20 63 75 | R8-R10=input cu| 00005fa0 72 73 6f 72 20 28 6f 72 20 63 75 72 73 6f 72 20 |rsor (or cursor | 00005fb0 79 6f 75 20 77 69 73 68 20 63 6f 6d 6d 61 6e 64 |you wish command| 00005fc0 20 74 6f 20 61 63 74 20 6f 6e 29 2e 0a 09 5c 58 | to act on)...\X| 00005fd0 20 52 31 2d 52 31 33 20 70 72 65 73 65 72 76 65 | R1-R13 preserve| 00005fe0 64 2e 0a 09 49 66 20 61 63 74 69 6f 6e 20 63 6f |d...If action co| 00005ff0 64 65 3d 30 20 6f 6e 20 65 6e 74 72 79 20 74 68 |de=0 on entry th| 00006000 65 6e 20 52 30 3d 30 20 6f 72 20 2d 31 20 69 66 |en R0=0 or -1 if| 00006010 20 6d 69 6e 69 62 75 66 66 65 72 20 6f 70 65 6e | minibuffer open| 00006020 65 64 2e 0a 09 49 66 20 61 63 74 69 6f 6e 20 63 |ed...If action c| 00006030 6f 64 65 3e 30 20 6f 6e 20 65 6e 74 72 79 20 74 |ode>0 on entry t| 00006040 68 65 6e 20 52 30 3d 76 61 6c 75 65 20 69 6e 20 |hen R0=value in | 00006050 52 30 20 77 68 65 6e 20 63 6f 6d 6d 61 6e 64 20 |R0 when command | 00006060 72 65 74 75 72 6e 65 64 2e 0a 0a 5a 61 70 5f 46 |returned...Zap_F| 00006070 69 6e 64 4b 65 79 45 6e 74 72 79 0a 54 68 69 73 |indKeyEntry.This| 00006080 20 66 69 6e 64 73 20 74 68 65 20 65 6e 74 72 79 | finds the entry| 00006090 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 | corresponding t| 000060a0 6f 20 61 20 67 69 76 65 6e 20 6b 65 79 20 61 6e |o a given key an| 000060b0 64 20 6b 65 79 6d 61 70 2e 20 59 6f 75 20 6d 69 |d keymap. You mi| 000060c0 67 68 74 20 75 73 65 0a 69 74 20 66 6f 72 20 72 |ght use.it for r| 000060d0 65 64 65 66 69 6e 69 6e 67 20 74 68 65 20 6b 65 |edefining the ke| 000060e0 79 20 66 6f 72 20 69 6e 73 74 61 6e 63 65 2e 20 |y for instance. | 000060f0 54 68 65 20 62 6c 6f 63 6b 20 70 6f 69 6e 74 65 |The block pointe| 00006100 64 20 74 6f 20 6f 6e 20 65 78 69 74 20 68 61 73 |d to on exit has| 00006110 20 74 68 65 0a 66 6f 72 6d 61 74 3a 0a 09 23 30 | the.format:..#0| 00006120 20 43 6f 6d 6d 61 6e 64 20 61 64 64 72 65 73 73 | Command address| 00006130 20 28 6f 72 20 30 20 69 66 20 6e 6f 6e 65 20 2d | (or 0 if none -| 00006140 20 6b 65 79 20 69 73 20 70 61 73 73 65 64 20 6f | key is passed o| 00006150 6e 20 74 6f 20 77 69 6d 70 29 0a 09 23 34 20 43 |n to wimp)..#4 C| 00006160 6f 6d 6d 61 6e 64 20 70 61 72 61 6d 65 74 65 72 |ommand parameter| 00006170 2c 20 74 68 69 73 20 64 65 70 65 6e 64 73 20 6f |, this depends o| 00006180 6e 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 66 6c |n the command fl| 00006190 61 67 73 20 62 33 2d 37 2e 20 49 66 0a 09 20 20 |ags b3-7. If.. | 000061a0 20 74 68 65 73 65 20 62 69 74 73 20 61 72 65 3a | these bits are:| 000061b0 0a 09 20 20 20 30 20 20 20 3d 3e 20 23 34 20 75 |.. 0 => #4 u| 000061c0 6e 64 65 66 69 6e 65 64 20 28 73 68 6f 75 6c 64 |ndefined (should| 000061d0 20 62 65 20 30 29 0a 09 20 20 20 31 2f 32 20 3d | be 0).. 1/2 =| 000061e0 3e 20 23 34 20 69 73 20 74 68 65 20 62 79 74 65 |> #4 is the byte| 000061f0 20 6f 72 20 77 6f 72 64 20 74 6f 20 62 65 20 61 | or word to be a| 00006200 64 64 65 64 20 74 6f 20 74 68 65 20 6c 69 73 74 |dded to the list| 00006210 20 74 6f 20 62 65 0a 09 20 20 20 09 20 20 70 61 | to be.. . pa| 00006220 73 73 65 64 20 74 6f 20 74 68 65 20 63 6f 6d 6d |ssed to the comm| 00006230 61 6e 64 20 77 68 65 6e 20 74 68 65 20 6b 65 79 |and when the key| 00006240 20 69 73 20 70 72 65 73 73 65 64 2e 0a 09 20 20 | is pressed... | 00006250 20 33 20 20 20 3d 3e 20 23 34 3d 61 64 64 72 65 | 3 => #4=addre| 00006260 73 73 20 6f 66 20 73 74 72 69 6e 67 20 70 61 72 |ss of string par| 00006270 61 6d 65 74 65 72 20 2f 30 20 69 66 20 6d 69 6e |ameter /0 if min| 00006280 69 62 75 66 66 65 72 20 73 68 6f 75 6c 64 20 62 |ibuffer should b| 00006290 65 0a 09 20 20 20 20 20 20 20 20 20 20 75 73 65 |e.. use| 000062a0 64 2e 0a 09 20 20 20 34 20 20 20 3d 3e 20 23 34 |d... 4 => #4| 000062b0 3d 61 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 |=address of the | 000062c0 64 61 74 61 20 62 6c 6f 63 6b 2e 0a 09 5c 45 20 |data block...\E | 000062d0 52 30 3d 6b 65 79 6d 61 70 20 6e 75 6d 62 65 72 |R0=keymap number| 000062e0 20 52 31 3d 7a 61 70 73 20 6b 65 79 20 6e 75 6d | R1=zaps key num| 000062f0 62 65 72 20 28 30 2d 26 31 46 46 29 0a 09 5c 58 |ber (0-&1FF)..\X| 00006300 20 52 30 3d 65 6e 74 72 79 20 66 6f 72 20 74 68 | R0=entry for th| 00006310 69 73 20 6b 65 79 20 2f 20 30 20 69 66 20 6b 65 |is key / 0 if ke| 00006320 79 6d 61 70 20 64 6f 65 73 20 6e 6f 74 20 65 78 |ymap does not ex| 00006330 69 73 74 20 6f 72 20 6b 65 79 20 69 73 0a 09 20 |ist or key is.. | 00006340 20 20 6f 75 74 20 6f 66 20 72 61 6e 67 65 2e 0a | out of range..| 00006350 0a 5a 61 70 5f 46 69 6e 64 4c 65 61 66 4e 61 6d |.Zap_FindLeafNam| 00006360 65 0a 54 68 69 73 20 77 6f 72 6b 73 20 6f 75 74 |e.This works out| 00006370 20 77 68 69 63 68 20 70 61 72 74 20 6f 66 20 61 | which part of a| 00006380 20 66 69 6c 65 6e 61 6d 65 20 69 73 20 74 68 65 | filename is the| 00006390 20 6c 65 61 66 6e 61 6d 65 2e 0a 09 5c 45 20 52 | leafname...\E R| 000063a0 30 3d 66 69 6c 65 6e 61 6d 65 20 70 6f 69 6e 74 |0=filename point| 000063b0 65 72 0a 09 5c 58 20 52 30 3d 70 6f 69 6e 74 65 |er..\X R0=pointe| 000063c0 72 20 74 6f 20 74 68 65 20 6c 65 61 66 6e 61 6d |r to the leafnam| 000063d0 65 20 70 61 72 74 20 28 77 69 74 68 69 6e 20 74 |e part (within t| 000063e0 68 65 20 66 69 6c 65 6e 61 6d 65 29 2e 0a 0a 5a |he filename)...Z| 000063f0 61 70 5f 4e 65 77 46 69 6c 65 4e 61 6d 65 0a 43 |ap_NewFileName.C| 00006400 68 61 6e 67 65 20 74 68 65 20 6e 61 6d 65 20 6f |hange the name o| 00006410 66 20 61 20 67 69 76 65 6e 20 66 69 6c 65 2e 20 |f a given file. | 00006420 59 6f 75 20 6d 61 79 20 68 61 76 65 20 74 6f 20 |You may have to | 00006430 63 61 6c 6c 20 5a 61 70 5f 4e 65 77 46 69 6c 65 |call Zap_NewFile| 00006440 54 69 74 6c 65 20 74 6f 0a 75 70 64 61 74 65 20 |Title to.update | 00006450 74 68 65 20 74 69 74 6c 65 62 61 72 73 20 28 74 |the titlebars (t| 00006460 68 69 73 20 77 69 6c 6c 20 75 73 75 61 6c 6c 79 |his will usually| 00006470 20 62 65 20 64 6f 6e 65 20 62 79 20 5a 61 70 5f | be done by Zap_| 00006480 53 61 76 65 46 69 6c 65 29 2e 0a 09 5c 45 20 52 |SaveFile)...\E R| 00006490 30 3d 6e 65 77 20 66 69 6c 65 20 6e 61 6d 65 20 |0=new file name | 000064a0 52 39 0a 09 0a 5a 61 70 5f 43 68 65 63 6b 46 69 |R9...Zap_CheckFi| 000064b0 6c 65 4e 61 6d 65 0a 44 65 63 69 64 65 73 20 77 |leName.Decides w| 000064c0 68 65 74 68 65 72 20 61 20 66 69 6c 65 6e 61 6d |hether a filenam| 000064d0 65 20 69 73 20 61 20 66 75 6c 6c 20 70 61 74 68 |e is a full path| 000064e0 20 6e 61 6d 65 20 28 65 67 20 22 41 44 46 53 3a | name (eg "ADFS:| 000064f0 3a 24 2e 57 69 62 62 6c 65 22 29 20 6f 72 20 6a |:$.Wibble") or j| 00006500 75 73 74 0a 74 68 65 20 6c 65 61 66 20 6e 61 6d |ust.the leaf nam| 00006510 65 20 6f 66 20 61 20 66 69 6c 65 20 28 65 67 20 |e of a file (eg | 00006520 22 54 65 78 74 31 22 29 2e 20 53 68 6f 75 6c 64 |"Text1"). Should| 00006530 20 62 65 20 75 73 65 64 20 69 6e 20 63 6f 6e 6a | be used in conj| 00006540 75 6e 63 74 69 6f 6e 20 77 69 74 68 0a 5a 61 70 |unction with.Zap| 00006550 5f 53 61 76 65 46 69 6c 65 20 61 73 20 74 68 69 |_SaveFile as thi| 00006560 73 20 77 69 6c 6c 20 6e 6f 74 20 73 61 76 65 20 |s will not save | 00006570 66 69 6c 65 73 20 77 69 74 68 6f 75 74 20 66 75 |files without fu| 00006580 6c 6c 20 70 61 74 68 20 6e 61 6d 65 73 2e 0a 09 |ll path names...| 00006590 5c 45 20 52 30 3d 66 69 6c 65 6e 61 6d 65 0a 09 |\E R0=filename..| 000065a0 5c 58 20 52 30 3d 30 20 69 66 20 69 74 20 69 73 |\X R0=0 if it is| 000065b0 20 61 20 66 75 6c 6c 20 70 61 74 68 20 6e 61 6d | a full path nam| 000065c0 65 20 2f 20 31 20 6f 74 68 65 72 77 69 73 65 0a |e / 1 otherwise.| 000065d0 0a 5a 61 70 5f 47 65 74 43 75 72 72 44 69 72 0a |.Zap_GetCurrDir.| 000065e0 52 65 74 75 72 6e 73 20 63 75 72 72 65 6e 74 20 |Returns current | 000065f0 64 69 72 65 63 74 6f 72 79 20 28 6f 66 20 74 68 |directory (of th| 00006600 65 20 74 65 6d 70 6f 72 61 72 79 20 66 69 6c 69 |e temporary fili| 00006610 6e 67 20 73 79 73 74 65 6d 29 20 77 68 69 63 68 |ng system) which| 00006620 20 73 68 6f 75 6c 64 20 62 65 0a 75 73 65 64 20 | should be.used | 00006630 61 73 20 64 65 66 61 75 6c 74 20 73 74 72 69 6e |as default strin| 00006640 67 20 69 6e 20 6d 69 6e 69 62 75 66 66 65 72 20 |g in minibuffer | 00006650 66 69 6c 65 20 6f 70 65 72 61 74 69 6f 6e 73 2e |file operations.| 00006660 20 4f 6e 20 52 49 53 43 20 4f 53 20 32 2c 20 74 | On RISC OS 2, t| 00006670 68 65 72 65 20 69 73 0a 6e 6f 20 77 61 79 20 6f |here is.no way o| 00006680 66 20 72 65 61 64 69 6e 67 20 74 68 65 20 63 75 |f reading the cu| 00006690 72 72 65 6e 74 20 64 69 72 65 63 74 6f 72 79 20 |rrent directory | 000066a0 73 6f 20 74 68 69 73 20 63 61 6c 6c 20 72 65 74 |so this call ret| 000066b0 75 72 6e 73 20 74 68 65 20 72 6f 6f 74 0a 64 69 |urns the root.di| 000066c0 72 65 63 74 6f 72 79 20 6f 6e 20 74 68 65 20 63 |rectory on the c| 000066d0 75 72 72 65 6e 74 20 64 69 73 63 20 28 76 69 61 |urrent disc (via| 000066e0 20 4f 53 5f 41 72 67 73 20 30 2c 20 4f 53 5f 46 | OS_Args 0, OS_F| 000066f0 53 43 6f 6e 74 72 6f 6c 20 33 33 2c 20 4f 53 5f |SControl 33, OS_| 00006700 47 42 50 42 20 35 29 2e 20 4f 6e 0a 52 49 53 43 |GBPB 5). On.RISC| 00006710 20 4f 53 20 33 2c 20 74 68 65 20 63 75 72 72 65 | OS 3, the curre| 00006720 6e 74 20 64 69 72 65 63 74 6f 72 79 20 69 73 20 |nt directory is | 00006730 72 65 61 64 20 76 69 61 20 4f 53 5f 41 72 67 73 |read via OS_Args| 00006740 20 30 2c 20 4f 53 5f 46 53 43 6f 6e 74 72 6f 6c | 0, OS_FSControl| 00006750 20 33 33 2c 20 61 6e 64 0a 4f 53 5f 46 53 43 6f | 33, and.OS_FSCo| 00006760 6e 74 72 6f 6c 20 35 34 2e 20 4e 42 20 54 68 65 |ntrol 54. NB The| 00006770 20 62 6c 6f 63 6b 20 69 74 20 69 73 20 72 65 74 | block it is ret| 00006780 75 72 6e 65 64 20 69 6e 20 69 73 20 6e 6f 74 20 |urned in is not | 00006790 73 74 61 62 6c 65 20 6f 76 65 72 20 63 61 6c 6c |stable over call| 000067a0 73 20 74 6f 0a 5a 61 70 2e 20 59 6f 75 20 6d 61 |s to.Zap. You ma| 000067b0 79 20 63 61 6c 6c 20 5a 61 70 5f 4d 69 6e 69 57 |y call Zap_MiniW| 000067c0 72 69 74 65 20 70 61 73 73 69 6e 67 20 74 68 69 |rite passing thi| 000067d0 73 20 62 6c 6f 63 6b 20 62 75 74 20 73 68 6f 75 |s block but shou| 000067e0 6c 64 20 63 6f 70 79 20 74 68 65 0a 73 74 72 69 |ld copy the.stri| 000067f0 6e 67 20 66 6f 72 20 6f 74 68 65 72 20 63 61 6c |ng for other cal| 00006800 6c 73 2e 0a 09 5c 58 20 52 30 3d 70 6f 69 6e 74 |ls...\X R0=point| 00006810 65 72 20 74 6f 20 32 35 36 20 62 79 74 65 20 62 |er to 256 byte b| 00006820 75 66 66 65 72 20 63 6f 6e 74 61 69 6e 69 6e 67 |uffer containing| 00006830 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 6e | the directory n| 00006840 61 6d 65 0a 0a 5a 61 70 5f 4d 69 6e 69 57 72 69 |ame..Zap_MiniWri| 00006850 74 65 43 0a 57 72 69 74 65 73 20 61 20 73 69 6e |teC.Writes a sin| 00006860 67 6c 65 20 63 68 61 72 61 63 74 65 72 20 74 6f |gle character to| 00006870 20 74 68 65 20 6d 69 6e 69 62 75 66 66 65 72 2e | the minibuffer.| 00006880 20 53 65 65 20 5a 61 70 5f 4d 69 6e 69 57 72 69 | See Zap_MiniWri| 00006890 74 65 20 66 6f 72 20 74 68 65 0a 63 68 61 72 61 |te for the.chara| 000068a0 63 74 65 72 20 63 6f 64 65 73 2e 0a 09 5c 45 20 |cter codes...\E | 000068b0 52 30 3d 63 68 61 72 61 63 74 65 72 20 74 6f 20 |R0=character to | 000068c0 69 6e 73 65 72 74 20 69 6e 20 6d 69 6e 69 62 75 |insert in minibu| 000068d0 66 66 65 72 2e 0a 0a 5a 61 70 5f 4d 69 6e 69 43 |ffer...Zap_MiniC| 000068e0 6c 65 61 72 0a 43 6c 65 61 72 73 20 6d 69 6e 69 |lear.Clears mini| 000068f0 62 75 66 66 65 72 20 63 6f 6e 74 65 6e 74 73 20 |buffer contents | 00006900 77 69 74 68 6f 75 74 20 75 70 64 61 74 69 6e 67 |without updating| 00006910 20 6f 6e 20 73 63 72 65 65 6e 2e 20 52 65 73 65 | on screen. Rese| 00006920 74 73 20 6d 61 72 6b 73 20 65 74 63 2e 20 59 6f |ts marks etc. Yo| 00006930 75 0a 73 68 6f 75 6c 64 20 75 73 65 20 74 68 69 |u.should use thi| 00006940 73 20 62 65 66 6f 72 65 20 75 73 69 6e 67 20 5a |s before using Z| 00006950 61 70 5f 4d 69 6e 69 53 74 61 72 74 2e 0a 0a 5a |ap_MiniStart...Z| 00006960 61 70 5f 4d 69 6e 69 53 74 61 72 74 0a 54 68 69 |ap_MiniStart.Thi| 00006970 73 20 73 74 61 72 74 73 20 75 70 20 74 68 65 20 |s starts up the | 00006980 6d 69 6e 69 62 75 66 66 65 72 2e 20 44 6f 20 6e |minibuffer. Do n| 00006990 6f 74 20 75 73 65 20 74 68 69 73 20 63 61 6c 6c |ot use this call| 000069a0 20 77 68 65 6e 20 77 72 69 74 69 6e 67 20 61 20 | when writing a | 000069b0 5a 61 70 0a 63 6f 6d 6d 61 6e 64 2e 20 52 65 61 |Zap.command. Rea| 000069c0 64 20 74 68 65 20 66 69 6c 65 20 45 2d 43 6f 6d |d the file E-Com| 000069d0 6d 61 6e 64 20 74 6f 20 73 65 65 20 68 6f 77 20 |mand to see how | 000069e0 74 68 65 20 6d 69 6e 69 62 75 66 66 65 72 20 77 |the minibuffer w| 000069f0 6f 72 6b 73 20 69 6e 20 74 68 69 73 0a 63 61 73 |orks in this.cas| 00006a00 65 2e 20 59 6f 75 20 6e 65 76 65 72 20 6e 65 65 |e. You never nee| 00006a10 64 20 74 68 69 73 20 63 61 6c 6c 2c 20 5a 61 70 |d this call, Zap| 00006a20 5f 50 72 6f 63 65 73 73 43 6f 6d 6d 61 6e 64 20 |_ProcessCommand | 00006a30 63 61 6e 20 6f 70 65 6e 20 61 20 6d 69 6e 69 62 |can open a minib| 00006a40 75 66 66 65 72 20 61 74 0a 61 6e 79 20 74 69 6d |uffer at.any tim| 00006a50 65 20 69 66 20 79 6f 75 20 66 65 65 64 20 69 74 |e if you feed it| 00006a60 20 61 20 73 74 72 69 6e 67 20 74 79 70 65 20 63 | a string type c| 00006a70 6f 6d 6d 61 6e 64 20 61 6e 64 20 52 30 3d 52 32 |ommand and R0=R2| 00006a80 3d 30 2e 0a 09 5c 45 20 52 37 3d 61 64 64 72 65 |=0...\E R7=addre| 00006a90 73 73 20 6f 66 20 63 6f 6d 6d 61 6e 64 20 74 6f |ss of command to| 00006aa0 20 62 65 20 63 61 6c 6c 65 64 20 77 68 65 6e 20 | be called when | 00006ab0 72 65 74 75 72 6e 20 70 72 65 73 73 65 64 20 69 |return pressed i| 00006ac0 6e 0a 09 20 20 20 6d 69 6e 69 62 75 66 66 65 72 |n.. minibuffer| 00006ad0 2e 20 5b 52 37 2c 23 2d 34 5d 20 6d 75 73 74 20 |. [R7,#-4] must | 00006ae0 63 6f 6e 74 61 69 6e 20 74 68 65 20 63 6f 6d 6d |contain the comm| 00006af0 61 6e 64 20 66 6c 61 67 73 20 77 6f 72 64 20 61 |and flags word a| 00006b00 73 0a 09 20 20 20 64 6f 63 75 6d 65 6e 74 65 64 |s.. documented| 00006b10 20 69 6e 20 45 2d 43 6f 6d 6d 61 6e 64 2e 0a 09 | in E-Command...| 00006b20 20 20 20 52 38 2f 52 39 3d 77 69 6e 64 6f 77 20 | R8/R9=window | 00006b30 6d 69 6e 69 62 75 66 66 65 72 20 73 68 6f 75 6c |minibuffer shoul| 00006b40 64 20 61 70 70 65 61 72 20 61 74 2e 0a 0a 5a 61 |d appear at...Za| 00006b50 70 5f 4d 69 6e 69 45 76 61 6c 0a 54 68 69 73 20 |p_MiniEval.This | 00006b60 74 75 72 6e 73 20 61 20 73 74 72 69 6e 67 20 69 |turns a string i| 00006b70 6e 74 6f 20 61 20 6e 75 6d 62 65 72 20 76 69 61 |nto a number via| 00006b80 20 4f 53 5f 45 76 61 6c 75 61 74 65 45 78 70 72 | OS_EvaluateExpr| 00006b90 65 73 73 69 6f 6e 2e 20 49 74 20 69 73 20 75 73 |ession. It is us| 00006ba0 75 61 6c 6c 79 0a 63 61 6c 6c 65 64 20 6e 65 61 |ually.called nea| 00006bb0 72 20 74 68 65 20 73 74 61 72 74 20 6f 66 20 61 |r the start of a| 00006bc0 20 63 6f 6d 6d 61 6e 64 20 77 68 69 63 68 20 65 | command which e| 00006bd0 78 70 65 63 74 73 20 74 6f 20 66 69 6e 64 20 61 |xpects to find a| 00006be0 20 6e 75 6d 62 65 72 20 69 6e 20 74 68 65 0a 6d | number in the.m| 00006bf0 69 6e 69 62 75 66 66 65 72 2e 0a 09 5c 45 20 52 |inibuffer...\E R| 00006c00 30 3d 73 74 72 69 6e 67 20 70 6f 69 6e 74 65 72 |0=string pointer| 00006c10 20 28 75 73 75 61 6c 6c 79 20 6d 69 6e 69 62 75 | (usually minibu| 00006c20 66 66 65 72 20 70 6f 69 6e 74 65 72 20 70 61 73 |ffer pointer pas| 00006c30 73 65 64 20 74 6f 20 79 6f 75 29 0a 09 5c 58 20 |sed to you)..\X | 00006c40 52 30 3d 6e 75 6d 62 65 72 20 73 74 6f 72 65 64 |R0=number stored| 00006c50 20 69 6e 20 73 74 72 69 6e 67 2f 43 53 20 69 66 | in string/CS if| 00006c60 20 6e 6f 74 20 61 20 76 61 6c 69 64 20 6e 75 6d | not a valid num| 00006c70 62 65 72 2e 0a 0a 5a 61 70 5f 43 6f 6d 6d 61 6e |ber...Zap_Comman| 00006c80 64 53 74 72 69 6e 67 20 28 73 65 65 20 61 6c 73 |dString (see als| 00006c90 6f 20 5a 61 70 5f 50 72 6f 63 65 73 73 43 6f 6d |o Zap_ProcessCom| 00006ca0 6d 61 6e 64 29 0a 54 68 69 73 20 63 61 6c 6c 20 |mand).This call | 00006cb0 74 61 6b 65 73 20 61 20 63 6f 6d 6d 61 6e 64 20 |takes a command | 00006cc0 28 6f 72 20 63 6f 6c 6f 6e 20 73 65 70 61 72 61 |(or colon separa| 00006cd0 74 65 64 20 6c 69 73 74 20 6f 66 20 63 6f 6d 6d |ted list of comm| 00006ce0 61 6e 64 73 29 20 69 6e 20 73 74 72 69 6e 67 0a |ands) in string.| 00006cf0 66 6f 72 6d 20 61 6e 64 20 65 78 65 63 75 74 65 |form and execute| 00006d00 73 20 74 68 65 6d 20 61 73 20 74 79 70 65 64 2e |s them as typed.| 00006d10 20 46 6f 72 20 65 78 61 6d 70 6c 65 20 69 66 20 | For example if | 00006d20 52 30 3d 22 4d 4f 44 45 20 30 22 20 6f 6e 20 65 |R0="MODE 0" on e| 00006d30 6e 74 72 79 20 74 68 65 6e 0a 66 69 72 73 74 20 |ntry then.first | 00006d40 6f 66 20 61 6c 6c 20 61 20 63 61 6c 6c 20 74 6f |of all a call to| 00006d50 20 5a 61 70 5f 46 69 6e 64 43 6f 6d 6d 61 6e 64 | Zap_FindCommand| 00006d60 20 77 69 6c 6c 20 62 65 20 6d 61 64 65 20 74 6f | will be made to| 00006d70 20 66 69 6e 64 20 74 68 65 20 61 64 64 72 65 73 | find the addres| 00006d80 73 20 6f 66 0a 74 68 65 20 63 6f 6d 6d 61 6e 64 |s of.the command| 00006d90 20 22 4d 4f 44 45 22 20 61 6e 64 20 74 68 65 6e | "MODE" and then| 00006da0 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 77 69 6c | the command wil| 00006db0 6c 20 62 65 20 63 61 6c 6c 65 64 20 76 69 61 0a |l be called via.| 00006dc0 5a 61 70 5f 50 72 6f 63 65 73 73 43 6f 6d 6d 61 |Zap_ProcessComma| 00006dd0 6e 64 20 77 69 74 68 20 52 32 3d 30 2e 0a 09 5c |nd with R2=0...\| 00006de0 45 20 52 30 3d 63 6f 6d 6d 61 6e 64 20 73 74 72 |E R0=command str| 00006df0 69 6e 67 20 28 7a 65 72 6f 20 74 65 72 6d 69 6e |ing (zero termin| 00006e00 61 74 65 64 29 0a 09 20 20 20 20 20 20 53 65 74 |ated).. Set| 00006e10 20 62 33 31 20 69 66 20 79 6f 75 20 64 6f 6e 27 | b31 if you don'| 00006e20 74 20 77 61 6e 74 20 74 68 65 20 63 6f 6d 6d 61 |t want the comma| 00006e30 6e 64 73 20 74 6f 20 62 65 20 6c 65 61 72 6e 74 |nds to be learnt| 00006e40 20 69 66 20 69 6e 0a 09 20 20 20 20 20 20 6c 65 | if in.. le| 00006e50 61 72 6e 20 6d 6f 64 65 2e 0a 09 5c 58 20 52 30 |arn mode...\X R0| 00006e60 3d 30 20 6f 72 20 2d 31 20 69 66 20 74 68 65 20 |=0 or -1 if the | 00006e70 6d 69 6e 69 62 75 66 66 65 72 20 68 61 73 20 62 |minibuffer has b| 00006e80 65 65 6e 20 6f 70 65 6e 65 64 2e 0a 0a 5a 61 70 |een opened...Zap| 00006e90 5f 50 72 6f 63 65 73 73 4b 65 79 73 0a 54 68 69 |_ProcessKeys.Thi| 00006ea0 73 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 61 63 |s entry point ac| 00006eb0 63 65 73 73 65 73 20 5a 61 70 27 73 20 6d 61 69 |cesses Zap's mai| 00006ec0 6e 20 6b 65 79 20 68 61 6e 64 6c 69 6e 67 20 73 |n key handling s| 00006ed0 75 62 20 73 6f 20 79 6f 75 20 63 61 6e 20 73 69 |ub so you can si| 00006ee0 6d 75 6c 61 74 65 0a 6b 65 79 70 72 65 73 73 65 |mulate.keypresse| 00006ef0 73 2e 20 49 66 20 79 6f 75 20 6a 75 73 74 20 77 |s. If you just w| 00006f00 69 73 68 20 74 6f 20 73 69 6d 75 6c 61 74 65 20 |ish to simulate | 00006f10 6f 6e 65 20 6b 65 79 20 70 72 65 73 73 2c 20 74 |one key press, t| 00006f20 68 65 6e 20 69 74 20 69 73 20 65 61 73 69 65 72 |hen it is easier| 00006f30 20 74 6f 0a 75 73 65 20 74 68 65 20 6e 65 78 74 | to.use the next| 00006f40 20 63 61 6c 6c 2e 20 54 68 69 73 20 63 61 6c 6c | call. This call| 00006f50 20 69 73 20 66 6f 72 20 6d 75 6c 74 69 70 6c 65 | is for multiple| 00006f60 20 6b 65 79 70 72 65 73 73 65 73 20 61 6e 64 20 | keypresses and | 00006f70 62 75 66 66 65 72 73 20 74 68 65 20 64 61 74 61 |buffers the data| 00006f80 0a 61 73 20 6d 75 63 68 20 61 73 20 70 6f 73 73 |.as much as poss| 00006f90 69 62 6c 65 20 62 65 66 6f 72 65 20 69 74 20 68 |ible before it h| 00006fa0 61 73 20 74 6f 20 63 61 6c 6c 20 61 20 63 6f 6d |as to call a com| 00006fb0 6d 61 6e 64 2e 20 59 6f 75 20 6d 75 73 74 20 6b |mand. You must k| 00006fc0 65 65 70 20 63 61 6c 6c 69 6e 67 0a 74 68 69 73 |eep calling.this| 00006fd0 20 63 6f 6d 6d 61 6e 64 20 75 6e 74 69 6c 20 69 | command until i| 00006fe0 74 20 72 65 74 75 72 6e 73 20 52 30 3c 30 20 28 |t returns R0<0 (| 00006ff0 61 73 20 69 74 20 77 69 6c 6c 20 64 6f 20 69 66 |as it will do if| 00007000 20 79 6f 75 20 70 75 74 20 52 35 3d 2d 31 20 6f | you put R5=-1 o| 00007010 6e 20 65 6e 74 72 79 20 2d 0a 69 74 20 75 73 65 |n entry -.it use| 00007020 73 20 74 68 65 20 52 35 3d 2d 31 20 63 61 6c 6c |s the R5=-1 call| 00007030 20 74 6f 20 65 78 65 63 75 74 65 20 74 68 65 20 | to execute the | 00007040 62 75 66 66 65 72 65 64 20 64 61 74 61 29 2e 0a |buffered data)..| 00007050 09 5c 45 20 52 30 3d 7a 61 70 20 6b 65 79 20 6e |.\E R0=zap key n| 00007060 75 6d 62 65 72 20 6f 66 20 6e 65 78 74 20 6b 65 |umber of next ke| 00007070 79 20 74 6f 20 65 78 65 63 75 74 65 20 28 69 66 |y to execute (if| 00007080 20 52 35 3e 3d 30 29 0a 09 20 20 20 52 35 3d 2d | R5>=0).. R5=-| 00007090 31 20 20 20 20 20 3d 3e 20 74 68 65 72 65 20 61 |1 => there a| 000070a0 72 65 20 6e 6f 20 6d 6f 72 65 20 6b 65 79 73 20 |re no more keys | 000070b0 74 6f 20 62 75 66 66 65 72 20 28 52 30 20 6e 6f |to buffer (R0 no| 000070c0 74 20 64 65 66 69 6e 65 64 29 2e 0a 09 20 20 20 |t defined)... | 000070d0 20 20 20 30 2d 26 31 46 46 20 3d 3e 20 77 69 6d | 0-&1FF => wim| 000070e0 70 20 6b 65 79 20 6e 75 6d 62 65 72 20 6f 66 20 |p key number of | 000070f0 6b 65 79 20 74 6f 20 73 65 6e 64 20 74 6f 20 57 |key to send to W| 00007100 69 6d 70 5f 50 72 6f 63 65 73 73 4b 65 79 0a 09 |imp_ProcessKey..| 00007110 20 20 20 09 09 69 66 20 6e 6f 20 63 6f 6d 6d 61 | ..if no comma| 00007120 6e 64 20 69 73 20 61 74 74 61 63 68 65 64 20 74 |nd is attached t| 00007130 6f 20 74 68 65 20 6b 65 79 2e 0a 09 20 20 20 20 |o the key... | 00007140 20 20 26 32 30 30 20 20 20 3d 3e 09 69 66 20 57 | &200 =>.if W| 00007150 69 6d 70 5f 50 72 6f 63 65 73 73 4b 65 79 20 73 |imp_ProcessKey s| 00007160 68 6f 75 6c 64 20 6e 65 76 65 72 20 62 65 20 63 |hould never be c| 00007170 61 6c 6c 65 64 2e 0a 09 20 20 20 52 36 3d 6c 65 |alled... R6=le| 00007180 6e 67 74 68 20 6f 66 20 63 75 72 72 65 6e 74 20 |ngth of current | 00007190 62 75 66 66 65 72 69 6e 67 20 28 73 65 74 20 74 |buffering (set t| 000071a0 6f 20 30 20 6f 6e 20 66 69 72 73 74 20 63 61 6c |o 0 on first cal| 000071b0 6c 29 0a 09 20 20 20 52 37 3d 63 6f 6d 6d 61 6e |l).. R7=comman| 000071c0 64 20 63 75 72 72 65 6e 74 6c 79 20 62 65 69 6e |d currently bein| 000071d0 67 20 62 75 66 66 65 72 65 64 20 28 69 66 20 52 |g buffered (if R| 000071e0 36 3e 30 29 0a 09 20 20 20 52 38 2d 52 31 30 3d |6>0).. R8-R10=| 000071f0 69 6e 70 75 74 20 63 75 72 73 6f 72 0a 09 5c 58 |input cursor..\X| 00007200 20 52 30 3e 3d 30 20 69 66 20 79 6f 75 20 73 68 | R0>=0 if you sh| 00007210 6f 75 6c 64 20 63 61 6c 6c 20 74 68 69 73 20 73 |ould call this s| 00007220 75 62 20 61 67 61 69 6e 20 77 69 74 68 20 74 68 |ub again with th| 00007230 65 20 6e 65 78 74 20 6b 65 79 20 28 6f 72 0a 09 |e next key (or..| 00007240 20 20 20 20 20 20 52 35 3d 2d 31 20 69 66 20 74 | R5=-1 if t| 00007250 68 65 72 65 20 61 72 65 20 6e 6f 20 6d 6f 72 65 |here are no more| 00007260 29 2e 0a 09 20 20 20 52 30 3c 30 20 69 66 20 74 |)... R0<0 if t| 00007270 68 65 20 63 6f 6d 6d 61 6e 64 20 68 61 73 20 66 |he command has f| 00007280 69 6e 69 73 68 65 64 20 70 72 6f 63 65 73 73 69 |inished processi| 00007290 6e 67 20 61 6c 6c 20 62 75 66 66 65 72 65 64 20 |ng all buffered | 000072a0 64 61 74 61 0a 09 20 20 20 20 20 20 73 6f 20 79 |data.. so y| 000072b0 6f 75 20 6e 65 65 64 6e 27 74 20 63 61 6c 6c 20 |ou needn't call | 000072c0 69 74 20 61 67 61 69 6e 2e 0a 09 20 20 20 52 36 |it again... R6| 000072d0 2f 52 37 20 61 72 65 20 75 70 64 61 74 65 64 20 |/R7 are updated | 000072e0 66 6f 72 20 74 68 65 20 6e 65 78 74 20 63 61 6c |for the next cal| 000072f0 6c 2e 0a 09 20 20 20 0a 5a 61 70 5f 50 72 6f 63 |l... .Zap_Proc| 00007300 65 73 73 41 4b 65 79 0a 54 68 69 73 20 63 6f 6d |essAKey.This com| 00007310 6d 61 6e 64 20 73 69 6d 75 6c 61 74 65 73 20 61 |mand simulates a| 00007320 20 6b 65 79 20 70 72 65 73 73 20 62 79 20 63 61 | key press by ca| 00007330 6c 6c 69 6e 67 20 74 68 65 20 61 62 6f 76 65 20 |lling the above | 00007340 63 6f 6d 6d 61 6e 64 20 74 77 69 63 65 2c 20 6f |command twice, o| 00007350 6e 63 65 0a 77 69 74 68 20 74 68 65 20 6b 65 79 |nce.with the key| 00007360 20 61 6e 64 20 74 68 65 6e 20 6f 6e 63 65 20 77 | and then once w| 00007370 69 74 68 20 52 35 3d 2d 31 2e 0a 09 5c 45 20 52 |ith R5=-1...\E R| 00007380 30 3d 7a 61 70 20 6b 65 79 20 6e 75 6d 62 65 72 |0=zap key number| 00007390 0a 09 20 20 20 52 35 3d 77 69 6d 70 20 6b 65 79 |.. R5=wimp key| 000073a0 20 6e 75 6d 62 65 72 20 28 73 65 65 20 5a 61 70 | number (see Zap| 000073b0 5f 50 72 6f 63 65 73 73 4b 65 79 73 29 0a 09 20 |_ProcessKeys).. | 000073c0 20 20 52 38 2d 52 31 30 3d 69 6e 70 75 74 20 63 | R8-R10=input c| 000073d0 61 72 65 74 0a 0a 5a 61 70 5f 4f 70 65 6e 57 69 |aret..Zap_OpenWi| 000073e0 6e 64 6f 77 0a 54 68 65 20 63 75 72 72 65 6e 74 |ndow.The current| 000073f0 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 61 20 5a | position of a Z| 00007400 61 70 20 77 69 6e 64 6f 77 20 63 61 6e 20 62 65 |ap window can be| 00007410 20 72 65 61 64 20 65 61 73 69 6c 79 20 75 73 69 | read easily usi| 00007420 6e 67 20 74 68 65 20 63 6f 64 65 3a 0a 20 4d 4f |ng the code:. MO| 00007430 56 20 52 31 2c 52 38 20 3a 20 53 57 49 20 22 58 |V R1,R8 : SWI "X| 00007440 57 69 6d 70 5f 47 65 74 57 69 6e 64 6f 77 53 74 |Wimp_GetWindowSt| 00007450 61 74 65 22 2e 20 48 6f 77 65 76 65 72 2c 20 79 |ate". However, y| 00007460 6f 75 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 61 |ou should not ca| 00007470 6c 6c 0a 57 69 6d 70 5f 4f 70 65 6e 57 69 6e 64 |ll.Wimp_OpenWind| 00007480 6f 77 20 74 6f 20 6f 70 65 6e 20 61 20 77 69 6e |ow to open a win| 00007490 64 6f 77 20 61 73 20 5a 61 70 20 68 61 73 20 74 |dow as Zap has t| 000074a0 6f 20 6b 65 65 70 20 74 72 61 63 6b 20 6f 66 20 |o keep track of | 000074b0 74 68 65 20 74 69 74 6c 65 20 6c 65 6e 67 74 68 |the title length| 000074c0 0a 61 6e 64 20 70 6f 73 69 74 69 6f 6e 20 6f 66 |.and position of| 000074d0 20 74 68 65 20 6d 69 6e 69 62 75 66 66 65 72 20 | the minibuffer | 000074e0 65 74 63 2e 20 59 6f 75 20 73 68 6f 75 6c 64 20 |etc. You should | 000074f0 75 73 65 20 74 68 69 73 20 63 61 6c 6c 20 69 6e |use this call in| 00007500 73 74 65 61 64 2e 20 55 73 65 0a 63 61 6c 6c 20 |stead. Use.call | 00007510 30 20 77 68 65 72 65 20 70 6f 73 73 69 62 6c 65 |0 where possible| 00007520 20 61 73 20 69 74 20 70 72 65 76 65 6e 74 73 20 | as it prevents | 00007530 74 69 74 6c 65 62 61 72 20 66 6c 69 63 6b 65 72 |titlebar flicker| 00007540 2e 0a 09 5c 45 20 52 30 3d 74 79 70 65 20 6f 66 |...\E R0=type of| 00007550 20 6f 70 65 6e 3a 0a 09 09 30 20 3d 3e 20 4a 75 | open:...0 => Ju| 00007560 73 74 20 63 68 61 6e 67 69 6e 67 20 73 63 72 6f |st changing scro| 00007570 6c 6c 20 6f 66 66 73 65 74 73 20 6f 72 20 68 65 |ll offsets or he| 00007580 69 67 68 74 20 69 6e 20 77 69 6e 64 6f 77 20 73 |ight in window s| 00007590 74 61 63 6b 2e 0a 09 09 20 20 20 20 20 53 69 7a |tack.... Siz| 000075a0 65 2f 70 6f 73 69 74 69 6f 6e 20 6f 66 20 77 69 |e/position of wi| 000075b0 6e 64 6f 77 20 4e 4f 54 20 63 68 61 6e 67 69 6e |ndow NOT changin| 000075c0 67 2e 0a 09 09 31 20 3d 3e 20 57 69 6e 64 6f 77 |g....1 => Window| 000075d0 20 6d 61 79 20 6d 6f 76 65 2f 63 68 61 6e 67 65 | may move/change| 000075e0 20 73 69 7a 65 2e 20 4d 69 6e 69 62 75 66 66 65 | size. Minibuffe| 000075f0 72 2c 20 74 69 74 6c 65 20 62 61 72 0a 09 09 20 |r, title bar... | 00007600 20 20 20 20 61 6e 64 20 63 75 72 73 6f 72 73 20 | and cursors | 00007610 64 65 61 6c 74 20 77 69 74 68 20 61 63 63 6f 72 |dealt with accor| 00007620 64 69 6e 67 6c 79 2e 0a 09 09 32 20 3d 3e 20 57 |dingly....2 => W| 00007630 69 6e 64 6f 77 20 69 73 20 61 20 6e 65 77 20 77 |indow is a new w| 00007640 69 6e 64 6f 77 2e 20 54 6f 67 67 6c 65 20 73 69 |indow. Toggle si| 00007650 7a 65 20 64 61 74 61 20 65 74 63 20 72 65 73 65 |ze data etc rese| 00007660 74 2e 0a 09 09 33 20 3d 3e 20 42 72 69 6e 67 20 |t....3 => Bring | 00007670 77 69 6e 64 6f 77 20 74 6f 20 66 72 6f 6e 74 20 |window to front | 00007680 6f 66 20 73 74 61 63 6b 20 28 69 67 6e 6f 72 65 |of stack (ignore| 00007690 20 52 31 29 0a 09 09 34 20 3d 3e 20 50 75 74 20 | R1)...4 => Put | 000076a0 77 69 6e 64 6f 77 20 74 6f 20 62 61 63 6b 20 6f |window to back o| 000076b0 66 20 73 74 61 63 6b 20 28 69 67 6e 6f 72 65 20 |f stack (ignore | 000076c0 52 31 29 0a 09 09 35 20 3d 3e 20 41 73 20 66 6f |R1)...5 => As fo| 000076d0 72 20 30 2c 20 62 75 74 20 63 75 72 73 6f 72 20 |r 0, but cursor | 000076e0 6b 65 70 74 20 77 69 74 68 69 6e 20 74 68 65 20 |kept within the | 000076f0 77 69 6e 64 6f 77 20 69 66 20 74 68 65 0a 09 09 |window if the...| 00007700 20 20 20 20 20 27 63 6f 6e 73 74 72 69 63 74 20 | 'constrict | 00007710 63 75 72 73 6f 72 27 20 6f 70 74 69 6f 6e 20 69 |cursor' option i| 00007720 73 20 6f 6e 2e 0a 09 09 28 4e 42 20 74 79 70 65 |s on....(NB type| 00007730 20 32 20 63 61 6c 6c 73 20 74 79 70 65 20 31 20 | 2 calls type 1 | 00007740 63 61 6c 6c 73 20 74 79 70 65 20 35 20 63 61 6c |calls type 5 cal| 00007750 6c 73 20 74 79 70 65 20 30 29 0a 09 20 20 20 52 |ls type 0).. R| 00007760 31 3d 6f 70 65 6e 20 62 6c 6f 63 6b 20 28 61 73 |1=open block (as| 00007770 20 66 6f 72 20 57 69 6d 70 5f 4f 70 65 6e 57 69 | for Wimp_OpenWi| 00007780 6e 64 6f 77 29 0a 09 20 20 20 52 38 3d 77 69 6e |ndow).. R8=win| 00007790 64 6f 77 20 62 6c 6f 63 6b 20 28 4e 42 20 55 73 |dow block (NB Us| 000077a0 75 61 6c 6c 79 20 61 6c 74 65 72 20 74 68 69 73 |ually alter this| 000077b0 20 62 6c 6f 63 6b 20 61 6e 64 20 6c 65 74 20 52 | block and let R| 000077c0 31 3d 52 38 29 0a 0a 5a 61 70 5f 52 65 73 74 6f |1=R8)..Zap_Resto| 000077d0 72 65 4d 6f 64 65 57 6f 72 64 0a 54 68 69 73 20 |reModeWord.This | 000077e0 63 61 6c 6c 20 73 68 6f 75 6c 64 20 62 65 20 75 |call should be u| 000077f0 73 65 64 20 62 79 20 79 6f 75 72 20 65 5f 73 74 |sed by your e_st| 00007800 61 72 74 20 65 6e 74 72 79 20 70 6f 69 6e 74 2e |art entry point.| 00007810 20 49 66 20 52 38 3c 3e 30 20 6f 6e 20 65 6e 74 | If R8<>0 on ent| 00007820 72 79 20 74 68 65 6e 0a 69 74 20 72 65 61 64 73 |ry then.it reads| 00007830 20 74 68 65 20 72 65 61 64 73 20 74 68 65 20 6f | the reads the o| 00007840 70 74 69 6f 6e 73 20 66 6f 72 20 74 68 65 20 67 |ptions for the g| 00007850 69 76 65 6e 20 6d 6f 64 65 20 66 72 6f 6d 20 77 |iven mode from w| 00007860 5f 64 61 74 61 62 6c 6f 63 6b 20 75 73 69 6e 67 |_datablock using| 00007870 20 74 68 65 0a 63 61 6c 6c 20 5a 61 70 5f 4d 6f | the.call Zap_Mo| 00007880 64 65 44 61 74 61 2c 20 61 6e 64 20 73 65 74 73 |deData, and sets| 00007890 20 74 68 65 6d 20 61 73 20 74 68 65 20 63 75 72 | them as the cur| 000078a0 72 65 6e 74 20 6f 70 74 69 6f 6e 73 2e 20 49 66 |rent options. If| 000078b0 20 52 38 3d 30 20 74 68 65 6e 20 69 74 20 64 6f | R8=0 then it do| 000078c0 65 73 0a 74 68 65 20 73 61 6d 65 20 74 68 69 6e |es.the same thin| 000078d0 67 20 62 75 74 20 73 65 74 73 20 74 68 65 20 64 |g but sets the d| 000078e0 65 66 61 75 6c 74 20 6f 70 74 69 6f 6e 73 2e 0a |efault options..| 000078f0 09 5c 45 20 52 30 3d 6d 6f 64 65 20 6e 75 6d 62 |.\E R0=mode numb| 00007900 65 72 0a 09 20 20 20 52 38 3d 77 69 6e 64 6f 77 |er.. R8=window| 00007910 20 74 6f 20 72 65 73 74 6f 72 65 20 6f 70 74 69 | to restore opti| 00007920 6f 6e 73 20 6f 6e 20 2f 20 30 20 66 6f 72 20 74 |ons on / 0 for t| 00007930 68 65 20 64 65 66 61 75 6c 74 20 6f 70 74 69 6f |he default optio| 00007940 6e 73 2e 0a 09 20 20 20 0a 5a 61 70 5f 53 61 76 |ns... .Zap_Sav| 00007950 65 4d 6f 64 65 57 6f 72 64 0a 54 68 69 73 20 63 |eModeWord.This c| 00007960 61 6c 6c 20 73 68 6f 75 6c 64 20 62 65 20 75 73 |all should be us| 00007970 65 64 20 62 79 20 79 6f 75 72 20 65 5f 65 6e 64 |ed by your e_end| 00007980 20 65 6e 74 72 79 20 70 6f 69 6e 74 2e 20 49 66 | entry point. If| 00007990 20 52 38 3c 3e 30 20 6f 6e 20 65 6e 74 72 79 20 | R8<>0 on entry | 000079a0 74 68 65 6e 20 69 74 0a 72 65 61 64 73 20 74 68 |then it.reads th| 000079b0 65 20 77 6f 72 64 73 20 77 5f 66 6c 61 67 73 20 |e words w_flags | 000079c0 61 6e 64 20 77 5f 66 6f 72 6d 61 74 20 61 6e 64 |and w_format and| 000079d0 20 73 74 6f 72 65 73 20 74 68 65 20 63 75 72 72 | stores the curr| 000079e0 65 6e 74 20 6f 70 74 69 6f 6e 73 20 69 6e 20 74 |ent options in t| 000079f0 68 65 0a 77 5f 6d 6f 64 65 64 61 74 61 20 62 6c |he.w_modedata bl| 00007a00 6f 63 6b 20 62 79 20 75 73 65 20 6f 66 20 74 68 |ock by use of th| 00007a10 65 20 63 61 6c 6c 20 5a 61 70 5f 4d 6f 64 65 44 |e call Zap_ModeD| 00007a20 61 74 61 2e 20 49 66 20 52 38 3d 30 20 6f 6e 20 |ata. If R8=0 on | 00007a30 65 6e 74 72 79 20 74 68 65 6e 20 69 74 0a 72 65 |entry then it.re| 00007a40 61 64 73 20 6f 70 74 5f 66 6c 61 67 73 20 61 6e |ads opt_flags an| 00007a50 64 20 6f 70 74 5f 66 6f 72 6d 61 74 20 61 6e 64 |d opt_format and| 00007a60 20 73 74 6f 72 65 73 20 74 68 65 6d 20 61 73 20 | stores them as | 00007a70 74 68 65 20 64 65 66 61 75 6c 74 20 6f 70 74 69 |the default opti| 00007a80 6f 6e 20 65 74 63 2e 0a 09 5c 45 20 52 30 3d 6d |on etc...\E R0=m| 00007a90 6f 64 65 20 6e 75 6d 62 65 72 0a 09 20 20 20 52 |ode number.. R| 00007aa0 38 3d 77 69 6e 64 6f 77 20 74 6f 20 73 61 76 65 |8=window to save| 00007ab0 20 6f 70 74 69 6f 6e 73 20 6f 6e 20 2f 20 30 20 | options on / 0 | 00007ac0 66 6f 72 20 74 68 65 20 64 65 66 61 75 6c 74 20 |for the default | 00007ad0 6f 70 74 69 6f 6e 73 2e 0a 0a 5a 61 70 5f 47 65 |options...Zap_Ge| 00007ae0 74 4d 6f 64 65 57 6f 72 64 0a 54 68 69 73 20 63 |tModeWord.This c| 00007af0 61 6c 6c 20 72 65 61 64 73 20 74 68 65 20 63 6f |all reads the co| 00007b00 6e 74 65 6e 74 73 20 6f 66 20 79 6f 75 72 20 6d |ntents of your m| 00007b10 6f 64 65 20 77 6f 72 64 2e 20 49 66 20 52 38 3d |ode word. If R8=| 00007b20 30 20 74 68 65 6e 20 69 74 20 72 65 61 64 73 0a |0 then it reads.| 00007b30 6f 70 74 5f 6d 6f 64 65 6e 2c 20 6f 74 68 65 72 |opt_moden, other| 00007b40 77 69 73 65 20 69 74 20 72 65 61 64 73 20 5b 52 |wise it reads [R| 00007b50 38 2c 23 77 5f 6d 6f 64 65 6e 5d 2e 20 54 68 69 |8,#w_moden]. Thi| 00007b60 73 20 69 73 20 75 73 65 66 75 6c 20 66 6f 72 20 |s is useful for | 00007b70 6d 65 6e 75 0a 6f 70 74 69 6f 6e 73 2e 0a 09 5c |menu.options...\| 00007b80 45 20 52 31 3d 6d 6f 64 65 20 6e 75 6d 62 65 72 |E R1=mode number| 00007b90 0a 09 20 20 20 52 38 3d 77 69 6e 64 6f 77 20 74 |.. R8=window t| 00007ba0 6f 20 67 65 74 20 6d 6f 64 65 20 77 6f 72 64 20 |o get mode word | 00007bb0 2f 20 30 20 66 6f 72 20 64 65 66 61 75 6c 74 20 |/ 0 for default | 00007bc0 6f 70 74 69 6f 6e 73 20 6d 6f 64 65 20 77 6f 72 |options mode wor| 00007bd0 64 0a 09 5c 58 20 52 30 3d 6d 6f 64 65 20 77 6f |d..\X R0=mode wo| 00007be0 72 64 20 63 6f 6e 74 65 6e 74 73 2e 0a 09 0a 5a |rd contents....Z| 00007bf0 61 70 5f 50 75 74 4d 6f 64 65 57 6f 72 64 0a 41 |ap_PutModeWord.A| 00007c00 73 20 61 62 6f 76 65 2c 20 62 75 74 20 77 72 69 |s above, but wri| 00007c10 74 65 20 74 68 65 20 76 61 6c 75 65 2e 0a 09 5c |te the value...\| 00007c20 45 20 52 30 3d 6e 65 77 20 76 61 6c 75 65 20 66 |E R0=new value f| 00007c30 6f 72 20 74 68 65 20 77 6f 72 64 0a 09 20 20 20 |or the word.. | 00007c40 52 31 3d 6d 6f 64 65 20 6e 75 6d 62 65 72 0a 20 |R1=mode number. | 00007c50 20 20 20 20 20 20 20 20 20 20 52 38 3d 77 69 6e | R8=win| 00007c60 64 6f 77 20 74 6f 20 70 75 74 20 6d 6f 64 65 20 |dow to put mode | 00007c70 77 6f 72 64 20 2f 20 30 20 66 6f 72 20 64 65 66 |word / 0 for def| 00007c80 61 75 6c 74 20 6f 70 74 69 6f 6e 73 20 6d 6f 64 |ault options mod| 00007c90 65 20 77 6f 72 64 0a 0a 5a 61 70 5f 42 61 73 65 |e word..Zap_Base| 00007ca0 4d 6f 64 65 0a 54 68 69 73 20 63 61 6c 6c 20 72 |Mode.This call r| 00007cb0 65 70 6c 61 63 65 73 20 5a 61 70 5f 43 61 6c 6c |eplaces Zap_Call| 00007cc0 42 61 73 65 4d 6f 64 65 2e 20 49 74 20 64 69 66 |BaseMode. It dif| 00007cd0 66 65 72 73 20 69 6e 20 74 68 61 74 20 79 6f 75 |fers in that you| 00007ce0 20 6d 75 73 74 20 73 70 65 63 69 66 79 0a 77 68 | must specify.wh| 00007cf0 69 63 68 20 6d 6f 64 65 20 69 73 20 63 61 6c 6c |ich mode is call| 00007d00 69 6e 67 2e 20 54 68 69 73 20 69 6e 66 6f 72 6d |ing. This inform| 00007d10 61 74 69 6f 6e 20 69 73 20 6e 6f 74 20 6e 65 63 |ation is not nec| 00007d20 65 73 73 61 72 69 6c 79 20 61 76 61 69 6c 61 62 |essarily availab| 00007d30 6c 65 20 66 72 6f 6d 0a 74 68 65 20 62 6c 6f 63 |le from.the bloc| 00007d40 6b 20 69 6e 20 52 38 20 69 66 20 61 6e 6f 74 68 |k in R8 if anoth| 00007d50 65 72 20 6d 6f 64 65 20 69 73 20 62 61 73 65 64 |er mode is based| 00007d60 20 6f 6e 20 79 6f 75 72 73 2e 20 54 68 65 20 62 | on yours. The b| 00007d70 61 73 65 6d 6f 64 65 20 6f 66 20 74 68 65 20 6d |asemode of the m| 00007d80 6f 64 65 0a 6e 61 6d 65 64 20 69 6e 20 52 39 20 |ode.named in R9 | 00007d90 69 73 20 63 61 6c 6c 65 64 20 76 69 61 20 74 68 |is called via th| 00007da0 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 6f 66 |e entry point of| 00007db0 66 73 65 74 20 67 69 76 65 6e 20 69 6e 20 52 31 |fset given in R1| 00007dc0 31 2e 20 42 65 66 6f 72 65 20 74 68 65 0a 65 6e |1. Before the.en| 00007dd0 74 72 79 20 70 6f 69 6e 74 20 69 73 20 61 63 74 |try point is act| 00007de0 75 61 6c 6c 79 20 63 61 6c 6c 65 64 2c 20 52 39 |ually called, R9| 00007df0 20 69 73 20 63 6f 6e 76 65 72 74 65 64 20 74 6f | is converted to| 00007e00 20 74 68 65 20 66 69 6c 65 20 62 6c 6f 63 6b 20 | the file block | 00007e10 70 6f 69 6e 74 65 72 0a 6f 66 20 74 68 65 20 77 |pointer.of the w| 00007e20 69 6e 64 6f 77 20 73 70 65 63 69 66 69 65 64 20 |indow specified | 00007e30 69 6e 20 52 38 2e 20 48 65 6e 63 65 20 61 6e 79 |in R8. Hence any| 00007e40 20 65 6e 74 72 79 20 70 6f 69 6e 74 20 72 65 71 | entry point req| 00007e50 75 69 72 69 6e 67 20 52 38 20 61 6e 64 20 52 39 |uiring R8 and R9| 00007e60 0a 73 65 74 20 75 70 20 6f 6e 20 65 6e 74 72 79 |.set up on entry| 00007e70 20 63 61 6e 20 62 65 20 63 61 6c 6c 65 64 20 6f | can be called o| 00007e80 6b 2e 0a 09 5c 45 20 52 30 2d 52 37 3d 70 61 72 |k...\E R0-R7=par| 00007e90 61 6d 65 74 65 72 73 20 66 6f 72 20 74 68 65 20 |ameters for the | 00007ea0 63 61 6c 6c 0a 09 20 20 20 52 38 3d 77 69 6e 64 |call.. R8=wind| 00007eb0 6f 77 20 62 6c 6f 63 6b 20 74 6f 20 62 65 20 75 |ow block to be u| 00007ec0 73 65 64 20 62 79 20 74 68 65 20 63 61 6c 6c 2e |sed by the call.| 00007ed0 0a 09 20 20 20 52 39 3d 6d 6f 64 65 20 6e 75 6d |.. R9=mode num| 00007ee0 62 65 72 20 6d 61 6b 69 6e 67 20 74 68 69 73 20 |ber making this | 00007ef0 63 61 6c 6c 20 28 79 6f 75 72 20 6d 6f 64 65 20 |call (your mode | 00007f00 6e 75 6d 62 65 72 29 2e 0a 09 20 20 20 52 31 30 |number)... R10| 00007f10 3d 70 61 72 61 6d 65 74 65 72 20 66 6f 72 20 74 |=parameter for t| 00007f20 68 65 20 63 61 6c 6c 20 28 75 73 75 61 6c 6c 79 |he call (usually| 00007f30 20 63 75 72 73 6f 72 20 62 6c 6f 63 6b 20 70 6f | cursor block po| 00007f40 69 6e 74 65 72 29 2e 0a 09 20 20 20 52 31 31 3d |inter)... R11=| 00007f50 6d 6f 64 65 20 65 6e 74 72 79 20 70 6f 69 6e 74 |mode entry point| 00007f60 20 6f 66 66 73 65 74 20 28 73 65 65 20 45 2d 45 | offset (see E-E| 00007f70 6e 74 72 79 29 20 74 6f 20 63 61 6c 6c 2e 0a 09 |ntry) to call...| 00007f80 5c 58 20 41 73 20 66 6f 72 20 74 68 65 20 67 69 |\X As for the gi| 00007f90 76 65 6e 20 6d 6f 64 65 20 65 6e 74 72 79 20 70 |ven mode entry p| 00007fa0 6f 69 6e 74 2e 0a 0a 5a 61 70 5f 52 65 61 64 57 |oint...Zap_ReadW| 00007fb0 6f 72 64 0a 54 68 69 73 20 63 61 6c 6c 20 63 61 |ord.This call ca| 00007fc0 6e 20 62 65 20 75 73 65 64 20 66 6f 72 20 72 65 |n be used for re| 00007fd0 61 64 69 6e 67 20 34 20 62 79 74 65 20 66 72 6f |ading 4 byte fro| 00007fe0 6d 20 61 20 66 69 6c 65 20 62 75 66 66 65 72 2e |m a file buffer.| 00007ff0 20 4e 6f 74 65 20 74 68 61 74 0a 61 6c 74 68 6f | Note that.altho| 00008000 75 67 68 20 74 68 65 20 6f 66 66 73 65 74 20 6f |ugh the offset o| 00008010 66 20 74 68 65 20 77 6f 72 64 20 69 6e 20 74 68 |f the word in th| 00008020 65 20 66 69 6c 65 20 6d 61 79 20 62 65 20 77 6f |e file may be wo| 00008030 72 64 20 61 6c 69 67 6e 65 64 2c 20 69 74 27 73 |rd aligned, it's| 00008040 20 6f 66 66 73 65 74 0a 69 6e 20 74 68 65 20 62 | offset.in the b| 00008050 75 66 66 65 72 20 6d 61 79 20 6e 6f 74 20 62 65 |uffer may not be| 00008060 20 64 75 65 20 74 6f 20 74 68 65 20 73 70 6c 69 | due to the spli| 00008070 74 2e 20 54 68 69 73 20 63 61 6c 6c 20 72 65 76 |t. This call rev| 00008080 65 72 73 65 73 20 74 68 65 20 77 6f 72 64 20 69 |erses the word i| 00008090 66 20 74 68 65 0a 42 69 67 20 45 6e 64 69 61 6e |f the.Big Endian| 000080a0 20 66 6c 61 67 20 69 73 20 73 65 74 2e 0a 09 5c | flag is set...\| 000080b0 45 20 52 30 3d 46 69 6c 65 20 6f 66 66 73 65 74 |E R0=File offset| 000080c0 20 6f 66 20 74 68 65 20 77 6f 72 64 20 74 6f 20 | of the word to | 000080d0 62 65 20 72 65 61 64 0a 09 20 20 20 52 38 3d 77 |be read.. R8=w| 000080e0 69 6e 64 6f 77 20 28 66 6f 72 20 62 69 67 20 65 |indow (for big e| 000080f0 6e 64 69 61 6e 20 66 6c 61 67 20 74 6f 20 62 65 |ndian flag to be| 00008100 20 72 65 61 64 29 0a 09 20 20 20 52 39 3d 66 69 | read).. R9=fi| 00008110 6c 65 0a 09 5c 58 20 52 30 3d 74 68 65 20 77 6f |le..\X R0=the wo| 00008120 72 64 20 72 65 61 64 20 28 70 61 64 64 65 64 20 |rd read (padded | 00008130 77 69 74 68 20 7a 65 72 6f 73 20 69 66 20 69 74 |with zeros if it| 00008140 20 77 65 6e 74 20 6f 66 66 20 74 68 65 20 66 69 | went off the fi| 00008150 6c 65 20 65 6e 64 29 2e 0a 0a 5a 61 70 5f 52 65 |le end)...Zap_Re| 00008160 70 6c 61 63 65 57 6f 72 64 0a 54 68 69 73 20 63 |placeWord.This c| 00008170 61 6c 6c 20 72 65 70 6c 61 63 65 73 20 61 20 77 |all replaces a w| 00008180 6f 72 64 20 61 74 20 74 68 65 20 67 69 76 65 6e |ord at the given| 00008190 20 66 69 6c 65 20 6f 66 66 73 65 74 20 28 69 6e | file offset (in| 000081a0 73 65 72 74 69 6e 67 20 69 66 20 74 68 65 20 66 |serting if the f| 000081b0 69 6c 65 0a 6f 66 66 73 65 74 2b 34 3e 66 69 6c |ile.offset+4>fil| 000081c0 65 20 6c 65 6e 67 74 68 29 20 76 69 61 20 5a 61 |e length) via Za| 000081d0 70 5f 43 6f 6d 6d 61 6e 64 2e 20 54 68 65 20 77 |p_Command. The w| 000081e0 6f 72 64 20 69 73 20 72 65 76 65 72 73 65 64 20 |ord is reversed | 000081f0 69 66 20 74 68 65 20 62 69 67 20 65 6e 64 69 61 |if the big endia| 00008200 6e 0a 66 6c 61 67 20 69 73 20 73 65 74 2e 0a 09 |n.flag is set...| 00008210 5c 45 20 52 30 3d 77 6f 72 64 20 74 6f 20 72 65 |\E R0=word to re| 00008220 70 6c 61 63 65 0a 09 20 20 20 52 31 3d 66 69 6c |place.. R1=fil| 00008230 65 20 6f 66 66 73 65 74 0a 09 20 20 20 52 38 2f |e offset.. R8/| 00008240 52 39 20 28 52 38 20 75 73 65 64 20 66 6f 72 20 |R9 (R8 used for | 00008250 74 68 65 20 62 69 67 20 65 6e 64 69 61 6e 20 66 |the big endian f| 00008260 6c 61 67 29 2e 0a 0a 5a 61 70 5f 4d 6f 64 65 43 |lag)...Zap_ModeC| 00008270 6f 6c 6f 75 72 0a 54 68 69 73 20 63 61 6c 6c 20 |olour.This call | 00008280 72 65 61 64 73 20 6f 72 20 77 72 69 74 65 73 20 |reads or writes | 00008290 74 68 65 20 63 6f 6c 6f 75 72 20 64 65 66 69 6e |the colour defin| 000082a0 69 74 69 6f 6e 20 74 61 62 6c 65 2e 20 49 74 20 |ition table. It | 000082b0 77 69 6c 6c 20 6e 6f 74 20 75 73 75 61 6c 6c 79 |will not usually| 000082c0 0a 68 61 76 65 20 69 6d 6d 65 64 69 61 74 65 20 |.have immediate | 000082d0 65 66 66 65 63 74 20 75 6e 6c 65 73 73 20 79 6f |effect unless yo| 000082e0 75 20 72 65 63 72 65 61 74 65 20 74 68 65 20 77 |u recreate the w| 000082f0 69 6e 64 6f 77 20 28 65 67 20 5a 61 70 5f 4e 65 |indow (eg Zap_Ne| 00008300 77 57 69 6e 53 74 61 74 75 73 29 2e 0a 59 6f 75 |wWinStatus)..You| 00008310 20 73 68 6f 75 6c 64 6e 27 74 20 75 73 75 61 6c | shouldn't usual| 00008320 6c 79 20 61 63 63 65 73 73 20 74 68 69 73 20 64 |ly access this d| 00008330 61 74 61 20 61 73 20 5a 61 70 20 68 61 6e 64 6c |ata as Zap handl| 00008340 65 73 20 69 74 20 61 6c 6c 20 66 6f 72 20 79 6f |es it all for yo| 00008350 75 2c 20 65 78 63 65 70 74 0a 74 6f 20 77 72 69 |u, except.to wri| 00008360 74 65 20 73 65 6e 73 69 62 6c 65 20 64 65 66 61 |te sensible defa| 00008370 75 6c 74 20 76 61 6c 75 65 73 20 28 75 73 69 6e |ult values (usin| 00008380 67 20 52 38 3d 30 29 20 69 66 20 79 6f 75 72 20 |g R8=0) if your | 00008390 6d 6f 64 65 20 73 74 61 72 74 73 20 75 70 20 61 |mode starts up a| 000083a0 6e 64 0a 66 69 6e 64 73 20 69 74 73 20 6d 6f 64 |nd.finds its mod| 000083b0 65 20 77 6f 72 64 20 69 73 20 7a 65 72 6f 2e 0a |e word is zero..| 000083c0 09 5c 45 20 52 30 3d 63 6f 6c 6f 75 72 20 74 6f |.\E R0=colour to| 000083d0 20 77 72 69 74 65 20 28 30 2d 31 35 3d 77 69 6d | write (0-15=wim| 000083e0 70 20 63 6f 6c 6f 75 72 29 20 2f 20 2d 31 20 74 |p colour) / -1 t| 000083f0 6f 20 72 65 61 64 0a 09 20 20 20 20 20 20 28 49 |o read.. (I| 00008400 6e 20 66 75 74 75 72 65 20 76 65 72 73 69 6f 6e |n future version| 00008410 73 20 49 20 6d 61 79 20 61 6c 6c 6f 77 20 26 42 |s I may allow &B| 00008420 42 47 47 52 52 31 30 20 32 34 20 62 69 74 20 73 |BGGRR10 24 bit s| 00008430 65 74 74 69 6e 67 73 0a 09 20 20 20 20 20 20 20 |ettings.. | 00008440 61 73 20 77 65 6c 6c 29 2e 0a 09 20 20 20 52 31 |as well)... R1| 00008450 3d 6d 6f 64 65 20 6e 75 6d 62 65 72 0a 09 20 20 |=mode number.. | 00008460 20 52 32 3d 5a 61 70 20 63 6f 6c 6f 75 72 20 6e | R2=Zap colour n| 00008470 75 6d 62 65 72 20 6f 66 20 74 68 65 20 63 6f 6c |umber of the col| 00008480 6f 75 72 20 74 6f 20 77 72 69 74 65 2f 72 65 61 |our to write/rea| 00008490 64 3a 0a 09 20 20 20 20 20 20 30 2f 31 3d 42 61 |d:.. 0/1=Ba| 000084a0 63 6b 67 72 6f 75 6e 64 20 32 3d 46 6f 72 65 67 |ckground 2=Foreg| 000084b0 72 6f 75 6e 64 20 33 3d 53 65 6c 65 63 74 69 6f |round 3=Selectio| 000084c0 6e 20 62 61 63 6b 67 72 6f 75 6e 64 0a 09 20 20 |n background.. | 000084d0 20 20 20 20 34 3d 73 65 6c 65 63 74 69 6f 6e 20 | 4=selection | 000084e0 66 6f 72 65 67 72 6f 75 6e 64 20 35 3d 63 75 72 |foreground 5=cur| 000084f0 73 6f 72 20 62 61 63 6b 20 36 3d 63 75 72 73 6f |sor back 6=curso| 00008500 72 20 66 6f 72 0a 09 20 20 20 20 20 20 37 3d 6c |r for.. 7=l| 00008510 69 6e 65 20 6e 75 6d 62 65 72 73 20 38 3d 63 6f |ine numbers 8=co| 00008520 6e 74 72 6f 6c 20 63 68 61 72 73 0a 09 20 20 20 |ntrol chars.. | 00008530 20 20 20 39 2d 31 35 20 6d 6f 64 65 20 64 65 70 | 9-15 mode dep| 00008540 65 6e 64 65 6e 74 20 65 78 74 65 6e 73 69 6f 6e |endent extension| 00008550 20 63 6f 6c 6f 75 72 73 2e 0a 09 20 20 20 52 38 | colours... R8| 00008560 3d 57 69 6e 64 6f 77 20 62 6c 6f 63 6b 20 74 6f |=Window block to| 00008570 20 72 65 61 64 20 66 72 6f 6d 20 2f 20 30 20 66 | read from / 0 f| 00008580 6f 72 20 64 65 66 61 75 6c 74 20 28 21 43 6f 6e |or default (!Con| 00008590 66 69 67 29 20 73 65 74 74 69 6e 67 73 2e 0a 09 |fig) settings...| 000085a0 5c 58 20 52 30 3d 63 6f 6c 6f 75 72 20 76 61 6c |\X R0=colour val| 000085b0 75 65 20 72 65 61 64 20 2f 20 6f 6c 64 20 76 61 |ue read / old va| 000085c0 6c 75 65 20 69 66 20 77 72 69 74 69 6e 67 20 69 |lue if writing i| 000085d0 74 2e 0a 09 20 20 20 20 20 20 4e 42 20 54 68 69 |t... NB Thi| 000085e0 73 20 69 73 20 63 75 72 72 65 6e 74 6c 79 20 61 |s is currently a| 000085f0 20 77 69 6d 70 20 63 6f 6c 6f 75 72 20 28 30 2d | wimp colour (0-| 00008600 31 35 29 20 62 75 74 20 6d 61 79 20 72 65 74 75 |15) but may retu| 00008610 72 6e 0a 09 20 20 20 20 20 20 20 20 20 32 34 20 |rn.. 24 | 00008620 62 69 74 20 26 42 42 47 47 52 52 31 30 20 73 65 |bit &BBGGRR10 se| 00008630 74 74 69 6e 67 73 20 69 6e 20 66 75 74 75 72 65 |ttings in future| 00008640 20 76 65 72 73 69 6f 6e 73 2e 0a 0a 5a 61 70 5f | versions...Zap_| 00008650 46 69 6e 64 49 6e 70 75 74 0a 54 68 69 73 20 63 |FindInput.This c| 00008660 61 6c 6c 20 77 6f 72 6b 73 20 6f 75 74 20 74 68 |all works out th| 00008670 65 20 63 75 72 72 65 6e 74 20 70 6f 73 69 74 69 |e current positi| 00008680 6f 6e 20 6f 66 20 74 68 65 20 27 69 6e 70 75 74 |on of the 'input| 00008690 20 66 6f 63 75 73 27 20 69 6e 20 61 20 77 69 6e | focus' in a win| 000086a0 64 6f 77 2e 20 49 66 0a 74 68 65 20 69 6e 70 75 |dow. If.the inpu| 000086b0 74 20 63 61 72 65 74 20 69 73 20 69 6e 20 74 68 |t caret is in th| 000086c0 69 73 20 77 69 6e 64 6f 77 20 74 68 65 6e 20 69 |is window then i| 000086d0 74 20 72 65 74 75 72 6e 73 20 69 74 27 73 20 6f |t returns it's o| 000086e0 66 66 73 65 74 2e 20 4f 74 68 65 72 77 69 73 65 |ffset. Otherwise| 000086f0 20 69 74 0a 72 65 74 75 72 6e 73 20 74 68 65 20 | it.returns the | 00008700 27 70 6f 69 6e 74 27 20 70 6f 73 69 74 69 6f 6e |'point' position| 00008710 20 28 75 73 75 61 6c 6c 79 20 6d 61 72 6b 65 64 | (usually marked| 00008720 20 62 79 20 61 6e 20 65 6d 70 74 79 20 73 71 75 | by an empty squ| 00008730 61 72 65 29 2e 0a 09 5c 45 20 52 38 2f 52 39 0a |are)...\E R8/R9.| 00008740 09 5c 58 20 52 30 3d 6d 6f 73 74 20 73 75 69 74 |.\X R0=most suit| 00008750 61 62 6c 65 20 6f 66 66 73 65 74 20 74 6f 20 69 |able offset to i| 00008760 6e 73 65 72 74 20 64 61 74 61 2e 0a 0a 5a 61 70 |nsert data...Zap| 00008770 5f 43 6c 69 70 43 61 63 68 65 0a 54 68 69 73 20 |_ClipCache.This | 00008780 63 61 6c 6c 20 6d 6f 76 65 73 20 74 68 65 20 63 |call moves the c| 00008790 61 63 68 65 20 72 65 66 65 72 65 6e 63 65 20 70 |ache reference p| 000087a0 6f 69 6e 74 20 28 77 5f 63 6c 69 6e 65 2f 63 6f |oint (w_cline/co| 000087b0 66 66 2f 63 6c 6f 67 6c 20 65 74 63 29 20 74 6f |ff/clogl etc) to| 000087c0 20 61 20 67 69 76 65 6e 0a 70 6f 69 6e 74 20 28 | a given.point (| 000087d0 75 73 69 6e 67 20 65 5f 63 6c 6e 6f 66 66 29 2e |using e_clnoff).| 000087e0 0a 09 5c 45 20 52 30 3d 4f 66 66 73 65 74 20 69 |..\E R0=Offset i| 000087f0 6e 20 6c 69 6e 65 20 74 6f 20 6d 6f 76 65 20 74 |n line to move t| 00008800 68 65 20 63 61 63 68 65 20 72 65 66 65 72 65 6e |he cache referen| 00008810 63 65 20 70 6f 69 6e 74 20 74 6f 2e 20 52 38 2f |ce point to. R8/| 00008820 52 39 0a 0a 5a 61 70 5f 4d 6f 64 65 44 61 74 61 |R9..Zap_ModeData| 00008830 0a 54 68 69 73 20 63 61 6c 6c 20 72 65 61 64 73 |.This call reads| 00008840 20 6f 72 20 77 72 69 74 65 20 74 68 65 20 6d 6f | or write the mo| 00008850 64 65 20 64 65 70 65 6e 64 61 6e 74 20 6f 70 74 |de dependant opt| 00008860 69 6f 6e 73 20 74 68 61 74 20 5a 61 70 20 68 61 |ions that Zap ha| 00008870 6e 64 6c 65 73 0a 61 75 74 6f 6d 61 74 69 63 61 |ndles.automatica| 00008880 6c 6c 79 20 66 6f 72 20 79 6f 75 2e 20 53 65 65 |lly for you. See| 00008890 20 61 6c 73 6f 20 5a 61 70 5f 4d 6f 64 65 43 6f | also Zap_ModeCo| 000088a0 6c 6f 75 72 2e 20 43 75 72 72 65 6e 74 6c 79 20 |lour. Currently | 000088b0 74 68 65 72 65 20 69 73 20 6f 6e 6c 79 20 6f 6e |there is only on| 000088c0 65 0a 77 6f 72 64 20 70 65 72 20 6d 6f 64 65 20 |e.word per mode | 000088d0 73 74 6f 72 69 6e 67 20 74 68 65 20 77 69 64 74 |storing the widt| 000088e0 68 20 61 6e 64 20 74 68 69 6e 67 73 20 6c 69 6b |h and things lik| 000088f0 65 20 77 68 65 74 68 65 72 20 61 75 74 6f 2d 69 |e whether auto-i| 00008900 6e 64 65 6e 74 20 69 73 20 6f 6e 20 6f 72 0a 6e |ndent is on or.n| 00008910 6f 74 2e 20 59 6f 75 20 73 68 6f 75 6c 64 20 75 |ot. You should u| 00008920 73 65 20 74 68 69 73 20 63 61 6c 6c 20 77 69 74 |se this call wit| 00008930 68 20 52 38 3d 30 20 74 6f 20 77 72 69 74 65 20 |h R8=0 to write | 00008940 73 65 6e 73 69 62 6c 65 20 64 65 66 61 75 6c 74 |sensible default| 00008950 20 76 61 6c 75 65 73 20 69 66 0a 79 6f 75 72 20 | values if.your | 00008960 6d 6f 64 65 20 73 74 61 72 74 73 20 75 70 20 61 |mode starts up a| 00008970 6e 64 20 66 69 6e 64 73 20 69 74 73 20 6d 6f 64 |nd finds its mod| 00008980 65 20 77 6f 72 64 20 69 73 20 7a 65 72 6f 2e 20 |e word is zero. | 00008990 49 66 20 79 6f 75 20 64 6f 6e 27 74 20 74 68 65 |If you don't the| 000089a0 6e 20 74 68 65 0a 64 65 66 61 75 6c 74 20 54 65 |n the.default Te| 000089b0 78 74 20 6d 6f 64 65 20 76 61 6c 75 65 73 20 77 |xt mode values w| 000089c0 69 6c 6c 20 62 65 20 75 73 65 64 2e 0a 09 5c 45 |ill be used...\E| 000089d0 20 52 30 3d 76 61 6c 75 65 20 74 6f 20 77 72 69 | R0=value to wri| 000089e0 74 65 20 2f 20 2d 31 20 74 6f 20 72 65 61 64 0a |te / -1 to read.| 000089f0 09 20 20 20 52 31 3d 6d 6f 64 65 20 6e 75 6d 62 |. R1=mode numb| 00008a00 65 72 0a 09 20 20 20 52 32 3d 76 61 72 69 61 62 |er.. R2=variab| 00008a10 6c 65 20 6e 75 6d 62 65 72 20 74 6f 20 72 65 61 |le number to rea| 00008a20 64 20 77 72 69 74 65 0a 09 20 20 20 52 38 3d 77 |d write.. R8=w| 00008a30 69 6e 64 6f 77 20 63 6f 6e 63 65 72 6e 65 64 20 |indow concerned | 00008a40 2f 20 30 20 66 6f 72 20 74 68 65 20 64 65 66 61 |/ 0 for the defa| 00008a50 75 6c 74 20 28 21 43 6f 6e 66 69 67 29 20 73 65 |ult (!Config) se| 00008a60 74 74 69 6e 67 73 2e 0a 09 5c 58 20 52 30 3d 76 |ttings...\X R0=v| 00008a70 61 72 69 61 62 6c 65 20 76 61 6c 75 65 20 69 66 |ariable value if| 00008a80 20 72 65 61 64 20 2f 20 6f 6c 64 20 76 61 6c 75 | read / old valu| 00008a90 65 20 69 66 20 77 72 69 74 74 65 6e 0a 09 56 61 |e if written..Va| 00008aa0 72 69 61 62 6c 65 73 20 6e 75 6d 3a 09 30 20 09 |riables num:.0 .| 00008ab0 62 30 2d 62 31 35 20 20 73 74 6f 72 65 73 20 74 |b0-b15 stores t| 00008ac0 68 65 20 22 77 69 64 74 68 22 20 66 6f 72 20 74 |he "width" for t| 00008ad0 68 69 73 20 6d 6f 64 65 0a 09 09 09 09 62 31 36 |his mode.....b16| 00008ae0 09 61 75 74 6f 20 69 6e 64 65 6e 74 20 62 69 74 |.auto indent bit| 00008af0 20 28 62 31 36 20 6f 66 20 77 5f 66 6f 72 6d 61 | (b16 of w_forma| 00008b00 74 29 0a 09 09 09 09 62 31 37 2d 62 32 31 20 61 |t).....b17-b21 a| 00008b10 72 65 20 72 65 73 65 72 76 65 64 0a 09 09 09 09 |re reserved.....| 00008b20 62 32 32 09 68 65 78 20 65 6e 74 72 79 20 6d 6f |b22.hex entry mo| 00008b30 64 65 20 62 69 74 20 28 62 35 20 6f 66 20 77 5f |de bit (b5 of w_| 00008b40 66 6c 61 67 73 29 0a 09 09 09 09 62 32 33 09 6f |flags).....b23.o| 00008b50 76 65 72 77 72 69 74 65 20 62 69 74 20 28 62 31 |verwrite bit (b1| 00008b60 20 6f 66 20 77 5f 66 6c 61 67 73 29 0a 09 09 09 | of w_flags)....| 00008b70 09 62 32 34 2d 62 33 31 09 64 69 73 70 6c 61 79 |.b24-b31.display| 00008b80 20 62 69 74 73 20 28 62 38 2d 62 31 35 20 6f 66 | bits (b8-b15 of| 00008b90 20 77 5f 66 6f 72 6d 61 74 29 0a 09 09 09 31 2b | w_format)....1+| 00008ba0 09 72 65 73 65 72 76 65 64 2e 0a 0a 5a 61 70 5f |.reserved...Zap_| 00008bb0 57 68 69 63 68 4d 6f 64 65 0a 54 68 69 73 20 63 |WhichMode.This c| 00008bc0 61 6c 6c 20 64 65 63 69 64 65 73 20 77 68 69 63 |all decides whic| 00008bd0 68 20 6d 6f 64 65 20 61 20 67 69 76 65 6e 20 66 |h mode a given f| 00008be0 69 6c 65 20 73 68 6f 75 6c 64 20 62 65 20 64 69 |ile should be di| 00008bf0 73 70 6c 61 79 65 64 20 69 6e 2e 0a 09 5c 45 20 |splayed in...\E | 00008c00 52 30 3d 6c 6f 61 64 20 61 64 64 72 65 73 73 20 |R0=load address | 00008c10 6f 66 20 66 69 6c 65 20 28 63 6f 6e 74 61 69 6e |of file (contain| 00008c20 69 6e 67 20 74 68 65 20 66 69 6c 65 74 79 70 65 |ing the filetype| 00008c30 29 0a 09 20 20 20 52 31 3d 66 69 6c 65 6e 61 6d |).. R1=filenam| 00008c40 65 20 70 6f 69 6e 74 65 72 20 2f 20 30 20 69 66 |e pointer / 0 if| 00008c50 20 6e 6f 74 20 6b 6e 6f 77 6e 0a 09 5c 58 20 52 | not known..\X R| 00008c60 30 3d 66 6c 61 67 73 09 62 30 20 3d 3e 20 41 75 |0=flags.b0 => Au| 00008c70 74 6f 20 6c 6f 61 64 20 66 6c 61 67 20 69 73 20 |to load flag is | 00008c80 73 65 74 2c 20 6e 6f 20 73 68 69 66 74 20 74 65 |set, no shift te| 00008c90 73 74 2e 0a 09 20 20 20 52 31 30 3d 6d 6f 64 65 |st... R10=mode| 00008ca0 20 66 69 6c 65 20 73 68 6f 75 6c 64 20 62 65 20 | file should be | 00008cb0 6c 6f 61 64 65 64 20 69 6e 74 6f 2e 0a 0a 5a 61 |loaded into...Za| 00008cc0 70 5f 4d 6f 64 65 4e 75 6d 62 65 72 0a 54 68 69 |p_ModeNumber.Thi| 00008cd0 73 20 63 61 6c 6c 73 20 74 75 72 6e 73 20 61 20 |s calls turns a | 00008ce0 6d 6f 64 65 20 6e 61 6d 65 20 28 67 69 76 65 6e |mode name (given| 00008cf0 20 62 79 20 61 20 73 74 72 69 6e 67 29 20 69 6e | by a string) in| 00008d00 74 6f 20 61 20 6d 6f 64 65 20 6e 75 6d 62 65 72 |to a mode number| 00008d10 2e 0a 09 5c 45 20 52 30 3d 6d 6f 64 65 20 6e 61 |...\E R0=mode na| 00008d20 6d 65 20 73 74 72 69 6e 67 20 74 65 72 6d 69 6e |me string termin| 00008d30 61 74 65 64 20 62 79 20 3c 3d 20 73 70 61 63 65 |ated by <= space| 00008d40 20 28 26 32 30 29 0a 09 5c 58 20 52 30 3d 6d 6f | (&20)..\X R0=mo| 00008d50 64 65 20 6e 75 6d 62 65 72 20 6f 72 20 2d 31 20 |de number or -1 | 00008d60 69 66 20 6e 6f 74 20 66 6f 75 6e 64 2e 0a 0a 5a |if not found...Z| 00008d70 61 70 5f 53 65 6e 64 44 61 74 61 53 61 76 65 0a |ap_SendDataSave.| 00008d80 54 68 69 73 20 63 61 6c 6c 20 69 6e 69 74 69 61 |This call initia| 00008d90 74 65 73 20 74 68 65 20 73 61 76 65 20 70 72 6f |tes the save pro| 00008da0 74 6f 63 6f 6c 2c 20 73 61 76 69 6e 67 20 64 61 |tocol, saving da| 00008db0 74 61 20 74 6f 20 61 6e 6f 74 68 65 72 20 77 69 |ta to another wi| 00008dc0 6e 64 6f 77 20 6f 72 0a 61 70 70 6c 69 63 61 74 |ndow or.applicat| 00008dd0 69 6f 6e 20 76 69 61 20 52 41 4d 20 74 72 61 6e |ion via RAM tran| 00008de0 73 66 65 72 20 6f 72 20 57 69 6d 70 53 63 72 61 |sfer or WimpScra| 00008df0 70 2e 20 49 74 20 73 65 6e 64 73 20 74 68 65 20 |p. It sends the | 00008e00 64 61 74 61 5f 73 61 76 65 20 6d 65 73 73 61 67 |data_save messag| 00008e10 65 20 61 6e 64 0a 61 6c 6c 20 72 65 70 6c 69 65 |e and.all replie| 00008e20 73 20 61 72 65 20 68 61 6e 64 6c 65 64 20 61 75 |s are handled au| 00008e30 74 6f 6d 61 74 69 63 61 6c 6c 79 2e 0a 09 5c 45 |tomatically...\E| 00008e40 20 52 32 3d 70 61 74 68 20 6e 61 6d 65 20 74 6f | R2=path name to| 00008e50 20 75 73 65 20 66 6f 72 20 74 68 65 20 64 61 74 | use for the dat| 00008e60 61 20 2f 20 30 20 74 6f 20 75 73 65 20 74 68 65 |a / 0 to use the| 00008e70 20 66 69 6c 65 73 0a 09 20 20 20 52 33 3d 64 65 | files.. R3=de| 00008e80 73 74 69 6e 61 74 69 6f 6e 20 77 69 6e 64 6f 77 |stination window| 00008e90 20 68 61 6e 64 6c 65 20 28 6f 72 20 74 61 73 6b | handle (or task| 00008ea0 20 68 61 6e 64 6c 65 29 0a 09 20 20 20 52 34 3d | handle).. R4=| 00008eb0 64 65 73 74 69 6e 61 74 69 6f 6e 20 69 63 6f 6e |destination icon| 00008ec0 20 68 61 6e 64 6c 65 0a 09 20 20 20 52 35 2f 52 | handle.. R5/R| 00008ed0 36 3d 64 65 73 74 69 6e 61 74 69 6f 6e 20 6d 6f |6=destination mo| 00008ee0 75 73 65 20 63 6f 6f 72 64 73 20 28 69 66 20 61 |use coords (if a| 00008ef0 70 70 6c 69 63 61 62 6c 65 29 0a 09 20 20 20 52 |pplicable).. R| 00008f00 37 3d 30 20 28 6e 6f 6e 20 7a 65 72 6f 20 76 61 |7=0 (non zero va| 00008f10 6c 75 65 73 20 75 73 65 64 20 69 6e 74 65 72 6e |lues used intern| 00008f20 61 6c 6c 79 29 0a 09 20 20 20 52 38 2f 52 39 3d |ally).. R8/R9=| 00008f30 77 69 6e 64 6f 77 20 74 6f 20 73 61 76 65 20 6f |window to save o| 00008f40 72 20 52 38 3d 30 20 74 6f 20 73 61 76 65 20 74 |r R8=0 to save t| 00008f50 68 65 20 63 75 72 72 65 6e 74 6c 79 20 73 65 6c |he currently sel| 00008f60 65 63 74 65 64 20 61 72 65 61 0a 09 20 20 20 52 |ected area.. R| 00008f70 31 30 3d 66 6c 61 67 73 20 62 30 20 3d 3e 20 45 |10=flags b0 => E| 00008f80 78 74 65 72 6e 61 6c 20 65 64 69 74 20 66 6c 61 |xternal edit fla| 00008f90 67 20 28 64 6f 20 6e 6f 74 20 75 73 65 29 0a 0a |g (do not use)..| 00008fa0 5a 61 70 5f 57 61 72 6e 69 6e 67 0a 57 61 72 6e |Zap_Warning.Warn| 00008fb0 73 20 74 68 65 20 75 73 65 72 20 77 69 74 68 6f |s the user witho| 00008fc0 75 74 20 67 65 6e 65 72 61 74 69 6e 67 20 61 6e |ut generating an| 00008fd0 20 65 72 72 6f 72 2e 20 54 68 69 73 20 6f 70 65 | error. This ope| 00008fe0 6e 73 20 61 20 77 69 6e 64 6f 77 20 77 69 74 68 |ns a window with| 00008ff0 20 74 68 65 0a 67 69 76 65 6e 20 6d 65 73 73 61 | the.given messa| 00009000 67 65 20 61 6e 64 20 70 61 75 73 65 73 20 66 6f |ge and pauses fo| 00009010 72 20 74 68 65 20 6d 65 73 73 61 67 65 20 74 6f |r the message to| 00009020 20 62 65 20 73 65 65 6e 20 62 65 66 6f 72 65 20 | be seen before | 00009030 72 65 74 75 72 6e 69 6e 67 2e 20 57 69 6d 70 0a |returning. Wimp.| 00009040 50 6f 6c 6c 20 69 73 20 6e 6f 74 20 63 61 6c 6c |Poll is not call| 00009050 65 64 2e 0a 09 5c 45 20 52 30 3d 77 61 72 6e 69 |ed...\E R0=warni| 00009060 6e 67 20 6d 65 73 73 61 67 65 0a 09 20 20 20 52 |ng message.. R| 00009070 31 3d 74 69 6d 65 20 74 6f 20 6c 65 61 76 65 20 |1=time to leave | 00009080 6d 65 73 73 61 67 65 20 6f 70 65 6e 20 69 6e 20 |message open in | 00009090 63 73 20 28 30 20 66 6f 72 20 64 65 66 61 75 6c |cs (0 for defaul| 000090a0 74 20 64 65 6c 61 79 29 0a 09 20 20 20 20 20 20 |t delay).. | 000090b0 2b 20 66 6c 61 67 73 3a 0a 09 20 20 20 09 62 33 |+ flags:.. .b3| 000090c0 31 20 3d 3e 20 44 6f 6e 27 74 20 62 65 65 70 20 |1 => Don't beep | 000090d0 77 68 65 6e 20 6f 70 65 6e 69 6e 67 20 74 68 65 |when opening the| 000090e0 20 77 69 6e 64 6f 77 0a 0a 5a 61 70 5f 41 6c 6c | window..Zap_All| 000090f0 57 69 6e 64 6f 77 0a 43 61 6c 6c 73 20 61 20 67 |Window.Calls a g| 00009100 69 76 65 6e 20 73 75 62 72 6f 75 74 69 6e 65 20 |iven subroutine | 00009110 6f 6e 63 65 20 66 6f 72 20 65 61 63 68 20 76 61 |once for each va| 00009120 6c 69 64 20 5a 61 70 20 77 69 6e 64 6f 77 2e 20 |lid Zap window. | 00009130 53 65 65 20 61 6c 73 6f 0a 5a 61 70 5f 45 61 63 |See also.Zap_Eac| 00009140 68 57 69 6e 64 6f 77 2e 0a 09 5c 45 20 52 30 2d |hWindow...\E R0-| 00009150 52 37 3d 61 72 67 75 6d 65 6e 74 73 20 74 6f 20 |R7=arguments to | 00009160 70 61 73 73 20 74 6f 20 74 68 65 20 73 75 62 0a |pass to the sub.| 00009170 09 20 20 20 52 31 30 3d 61 64 64 72 65 73 73 20 |. R10=address | 00009180 6f 66 20 74 68 65 20 73 75 62 20 74 6f 20 63 61 |of the sub to ca| 00009190 6c 6c 20 28 77 68 69 63 68 20 6d 75 73 74 20 70 |ll (which must p| 000091a0 72 65 73 65 72 76 65 20 61 6c 6c 20 72 65 67 69 |reserve all regi| 000091b0 73 74 65 72 73 0a 09 20 20 20 20 20 20 20 65 78 |sters.. ex| 000091c0 63 65 70 74 20 52 30 2c 20 61 6e 64 20 69 73 20 |cept R0, and is | 000091d0 63 61 6c 6c 65 64 20 6f 6e 63 65 20 66 6f 72 20 |called once for | 000091e0 65 61 63 68 20 77 69 6e 64 6f 77 20 77 69 74 68 |each window with| 000091f0 20 52 38 2f 52 39 0a 09 20 20 20 20 20 20 20 73 | R8/R9.. s| 00009200 65 74 20 75 70 20 74 6f 20 62 65 20 74 68 61 74 |et up to be that| 00009210 20 77 69 6e 64 6f 77 29 2e 0a | window)..| 0000921a