software: Added more and more
[pdp8.git] / sw / SPACE / space.pal.bak
... / ...
CommitLineData
1/ SPACE WAR
2/
3/ INTERPLANETARY DEATH AND DESTRUCTION ON YOUR
4/ LAB-8
5/
6/ EVAN SUITS
7/
8/ THIS VERSION WORKS OFF EITHER THE BLUE RIBBON CONNECTOR OR THE
9/ SR. WHEN THE PROGRAM IS STARTED (AT 0200) OR RESTARTED THE
10/ SR WILL BE TESTED AND IF =0000 WILL BE USED FOR THE COMMAND
11/ INPUT. OTHERWISE, THE BLUE RIBBON CONNECTOR (AX08 * C0-C7 *
12/ XR OPTION ONLY) CONTINGENCY INPUTS WILL BE USED.
13/
14/ WHEN THE PROGRAM IS STARTED THE TWO SHIPS SHOULD
15/ APPEAR ON THE SCREEN WITH SHIP 'ONE' ON THE LEFT, SHIP
16/ 'TWO' ON THE RIGHT.
17/
18/ THE COMMAND WORD BIT ASSIGNMENTS ARE:
19/
20/ SR BIT: C: FUNCTION:
21/
22/ 0 0 SHIP ONE ROTATES LEFT
23/
24/ 1 1 SHIP ONE ROTATES RIGHT
25/
26/ 2 2 SHIP ONE ACCELERATES
27/
28/ 3 3 SHIP ONE FIRES
29/
30/
31/
32/ 8 4 SHIP TWO ROTATES LEFT
33/
34/ 9 5 SHIP TWO ROTATES RIGHT
35/
36/ 10 6 SHIP TWO ACCELERATES
37/
38/ 11 7 SHIP TWO FIRES
39/
40/
41/
42/ NOTE THAT TURNING RIGHT AND LEFT SIMULTANEOUSLY THROWS
43/ THE SHIP INTO HYPERSPACE. IN THE CURRENT VERSION THE ODDS
44/ ARE IN FAVOR OF YOUR MAKING IT BACK SAFELY. THE GAME IS OVER
45/ WHEN ONE OR BOTH OF THE SHIPS HAVE BEEN DESTROYED AND THE
46/ WINNER (IF ANY) IS IN NORMAL SPACE. WHEN THE WINNER
47/ HAS BEEN ANNOUNCED, HIT ANY TTY KEY TO RESTART.
48/
49
50
51/****************************************************************
52
53/***************************
54/ CLOCK OPERATIONS
55
56CLZE=6130 / CLEAR CLOCK ENABLE REGISTER PER AC
57CLSK=6131 / SKIP ON CLOCK FLAG
58CLOE=6132 / SET CLOCK ENABLE REGISTER PER AC
59CLAB=6133 / AC REGISTER TO CLOCK COUNTER REGISTER
60CLEN=6134 / CLOCK ENABLE REGISTER TO AC
61CLSA=6135 / STATUS TO AC
62CLBA=6136 / CLOCK BUFFER REGISTER TO AC
63CLCA=6137 / CLOCK COUNTER REGISTER TO AC
64
65/ BITS IN CLOCK ENABLE REGISTER
66CREXT=0100 / EXTERNAL SOURCE
67CR2=0200 / 10**2 per second
68CR3=0300 / 10**3 per second
69CR4=0400 / 10**4 per second
70CR5=0500 / 10**5 per second
71CR6=0600 / 10**6 per second
72
73COVSTAT=4000
74CMFREE=0000 / 4096 FIXED FREE RUN
75CMPROG=1000 / PROGRAMMED DELAY
76
77CADC=0040 / START ADC ON OVERFLOW
78CINH=0020 / INHIBIT CLOCK
79CION=0010 / INTERRUPT ENABLE
80
81CEV3=0004 / EVENT 3 ENABLED
82CEV2=0002 / EVENT 2 ENABLED
83CEV1=00001 / EVENT 1 ENABLED
84
85/ VC8-E OPCODES
86DIXY=6055 / INTENSIFY
87DILX=6053 / LOAD X
88DILY=6054 / LOAD Y
89DILE=6056 / LOAD ENABLES FROM A
90DISD=6052 / TEST FOR READY
91
92/****************************************************************
93/ SYMBOL DEFINITIONS FOR PAL8-PAL10
94
95XRIN=NOP / DIGITAL INPUT?
96XRCL=NOP
97
98/DSB=XXXX / SET BRIGHTNESS - MUST BE COMMENTED OUT!!!
99
100DXC=JMS I IVCLDX / X VALUE CONTROL?
101DYC=JMS I IVCLDY / Y VALUE CONTROL?
102
103DXL=0000 / X VALUE LOAD FLAG?
104DYL=0000 / Y VALUE LOAD FLAG?
105DIS=0000 / ANOTHER STRANGE FLAG
106
107/CRF=NOP / WHICH FLAG???
108/CCF=NOP / ??
109
110
111/****************************************************************
112/
113/ THIS PROGRAM RELIES ON THE PROGRAM INTERUPT FACILITY FOR
114/ REAL WORLD TIMING PURPOSES.
115/
116
117 *0
118
119 0 /EFFECTIVE JMS 0 ON PROGRAM INTERUPT
120 JMP I 2 /EXIT IMMEDIATLY TO SERVICE ROUTINE
121 INTSER
122
123EMPTY, 0 /THESE LOCATIONS ARE RESERVED FOR
124ODT1, 0 /DEBUGGERS, ETC.
125ODT2, 0
126ODT3, 0
127
128/
129/ ALL THE AUTO INDEX REGISTERS ARE NAMED BUT NOT ALL OF
130/ THEM ARE USED. THE STATUS OF ANY GIVEN REGISTER CANNOT
131/ BE DETERMINED AT ANY TIME EXCEPT BY CAREFUL INSPECTION OF
132/ THE CODE.
133/
134
135 *10
136
137AUTO10, 0
138AUTO11, 0
139AUTO12, 0
140AUTO13, 0
141AUTO14, 0
142AUTO15, 0
143AUTO16, 0
144AUTO17, 0
145
146/
147/ THE FOLLOWING ARE THE DATA FILES FOR THE TWO SPACE SHIPS
148/ AS WELL AS CERTAIN OTHER PARAMETERS FOR CALCULATING POSITIONS
149/ AND SO ON. THE ORDER OF THE LOCATIONS MUST BE PRESERVED
150/ ALTHOUGH THE SIZE OF THE TABLES MAY BE VARIED
151/
152
153 *20
154
155ONEOUT, 0 /IF NON-ZERO CONTAINS REAMINING TIME OF EXPLOSION
156ONECNT, 0 /NUMBER OF POINTS IN FIGURE TO BE DISPLAYED
157ONEFLG, 0 /IN OR OUT OF NORMAL SPACE
158ONETHE, 0 /ANGLE OF ORIENTATION ON SCREEN
159ONEVEX, 0 /X COMPONENT OF VELOCITY
160ONEVEY, 0 /Y COMPONENT OF VELOCITY
161ONEPEX, 0 /X POSITION (12 BITS)
162ONEPEY, 0 /Y POSITION (12 BITS)
163ONESIN, 0 /SINE OF ANGLE
164ONECOS, 0 /COSINE OF ANGLE
165ONEFIN, 0 /SET WHEN EXPLOSION DIES OUT
166
167TWOOUT, 0 /SAME CONTENT AND ORDER
168TWOCNT, 0 /AS ABOVE
169TWOFLG, 0
170TWOTHE, 0
171TWOVEX, 0
172TWOVEY, 0
173TWOPEX, 0
174TWOPEY, 0
175TWOSIN, 0
176TWOCOS, 0
177TWOFIN, 0
178
179
180/
181/ THESE LOCATIONS ARE USED BY THE "VECTOR GENERATOR" IN
182/ DISPLAYING THE FIGURES. A FOUR DOT VECTOR WILL BE DRAWN
183/ FROM XONE,YONE TO XTWO,YTWO WITH STEPS OF SIZE DIXTEM,DIYTEM
184/
185
186XONEDS, 0
187YONEDS, 0
188XTWODS, 0
189YTWODS, 0
190DIXTEM, 0
191DIYTEM, 0
192DISCNT, 0
193
194
195/
196/ THE NEXT LOCATIONS ARE USED BY CALPOS TO DO A FAST
197/ MULTIPLY TO HELP CALCULATE THE DISPLAY FILES.
198/
199T10SIN, 0
200T20SIN, 0
201T30SIN, 0
202T10COS, 0
203T20COS, 0
204T30COS, 0
205
206CALSIN, 0
207CALCOS, 0
208
209/
210/ NOW COME THE VARIOUS ODDS AND ENDS ONE USUALLY FINDS ON
211/ PAGE ZERO
212/
213
214SINE, SINEIN
215COSINE, COSINI
216MULT, MULTI
217RSHIFT, SHIFTR
218VECTOR, DISPLY
219CALPOS, POSCAL
220INTWRD, 0
221INTCNT, 0
222/CLOCK, 0
223HYPER, HYPSET
224MESOUT, CHARS
225THEADJ, THEAJI
226VEESCL, VEELIM
227ISHFT, DISHFT
228RESET1, RESE1
229GAMOVR, 0
230ACCFLG, 0
231ACCPER, -30
232MEXP, -400
233
234PROX, 0
235PROY, 0
236PROLIF, -360
237BUFTMP, 0
238ONEFIL, DISBUF
239TWOFIL, DISBUF+40
240
241P5, 5
242P10, 10
243P17, 17
244P20, 20
245P37, 37
246P40, 40
247P100, 100
248P132, 132
249P200, 200
250P400, 400
251P550, 550
252P3777, 3777
253
254M4, -4
255M6, -6
256M10, -10
257M11, -11
258M264, -264
259M200, -200
260M400, -400
261M550, -550
262
263IVCLDX, VCLDX
264IVCLDY, VCLDY
265
266/
267/ THE PROGRAM MAY BE STARTED OR RESTARTED AT ANYTIME AT 0200.
268/ THE DATA FILE ON PAGE ZERO IS CLEARED, ALL FLAGS INITIALIZED,
269/ AND THE SR EXAMINED. IF THE SR=0 THE DISPLAY UPDATE ROUTINES
270/ ARE SET TO PICK UP THE STATUS WORD FROM THE SR. IF THE SR
271/ DOES NOT EQUAL ZERO, THE STATUS WORD IS READ FROM THE EIGHT
272/ CONTINGENCY INPUTS ON THE BLUE RIBBON CONNECTOR OF THE AX08
273/ (XR OPTION ONLY). JUMP IS THEN TO THE DISPLAY
274/ FILE UPDATE TO START OFF THE GAME.
275/
276
277 *200
278
279START, CLA CLL /START OR RESTART HERE ANY OLD TIME
280 DIXY /TO GET THE VC8-E STARTED ONCE
281 LAS /SR
282/TMP SNA CLA
283 TAD SWRD /USE THE SR
284 TAD XROPT /USE THE BLUE RIBBON CONNECTOR
285 DCA COLDST /AND LEAVE IN THE TRAP LOCATION
286
287RESTRT, CLA CMA
288 XRCL
289 CLA CLL
290
291 TAD P17 /FIRST CLEAR THE POSITION AND DATA
292 DCA AUTO10 /TABLES OF THE TWO SHIPS
293 TAD TABLEN
294 DCA AUTO11
295 DCA I AUTO10
296 ISZ AUTO11
297 JMP .-2
298
299 TAD STRT1 /SET THE STARTING POSITIONS OF THE
300 DCA ONEPEX /TWO SHIPS
301 TAD STRT2
302 DCA TWOPEX
303 TAD P37 /SET TRIG FUNCTIONS JUST IN CASE
304 DCA ONECOS
305 TAD P37
306 DCA TWOCOS /ZERO DEGREES IS POINTING STRAIGHT UP
307 TAD ACCPER /SET COUNT FOR VELOCITY INCREASE
308 DCA ACCFLG
309 DCA ONEFIN /CLEAR ALL GAME END FLAGS
310 DCA TWOFIN
311 DCA GAMOVR
312 JMS I BUFSET /RESET ALL PROJECTILE DISPLAY BUFFERS
313
314
315 TCF /CLEAR OTHER REMAINING LIKELY FLAGS
316 PCF
317 RRB
318
319 CLA CMA / ALL ONES
320 CLZE / CLEAR CLOCK CONFIG REGISTER
321 CLA
322 TAD CDELY / LOAD NEG DELAY
323 CLAB / LOAD TO CLOCK BUFFER
324 CLA
325 TAD CCNF / LOAD CLOCK CONFIG
326 CLOE / SET CONFIG BITS
327
328 CLA CLL
329 JMP COLDST /AND GO TO IT
330
331CCNF, CR4+CMPROG+CION+COVSTAT / CLOCK CONFIGURATION
332CDELY, -310 / COUNTER PRESET (200)
333
334/
335/ UPDATE IS REACHED WHENEVER THE PROGRAM IS STARTED OR THE
336/ CLOCK COUNT OVERFLOWS INDICATING TIME TO RECALCULATE THE
337/ THE DISPLAY FILES AND REFRESH THE DISPLAY. THE INTERUPT
338/ COUNT IS RESTORED, THE STATUS WORD IS PICKED UP FROM EITHER
339/ THE SR OR BRC, AND THE RECALCULATION PROCESS BEGUN.
340/
341
342UPDATE, CLA CLL /HERE ON CLOCK COUNT OVERFLOW.
343 /START NEXT SWEEP
344COLDST, 0 /TRAP TO READ SR OR BRC
345 LAS /HERE FOR SR
346 DCA INTWRD /STORE TEMPORARILY
347 TAD INTWRD /MASK OUT LEFTMOST 4 BITS
348 RTR /FOR NUMBER ONE
349 RTR
350 AND LFTHAF
351 DCA INTTEM /AND STORE
352 TAD INTWRD /MASK OUT RIGHTMOST BITS FOR NUMBER TWO
353 AND RYTHAF
354 TAD INTTEM /ADD TOGETHER
355 JMP .+3 /AND CONTINUE
356
357CODST, XRIN /HERE FOR BRC - PICK UP AND CLEAR
358 XRCL
359 DCA INTWRD /CONTINUE
360 TAD M550 /RESTORE INTERUPT COUNT BEFORE NEXT
361 DCA INTCNT /UPDATE
362 ION /GET READY FOR THE NEXT CYCLE
363 TAD ACCFLG /ALLOW VELOCITY INCREASE THIS TIME?
364 IAC /ONLY WHEN ACCFLG=0
365 SMA SZA
366 TAD ACCPER /IF ZERO, RESET COUNT
367 DCA ACCFLG
368
369 JMP I .+1 /NOW GET DOWN TO WORK.
370 ONEUP
371
372BUFSET, SETBUF
373TABLEN, AUTO17-CALCOS
374INTTEM, 0
375LFTHAF, 0360
376RYTHAF, 0017
377STRT1, 1000
378STRT2, -1000
379SWRD, 2000-CODST
380XROPT, JMP CODST
381
382\f
383/
384/ THIS IS THE INTERUPT SERVICE ROUTINE. MOST OF THE
385/ INTERUPTS WILL BE FROM THE CRYSTAL CLOCK WHICH WILL BE
386/ COUNTED AND UNLESS THE COUNT OVERFLOWS THE INTERUPT IS
387/ DISMISSED IMMEDIATLY. IF THE COUNT OVER FLOWS, JMP IS TO
388/ UPDATE WITH IOF.
389/
390/ SPECIAL CASE IS KEYBOARD INTERUPT WHEN THE GAMOVR FLAG IS
391/ SET IN WHICH CASE THE GAME IS RESTARTED.
392/
393/ UNEXPECTED INTERUPTS ARE COUNTED AND AFTER ENOUGH OF THEM
394/ HAPPEN THE PROGRAM HALTS. IF THIS HAPPENS RELOAD OR FIND THE
395/ STRANGE FLAG
396/
397
398INTSER, DCA INTACC /HERE RIGHT AFTER INTERUPT - STORE
399 RAR /AC AND LINK
400 DCA INTLNK /FOR POSSIBLE CONTINUATION
401 CLSK /WAS IT THE CRYSTAL CLOCK?
402 JMP INTBUS /NO TRY SOMETHING ELSE
403 CLA IAC RTR /LOAD 4000
404 CLSA /GET CLOCKSTATUS AND RESET FLAG
405 CLA CLL
406 JMP UPDATE /YES, GO TO IT
407
408INTBUS, KSF /HERE ON NON-CLOCK INTERUPT
409 JMP .+5 /NOT THE KEYBOARD
410 KCC /CLEAR KEYBOARD FLAG
411 TAD GAMOVR /IS THE GAMEOVER
412 SZA CLA
413 JMP RESTRT /YES, RESTART
414/ TCF /NO, HELL WITH IT
415 ISZ INTGLH /COUNT ONE BADDIE
416 SKP
417 HLT /HALT IF TOO MANY BADDIES
418
419INTRET, CLA CLL /HERE TO DISMISS THE INTERUPT
420 TAD INTLNK
421 RAL
422 TAD INTACC
423 ION
424 JMP I 0
425
426INTACC, 0
427INTLNK, 0
428INTGLH, 0
429
430\f
431/
432/ NOW BEGINS THE GREAT UPDATE PROCEEDURE, FIRST FOR SHIP
433/ NUMBER ONE (THE DELTA SHAPED SHIP WHICH APPEARS ON
434/ THE LEFT AT THE START OF THE GAME). IF ALIVE THE STATUS
435/ WORD (INTWRD) IS TESTED FOR REQUESTS FOR LEFT TURN,
436/ RIGHT TURN, THRUST ON, AND LAUNCH PROJECTILE. THESE ACTIONS
437/ MAY OR MAY NOT BE ACTED UPON DEPENDING ON COUNTS AND FLAGS.
438/ WHEN THIS IS COMPLETE THE SAME OPERATION IS PERFORMED FOR
439/ NUMBER TWO.
440/
441
442 *400
443
444ONEUP, TAD ONEFLG /FIRST SEE IF IT'S IN NORMAL SPACE
445 SNA
446 JMP ONEOK /YES IT IS
447 IAC /NO, BUT IS IT JUST COMING OUT?
448 SNA
449 TAD ONEFIN /YES, THROW BACK IN IF ALREADY DESTROYED
450 DCA ONEFLG /OTHERWISE JUST COUNT ONE
451 JMP I ITWOUP /AND GO TO FIX UP NUMBER TWO
452
453ONEOK, TAD ONEOUT /IN NORMAL SPACE - IS IT EXPLODING?
454 SZA CLA
455 JMP ONEFIG /IF YES, ALLOW NO CONTROLS
456 TAD TWOFIN /HAS THE ENEMY BEEN VANQUISHED?
457 SZA CLA
458 JMS I ONEWN /YES, SIGNAL VICTORY
459 TAD INTWRD /NOW BEGIN TEST OF REQUEST
460 AND OP300 /LEFT AND RIGHT TURN TOGETHER MEAN HYPERSPACE!
461 TAD OM300 /TEST BITS 4 AND 5
462 SZA CLA
463 JMP ONELEF /NOPE, CONTINUE
464 CMA /YES, CALL HYPER WITH AC=-1 FOR NUMBER ONE
465 JMP I HYPER
466ONELEF, TAD INTWRD /REQUEST FOR LEFT TURN?
467 AND P200 /TEST BIT 4
468 SNA CLA
469 JMP ONERYT /NO
470 CLA CLL CMA /YES DECREMENT ANGLE
471 JMP ONEFIG
472
473ONERYT, TAD INTWRD /HOW ABOUT RIGHT TURN
474 AND P100 /TEST BIT 5
475 SZA CLA
476 IAC /YES, INCREMENT ANGLE
477
478ONEFIG, TAD ONETHE /PICK UP AND ADJUST ANGLE (MAYBE)
479 JMS I THEADJ /BRING BACK WITHIN LIMITS OF TRIG FUNCTIONS
480 DCA ONETHE /AND STORE
481 TAD ONETHE /FIND THEM TRIG FUNCTIONS
482 JMS I SINE /AND STORE ONCE AND FOR ALL
483 DCA ONESIN /IN THE APPROPRIATE PLACES
484 TAD ONETHE
485 JMS I COSINE
486 DCA ONECOS
487 TAD ONEOUT /DO NOT ALLOW THRUST IF EXPLODING
488 SZA CLA
489 JMP ONEVEL
490
491\f
492
493ONEMOV, TAD ACCFLG /ALLOW ANY VELOCITY INCREASE THIS CYCLE?
494 SZA CLA
495 JMP ONEVEL /NOPE
496 TAD INTWRD /YES, ANY REQUESTED?
497 AND P40 /TEST BIT 6
498 SNA CLA
499 JMP ONEVEL /NONE REQUESTED
500 TAD ONECOS /YES, ADD IN VELOCITY INCREMENT DEPENDING
501 TAD ONEVEY /ON ORIENTATION
502 JMS I VEESCL /BUT DO NOT ALLOW TO EXCEED MAXIMUM
503 DCA ONEVEY /AND STORE
504 TAD ONESIN /DO THE SAME FOR THE OTHER (X) COMPONENT
505 TAD ONEVEX
506 JMS I VEESCL
507 DCA ONEVEX
508
509
510
511ONEVEL, TAD ONEVEX /NOW UPDATE THE POSITION WITH THE
512 JMS I ISHFT /VELOCITY COMPONENTS DIVIDED BY 4
513 JMS I ISHFT /THIS MAINTAINS MAXIMUM RESOLUTION
514 TAD ONEPEX
515 DCA ONEPEX /IGNORE ANY OVERFLOW
516 TAD ONEVEY /DO THE SAME FOR Y COORDINATE
517 JMS I ISHFT /AND VELOCITY COMPONENT
518 JMS I ISHFT
519 TAD ONEPEY
520 DCA ONEPEY
521 TAD ONEOUT /DO NOT ALLOW PROJECTILE LAUNCH IF
522 SZA CLA /EXPLODING
523 JMP I ITWOUP
524
525\f
526
527ONELNC, TAD LNC1FG /OTHERWISE, SEE IF RELOAD IS FINISHED
528 SNA CLA
529 JMP .+3
530 ISZ LNC1FG /NO, CONTINUE RELOADING
531 JMP I ITWOUP /AND EXIT
532 TAD INTWRD /YES, READY TO LAUNCH, TRIGGER BEEN PULLED?
533 AND P20 /TEST BIT7
534 SNA CLA
535 JMP I ITWOUP /NO, WAIT FOR A BETTER SHOT
536 /.....I GUESS.....
537 TAD PROLIF /YES, SET CYCLE COUNT FOR THIS LAUNCH
538 DCA I AUTO16 /AUTO16 ALWAYS POINTS AT THE NEXT SLOT IN THE FILE
539 TAD ONEVEX /ADD SHIPS VELOCITY (SCALED OF COURSE)
540 JMS I ISHFT /TO ORIENTATION TO EXTABLISH X VELOCITY
541 JMS I RSHIFT /COMPONENT OF PROJECTILE
542 TAD ONESIN
543 JMS I RSHIFT /AND STICK IT IN THE FILE
544 DCA I AUTO16
545 TAD ONESIN /MOVE THE LAUNCH POINT OUTSIDE THE
546 CLL RTL /SHIP OF ORIGIN
547 TAD ONEPEX
548 DCA I AUTO16 /AND STORE X POSITION
549 TAD ONEVEY /NOW DO THE SAME FOR THE Y VELOCITY AND
550 JMS I ISHFT /POSITION
551 JMS I RSHIFT
552 TAD ONECOS
553 JMS I RSHIFT
554 DCA I AUTO16
555 TAD ONECOS
556 CLL RTL
557 TAD ONEPEY
558 DCA I AUTO16
559 TAD M200 /START RELOAD CYCLE
560 DCA LNC1FG
561 JMS I RESET1 /RESET AUTO16 TO NEXT HOLE
562
563 JMP I .+1 /NOW TO FIX IT UP WITH NUMBER TWO
564ITWOUP, TWOUP
565
566LNC1FG, 0 /PROJECTILE LAUNCH ENABLE
567
568OP300, 300 /HYPERSPACE REQUEST CODE BITS 4 AND 5
569OM300, -300
570ONEWN, ONEWIN /POINTER TO VICTORY MESSAGE
571
572\f
573/
574/ HERE BEGINS THE UPDATE PROCEEDURE FOR SHIP NUMBER TWO.
575/ OPERATION IS THE SAME AS FOR NUMBER ONE ABOVE.
576/
577
578 *600
579
580TWOUP, TAD TWOFLG /FIRST SEE IF IT'S IN NORMAL SPACE
581 SNA
582 JMP TWOOK /YES, CONTINUE
583 IAC /NO, BUMP COUNT AND TEST FOR REENTRY
584 SNA
585 TAD TWOFIN /IF RE-ENTERING THROW BACK OUT IF FINISHED
586 DCA TWOFLG /AND CONTINUE
587 JMP I IONEST
588
589TWOOK, TAD TWOOUT /HERE WHEN READY TO UPDATE IN NORMAL SPACE
590 SZA CLA /IS IT EXPLODING?
591 JMP TWOFIG /YES DO NOT ALLOW HYPERSPACE
592 TAD ONEFIN /DID WE JUST WIN?
593 SZA CLA
594 JMS I TWOWN /YES ENABLE END OF GAME MESSAGE
595 TAD INTWRD /TEST FOR HYPERSPACE REQUEST
596 AND OP14
597 TAD OM14 /BITS 8 AND 9 MUST BE SET
598 SNA CLA
599 JMP I HYPER /8 AND 9 SET. ENTER HYPER ROUTINE WITH AC=0
600 /FOR SHIP NUMBER 2
601TWOLEF, TAD INTWRD /TEST FOR LEFT TURN - BIT 8
602 AND P10
603 SNA CLA
604 JMP TWORYT /NOT SET
605 CLA CLL CMA /SET, DECREMENT TWOTHE BY 1 DEGREE
606 JMP TWOFIG /SKIP TEST FOR RIGHT TURN
607
608TWORYT, CLA CLL IAC RTL /TEST FOR RIGHT TURN - BIT 9
609 AND INTWRD
610 SZA CLA
611 IAC /IF SET INCREMENT TWOTHE BY 1 DEGREE
612
613TWOFIG, TAD TWOTHE /UPDTAE TWOTHE
614 JMS I THEADJ /BRING TO WITHIN LIMITS OF SINE,COSINE
615 DCA TWOTHE /AND STORE
616 TAD TWOTHE
617 JMS I SINE /CALCULATE SINE AND COSINE FUNCTIONS
618 DCA TWOSIN /AND STORE IN DATA TABLE
619 TAD TWOTHE
620 JMS I COSINE
621 DCA TWOCOS
622 TAD TWOOUT /DO NOT ALLOW VELOCITY CHANGE IF EXPLODING
623 SZA CLA
624 JMP TWOVEL
625
626\f
627
628TWOMOV, TAD ACCFLG /NOW FOR ACCELERATION. TEST TO SEE IF ALLOWED
629 SZA CLA /DURING THIS UPDATE CYCLE
630 JMP TWOVEL /NOPE
631 CLL IAC RAL /YES, TEST FOR BIT 2 SET
632 AND INTWRD
633 SNA CLA
634 JMP TWOVEL /NOT SET
635
636 TAD TWOSIN /UPDATE X VELOCITY COMPONENT BY SINE OF
637 TAD TWOVEX /ANGLE OF ORIENTATION
638 JMS I VEESCL /AND SCALE TO NOT EXCEED MAX
639 DCA TWOVEX /UPDATE Y COMPONENT WITH COSINE
640
641 TAD TWOCOS
642 TAD TWOVEY
643 JMS I VEESCL
644 DCA TWOVEY
645
646
647
648TWOVEL, TAD TWOVEX /NOW UPDATE THE POSITION WITH THE VELOCITY
649 JMS I ISHFT /COMPONENTS/16
650 JMS I ISHFT
651 TAD TWOPEX
652 DCA TWOPEX
653 TAD TWOVEY
654 JMS I ISHFT
655 JMS I ISHFT
656 TAD TWOPEY
657 DCA TWOPEY
658 TAD TWOOUT
659 SZA CLA
660 JMP I IONEST
661
662\f
663
664TWOLNC, TAD LNC2FG /NOW CHECK FOR PROJECTILE LAUNCH. FIRST
665 SNA CLA /TEST TO SEE IF RELOAD COMPLETE
666 JMP .+3
667 ISZ LNC2FG /NO, COUNT ONE CYCLE AND EXIT
668 JMP I IONEST
669 IAC /YES, TEST TRIGGER BIT 11
670 AND INTWRD
671 SNA CLA
672 JMP I IONEST /NOT SET, HELL WITH IT
673
674 TAD PROLIF /OK, SET PROJECTILE LIFE
675 DCA I AUTO16 /AUTO16 IS ALWAYS POINTING AT THE NEXT SLOT
676 TAD TWOVEX /ADD SHIPS VELOCITY
677 JMS I ISHFT /(ADJUSTED)
678 JMS I RSHIFT
679 TAD TWOSIN /TO THAT OF PROJECTILE - AGAIN X COMPONENT
680 JMS I RSHIFT /FROM SINE OF ANGLE OF ORIENTATION
681 DCA I AUTO16
682 TAD TWOSIN /SET INITIAL POSITION TO BE JUST AHEAD
683 CLL RTL /OF THE SHIP
684 TAD TWOPEX /X COMPONENT
685 DCA I AUTO16
686 TAD TWOVEY /NOW THE Y COMPONENTS FROM Y VELOCITY
687 JMS I ISHFT /Y POSITION AND COSINE
688 JMS I RSHIFT
689 TAD TWOCOS
690 JMS I RSHIFT
691 DCA I AUTO16
692 TAD TWOCOS
693 CLL RTL
694 TAD TWOPEY
695 DCA I AUTO16
696 TAD M200
697 DCA LNC2FG /200 CYCLES OF RELOAD
698 JMS I RESET1 /DRINK LEADEN DEATH, NUMBER ONE!
699
700 JMP I .+1 /FINAL EXIT TO DISPLAY FILE CALCULATIONS
701IONEST, ONESET
702
703LNC2FG, 0 /RELOAD COUNT
704
705OP14, 14 /HYPERSPACE CODE
706OM14, -14
707TWOWN, TWOWIN
708
709\f
710/
711/ HERE BEGINS THE DISPLAY CALCULATIONS FOR THE TWO SHIPS. AT
712/ THIS POINT ONLY THE POSITION AND ORIENTATION OF EACH VESSEL
713/ IS ONF INTEREST SINCE THE VELOCITY AND ALL THAT HAVE ALREADY
714/ BEEN TAKEN CARE OF. FOR THE BOTH SHIPS THE DISPLAY FILES ARE
715/ CALCULATED AS A SERIES OF PAIRS OF X,Y COORDINATES. BETWEEN
716/ EACH PAIR OF POINTS A FOUR POINT VECTOR WILL BE DRAWN. THE
717/ ACTUAL COORDINATES ARE CALCULATED AS DISPLACEMENTS
718/ FROM THE CENTRAL PSOTION OF THE SHIP, TAKING INTO ACCOUNT THE
719/ ANGLE OF ORIENTATION. THE FORMULAS FOLLOWED ARE:
720/
721/ X(POINT)=X(BASE)+X(REL)*COS[THE]+Y(REL)*SINE[THE]
722/
723/ Y(POINT)=Y(BASE)+Y(REL)*COS[THE]-X(REL)*SINE[THE]
724/
725/ WHERE SINE[THE] AND COS[THE] ARE THE FUNCTIONS OF THE
726/ ANGLE OF ORIENTATION, X(BASE) AND Y(BASE) ARE THE
727/ COORDINATES OF THE SHIPS POSITION AND X(REL) AND Y(REL)
728/ CORRESPOND TO DISPLACEMENT PAIRS DEPENDING ON THE SHAPE
729/ OF THE FIGURE. ALL X AND Y RELS LIE WITHIN THE RANGE 0-3 AND
730/ THERE FORE ALL NECESSARY DISPLACEMENTS FROM BASE COORDINATES
731/ MAY BE CALCULATEDFROM DIFFERENT COMBINATIONS OF T10SIN, T20COS
732/ ETC. THESE VALUES ARE CALCULATED BY A CALL TO POSCAL WITH THE SINE
733/ AND COSINE OF THE ANGLE OF INTEREST IN CALSIN AND CALCOS.
734/
735/ FOLLOWING THIS METHOD ANY FIGURE DESCRIBABLE WITH A 7 BY 7
736/ MATRIX OF POINTS MAY BE QUICKLY CALCULATED.
737/
738/ BEGINNING AT ONESET DIFFERENT DISPLACEMENT PAIRS ARE CALCULATED
739/ AND DEPOSITIED THROUGH AUTO10 TO FORM THE DISPLAY FILE FOR SHIP NUMBER ONE.
740/
741
742
743 *1000
744
745ONESET, CLA CLL /BEGIN DISPLAY FILE FOR NUMBER ONE
746 TAD ONEFLG /DONT BOTHER IF NOT IN NORMAL SPACE
747 SZA CLA
748 JMP I ITWOST
749 TAD ONESIN /SET UP FOR MATRIX COMPONENT CALCULATIONS
750 DCA CALSIN
751 TAD ONECOS
752 DCA CALCOS
753 JMS I CALPOS /CALL THE CALCULATOR
754
755/
756/ CONSIDER THE 7 BY 7 MATRIX OF DISPLACEMENT POINTS WITH THE
757/ CENTER AT 0,0 CORRESPONDING TO THE SHIPS POSITION. A SERIES
758/ OF POINTS IS NOW DESCRIBED AROUND THIS CENTER USING THE
759/ MULTIPLES OF THE TRIG FUNCTIONS JUST CALCULATED
760/ SO THAT ANY POINT ON THE OUTLINE IS DESCRIBABLE AS X,Y
761/ DISPLACED BY X,Y OF THE SHIP ITSELF
762/
763
764 TAD ONEFIL /SET UP AUTO10 AS THE DISPLAY FILE
765 DCA AUTO10 /POINTER
766 TAD ONEPEX /THE FIRST POINT OF THE OUTLINE IS
767 TAD T30SIN
768 DCA I AUTO10 / 0,3 OR TOP CENTER
769 TAD ONEPEY
770 TAD T30COS
771 DCA I AUTO10
772
773 TAD T10COS
774 CIA /THE SECOND IS
775 TAD ONEPEX
776 DCA I AUTO10 / -1,0
777 TAD T10SIN /OR JUST LEFT OF DEAD CENTER
778 TAD ONEPEY /AND SO ON
779 DCA I AUTO10
780
781 TAD T30SIN
782 TAD T30COS /THE THIRD POINT IS
783 CIA
784 TAD ONEPEX / -3,-3
785 DCA I AUTO10
786 TAD T30COS /OR BOTTOM LEFT HAND CORNER
787 CIA
788 TAD T30SIN
789 TAD ONEPEY
790 DCA I AUTO10
791
792\f
793
794 TAD T10SIN
795 CIA /FOURTH POINT
796 TAD ONEPEX
797 DCA I AUTO10 / 0,-1
798 TAD T10COS
799 CIA /OR JUST BELOW CENTER
800 TAD ONEPEY
801 DCA I AUTO10
802
803FLAM1, TAD INTWRD /TEST FOR POWER ON. IF ON, DRAW THE
804 AND P40 /FLAME WITH AN EXTRA POINT SOME
805 SNA CLA /DISTANCE DIRECTLY BELOW THE SHIP
806 JMP ONECON /POWER NOT ON - CONTINUE
807 TAD ONEOUT /DO NOT ALLOW IF EXPLODING
808 SZA CLA
809 JMP ONECON
810
811 TAD ONFG1 /USE ONFG1 TO TURN THE FLAME ON AND
812 SNA /OFF TO MAKE IT FLICKER. DISPLAY THE
813 CLA CLL CMA RAL /FLAME ONE TIME OUT OF THREE
814 DCA ONFG1
815
816 ISZ ONFG1
817 JMP ONECON /ONE OUT OF THREE TIMES THIS WILL SKIP
818
819 TAD ONFG2 /VARY ALSO THE LENGHT OF THE FLAME
820 CMA /WITH LONG SHORT LONG SHORT
821 DCA ONFG2
822
823 TAD ONFG2 /TIP OF FLAME AT EITHER
824 SNA CLA
825 TAD T10SIN / 0,-4 OR
826 TAD T30SIN / 0,-3
827 CIA
828 TAD ONEPEX
829 DCA I AUTO10
830 TAD ONFG2
831 SNA CLA
832 TAD T10COS
833 TAD T30COS
834 CIA
835 TAD ONEPEY
836 DCA I AUTO10
837
838 TAD T10SIN
839 CIA
840 TAD ONEPEX /RETURN DISPLAY TO 0,-1
841 DCA I AUTO10
842 TAD T10COS
843 CIA
844 TAD ONEPEY
845 DCA I AUTO10
846 CLA CLL CMA RAL /ADD -2 TO POINT COUNT
847
848\f
849
850ONECON, TAD M6 /SET POINT COUNT TO -6 OR -8
851 DCA ONECNT
852
853 TAD T30SIN /CONTINUE WITH DISPLAY FILE - THIS POINT
854 CIA
855 TAD T30COS / AT 3,-3
856 TAD ONEPEX /
857 DCA I AUTO10 /OR LOWER RIGHT HAND CORNER
858 TAD T30SIN
859 TAD T30COS
860 CIA
861 TAD ONEPEY
862 DCA I AUTO10
863
864 TAD T10COS /NEXT
865 TAD ONEPEX /
866 DCA I AUTO10 / 1,0
867 TAD T10SIN /
868 CIA / OR JUST RIGHT OF CENTER
869 TAD ONEPEY
870 DCA I AUTO10
871
872 TAD T30SIN /FINALLY BACK TO
873 TAD ONEPEX /
874 DCA I AUTO10 / 0,3
875 TAD T30COS /
876 TAD ONEPEY / TOP CENTE
877 DCA I AUTO10
878
879 JMP I ITWOST /NOW FOR NUMBER TWO
880ITWOST, TWOSET
881
882ONFG1, 0 /USED TO COUNT FLICKERS
883ONFG2, 0 /SHORT OR LONG FLAG
884
885\f
886/
887/ HERE BEGINS THE DISPLAY FILE GENERATOR FOR SHIP TWO.
888/ IT WORKS JUST LIKE THE ONE FOR NUMBER ONE BUT WITH
889/ DIFFERENT DISPLACEMENT PAIRS AND TWO EXTRA POINTS
890/
891
892 *1200
893
894TWOSET, CLA CLL /DONT BOTHER IF NOT IN NORMAL SPACE
895 TAD TWOFLG
896 SZA CLA
897 JMP I IFILDS
898 TAD TWOSIN /SET UP TO HAVE DISPLACEMENT INCREMENTS
899 DCA CALSIN /CALCULATED
900 TAD TWOCOS
901 DCA CALCOS
902 JMS I CALPOS
903
904 TAD TWOFIL /SET AUTO10 TO POINT TO SECOND DISPLAY
905 DCA AUTO10 /FILE
906 TAD T30SIN /FIRST POINT AT
907 TAD TWOPEX /
908 DCA I AUTO10 / 0,3
909 TAD T30COS /
910 TAD TWOPEY / OR TOP CENTER
911 DCA I AUTO10
912
913 TAD T20COS
914 CIA
915 TAD T20SIN
916 TAD TWOPEX
917 DCA I AUTO10
918 TAD T20SIN
919 TAD T20COS /SECOND POINT
920 TAD TWOPEY / -2,2
921 DCA I AUTO10
922
923 TAD T20COS /THIRD POINT
924 CIA / -2,0
925 TAD TWOPEX
926 DCA I AUTO10
927 TAD T20SIN
928 TAD TWOPEY
929 DCA I AUTO10
930
931
932
933 TAD T20COS
934 TAD T30SIN
935 CIA
936 TAD TWOPEX /FOURTH POINT
937 DCA I AUTO10 / -2,-3
938 TAD T30COS
939 CIA
940 TAD T20SIN
941 TAD TWOPEY
942 DCA I AUTO10
943
944\f
945
946 TAD T20SIN
947 CIA /NEXT
948 TAD TWOPEX / 0,-2
949 DCA I AUTO10
950 TAD T20COS
951 CIA
952 TAD TWOPEY
953 DCA I AUTO10
954
955FLAM2, CLA CLL IAC RAL /NOW THE FLAME BIT. CHECK FOR POWER ON
956 AND INTWRD
957 SNA CLA
958 JMP TWOCON /NO, FORGET IT
959 TAD TWOOUT /NOT ALLOWED IF EXPLODING
960 SZA CLA
961 JMP TWOCON
962
963 TAD TWFG1 /SET THE 1-3 FLICKER AS WITH #1
964 SNA
965 CLA CLL CMA RAL
966 DCA TWFG1
967
968 ISZ TWFG1 /ALSO THE LENGHT VARIATION
969 JMP TWOCON
970
971 TAD TWFG2 /EVERY OTHER TIME LONG
972 CMA
973 DCA TWFG2
974 /FLAME TIP AT EITHER
975 TAD TWFG2 / 0,-3
976 SNA CLA /OR
977 TAD T20SIN / 0,-5
978 TAD T30SIN
979 CIA
980 TAD TWOPEX
981 DCA I AUTO10
982 TAD TWFG2
983 SNA CLA
984 TAD T20COS
985 TAD T30COS
986 CIA
987 TAD TWOPEY
988 DCA I AUTO10
989
990 TAD T20SIN /NOW BACK UP TO THE SHIP
991 CIA
992 TAD TWOPEX
993 DCA I AUTO10
994 TAD T20COS
995 CIA
996 TAD TWOPEY
997 DCA I AUTO10
998
999 CLA CLL CMA RAL /ADD -2 TO POINT COUNT
1000
1001\f
1002
1003TWOCON, TAD M10 /SET POINT COUNT TO -8 OR -10
1004 DCA TWOCNT
1005
1006 TAD T30SIN /CONTINUE WITH DISPLAY FILE
1007 CIA /NEXT POINT AT 2,-3
1008 TAD T20COS
1009 TAD TWOPEX
1010 DCA I AUTO10
1011 TAD T30COS
1012 TAD T20SIN
1013 CIA
1014 TAD TWOPEY
1015 DCA I AUTO10
1016
1017
1018
1019 TAD T20COS /NEXT POINT
1020 TAD TWOPEX /
1021 DCA I AUTO10 / 2,0
1022 TAD T20SIN
1023 CIA
1024 TAD TWOPEY
1025 DCA I AUTO10
1026
1027 TAD T20COS /AND THE NEXT AT
1028 TAD T20SIN
1029 TAD TWOPEX / 2,2
1030 DCA I AUTO10
1031 TAD T20SIN
1032 CIA
1033 TAD T20COS
1034 TAD TWOPEY
1035 DCA I AUTO10
1036
1037 TAD T30SIN
1038 TAD TWOPEX
1039 DCA I AUTO10
1040 TAD T30COS /AND THE LAST AT
1041 TAD TWOPEY /
1042 DCA I AUTO10 / 0,3
1043
1044 JMP I IFILDS /NOW TO DISPLAY THE WHOLE MESS
1045IFILDS, FILDIS
1046
1047TWFG1, 0 /FLIK THE FLAME
1048TWFG2, 0 /LONG OR SHORT
1049
1050\f
1051/
1052/ HERE TO DISPLAY THE TWO SHIPS. CHECK FIRST FOR COLLISION
1053/ AND THEN SET THE TWO PAIRS OF COORDENATES FOR THE END
1054/ POINTS AND CALL THE "VECTOR GENERATOR" TO DRAW THE DOTS
1055/ IN BETWEEN. WHEN THE COUNT OVERFLOWS DO THE SAME FOR
1056/ NUMBER TWO. THEN EXIT TO DISPLAY ALL THE PROJECTILES.
1057/
1058
1059 *1400
1060
1061FILDIS, CLA CLL /ALL SET TO GO
1062 JMS I COLIDE /TEST FOR COLLISION FIRST
1063/ DSB 1 /IF NO COLLISION
1064 TAD ONEFLG /SKIP NUMBER ONE IF NOT IN NORMAL
1065 SZA CLA /SPACE
1066 JMP TWODIS
1067
1068 TAD ONEFIL /SET UP POINTERS TO DISPLAY FILE
1069 DCA AUTO10 /FOR NUMBER ONE
1070 TAD ONECNT /ALONG WITH VECTOR COUNT
1071 DCA AUTO11
1072 TAD I AUTO10 /SET OUT THE FIRST POINT PAIR
1073 DCA XONEDS
1074 TAD I AUTO10
1075 DCA YONEDS
1076 TAD ONEOUT /NORMAL DISPLAY OR EXPLOSION?
1077 SZA CLA
1078 JMP I IONEEX /GO ELSE WHERE FOR EXPLOSION
1079
1080FILONE, TAD I AUTO10 /STEP TO NEXT PAIR OF POINTS
1081 DCA XTWODS /SET X AND Y TO NEW POINT
1082 TAD I AUTO10
1083 DCA YTWODS
1084 JMS I VECTOR /CALL THE DOT DRAWING MACHINE
1085 ISZ AUTO11
1086 SKP /COUNT
1087 JMP TWODIS /DO NUMBER TWO ON OVERFLOW
1088 TAD XTWODS /SWAP POINTS FOR NEXT PAIR
1089 DCA XONEDS
1090 TAD YTWODS /THE GENERATOR DRAWS FROM ONE
1091 DCA YONEDS /TOWARDS TWO
1092 JMP FILONE
1093
1094\f
1095
1096TWODIS, TAD TWOFLG /HERE TO DO NUMBER TWO
1097 SZA CLA /BUT NOT IF IN HYPER SPACE
1098 JMP I IPRODS
1099
1100 TAD TWOFIL /SET UP FILE POINTER AS IN ONE
1101 DCA AUTO10
1102 TAD TWOCNT /AND THE COUNT
1103 DCA AUTO11
1104 TAD I AUTO10 /I SUPPOSE THIS COULD BE A SUBROUTINE TOO
1105 DCA XONEDS
1106 TAD I AUTO10
1107 DCA YONEDS
1108 TAD TWOOUT /IS IT EXPLODING?
1109 SZA CLA
1110 JMP I ITWOEX /YES, HOW EXCITING
1111
1112TWDLOP, TAD I AUTO10 /NO HOW DULL, STICK IN NEXT PAIR OF
1113 DCA XTWODS /POINTS
1114 TAD I AUTO10
1115 DCA YTWODS /AND CALL THE VECTOR SEQUENCE
1116 JMS I VECTOR
1117 ISZ AUTO11
1118 JMP .+3
1119
1120 JMP I .+1 /WHEN COUNT OVERFLOWS GO ON TO
1121IPRODS, PRODIS /DO THE PROJECTILE THING
1122
1123 TAD XTWODS /OTHERWISE SWAP ON TO THE NEXT PAIR
1124 DCA XONEDS /OF POINTS
1125 TAD YTWODS
1126 DCA YONEDS
1127 JMP TWDLOP
1128
1129COLIDE, COLLID
1130IONEEX, ONEEXP
1131ITWOEX, TWOEXP
1132
1133\f
1134/
1135/ THIS IS THE SO CALLED "VECTOR GENERATOR" WHICH DRAWS A
1136/ SERIES OF DOTS FROM XONEDS,YONEDS TO XTWODS,YTWODS.
1137/ THE COORDINATE COMPONENTS ARE DIVIDED INTO FOURTHS AND
1138/ FOUR DOTS DRAWN ON THE SCOPE SCREEN. NOTE THAT NO DOT
1139/ IS DRAWN AT XONEDS,YONEDS. THIS IS COMPENSATED FOR ELSEWHERE.
1140/
1141
1142DISPLY, 0 /ENTER TO DRAW A FOUR POINT VECTOR
1143 CLA
1144 TAD XONEDS /FROM XONEDS,YONEDS
1145 CIA /TO XTWODS,YTWODS
1146 TAD XTWODS /DIVIDE COORDINATE DIFERENCES INTO
1147 JMS DISHFT /FOURTHS
1148 DCA DIXTEM /AND STORE INCREMENT
1149 TAD YONEDS
1150 CIA
1151 TAD YTWODS
1152 JMS DISHFT /FOURTHS
1153 DCA DIYTEM
1154 TAD M4 /FOR FOUR DOTS
1155 DCA DISCNT
1156
1157DISLOP, TAD XONEDS /ADD INCREMENT TO CURRENT X AND Y
1158 TAD DIXTEM
1159 DCA XONEDS /NOTE THAT THIS ROUTINE DESTROYS
1160 TAD YONEDS /XONEDS AND YONEDS
1161 TAD DIYTEM
1162 DCA YONEDS
1163 TAD XONEDS
1164/ RTR /DIVIDE BY 8 TO FIT SCREEN SIZE
1165/ RAR
1166 DXC DXL /SET X VALUE
1167 CLA
1168 TAD YONEDS /DO THE SAME FOR Y
1169/ RTR
1170/ RAR
1171 DYC DYL DIS /AT LAST SOMETHING TO SEE!!
1172 CLA
1173 ISZ DISCNT /DONE YET?
1174 JMP DISLOP /NOPE
1175 JMP I DISPLY /YUP
1176
1177
1178DISHFT, 0 /A GENERALIZED SHIFT ROUTINE CALLED
1179 CLL /FROM EVERYWHERE TO DIVIDE THE
1180 SPA /AC BY FOUR WITH AN ASR RIGHT
1181 CML IAC /NOTE THAT NEGATIVE NUMBERS ARE
1182 RAR /ROUNDED UPWARDS (TOWARD ZERO)
1183 CLL /TO MAKE IT COME OUT RIGHT
1184 SPA
1185 CML IAC /EVEN SO THERE ARE SOME ROUNDING ERRORS
1186 RAR /SOMEWHERE. SO MUCH FOR 12 BIT MACHINES
1187 JMP I DISHFT
1188
1189\f
1190/
1191/ HERE TO DISPLAY ALL THE PROJECTILES AND TEST FOR HITS.
1192/ THE PROJECTILE DISPLAY FILE IS SEARCHED FOR PROJECTILES WITH
1193/ NON-ZERO COUNTS AND WHEN ONE IS FOUND THE POSITION IS
1194/ UPDATED BY THE VELOCITY, THE POINT DISPLAYED AND TESTED FOR
1195/ A HIT.
1196/
1197
1198 *1600
1199
1200PRODIS, CLA CLL / BEGIN DISPLAY OF THE PROJECTILES
1201 TAD BUFST /POINT TO BEGINNING OF DISPLAY FILE
1202 DCA BUFTMP
1203/ DSB 2 /SET EXTRA BRIGHT FOR SINGLE POINTS
1204
1205PROLOP, TAD I BUFTMP /PICK UP NEXT COUNT
1206 SNA
1207 JMP EXPIRE /THIS ONE IS DEAD - GO TO THE NEXT
1208 IAC /INCREMENT COUNT AND REPLACE
1209 DCA I BUFTMP
1210 ISZ BUFTMP /BUMP POINTER TO X VELOCITY
1211 TAD I BUFTMP
1212 ISZ BUFTMP /THEN TO XPOSITION AND UPDATE X POSITION
1213 TAD I BUFTMP /WITH THE VELOCITY WHICH IS CONSTANT
1214 DCA I BUFTMP
1215 TAD I BUFTMP
1216 DCA PROX /AND STORE X POSITION FOR DISPLAY AND TEST
1217 ISZ BUFTMP /NOW TO Y POSITION AND VELOCITY
1218 TAD I BUFTMP
1219 ISZ BUFTMP
1220 TAD I BUFTMP /SAME LITTLE GAME
1221 DCA I BUFTMP
1222 TAD I BUFTMP
1223 DCA PROY /STORE THE NEW Y VALUE
1224
1225 TAD PROX /DISPLAY THE POINT WITH
1226/ RTR /THE SAME SHIFT AS FOR THE SHIPS
1227/ RAR /FOR THE SMALL SCREEN
1228 DXC DXL
1229 CLA
1230 TAD PROY
1231/ RTR /
1232/ RAR
1233 DYC DYL DIS /THERE IT IS!!
1234 CLA
1235 JMS I CHKOUT /TEST FOR A HIT
1236 ISZ BUFTMP /MOVE POINTER ON AND TEST FOR END
1237 TAD BUFTMP /OF BUFFER
1238 TAD BUFLIM
1239 SZA CLA
1240 JMP PROLOP /NOT AT END - CONTINUE
1241
1242\f/
1243/ HERE AT THE END OF THE PROJECTILE DISPLAY. IF THE GAMOVR
1244/ FLAG IS SET, GO ON TO THE MESSAGE DISPLAY - VICTORY LAP
1245/ SECTION. OTHERWISE PICK UP THE REMAINING CLOCK COUNT
1246/ TO GIVE THE FANS SOMETHING TO LOOK AT, AND MOVE THE
1247/ ELECTRON BEAM TO A LOWER CORNER. THE COUNT DISPLAYED
1248/ IN THE AC IS THE NUMBER OF 100 USEC CLOCK TICKS REMAINING
1249/ WHEN THIS CODE IS REACHED BEFORE THE NEXT UPDATE WOULD
1250/ BEGIN. TURNS OUT THAT ROUGHLY 2/3 OF THE CPU IS LEFT
1251/ OVER SHOULD ANYONE WANT TO DO ANYTHING VERY FANCY.
1252/
1253
1254
1255FINISH, TAD GAMOVR /IS THIS THE VICTORY LAP OR WHAT?
1256 SZA CLA
1257 JMP I ENDGAM /YES, GO TO PUT UP THE MESSAGE
1258/ TAD M400 /MOVE THE BEAM OFF SCREEN
1259/ DYC DYL
1260 CLA CLL
1261/ DXC DXL
1262 TAD INTCNT /PICK UP THE COUNT
1263 CIA
1264 JMP .
1265
1266ENDGAM, JOBLOP
1267
1268
1269EXPIRE, TAD BUFTMP /HERE TO ADVANCE THE BUFFER
1270 TAD P5 /POINTER TO THE NEXT PROJECTILE
1271 DCA BUFTMP /UNLESS THE END
1272 TAD BUFTMP /OF THE BUFFER
1273 TAD BUFLIM /IS REACHED
1274 SZA CLA /IN WHICH CASE
1275 JMP PROLOP /IT
1276 JMP FINISH /QUITS
1277
1278BUFST, DISBUF+101
1279BUFLIM, -DISBUF-175
1280CHKOUT, CHECK
1281
1282RESE1, 0 /THIS IS CALLED TO SET THE POINTER
1283 TAD MRES /(AUTO16) TO THE NEXT FREE SLOT
1284 DCA RESCNT /FOR A PROJECTILE LAUNCH. 12 POSSIBLE
1285
1286RESLOP, TAD RESPNT /MOVE THE POINTER TO THE NEXT SLOT
1287 TAD P5
1288 DCA RESPNT
1289 TAD RESPNT /RESTE IF AT END OF BUFFER
1290 TAD BUFLIM
1291 SZA CLA
1292 JMP RESCON
1293 TAD BUFST
1294 DCA RESPNT
1295
1296RESCON, TAD I RESPNT /FIND A HOLE YET?
1297 SNA CLA
1298 JMP RESFND /YES, SET UP AUTO16
1299 ISZ RESCNT /NO COUNT
1300 JMP RESLOP /AND TRY AGAIN
1301 HLT /NO HOLES AT ALL?
1302
1303RESFND, CMA /BACK THE POINTER FOR AUTO INDEXING
1304 TAD RESPNT
1305 DCA AUTO16
1306 JMP I RESE1
1307
1308MRES, -14
1309RESCNT, 0
1310RESPNT, 0
1311
1312SETBUF, 0
1313 CMA /THIS ROUTINE IS CALLED FROM THE
1314 TAD BUFST /STARTING SEQUENCE TO INITIALIZE ALL
1315 DCA AUTO16 /THE BUFFER POINTERS AND SO ON
1316 TAD BUFST
1317 DCA BUFTMP
1318 TAD BUFST
1319 DCA RESPNT
1320 TAD BUFST
1321 DCA SETPNT
1322SETLOP, DCA I SETPNT
1323 ISZ SETPNT
1324 TAD SETPNT
1325 TAD BUFLIM
1326 SZA CLA
1327 JMP SETLOP
1328 JMP I SETBUF
1329
1330SETPNT, 0
1331
1332\f
1333/
1334/ THIS HERE NOW THING CHECKS THE COORDINATES OF THE MOST RECENTLY
1335/ DISPLAYED PROJECTILE AGAINST THOSE OF THE SHIPS ON THE SCREEN.
1336/ IF WITH A COLLISION LIMIT A HIT IS RECORDED AND THE LIFE
1337/ COUNT OF THE PROJECTILE ZEROED TO REMOVE IT. A HIT SHIP
1338/ IS SUITABLY FLAGGED
1339/
1340
1341 *2000
1342
1343CHECK, 0 /HERE TO TEST FOR A PROJECTILE HIT
1344 TAD ONEFLG /CANT HIT SOMETHING IN HYPERSPACE
1345 SZA CLA
1346 JMP CHECK2
1347 TAD ONEOUT /OR SOMETHING THAT'S BEEN HIT
1348 SZA CLA
1349 JMP CHECK2
1350
1351 TAD PROX /CHECK X COORDINATES OF SHIP ONE
1352 CIA /AND PROJECTILE
1353 TAD ONEPEX /THIS SORT OF THING IS WHY THE
1354 SPA /COORDINATES HAVE TO BE MAINTAINED TO 12
1355 CIA /BITS
1356 TAD LIMIT /CLOSE ENOUGH?
1357 SMA CLA
1358 JMP CHECK2 /IF X ISN' CLOSE ENOUGH THEN NO HIT
1359 TAD PROY /X WAS CLOSE ENOUGH, HOW ABOUT Y?
1360 CIA
1361 TAD ONEPEY
1362 SPA
1363 CIA
1364 TAD LIMIT
1365 SMA CLA
1366 JMP CHECK2 /NO HIT
1367
1368 TAD MEXP /DEPOSIT EXPLOSION COUNT IN ONEOUT
1369 DCA ONEOUT /ALL THAT IS NECESSARY
1370 JMS CUTOUT /REMOVE PROJECTILE
1371
1372\f
1373
1374CHECK2, TAD TWOFLG /NO HIT ON NUMBER ONE, TRY NUMBER TWO
1375 SZA CLA
1376 JMP I CHECK /BUT NOT IF IN HYPERSPACE
1377 TAD TWOOUT /OR IF ALREADY HIT
1378 SZA CLA
1379 JMP I CHECK
1380
1381 TAD PROX /CHECK X'S FIRST
1382 CIA
1383 TAD TWOPEX
1384 SPA /GET ABSOLUTE VALUE OF DIFFERENCE
1385 CIA
1386 TAD LIMIT /AND TEST MAGNITUDE AGAINST PROXIMITY
1387 SMA CLA /LIMIT
1388 JMP I CHECK /NOWHERE NEAR CLOSE
1389
1390 TAD PROY /NYAH, NYAH
1391 CIA /TRY THE Y'S
1392 TAD TWOPEY
1393 SPA
1394 CIA /ABSOLUTE VALUE OF DIFFERENCE
1395 TAD LIMIT
1396 SMA CLA
1397 JMP I CHECK /CLEAN MISS!
1398
1399 TAD MEXP /HIT ON TWO - END EVERYTHING BY SETTING
1400 DCA TWOOUT /TWOOUT TO NON-ZERO EXPLOSION COUNT
1401 JMS CUTOUT
1402 JMP I CHECK /EXIT AFTER DESTOYING PROJECTILE
1403
1404LIMIT, -120 /PROXIMITY LIMIT FOR WHAT CONSTITUTES A HIT
1405
1406CUTOUT, 0 /THIS ROUTINE ZEROES OUT THE MOST RECENTLY
1407 TAD M4 /DISPLAYED PROJECTILE BY ZEROEING THE
1408 TAD BUFTMP /COUNT
1409 DCA CUTPNT
1410 DCA I CUTPNT
1411 JMP I CUTOUT
1412
1413CUTPNT, 0
1414
1415\f
1416/
1417/ THIS ROUTINE IS CALLED TO TEST FOR A COLLISION BETWEEN THE
1418/ TWO SHIPS. THE COORDINATES OF BOTH ARE COMPARED
1419/ AND IFF SUFFICIENTLY CLOSE BOTH ARE DESTROYED BY SETTING
1420/ THEIR EXPLOSION COUNTS NON-ZERO.
1421/
1422
1423
1424COLLID, 0 /HERE TO TEST FOR COLLISION
1425 TAD ONEFLG /NO TEST IF EITHER SHIP IS IN
1426 SZA CLA /HYPERSPACE OR EXPLODING
1427 JMP I COLLID
1428 TAD TWOFLG
1429 SZA CLA
1430 JMP I COLLID
1431 TAD ONEOUT
1432 SZA CLA
1433 JMP I COLLID
1434 TAD TWOOUT
1435 SZA CLA
1436 JMP I COLLID
1437
1438 TAD ONEPEX /BOTH SHIPS AVAILABLE FOR COLLISION
1439 CIA /CHECK X COORDINATES FIRST
1440 TAD TWOPEX
1441 SPA /GET ABSOLUTE VALUE OF DIFFERENCE
1442 CIA
1443 TAD COLLIM /CLOSE ENOUGH?
1444 SMA CLA
1445 JMP I COLLID /NOPE, FORGET IT
1446
1447 TAD ONEPEY /YES, NOW TRY THE Y COORDINATES
1448 CIA
1449 TAD TWOPEY
1450 SPA
1451 CIA /GET MAGNITUDE ONLY
1452 TAD COLLIM
1453 SMA CLA /CLOSE ENOUGH?
1454 JMP I COLLID
1455 TAD MEXP /YES, SET BOTH EXPLOSION COUNTS
1456 DCA ONEOUT
1457 TAD MEXP
1458 DCA TWOOUT
1459 JMP I COLLID
1460
1461COLLIM, -300
1462\f
1463/
1464/ THIS ROUTINE IS CALLED TO SET ONE OF THE TWO SHIPS INTO
1465/ HYPERSPACE. ON ENTRY THE AC=-1 FOR SHIP #1, 0 FOR SHIP
1466/ NUMBER 2. THE LOCATION CLOCK IS USED FOR A RANDOM
1467/ ADDRESS POINTER FROM WHICH WILL BE DRAWN THE
1468/ VARIOUS PARAMETERS FOR REENTRY.
1469/
1470
1471 *2200
1472
1473HYPSET, DCA RTNFLG /HERE WITH AC=-1 OR 0
1474 TAD RTNFLG /SET UP LIST POINTER
1475 SZA CLA
1476 TAD ONEDIF /TO APPROPRIATE SHIP FILE
1477 TAD TWOLST
1478 DCA AUTO15
1479
1480 CLCA /SET UP "RANDOM NUMBER GENERATOR"
1481 /USE CLOCK COUNTER FOR THAT PURPOSE
1482 DCA AUTO17
1483 TAD I AUTO17 /PICK UP FIRST THE AMOUNT OF TIME
1484 AND TIMOUT /OUT OF NOMAL SPACE LIMITED TO -777
1485 CIA /UPDATE CYCLES ( ABOUT 15 SECONDS)
1486 DCA I AUTO15 /AND STORE IN ONEOUT OR TWO OUT
1487
1488 TAD I AUTO17 /THE NEXT RANDOM NUMBER BECOMES THE
1489 JMS I THEADJ /ANGLE OR ORIENTATION ON REENTRY
1490 DCA I AUTO15
1491 TAD I AUTO17 /AND THE NEXT BECOMES THE X VELOCITY
1492 JMS VEESET /COMPONENT
1493 DCA I AUTO15
1494 TAD I AUTO17 /AND THEN THE Y COMPONENT
1495 JMS VEESET
1496 DCA I AUTO15
1497 TAD I AUTO17
1498 DCA I AUTO15
1499
1500 TAD I AUTO17
1501 DCA I AUTO15
1502
1503 TAD I AUTO17 /FINALLY SEE IF RETURN WILL BE SUCCESSFLY
1504 AND TIMOUT
1505 TAD MHYP /ABOUT 3/4 CHANCE
1506 SMA CLA
1507 JMP HYPRET /OK
1508 TAD RTNFLG /THIS IS THE ONE TIME IN FOUR. SET
1509 SZA CLA /UP FOR EXPLOSION ON REENTRY
1510 TAD ONEDIF
1511 TAD OUTLOC
1512 DCA VEESET
1513 TAD MEXP
1514 DCA I VEESET
1515
1516HYPRET, ISZ RTNFLG
1517 JMP I TWORTN
1518 JMP I ONERTN
1519
1520TIMOUT, 777
1521ONEDIF, ONEFLG-TWOFLG
1522TWOLST, TWOFLG-1
1523RTNFLG, 0
1524ONERTN, TWOUP
1525TWORTN, ONESET
1526OUTLOC, TWOOUT
1527MHYP, -200
1528
1529\f
1530
1531VEESET, 0 /HERE TO LIMIT VELOCITY COMPONENTS
1532 CLL
1533 SPA /GET MAGNITUDE
1534 CML
1535 AND HM177 /LIMIT TO 177
1536 SZL CLL
1537 CIA
1538 JMP I VEESET /AND EXIT
1539
1540HM177, 177
1541
1542ONEEXP, CLA CLL /HERE TO DISPLAY SHIP NUMBER ONE AS
1543 TAD ONETHE /AN EXPLOSION
1544 TAD INCONE /FIRST ROTATE IT BY A GOOD DOLLOP
1545 DCA ONETHE
1546 JMS I IXPDIS /THEN CALL THE EXPLOSION GENERATOR
1547 ISZ ONEOUT /DONE WITH THE EXPLOSION?
1548 JMP I NOWTWO /NO, NORMAL RETURN
1549
1550 IAC /YES, SET INTO PSEUDO HYPER SPACE
1551 DCA ONEFLG
1552 IAC /DISABLE RETURN FROM HYPER SPACE
1553 DCA ONEFIN
1554
1555 TAD TWOFIN /IS NUMBER TWO STILL AROUND?
1556 SNA CLA
1557 JMP I NOWTWO /YES, RETURN
1558 JMP I TIEUP /NO, TIE BALL GAME
1559\f
1560
1561TWOEXP, CLA CLL /HERE TO DISPLAY SHIP NUMBER TWO
1562 TAD TWOTHE /AS AN EXPLOSION. BASH IT AROUND
1563 TAD INCTWO
1564 DCA TWOTHE
1565 JMS I IXPDIS /THEN DISPLAY IT
1566 ISZ TWOOUT /DONE WITH EXPLOSION?
1567 JMP I NOWPRO /NO, NORMAL RETURN
1568
1569 IAC /YES, SEND INTO PSEUDO HYPER SPACE
1570 DCA TWOFLG
1571 IAC /DISABLE NORMAL RETURN FROM HYPERSPACE
1572 DCA TWOFIN
1573 /CHECK NUMBER ONE
1574 TAD ONEFIN
1575 SZA CLA /STILL ALIVE AND WELL?
1576 JMP I TIEUP /NO, TIE GAME
1577 JMP I NOWPRO /YES, CONTINUE ON
1578NOWTWO, TWODIS
1579NOWPRO, PRODIS
1580TIEUP, NOWIN
1581IXPDIS, EXPDIS
1582INCONE, 55
1583INCTWO, 55
1584
1585\f
1586/
1587/ HERE TO DISPLAY THE FIGURE POINTED TO BY AUTO10 AS
1588/ AN EXPLOSION. THIS WORKS THE SAME WAY AS THE NORMAL
1589/ DISPLAY ROUTINE EXCEPT THAT THE COORDINATE INCREMENTS
1590/ ARE INVERTED TURNING THE FIGURE INSIDE OUT FOR S
1591/ A SORT OF CLOBBY EXPLOSION.
1592/
1593
1594 *2400
1595
1596EXPDIS, 0 /HERE TO DISPLAY A FIGURE INSIDE OUT
1597 TAD I AUTO10 /WITH THE POINTERS AND COUNTS ALREADY
1598 DCA XTWODS /SET UP BY FILDIS OR TWODIS
1599 TAD I AUTO10 /STICK NEXT TWO POINTS INTO LINE
1600 DCA YTWODS
1601
1602 TAD XTWODS
1603 CIA /CALCULATE INCREMENT THE WRONG WAY
1604 TAD XONEDS
1605 DCA DIXTEM /AND STORE
1606 TAD YTWODS
1607 CIA
1608 TAD YONEDS
1609 DCA DIYTEM /SAME FOR Y
1610
1611 TAD M4 /4 DOTS IN THE VECTOR"
1612 DCA DISCNT /COULD HAVE CALLED THE OTHER
1613 /VECTOR GENERATOR I SUPPOSE
1614EXPLOP, TAD XONEDS
1615 TAD DIXTEM /ADD X AND Y INCREMENTS TO THE RUNNING
1616 DCA XONEDS /TOTALS AND DISPLAY THE RUNNING
1617 TAD YONEDS /TOTALS NORMAL SIZE
1618 TAD DIYTEM
1619 DCA YONEDS
1620
1621 TAD XONEDS
1622/ RTR /COULD MAKE TWICE AS BIG BY NOP-ING
1623/ RAR /THE RAR'S BUT THE SCREEN IS SMALL ENOUGH
1624 JMS I IVCLDX /AS IT IS
1625 CLA
1626 TAD YONEDS
1627/ RTR
1628/ RAR
1629 JMS I IVCLDY
1630/ DISD
1631/ JMP .-1
1632/ DIXY
1633
1634 CLA
1635 ISZ DISCNT /DONE 4 DOTS?
1636 JMP EXPLOP /NO
1637
1638 ISZ AUTO11 /DONE ALL VECTORS IN THE FILE?
1639 SKP
1640 JMP I EXPDIS /YES, EXIT
1641
1642 TAD XTWODS /NO SWAP TO NEXT PAIR OF POINTS
1643 DCA XONEDS
1644 TAD YTWODS
1645 DCA YONEDS
1646 JMP EXPDIS+1
1647
1648
1649\f
1650/
1651/ VEELIM IS THE SCALING ROUTINE FOR VELOCITY COMPONENTS.
1652/ THE COMPONENTS ARE SCALED TO REMAIN IN THE RANGE 140
1653/ TO -140. THIS IS NECESSARY TO AVOID ASTRONOMICAL SPPED
1654/ BUILDUP ON THE SMALL SCREEN. UNFORTUNATELY THE X AND Y
1655/ COMPONENTS ARE SCALED SEPARATELY WHICH GIVES SLIGHT BUT
1656/ NOTICABLE DISTORTIONS IN DIAGONAL FLIGHT PATHS. IN THE
1657/ NORMAL HEAT OF THE BATTLE NO ONE WILL REALLY NOTICE.
1658/
1659
1660
1661VEELIM, 0 /ENTER TO SCALE VELOCITY HELD IN
1662 DCA VEEHLD /AC
1663 TAD VEEHLD
1664 SMA /BRANCH FOR POSITIVE OR NEGATIV
1665 JMP VEEPOS
1666 TAD VEEMAX
1667 SMA CLA /GREATER THAN MAXIMUM POSITIVE?
1668 JMP VEECLR /NO
1669 TAD VEEMIN /I MEAN MAXIMUM NEGATIVE - YES SET
1670 JMP I VEELIM /TO MAX NEGATIV
1671
1672VEEPOS, TAD VEEMIN /GREATER THAN MAX?
1673 SPA CLA
1674 JMP VEECLR /NO
1675 TAD VEEMAX /YES SET TO MAX
1676 JMP I VEELIM
1677
1678VEECLR, TAD VEEHLD /IT WAS IN RANGE ALL ALONG
1679 JMP I VEELIM
1680
1681VEEHLD, 0
1682VEEMIN, -140
1683VEEMAX, 140
1684
1685THEAJI, 0 /HERE TO ADJUST THE ANGLE TO A RANGE
1686 SMA /0-550 OR 0-360 DEGREES. THIS IS
1687 JMP .+3 /NECESSARY TO INSURE THAT PUSHDOWN OVERFLOW
1688 TAD P550 /WILL NOT HAPPEN IN THE SINE AND COSINE
1689 JMP .-3 /ROUTINES. THIS SIMPLY TAKES THE AC
1690 TAD M550 /MODULO 360 AND EXITS
1691 SMA
1692 JMP .-2
1693 TAD P550 /FOLLOW IT THROUGH AND SEE IF IT DOESN'T
1694 JMP I THEAJI
1695
1696\f
1697/
1698/ ONE OF THESE ROUTINE IS ENTERED WHEN A WINNER IS DECLARED.
1699/ THE ADDRESS OF THE VICTORY MESSAGE IS PLACED IN MESS AND
1700/ THE GAMOVR FLAG SET TO CAUSE A BRANCH TO JOBLOP WHEN THE
1701/ DISPLAY CYCLE IS COMPLETED. THE ROUTINE WILL THEN DISPLAY
1702/ THE APPROPRIATE MESSAGE OVER THE REMAINING SHIPS IF
1703/ ANY UNTIL THE KEYBOARD IS MOLESTED OR THE CLOCK RUNS OUT
1704/ AND THE NEXT DISPLAY UPDATE CYCLE IS SET. AT ANY RATE THE
1705/ PROGRAM WILL REACH HERE ONLY WHEN SOMEONE HAS BITTEN THE
1706/ INTERGALACTIC DUST.
1707/
1708
1709
1710ONEWIN, 0 /THIS IS CALLED WHEN TWOFIN IS SET
1711 TAD MES1 /AND ONE FIN IS NOT. SET ONE TO VICTOR
1712 DCA MESS /AND SET GAMOVR FLAG
1713 IAC
1714 DCA GAMOVR
1715 JMP I ONEWIN /THEN RETURN TO UPDATE CYCLE
1716
1717TWOWIN, 0 /THIS IS CALLED WHEN ONEFIN IS SET
1718 TAD MES2 /AND TWO FIN IS NOT
1719 DCA MESS /SET ALSO GAMOVR
1720 IAC
1721 DCA GAMOVR
1722 JMP I TWOWIN
1723
1724NOWIN, TAD MES4 /GET HERE WHEN BOTH ONEFIN AND TWOFIN
1725 DCA MESS /ARE SET .
1726 IAC
1727 DCA GAMOVR /NOBODY EVER REALLY WINDS
1728 /UP THE WINNER IN THESE THINGS
1729JOBLOP,
1730/ DSB 1 /THIS IS ENTERED FROM FINISH WHEN
1731 TAD MES0 /GAMOVR IS SET AND SERVES TO DISPLAY
1732 JMS I MESOUT /THE VICTORY MESSAGE ON THE SCREEN
1733 TAD MESS /USING THE CHARACTER GENERATOR SOMEWHAT
1734 JMS I MESOUT /FURTHER ON UNTIL THE GAME IS RESTARTED
1735 TAD MES5 /OR UNTIL THE INTERRUPT COUNT OVERFLOWS
1736 JMS I MESOUT /AND THE UPDATE CYCLE IS RESTARTED
1737 TAD MES3
1738 JMS I MESOUT
1739FINITO, JMP JOBLOP
1740
1741MES0, MESS0
1742MES1, MESS1
1743MES2, MESS2
1744MES3, MESS3
1745MES4, MESS4
1746MES5, MESS5
1747MESS, 0
1748
1749\f
1750/
1751/ THE FOLLOWING ARE THE SINE AND COSINE ROUTINES CUSTOMIZED
1752/ FOR THIS PROGRAM FROM ANOTHER I WORKED ON. CALL EITHER
1753/ SINE OR COSINE WITH ANGLE IN DEGREES IN AC. THE ARGUEMENT
1754/ IS REDUCED THROUGH RECURSION UNTIL BETWEEN 0-89 DEGREES
1755/ AND THEN A TABLE LOOKUP DONE TO OBTAIN THE VALUE. IT TAKES
1756/ UP A FAIR AMOUNT OF SPACE BUT IT WORKS JUST FASTER
1757/ THAN SHEEP. THE COSINE CALL JUST TRANSFORMS THE ARGUEMENT
1758/ THROUGH SOME TRIGONOMETRIC GARBAGE AND CALLS THE SINE
1759/ ROUTINE. NOTE THAT CALLING EITHER ROUTINE WITH TOO
1760/ LARGE AN ARGUEMENT WILL CAUSE PUSHDOWN OVERFLOW AND THEN
1761/ ALL HELL WILL BREAK LOOSE. THE ORIGINAL ROUTINE FROM WHICH
1762/ THIS WAS STOLEN HAD FULL WORD PRECISION.
1763/
1764
1765 *6400
1766
1767SINEIN, 0 /I REALLY CANT BRING MYSELF TO COMMENT
1768 DCA SINARG /THIS. IT'S VERY STRAIGHFORWARD
1769 TAD SINEIN
1770 DCA I SINPSH
1771 ISZ SINPSH
1772 TAD SINARG
1773 SZA
1774 JMP SINNG2
1775
1776SINPOP, CLA CLL CMA
1777 TAD SINPSH
1778 DCA SINPSH
1779 TAD I SINPSH
1780 DCA SINEIN
1781 TAD SINARG
1782 JMP I SINEIN
1783
1784SINNG2, SMA
1785 JMP SINPOS
1786 CIA
1787 JMS SINEIN
1788
1789SINNEG, CIA
1790 DCA SINARG
1791 JMP SINPOP
1792
1793SINPOS, TAD M264
1794 SPA
1795 JMP .+2
1796 JMP SINNEG-1
1797 TAD P132
1798 SPA
1799 JMP SINELK
1800 SZA CLA
1801 JMP .+3
1802 TAD P37
1803 JMP SINNEG+1
1804
1805 TAD SINARG
1806 TAD M264
1807 JMP SINNEG-1
1808
1809SINELK, TAD P132
1810 TAD SINTAB
1811 DCA SINEIN
1812 TAD I SINEIN
1813 DCA SINARG
1814 JMP SINPOP
1815
1816\f
1817
1818SINARG, 0
1819SINPSH, SINLST
1820SINLST, 0
1821 0
1822 0
1823 0
1824 0
1825 0
1826
1827SINTAB, SINES-1
1828
1829COSINI, 0
1830 CIA
1831 TAD P132
1832 JMS SINEIN
1833 JMP I COSINI
1834
1835\f
1836
1837SINES, 00 /1
1838 01 /2
1839 01 /3
1840 02 /4
1841 02 /5
1842 03 /6
1843 03 /7
1844 04 /8
1845 05 /9
1846 05 /10
1847 06 /11
1848 06 /12
1849 07 /13
1850 07 /14
1851 10 /15
1852 10 /16
1853 11 /17
1854 11 /18
1855 12 /19
1856 12 /20
1857 13 /21
1858 13 /22
1859 14 /23
1860 15 /24
1861 15 /25
1862 16 /26
1863 16 /27
1864 17 /28
1865 17 /29
1866 20 /30
1867 20 /31
1868 20 /32
1869 21 /33
1870 21 /34
1871 22 /35
1872 22 /36
1873 23 /37
1874 23 /38
1875 24 /39
1876 24 /40
1877 25 /41
1878 25 /42
1879 25 /43
1880 26 /44
1881 26 /45
1882 27 /46
1883 27 /47
1884 27 /48
1885 30 /49
1886 30 /50
1887 30 /51
1888 31 /52
1889 31 /53
1890 31 /54
1891 32 /55
1892 32 /56
1893 32 /57
1894 33 /58
1895 33 /59
1896 33 /60
1897 33 /61
1898 34 /62
1899 34 /63
1900 34 /64
1901 35 /65
1902 35 /66
1903 35 /67
1904 35 /68
1905 35 /69
1906 36 /70
1907 36 /71
1908 36 /72
1909 36 /73
1910 36 /74
1911 36 /75
1912 37 /76
1913 37 /77
1914 37 /78
1915 37 /79
1916 37 /80
1917 37 /81
1918 37 /82
1919 37 /83
1920 37 /84
1921 37 /85
1922 37 /86
1923 37 /87
1924 37 /88
1925 37 /89
1926
1927\f
1928
1929MULTI, 0 /THIS IS STANDARD SINGLE PRECISION
1930 CLL /MULTIPLY ROUTINE WHICH WAS ONCE
1931 SPA /USED. I'VE LEFT IT IN SINCE
1932 CMA CML IAC /THERE IS LOTS OF CORE LEFT OVER AND
1933 DCA MULMP1 /MAYBLE SOMEDAY I'LL NEED IT TO PUT
1934 DCA MULMP5 /IN A SUN OR SOMETHING. THIS IS THE
1935 TAD I MULTI /STANDARD DEC SUBROUTINE WITH DIFFERENT
1936 SNA /LABELS
1937 JMP MULPSN+2
1938 SPA
1939 CMA CML IAC
1940 DCA MULMP2
1941 TAD MULTHR
1942 DCA MULMP3
1943
1944MULMP4, TAD MULMP1
1945 RAR
1946 DCA MULMP1
1947 TAD MULMP5
1948 SZL
1949 TAD MULMP2
1950 CLL RAR
1951 DCA MULMP5
1952 ISZ MULMP3
1953 JMP MULMP4
1954 TAD MULMP1
1955 RAR
1956MULPSN, SZL
1957 JMP MULCMP
1958 DCA MULMP1
1959 TAD MULMP5
1960MULMPZ, ISZ MULTI
1961 JMP I MULTI
1962
1963MULCMP, CMA CLL IAC
1964 DCA MULMP1
1965 TAD MULMP5
1966 CMA
1967 SZL
1968 IAC
1969 JMP MULMPZ
1970
1971MULTHR, 7764
1972MULMP1, 0
1973MULMP5, 0
1974MULMP2, 0
1975MULMP3, 0
1976
1977\f
1978/
1979/ SHIFTR DIVIDES THE AC BY TWO WHETHER POSITIVE OR NEGATIVE
1980/ AND IS CALLED FROM VARIOUS PLACES. NOT ENTIRELY MYSTERIOUS
1981/
1982
1983
1984SHIFTR, 0
1985 CLL
1986 SPA
1987 CML IAC
1988 RAR
1989 JMP I SHIFTR
1990
1991
1992/
1993/ POSCAL IS CALLED TO CALCULATE THE COORDINATE INCREMENTS
1994/ NECESSARY TO PRODUCE THE SHIP FIGURES. RATHER THAN DOING
1995/ A LOT OF EXPENSIVE MATH THIS DOES A QUICK PRODUCTION
1996/ OF 1, 2, AND 3 TIMES THE SIN AND COSINE VALUES FOUND
1997/ IN CALSIN AND CALCOS LEAVING THEM IN THE TABLE FOR
1998/ ONESET AND TWOSET. IF THE SCOPE WERE ANY BETTER
1999/ THIS PROBABLY WOULDN'T BE NEAR GOOD ENOUGH BUT....
2000/
2001
2002POSCAL, 0
2003 TAD CALSIN
2004
2005 DCA T10SIN
2006 TAD T10SIN
2007 CLL RAL
2008 DCA T20SIN
2009 TAD T10SIN
2010 TAD T20SIN
2011 DCA T30SIN
2012
2013 TAD CALCOS
2014
2015 DCA T10COS
2016 TAD T10COS
2017 CLL RAL
2018 DCA T20COS
2019 TAD T10COS
2020 TAD T20COS
2021 DCA T30COS
2022 JMP I POSCAL
2023
2024/****************************************************************
2025/ VC8-E ROUTINES
2026
2027
2028VDIV, 0
2029 SMA / SKIP IF MINUS
2030 JMP VPLUS
2031VMINUS, CMA IAC / COMPLEMENT
2032 RTR / DIVIDE BY FOUR
2033 AND P1777 / DELETE UPPER TWO BITS
2034 CMA IAC
2035 JMP I VDIV / RETURN
2036
2037VPLUS, RTR
2038 AND P1777
2039 JMP I VDIV
2040
2041/*****
2042
2043VCLDX, 0 / INTENSIFY LAST POINT AND LOAD NEW X VALUE
2044 JMS VDIV / DIVIDE BY FOUR
2045 DISD / DISPLAY READY?
2046 JMP .-1 / WAIT.
2047 DIXY / INTENSIFY
2048 DILX / LOAD NEW X VALUE
2049 JMP I VCLDX / RETURN
2050
2051VCLDY, 0
2052 JMS VDIV / DIVIDE BY FOUR
2053 DILY / LOAD NEW Y VALUE
2054 JMP I VCLDY
2055
2056P1777, 1777
2057
2058
2059/****************************************************************
2060
2061
2062 *7000
2063
2064/GENERAL PURPOSE SYMBOL GENERATOR
2065/
2066CHARS, 0 /ENTRY TO PLOT CHARACTER STRING
2067 DCA ADDR /STORE STRING ADDRESS
2068 TAD I ADDR /FETCH DOUBLE CHARACTER
2069 RTR /SHIFT
2070 RTR / FOR FIRST
2071 RTR / CHARACTER
2072 JMS CHAR /PLOT CHARACTER
2073 SKP /NORMAL RETURN -- SKIP
2074 JMP I CHARS /TERMINATION RETURN -- EXIT
2075 TAD I ADDR /RECALL DOUBLE CHARACTER
2076 ISZ ADDR /ADVANCE STRING ADDRESS
2077 JMS CHAR /PLOT CHARACTER
2078 JMP CHARS+2 /NORMAL RETURN -- REPEAT
2079 JMP I CHARS /TERMINATION RETURN -- EXIT
2080/
2081CHAR, 0 /ENTRY TO PLOT SINGLE CHARACTER
2082 AND K77 /MASK OUT UPPER BITS
2083 CLL RAL /MULTIPLY CODE BY TWO
2084 TAD TABLE /ADD TABLE BASE ADDRESS
2085 DCA POINT /CONSTRUCT POINTER TO 24-BIT CODE
2086 CMA /INITIALIZE COUNTER FOR
2087 DCA COUNT2 / TWO PLOT WORDS
2088 TAD I POINT /FETCH FIRST PLOT WORD
2089 ISZ POINT /INCREMENT POINTER FOR NEXT ONE
2090 SNA /SKIP IF NOT SPECIAL CHARACTER
2091 JMP SPCHAR /ELSE GO PROCESS IT
2092 DCA CURPLT /SAVE CURRENT PLOT BITS
2093XPLOT, TAD KM6 /INITIALIZE 6-BIT
2094 DCA COUNT6 / COUNTER
2095 TAD YVALUE /RESET Y TEMPORARY
2096 DCA YTEMP / VALUE FOR CHARACTER
2097 TAD XVALUE /OUTPUT CURRENT
2098 DILX /X-VALUE TO CRT
2099 TAD XINCR /INCREMENT
2100 DCA XVALUE / ABSCISSA
2101YPLOT, TAD CURPLT /RECALL CURRENT PLOT BITS
2102 CLL RAL /GET NEXT BIT
2103 DCA CURPLT /SAVE REMAINING PLOT BITS
2104 SNL /SKIP IF POINT TO PLOT
2105 JMP CNTINU /ELSE JUMP AHEAD
2106 TAD YTEMP /OUTPUT CURRENT
2107 DILY /Y-VALUE TO CRT
2108 DISD / READY TO DISPLAY THE POINT?
2109 JMP .-1 / NO, WE'LL WAIT.
2110 DIXY / SHOOT THE BEAM!
2111
2112 CLA CLL /CLEAR AC
2113 TAD CURPLT /RECALL CURRENT PLOT BITS
2114 SNA CLA /SKIP IF POINTS REMAINING
2115 JMP WRDEND /ELSE WORD IS FINISHED
2116CNTINU, TAD YTEMP /INCREMENT TEMPORARY
2117 TAD YINCR / Y-VALUE FOR NEXT
2118 DCA YTEMP / CHARACTER STEP
2119 ISZ COUNT6 /SKIP IF 6 BITS PLOTTED
2120 JMP YPLOT /ELSE PLOT NEXT ONE
2121 JMP XPLOT /GO UPDATE X-VALUE
2122WRDEND, ISZ COUNT2 /SKIP IF ANOTHER BIT WORD
2123 JMP EXIT /ELSE EXIT
2124 TAD I POINT /FETCH SECOND BIT WORD
2125 SZA /SKIP IF NO PLOT POINTS
2126 JMP XPLOT-1 /ELSE GO PLOT THEM
2127EXIT, TAD XVALUE /INCREMENT ABSCISSA
2128 TAD XINCR / FOR SPACE BETWEEN
2129 DCA XVALUE / SYMBOLS
2130 JMP I CHAR /EXIT FROM CHAR
2131/
2132SPCHAR, TAD I POINT /FETCH TRANSFER VECTOR
2133 DCA POINT /STORE AS INDIRECT ADDRESS
2134\f JMP I POINT /GO TO APPROPRIATE ROUTINE
2135SPACE, TAD XINCR /FETCH BASIC ABSCISSA INCREMENT
2136 CLL RTL /MULTIPLY BY FOUR AND
2137 JMP EXIT / GO CREATE SPACE
2138CRLF, TAD INITX /"CARRIAGE RETURN" RESETS X
2139 DCA XVALUE / TO ITS ORIGINAL VALUE
2140LF, TAD YINCR /"LINE FEED"
2141 CLL RTL / DECREMENTS THE
2142 CLL CIA RAL / Y-VALUE BY
2143 TAD YVALUE / EIGHT SCALE
2144 DCA YVALUE / STEPS
2145 JMP I CHAR /EXIT FROM CHAR
2146RESET, TAD INITX /"RESET" RESETS
2147 DCA XVALUE / X AND Y TO
2148 TAD INITY / THEIR ORIGINAL
2149 JMP RESET-2 / VALUES
2150TERM, ISZ CHAR /TERMINATE CODE CAUSES
2151 JMP I CHAR / EXIT TO P+2
2152/
2153INITX, 0 /INITIAL X-VALUE
2154INITY, 327 /INITIAL Y-VALUE
2155XVALUE, 0 /CURRENT X-VALUE
2156YVALUE, 0 /CURRENT Y-VALUE
2157XINCR, 6 /BASIC X INCREMENT VALUE
2158YINCR, 10 /BASIC Y INCREMENT VALUE
2159YTEMP, 0 /TEMPORARY Y-VALUE
2160CURPLT, 0 /CURRENT PLOT BITS
2161ADDR, 0 /CURRENT STRING ADDRESS
2162COUNT6, 0 /6-BIT COUNTER
2163COUNT2, 0 /2-WORD COUNTER
2164KM6, -6 /CONSTANT FOR COUNT6
2165K77, 77 /CHARACTER CODE MASK
2166POINT, 0 /TABLE POINTER
2167/
2168\f
2169/
2170TABLE, .+1 /TABLE BASE ADDRESS
2171 0 /SPECIAL CHARACTER (00)
2172 TERM /TERMINATION CODE
2173 7611 / A
2174 1176
2175 7745 / B
2176 4532
2177 3641 / C
2178 4122
2179 7741 / D
2180 4136
2181 7745 / E
2182 4541
2183 7705 / F
2184 501
2185 7741 / G
2186 5173
2187 7710 / H
2188 1077
2189 4177 / I
2190 4100
2191 2040 / J
2192 4037
2193 7714 / K
2194 2241
2195 7740 / L
2196 4040
2197 7702 / M
2198 277
2199 7706 / N
2200 3077
2201 7741 / O
2202 4177
2203 7705 / P
2204 502
2205 3641 / Q
2206 6176
2207 7715 / R
2208 2542
2209 2245 / S
2210 5122
2211 177 / T
2212 100
2213 3740 / U
2214 4037
2215 1720 / V
2216 4037
2217 7730 / W
2218 3077
2219 4136 / X
2220 3641
2221 374 / Y
2222 7403
2223 6151 / Z
2224 4543
2225 7741 / [
2226 0
2227 204 / \
2228 1020
2229 4177 / ]
2230 0
2231 436 / ^
2232 400
2233 0 /SPECIAL CHARACTER (37)
2234 RESET /RESET
2235 0 /SPECIAL CHARACTER (40)
2236 SPACE /SPACE
2237 5600 / !
2238 0
2239 303 / "
2240 0
2241 1477 / #
2242 7714
2243 2277 / MARKER
2244 2200
2245 2313 / %
2246 6462
2247 7777 / BLOCK
2248 7777
2249 300 / '
2250 0
2251 3641 / (
2252 0
2253 4136 / )
2254 0
2255 4040 / UNDERSCORE (52)
2256 4040
2257 1034 / +
2258 1000
2259 0 /SPECIAL CHARACTER (54)
2260 LF /LINE FEED
2261 1010 / -
2262 1000
2263 4000 / .
2264 0
2265 2010 / /
2266 402
2267 3641 / 0
2268 4136
2269 4442 / 1
2270 7740
2271 4261 / 2
2272 5146
2273 2145 / 3
2274 5321
2275 1710 / 4
2276 1077
2277 4745 / 5
2278 4531
2279 7750 / 6
2280 5070
2281 6111 / 7
2282 503
2283 2255 / 8
2284 5522
2285 705 / 9
2286 577
2287 2400 / :
2288 0
2289 0 /SPECIAL CHARACTER (73)
2290 CRLF /CARRIAGE RETURN; LINE FEED
2291 1024 / >
2292 4200
2293 1212 / =
2294 1200
2295 4224 / <
2296 1000
2297 255 / ?
2298 300
2299
2300\f
2301/
2302/ HERE FOLLOW THE PACKED ASCII TEXTS FOR THE VARIOUS
2303/ VICTORY MESSAGES. PERSONS ADVENTEROUS TO FIND THIS MIGH CARE
2304/ TO TOGGLE IN SOME CUTE LITTLE MESSAGES OF THEIR OWN.
2305/
2306
2307MESS0, 3773
2308MESS5, 7340
2309 4040
2310 4040
2311 4000
2312
2313MESS1, 1716
2314 0500
2315
2316MESS2, 2427
2317 1700
2318
2319MESS3, 2711
2320 1623
2321 4100
2322
2323MESS4, 1617
2324 0217
2325 0431
2326 0000
2327
2328\f
2329 *7400
2330
2331DISBUF, 0
2332
2333/ THE DISPLAY BUFFERS BEGIN HERE AND EXTEND UP SOMEWHERE TO
2334/ AROUND 7575 OR SO.
2335/
2336/
2337/
2338/
2339/
2340
2341\f
2342
2343 $
2344
2345////////////////////////////
2346/
2347/ THIS IS THE END
2348/
2349///////////////////////////
2350
2351
2352
2353
2354
2355\f