9/27/2000 Relocated SmartCat Routine By Michael Spangler The Beagle Bros. Disk BIG U has a variety of routines for improving ProDOS. One of my favorites is a routine called SmartCat. This changes the way the ProDOS CAT and CATALOG commands work. Specifically, it results in four possible results. CAT in 40 column mode gives the usual result, the shorter 40 column display. CATALOG in 40 column mode switches the display to 80 columns, and displays the 80 column type catalog. CAT in 80 column mode gives the regular 80 column display. CATALOG in 80 column mode also gives the usual 80 column display. These changes are implemented by patching Basic.System. Unfortunately, this patch only works with Basic.System 1.1. I wanted to use Basic.System 1.5, which goes with ProDOS 2.0.3. So I had to hunt down the changes, and see if it could be made to work. Fortunately, the patching program on the BIG U disk is in Applesoft, so it is possible to figure it out. The original patch was installed at addresses 45110 to 45116. Also, modifications were made to addresses 47343 and 47395. After writing a short Applesoft routine to check Basic.System 1.5 for the same byte sequence that was found in 1.1 at 45110, I found it unchanged at address 45222. Replacing the original pattern of 169,39,208,2,169,79,141 with the new pattern of 32,0,195,166,33,202,142 was easy enough. I decided to patch it in my Startup program rather than permanently patching Basic.System. I might do that later. The hard part was the other two bytes. Hunting for two individual bytes wasn't going to help too much. So I had to find the context they occurred in. Now, as it happens, in Basic.System 1.1, 47343 is 7 bytes past the end of the Append command in the command table. (Use a byte editor, like Memzap to look at the code from B800 on.) The original value is 54. 59 bytes after append, at 47395, we have a 58. However, in Basic.System 1.5, the equivalent positions (47449 and 47501) have a 166 and a 170 respectively. This had me stumped, until the thought occurred that they might be offsets in a jump table. The difference between both sets of numbers was 4. So maybe I really was in the right place. Now, in Basic.System 1.1, the value at 47343 was changed from 54 to 57, an increase of 3. The value at 47395 goes from 58 to 54, a decrease of 4. So assuming the same changes applied, I changed 47449 to 169 (up by 3) and 47501 to 166 (down by 4). This worked! I have been using the patch for some time with no ill effects noted. However, my machines are an enhanced IIe, and a GS booted directly into ProDOS. It is not inclusive by any means, so your mileage may vary. The Applesoft program to handle this looks like this: 10 IF PEEK(45222)<>169 THEN PRINT "ERROR, WRONG VERSION OF BASIC.SYSTEM": END 20 FOR I=45222 TO 45228 30 READ J: POKE I,J 40 NEXT 50 POKE 47449,169: POKE 47501,166 60 DATA 32,0,195,166,33,202,142 70 END A similar patch could be made in other versions of Basic.System, particularly 1.4.1, which shipped with ProDOS 1.9. The main patch location is 45178, but I have not sorted out the other two bytes. However, if you can find the Append command, then count up from there appropriately, the other two bytes should be findable. I hope you enjoy SmartCat, another great Beagle routine. Michael Spangler spangler@gorge.net