A.N.A.L.O.G. ISSUE 45 / AUGUST 1986 / PAGE 95
Your king watches over his lands from the lower lefthand corner of his realm. The force field protecting him and the countryside from invasion is at his far right.
You’ve just been promoted to the rank of Gunner First Class. As such, you’ve taken a position on the left flank of the treasure room above the king. To your right is open battlefield.
The task before you is to guard the royal treasure. It supplies power to the force field, keeping the enemy at bay. The atomic weapon you control is your key to success.
Warring trolls will appear at the screen’s right. They race across the terrain in an effort to capture the treasure, for they know its value.
Listing 1 is the BASIC data used to create both cassette and disk versions of Troll War. Those readers who are interested in how the game works may obtain the assembly listing on either the magazine disk version or the ANALOG Computing Atari Users’ Group on Delphi.
Disk users should refer to the M/L Editor article on page 24 for typing instructions.
If you have a cassette system, type in Listing 1, then add the lines shown in Listing 2. Type RUN and press RETURN. The program will begin checking the data statements, printing the line numbers as it goes. It will alert you to any problems. Fix any incorrect lines and rerun the program until all errors are eliminated.
When all your data lines are correct, the computer will beep twice and prompt you to READY CASSETTE AND PRESS RETURN Now, insert a blank cassette in your recorder, press the RECORD and PLAY buttons simultaneously and hit RETURN. The message WRITING FILE will appear, and the program will create a machine language boot tape version of Troll War, printing each data line number as it goes. When the READY prompt appears, the game is recorded and ready to play. CSAVE the BASIC program onto a separate tape before continuing.
To play the game, rewind the tape created with the BASIC program to the beginning. Turn your computer off and remove all cartridges. Press the PLAY button on your recorder and turn on your computer, while holding down the START key. If you have an XL or XE series computer, you must hold the START and OPTION keys when you turn on the power. The computer will beep once. Hit the RETURN key and Troll War will load and run automatically
To stop a troll dead in his tracks, wait until he’s within your range. Use joystick to move the weapon up or down, bringing the opponent into your sights. When you’ve gotten the gun into position, press the joystick button to send energy screaming at the attacker.
A single energy bolt is adequate to disintegrate a charging troll. One hundred valor points will be awarded for each enemy annihilated.
Should one of the trolls slip past you, he will steal some of the treasure, then turn to watch you frantically fight his allies. If another troll manages to gain the same position as the first in the treasure room, the king’s force field will weaken. The opposing trolls will then be able to push the force field back toward the king.
The game is over when the royal force field disappears. At that time, the trolls confronting the king will dictate his total surrender.
The trolls will never cease attacking, but, since you have never-ending firepower, just blast the invaders. Your only worry is to avoid the sprites seeking to drain the atomic weapon you wield. Their success will cause it to freeze until it can be regenerated.
But never fear — should you lose the war, press the START key. The battle will begin anew.
1000 DATA 255,255,0,40,247,50,0,0,0,0,0,0,0,0,0,0,3460 1010 DATA 20,85,85,85,85,20,0,0,20,69, 69,81,81,20,0,0,6274 1020 DATA 16,65,65,65,81,20,21,19,23,1 65,138,58,12,60,80,16,8968 1030 DATA 80,104,136,176,192,240,0,3,0 ,12,2,0,12,3,85,245,389 1040 DATA 245,86,186,168,207,3,5,63,15 ,5,235,10,3,15,80,80,9898 1050 DATA 80,96,160,128,0,0,12,60,3,60 ,12,0,0,0,192,240,357 1060 DATA 0,240,192,0,0,0,0,0,0,255,25 5,0,0,0,204,59,1475 1070 DATA 29,28,30,15,15,15,192,0,0,12 8,0,64,192,192,0,96,1582 1080 DATA 240,255,255,252,248,96,0,3,1 2,48,48,12,3,42,0,240,1170 1090 DATA 0,80,80,0,240,168,0,240,0,0, 0,0,240,168,0,15,1330 1100 DATA 63,255,255,127,23,4,12,3,5,4 ,5,61,51,59,204,240,2454 1110 DATA 84,132,148,95,243,251,255,25 5,15,15,15,15,15,15,243,243,7396 1120 DATA 3,3,3,3,3,3,255,207,207,255, 252,207,207,207,63,63,1835 1130 DATA 60,60,60,60,63,63,243,243,24 3,243,243,243,243,243,192,192,8787 1140 DATA 192,192,192,192,255,255,60,6 0,60,60,60,60,63,63,0,0,986 1150 DATA 0,0,0,0,240,240,240,240,240, 243,255,60,60,60,60,60,8985 1160 DATA 60,60,252,240,240,240,255,24 3,243,255,255,243,243,243,207,207,2861 1170 DATA 207,207,207,207,207,207,252, 60,60,252,240,60,60,60,255,243,3514 1180 DATA 243,255,255,243,243,243,192, 192,192,192,192,192,192,192,240,243,99 59 1190 DATA 243,243,240,240,243,240,252, 255,192,252,255,15,255,252,255,243,184 7 1200 DATA 243,255,255,243,243,243,207, 207,207,207,207,207,207,207,240,60,831 1 1210 DATA 60,240,240,60,60,240,255,255 ,243,243,243,243,255,255,60,60,7226 1220 DATA 60,60,60,60,252,252,255,255, 15,15,15,15,15,15,240,240,6892 1230 DATA 0,0,0,0,0,0,255,255,15,15,15 ,15,15,15,243,243,3623 1240 DATA 3,3,3,3,3,3,255,255,207,207, 207,207,255,255,63,255,5732 1250 DATA 240,255,63,3,255,63,15,207,0 ,0,192,192,192,0,255,255,432 1260 DATA 240,240,240,240,240,240,63,6 0,60,63,63,60,60,60,243,243,8957 1270 DATA 243,243,243,243,243,243,255, 207,207,255,252,207,207,207,63,63,7025 1280 DATA 3,3,3,3,3,3,252,252,192,192, 192,192,192,192,15,63,9604 1290 DATA 240,240,240,243,240,63,192,2 40,240,0,0,252,240,192,255,243,7249 1300 DATA 243,255,255,243,243,243,207, 207,207,207,207,207,207,207,0,192,6923 1310 DATA 243,63,12,0,0,0,60,252,252,6 0,60,60,60,60,255,255,7924 1320 DATA 240,255,255,240,255,255,192, 192,0,0,0,0,192,192,255,255,2569 1330 DATA 243,243,243,243,255,255,207, 207,195,195,192,192,192,192,0,0,2975 1340 DATA 195,195,255,255,60,60,243,24 3,195,195,3,3,3,3,255,255,9775 1350 DATA 192,252,252,192,255,255,63,6 0,60,63,63,60,60,60,240,240,8939 1360 DATA 240,240,192,240,240,240,112, 112,69,12,55,68,248,50,4,4,4146 1370 DATA 4,4,4,4,4,4,4,4,4,4,4,4,4,4, 4,4,1914 1380 DATA 4,132,70,248,54,65,64,42,85, 96,102,96,81,64,72,81,2618 1390 DATA 85,81,64,47,60,64,68,64,42,4 7,50,47,42,47,53,47,8402 1400 DATA 40,40,42,47,53,57,64,2,4,3,1 ,3,2,2,4,1,3148 1410 DATA 4,1,3,4,2,3,2,184,168,220,18 4,220,168,168,220,220,2687 1420 DATA 200,220,172,168,220,168,184, 8,10,138,174,255,174,138,10,8,7624 1430 DATA 0,0,0,0,51,35,47,50,37,0,0,1 6,16,16,16,16,4077 1440 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,15 0,151,152,8237 1450 DATA 153,154,155,156,157,0,0,0,0, 0,0,158,159,160,161,162,4995 1460 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,163,4068 1470 DATA 164,0,158,159,160,161,162,0, 165,166,0,167,168,169,170,168,581 1480 DATA 171,172,173,0,174,175,176,0, 0,177,178,179,180,181,182,183,2074 1490 DATA 184,0,0,0,185,186,187,188,18 9,190,191,192,193,194,195,196,5820 1500 DATA 197,198,199,28,62,42,54,28,1 27,93,93,28,24,48,0,0,8382 1510 DATA 20,0,0,0,0,0,0,0,0,124,84,12 5,57,255,188,190,5365 1520 DATA 63,3,1,72,165,170,141,10,212 ,141,9,212,104,64,162,0,5431 1530 DATA 138,157,248,50,157,152,51,15 7,136,52,157,120,53,157,0,36,4610 1540 DATA 157,0,37,157,0,38,157,0,39,2 32,208,229,96,162,15,160,7771 1550 DATA 0,138,74,144,2,160,2,169,16, 145,132,200,169,17,145,132,7128 1560 DATA 32,188,45,202,16,233,169,21, 153,240,53,169,20,136,153,240,427 1570 DATA 53,162,39,169,12,157,200,53, 157,32,51,157,24,54,202,16,4098 1580 DATA 244,96,173,10,210,41,15,133, 144,170,160,0,232,224,16,144,8492 1590 DATA 2,162,0,189,145,42,153,200,5 4,153,184,54,200,228,144,208,2288 1600 DATA 235,162,15,169,15,157,216,54 ,189,129,42,157,232,54,202,16,8236 1610 DATA 242,96,169,0,133,169,133,160 ,133,161,133,162,133,155,133,168,1237 1620 DATA 133,147,141,11,208,141,10,20 8,141,9,208,141,8,208,141,12,6796 1630 DATA 208,141,200,2,133,163,133,16 4,133,166,133,167,133,157,133,158,1388 1640 DATA 133,159,141,8,210,141,5,210, 169,3,141,15,210,169,30,133,7113 1650 DATA 165,169,1,133,148,133,152,13 3,153,133,154,169,17,141,111,2,6675 1660 DATA 169,170,141,1,210,141,3,210, 169,162,141,7,210,169,41,133,8808 1670 DATA 145,169,16,141,3,55,141,4,55 ,141,5,55,169,64,141,48,2725 1680 DATA 2,169,42,141,49,2,169,61,141 ,0,2,169,43,141,1,2,537 1690 DATA 173,14,212,9,128,141,14,212, 169,32,141,7,212,169,62,141,7627 1700 DATA 47,2,169,3,141,29,208,169,42 ,141,196,2,169,12,141,197,7557 1710 DATA 2,169,206,141,198,2,169,76,1 41,192,2,169,196,141,195,2,8743 1720 DATA 169,72,141,193,2,169,14,141, 194,2,96,162,0,169,36,208,6478 1730 DATA 10,162,1,169,37,208,4,162,2, 169,38,133,131,169,0,133,5419 1740 DATA 130,96,32,133,44,32,192,44,1 62,0,32,252,44,32,139,44,3441 1750 DATA 32,192,44,162,1,32,252,44,32 ,145,44,32,192,44,162,2,3439 1760 DATA 32,252,44,76,90,45,181,149,2 01,52,208,4,169,0,149,152,7440 1770 DATA 201,175,208,4,169,1,149,152, 181,152,240,17,214,149,180,149,2016 1780 DATA 162,11,200,177,130,136,145,1 30,200,202,16,246,96,181,149,246,3694 1790 DATA 149,24,105,10,168,162,11,177 ,130,200,145,130,136,136,202,16,8930 1800 DATA 246,96,246,160,181,160,201,4 ,144,40,169,0,149,160,24,181,7908 1810 DATA 157,105,11,201,22,208,2,169, 0,149,157,133,144,181,149,168,9880 1820 DATA 24,105,11,133,156,166,144,18 9,29,43,145,130,232,200,196,156,2013 1830 DATA 208,245,96,162,10,169,70,133 ,149,169,95,133,150,169,170,133,748 1840 DATA 151,189,29,43,157,70,36,157, 95,37,157,170,38,202,16,241,7751 1850 DATA 142,0,208,142,1,208,142,2,20 8,134,137,134,139,134,138,96,9063 1860 DATA 198,137,198,137,165,137,141, 0,208,165,169,201,20,144,24,198,9705 1870 DATA 139,165,139,141,1,208,165,16 9,201,50,144,11,198,138,198,138,789 1880 DATA 198,138,165,138,141,2,208,96 ,162,0,138,157,0,35,232,208,8500 1890 DATA 250,173,10,210,141,199,2,162 ,9,164,135,189,51,43,153,0,5599 1900 DATA 35,136,202,16,246,169,242,13 3,142,141,4,208,169,240,133,140,2899 1910 DATA 141,5,208,169,238,133,141,14 1,6,208,169,236,133,143,141,7,247 1920 DATA 208,96,165,132,24,105,40,133 ,132,165,133,105,0,133,133,201,8071 1930 DATA 53,208,14,165,132,201,200,20 8,8,169,51,133,133,169,72,133,9253 1940 DATA 132,96,164,145,136,136,185,2 40,53,201,21,240,14,185,240,53,865 1950 DATA 240,10,169,0,153,240,53,136, 153,240,53,96,169,15,153,240,435 1960 DATA 53,136,169,19,153,240,53,96, 165,146,56,233,40,74,74,74,6419 1970 DATA 170,173,70,42,133,128,173,71 ,42,133,129,202,48,13,24,165,5433 1980 DATA 128,105,40,133,128,144,244,2 30,129,176,240,96,165,169,201,250,6261 1990 DATA 240,23,230,169,165,169,201,1 00,144,7,169,10,133,165,76,67,7284 2000 DATA 46,201,70,144,4,169,20,133,1 65,238,5,55,173,5,55,201,6412 2010 DATA 26,208,41,169,16,141,5,55,23 8,4,55,173,4,55,201,26,3768 2020 DATA 208,26,169,16,141,4,55,238,3 ,55,173,3,55,201,26,208,5632 2030 DATA 11,169,16,141,5,55,141,4,55, 141,3,55,96,164,163,185,5912 2040 DATA 98,42,10,141,6,210,200,192,3 2,144,5,169,0,133,163,96,6696 2050 DATA 230,164,165,164,197,165,208, 6,230,163,169,0,133,164,96,169,966 2060 DATA 70,133,135,169,62,133,134,14 1,3,208,162,8,189,161,42,157,8489 2070 DATA 62,39,202,16,247,96,165,168, 240,17,169,0,141,6,210,141,8702 2080 DATA 4,210,141,2,210,141,0,210,76 ,98,228,230,166,208,2,230,2223 2090 DATA 167,32,220,45,32,119,46,32,2 5,49,165,155,240,19,198,155,7839 2100 DATA 201,240,240,6,141,0,210,76,2 35,46,169,0,141,0,210,133,7853 2110 DATA 155,165,148,208,14,173,15,20 8,240,25,169,90,133,148,169,78,9681 2120 DATA 141,195,2,169,0,141,30,208,1 41,2,210,32,156,44,198,148,8018 2130 DATA 76,98,228,169,0,141,30,208,3 2,90,47,32,156,44,169,196,6886 2140 DATA 141,195,2,173,120,2,201,13,2 08,25,166,135,160,12,224,184,9612 2150 DATA 176,43,189,255,38,157,0,39,2 02,136,208,246,230,134,230,135,4337 2160 DATA 76,98,228,201,14,208,22,166, 134,160,12,224,56,144,14,189,8324 2170 DATA 1,39,157,0,39,232,136,208,24 6,198,134,198,135,76,98,228,2904 2180 DATA 173,132,2,240,6,169,0,141,2, 210,96,230,147,165,147,201,1331 2190 DATA 11,144,242,169,150,141,2,210 ,169,0,133,147,165,134,24,105,7990 2200 DATA 4,133,146,32,2,46,160,5,177, 128,208,217,169,15,145,128,8877 2210 DATA 96,162,15,160,36,177,132,201 ,17,208,7,169,18,145,132,76,6887 2220 DATA 218,47,201,18,208,7,169,17,1 45,132,76,218,47,201,15,240,9175 2230 DATA 9,201,19,208,43,169,15,76,18 2,47,169,19,133,136,169,0,5835 2240 DATA 145,132,192,36,240,26,200,17 7,132,208,7,165,136,145,132,76,9860 2250 DATA 218,47,169,0,145,132,200,145 ,132,169,255,133,155,32,38,46,8194 2260 DATA 136,208,178,32,188,45,202,16 ,170,96,160,38,177,132,201,5,8176 2270 DATA 208,9,169,9,145,132,169,8,13 6,145,132,96,160,2,177,132,7956 2280 DATA 201,7,208,13,169,9,145,132,1 36,169,8,145,132,200,76,129,8603 2290 DATA 48,201,9,240,3,76,129,48,136 ,136,177,132,240,91,201,17,9281 2300 DATA 240,66,201,18,240,62,201,5,2 40,5,200,200,76,129,48,152,9122 2310 DATA 170,198,145,198,145,164,145, 192,1,208,25,169,14,153,240,53,9527 2320 DATA 169,13,136,153,240,53,169,1, 133,168,169,30,133,165,32,101,7475 2330 DATA 49,76,155,50,169,5,153,240,5 3,136,169,4,153,240,53,138,9158 2340 DATA 168,76,104,48,169,5,145,132, 136,169,4,145,132,200,200,169,1028 2350 DATA 0,145,132,200,145,132,76,129 ,48,169,6,145,132,200,169,7,8008 2360 DATA 145,132,200,169,0,145,132,20 0,192,39,176,3,76,248,47,96,8230 2370 DATA 160,37,177,132,201,1,208,5,1 69,2,145,132,96,201,2,208,8310 2380 DATA 5,169,3,145,132,96,201,3,208 ,15,200,177,132,240,1,96,8952 2390 DATA 169,5,145,132,136,169,4,145, 132,96,162,15,189,184,54,201,9583 2400 DATA 255,144,22,32,246,47,32,228, 47,32,138,48,189,200,54,157,8113 2410 DATA 184,54,201,253,176,3,254,200 ,54,254,184,54,32,188,45,202,1246 2420 DATA 16,218,96,162,15,160,37,189, 232,54,208,5,189,216,54,240,1721 2430 DATA 20,56,189,216,54,233,1,157,2 16,54,189,232,54,233,0,157,747 2440 DATA 232,54,76,18,49,177,132,208, 15,169,15,157,216,54,189,129,9312 2450 DATA 42,157,232,54,169,1,145,132, 32,188,45,202,16,201,96,173,8957 2460 DATA 9,208,201,8,144,3,76,42,49,1 73,11,208,201,8,144,9,4943 2470 DATA 169,90,133,148,169,78,141,19 5,2,165,169,201,70,144,43,198,348 2480 DATA 140,198,140,165,140,141,5,20 8,198,143,198,143,165,143,141,7,821 2490 DATA 208,198,141,198,141,165,141, 141,6,208,198,142,198,142,165,142,3444 2500 DATA 141,4,208,201,10,176,3,32,13 0,45,96,169,52,133,133,169,7401 2510 DATA 136,133,132,160,39,169,0,145 ,132,169,0,136,192,3,208,247,437 2520 DATA 169,42,141,199,2,160,29,169, 5,145,132,136,169,4,145,132,7636 2530 DATA 136,169,9,145,132,136,169,8, 145,132,169,14,133,144,160,11,7307 2540 DATA 177,132,208,35,32,216,49,32, 246,47,160,11,177,132,201,6,7636 2550 DATA 240,8,200,192,26,208,245,76, 152,49,166,144,189,14,43,157,9097 2560 DATA 149,52,198,144,76,152,49,169 ,4,145,132,200,169,5,145,132,8862 2570 DATA 206,199,2,173,31,208,201,6,2 40,3,76,202,49,96,162,255,671 2580 DATA 160,255,136,208,253,202,208, 248,96,173,244,2,133,170,169,40,2993 2590 DATA 141,244,2,141,9,212,32,72,43 ,32,204,43,162,59,169,0,4840 2600 DATA 157,248,54,202,16,250,162,39 ,189,230,42,157,136,52,202,16,9378 2610 DATA 247,169,14,141,199,2,206,199 ,2,32,216,49,173,199,2,208,9537 2620 DATA 245,32,72,43,160,35,169,6,15 3,152,51,200,169,7,153,152,8438 2630 DATA 51,169,51,133,133,169,152,13 3,132,32,246,47,32,216,49,160,9024 2640 DATA 19,177,132,240,244,169,4,145 ,132,169,5,200,145,132,32,216,793 2650 DATA 49,32,216,49,169,42,141,199, 2,162,39,189,190,42,157,12,7223 2660 DATA 55,202,16,247,32,216,49,32,2 16,49,32,216,49,32,216,49,6697 2670 DATA 169,4,141,19,55,141,29,55,14 1,33,55,141,40,55,169,5,2911 2680 DATA 141,20,55,141,30,55,141,34,5 5,141,41,55,169,20,141,31,3433 2690 DATA 55,169,21,141,32,55,162,19,1 89,170,42,157,248,54,202,16,8499 2700 DATA 247,32,156,43,32,204,43,32,7 2,43,32,153,46,32,130,45,2574 2710 DATA 169,7,162,46,160,176,32,92,2 28,32,211,45,32,103,43,32,4627 2720 DATA 45,45,169,0,133,77,238,199,2 ,32,211,45,32,180,48,32,5114 2730 DATA 221,48,165,169,201,131,144,1 2,32,221,48,165,169,201,160,144,1834 2740 DATA 3,32,221,48,32,139,47,165,16 7,201,2,144,14,162,15,94,5747 2750 DATA 232,54,202,16,250,169,0,133, 166,133,167,76,188,50,224,2,9197 2760 DATA 225,2,227,49,0,0,0,0,0,0,0,0 ,0,0,0,0,3866
10 REM *** TROLL WAR *** 20 REM CASSETTE MAKER PROGRAM 40 DIM DAT(16):LINE=990:RESTORE 1000:TRAP 120:? "CHECKING DATA" 50 LINE=LINE+10:? "LINE:";LINE:FOR X=1 TO 16:READ DAT:IF DAT<0 OR DAT>255 TH EN 220 60 DAT(X)=DAT:NEXT X:DATLIN=PEEK(183)+ PEEK(184)*256:IF DATLIN<>LINE THEN ? " LINE ";LINE;" MISSING!":END 70 TOTAL=LINE:FOR K=1 TO 16 80 IF PASS=2 THEN PUT #1,DAT(X):NEXT X :READ CHKSUM:GOTO 50 90 TOTAL=TOTAL+DAT(X)*X:IF TOTAL>9999 THEN TOTAL=TOTAL−10000 100 NEXT X:READ CHKSUM:IF TOTAL=CHKSUM THEN 50 110 GOTO 220 120 IF PEEK(195)<>6 THEN 220 130 IF PASS=0 THEN 200 160 FOR X=1 TO 128:PUT #1,0:NEXT X:CLO SE #1:END 200 ? "READY CASSETTE AND PRESS RETURN ";:OPEN #1,8,128,"C:":RESTORE 230:FOR X=1 TO 40:READ N:PUT #1,N:NEXT X 210 ? :? "WRITING FILE":PASS=2:LINE=99 0:RESTORE 1000:TRAP 120:GOTO 50 220 ? "BAD DATA: LINE ";LINE:END 230 DATA 0,23,210,39,249,39,169,0,234, 234,234,169,60,141,2,211,169,0,141,231 ,2,133,14,169,64,141,232,2 240 DATA 133,15,169,227,133,10,169,49, 133,11,24,96
; ; TROLLWAR ; BY ; SCOTT D. LANGSTON ; ROCK ISLAND, IL ; ; SYSTEM EQUATES ; CHBASE = $D409 HPOSM0 = $D004 HPOSM1 = $D005 HPOSM2 = $D006 HPOSM3 = $D007 HPOSP0 = $D000 HPOSP1 = $D001 HPOSP2 = $D002 HPOSP3 = $D003 RANDOM = $D20A WSYNC = $D40A XITVBV = $E462 ; *= $80 ; TEMP10 .DS 2 ;PAGE ZERO VARIABLES TEMP11 .DS 2 TEMP12 .DS 2 GUNTOP .DS 1 ;POINTER TO TOP OF GUN DRAWING GUNBOT .DS 1 ;POINTER TO BOTTOM OF GUN DRAWING BOMB .DS 1 ;VARIBLE FOR CHAR FIRED FROM GUN P0 .DS 1 ;POINTER/HORIZ POS PLAYER 0 P2 .DS 1 ;HORIZ POS PLAYER 2 P1 .DS 1 ;HORIZ POS PLAYER 1 P5 .DS 1 ;HORIZ POS MISS 1 P6 .DS 1 ;HORIZ POS MISS 2 P4 .DS 1 ;HORIZ POS MISS 0 P7 .DS 1 ;HORIZ POS MISS 4 TEMP1 .DS 1 ;VARIABLE TEMP13 .DS 1 ;POINTER ON LAST LINE WHERE TROLL IS DISPLAYED STEMP2 .DS 1 VBCNT .DS 1 ;COUNTER FOR # OF TIMES VERT BLANK EXCUTED GUNFLAG .DS 1 ;FLAG FOR GHOST TOUCHIN GUN GTOP .DS 1 ;PLAYER0/POINTER TOP OF GHOST GTOP1 .DS 1 ;PLAYER1/" GTOP2 .DS 1 ;PLAYER2/" GFLAG .DS 1 ;PLAYER0/FLAG FOR GHOST DIRECTION GFLAG1 .DS 1 ;PLAYER1/" GFLAG2 .DS 1 ;PLAYER2/" EXPTIM .DS 1 ;VAR/DELAY FOR GUN SOUND GTEMP .DS 1 ;TEMPORARY VARIABLE GH1ST .DS 1 ;PLAYER0/POINTER GHOST DRAWING GH2ST .DS 1 ;PLAYER1/" GH3ST .DS 1 ;PLAYER2/" GCNT1 .DS 1 ;PLAYER0/COUNTER BEFORE DRAWING CHANGES GCNT2 .DS 1 ;PLAYER1/" GCNT3 .DS 1 ;PLAYER2/" SD .DS 1 ;POINTER TO SONG NOTE SD1 .DS 1 ;DELAY BEFORE NOTE CHANGES SD2 .DS 1 ;SONG TEMPO VAR TIMER1 .DS 1 ;TIMERS FOR WHEN TROLLS TIMER2 .DS 1 ;SPEED-UP GAMEOVER .DS 1 ;FLAG FOR GAME OVER SCOUNT .DS 1 ;COUNTER OF SCORE VALUE OF 0 THRU 250 TR .DS 1 ; *= $2000 ; PM .DS 768 MIS .DS 256 ;MISSILE 0-3 PL0R .DS 256 ;PLAYER 0 PL1R .DS 256 ;PLAYER 1 PL2R .DS 256 ;PLAYER 2 PL3R .DS 256 ;PLAYER 3 ; ;CHARACTER SET ; CHAR .BYTE $00,$00,$00,$00,$00,$00,$00,$00 .BYTE $00,$00,$14,$55,$55,$55,$55,$14 .BYTE $00,$00,$14,$45,$45,$51,$51,$14 .BYTE $00,$00,$10,$41,$41,$41,$51,$14 .BYTE $15,$13,$17,$A5,$8A,$3A,$0C,$3C .BYTE $50,$10,$50,$68,$88,$B0,$C0,$F0 .BYTE $00,$03,$00,$0C,$02,$00,$0C,$03 .BYTE $55,$F5,$F5,$56,$BA,$A8,$CF,$03 .BYTE $05,$3F,$0F,$05,$EB,$0A,$03,$0F .BYTE $50,$50,$50,$60,$A0,$80,$00,$00 .BYTE $0C,$3C,$03,$3C,$0C,$00,$00,$00 .BYTE $C0,$F0,$00,$F0,$C0,$00,$00,$00 .BYTE $00,$00,$00,$FF,$FF,$00,$00,$00 .BYTE $CC,$3B,$1D,$1C,$1E,$0F,$0F,$0F .BYTE $C0,$00,$00,$80,$00,$40,$C0,$C0 .BYTE $00,$60,$F0,$FF,$FF,$FC,$F8,$60 .BYTE $00,$03,$0C,$30,$30,$0C,$03,$2A .BYTE $00,$F0,$00,$50,$50,$00,$F0,$A8 .BYTE $00,$F0,$00,$00,$00,$00,$F0,$A8 .BYTE $00,$0F,$3F,$FF,$FF,$7F,$17,$04 .BYTE $0C,$03,$05,$04,$05,$3D,$33,$3B .BYTE $CC,$F0,$54,$84,$94,$5F,$F3,$FB TW .BYTE $FF,$FF,$0F,$0F,$0F,$0F,$0F,$0F .BYTE $F3,$F3,$03,$03,$03,$03,$03,$03 .BYTE $FF,$CF,$CF,$FF,$FC,$CF,$CF,$CF .BYTE $3F,$3F,$3C,$3C,$3C,$3C,$3F,$3F .BYTE $F3,$F3,$F3,$F3,$F3,$F3,$F3,$F3 .BYTE $C0,$C0,$C0,$C0,$C0,$C0,$FF,$FF .BYTE $3C,$3C,$3C,$3C,$3C,$3C,$3F,$3F .BYTE $00,$00,$00,$00,$00,$00,$F0,$F0 .BYTE $F0,$F0,$F0,$F3,$FF,$3C,$3C,$3C .BYTE $3C,$3C,$3C,$3C,$FC,$F0,$F0,$F0 .BYTE $FF,$F3,$F3,$FF,$FF,$F3,$F3,$F3 .BYTE $CF,$CF,$CF,$CF,$CF,$CF,$CF,$CF .BYTE $FC,$3C,$3C,$FC,$F0,$3C,$3C,$3C .BYTE $FF,$F3,$F3,$FF,$FF,$F3,$F3,$F3 .BYTE $C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0 .BYTE $F0,$F3,$F3,$F3,$F0,$F0,$F3,$F0 .BYTE $FC,$FF,$C0,$FC,$FF,$0F,$FF,$FC .BYTE $FF,$F3,$F3,$FF,$FF,$F3,$F3,$F3 .BYTE $CF,$CF,$CF,$CF,$CF,$CF,$CF,$CF .BYTE $F0,$3C,$3C,$F0,$F0,$3C,$3C,$F0 .BYTE $FF,$FF,$F3,$F3,$F3,$F3,$FF,$FF .BYTE $3C,$3C,$3C,$3C,$3C,$3C,$FC,$FC .BYTE $FF,$FF,$0F,$0F,$0F,$0F,$0F,$0F .BYTE $F0,$F0,$00,$00,$00,$00,$00,$00 .BYTE $FF,$FF,$0F,$0F,$0F,$0F,$0F,$0F .BYTE $F3,$F3,$03,$03,$03,$03,$03,$03 .BYTE $FF,$FF,$CF,$CF,$CF,$CF,$FF,$FF .BYTE $3F,$FF,$F0,$FF,$3F,$03,$FF,$3F .BYTE $0F,$CF,$00,$00,$C0,$C0,$C0,$00 .BYTE $FF,$FF,$F0,$F0,$F0,$F0,$F0,$F0 .BYTE $3F,$3C,$3C,$3F,$3F,$3C,$3C,$3C .BYTE $F3,$F3,$F3,$F3,$F3,$F3,$F3,$F3 .BYTE $FF,$CF,$CF,$FF,$FC,$CF,$CF,$CF .BYTE $3F,$3F,$03,$03,$03,$03,$03,$03 .BYTE $FC,$FC,$C0,$C0,$C0,$C0,$C0,$C0 .BYTE $0F,$3F,$F0,$F0,$F0,$F3,$F0,$3F .BYTE $C0,$F0,$F0,$00,$00,$FC,$F0,$C0 .BYTE $FF,$F3,$F3,$FF,$FF,$F3,$F3,$F3 .BYTE $CF,$CF,$CF,$CF,$CF,$CF,$CF,$CF .BYTE $00,$C0,$F3,$3F,$0C,$00,$00,$00 .BYTE $3C,$FC,$FC,$3C,$3C,$3C,$3C,$3C .BYTE $FF,$FF,$F0,$FF,$FF,$F0,$FF,$FF .BYTE $C0,$C0,$00,$00,$00,$00,$C0,$C0 .BYTE $FF,$FF,$F3,$F3,$F3,$F3,$FF,$FF .BYTE $CF,$CF,$C3,$C3,$C0,$C0,$C0,$C0 .BYTE $00,$00,$C3,$C3,$FF,$FF,$3C,$3C .BYTE $F3,$F3,$C3,$C3,$03,$03,$03,$03 .BYTE $FF,$FF,$C0,$FC,$FC,$C0,$FF,$FF .BYTE $3F,$3C,$3C,$3F,$3F,$3C,$3C,$3C .BYTE $F0,$F0,$F0,$F0,$C0,$F0,$F0,$F0 ; ;GAME DISPLAY LIST ; DLIST .BYTE $70,$70,$45 .WORD SCR5 .BYTE $44 .WORD SCR1 .BYTE $04,$04,$04,$04,$04,$04,$04,$04 .BYTE $04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$84,$46 .WORD SCR4 .BYTE $41 .WORD DLIST ; ;LOOKUP TABLES ; SONG .BYTE 85,96,102,96,81,64,72,81,85,81,64,47,60,64,68,64,42,47,50,47,42,47,53 .BYTE 47,40,40,42,47,53,57,64 TABLE5 .BYTE $02,$04,$03,$01,$03,$02 .BYTE $02,$04,$01,$04,$01,$03,$04,$02,$03,$02 TABLE7 .BYTE $B8,$A8,$DC,$B8,$DC,$A8 .BYTE $A8,$DC,$DC,$C8,$DC,$AC,$A8,$DC,$A8,$B8 GUN .BYTE $08,$0A,$8A,$AE,$FF,$AE,$8A,$0A,$08 SCR42 .BYTE $00,$00,$00,$00,$33,$23,$2F,$32,$25,$00 .BYTE $00,$10,$10,$10,$10,$10,$00,$00,$00,$00 SCR52 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$96 .BYTE $97,$98,$99,$9A,$9B,$9C,$9D,$00,$00,$00 .BYTE $00,$00,$00,$9E,$9F,$A0,$A1,$A2,$00,$00 .BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 SCR6 .BYTE $00,$00,$00,$A3,$A4,$00,$9E,$9F,$A0,$A1 .BYTE $A2,$00,$A5,$A6,$00,$A7,$A8,$A9,$AA .BYTE $A8,$AB,$AC,$AD,$00,$AE,$AF,$B0,$00,$00,$B1 .BYTE $B2,$B3,$B4,$B5,$B6,$B7,$B8,$00,$00,$00 SCR7 .BYTE $B9,$BA,$BB,$BC,$BD,$BE,$BF,$C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7 GHOST .BYTE $1C,$3E,$2A,$36,$1C,$7F,$5D,$5D,$1C,$18,$30 .BYTE $00,$00,$14,$00,$00,$00,$00,$00,$00,$00,$00 GHOST2 .BYTE $7C,$54,$7D,$39,$FF,$BC,$BE,$3F,$03,$01 ; ;SUBROUTINE DLI:USED BY DISPLAY ;INTERURPT TO LOAD ADDRESS ;OF REDEFINED CHARACTER BASE ; DLI PHA LDA TR ;CHAR BASE ADDRESS STA WSYNC ;WAIT SYNC STA CHBASE ;CHAR BASE REGISTER PLA RTI ; ;SUBROUTINE ZEROSC:CLEARS ;PLAYFIELD AND PLAYER ;MEMORY.EXECUTES 256 TIMES. ; ZEROSC LDX #0 TXA Z1 STA SCR1,X ;CLEAR SCREEN STA LEV1,X STA LEV2,X STA LEV3,X STA PL0R,X ;CLEAR PLAYERS STA PL1R,X STA PL2R,X STA PL3R,X INX BNE Z1 RTS ; ;SUBROUTINE WALL:BUILDS ;PLAYFIELD.GEM IS CHARACTER ;16 AND 17.WALL IS CHARACTER 12. ;KING IS CHARACTER 20&21 ; WALL LDX #15 ;# OF PLAYFLD ROWS-1 W2 LDY #0 ;LOOP W2 PLACES TXA ; GEM CHARACTERS LSR A BCC W1 ;GEM CHAR IS PLACED LDY #2 ;STARTING IN BYTE 2 OR 0 W1 LDA #16 ;LEFT HALF OF GEM STA (TEMP12),Y ;TEMP12 HOLDS INY ;ADDRESS OF A LINE IN THE PLAYFIELD LDA #17 ;RIGHT HALF OF GEM STA (TEMP12),Y JSR LINECNT ;JUMP SUB TO DEX ;INCREMENT TEMP12 TO BPL W2 ;NEXT LINE LDA #21 STA LEV7,Y ;LEV7 IS LOWEST LDA #20 ;PLAYFLD WHERE KING IS PLACED DEY STA LEV7,Y LDX #39 ;# OF BYTES PER LINE-1 LDA #12 ;WALL CHARACTER W3 STA ENDSC,X ;LOOP W3 PLACES STA LEV9,X ;SOLID WALL STA LEV8,X ;CHARACTERS DEX ;(3 WALLS ARE BIULT) BPL W3 RTS ; ;SUBROUTINE SETTBL6:RANDOMLY SETS ;THE ORDER OF HOW FAST TROLLS MOVE. ;TABLE6 CONTROLS HOW LONG BEFORE ;TROLL MOVES,TABLES 2 AND 3 ;CONTROL HOW FAST EGG TURNS INTO ;A TROLL CHARACTER. ; SETTBL6 LDA RANDOM ;GET RANDOM # AND #$0F ;MAKE 0..15 STA TEMP1 ;TEMPORARY SAVE # TAX ;POINTER TO WHERE VALUE IS LDY #0 ;POINTER TO WHERE VALUE IS GOING CHCKX INX ;VALUE OF X CAN ONLY BE 0-15 CPX #16 BCC LOAD6 LDX #0 LOAD6 LDA TABLE7,X ;GET VALUE STA TABLE6,Y ;SAVE VALUE STA TABLE1,Y ;SAVE VALUE INY ;NEXT DESTINATION CPX TEMP1 ;IF X=TEMP1 THEN ALL VALUES HAVE BNE CHCKX ;BEEN LOADED INTO TABLE6 LDX #15 LOAD23 LDA #15 ;LOAD AND SAVE STA TABLE2,X ;CORRESPONDING LDA TABLE5,X ;TABLE VALUES STA TABLE3,X DEX BPL LOAD23 RTS ; ;SUBROUTINE INITIAL:SETS ;INITIAL VALUE OF POINTERS ;AND COUNTERS. SETS-PMGRAPH, ;PLAYFIELD,PLAYER COLOR,AND ;PLAYER WIDTH/PRIORITY ;ALSO LOAD ADDRESS OF DISPLAY ;LIST AND ENABLES DISPLAY LIST ;INTERRUPT. ; INITIAL LDA #0 STA SCOUNT STA GCNT1 STA GCNT2 STA GCNT3 STA EXPTIM STA GAMEOVER STA VBCNT STA $D00B ;PLAYER SIZE STA $D00A ;" STA $D009 ;" STA $D008 ;" STA $D00C ;" STA $02C8 ;BACKGROUND STA SD STA SD1 STA TIMER1 STA TIMER2 STA GH1ST STA GH2ST STA GH3ST STA $D208 STA $D205 LDA #3 STA $D20F LDA #30 STA SD2 LDA #1 STA GUNFLAG STA GFLAG STA GFLAG1 STA GFLAG2 LDA #17 STA $026F ;PLAYER PRIORITY LDA #$AA ;SET SOUND STA $D201 STA $D203 LDA #$A2 STA $D207 LDA #41 STA TEMP13 LDA #$10 ;CLEAR SCORE STA SCR4+11 STA SCR4+12 STA SCR4+13 DISPLAY LDA #<DLIST ;SET DISP LIST STA 560 LDA #>DLIST STA 561 LDA #<DLI ;SET UP DISPLAY STA $0200 ;LIST INTERRUPT LDA #>DLI STA $0201 LDA $D40E ;ENABLE DISPLAY INTERRUPT ORA #$80 STA $D40E PMGRAPH LDA #>PM ;SET UP PMGRAPG STA $D407 LDA #62 STA $022F LDA #3 STA $D01D COLORPLF LDA #42 ;SET PLAYFIELD COLOR STA $02C4 LDA #12 STA $02C5 LDA #206 STA $02C6 COLORPLR LDA #76 ;SET PLAYER COLOR STA $02C0 LDA #196 STA $02C3 LDA #72 STA $02C1 LDA #14 STA $02C2 RTS ; ;SUBROUTINE PLOR0:SETS POINTER ;TO START OF PLAYER 0 AND ;SETS X TO POINT TO PLAYER0 ;VARIABLES ; PLOR0 LDX #0 LDA #>PL0R BNE PLSRX ; ;SUBROUTINE PLIR1:SAME AS ;PLOR0 EXCEPT FOR PLAYER 1 ; PLIR1 LDX #1 LDA #>PL1R BNE PLSRX ; ;SUBROUTINE PLSR2:SAME AS ;PLOR0 EXCEPT FOR PLAYER 2 ; PLSR2 LDX #2 LDA #>PL2R PLSRX STA TEMP11+1 LDA #<PL2R STA TEMP11 RTS ; ;SUBROUTINE MOVGHOST :JUMPS ;SUBRS TO SET POINTERS ;FOR CORRESPONDING PLAYER, ;CHANGES DRAWING BY SUB CHG1, ;CHANGES VERTICLE POSITION ;BY SUB HEIGHT,AND CHANGES ;HORIZONTAL POSITION BY ;SUB MOVP (MOVE PLAYERYS) ; MOVGHOST JSR PLOR0 JSR HEIGHT LDX #0 JSR CHG1 JSR PLIR1 JSR HEIGHT LDX #1 JSR CHG1 JSR PLSR2 JSR HEIGHT LDX #2 JSR CHG1 JMP MOVP ; ;SUBROUTINE HEIGHT:MOVES ;DRAWING OF GHOST UP OR DOWN ;1 POSITION WITHIN PLAYER 0-2. ;DRAWING DOES NOT MOVE ABOVE ;POSITION 52 OR BELOW 175. ;ONCE DRAWING REACHES BOUNDARY ;(52 OR 175) GFLAG IS SET SO ;DRAWING IS MOVED THE OTHER ;DIRECTION. ; ; HEIGHT LDA GTOP,X ;LOAD GHOST TOP CMP #52 ;UPPER LIMIT? BNE NX1 LDA #0 ;YES THEN SET FLAG STA GFLAG,X NX1 CMP #175 ;LOWER LIMIT? BNE NX2 LDA #1 ;YES THEN SET FLAG STA GFLAG,X NX2 LDA GFLAG,X ;GET FLAG BEQ NX3 ;IF=0 MOVE GHOST UP DEC GTOP,X ;NEW POS (OLD POS-1) LDY GTOP,X LDX #11 ;HIEGHT OF GHOST NX4 INY LDA (TEMP11),Y ;OLD POS DEY STA (TEMP11),Y ;NEW POS INY ;NEXT DRAWING BYTE DEX BPL NX4 ;DONE? RTS NX3 LDA GTOP,X ;LOAD TOP OF GHOST INC GTOP,X ;NEW POS CLC ADC #10 ;BOTTOM OF GHOST TAY LDX #11 ;HIEGHT OF GHOST+1 NX5 LDA (TEMP11),Y ;OLD POS INY STA (TEMP11),Y ;NEW POS DEY ;RESET POINTER DEY ;NEXT BYTE DEX BPL NX5 ;DONE? RTS ; ;SUBROUTINE CHG1:CHANGES ;THE DRAWING(OF A GHOST) ;THAT IS IN PLAYER 0-2 ; CHG1 INC GCNT1,X ;ADD 1 TO COUNTER OF DELAY LDA GCNT1,X ;BEFORE GHOST DRAWING CHANGES CMP #4 BCC NCHG ;IF<4 NO CHANGE LDA #0 ;ELSE SET POINTER TO STA GCNT1,X ;NEXT DRAWING CLC ;OF GHOST (ONLY 2 DRAWINGS ARE USED) LDA GH1ST,X ADC #11 CMP #22 BNE GST1 LDA #0 GST1 STA GH1ST,X ;SAVE POINTER TO DRAWING STA TEMP1 ;ALSO TEMPORARY SAVE LDA GTOP,X ;LOAD VERT POS OF GHOST TAY CLC ;SET UP TO ADD ADC #11 ;ADD 11 TO FIND BOTTOM STA GTEMP ;OF GHOST AND SAVE VALUE LDX TEMP1 GST11 LDA GHOST,X ;GET DRAWING BYTE STA (TEMP11),Y ;SAVE IN PLAYER INX ;NEXT DRAWING BYTE INY ;NEXT POS WHERE DRAWING IS GOING CPY GTEMP ;DRAWING CHANGED? BNE GST11 ;IF EQ THEN DONE NCHG RTS ;EXIT ; ;SUBROUTINE PLAYERS:SETS ;INITIAL VALUE OF POINTER ;OF PLAYER0-2 AND READS ;DRAWING OF GHOST INTO THE ;PLAYERS. ; PLAYERS LDX #10 ;HIEGHT OF GHOST-1 LDA #70 STA GTOP ;PLAYER0 GHOST TOP LDA #95 STA GTOP1 ;PLAYER1 GHOST TOP LDA #170 STA GTOP2 ;PLAYER2 GHOST TOP PL1 LDA GHOST,X ;READ IN DRAWING STA PL0R+70,X ;OF GHOST AND STA PL1R+95,X ;STORE IN PLAYERS STA PL2R+170,X DEX BPL PL1 STX HPOSP0 ;SET HORIZONTAL STX HPOSP1 ;REGISTERS STX HPOSP2 STX P0 ;SET HORIZONTAL STX P1 ;POINTERS STX P2 RTS ; ;SUBROUTINE MOVP:DECREMENTS ;POINTER OF CURRENT HORIZONTAL ;POSITION OF PLAYERS 0-2 ;AND STORES NEW VALUE ; MOVP DEC P0 DEC P0 LDA P0 STA HPOSP0 LDA SCOUNT ;GET SCORE COUNT CMP #20 ;IF < 20 THEN ONLY BCC NMP ;1 GHOST DEC P1 LDA P1 STA HPOSP1 LDA SCOUNT CMP #50 ;IF < 50 THEN ONLY BCC NMP ;2 GHOSTS DEC P2 DEC P2 DEC P2 LDA P2 STA HPOSP2 NMP RTS ; ;SUBROUTINE GHOSTM:CLEARS MISSILE ;MEMORY,READS IN GHOST DRAWING ;SETS HORIZONTAL POSITION ; GHOSTM LDX #0 TXA ZMIS STA MIS,X ;CLEAR MISS'S INX BNE ZMIS LDA RANDOM ;GET RANDOM # STA $02C7 ;SET PLFLD COLOR LDX #9 ;GHOST HIEGHT-1 LDY GUNBOT ;Y IS POINTER BOT OF GHOST SLOOP LDA GHOST2,X ;READ IN/SAVE STA MIS,Y ;GHOST DRAWING DEY DEX BPL SLOOP LDA #242 ;SET HORIZ POS OF STA P4 ;MISS SAVE IN CORRESPONDING STA HPOSM0 ;REGISTERS/POINTERS LDA #240 STA P5 STA HPOSM1 LDA #238 STA P6 STA HPOSM2 LDA #236 STA P7 STA HPOSM3 RTS ; ;SUBROUTINE LINECNT:LOADS ;ZERO PAGE VARIABLE TEMP12 ;WITH START ADDRESS OF A ;LINE OF THE PLAYFIELD ;SCREEN.TEMP12 CAN POINT TO ;LINES 4 THRU 20. ; LINECNT LDA TEMP12 ;LOAD CURRENT SCREEN LINE CLC ADC #40 ;ADD # OF BYTES PER LINE STA TEMP12 ;TEMP12 POINTER LDA TEMP12+1 ;TO NEXT LINE ADC #0 STA TEMP12+1 CMP #>ENDSC ;END OF PLFLD IS ENDSC BNE EXITSC LDA TEMP12 ;IF NOT = EXIT CMP #<ENDSC BNE EXITSC ;ELSE IF = RESET TEMP12 ORGIN LDA #>LEV0 ;SET TEMP12 STA TEMP12+1 ;TO POINT TO LDA #<LEV0 ;1ST PLAYFIELD STA TEMP12 ;LINE EXITSC RTS ; ;SUBROUTINE FORCE:CONTROLLS THE ;FLASHING CHARACTER THAT IS ;DISPLAYED IN BOTTOM ROW. ;CHARACTER FLASHES BY ALTERNATING ;THE ACTUAL DRAWING WITH THE ;ZERO CHARACTER ; FORCE LDY TEMP13 ;SET POINTER TO DEY ;WHERE FLASHING CHAR IS DEY ;GOING LDA LEV7,Y ;DOES NEW POS HAVE CMP #21 ;KING CHAR IN IT BEQ EX13 ;IF YES THEN EXIT LDA LEV7,Y ;ELSE MAKE CHAR FLASH BEQ BOLT LDA #0 ;STORE ZERO TO REMOVE STA LEV7,Y ;CHARACTER DEY STA LEV7,Y EX13 RTS BOLT LDA #15 ;STORE CHARS THAT STA LEV7,Y ;MAKEUP FLASHING DEY ;CHAR LDA #19 STA LEV7,Y RTS ; ;SUBROUTINE FINDCHAR:ACCEPTS ;VERTICLE POSITION OF PLAYER 3 ;(THE GUN)AND CALCULATES THE ;CORRESPONDING PLAYFIELD ;ROW IN THAT POSITION ; FINDCHAR LDA STEMP2 ;LOAD PLAYR3 VERT POS SEC ;SUBTRACT AREA WHERE PLAYER CAN SBC #$28 ;MOVE BUT THAT IS NOT ON PLAYFLD LSR A ;DIVIDE BY HIEGHT OF LSR A ;CHARACTER GIVES LSR A ;# OF ROWS TAX LDA DLIST+6 ;LOAD CURRENT STA TEMP10 ;SCREEN ADDRESS LDA DLIST+7 STA TEMP10+1 ROW DEX ;CALCULATE # ROW-1 BMI EXIT30 ;TO FIND POS CLC ;OF PLAYER 3 LDA TEMP10 ADC #40 ;# BYTES PER LINE STA TEMP10 BCC ROW INC TEMP10+1 BCS ROW EXIT30 RTS ; ;SUBROUTINE ONE:WHEN ENERGY ;BOLT HITS TROLL,THIS ;SUBROUTINE ADDS 1 TO THE ;CURRENT SCORE ; ONE LDA SCOUNT CMP #250 BEQ AD1 INC SCOUNT LDA SCOUNT CMP #100 BCC SN1 LDA #10 STA SD2 JMP AD1 SN1 CMP #70 BCC AD1 LDA #20 STA SD2 AD1 INC SCR4+13 ;HUNDERS COUNTER LDA SCR4+13 CMP #26 ;>9 BNE SC1 ;IF NO EXIT LDA #16 ;"0" STA SCR4+13 INC SCR4+12 ;THOUSANDS LDA SCR4+12 CMP #26 ;>9 BNE SC1 ;IF NO EXIT LDA #16 ;"0" STA SCR4+12 INC SCR4+11 ;TEN THOUSANDS LDA SCR4+11 CMP #26 ;>9 BNE SC1 ;IF NO EXIT LDA #16 ;"0" STA SCR4+13 ;RESET SCORE STA SCR4+12 STA SCR4+11 SC1 RTS SOUND LDY SD ;POINTER TO NOTE LDA SONG,Y ;GET NOTE ASL A ;LOWER OCTIVE STA $D206 ;PLAY NOTE INY ;NEXT NOTE THAT WOULD PLAY CPY #32 ;32 NOTES TO PLAY BCC OKS ;IF < CHECK DELAY LDA #0 ;ELSE RESET TO SONG START STA SD RTS OKS INC SD1 ;INC DELAY BEFORE NOTE PLAYS LDA SD1 CMP SD2 ;CMP WITH SONG SPEED BNE OKS2 INC SD ;NEXT NOTE LDA #0 ;RESET DELAY STA SD1 OKS2 RTS ; ;SUBROUTINE JS15:SETS INITIAL ;POSITION OF PLAYER 3(THE ;GUN) AND READS IN THE ;DRAWING OF THE GUN ; JS15 LDA #70 ;ENDING POSITION STA GUNBOT ;OF GUN DRAWING LDA #62 ;STARTING POSITION STA GUNTOP ;OF GUN DRAWING STA HPOSP3 ;HORIZ POS PLAYER3 LDX #8 ;#BTYES GUN DRAWING-1 M1 LDA GUN,X ;GET DRAWING BYTE STA PL3R+62,X ;SAVE IN PLAYER DEX ;NEXT BYTE BPL M1 ;DONE? RTS ; ;VERTICLE BLANK ROUTINE: ; VBROUTIN LDA GAMEOVER BEQ NOTOVER LDA #0 STA $D206 ;TURN OFF SOUND STA $D204 STA $D202 STA $D200 JMP XITVBV NOTOVER INC TIMER1 ;HIGH BYTE OF TIMER BNE NOTOV1 INC TIMER2 ;LOW BYTE OF TIMER NOTOV1 JSR FORCE JSR SOUND JSR MOVMIS LDA EXPTIM ;GET SOUND VARIABLE BEQ NOEX ;IF NE PLAY TROL HIT SOUND DEC EXPTIM ;NEXT NOTE TO PLAY CMP #240 BEQ OFF ;IF NOTE =240 TURN OFF SOUND STA $D200 ;ELSE PLAY NOTE JMP NOEX OFF LDA #0 ;ZERO TO TURN OFF STA $D200 STA EXPTIM NOEX LDA GUNFLAG ;IF FLAG NE THEN FREEZE GUN BNE VB2 LDA $D00F ;ELSE CHECK SEE IF PLAYER 3 COLLISION BEQ VB1 VB3 LDA #90 ;90 COUNTS OF GUN FREEZE STA GUNFLAG LDA #78 ;CHANGE COLOR OF GUN STA $02C3 VB2 LDA #0 ;CLEAR COLLISION STA $D01E STA $D202 ;TRUN OFF GUN FIRE SOUND JSR MOVGHOST DEC GUNFLAG ;DEC GUN FREEZE DELAY JMP XITVBV VB1 LDA #0 ;HIT CLEAR STA $D01E JSR MISSILE JSR MOVGHOST LDA #196 ;RESTORE GUN COLOR STA $02C3 ; ;SUBROUTINE JOYSTICK:READS ;VALUE OF JOYSTICK 0.IF VALUE ;IS 13 THEN PLAYER3 DRAWING ;(THE GUN) IS MOVED DOWN ONE ;POSITION.IF VALUE IS 14 THEN ;GUN IS MOVED UP ONE POSITION ; JOYSTICK LDA $0278 ;LOAD VALUE OF STICK 0 CMP #13 ;IS IT 13 BNE STICK14 ;NO CMP WITH OTHERS LDX GUNBOT ;BOTTOM OF GUN LDY #12 ;HIEGHT OF GUN CPX #184 ;LOWER LIMIT CAN BCS EXIT ;NOT MOVE PAST DOWN LDA PL3R-1,X ;MOVE DRAWING STA PL3R,X ;DOWN 1 BYTE XP2 DEX ;NEXT BYTE DEY BNE DOWN INC GUNTOP ;NEW POSITION INC GUNBOT JMP XITVBV STICK14 CMP #14 ;STICK0=14? BNE EXIT ;NO EXIT LDX GUNTOP ;TOP OF GUN LDY #12 ;HIEGHT OF GUN CPX #56 ;UPPER LIMIT CAN BCC EXIT ;NOT MOVE PAST UP LDA PL3R+1,X ;MOVE DRAWING STA PL3R,X ;UP 1 BYTE XP3 INX ;NEXT BYTE DEY BNE UP DEC GUNTOP ;NEW POSITION DEC GUNBOT EXIT JMP XITVBV ; ;SUBROUTINE MISSILE:READS ;VALUE OF TRIGGER 0.IF PUSHED ;AND A DELAY OF 16 HAS PASSED ;THEN AN ENERGY BOLT CHARACTER ;IS DISPLAYED AT PLAYFIELD ;POSITION CORRESPONDING TO ;PLAYER 3(GUN) POSITION ; MISSILE LDA $0284 ;READ TRIGGER0 BEQ FIRE ;IF PUSHED FIRE ENERGY NOMIS LDA #0 ;IF NOT TURN OFF STA $D202 ;SOUND OF GUN FIRE RTS FIRE INC VBCNT ;INC DELAY COUNTER LDA VBCNT ;MUST BE 16 BEFORE CMP #11 ; GUN CAN FIRE BCC NOMIS ;IF<16 EXIT LDA #150 ;GUN FIRE NOTE STA $D202 ;PLAY NOTE LDA #0 ;RESET COUNTER STA VBCNT LDA GUNTOP ;VERT POS GUN TOP CLC ADC #4 ;MIDDLE OF GUN STA STEMP2 ;TEMPORARY SAVE JSR FINDCHAR ;GET PLAYFLD BYTE LDY #5 ;IS BYTE WHERE GUN IS LDA (TEMP10),Y ;CLEAR? IF BNE NOMIS ;NO THEN EXIT LDA #15 ;IF YES FIRE GUN STA (TEMP10),Y RTS ; ;SUBROUTINE MOVEMIS:CHECKS ;EACH BYTE OF PLAYFIELD ;FOR ENERGY BOLT CHARACTER ;IF IT IS A BOLT CHARACTER ;THEN THAT CHAR IS MOVED ;RIGHT ONE BYTE.(ENERGY BOLT ;CHAR IS #15 AND CHAR #19) ;ALSO CHANGES GEM'S RIGHT ;CHARACTER (#17 OR #18) ;CHANGING CHARACTER FROM ;#17 TO #18 MAKES GEM FLICKER ;TEMP12 HOLDS START ADDRESS ;OF A LINE OF PLAYFIELD ; MOVEMIS LDX #15 ;#PLAYFLD LINES-1 MVS1 LDY #36 ;# OF BYTES TO CHECK MSLOOP LDA (TEMP12),Y ;GET LINE BYTE CMP #17 ;IS IT A GEM CHARACTER BNE MSX1 ;NO,CHECK OTHER CHAR LDA #18 ;YES,DISPLAY OTHER GEM STA (TEMP12),Y JMP NEXTMS ;GET NEXT BYTE MSX1 CMP #18 ;IS IT A GEM CHAR BNE MSX2 ;NO CHECK FOR MISSILE CHAR LDA #17 ;YES CHANGE GEM STA (TEMP12),Y JMP NEXTMS ;GET NEXT BYTE MSX2 CMP #15 ;IS IT MISSILE CHAR BEQ MSX3 ;IF YES JMP TO LOAD OTHER MISSILE CHAR CMP #19 ;IS IT OTHER MISSILE CHAR BNE NEXTMS ;IF NO,GET NEXT BYTE LDA #15 ;LOAD MISSILE CHAR JMP MSX4 MSX3 LDA #19 ;LOAD MISSILE CHAR MSX4 STA BOMB ;TEMPORARY SAVE LDA #0 ;REMOVE OLD MISSILE CHAR STA (TEMP12),Y CPY #36 ;IS BYTE # 36 BEQ NEXTMS ;IF YES DO NOT DISPLAY NEW CHAR INY ; ELSE GET NEXT BYTE TO RIGHT LDA (TEMP12),Y ;IS BYTE CLEAR BNE REMVMIS ;IF NO TROLL HIT LDA BOMB ;ELSE MOVE MISSILE STA (TEMP12),Y ;RIGHT 1 BYTE JMP NEXTMS ;GET NEXT LINE BYTE REMVMIS LDA #0 ;"0" TO CLEAR STA (TEMP12),Y ;LEFT HALF OF TROLL DRAWING INY ;MOVE POINTER TO RIGHT HALF DRAWING STA (TEMP12),Y ;REMOVE LDA #255 ;LOAD DELAY FOR SOUND WHEN STA EXPTIM ;TROLL HIT JSR ONE ;ADD 1 TO SCORE NEXTMS DEY ;NEXT BYTE BNE MSLOOP JSR LINECNT ;NEXT ROW DEX BPL MVS1 ;DONE? RTS ; ;SUBROUTINE FACELEFT:CHECKS ;38TH BYTE OF EACH PLAYFIELD ;LINE TO SEE IF CHARACTER IN ;THAT BYTE IS FRONT VIEW OF ;TROLL.IF IT IS THEN THE TROLL ;DRAWING IS REPLACED WITH ;DRAWING OF TROLL FACING LEFT ; FACELEFT LDY #38 ;BYTE 38 LDA (TEMP12),Y ;TEMP12 HOLDS CURRENT LINE CMP #5 ;FRONT VIEW OF TROLL BNE EXIT20 ;NO,EXIT LDA #9 ;CHAR,RIGHT HALF OF TROLL FACING LEFT PLACE STA (TEMP12),Y LDA #8 ;CHAR LEFT HALF OF TROLL DEY STA (TEMP12),Y EXIT20 RTS ; ;SUBROUTINE MOVCRQ:MOVES ;TROLL CHARACTER LEFT ;ONE BYTE AND CHANGES DRAWING ;OR DOES NOT MOVE TROLL BUT ;CHANGES DRAWING. ;ALSO CHECKS TO SEE WHAT ;(IF ANY) IS IN FRONT OF ;TROLL ;DRAWING OF TROLL IS TWO BYTES ;CHARACTER 8&9 OR CHAR 6&7. ;IF CURRENT TROLL DRAWING IS ;CHAR 6&7 THEN TROL DRAWING ;IS CHANGED TO CHAR 8&9. ;IF CURRENT DRAWING IS ;CHAR 8&9 THEN DRAWING IS ;CHANGED TO CHAR 6&7 AND TROLL ;IS MOVE LEFT ONE BYTE. ; MOVCRQ LDY #2 ;PLAYFLD BYTE TO START AT RF1Q LDA (TEMP12),Y ;LOAD BYTE CMP #7 ;TROLL CHARACTER? BNE RF2Q ;IF NE CMP WITH OTHER CHAR LDA #9 ;ELSE,LDA NEW TROLL DRAWING STA (TEMP12),Y ;SAVE DEY LDA #8 ;OTHER HALF OF TROLL STA (TEMP12),Y ;SAVE INY ;RESET POINTER JMP RF4Q ;GET NEXT BYTE OF LINE RF2Q CMP #9 ;TROLL CHARACTER? BEQ TRL9 ;IF NO THEN GET NEXT BYTE JMP RF4Q TRL9 DEY ;MOVE POINTER TO FIND DEY ;BYTE (CHARACTER) IN FRONT OF TROLL LDA (TEMP12),Y ;LOAD BYTE BEQ RFR3 ;IF = MOVE TROLL CMP #17 ;IS CHARACTER IN BEQ GEM ;FRONT OF TROLL A CMP #18 ;GEM CHARACTER? BEQ GEM ;IF YES HAVE TROLL TAKE GEM CMP #5 ;ELSE IS CHARACTER ANOTHER TROLL? BEQ DISTRL ;IF YES THEN DISPLAY TROLL INY ;RESTORE POINTER INY JMP RF4Q ;GET NEXT BYTE DISTRL TYA ;TEMPORARY SAVE POINTER TAX DEC TEMP13 ;SET POINTER FOR DEC TEMP13 ;POSITION WHERE LDY TEMP13 ;TROLL IS PLACED ON LOWEST PLAYFLD LINE CPY #1 ;IS THAT POINTER BYTE 1? DONE2 BNE NONE2 ;IF IT IS BYTE 1 DONE21 LDA #14 ;THEN HAVE TROLL STA LEV7,Y ;DISTROY GEM IN LOWER LDA #13 ;LEFT CORNER OF PLAYFLD DEY STA LEV7,Y LDA #1 STA GAMEOVER LDA #30 STA SD2 JSR GOVER JMP START ;IF YES RESET GAME NONE2 LDA #5 ;IF BYTE # <> 1 STA LEV7,Y ;THEN DISPLAY DEY ;ANOTHER TROLL LDA #4 ;ON LOWEST LINE STA LEV7,Y ;OF PLAYFLD TXA ;RESTORE POINTER TAY JMP REMTRL ;REMOVE OLD TROLL DRAWING GEM LDA #5 ;IF CHAR IN FRONT OF TROLL STA (TEMP12),Y ;IS A GEM CHAR DEY ;THEN REPLACE GEM WITH LDA #4 ;FRONT VIEW OF TROLL STA (TEMP12),Y INY REMTRL INY ;SET POINTER SO TROLL LDA #0 ;DRAWING IS REMOVED STA (TEMP12),Y INY STA (TEMP12),Y JMP RF4Q ;NEXT BYTE RFR3 LDA #6 ;LEFT HALF DRAWING STA (TEMP12),Y ;NEW POSITION INY ;MOVE POINTER RIGHT LDA #7 ;RIGHT HALF OF DRAWING STA (TEMP12),Y ;NEW POS INY ;MOVE POINTER RIGHT LDA #0 ;REMOVE OLD DRAWING STA (TEMP12),Y RF4Q INY ;NEXT BYTE OF LINE CPY #39 ;ALL BYTES CHECKED? BCS RF11 ;IF YES EXIT JMP RF1Q ;ELSE CHECK NEW BYTE RF11 RTS ; ;SUBROUTINE EGG:CHECKS 37TH ;BYTE OF EACH PLAYFIELD ;LINE TO SEE IF IT IS A ;CHARACTER THAT DEVELOPS ;INTO A TROLL CHARACTER ;TROLL FORMS OUT OF CHARACTER ;1,2,&3.FRONT VIEW OF TROLL ;IS CHARACTER 4&5. ; EGG LDY #37 ;SET POINTER TO BYTE 37 LDA (TEMP12),Y ;TEMP12 HOLDS ADDRESS OF LINE CMP #1 ;STARTING CHAR OF TROLL BNE RF5 LDA #2 ;NEXT CHAR OF TROLL SEQUENCE STA (TEMP12),Y RTS RF5 CMP #2 ;CONTINUE TO FORM TROLL BNE RF7 LDA #3 ;3RD CHAR OF TROLL SEQUENCE STA (TEMP12),Y RTS RF7 CMP #3 ;CONTINUE TO FORM TROLL BNE RF6 INY LDA (TEMP12),Y BEQ RS RTS RS LDA #5 ;RIGHT HALF OF TROLL,FRONT VIEW STA (TEMP12),Y DEY LDA #4 ;LEFT HALF OF TROLL STA (TEMP12),Y RF6 RTS ; ;SUBROUTINE TROLL:EVALUATES ;TABLE VALUE THAT REPRESENTS ;DELAY BEFORE TROLL IS FORMED, ;TURNED LEFT,AND MOVED. ; TROLL LDX #15 ;# OF PLAYFLD ROWS-1 OO1 LDA TABLE1,X ;LOAD DELAY CMP #255 ;IF < 255 ADD 1 TO BCC OO2 ; DELAY AND GET NEXT LINE JSR MOVCRQ ;MOVE TROLL JSR FACELEFT ;TURN TROLL LEFT JSR EGG ;START TROLL FORMING LDA TABLE6,X ;RESET DELAY STA TABLE1,X CMP #253 ;253 IS LEAST AMOUNT OF DELAY BCS OO2 ;GET NEXT LINE INC TABLE6,X ;SPEED UP DELAY OO2 INC TABLE1,X JSR LINECNT ;SET TEMP12 TO NEXT LINE DEX ;DONE CHECKING LINES? BPL OO1 ;IF<0 THEN DONE RTS ; ;SUBROUTINE DISPEGG:EVALUATES ;TABLE VALUE THAT REPRESENTS ;DELAY BEFORE CHARACTER ;THAT FORMS INTO A TROLL ;WILL APPEAR ; DISPEGG LDX #15 ;# OF ROWS -1 LDY #37 ;BYTE WHERE TROLL APPEARS OO5 LDA TABLE3,X ;CHECK DELAY BNE OO6 ;IF HIGH&LOW TABLE BYTES LDA TABLE2,X ;ARE ZERO THEN BEQ OO7 ;FORM TROLL OO6 SEC ;ELSE DEC DELAY LDA TABLE2,X SBC #1 STA TABLE2,X LDA TABLE3,X SBC #0 STA TABLE3,X JMP OO4 OO7 LDA (TEMP12),Y ;IS TROLL ALREADY DISPLAYED BNE OO4 ;IF YES THEN GET NEXT LINE LDA #15 ;ELSE RESET TABLE STA TABLE2,X LDA TABLE5,X STA TABLE3,X LDA #1 ;DISPLAY START OF TROLL STA (TEMP12),Y OO4 JSR LINECNT ;NEXT LINE DEX ;16 LINES CHECKED? BPL OO5 RTS ; MOVMIS LDA $D009 ;IS MISS 1 TOUCHING PLAYER3 CMP #8 ;IF 8OR> THEN YES BCC NM1 JMP NM3 NM1 LDA $D00B ;IS MISS 2 TOUCHING PLAYER3 CMP #8 BCC NM2 NM3 LDA #90 ;LOAD LENGHT OF DELAY STA GUNFLAG ;STORE TO FREEZE GUN LDA #78 ;CHANGE COLOR OF GUN STA $02C3 NM2 LDA SCOUNT ;IF SCORE>70 THEN MOVE GHOST CMP #70 BCC MEXIT DEC P5 ;SET NEW POS OF MISILE DEC P5 ;AND SAVE LDA P5 STA HPOSM1 DEC P7 DEC P7 LDA P7 STA HPOSM3 DEC P6 DEC P6 LDA P6 STA HPOSM2 DEC P4 DEC P4 LDA P4 STA HPOSM0 CMP #10 BCS MEXIT JSR GHOSTM MEXIT RTS ; ;SUBROUTINE GOVER:USED AT ;END OF GAME.PRINTS OUT MESSAGE ;"GAME OVER" AND CHECKS TO ;SEE IF START KEY IS PRESSED. ; GOVER LDA #>LEV2 ;LOAD ADDRESS OF STA TEMP12+1 ;LINE WHERE MESSAGE LDA #<LEV2 ;IS TO PRINT STA TEMP12 LDY #39 ;# OF BYTES-1 PER ROW LDA #0 ;ZERO TO CLEAR ROW GV1 STA (TEMP12),Y ;CLEAR ROW LDA #0 DEY CPY #3 BNE GV1 LDA #42 ;SET COLOR PLFD3 STA $02C7 LDY #29 ;DISPLAY RIGHT TROLL LDA #5 STA (TEMP12),Y DEY LDA #4 STA (TEMP12),Y DEY LDA #9 ;DISPLAY TROLL THAT WALKS STA (TEMP12),Y ;AND PRINTS MESSASE DEY LDA #8 STA (TEMP12),Y LDA #14 ;POINTER TO LETTER OF STA TEMP1 ;MESSAGE GV2 LDY #11 ;CHECK TO SEE IF LDA (TEMP12),Y ;MESSAGE IS DONE BNE GV5 ;IF <> THEN DONE JSR DELAY ;ELSE DELAY JSR MOVCRQ ;MOVE TROLL LEFT LDY #11 ;CHECK TO SEE IF GV3 LDA (TEMP12),Y ;TROLL HAS MOVED CMP #6 ;IF CHAR 6 THEN TROLL MOVED BEQ GV4 ;SO IF EQ PRINT MESSAGE INY CPY #26 ;CHECK ROW THAT MESSAGE IS PRINTED BNE GV3 ;IN ORDER TO FIND A TROLL JMP GV2 GV4 LDX TEMP1 ;LOAD POINTER TO MESSAGE LETTER LDA SCR7,X ;GET LETTER STA LEV2+13,X ;DISPLAY DEC TEMP1 ;NEXT LETTER JMP GV2 GV5 LDA #4 ;IF MESSAGE DONE STA (TEMP12),Y ;PRINT FRONT TROLL INY ;AT THE FAR LEFT LDA #5 STA (TEMP12),Y GV0 DEC $02C7 LDA $D01F ;IS START KEY PRESSED CMP #6 BEQ GEXIT JMP GV0 GEXIT RTS ; ;SUBROUTINE DELAY ; DELAY LDX #255 D1 LDY #255 D2 DEY BNE D2 DEX BNE D1 RTS ; ;MAIN PROGRAM START1:DISPLAYS ;STARTING MESSAGE ,WALKING TROLL ;,AND GAME TITLE ; START1 LDA $02F4 ;SAVE CHAR BASE ADDRESS STA TR LDA #>CHAR ;STORE REDEFINED STA $02F4 ;CHAR BASE ADDRESS STA CHBASE JSR ZEROSC ;CLEAR SCREEN JSR INITIAL LDX #59 LDA #0 ST10 STA SCR4,X ;CLEAR SCORE SCREEN DEX BPL ST10 LDX #39 ST6 LDA SCR6,X ;DISPLAY MESSAGE STA LEV2,X DEX BPL ST6 LDA #14 ;COLOR WHITE STA $02C7 ST7 DEC $02C7 ;FADE MESSAGE JSR DELAY LDA $02C7 ;MESSAGE GONE? BNE ST7 JSR ZEROSC LDY #35 ;SET POINTER FOR DISPLAYING LDA #6 ;TROLL STA LEV1,Y INY LDA #7 STA LEV1,Y LDA #>LEV1 ;SET TEMP12 TO STA TEMP12+1 ;LINE WHERE LDA #<LEV1 ;TROLL WALKS STA TEMP12 ST JSR MOVCRQ ;MOVE TROLL JSR DELAY LDY #19 LDA (TEMP12),Y ;IS TROLL AT LINE BEQ ST ;BYTE 19? LDA #4 ;IF YES THEN DISPLAY STA (TEMP12),Y ;FRONT VIEW OF TROLL LDA #5 INY STA (TEMP12),Y JSR DELAY JSR DELAY LDA #42 ;COLOR ORANGE STA $02C7 LDX #39 ;DISPLAY "TROLL WAR" ST9 LDA SCR52,X ;READ IN LETTER STA SCR5,X ;DISPLAY LETTER DEX BPL ST9 JSR DELAY JSR DELAY JSR DELAY JSR DELAY LDA #4 ;BUILD REMAINING STA SCR5+7 ;PICTURES (OF TOLLS) STA SCR5+17 ;THAT ARE DISPLAYED STA SCR5+21 ;AT TOP OF SCREEN STA SCR5+28 LDA #5 STA SCR5+8 STA SCR5+18 STA SCR5+22 STA SCR5+29 LDA #20 STA SCR5+19 LDA #21 STA SCR5+20 LDX #19 ST8 LDA SCR42,X ;READ IN "SCORE00000" STA SCR4,X ;SAVE/DISPLAY DEX BPL ST8 ; ;SUBROUTINE START:JUMPS ;TO SUBROUTINES TO INITIALIZE ; GAME ; START JSR SETTBL6 JSR INITIAL JSR ZEROSC JSR JS15 JSR GHOSTM LDA #7 LDX #>VBROUTIN LDY #<VBROUTIN JSR $E45C JSR ORGIN JSR WALL JSR PLAYERS ; ;MAIN LOOP :CONTROLS PLAY ;OF GAME. MAINLOOP LDA #0 STA 77 INC $02C7 ;CHANGE COLOR OF MISSILE GHOST JSR ORGIN JSR TROLL JSR DISPEGG LDA SCOUNT CMP #131 BCC MN1 JSR DISPEGG LDA SCOUNT CMP #160 BCC MN1 JSR DISPEGG MN1 JSR MOVEMIS LDA TIMER2 ;TIMER1&2 ARE DELAYS CMP #2 ;BEFORE TROLL APPEARS,IF=2 BCC NOSH ;THEN SPEED UP APPEARANCE LDX #15 ;BY SHIFTING VALUE OO8 LSR TABLE3,X ;OF TABLE3 RIGHT DEX ;ONE BIT BPL OO8 LDA #0 ;RESET TIMERS STA TIMER1 STA TIMER2 NOSH JMP MAINLOOP ; ;MISC WORKSPACE ; SCR1 .DS 40 LEV9 .DS 40 LEV0 .DS 80 LEV1 .DS 240 LEV2 .DS 240 LEV3 .DS 80 ENDSC .DS 40 LEV7 .DS 40 LEV8 .DS 80 LEV4 .DS 80 TABLE1 .DS 16 TABLE6 .DS 16 TABLE2 .DS 16 TABLE3 .DS 16 SCR4 .DS 20 SCR5 .DS 40 ; *= $02E0 .WORD START1