★ APPLICATIONS ★ DISQUE ★ Disc Menu ★ |
Disc Menu (Computing With the Amstrad) | Applications Disque |
ONE of the major differences between a tape and a disc system is the amazing speed at which programs load and save. What took minutes before now takes seconds. Not only does this great speed advantage enable you to use your time more efficiently, and generally make programming more bearable, but it allows programs to be written which were impractical before. The long wait for programs or data to load has been banished. A menu program to display the contents of a disc and allow the easy selection of programs demonstrates the advantages of the system admirably. Most disc menu programs have the names of all the files stored in data statements. They then read the names, print a list and allow you to select a program. This is fine if you don't intend to change the contents of the disc very otten, but a pain in the neck if you do, and all the data statements have to be changed when it is used with another disc. What is needed is an intelligent menu - one which looks at the disc to see what is on it rather than fixed data statements. Disc Menu - I know it's not an original title, but it is descriptive - is such a program. It does not rely on data and it does not matter what is on the disc, or whether it has been changed in any way by adding, deleting or renaming files since the menu was added. In fact you could load Disc Menu off one disc, insert another with a completely different set of files and run it with this. Simply: RUN or CHAIN"Menu" (after typing it in and saving it first of course), and a menu of all the files will be displayed with a pointer next to the first. The pointer, indicating the current selection, can be moved up and down the list using the cursor keys and a file loaded and run by pressing Enter. It couldn't be easier to use, and it makes the whole system so much friendlier. There is also an option to selectively list a particular type of file, such as all the Basic programs or all the binary files, and you could extend the list to include other types if desired. Binary files present a few problems -you can't load them below HIMEM, and are they machine code programs or data such as a screen dump? So if the current selection is a binary file, detected by looking for .BIN in the name, then you are requested to input a new value for HIMEM (just press Enter if you don't want to change it). Then you must say whether it is to be loaded or run. How does Disc Menu work? At first I thought it would be impossible given the scant information in the manual supplied with the disc drive. It is in fact very simple. If you wanted to find out what is on a disc what would you do? Type CAT and read the names printed on the screen. This is exactly what the program does. Although there isn't a Basic command to read the screen, the operating system is capable of it. To use the routine CALL &BB60, the code for the character at the text cursor position is in the A register on return. A very short (20 byte) machine code routine was written to read the character at any position and place the code in a variable. The disc is catalogued and the names read into an array, provided they are of the right type, by scanning the screen using the readchar machine code routine. You will not see this happening as the current pen ink is set to black, the same as the background. It doesn't fool the readchar routine though. What you will notice is a slight delay while it carries this out. It is then a relatively simple matter to list the names and print the pointer. So it does not matter what is on the disc, it is simply catalogued and the information read off the screen. A menu is prepared from this. Please note that there is only room for about 40 file names on the screen. If you have more than this on the disc then choose any option other than 1, which prints all the files.
|