(This is the "Dungeon Designs" column from the December 1995 issue of the Eamon Adventurer's Guild newsletter. Copyright 1995 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.) The "Speed-up Mods" The old pre-7.0 versions of the Eamon MAIN PGM used programming techniques that made clean and proper code, but caused the program to run very slowly, especially in large Eamons. A set of modifications evolved that came to be known as the "speed-up mods". Many Eamons have received these mods, as was indicated in the September issue's Eamon Listing. If you have GPLE or Program Writer, the speed-up mods are very easy to make, and can be done in just a few minutes. If you don't have an editor and must make the mods by hand, they are still fairly easy to accomplish if you are familiar with the method of using the IJKL or arrow keys to recopy program listed lines. In most cases, the mods will result in a quite noticeable improvement in execution speed, vastly reducing those annoying delays. Since the MAIN PGM was constantly evolving over the years, we can't simply give you a set of the mods to make. There are three cases where the mod cannot be made as illustrated: 1) the mod is already made 2) the code resides at different line numbers 3) the code is so different that the mod cannot or should not be made. Instead, we must teach you how to recognize the old, slow code and how to change it by showing you both the original code and the modified code. In this way you can see for yourself what was changed and why. ________________________________________________ YOU SEE original code: 130 IF ( INT (V%(ROOM) / 2) < > (V%(ROOM /2) THEN... 140 IF ( INT (V%(ROOM) / 2) = (V%(ROOM /2) THEN... 150 FOR M = 1 TO NM: IF MD%(M,5) = ROOM AND MD%(M,15) THEN PRINT MN$(M);" IS HERE.": PRINT 160 IF MD%(M,5) = ROOM AND NOT MD%(M,15) THEN PRINT DK$;"READ EAMON.DESC,R";M + 300: INPUT A$: PRINT DK$: PRINT A$: MD%(M,15) = 1: PRINT 170 NEXT M: FOR A = 1 TO NZ: IF AD%(A,4) = ROOM AND AD%(A,9) THEN PRINT "YOU SEE ";AN$(A) 180 IF AD%(A,4) = ROOM AND NOT AD%(A,9) THEN PRINT DK$;"READ EAMON.DESC,R";A + 100: INPUT A$: PRINT DK$: PRINT A$: AD%(A,9) = 1: PRINT 190 NEXT A: FOR A = A TO NA: IF AD%(A,4) = ROOM THEN PRINT "YOUR ";AN$(A) + " IS HERE." YOU SEE modified code: 130 VZ = ( INT (V%(ROOM) / 2) = (V%(ROOM /2): IF NOT VZ THEN... 140 IF VZ THEN... 150 FOR M = 1 TO NM: IF MD%(M,5) < > RO THEN NEXT: GOTO 170 155 IF MD%(M,15) THEN PRINT MN$(M);" IS HERE.": PRINT 160 IF NOT MD%(M,15) THEN PRINT DK$;"READ EAMON.DESC,R";M + 300: INPUT A$: PRINT DK$: PRINT A$: MD%(M,15) = 1: PRINT 165 NEXT 170 FOR A = 1 TO NZ: IF AD%(A,4) < > RO THEN NEXT: GOTO 190 175 IF AD%(A,9) THEN PRINT "YOU SEE ";AN$(A) 180 IF NOT AD%(A,9) THEN PRINT DK$;"READ EAMON.DESC,R";A + 100: INPUT A$: PRINT DK$: PRINT A$: AD%(A,9) = 1: PRINT 185 NEXT 190 FOR A = A TO NA: IF AD%(A,4) = ROOM THEN PRINT "YOUR ";AN$(A) + " IS HERE." ________________________________________________ PICK FOE original code: 320 FOR M = 1 TO NM: IF MD%(M,5) < > RO OR MD%(M,15) = 2 THEN 490 370 FOR M2 = 1 TO NM: IF MD%(M2,5) = ROOM AND... 400 FOR M2 = 1 TO NM: IF MD%(M2,5) = ROOM AND... 490 NBTL = (FD%(1) < TD%(1)): IF NBTL THEN NEXT M PICK FOE modified code: 320 FOR M = 1 TO NM: IF MD%(M,5) < > RO THEN NEXT: NBTL = (FD%(1) < TD%(1)): IF NOT NBTL THEN M = NM: NEXT: GOTO 500 325 IF MD%(M,15) = 2 THEN 495 370 FOR M2 = 1 TO NM: IF MD%(M2,5) = RO THEN IF... 400 FOR M2 = 1 TO NM: IF MD%(M2,5) = RO THEN IF... 490 NBTL = (FD%(1) < TD%(1)): IF NOT NBTL THEN M = NM 495 NEXT ________________________________________________ MONSTER PICK UP WEAPON original code: 7420 FOR A = 1 TO NA: IF AD%(A,4) < > ROOM OR AD%(A,2) < 2 OR AD%(A,2) > 3 THEN NEXT: RETURN MONSTER PICK UP WEAPON modified code: 7420 FOR A = 1 TO NA: IF AD%(A,4) < > RO THEN NEXT: RETURN 7425 IF AD%(A,2) < 2 OR AD%(A,2) > 3 THEN NEXT: RETURN ________________________________________________ It's also worth adding a line to the "RESTART" code. This code can usually be found at 19000, 29000, or 30000. Add this line (29000 example): 29005 POKE 216,0 ________________________________________________ Typically, I will add a few other minor fixes if they are merited. The most common one is that the DROP code may not check to see if the object is actually being carried. Also, I will often scan for special-programming lines that check for room numbers. Usually, these lines will use AND in this manner: 510 IF ROOM = 10 AND AD%(12,4) = ROOM THEN... Changing AND to THEN IF can radically reduce the number of comparisons made per turn: 510 IF RO = 10 THEN IF AD%(12,4) = RO THEN... Note that the above change can ONLY be made in those cases where nothing happens if the first comparison fails. If you are not confident that you can determine this, then you should not attempt this particular mod. ________________________________________________