(This is the "Dungeon Designs" column from the June 1990 issue of the Eamon Adventurer's Guild newsletter. Copyright 1990 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.) EAMON Coin Tossing - or - Your OS or Mine as explained by Hokas Tokas to Lurch Eamon authors and adventurers all have one thing in common: If you want to play, you must play under the old DOS 3.3 operating system. While there is really nothing wrong with this, what if you would rather play under the ProDOS operating system? You are kinda out of luck, aintcha? Not so, Oh tall one! It is unbelievably simple to convert a DOS 3.3 version of a given scenario to ProDOS - even a niffling such as yourself can do it with ease! But first, why should you convert? To be truthful, there is no adventure oriented reason. A given scenario in ProDOS will appear identical to one under DOS 3.3. But how many adventurers habitually live in the DOS 3.3 world? The advent (No pun intended) (yeah, right) of the Apple IIGS and various program selectors for the rest of the Apple II series, means adventuring in any Eamon world requires that you re-boot the entire system. That's defeating the whole purpose behind the program selectors. However, if you have a ProDOS version of an Eamon adventure, you can simply select the Master Program from within your program selector and be off! For instance, I play on an Apple IIGS. If I want to play one of the old DOS 3.3 versions, I have to essentially shut the whole thing down, and re-boot on the EAMON MASTER DISK. But, since I have a ProDOS version of the Master, all I need to do is point my mouse at it and "click". Zip, I'm in the Main Hall. From there, it's essentially the same as in the DOS 3.3 versions. Unfortunately, even though I have a ProDOS Master disk, I still need to convert my old DOS 3.3 scenarios if I want to adventure in them. There are other disadvantages to DOS 3.3, not the least of which is it's speed. ProDOS disk access is usually about eight times faster than DOS 3.3. A thought for future authors, under ProDOS, you could make use of the CHAIN command, which carries variables with it. In other words, under DOS 3.3 you have to write all your variables to a file, RUN the other program, then READ the variables again. Under ProDOS, all you need to do is CHAIN to the next program. The variables will carry over unchanged. ProDOS also offers SAVE and RESTORE commands, which allow you to STORE all your variables in one file, then RESTORE them to a different program - even if your computer has been shut off. (The chain program does this too, but the file created is temporary, internal to the computer, and wiped out when the power goes away. You'll never see it.) That's neat, but how can I convert the games I already have? Converting Eamon adventures is very easy. In fact, there are fewer than 30 program lines that HAVE to be changed or added. All you need - other than a willingness to type a little - is some way to copy files from your DOS 3.3 disk to a ProDOS disk (I use Copy II+). A program such as Beagle Brothers PROGRAM.WRITER can be handy for this project too, but is hardly necessary. You start out by formatting a blank floppy for use under ProDOS. I recommend it follow this disk naming convention: EAMON.P.XXX, where XXX is the adventure number. Copy II+ or your System Utilities disk can do this for you. Next, use your copy files utility to copy ALL the files on the DOS 3.3 disk to the ProDOS disk. Once that is done, put your DOS 3.3 disk away, you're done with it. Now, set your PREFIX to your ProDOS Eamon disk, and do a CATalog. You should note that most of the file names have been changed, and in some cases, truncated. This is because ProDOS won't allow filenames longer than 15 characters, and won't allow spaces in the filename. Even most punctuation is replaced with periods. This is nothing to worry about, since it's what the conversion is really all about. In fact, the hard part is done. In point of fact, that is the whole reason behind the rest of this column. Under DOS 3.3, Eamon filenames are full of spaces and special characters but since ProDOS won't allow spaces or special characters in a filename, AND limits that filename to 15 characters, several EAMON program lines need to be changed to make the programs run properly. Don't worry, there are surprisingly few, and the conversion is very simple. The next step is the re-naming of several of the programs, mostly just to make the filenames easier to read. One will Usually be: EAMON.ADVENTURE. This file started life as EAMON ADVENTURE # XXX. I recommend you rename it EAMON.XXX (again, XXX is the adventure number). Another file that usually requires renaming is the description file - For instance: THE MINES OF MORIA will be: THE.MINES.OF.MO. after the file copy process. Needless to say, while that can be understood, it's a bit clumsy. I suggest something like: MINES.OF.MORIA. It's still the same file, but it's a little easier to understand the filename. Of course, there ARE those description files whose names are just too long to make understandable under ProDOS, but, since it's just a name, we must do the best we can and live with it. Now you need to create a short program. In fact, one line is all you really need: 100 PRINT CHR$(4)"RUN (description file)" For Mines of Moria, the program would be: 100 PRINT CHR$(4)"RUN MINES.OF.MORIA" Save this program under the name LEADIN. This is a MUST, since both known ProDOS EAMON MASTER disks look for this file. You can add your own embellishments to this program to make things flow more smoothly. For instance, the LEADIN programs I write check for a SAVED game and make provisions to resume it, so they look like this: 100 ONERR GOTO 300 200 PRINT CHR$(4)"VERIFY GAME.VAR":PRINT CHR$(4)"RUN MAIN.PGM,@29000" 300 POKE 216,0:PRINT CHR$(4)"RUN (intro pgm) Line 200 checks for the file "GAME.VAR" and if it finds it, runs MAIN.PGM, starting at line 29000 - which is where I generally put the RESUME game routine. If "GAME.VAR" is not found, the description file is run, which in turn passes you to MAIN.PGM - but at the beginning, since you are starting a new adventure. Now, LOAD the MAIN.PGM and LIST line 130. This line varies greatly from one scenario to the next, but they are all similar. Re-type this line exactly, character for character, except where you see PRINT DK$"READ EAMON.ROOM NAMES,R". At this point, type PRINT DK$"READ EAMON.ROOM.NAME,R". Not much difference is there? But it's enough. One thing to note: when you list line 130, if you don't see anything resembling EAMON.ROOM NAMES anywhere, take a look at the few lines nearest it in the program. If you still can't find a reference to EAMON.ROOM NAMES, note where any nearby GOSUBs go, and take a look at THOSE line numbers. There have been a few occasions where this part of the line has been stashed as far away as line 37000. LIST line 1040. Do the same thing, using the filename FRESH.MEAT instead of FRESH MEAT. LIST line 1060. Notice any similarities to line 130? Right, it looks at EAMON.ROOM NAMES too. Re-type this and change EAMON.ROOM NAMES to EAMON.ROOM.NAME . LIST line 1050. Does it end with "PRINT DK$"DELETE FRESH.MEAT"? If not, add line 1055: 1055 PRINT DK$"DELETE FRESH.MEAT" At this point it would be a good idea to SAVE your changes. Nothing is quite so frustrating as spending even as little as 5 minutes on something, only to have it blown away by a random loss of power, or the calculating destructiveness of your local housecat. This much is fine, and will allow us to play the game, with a little extra typing to get things started, but we still need to address what happens when we successfully complete the quest. So: First, check to make sure the lines between 2500 and 2900 don't do anything but provide an exit back to the Main Hall. (They shouldn't - it's usually all that's ever there). Now delete them and type in the following listing: 2500 REM >>> RETURN TO MAIN HALL <<< 2510 ONERR GOTO 2530 2520 PRINT DK$"OPEN EAMON.PREFIX":PRINT DK$"READ EAMON.PREFIX":INPUT PR$:PRINT DK$"CLOSE": GOTO 2570 2530 POKE 216,0:REM >> ERROR TRAP << 2540 PRINT DK$"CLOSE":PRINT DK$"PREFIX": INPUT CX$ 2550 PRINT:PRINT:PRINT CX$:PRINT "IS THE CURRENT PREFIX":PRINT"INSERT YOUR MASTER DISK AND ENTER ITS PREFIX" 2560 INPUT"";PX$ 2570 PRINT DK$"PREFIX"PX$ 2580 PRINT DK$"VERIFY MAIN.HALL":POKE 216,0:IF DIE THEN PRINT DK$"OPEN THE.ADVENTURER": PRINT DK$"CLOSE":PRINT DK$"DELETE THE.ADVENTURER":GOTO 2630 2590 IF REC=-1 THEN 2630 2600 PRINT DK$"OPEN CHARACTERS,L150":PRINT DK$"WRITE CHARACTERS,R"REC:PRINT MN$(0): PRINT MD%(0,1):PRINT MD%(0,2):PRINT CH: FOR A=1 TO4:PRINT SA%(A):NEXT A 2610 FOR A=1 TO 5:PRINT WA%(A):NEXT:PRINT AE:PRINT SEX$:PRINT GOLD:PRINT BANK:PRINT AC:FOR A=1 TO 4:PRINT WN$(A):PRINT WT%(A): PRINTWO%(A):PRINT WD%(A):PRINT WS%(A): NEXT 2620 PRINT DK$"CLOSE":PRINT DK$"OPEN THE.ADVE NTURER":PRINT DK$"WRITE THE.ADVENTURER": PRINTMN$(0):PRINT REC:PRINT DK$"CLOSE" 2630 REM >>> RETURN TO MAIN HALL <<<< 2640 PRINT DK$"RUN MAIN.HALL Save the program again. Take a look at the SAVE/RESTART routines - usually kept at line 18000 and 29000 respectively. Make sure they don't make use of the old filenames. If they do, they need to be changed. Use lines 130, 1040, and 1060 as examples if you need to. ( A better set of ProDOS SAVE/RESTORE game routines should be the subject of a future Dungeon Designs column. ) What about the other programs? Now, take a look at the remaining BASIC programs on the disk. If you are not sure which they are, simply CATalog the disk and check it out. Every BASIC program will have "BAS" immediately to the right of the filename. LOAD each remaining BASIC program in turn, and look through it for lines where it makes reference to one of the other files on the disk. In most cases it will be something like this: 20 D$=CHR$(4):PRINT D$"OPEN FRESH MEAT":PRINT D$"READ FRESH MEAT":INPUT NAME$:INPUT REC: PRINTD$"CLOSE" or: 500 PRINT:PRINT"GOOD LUCK, "NAME$".":PRINT D$"RUN MAIN PGM" I can't tell you which specific line numbers to change in these cases, since there are nearly as many different line numbers as there are scenarios. What lies behind all these changes? By now you will have noticed that all this typing (well, most of it) has to do only with those lines that OPEN or otherwise make use of the files on the disk. With this knowledge, you should be able to go through the rest of MAIN.PGM and the other BASIC files and make sure that the filenames - as they appear in the program - agree with what shows up when you CATalog the disk. That, believe it or not, is all there is to converting the scenarios to ProDOS. It looks more difficult than it really is. In fact, if you intend to convert more than one or two, it might behoove you to use a text editor to pre-type the necessary lines as an EXEC text file, since the applicable lines rarely change. You can even have the Exec file load in your programs for you, and save the program when the changes have been made. Once all the changes have been made to all the programs, you're set! Launch your ProDOS MASTER disk, and go slay a few orcs! ______________________________________________________ Eamon ProDOS Conversions - Part II by Tom Zuchowski Lurch has done a large number of conversions using the method that he outlined in the preceding article. While it should be mentioned that there are no significant differences between my conversion method and Lurch's, his method and mine differ in some minor respects, that I will list here: 1) I don't check for a saved game in the LEADIN pgm, but do this check at Line 20 of the MAIN.PGM, as it is done in the Dos 3.3 version. In my opinion Lurch is 'showing off' ProDOS features with this step . Also, I name the saved VAR file SAVED.GAME instead of GAME.VAR. 2) I do not add line 1055 to delete the FRESH.MEAT file if it is missing. In fact, I REM out line 1055 whenever I find it! I don't see any good reason for deleting this file, as it makes it impossible to start a game over again without returning to the Master to resurrect your character and then launching the adventure all over again, a totally unnecessary procedure. 3) I rename the intro pgm in the format EAMON.nnn.INTRO. Note that we are using a 3-digit convention here, with leading zeroes in 1 and 2 digit eamon numbers (eg: EAMON.008.INTRO). 4) I delete the pgm EAMON ADVENTURE #nnn altogether. It serves as the HELLO pgm in Dos 3.3 but serves no purpose in ProDOS. 5) I add a short pgm with the name REV.DDMMMYY (where DD=date; MMM=month; YY=year). This pgm has 2 lines: 10 HOME: VTAB5: PRINT"EAMON ADVENTURE #nnn": PRINT: PRINT "(name of adventure)": PRINT: PRINT "BY (name of author)" 20 VTAB15: LAST UPDATE: MM/DD/YY 6) Lurch & I disagree on the subject of error trapping when returning to the Master disk. Lurch believes in handling the errors that don't require too much code, whereas I believe that if you aren't going to trap them all then it is better to let all the errors crash uniformly. My 'return' code is: 2500 PRINT DK$"OPEN EAMON.PREFIX": PRINT DK$ "READ EAMON.PREFIX": INPUT PX$: PRINT DK$ "CLOSE" 2510 HOME: VTAB 5: PRINT "(INSERT EAMON MAS TER DISKETTE, THEN": PRINT " HIT THE 'C' KEY) ";: POKE -16368,0 2515 GET A$: IF ASC(A$) = 3 THEN PRINT: END: REM CTRL-C 2517 IF A$ < > "C" THEN 2515 2520 PRINT A$ 2525 ONERR GOTO 2510 2530 PRINT DK$"PREFIX "PX$ 2540 POKE 216,0: IF DI THEN PRINT DK$;"DELETE THE.ADVENTURER": GOTO 2900 2550 PRINT DK$"OPEN CHARACTERS,L150": PRINT DK$"WRITE CHARACTERS,R";REC: PRINT MN$(0): PRINT MD%(0,1): PRINT MD%(0,2): PRINT CH: FOR A = 1 TO 4: PRINT SA%(A): NEXT 2560 FOR A = 1 TO 5: PRINT WA%(A): NEXT: PRINT AE: PRINT SEX$: PRINT GOLD: PRINT BANK: PRINT AC: FOR A = 1 TO 4: PRINT WN$(A): PRINT WT%(A): PRINT WO%(A): PRINT WD%(A): PRINT WS%(A): NEXT 2570 PRINT DK$"OPEN THE.ADVENTURER": PRINT DK$"WRITE THE.ADVENTURER": PRINT MN$(0): PRINT REC: PRINT DK$"CLOSE" 2900 PRINT DK$"RUN MAIN.HALL" 7) I am taking the INIT lines at 1001-1038 out of the MAIN.PGM and putting them in a small program named MAKE.FAST.START. This pgm loads EAMON.ARTIFACTS and EAMON.MONSTERS, and STOREs then in a VAR file named FAST.START. I put a line in the MAIN.PGM at 1010 to RESTORE FAST.START, resulting in a lot faster startup. I also write a companion pgm to MAKE.FAST.START named MAKE.ARTS.MONS that will generate EAMON.ARTIFACTS and EAMON.MONSTERS from the FAST.START file for editing. This allows you to delete EAMON.ARTIFACTS and EAMON.MONSTERS to save disk space. 8) Both Lurch & I are using STORE and RESTORE to save and resume games. It is very compact and fast. Here is my code: 18000 REM SAVE GAME 18010 PRINT: PRINT "DO YOU WANT TO SAVE THIS GAME? ":INPUT "(Y/N) :";A$: A$ = LEFT$(A$,1) 18020 IF A$ < > "Y" AND A$ < > "N" THEN 18010 18030 IF A$ = "N" THEN 100 18040 PRINT DK$"CLOSE": PRINT DK$"FRE" 18050 PRINT DK$"STORE SAVED.GAME" 18080 PRINT: PRINT "THE GAME IS NOW SAVED. RUN THE PROGRAM NAMED 'MAIN.PGM' TO RESTART THE GAME." 18090 END 29000 REM RESTORE 29005 POKE 216,0 29010 PRINT: PRINT "DO YOU WANT TO RESUME THE SAVED GAME?": INPUT " Y OR N:";A$: A$ = LEFT$(A$,1) 29020 IF A$ < > "Y" AND A$ < > "N" THEN 29010 29030 IF A$ = "N" THEN PRINT DK$"DELETE SAVED. GAME": RUN 29040 PRINT DK$"RESTORE SAVED.GAME" 29060 PRINT DK$"OPEN EAMON.DESC,L256": PRINT DK$"OPEN EAMON.ROOMS,L64": PRINT DK$"OPEN EAMON.ROOM.NAME,L64" 19070 GOTO 100 It should go without saying that you really need a good program editor to do these conversions. Lurch recommends Program Writer. I have been using a ProDOS version of GPLE and have found that GPLE won't do global searches in line numbers over 9999 on my enhanced //e, so Program Writer is probably the way to go.