A.N.A.L.O.G. ISSUE 52 / MARCH 1987 / PAGE 27
After five years of writing educational, tutorial and utility software, I have finally blown a gasket. This time, we’re going to blast something! No matter how expert a programmer you are perfecting your work requires a certain amount of debugging It is an infuriating trial-and-error process of “fixing,” running and crashing your programs. After a great deal of research I have developed a rather unusual “debugging tool.”
Deep within your Atari there are 200 bugs, just waiting to fly across the data bus into the microprocessor’s “power matrix” and crash the system. Rambug II places two electrodes across the pulsating matrix in the form of horizontal “charging plates”—one above and one below. As the bugs fly across the power matrix, you must center the electrodes over the little crashers (with a joystick in port 1) and annihilate them with the flash of a lightning bolt (fire button).
Your electrodes draw their power from the matrix—a limited supply—beginning each game with 2000 watts of energy. There are twenty rounds of ten bugs each to complete the game. (Yes, it’s possible to finish.) Use your powerful lightning bolt sparingly to make it to the end. Your electrodes are fragile, like the filament of a light bulb. Should a bug hit one when it’s not energized, the electrodes will short out and disintegrate.
Fortunately, you have five of these “debuggers.” If a bug approaches an electrode from the side, protect yourself by pressing the fire button just before it gets there. You can also blast several bugs at a time as they cross paths within your field of fire. If a bug successfully crosses the power matrix, he makes his way into your CPU and destroys one of your spare electrodes. If all your electrodes are destroyed, or you run out of power, then the bug’s “crash run” was successful, and the game ends.
Listing 1 is the BASIC data used to create your copy of Rambug II. Please refer to the M/L Editor on page 19 for typing instructions.
When run, Rambug II first checks for a file called D:RAMBHI. If found, it loads the all-time high score data and displays it on the title screen. Press START to continue. At the second screen, press SELECT for one of three difficulty levels. This adjusts the width of your electrodes and lightning bolt. The bugs at higher difficulty levels fly faster and are worth more points when zapped. The ultimate goal of Rambug II is to obliterate all 200 bugs in your computer, with power to spare—no small task.
While playing the game, your POWER and BUG counts are updated frequently. Your “debugger” count (remaining electrodes) is displayed in place of SCORE during game play. Each ROUND number is displayed, along with the current power rating, such as MILLIwatts or MEGAwatts. Dead bugs fill the power matrix as you blast away.
Pressing START will end the game early, thus admitting your defeat by the bugs. The SPACE BAR may be pressed to pause and to continue the game. Bonuses are awarded for rounds where all ten bugs are converted to nuclear dust. Your final score is based on surplus matrix power, bonuses, difficulty level and total bugs wasted. If you last long enough, at the end of the twentieth round you’ve finished the game and foiled the bugs’ crash attempts. The final score and overall high score are computed and displayed.
If you get a new all-time high score, you will be prompted to enter your name for the record books. Your new high score, bug count, surplus power and name are then written to disk. At the end of the game, you’re usually returned to the “Select” screen. If it was a high-scoring game, the original title screen is displayed for all to see who the new Master Bug Blaster is. The next time Rambug II is booted, this score will be loaded and displayed again.
If any disk I/O error occurs during a read or write, the file is closed, and the high score data is zeroed out in memory. This will be the case the first time you play the game, since D:RAMBHI won’t be there. The file will be created after your first game. Now, when you blast 200 bugs, with 500 watts to spare, you will have proof positive—and a goal for others to meet or beat.
The next time you’re burning the midnight oil, trying to work out that final nasty bug in a program, fire up Rambug II and take revenge on those little beasties! It just may relieve some of the frustration that goes with a real debugging task. If you don’t program, nuking bugs can be great fun anyway. Should you not blast all the bugs, that’s okay. There are always more to squash with Rambug II.
I would like to thank Dave Miller, SYSOP of M.I.C.E. BBS (314-355-3403) in St. Louis, for his assistance with the graphics, sound effects and playability development of this game. The power ratings go up in each round of the game. Not all are valid prefixes; can you find them? These “bogus” wattage levels in Rambug II are the names of several well known St. Louis area SYSOPS, but you have to be a great “debugger” to see them.
1000 DATA 255,255,0,80,80,80,112,112,70,21,80,7,7,128,7,7,8549 1010 DATA 7,7,7,7,7,7,7,7,65,0,80,115, 99,111,114,101,274 1020 DATA 0,16,16,16,16,16,0,232,233,0 ,16,16,16,16,16,176,9149 1030 DATA 175,183,178,26,0,0,153,153,1 53,0,97,116,116,111,119,97,4739 1040 DATA 116,116,115,226,245,231,243, 26,0,0,144,144,144,0,50,47,3843 1050 DATA 53,46,36,26,0,144,145,25,81, 215,97,0,0,0,0,0,7432 1060 DATA 178,161,173,162,181,167,128, 128,169,169,0,0,0,0,0,0,9765 1070 DATA 0,0,114,97,116,0,97,110,100, 0,109,105,108,108,101,114,3553 1080 DATA 0,0,0,0,99,104,105,101,102,0 ,101,120,116,101,114,109,3587 1090 DATA 105,110,97,116,111,114,115,0 ,51,37,44,37,35,52,0,100,8754 1100 DATA 105,102,102,105,99,117,108,1 16,121,0,0,0,0,0,0,243,9993 1110 DATA 244,225,242,244,0,111,114,0, 230,233,242,229,0,0,0,0,4780 1120 DATA 0,0,34,37,39,41,46,0,36,37,3 4,53,39,39,41,46,6241 1130 DATA 39,0,0,119,114,105,116,105,1 10,103,0,238,229,247,0,40,6448 1140 DATA 41,0,179,163,175,178,165,0,9 7,116,116,111,102,101,109,116,6340 1150 DATA 111,0,112,105,99,111,0,110,9 7,110,111,109,105,99,114,111,4797 1160 DATA 109,105,108,108,105,99,101,1 10,116,105,0,100,101,99,105,112,4301 1170 DATA 108,97,110,111,0,100,101,107 ,97,104,101,99,116,111,0,107,3395 1180 DATA 105,108,111,0,109,101,103,97 ,0,103,105,103,97,0,116,101,2520 1190 DATA 114,97,100,97,110,110,111,10 6,105,109,98,111,110,97,102,105,5464 1200 DATA 101,100,97,118,105,101,109,9 7,116,116,111,114,97,116,116,111,6128 1210 DATA 78,174,206,238,66,132,52,196 ,70,6,198,134,65,1,193,129,6554 1220 DATA 0,81,74,42,44,127,60,0,128,2 24,113,58,7,248,112,8,3876 1230 DATA 0,0,16,121,198,251,112,16,1, 6,206,172,48,28,38,65,2195 1240 DATA 0,0,198,175,48,28,39,16,0,0, 0,0,0,162,181,173,1094 1250 DATA 162,172,165,128,166,169,174, 167,165,178,179,0,0,0,0,0,2395 1260 DATA 176,178,175,128,165,184,180, 165,178,173,169,174,161,180,175,178,47 03 1270 DATA 0,0,0,173,161,179,180,165,17 8,128,162,181,167,128,162,172,2402 1280 DATA 161,179,180,165,178,0,1,14,1 28,8,6,14,136,8,12,13,7742 1290 DATA 137,9,18,13,149,9,24,13,148, 10,30,12,144,10,36,12,7272 1300 DATA 164,10,42,11,168,11,48,11,16 4,11,54,11,175,11,60,10,8785 1310 DATA 166,12,66,10,164,12,72,10,18 2,13,78,9,174,13,84,9,9796 1320 DATA 173,13,90,8,176,14,96,8,190, 14,102,8,185,14,108,7,922 1330 DATA 194,15,114,7,186,15,120,7,19 1,16,0,0,0,0,112,112,9191 1340 DATA 71,248,82,0,7,0,7,0,7,0,2,11 2,7,0,7,0,3862 1350 DATA 7,0,7,0,7,112,2,65,220,82,0, 0,0,0,33,14,6138 1360 DATA 46,14,33,14,44,14,47,14,39,1 4,0,0,0,0,0,0,2825 1370 DATA 0,0,0,99,111,109,112,117,116 ,105,110,103,0,0,0,0,9235 1380 DATA 0,0,0,0,0,0,0,0,240,242,229, 243,229,238,244,243,5252 1390 DATA 0,0,0,0,0,0,0,0,0,0,0,242,22 5,237,226,245,7847 1400 DATA 231,128,128,233,233,0,0,0,0, 0,0,34,121,0,45,97,8576 1410 DATA 116,10,50,97,116,0,13,0,119, 105,116,104,0,36,97,118,1247 1420 DATA 101,0,45,14,41,14,35,14,37,1 4,0,45,105,108,108,101,9484 1430 DATA 114,0,116,104,101,0,98,101,1 15,116,0,98,117,103,0,107,2353 1440 DATA 105,108,108,101,114,0,0,0,0, 0,0,0,0,0,0,0,3059 1450 DATA 0,0,0,0,0,0,0,0,0,0,40,41,39 ,40,37,51,4820 1460 DATA 52,0,51,35,47,50,37,26,0,0,0 ,0,0,0,98,117,6149 1470 DATA 103,115,0,98,108,97,115,116, 101,100,0,26,0,0,0,0,7271 1480 DATA 0,0,51,53,50,48,44,53,51,0,4 8,47,55,37,50,26,7065 1490 DATA 0,0,0,0,0,0,0,0,0,0,48,114,1 01,115,115,0,8034 1500 DATA 59,51,52,33,50,52,61,0,116,1 11,0,46,53,43,37,0,7490 1510 DATA 115,111,109,101,0,98,117,103 ,115,1,0,0,0,0,68,58,7802 1520 DATA 82,65,77,66,72,73,0,169,4,32 ,157,84,16,17,169,0,449 1530 DATA 141,120,95,141,121,95,133,20 4,133,200,133,201,76,168,85,32,8697 1540 DATA 201,84,48,234,141,120,95,32, 201,84,48,226,141,121,95,32,6688 1550 DATA 201,84,48,218,133,200,32,201 ,84,48,211,133,201,32,201,84,9205 1560 DATA 48,204,133,204,169,7,32,129, 84,76,168,85,169,8,32,157,5059 1570 DATA 84,16,3,76,168,85,172,120,95 ,32,196,84,48,245,172,121,8422 1580 DATA 95,32,196,84,48,237,164,200, 32,196,84,48,230,164,201,32,9634 1590 DATA 196,84,48,223,164,204,32,196 ,84,48,216,169,11,32,129,84,6336 1600 DATA 76,168,85,162,16,157,66,3,16 9,0,157,73,3,169,20,157,3764 1610 DATA 72,3,169,132,157,68,3,169,83 ,157,69,3,76,86,228,72,5165 1620 DATA 32,168,85,104,157,74,3,169,0 ,157,75,3,157,73,3,169,3504 1630 DATA 252,157,68,3,169,83,157,69,3 ,169,8,157,72,3,169,3,2656 1640 DATA 157,66,3,76,86,228,169,11,76 ,203,84,169,7,162,16,157,6088 1650 DATA 66,3,169,0,157,72,3,157,73,3 ,152,76,86,228,169,18,5127 1660 DATA 32,101,86,169,2,133,248,169, 4,141,198,2,169,132,141,196,9668 1670 DATA 2,169,220,160,82,166,20,228, 20,240,252,141,48,2,140,49,7260 1680 DATA 2,169,248,133,88,169,82,133, 89,169,0,133,241,32,5,84,5475 1690 DATA 169,166,133,196,169,83,133,1 97,173,120,95,174,121,95,32,120,8417 1700 DATA 90,169,186,133,196,169,83,13 3,197,165,204,162,0,32,120,90,8156 1710 DATA 169,206,133,196,169,83,133,1 97,165,200,166,201,32,120,90,162,1085 1720 DATA 15,173,11,212,201,38,208,249 ,189,178,85,141,10,212,141,25,9364 1730 DATA 208,202,16,244,173,196,2,141 ,25,208,162,15,173,193,85,72,8194 1740 DATA 160,14,185,178,85,157,178,85 ,202,136,16,246,104,141,178,85,150 1750 DATA 160,16,162,255,173,31,208,20 1,7,208,9,202,208,246,136,208,3745 1760 DATA 243,76,61,85,169,132,133,192 ,169,82,133,193,32,57,91,160,8041 1770 DATA 0,177,192,208,247,162,255,17 3,31,208,201,7,208,230,202,208,5844 1780 DATA 246,169,0,133,204,133,200,13 3,201,96,162,16,169,12,157,66,7697 1790 DATA 3,76,86,228,10,26,42,58,74,9 0,106,122,138,154,170,186,7751 1800 DATA 202,218,234,250,169,18,32,10 1,86,162,3,189,18,82,157,196,7693 1810 DATA 2,202,16,247,169,0,160,80,16 6,20,228,20,240,252,141,48,9830 1820 DATA 2,140,49,2,169,170,141,0,2,1 69,91,141,1,2,169,192,5158 1830 DATA 141,14,212,169,21,133,88,169 ,80,133,89,173,100,86,208,12,7103 1840 DATA 173,36,2,141,99,86,173,37,2, 141,100,86,169,192,141,36,6309 1850 DATA 2,169,91,141,37,2,32,217,86, 162,0,134,196,134,198,162,9172 1860 DATA 64,134,199,174,244,2,134,197 ,162,2,160,0,177,196,145,198,857 1870 DATA 200,208,249,230,197,230,199, 202,208,242,162,0,189,30,82,157,2220 1880 DATA 8,64,232,224,40,208,245,169, 64,141,244,2,162,7,173,10,7776 1890 DATA 210,41,60,157,48,64,202,16,2 45,169,216,133,192,169,82,133,1243 1900 DATA 193,96,83,58,0,0,0,72,162,96 ,169,12,157,66,3,32,1285 1910 DATA 86,228,162,96,169,3,157,66,3 ,169,96,157,68,3,169,86,5306 1920 DATA 157,69,3,104,157,75,3,41,240 ,73,16,9,12,157,74,3,910 1930 DATA 32,86,228,96,166,242,169,165 ,133,196,169,81,133,197,202,240,5332 1940 DATA 14,24,169,5,101,196,133,196, 144,2,230,197,202,16,242,162,1991 1950 DATA 5,160,0,177,196,153,51,80,20 0,202,208,247,165,242,160,0,2883 1960 DATA 56,233,10,144,4,200,76,190,8 6,105,10,72,152,24,105,144,5349 1970 DATA 141,79,80,104,24,105,144,141 ,80,80,96,162,0,160,0,185,5531 1980 DATA 22,82,157,81,80,200,192,4,20 8,2,160,0,232,224,200,208,2069 1990 DATA 238,96,162,0,169,0,157,81,80 ,232,224,200,208,248,96,173,3786 2000 DATA 10,210,41,7,170,173,10,210,4 1,24,157,48,64,96,165,244,7686 2010 DATA 162,0,157,4,208,24,105,2,232 ,224,4,208,245,96,165,249,2450 2020 DATA 240,3,198,249,96,169,48,141, 66,67,160,0,24,174,10,210,6096 2030 DATA 48,4,42,42,144,4,106,106,176 ,248,133,250,25,65,67,153,7929 2040 DATA 66,67,200,192,157,240,10,165 ,250,153,66,67,200,192,157,208,3504 2050 DATA 220,169,196,141,5,210,173,10 ,210,9,192,141,4,210,169,2,7679 2060 DATA 133,249,96,169,0,160,0,153,6 6,67,200,192,157,208,248,141,2536 2070 DATA 5,210,141,4,210,96,206,41,88 ,198,205,32,59,88,32,114,6044 2080 DATA 94,169,0,174,213,97,149,222, 157,0,208,173,21,87,141,241,913 2090 DATA 87,169,10,141,21,87,165,244, 141,242,87,162,156,173,10,210,1393 2100 DATA 157,66,67,141,10,212,142,243 ,87,173,10,210,41,15,133,244,9199 2110 DATA 173,242,87,56,229,244,133,24 4,32,12,87,174,243,87,206,21,0 2120 DATA 87,208,5,169,10,141,21,87,20 2,208,210,161,192,208,204,174,4445 2130 DATA 243,87,140,243,87,32,97,87,1 72,243,87,173,241,87,141,21,9754 2140 DATA 87,173,242,87,133,244,32,12, 87,173,212,97,174,213,97,141,1060 2150 DATA 30,208,96,0,0,0,169,17,160,8 8,76,255,87,169,29,160,6911 2160 DATA 88,133,196,132,197,160,0,162 ,12,177,196,153,21,80,200,202,366 2170 DATA 208,247,96,115,99,111,114,10 1,0,0,0,0,0,0,0,100,7987 2180 DATA 101,98,117,103,103,101,114,1 15,0,0,0,0,16,17,18,19,7099 2190 DATA 20,21,22,174,41,88,189,42,88 ,141,31,80,96,169,7,141,4884 2200 DATA 144,88,169,255,141,252,2,160 ,0,132,195,169,170,141,5,210,670 2210 DATA 141,7,210,185,146,88,141,145 ,88,200,185,146,88,200,141,4,9842 2220 DATA 210,56,233,2,141,6,210,162,2 55,202,208,253,206,145,88,208,5751 2230 DATA 248,169,0,141,4,210,141,5,21 0,141,6,210,141,7,210,169,9358 2240 DATA 37,141,145,88,202,208,253,20 6,145,88,208,248,206,144,88,208,5814 2250 DATA 186,96,0,0,40,255,70,255,70, 253,170,255,150,217,100,255,5546 2260 DATA 200,191,161,162,163,164,165, 166,167,168,169,170,171,172,173,174,53 47 2270 DATA 175,176,177,178,179,180,181, 182,183,184,185,186,255,254,0,63,4371 2280 DATA 21,18,58,42,56,61,57,13,1,5, 0,37,35,8,10,47,5800 2290 DATA 40,62,45,11,16,46,22,43,23,1 2,52,33,110,101,119,0,9411 2300 DATA 104,105,13,229,238,244,229,2 42,128,238,225,237,229,142,0,0,3578 2310 DATA 32,59,88,32,114,94,32,240,86 ,169,0,133,241,133,195,169,814 2320 DATA 218,160,88,162,2,32,91,93,16 2,19,169,0,157,132,83,202,7226 2330 DATA 16,250,169,141,133,196,169,8 0,133,197,169,0,133,198,173,24,87 2340 DATA 82,160,0,145,196,173,252,2,2 01,255,240,249,141,161,89,32,3041 2350 DATA 162,89,162,28,169,255,141,25 2,2,173,161,89,160,0,221,189,1672 2360 DATA 88,240,6,202,16,248,76,35,89 ,189,160,88,201,255,240,23,1792 2370 DATA 201,254,240,19,145,196,230,1 96,208,2,230,197,230,198,165,198,7145 2380 DATA 201,20,208,186,76,139,89,201 ,255,208,7,169,0,145,196,76,100 2390 DATA 139,89,201,254,208,175,165,1 98,240,164,198,198,169,0,145,196,5017 2400 DATA 198,196,165,196,201,255,208, 2,198,197,76,28,89,162,19,189,9934 2410 DATA 141,80,157,132,83,202,16,247 ,169,255,141,102,88,169,37,141,592 2420 DATA 126,88,96,0,169,60,141,6,210 ,169,64,141,4,210,169,170,9473 2430 DATA 141,5,210,141,7,210,162,255, 160,47,202,208,253,136,208,250,7185 2440 DATA 169,0,141,6,210,141,4,210,14 1,7,210,141,5,210,96,169,9150 2450 DATA 46,133,196,169,80,133,197,16 5,200,166,201,32,120,90,169,66,389 2460 DATA 133,196,169,80,133,197,165,2 04,162,0,32,120,90,96,142,118,8228 2470 DATA 90,140,119,90,169,0,141,14,9 0,169,68,141,15,90,224,0,5256 2480 DATA 240,9,238,15,90,202,208,250, 174,118,90,160,255,169,0,153,2415 2490 DATA 0,68,136,16,250,173,10,210,1 06,106,41,128,149,214,173,10,8825 2500 DATA 210,41,15,208,2,169,1,149,20 6,21,214,149,214,41,128,208,702 2510 DATA 4,169,37,208,2,169,207,149,2 22,173,10,210,106,106,41,128,9343 2520 DATA 149,218,173,10,210,41,15,149 ,210,21,218,149,218,173,10,210,1309 2530 DATA 201,67,176,4,169,67,208,6,20 1,209,144,2,169,209,149,226,2641 2540 DATA 169,21,24,229,242,10,10,10,1 0,149,237,173,10,210,41,31,5603 2550 DATA 21,237,149,237,172,119,90,96 ,0,0,141,221,90,142,222,90,9543 2560 DATA 160,0,140,223,90,162,0,173,2 21,90,56,249,213,90,141,221,3011 2570 DATA 90,173,222,90,200,249,213,90 ,144,8,141,222,90,232,136,76,2002 2580 DATA 133,90,136,173,221,90,121,21 3,90,141,221,90,138,240,3,238,2927 2590 DATA 223,90,174,223,90,208,4,169, 0,240,2,9,144,162,0,129,6219 2600 DATA 196,230,196,208,2,230,197,20 0,200,192,8,144,184,173,221,90,4150 2610 DATA 9,144,162,0,129,196,96,16,39 ,232,3,100,0,10,0,0,58 2620 DATA 0,0,169,3,141,29,208,169,33, 141,111,2,169,62,141,47,5710 2630 DATA 2,162,3,189,14,82,157,192,2, 202,16,247,162,3,169,0,6779 2640 DATA 157,8,208,202,16,250,169,64, 141,7,212,169,0,168,153,0,7866 2650 DATA 67,153,0,68,153,0,69,153,0,7 0,153,0,71,200,208,238,8801 2660 DATA 169,114,133,244,32,12,87,169 ,255,141,64,67,141,65,67,141,7842 2670 DATA 224,67,141,223,67,169,0,141, 12,208,96,164,248,240,3,198,1829 2680 DATA 248,96,177,192,240,35,141,0, 210,32,118,91,177,192,141,1,8536 2690 DATA 210,32,118,91,177,192,141,2, 210,32,118,91,177,192,141,3,8474 2700 DATA 210,32,118,91,169,2,133,248, 96,169,0,141,0,210,141,1,6781 2710 DATA 210,141,2,210,141,3,210,96,2 30,192,208,2,230,193,96,169,3147 2720 DATA 6,133,252,165,242,41,3,168,1 85,26,82,141,168,91,164,251,1682 2730 DATA 169,200,56,233,20,136,208,25 0,164,242,136,140,169,91,24,109,1418 2740 DATA 169,91,168,173,168,91,153,81 ,80,96,0,0,72,138,72,162,5612 2750 DATA 3,189,196,2,41,240,9,2,157,2 2,208,202,16,243,104,170,9686 2760 DATA 104,64,133,245,134,246,132,2 47,8,165,241,208,13,162,3,169,1472 2770 DATA 0,157,0,208,202,16,250,76,24 7,91,162,3,181,237,240,2,1634 2780 DATA 214,237,202,16,247,165,252,2 40,13,198,252,173,200,2,208,4,2804 2790 DATA 169,48,208,2,169,0,141,200,2 ,165,195,208,13,133,249,173,1962 2800 DATA 66,67,240,43,32,97,87,76,45, 92,24,165,200,208,7,165,7677 2810 DATA 201,208,3,76,45,92,198,200,1 65,200,201,255,208,2,198,201,5177 2820 DATA 165,201,16,8,169,0,133,200,1 33,201,133,195,32,28,87,32,6478 2830 DATA 57,91,32,253,86,169,0,133,77 ,165,245,166,246,164,247,40,3554 2840 DATA 108,99,86,142,220,92,140,221 ,92,141,222,92,181,222,157,0,1972 2850 DATA 208,169,68,141,123,92,169,0, 141,122,92,224,0,240,9,238,6 2860 DATA 123,92,202,208,250,174,220,9 2,181,230,168,173,122,92,141,198,5185 2870 DATA 92,173,123,92,141,199,92,162 ,7,169,0,153,0,68,200,202,8657 2880 DATA 16,249,174,220,92,173,10,210 ,141,4,210,169,194,141,5,210,1622 2890 DATA 181,214,48,20,173,10,210,42, 144,7,169,24,160,64,76,183,7011 2900 DATA 92,169,16,160,64,76,183,92,1 73,10,210,42,144,7,169,32,6299 2910 DATA 160,64,76,183,92,169,40,160, 64,141,195,92,140,196,92,181,1267 2920 DATA 226,168,162,0,189,16,64,153, 0,68,200,232,224,8,208,244,2393 2930 DATA 174,220,92,181,226,149,230,1 73,222,92,172,221,92,96,0,0,9564 2940 DATA 0,181,237,240,1,96,181,206,2 40,39,214,206,181,214,48,25,2314 2950 DATA 246,222,181,222,201,207,208, 25,169,0,149,222,198,205,173,41,3493 2960 DATA 88,240,78,206,41,88,76,79,93 ,214,222,181,222,201,37,240,4169 2970 DATA 231,181,210,240,37,214,210,1 81,218,48,17,214,226,181,226,201,6815 2980 DATA 60,208,23,181,218,9,128,149, 218,76,56,93,246,226,181,226,4628 2990 DATA 201,224,208,6,181,218,41,127 ,149,218,32,65,92,24,181,210,63 3000 DATA 117,206,208,12,181,214,41,12 7,149,206,181,218,41,127,149,210,3607 3010 DATA 96,169,0,157,0,208,32,59,88, 32,114,94,96,133,196,132,7672 3020 DATA 197,169,81,133,198,169,80,13 3,199,138,168,240,16,24,169,20,9256 3030 DATA 101,198,133,198,144,2,230,19 9,136,208,242,160,0,177,196,145,4276 3040 DATA 198,200,192,20,208,247,232,9 6,32,240,86,169,25,160,81,162,1242 3050 DATA 0,32,91,93,169,45,160,81,162 ,2,32,91,93,169,65,160,6674 3060 DATA 81,32,91,93,169,85,160,81,16 2,5,32,91,93,169,105,160,7635 3070 DATA 81,162,8,32,91,93,169,125,16 0,81,32,91,93,169,6,141,6438 3080 DATA 181,91,32,177,94,173,71,82,2 08,31,169,72,160,82,162,6,7567 3090 DATA 32,91,93,169,255,162,176,160 ,38,132,234,160,25,132,235,160,3432 3100 DATA 49,140,205,94,160,8,76,38,94 ,201,1,208,31,169,92,160,8176 3110 DATA 82,162,6,32,91,93,169,85,162 ,192,160,33,132,234,160,30,9944 3120 DATA 132,235,160,74,140,205,94,16 0,4,76,38,94,169,112,160,82,8185 3130 DATA 162,6,32,91,93,169,0,162,200 ,160,25,132,234,160,37,132,9747 3140 DATA 235,160,99,140,205,94,160,2, 141,12,208,142,70,82,140,21,7152 3150 DATA 87,169,114,32,12,87,173,31,2 08,201,7,208,249,169,0,133,272 3160 DATA 195,173,31,208,201,6,240,35, 201,5,240,8,173,132,2,240,189 3170 DATA 26,76,63,94,169,1,133,195,32 ,114,94,174,71,82,232,224,940 3180 DATA 3,208,2,162,0,142,71,82,76,1 92,93,32,217,86,169,2,6861 3190 DATA 141,181,91,96,165,20,197,20, 208,252,169,132,133,192,169,82,2933 3200 DATA 133,193,96,173,157,94,201,25 5,208,20,173,158,94,201,255,208,6555 3210 DATA 13,165,12,141,157,94,165,13, 141,158,94,76,159,94,32,255,9499 3220 DATA 255,169,123,133,2,169,95,133 ,3,169,2,133,9,169,0,141,5541 3230 DATA 68,2,96,169,208,133,200,169, 7,133,201,96,32,244,87,165,1389 3240 DATA 204,141,118,95,169,0,141,119 ,95,133,195,141,122,95,162,49,9396 3250 DATA 165,204,24,109,118,95,141,11 8,95,144,3,238,119,95,202,208,1841 3260 DATA 239,162,5,24,165,200,109,118 ,95,141,118,95,165,201,109,119,867 3270 DATA 95,141,119,95,202,208,236,16 6,236,240,18,24,173,205,94,109,2905 3280 DATA 118,95,141,118,95,144,3,238, 119,95,202,208,238,169,27,133,2479 3290 DATA 196,169,80,133,197,173,118,9 5,174,119,95,32,120,90,173,119,9709 3300 DATA 95,205,121,95,144,64,208,8,1 73,118,95,205,120,95,144,54,9328 3310 DATA 173,118,95,141,120,95,173,11 9,95,141,121,95,173,120,95,13,8199 3320 DATA 121,95,240,34,169,6,141,181, 91,165,20,197,20,240,252,32,768 3330 DATA 238,88,169,145,160,81,162,5, 32,91,93,32,74,84,169,2,4601 3340 DATA 141,181,91,238,122,95,169,36 ,133,196,169,80,133,197,173,120,2697 3350 DATA 95,174,121,95,32,120,90,96,0 ,0,0,0,0,32,129,94,701 3360 DATA 32,220,84,32,194,85,169,0,13 3,236,133,241,133,251,133,205,5305 3370 DATA 32,224,90,32,205,89,169,114, 133,244,32,12,87,32,101,228,8777 3380 DATA 169,0,141,8,210,169,3,141,15 ,210,32,217,86,169,1,133,8035 3390 DATA 242,169,255,141,215,97,169,0 ,141,118,95,141,119,95,32,186,9658 3400 DATA 94,173,122,95,240,10,169,0,1 33,244,32,12,87,76,126,95,6767 3410 DATA 133,236,133,236,141,200,2,13 3,204,32,134,93,169,5,141,41,8125 3420 DATA 88,32,114,94,160,0,177,192,2 08,252,173,31,208,201,7,208,3483 3430 DATA 240,32,177,94,32,205,89,32,2 51,87,32,49,88,169,1,133,6632 3440 DATA 241,162,3,32,236,89,202,16,2 50,169,9,133,205,173,215,97,2897 3450 DATA 197,234,240,14,56,229,235,14 4,4,197,234,176,2,165,234,141,4136 3460 DATA 215,97,169,0,133,251,169,1,1 33,241,32,146,86,32,205,89,9514 3470 DATA 141,30,208,162,3,164,205,181 ,222,240,3,136,48,23,202,16,9120 3480 DATA 246,162,3,181,222,208,11,32, 236,89,169,0,141,4,210,136,9562 3490 DATA 48,3,202,16,238,169,4,141,21 4,97,165,200,208,7,165,201,3178 3500 DATA 208,3,76,56,97,173,132,2,208 ,7,169,1,133,195,76,152,8473 3510 DATA 96,169,0,133,195,169,4,44,12 0,2,208,11,165,244,201,48,9709 3520 DATA 240,21,198,244,76,149,96,169 ,8,44,120,2,208,12,165,244,9777 3530 DATA 205,70,82,240,2,230,244,32,1 2,87,172,215,97,173,31,208,1361 3540 DATA 201,6,208,6,32,179,97,76,145 ,95,169,255,205,252,2,240,4159 3550 DATA 16,141,252,2,32,191,97,132,1 95,205,252,2,240,251,141,252,7035 3560 DATA 2,162,3,169,0,29,8,208,202,1 6,250,201,0,208,8,136,8813 3570 DATA 208,216,206,214,97,208,131,3 2,95,97,165,205,48,33,141,30,8371 3580 DATA 208,32,49,88,173,41,88,240,8 1,162,3,181,222,240,3,32,9355 3590 DATA 223,92,202,16,246,32,95,97,1 65,205,48,3,76,43,96,165,7299 3600 DATA 251,201,10,208,7,24,165,236, 101,242,133,236,165,242,201,20,4829 3610 DATA 240,40,162,3,169,0,149,222,2 02,16,251,169,20,133,252,32,1273 3620 DATA 114,94,160,0,132,241,132,195 ,140,5,210,140,4,210,140,200,2584 3630 DATA 2,177,192,208,252,230,242,76 ,255,95,169,0,133,195,133,241,5750 3640 DATA 162,2,32,114,94,169,10,133,2 52,142,213,97,32,28,87,174,9068 3650 DATA 213,97,160,0,177,192,208,241 ,202,208,231,32,97,87,76,145,2720 3660 DATA 95,162,3,169,0,29,8,208,202, 16,250,160,1,132,253,162,1554 3670 DATA 0,36,253,208,10,6,253,232,22 4,4,208,245,76,175,97,141,3479 3680 DATA 212,97,142,213,97,165,195,13 ,222,67,208,3,76,116,87,32,7729 3690 DATA 114,94,198,205,230,204,32,20 5,89,230,251,174,213,97,32,125,4201 3700 DATA 91,174,213,97,169,0,149,222, 157,0,208,173,212,97,76,115,1701 3710 DATA 97,141,30,208,96,162,3,169,0 ,149,222,157,0,208,202,16,9850 3720 DATA 248,160,0,140,0,210,140,2,21 0,140,4,210,140,1,210,140,182 3730 DATA 3,210,140,5,210,96,0,0,0,255 ,226,2,227,2,123,95,7623
*SAVE#D3:RAMBUG.M65 * *ASM,#-,#D3:RAMBUG.COM .TITLE "RAMBUG II,By Mat*Rat" .ORG $5000 .OPT OBJ .OPT NOMLIST * .= (lister code) CIO = $E456 ;CALL OS HERE ICCOM = $0342 ;COMMAND TO CIO ICBADR = $0344 ;BUFFER OR FNAME ICBLEN = $0348 ;BUFFER LENGTH ICAUX1 = $034A ;AUX BYTE #1 ICAUX2 = $034B ;AUX BYTE #2 ; COPN = 3 ;COMMAND OPEN CCLOSE = 12 ;COMMAND CLOSE CGBINR = 7 ;GET BINARY REC CPBINR = 11 ;PUT BINARY REC CDRAW = 17 ;COMMAND DRAWTO CFILL = 18 ;COMMAND FILL * OPIN = 4 ;OPEN FOR INPUT OPOUT = 8 ;OPEN FOR OUTPUT XCORD = $55 YCORD = $54 DRAWCOLOR = $02FB ATRACT = 77 VVBLKD = $0224 ;Def VBI vector VDSLST = $0200 ;Screen Dlist Inr CASINI = $02 ;RESET HOOK DOSINI = $0C BOOT = $09 ;RESET CONTROL COLDST = $0244 ;RESET KEY FLAG WATTAGE = 2000 ;2000 WATTS A GAME NMIEN = $D40E ;Ena DLI here WSYNC = $D40A ;DLI Sync hdw loc VCOUNT = $D40B ;display sync here SDMCTL = $022F ;PM Controls SDLSTL = $0230 STICK0 = $0278 ;Joystick STRIG0 = $0284 COLOR0 = $02C4 ;PF colors COLOR1 = $02C5 COLOR2 = $02C6 COLOR3 = $02C7 COLOR4 = $02C8 PCOLR0 = $02C0 ;Player Colors COLPF0 = $D016 ;Hdw color reg COLPF1 = $D017 COLPF2 = $D018 COLPF3 = $D019 CHBAS = $02F4 CH = $02FC ;Cset Pointer HPOSP0 = $D000 ;Players X-ctl HPOSM0 = $D004 ;Missile X-ctl SIZEM = $D00C SIZEP0 = $D008 P0PF = $D004 P1PF = $D005 M0PL = $D008 ;Read colsn here GRACTL = $D01D GPRIOR = $026F ;PL/PF PRIORITY HITCLR = $D01E ;Collision Reg CONSOL = $D01F ;Start? Here AUDF1 = $D200 ;Audio AUDF2 = $D202 ;Control Regs AUDF3 = $D204 AUDF4 = $D206 AUDC1 = $D201 AUDC2 = $D203 AUDC3 = $D205 AUDC4 = $D207 AUDCTL = $D208 SKCTL = $D20F RANDOM = $D20A ;Random Reg PMBAS = $D407 ;PM pointer SIOINV = $E465 ;Init sound SAVMSC = $58 ;Gr Mode NORTH = 1 ;Joystick SOUTH = 2 ;direction WEST = 4 ;control bits EAST = 8 JIFFY = $14 ;VBI TIMER GLFLIM = 48 ;Grid Left Limit GRSGL = 200 ;Grid Rite Limit 1 GRDBL = 192 ;Grid Rite Limit 2 GRQUD = 176 ;Grid Rite Limit 4 FARLFT = 37 ;Left Screen PL limit FARITE = 207 ;Right Screen PL lim MIDDL = 114 BTOP = 60 ;playfiled BBOT = 224 ;limits MBIG = $FF ;big missiles=easy MMED = $55 MSML = $00 START = 6 SELECT = 5 OPTION = 3 ; P/M POINTERS SOUND = $C0 ;Sound Pointer ZAG = SOUND+2 ;VBI Dela Bolt BFLAG = ZAG+1 ;L-BOLT On Flag SPTR = BFLAG+1 ;Source Pointer DPTR = SPTR+2 ;Dest Pointer POWER = DPTR+2 ;Power Level PPTR = POWER+2 ;Player Pointer BUGCNT = PPTR+2 ;Bugs Killed TBUGS = BUGCNT+1 ;Current # Bugs XCNT = TBUGS+1 ;Vec Workspace YCNT = XCNT+4 XVEC = YCNT+4 ;Actual Vectors YVEC = XVEC+4 XPOS = YVEC+4 ;Xpos of Bugs YPOS = XPOS+4 ;Ypos of Bugs OYPOS = YPOS+4 ;Old Bug Locs MINSP = OYPOS+4 ;Difficulty Ctrl SPEEDO = MINSP+1 BONUS = SPEEDO+1 ;# of bonuses DSABL = BONUS+1 ;Bug Start Delay PMFLG = DSABL+4 ;PM VBI Work Flg LEVEL = PMFLG+1 ;Game Level ZAGDEL = LEVEL+1 ;Grid delay XGRID = ZAGDEL+1 ;Grid X Posn TMPA = XGRID+1 ;keep regs here TMPX = TMPA+1 TMPY = TMPX+1 BLDEL = TMPY+1 ;Blast Sound Del ZBDEL = BLDEL+1 ;zagbolt delay VWRK = ZBDEL+1 ;VBI PGZR0 WORKSP KBUGS = VWRK+1 ;killed bugs FLASH = KBUGS+1 ;killing routine. KILLER = FLASH+1 * this round * Vectors: * Xvec values 1-7 * Msbit clear move left->right * Msbit set move r->l * Yvec values 1-7 * Msbit clear move up * (decreasing y-values) * Msbit set move dn * Invert dir bit for y if bug * hits upper or lower limit. * * Set Up P/M Graphics * PMAREA = $4000 ;PMs here BOLT = PMAREA+$0300 PM0 = PMAREA+$0400 PM1 = PM0+$0100 PM2 = PM1+$0100 PM3 = PM2+$0100 TBOLT = BOLT+64 BBOLT = BOLT+224 DINDEX = $57 ;Graphics Mode BOTSCR = $02BF ;Scroll lines * Next define bugs DEDBUG = PMAREA+8 BUG1 = DEDBUG+8 ;P/M BUG BUG2 = BUG1+8 ;definitions BUG3 = BUG2+8 ;kept in c-set BUG4 = BUG3+8 ;area GRID = BUG4+8 ;grid char here * Custom Display List DLST .BYTE 112,112,70 .WORD TITLE .BYTE 7,7,128,7,7,7 .BYTE 7,7,7,7,7,7,7 .BYTE 65 .WORD DLST TITLE .SBYTE "score 00000 " .SBYTE "hi 00000" STATS .SBYTE "POWR:" SPOWR .SBYTE " 999" SWATS .SBYTE " attowatts" .SBYTE "bugs:" SBUGS .SBYTE " 000 ROUND: " SLVL .SBYTE "01" GAMESCR .DS 10*20 CREDIT1 .SBYTE " RAMBUG II " CREDIT2 .SBYTE " rat and miller " MATRAT .SBYTE " chief exterminators" SELCLV .SBYTE " SELECT difficulty " SSTRT .SBYTE " start or fire " SBEGN .SBYTE " BEGIN DEBUGGING " SNEWHI .SBYTE "writing new HI SCORE" LVLTX .SBYTE " atto" .SBYTE "femto" ;Wattage .SBYTE " pico" ;prefixes .SBYTE " nano" ;for levels .SBYTE "micro" ;1-20 .SBYTE "milli" .SBYTE "centi" .SBYTE " deci" .SBYTE "plano" .SBYTE " deka" .SBYTE "hecto" .SBYTE " kilo" .SBYTE " mega" .SBYTE " giga" .SBYTE " tera" .SBYTE "danno" .SBYTE "jimbo" .SBYTE "nafie" .SBYTE "davie" .SBYTE "matto" .SBYTE "ratto" * Player Colors PCLRS .BYTE $4E,$AE,$CE,$EE PFCLRS .BYTE $42,$84,$34,$C4 * BUG & GRID SCREEN BYTES GRIDAT .SBYTE 6,38,134,166 BUGTBL .SBYTE 1,33,129,161 * BUG DEFINITIONS BUGS .BYTE 0,81,74,42 ;DEDBUG .BYTE 44,127,60,0 .BYTE 128,224,113,58 ;BUG1 .BYTE 7,248,112,8 .BYTE 0,0,16,121 ;BUG2 .BYTE 198,251,112,16 .BYTE 1,6,206,172 ;BUG3 .BYTE 48,28,38,65 .BYTE 0,0,198,175 ;BUG4 .BYTE 48,28,39,16 * GRID Right X-Coord Limit * adjustable according to * missile sizes, game * difficulty. GRTLIM .BYTE 0 GAMDIF .BYTE 0 ; 0, 1, or 2 DIF0 .SBYTE " BUMBLE FINGERS " DIF1 .SBYTE " PRO EXTERMINATOR " DIF2 .SBYTE " MASTER BUG BLASTER " * Lightning Bolt zapping bug * sound data. ZSOUND .BYTE 1,14,128,8 .BYTE 6,14,136,8 .BYTE 12,13,137,9 .BYTE 18,13,149,9 .BYTE 24,13,148,10 .BYTE 30,12,144,10 .BYTE 36,12,164,10 .BYTE 42,11,168,11 .BYTE 48,11,164,11 .BYTE 54,11,175,11 .BYTE 60,10,166,12 .BYTE 66,10,164,12 .BYTE 72,10,182,13 .BYTE 78,9,174,13 .BYTE 84,9,173,13 .BYTE 90,8,176,14 .BYTE 96,8,190,14 .BYTE 102,8,185,14 .BYTE 108,7,194,15 .BYTE 114,7,186,15 .BYTE 120,7,191,16 NSOUND .BYTE 0,0,0,0 DLST1 .BYTE 112,112,71 .WORD SHOW .BYTE 0,7,0,7,0,7,0 .BYTE 2,112,7,0,7,0 .BYTE 7,0,7,0,7,112,2 .BYTE 65 .WORD DLST1 SHOW .SBYTE " A.N.A.L.O.G. " .SBYTE " computing " .SBYTE " presents " .SBYTE " rambug ii " .SBYTE " By Mat*Rat - with Dave M.I.C.E. Miller " .SBYTE "the best bug killer " NAMESTR .SBYTE " " ALHI .SBYTE "HIGHEST SCORE: " ALKIL .SBYTE "bugs blasted : " ALPWR .SBYTE "SURPLUS POWER: " .SBYTE " Press [START] to NUKE some bugs! " FILE .BYTE "D:RAMBHI",0 * MACRO Definitions .MACRO GETIT .IF %0<>1 .ERROR "BAD GETIT" .ENDIF JSR GET BMI GOOFHI STA %1 .ENDM .MACRO PUTIT .IF %0<>1 .ERROR "BAD PUTIT" .ENDIF LDY %1 JSR PUT BMI NOPUT .ENDM * DINC - Double Byte Increment * DINC - Double Byte Increment .MACRO DINC .IF %0<>1 .ERROR "Bad DINC Call." .ENDIF INC %1 BNE @LINC INC %1+1 @LINC .ENDM * * DDEC - Double Byte Decrement .MACRO DDEC .IF %0<>1 .ERROR "Bad DDEC Call." .ENDIF DEC %1 LDA %1 CMP #$FF BNE @DEC DEC %1+1 @DEC .ENDM * Setup for storing string * to screen RAM. .MACRO SLSTR .IF %0>2 OR %0<1 .ERROR "SLSTR MACRO ERR" .ENDIF LDA #<%1 LDY #>%1 .IF %0=2 LDX #%2 .ENDIF JSR SLINGSTRING .ENDM .MACRO SPEED .IF %0<>3 .ERROR "Speed ERR" .ENDIF LDY #%1 STY MINSP LDY #%2 STY SPEEDO LDY #%3-1 STY BUGVAL+1 .ENDM * GET SHOW DISPLAY .INCLUDE #D3:SHOW.M65 * Update POWER and BUGS fields. * POWER - value 0-999 sssssWATTS * two byte value. * BUGS - value 0-200 single * byte value. Running total * of all the bugs you've zapped. PWRBUG LDA #<SPOWR STA SPTR ;POINT LDA #>SPOWR ;TO STA SPTR+1 ;POWER FIELD LDA POWER ;TOTAL POWER LDX POWER+1 JSR PNUM ;Print number LDA #<SBUGS STA SPTR ;Update bug cnt LDA #>SBUGS STA SPTR+1 LDA BUGCNT LDX #0 ;1 Byte value JSR PNUM RTS * MAKBUG - Make a new bug. Set * random vector and direction * Fix X according to X-Dir * Fix Y random between TBOLT+7 * and BBOLT-14 * Set DSABL start according to * current LEVEL with random 0-3 * delay variation * Entry: X-Reg=Bug #0-3 to make * Exit : Bug Vec & Posn RAM regs * set. X,Y preserved. MAKBUG STX MAKX ;Save temp STY MAKY LDA #<PM0 STA CLRBUG+1 LDA #>PM0 STA CLRBUG+2 CPX #0 BEQ DOCLB NXPM INC CLRBUG+2 DEX BNE NXPM LDX MAKX ;Restore X-reg DOCLB LDY #255 LDA #0 CLRBUG STA PM0,Y DEY BPL CLRBUG LDA RANDOM ;50/50 chance ROR A ;x-direction ROR A ;select AND #$80 ;dir bit only STA XVEC,X ;save LDA RANDOM ;move 1-7 each time AND #$0F BNE KPXV LDA #1 ;min=1 KPXV STA XCNT,X ;Iniz counter ORA XVEC,X STA XVEC,X AND #$80 ;set init x-pos BNE ATRITE ;by dir flag ATLFT LDA #FARLFT ;Far Left BNE KPXC ;keep x-coord ATRITE LDA #FARITE KPXC STA XPOS,X ;new xpos LDA RANDOM ;set Yvec ROR A ROR A AND #$80 ;50/50 chance STA YVEC,X ;either dir LDA RANDOM ;Yvec=0-15 AND #$0F STA YCNT,X ;iniz cnt ORA YVEC,X ;dir & amount STA YVEC,X ;new vector LDA RANDOM ;iniz y-coord CMP #BTOP+7 ;< TBLOT+7 ? BCS CKMAX ;no, check max LDA #BTOP+7 ;yes, min then BNE SAVY ;save it CKMAX CMP #BBOT-15 BCC SAVY ;no, keep it LDA #BBOT-15 SAVY STA YPOS,X LDA #21 ;do delay CLC ;starter SBC LEVEL ;delay 1-10 VBI's ASL A ;*16 ASL A ;.25 ASL A ;TO ASL A ;5 SECONDS KPDS STA DSABL,X ;start dela LDA RANDOM AND #$1F ;+ rnd 0-15 ORA DSABL,X STA DSABL,X LDY MAKY RTS ;done new bug! MAKX .BYTE 0 MAKY .BYTE 0 * PNUM - Print DEC # in * A(LO),X(HI) Regs to * screen pointed to by * SPTR. Converts digits to * MAC/65 .SBYTE format. * Stores directly to screen * RAM area. PNUM STA LODEC STX HIDEC ;Work num here LDY #0 ;INIZ TBL INX STY SUPRES NXTDIG LDX #0 ;INIZ DIG COUNT SUBEM LDA LODEC ;FETCH LSBY BIN SEC ;SUBTRACT LSBY SBC SUBTBL,Y STA LODEC LDA HIDEC ;FETCH MSBY INY ;SUB MSBY SBC SUBTBL,Y BCC ADBACK ;IF RESULT NEG * RESTORE LSBYTE STA HIDEC ;OTHERWISE, * STORE MSBYTE OF RESULT INX ; NEXT DIGIT, DEY ;POINT TO LSBY JMP SUBEM ; AND GO AGAIN * RESTORE LSBYTE VALE IF SUB * RESULTED NEG VALUE, THE PRINT * DIGIT COUNT ADBACK DEY ;POINT TO LSBY LDA LODEC ;GET LSBYTE ADC SUBTBL,Y ;AND ADD LSBY STA LODEC TXA ;PUT DIGIT IN A BEQ SUPCK ;Supress? INC SUPRES ;Reset Sup Flag SUPCK LDX SUPRES ;Still Sup? * Leading zeros? BNE KEEP LDA #0 ;Blank BEQ KEEP1 KEEP ORA #$90 ;>SBYTE KEEP1 LDX #0 STA (SPTR,X) DINC SPTR NXDEC INY INY CPY #8 ;END OF TABLE? BCC NXTDIG ;NO, CNTNU WITH * NEXT DIGIT LDA LODEC ;YES, GET 1'S ORA #$90 ;CONVERT TO sbyt LDX #0 STA (SPTR,X) RTS * DECIMAL OUT ROUTINE WORKSPACE SUBTBL .WORD $2710 ;10000 .WORD $03E8 ;1000 .WORD $64 ;100 .WORD $0A ;10 LODEC .BYTE 0 HIDEC .BYTE 0 SUPRES .BYTE 0 ;SPRESS LEAD 0s PMSETUP LDA #3 ;turn on PMs STA GRACTL LDA #$21 STA GPRIOR ;multi color ;pl/pf priorities LDA #62 ;dma ena STA SDMCTL LDX #3 ;do player CLOOP LDA PCLRS,X STA PCOLR0,X DEX ;color defs BPL CLOOP LDX #3 LDA #0 SZPL STA SIZEP0,X DEX BPL SZPL LDA #>PMAREA ;PM RAM pointer STA PMBAS LDA #0 TAY CLPM STA BOLT,Y ;missle bolt STA PM0,Y STA PM1,Y ;Clear PM area STA PM2,Y STA PM3,Y INY BNE CLPM LDA #MIDDL ;middle screen STA XGRID JSR XBOLT ;do it LDA #$FF STA TBOLT ;top & STA TBOLT+1 STA BBOLT ;bottom of lite STA BBOLT-1 LDA #$00 ;REG MISSLES STA SIZEM RTS ;done * Play sound - if any routine. BLAST LDY BLDEL ;time to blast? BEQ BOOM ;yupidy DEC BLDEL RTS BOOM LDA (SOUND),Y BEQ UNBOOM ;no sound? STA AUDF1 ;got some JSR INCSND ;do it LDA (SOUND),Y STA AUDC1 JSR INCSND ;update sound LDA (SOUND),Y STA AUDF2 ;pointer JSR INCSND LDA (SOUND),Y STA AUDC2 JSR INCSND LDA #2 STA BLDEL RTS ;back to VBI UNBOOM LDA #0 ;sound regs STA AUDF1 ;1 & 2 off STA AUDC1 ;at end of STA AUDF2 ;blast STA AUDC2 RTS * Update SOUND address * pointer for BLAST INCSND DINC SOUND RTS * Killed a bug, update * his TIMELY demise! KILLBUG LDA #6 ;flash STA FLASH ;screen LDA LEVEL AND #$03 TAY ;graba deadbug LDA BUGTBL,Y STA TMPBGG LDY KBUGS ;bugs this level LDA #200 ;20 levels KILLB1 SEC ;10 bugs/lvl SBC #20 ;showa dead DEY ;bug BNE KILLB1 ;on grid LDY LEVEL ;Offset to DEY ;proper STY TMPAD ;column CLC ADC TMPAD TAY LDA TMPBGG STA GAMESCR,Y ;RAID RTS TMPBGG .BYTE 0 TMPAD .BYTE 0 * DLI - lower intensity * of background on lower * portion of screen, power * grid area. DODLI PHA ;Save regs TXA PHA LDX #3 LOINTEN LDA COLOR0,X AND #$F0 ;strip inten DLIMSK ORA #$02 ;set realow STA COLPF0,X ;Stuff into hdw DEX BPL LOINTEN PLA TAX PLA RTI * VBI handler for Lightning * bolt control, bug processing, * and most other updates VBI STA TMPA ;save regs STX TMPX STY TMPY PHP ;save status LDA PMFLG ;PMs on? BNE PLAY ;yes-play on LDX #3 ;no-reset LDA #0 ;bug positions NOPM STA HPOSP0,X DEX BPL NOPM JMP DOMOVS ;finish up PLAY LDX #3 ;do disable delays DOPDIS LDA DSABL,X ;vbi timed BEQ NODOPD ;delays DEC DSABL,X NODOPD DEX BPL DOPDIS LDA FLASH ;flash killing BEQ NOKLEM ;bug? DEC FLASH LDA COLOR4 ;red? BNE GOBLK ;or black LDA #$30 BNE NOKLEM GOBLK LDA #0 NOKLEM STA COLOR4 ;new color DOMOVS LDA BFLAG ;fire!? BNE SHOOT ;yes - do lbolt STA ZBDEL ;no,ena for next time LDA TBOLT+2 ;unzagged yet? BEQ DOSNDS ;yes-do sounds JSR UNZAGB ;no-clear JMP DOSNDS SHOOT CLC LDA POWER BNE SHOOT1 LDA POWER+1 BNE SHOOT1 JMP DOSNDS SHOOT1 DDEC POWER ;less power LDA POWER+1 ;<0? BPL MZAPON LDA #0 ;empty STA POWER STA POWER+1 STA BFLAG MZAPON JSR ZAGBOLT DOSNDS JSR BLAST ;boom if any JSR ZAGRID ;do power grid LDA #0 STA ATRACT LDA TMPA LDX TMPX LDY TMPY PLP JMP (XITVBI) * Move a bug and change * bug pointers for * animation purposes. * Entry: X Reg=Player # * Exit: All Regs Preserved * MOVBUG STX MTPX STY MTPY ;Temporary STA MTPA ;storage LDA XPOS,X ;before move STA HPOSP0,X ;mov x-dir LDA #>PM0 ;get ram ptr STA CLG+2 ;source pointer LDA #<PM0 STA CLG+1 CPX #0 ;first player? BEQ GOTSC ;yes-no offset INCSC INC CLG+2 ;next page DEX ;according to pl# BNE INCSC LDX MTPX GOTSC LDA OYPOS,X ;clear out TAY ;old player pos LDA CLG+1 STA CLGG+1 LDA CLG+2 STA CLGG+2 LDX #7 LDA #0 CLG STA PM0,Y INY DEX BPL CLG LDX MTPX ;restore pl# LDA RANDOM ;bzzzzz STA AUDF3 LDA #$C2 ;ctl/vol STA AUDC3 LDA XVEC,X ;pikabug BMI BG34 ;do 3 or 4 LDA RANDOM ;no-1 or 2 ROL A ;50/50 chance BCC DBG1 ;do 1 DBG2 LDA #<BUG2 ;do 2 LDY #>BUG2 JMP VBUGY ;use it DBG1 LDA #<BUG1 ;do 1 LDY #>BUG1 JMP VBUGY BG34 LDA RANDOM ;50/50 chance ROL A ;3 or 4 BCC DBG4 ;do 4 DBG3 LDA #<BUG3 ;do 3 LDY #>BUG3 JMP VBUGY DBG4 LDA #<BUG4 ;4 please LDY #>BUG4 VBUGY STA DOMOV+1 ;put in STY DOMOV+2 ;program code! LDA YPOS,X ;new y-pos TAY LDX #0 DOMOV LDA BUG1,X CLGG STA PM0,Y INY INX CPX #8 BNE DOMOV LDX MTPX ;restore pl# LDA YPOS,X ;new old 'Y' STA OYPOS,X LDA MTPA LDY MTPY RTS MTPX .BYTE 0 ;move temp MTPY .BYTE 0 ;storage here MTPA .BYTE 0 * NXBPOS - next bug posn. * caller must check xpos * (disabled if 0), before * calling NXBPOS. NXBPOS will * check & update disabl flag. * If zero, will fly the bug. * Use & update vector cntrs. * Restore them if both cntrs * at zero. Flip y dir bit * if bug hits upper/lower * limit of pf. * Entry: X=Pl # to move * NXBPOS LDA DSABL,X ;Disabled? BEQ NXB0 ;no-fly! RTS NXB0 LDA XCNT,X ;x-cnt set? BEQ NXB1 ;no-do y vec DEC XCNT,X ;yes-update LDA XVEC,X ;and move BMI NXB0A ;move r->l? INC XPOS,X ;no l->r! LDA XPOS,X ;limit? CMP #FARITE BNE NXB1 ;no NXB0B LDA #0 ;yes-missed STA XPOS,X ;turn it off DEC TBUGS ;1 less bug LDA LIVES ;Still Alive? BEQ NXB2 ;dead-forget it DEC LIVES JMP NXB2 ;this round NXB0A DEC XPOS,X ;r->l LDA XPOS,X ;limit? CMP #FARLFT BEQ NXB0B ;lost him NXB1 LDA YCNT,X ;y pos upd. BEQ NXB3 ;zero-no upd. DEC YCNT,X LDA YVEC,X ;dir? BMI NXB4 ;mov dn? DEC YPOS,X ;no-up LDA YPOS,X ;limit? CMP #BTOP BNE NXB3 LDA YVEC,X ;flip dir ORA #$80 ;bit STA YVEC,X JMP NXB3 ;wrapup NXB4 INC YPOS,X ;move dn LDA YPOS,X CMP #BBOT ;limit? BNE NXB3 ;no-go! LDA YVEC,X ;yes-flip dir AND #$7F ;bit STA YVEC,X NXB3 JSR MOVBUG CLC LDA YCNT,X ;vector ADC XCNT,X ;counters empty? BNE NXB5 ;no-cntnu LDA XVEC,X ;yes-restore AND #$7F ;count values STA XCNT,X LDA YVEC,X AND #$7F STA YCNT,X NXB5 RTS NXB2 LDA #0 ;lost bug STA HPOSP0,X ;just move off JSR BITDUST JSR DIEBUG RTS ;screen * SLINGSTRING - Sling a 20 * byte SBYTE string out * to game screen. * Entry: A - Loadr of stext * Y - Hiadr of stext * X - Screen line # * Exit: X=X+1, A & Y changed * SLINGSTRING STA SPTR ;Source STY SPTR+1 ;pointer LDA #<GAMESCR ;compute STA DPTR ;screen LDA #>GAMESCR STA DPTR+1 ;pointer TXA ;line # TAY BEQ SLINE1 SLINE CLC ;20 bytes LDA #20 ;per line ADC DPTR STA DPTR BCC SLINE0 INC DPTR+1 SLINE0 DEY BNE SLINE LDY #0 ;display SLINE1 LDA (SPTR),Y ;it STA (DPTR),Y INY CPY #20 BNE SLINE1 INX ;next line RTS ;for next time * * SELDIF * select game difficulty * and start game * SELDIF JSR NOGRID SLSTR CREDIT1,0 ;show credits SLSTR CREDIT2,2 ;and SLSTR MATRAT ;titles SLSTR SELCLV,5 ;& prompts SLSTR SSTRT,8 SLSTR SBEGN LDA #$06 ;hi inten now STA DLIMSK+1 SLOOP JSR FULLPWR ;lotsa LDA GAMDIF ;diff BNE SL12 ;level? SLSTR DIF0,6 ;missile LDA #MBIG ;sizes LDX #GRQUD SPEED 38,25,50 LDY #8 ;for xbolt JMP SLDF1 SL12 CMP #1 ;level 1? BNE SL02 SLSTR DIF1,6 LDA #MMED LDX #GRDBL SPEED 33,30,75 LDY #4 JMP SLDF1 SL02 SLSTR DIF2,6 LDA #MSML LDX #GRSGL SPEED 25,37,100 LDY #2 SLDF1 STA SIZEM ;Bolt size STX GRTLIM ;right limit STY XMISL+1 ;xmov cnt LDA #MIDDL JSR XBOLT ;set it SELD1 LDA CONSOL ;leggo CMP #7 BNE SELD1 LDA #0 ;reset STA BFLAG ;lbolt SELD2 LDA CONSOL CMP #START ;run? BEQ GOTDIF ;yup CMP #SELECT ;no-sel? BEQ SELD2A LDA STRIG0 BEQ GOTDIF JMP SELD2 SELD2A LDA #1 ;fire! STA BFLAG JSR DIEBUG ;turn on sound LDX GAMDIF INX CPX #3 ;next level BNE SELD3 LDX #0 SELD3 STX GAMDIF JMP SLOOP GOTDIF JSR MAKGRID LDA #$02 ;low intensity STA DLIMSK+1 ;background RTS ;play * * DIEBUG - set sound pointer * to zsound while not VBI * DIEBUG LDA JIFFY HDIE CMP JIFFY BNE HDIE LDA #<ZSOUND STA SOUND ;die bug LDA #>ZSOUND STA SOUND+1 ;die! RTS * * STEAL - steal system reset * vector STEAL LDA DOSVEC+1 CMP #$FF BNE DOSVEC LDA DOSVEC+2 CMP #$FF BNE DOSVEC LDA DOSINI STA DOSVEC+1 LDA DOSINI+1 STA DOSVEC+2 JMP DOSKIP DOSVEC JSR $FFFF DOSKIP LDA #<GAME STA CASINI LDA #>GAME STA CASINI+1 LDA #2 STA BOOT LDA #0 STA COLDST RTS * * FULLPWR - restore full * power for new game * FULLPWR LDA #<WATTAGE STA POWER LDA #>WATTAGE STA POWER+1 RTS * * SCORE=50*BUGCNT+5*POWER * Compute & Display it & * do hi score too. * SCORIT JSR SCLIN ;total LDA BUGCNT STA SCORE ;bugs LDA #0 ;killed STA SCORE+1 STA BFLAG STA HIFLG * be sure vbi lbolt control * is off to avoid pnum * conflicts (vwrk) BUGVAL LDX #49 ;*50 SCORIT0 LDA BUGCNT ;lazy! CLC ;multiply! ADC SCORE STA SCORE BCC SCORIT1 INC SCORE+1 SCORIT1 DEX BNE SCORIT0 LDX #5 ;power left SCORIT2 CLC LDA POWER ADC SCORE ;over STA SCORE ;*5 LDA POWER+1 ADC SCORE+1 STA SCORE+1 DEX BNE SCORIT2 * add bonus if any LDX BONUS BEQ SNOBON SBADD CLC LDA BUGVAL+1 ;Bonus ADC SCORE ;based on game STA SCORE ;level. BCC SBADD0 INC SCORE+1 SBADD0 DEX BNE SBADD SNOBON LDA #<TITLE+6 ;shoit STA SPTR LDA #>TITLE+6 STA SPTR+1 LDA SCORE LDX SCORE+1 JSR PNUM * new HI score? LDA SCORE+1 CMP HI+1 BCC NOHI BNE NEWHI LDA SCORE ;if hi bytes=then CMP HI ;check lobyte BCC NOHI NEWHI LDA SCORE STA HI LDA SCORE+1 STA HI+1 LDA HI ORA HI+1 BEQ NOHI LDA #6 STA DLIMSK+1 LDA JIFFY DHJF CMP JIFFY BEQ DHJF JSR GETNAME SLSTR SNEWHI,5 JSR PUTHI LDA #2 STA DLIMSK+1 INC HIFLG * Show HI score NOHI LDA #<TITLE+15 STA SPTR LDA #>TITLE+15 STA SPTR+1 LDA HI LDX HI+1 JSR PNUM RTS SCORE .WORD 0 HI .WORD 0 HIFLG .BYTE 0 * Play the game boys! GAME JSR STEAL ;GIMME DOS HGAME JSR SHOWALL ;HI SCORE DUDE JSR BEGIN ;do screen LDA #0 STA BONUS STA PMFLG STA KBUGS STA TBUGS JSR PMSETUP ;enable pms NEWGAME JSR PWRBUG ;show bug & power LDA #MIDDL STA XGRID JSR XBOLT JSR SIOINV LDA #0 STA AUDCTL LDA #3 STA SKCTL JSR MAKGRID LDA #1 STA LEVEL LDA #$FF STA DELAYIT LDA #0 STA SCORE STA SCORE+1 JSR SCORIT ;show score LDA HIFLG BEQ NEWG1 LDA #0 ;Gotta new hi-show STA XGRID JSR XBOLT JMP HGAME NEWG1 STA BONUS STA BONUS STA COLOR4 STA BUGCNT JSR SELDIF ;new game LDA #5 ;Live long STA LIVES ;and prosper GAMEGO JSR DIEBUG ;Sound LDY #0 ;Leggo console CLEGO LDA (SOUND),Y BNE CLEGO LDA CONSOL CMP #7 BNE GAMEGO JSR FULLPWR ;full power JSR PWRBUG ;show it JSR LFLIN JSR LIFER LDA #1 STA PMFLG SRND LDX #3 ;make new bugs DOPLMK JSR MAKBUG DEX BPL DOPLMK BROUND LDA #9 ;bugs this round STA TBUGS LDA DELAYIT ;speed CMP MINSP ;maxed out? BEQ SAVDD ;yup SEC SBC SPEEDO ;faster! BCC FASTEST CMP MINSP BCS SAVDEL FASTEST LDA MINSP SAVDEL STA DELAYIT SAVDD LDA #0 STA KBUGS LDA #1 STA PMFLG ;PMs on now GAME0 JSR PREFIX ;wattage GAME1 JSR PWRBUG ;power & bugs STA HITCLR ;No hits now LDX #3 ;Make new bugs LDY TBUGS ;if room GMMAK LDA XPOS,X BEQ GMMAK0 DEY BMI GMAK1 GMMAK0 DEX BPL GMMAK LDX #3 GMAK LDA XPOS,X BNE GMAK0 JSR MAKBUG LDA #0 STA AUDF3 DEY BMI GMAK1 GMAK0 DEX BPL GMAK GMAK1 LDA #4 STA MOVTRY GAME1A LDA POWER BNE DOFIRE LDA POWER+1 BNE DOFIRE JMP GAMEND ;NO POWER-DIE DUDE DOFIRE LDA STRIG0 BNE GAME2 ;nopidy LDA #1 ;yuppidy STA BFLAG JMP GAME5 ;Fire or move - not both GAME2 LDA #0 STA BFLAG ;Reset electrodes GAME2A LDA #WEST ;move BIT STICK0 ;electrodes? BNE GAME3 LDA XGRID ;limit test CMP #GLFLIM BEQ GAME4 DEC XGRID JMP GAME4 GAME3 LDA #EAST BIT STICK0 BNE GAME5 ;no moves LDA XGRID ;limit CMP GRTLIM ;check BEQ GAME4 INC XGRID GAME4 JSR XBOLT ;movit GAME5 LDY DELAYIT ;slow down LDA CONSOL CMP #START BNE GAME5A JSR NOBUGS JMP NEWGAME GAME5A LDA #255 ;Key pause? CMP CH BEQ GAME5C STA CH JSR NOSOUND STY BFLAG GAME5B CMP CH BEQ GAME5B STA CH GAME5C LDX #3 ;collisions? LDA #0 GAME6 ORA M0PL,X DEX BPL GAME6 CMP #0 ;any hits BNE GAME7 ;yes-doit DEY ;no-delay BNE GAME5A ;remember zagbolt DEC MOVTRY BNE GAME1A ;2 TIMES MORE OFTEN GAME7 JSR KILLTEST ;kill bugs LDA TBUGS ;end round? BMI NXRND ;yup-next STA HITCLR ;no move bugs JSR LIFER LDA LIVES ;Still Alive? BEQ GAMEND ;NO-DIE! LDX #3 GAME8 LDA XPOS,X BEQ GAME8A JSR NXBPOS GAME8A DEX BPL GAME8 JSR KILLTEST LDA TBUGS BMI NXRND ;end round JMP GAME1 ;loopit NXRND LDA KBUGS ;got all 10 CMP #10 BNE NOBON ;no-no bonus CLC ;yes-add it LDA BONUS ADC LEVEL STA BONUS NOBON LDA LEVEL ;game end? CMP #20 BEQ GAMEND LDX #3 ;turnoff LDA #0 ;bugs BUGOFF STA XPOS,X DEX BPL BUGOFF LDA #20 ;flash endround STA FLASH JSR DIEBUG ;killendround LDY #0 ;PMs off STY PMFLG STY BFLAG STY AUDC3 STY AUDF3 STY COLOR4 WRAPUP LDA (SOUND),Y ;done sound BNE WRAPUP INC LEVEL ;next level JMP SRND ;start new round GAMEND LDA #0 STA BFLAG ;save power STA PMFLG LDX #2 GAMEND0 JSR DIEBUG ;killem LDA #10 STA FLASH GAMEND1 STX GAMX JSR ZAGBOLT LDX GAMX LDY #0 LDA (SOUND),Y BNE GAMEND1 DEX BNE GAMEND0 JSR UNZAGB JMP NEWGAME KILLTEST LDX #3 LDA #0 KILOOP ORA M0PL,X ;hitem? DEX BPL KILOOP LDY #1 ;setup bit mask STY KILLER LDX #0 KILTST BIT KILLER BNE GOTEM KILTSTA ASL KILLER ;next INX CPX #4 BNE KILTST JMP KILEXIT GOTEM STA GAMA STX GAMX ;savem LDA BFLAG ;You nukem? ORA BBOLT-2 ;BOLT STILL ON? BNE GOTEM1 ;YUP! JMP DIEGRID ;No - you die! GOTEM1 JSR DIEBUG DEC TBUGS INC BUGCNT ;CREDIT FOR JSR PWRBUG ;THIS DEAD BUG INC KBUGS LDX GAMX JSR KILLBUG LDX GAMX LDA #0 STA XPOS,X ;OFF NOW! STA HPOSP0,X LDA GAMA JMP KILTSTA KILEXIT STA HITCLR RTS NOBUGS LDX #3 LDA #0 GOAWAY STA XPOS,X STA HPOSP0,X DEX BPL GOAWAY NOSOUND LDY #0 STY AUDF1 STY AUDF2 STY AUDF3 STY AUDC1 STY AUDC2 STY AUDC3 RTS GAMA .BYTE 0 ;save regs here GAMX .BYTE 0 MOVTRY .BYTE 0 DELAYIT .BYTE $FF *= $02E0 .WORD GAME