Authors
Publication
Pub Details
Date
Pages
BASIC Terms
Fourth installment in Lloyd Dreger’s Z80 machine language series for the Timex/Sinclair 2068, presenting the general menu system used in his CONQUEST wargame. Covers the SetTV and GetTV screen-switching routines, PrintMENU for rendering menu text to screen, MoveCURsor for arrow-key cursor movement, and GETINPut for accepting both keyboard and joystick input. Full assembly listings with addresses and mnemonics are provided throughout.
Although this routine is used in a game it can be used anywhere a menu is desired. Like the previous routines in this set, much use is made of the Basic routines already in ROM–if we have to waste 16k of memory we might as well take advantage of it.
This is a general menu routine that is called with the following registers set:
- B=# of items in menu
- C=What column to run the cursor from. The printing will start one column beyond that. Sorry but each menu starts at the top of the screen at line 0. At least you can have left, middle and right menus if you need submenus:
- DE= address of menu names -1. (What each line will say.) Menu items must be consecutive in this list and must not be so long as run onto a 2nd line of screen. The last letter of each line must have bit 7 set as a flag to indicate the end–see how this is used in PX. FN and PM also use PX but are not used to print the menu.
PrintMENU prints the menu and calls MoveCURsor which runs the ment by moving the cursor up and down and automatically recycling when at the top or bottom.
SetTV sets the screen to top. screen while GetTV returns the screen to the previous setting.
GETINPut is a general input routine that works for both keyboard and joystick.
The routines can be located anywhere. In CONQUEST its located at 60148 and that address is used for the present code:
Products
Media
Image Gallery
Source Code
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.