Notes for programs by John Maclean December 1988. General Notes: - John MacLean is the author of THE GRAPHICS EXCHANGE / GRAPHIC TOURER, which is available through computer stores for the Apple IIGS, and is currently developing a PROLOG system for the e/c/GS. - This collection of programs, represent programs written by John MacLean during the period of June 1988 to November 1988, that he feels may be of some interest to other Apple // users and/or programers. Some of them require a IIGS, while others require only an enhanced //e or //c. - These programs are provided as public domain (all commercial rights are reserved) and may be not be sold for more than the price of a disk to the general public (This means that user groups/clubs can cover handling costs by taking advantage of bulk purchases of blank disks). - The source code may be freely used in your programs provided they are not sold, or used in any way to make profit. - Many of these programs involve complex and technical systems programming techniques and thus can be dangerous. Please read the notes, and if you don't understand what a program is doing then don't use it (or get someone to show you). Neither John Maclean, nor any computer user group/club involved in distribution of this software, take any responsibility for damages caused by use or misuse of this software. - John MacLean regularly attends meetings of the Sydney Apple Users Group and may be contacted through the group for any comments/suggestions/questions about these programs. Notes for: LAUNCHER.SYSTEM - This is a ProDOS 8 program launcher for the Apple // series - it will not launch P16 programs. - It requires an enhanced //e, a //c or a IIGS. - The on-screen instructions are fairly simple so I will not explain them here. - It relocates itself into the second bank on the language card ($D100-$D7FF), replacing the quit code and some reserved memory. The advantage of using this reserved memory is that the launcher is completely memory resident, unlike some launchers such as ProSEL. This is rather nice if you do not have a hard disk, as it avoids disk swaps. However, there are a couple of disadvantages. Firstly, it will not run correctly under P16 (because it uses the reserved memory, as it has every right to do, since it is Apple software). Secondly, applications may use this reserved memory illegally, and thus not quit back to the launcher correctly (The only program I have found that does this is AppleWorks! - so if you launch AppleWorks from this launcher you will need to re-boot rather than quitting). - I find this program extremely fast and have it as the first ".SYSTEM" file on my hard disk. - I have renamed the "PRODOS" file on the GS/OS master disk to "PRODOS16", copied it to my hard disk, and simply select it on the rare occasions that I wish to run anything under this operating system. - Any suggested improvements will be looked into so feel free to comment, and I hope you find it useful. Notes for: CLONE.SYSTEM - This is a program that I was playing around with back in early 87 when I first got my GS; however, I never got 'round to polishing it up until NOV 88! - It is a ProDOS 8 switcher that allows up to four 128K sessions to be operational at any one time, and requires a IIGS. It will work with other P8 programs that utilise GS memory (such as THE GRAPHIC EXCHANGE and AppleWorks) provided that you have enough memory. - When it is first launched, it initialises 4 CDAs called Apple 0, Apple 1, Apple 2, and Apple 3; each representing a 128K session. - The CDA corresponding to the current session is displayed in upper case. - Selecting a CDA that has not been selected before will "clone" the current session creating 2 identical copies. This is most useful when a program selector, such as "LAUNCHER.SYSTEM" is running. - Selecting a session that has been previously selected will simply return the session to the point where it was last used. - NB: Pressing Apple-control-reset will remove the CDAs and thus sessions will be lost. If a session crashes it is still likely that the others are OK, so try selecting them from the control panel and saving any work. - Non-ProDOS programs can be run as a session by launching "BASIC.SYSTEM" and then typing "PR#6", "PR#5" etc. - Any suggested improvements will be looked into so feel free to comment, and I hope you find it useful. Notes for: PRECOMPRESS/POSTCOMPRESS - These files are basic algorithmic experiments I carried out while learning about a compression technique known as "arithmetic coding". For those not familiar with the technique, it is far superior (in terms of the compressed size to original size ratio) to the best known compression technique, Huffman packing. If your interested in compression, look it up, it is worth the effort to understand it. These programs do not implement the algorithm fully (I'll get 'round to it one day), but demonstrate the general principle of adaptive techniques, which usually form part of an arithmetic coding algorithm. - The programs as written require a IIGS, but the algorithms may be adapted (pun intended) for other machines. - The PRECOMPRESS program takes an input file, and produces an output file of exactly the same size, but with a rather interesting property: the distribution of byte values in the output file should be such that the lower byte values occur most often. - It will work on most files, including english language text files, graphics files, and machine code. - Feeding this output file into a Huffman packer, such as "BLU", will generally result in greater compression than if the original file was compressed because Huffman (and many other compression techniques) relies on frequency distributions - try it out. - POSTCOMPRESS reverses the process returning the original file. - As I said, these programs are experimental, and do not allocate the IIGS memory correctly - if you want to use them seriously, I suggest you fix them up - otherwise you could find you lose some data on RAM disk etc. - In fact, no prompts are even given. They bost expect an original pathname, followed by a destination pathname. - Also these programs were written for simplicity, and are not as fast as they could be; if you run the routines with a large file, be prepared to wait. - If anyone finds a use for these programs, or gets an general purpose adaptive arithmetic coding algorithm fully working in 65816, I would be extremely interested so let me know. Notes for: MENU.SYSTEM - MENU.SYSTEM is a menu program, based on the LAUNCHER.SYSTEM, that is capable of launching programs converted to ProDOS with any of the following three programs: DISK.TO.FILE, DISK.TO.SPARSE, CHANGE.TYPE. - The purpose of this program, and its associated programs, is to allow non-ProDOS disks and files to be converted to ProDOS so that they can be launched off hard disks and other high capacity devices. - It supports file types $F1 through $F8, each requiring a corresponding RWTS.N file where N is 1 through 8. At present only $F1 and $F2 files are defined, but more are planned. - All of these programs will run on an enhanced //e or //c. Notes for: DISK.TO.FILE - This program converts a complete disk (with an RWTS on track 0) to a file which can be launched with MENU.SYSTEM. - The file produced will be of type $F1, and it requires the file called RWTS.1 to be launched. - Very little error checking is done by this program as it is only used during the conversion process. Notes for: DISK.TO.SPARSE - This program is similar to DISK.TO.FILE except that it creates a sparse file (if you don't know what a sparse file is then look it up in your ProDOS reference manual or don't use this program). - This means that zeroed blocks will not be copied, and the destination file is often much smaller. For example, a DOS 3.3 disk can be converted to a file when it has a single program on it, and will produce a relatively small file. - NB: If the program writes to disk (in areas previously unused), these writes will be directed to block zero of the device on which the program is running. Thus don't use this program if the disk usage will change. - This program also creates a file of type $F1 and requires RWTS.1 to run. - Don't try to copy sparse files with the FINDER as it will expand them back to their full size (being the brilliant program that it is); use a decent program such as Copy II Plus. - Very little error checking is done by this program as it is only used during the conversion process. Notes for: CHANGE.TYPE - This program changes the filetype of a program to $F2, thus enabling them to be launched under MENU.SYSTEM making use of RWTS.2. - This is most useful in converting binary files that used to run under DOS 3.3 but will not run under ProDOS and BASIC.SYSTEM. Simply convert them to ProDOS and then launch CHANGE.TYPE. - NB: RWTS.2 does not support a write operation so only single load programs should be converted using CHANGE.TYPE. Multi-load and load/save type programs should use either of the first two conversion programs. Notes for: PreBOOT - PreBOOT is a program I wrote one day before I had my hard disk: I was still booting P16 disks on a 3.5 and it was SSSLLLOOOWW. This was particularly annoying, especially when developing under P16 and programs crash to monitor. - PreBOOT is a program that "front-ends" the ProDOS file and does a "smart block copy" of the disk to /RAM5 if the current boot device is not the RAMdisk. It then switches the current boot device to the RAMdisk, and re-boots. From then on all re-boots are fast. - PreBOOT must be installed into your ProDOS file by: BLOAD PRODOS,TSYS,A$2200 Note the length of the file (in the catalog) BLOAD PREBOOT,A$2000 (it is exactly $200 bytes long) BSAVE PRODOS,TSYS,A$2000,L$(oldlength + $200) - It takes care of most errors, and requires an 800K RAMdisk to operate. - I will be very surprised if others do not find this useful, especially those who are suffering without hard disks.