(This is the "Dungeon Designs" column from the December 1991 issue of the Eamon Adventurer's Guild newsletter. Copyright 1991 Eamon Adventurer's Guild, 7625 Hawkhaven Dr., Clemmons, NC 27012-9408. You may reproduce this freely as long as this credit remains attached to the article.) We're running something a bit different this time; the code for the new UNIVERSAL CHECK FILES program from the EAG Utilities disk. This new program can verify the data files of every known Eamon program (except #204) and new non-standard data can be easily added. The ProDOS version varies only slightly, though the non-standard list is a little different. _____________________________________________________ _____________________________________________________ Product Review _____________________________________________________ MicroDot - an alternative to BASIC.SYSTEM Those of you who have done much programming in Apple- soft under ProDOS know that the one big bottleneck is memory space! An Eamon adventure running under ProDOS has easily 3K less free memory than the same program has under DOS 3.3. While ProDOS itself resides in the upper 16K of memory and well out of the way, the Applesoft-to-ProDOS interface (BASIC.SYSTEM) resides where DOS 3.3 does at the top of normal memory. BASIC.SYSTEM occupies 10.6K of upper memory, approximately the same size as DOS 3.3, but this does not include any disk buffers. ProDOS buffers are each 1K in size; with the 3 buffers open that Eamon normally uses, we wind up with a net loss of 10% of available free memory space. There is an alternative. MicroDot is a very workable alternative to BASIC.SYSTEM, and it occupies only 4K of memory in its basic configuration. It offers several very nice enhancements as well: Program Overlays Access File Auxtype Read disk catalog directly into program Fast disk formatter utility Pack/unpack Hi-res files directly to/from disk Line Editor Patch to work with Program Writer MicroDot is modular. The basic system can't do catalogs, pack hi-res pictures, use random-access files, have more than one file open at a time, or do MLI calls. If you need any of these functions, you have to load the appropriate modules. For an Eamon adventure, we don't need any of the above but the Random module. When working in immediate mode (such as when writing/debugging an Eamon), you would also want to have the Catalog module and (if you have a clock) a Clock module that fixes a problem with bogus Syntax Errors. Since the normal Eamon system has 3 files open at once, you might think that we also need the Multi module so that we can have more than one file open. But MicroDot automatically closes the open file whenever you open another file, making this largely unnecessary. Let's take a look at some sample code for a comparison: BASIC.SYSTEM: 120 PRINT DK$"READ EAMON.DESC,R"RO: INPUT A$: PRINT A$ MicroDot: 120 & .O,"EAMON.DESC": & .JP,RO * 256: & .R: INPUT A$: & .Z: PRINT A$ While it appears that the MicroDot line is longer, it actually requires fewer bytes than the BASIC.SYSTEM line does. Don't let all those spaces fool you. And the line wouldn't be even that long, except that I had to open the file with the first command. If I had known that the file was already open, I could have deleted the first statement altogether. The second command takes care of one of MicroDot's less user friendly features: you have to manually compute the offset in the file in bytes. MicroDot doesn't know or care about disk file records; it's up to the programmer to figure out the exact byte where the record starts. This isn't hard, but it's a bit of a pain when you're used to having that done for you. MicroDot overlays are not the same thing as BASIC.SYSTEM's CHAIN command. With CHAIN, you change out the entire program while retaining the variables. The Overlay module permits you to add individual subroutines to a running program. Overlays load very quickly, giving this method a lot of potential for storing the code for seldom-used Eamon commands on the disk, freeing up the memory they would otherwise take up. With this module, you could write enormous Eamon programs that have hundreds of different commands. MicroDot's one serious drawback from my viewpoint is that it doesn't support the STORE and RESTORE commands that enable you to load and save variables from the disk. You would have to use the BSAVE/BLOAD method that we know so well from DOS 3.3. Another lesser drawback is that it handles Ampersand commands somewhat differently from BASIC.SYSTEM. I couldn't get the 7.0 Demo adventure running under MicroDot because of its ampersand search routine. In fairness, I didn't spend very long on it. I have no doubt that it can be run if the hooks are redone correctly. The Applesoft editor that is included is pretty simple and fits in the page 3 memory space. It was written by Jerry Kindall, the author of MicroDot. (Jerry is rather famous for being able to do amazing things in impossibly small memory spaces.) But if you want a full-featured global editor, a patch program is included that will modify a copy of Program Writer to work with MicroDot. This patch program is written to be able to modify any version of Program Writer, even versions that don't yet exist. Enough talk. Is it worthwhile to use MicroDot in Eamon? Let's look at a few numbers: Free Memory Savings BASIC.SYSTEM: 36348 - MicroDot: 43773 7425 Random : 40847 4499 Catalog & clock fix: 39845 3497 Multi option: 40591 4243 Cat/clk/Multi/Random: 39567 3219 All modules: 38294 1946 As you can see, the savings will run from about 2K to more than 7K, depending on what optional modules you have installed. Eamon would use the Random module for a savings of 4.5K. Not bad!. But wait, there's more! MicroDot commands use less space than the equivalent ProDOS commands do. After I had modified the MAIN.PGM from the 'Beginners Cave' to work with MicroDot, I had saved another 667 bytes. And let's look at a few more free space measurements, using the 'Beginners Cave' as the test program: Free Space after loading the MAIN.PGM into memory: BASIC.SYSTEM: 20501 MicroDot (with Random): 28336 Savings: 7835 Free space at YOUR COMMAND prompt: BASIC.SYSTEM: 15391 MicroDot (with Random): 26376 Savings: 10985 I'm not real clear on where all of these extra savings came from. The big jump to 11K comes mostly from the three buffers that ProDOS has open at this time. I purposely went for max free memory with MicroDot, choosing commands and options so that no more than one MicroDot disk buffer will be open at a time. At this point there may not have been any buffers open under MicroDot so that the true savings would actually be 9985 bytes. Still almost 10K! There is a licensing issue, too. If you want to sell or give away copies of your MicroDot-using software, you have to obtain a license. The license is supposed to be very reasonably priced. For Eamon, we have been granted permission to use MicroDot without having to buy a license, as long as it gets a really nice advertisement at the startup of the adventure. So the bottom line is here. On the plus side, MicroDot offers some powerful additions and saves an incredible amount of memory. On the minus side, it doesn't have STORE/RESTORE and requires you to learn a different command structure. The upshot is this: if you need more memory for your Eamon, MicroDot will give you another 10K to play with. There probably isn't anyone in the Eamon world except Sam Ruby who actually needs it, but there's no question that it gets the job done. The people at Kitchen Sink are 8-bit Apple enthusiasts and I have found them to be extremely available and helpful on GEnie. I met them at KansasFest and I was impressed with them. I think that you can count on them to support their products. MicroDot requires 64K and works in all Apple II's. MicroDot is $29.95 from Kitchen Sink Software 903 Knebworth Ct. (Free Catalog) Westerville, OH 43081 (614)891-2111