%OP%BON %OP%WRY %OP%AMM %OP%BM2 %OP%LM4 %OP%FO/UDC Editor//page @P@/ %CO:A,12,73%%H2%%H1%Z88 User Defined Character Editor Software & documentation (c) 1989 Simon Phipps, 0221 This software & documentation remains the property of Simon Phipps but may be freely used by Z88 Users' Club members provided: a) The software is not passed to any other person or body except under these conditions and accompanied by this document unaltered. b) No financial or material gain may be made from this software or documentation without permission from the owner. Simon Phipps, (0703) 550037 or Gold 83:NTG339 %H4%Correct relating to version 1.1 as of 20th March 1989 %P0% 1 - %H1%Capabilities This is a fairly simple BBC Basic program which allows any user to design "User Defined Characters" for the Z88 and generate BBC Basic "VDU" commands or zBase procedures to define them. The program allows character sets to be saved to RAM and subsequently reloaded. The program does not require Richard Russell's graphics patch. An example is provided in the form of a defined set of characters and a modified Micro User game which uses them. %P0% 2 - %H1%User Defined Characters User Defined Characters (UDCs) are special characters supported by the display driver on the Z88. They are defined using long but simple escape sequences. In a machine with less than 128k of memory in slot 1, only 16 may be defined unless the map display is restricted to less than 64 bits or is switched off; otherwise, up to 64 may be defined using character codes 64 to 127 for identification. The defined characters do not replace the standard character set. UDCs are displayed with the sequence VDU 1,&32,ASC"?",n where n is the code used to 'tag' the UDC required. This code sequence may also be sent from zBase, in the form: ? chr(1)+chr(50)+"? " where the trailing space is filled with the appropriate 'tag' character. UDCs are used commonly in games and in applications requiring 'icons' to represent entities. They cannot be displayed in PipeDream. %P0% 3 - %H1%Program Operation To start up, simply RUN or CHAIN the program. The screen display is divided into five areas: | Menu area | Editing area | Test area | Selection area | Input | |-----------|-----------------|-----------|--------------------|--------| | Currently | Character last | Text may | Current values of | For | | available | edited or being | be placed | all UDCs (note: | input | | commands | edited with UDC | here to | only those shown | and | | | display | test UDCs | dark are editable) | reply | %H1%| | | | | | Program operation is very simple; merely press the letter shown in the menu box for the action you require. At the end of this document is a chart showing which commands are available and how they are accessed. Normally on starting up you will wish to load a previously defined set of characters; to do this, press 'F' to select the File menu, then select 'L' (load). You will be prompted for a file name on the far right of the screen. As the file loads, the cursor will move across the display showing each character in turn; all existing definitions will be lost. Alternatively, the 'M' (merge) option loads a previously saved UDC set without erasing existing definitions (unless they are already defined in the set being loaded). The current set of defined characters may be saved in a similar way. Note that characters you have not defined within the program will not be saved as the program will have no knowledge of their definition - these characters are shown in grey on the selection grid. If you quit the program and have made any changes to any UDCs but have not saved your work, you will be asked for a file name to save the definitions. Use :NUL if you do not wish to save your work. Note that a suffix of ".UDC" is added to file-names if you do not specify a suffix. To edit a character, return to the main menu with 'R' and select 'E'. You will now be able to move the cursor over the character grid using the cursor control keys to select a character for editing. Press the space bar to select your chosen character, which will then be displayed large scale in the editing area. You will now be able to move the cursor around the editing area with the cursor keys. You can set or reset bits of the UDC with the space bar; reset all bits with 'R'; set all all bits with 'S'; invert all bits with 'I'. All changes are shown 'live' both on the character array and on a single copy of the UDC beside the editing area. When the character is satisfactory, press 'C'. If you press 'O', the 'Other Options' menu is displayed. On this menu are aptions to allow you to move characters around and copy definitions. When you select any of these options, you will be given the chance to decide which other character you wish to duplicate into/move into/swap with the character previously selected. During this selection option, you may abort by pressing the %H4%SHIFT%H4% and %H4%MENU%H4% keys together. %P0% 4 - %H1%Program Generation The program is capable of creating zBase routines and BASIC program lines in the form of CLI files for defining UDCs. Both options are accessed from the 'P' (Program Generate) option on the main menu (as is the option to display the program version number and date). a - %H2%BBC BASIC When you press 'B' to select this option, you will be prompted for the name of a file to be created. If you do not include a suffix, ".cli" will be used. Into this file will be written program lines in plain text form preceded by the CLI command '.J' so that the lines will be correctly interpreted on loading. A typical file would look like this: .J 9000 VDU1,&8A,&3D,64,192,196,206,223,206,196,192,248 9001 VDU1,&8A,&3D,65,192,219,223,223,206,196,192,248 9003 VDU1,&8A,&3D,67,192,196,206,223,223,213,196,248 9033 VDU1,&8A,&3D,97,192,196,204,196,196,196,192,199 Note that there are gaps in the sequence as only the characters you have edited are defined. The value in the third column (after &8A,&3D,) is the tag value for the UDC and corresponds to the character shown in grey under the UDC on the UDC Editor display. To add these lines to your existing BASIC program, first ensure the line numbers are not going to clash with anything else. Then type the following command after the '>' prompt: *CLI .