* * * Program: Space Raiders Version 1.0 * Programmer: Stephen Maguire August, 1979 * * Routine: Main (MAIN) * * Purpose: The purpose of this routine is to keep all * routines executing the proper number of * times, to accept input, and to trigger the * firing mechanism. It is the main loop of * the program. * *------------------------------------------* * This is the entry point for a new game. * *------------------------------------------* * NEWGME LXI SP,MNSTK CALL CLEAR Blank the screen * LDA DEMO Demonstration mode on? ORA A JZ NG2+3 If so, start playing * *------------------------------------------* * Tell the player the game is starting. * *------------------------------------------* * LXI H,FREADR Print the SPACE-BAR message LXI D,FRETXT LXI B,100H CALL PRINT * LXI H,MOVADR Tell what keys do what CALL PRINT * LXI H,CLRADR "CLEAR" resets game and high CALL PRINT * LXI H,ESCADR "ESCAPE" takes us back to the monitor CALL PRINT Initially the monitor is PTDOS * LXI H,DELADR "DEL" resets game CALL PRINT * *------------------------------------------* * Flash the starting message 10 times * *------------------------------------------* * MVI H,50 We will blink the next message 50 times * NG PUSH H Save this counter * LXI H,PLYADR Print the message LXI D,PLYTXT CALL PRINT * LXI H,400H Wait a bit before erasing it NG0 CALL INPUT JNZ NG2 DCX H MOV A,H ORA L JNZ NG0 * LXI H,PLYADR Now, erase it CALL PRINT * LXI H,400H Wait again NG1 CALL INPUT JNZ NG2 DCX H MOV A,H ORA L JNZ NG1 * POP H Are we done flashing? DCR H JNZ NG Nope * XRA A If so, they play a demonstration STA DEMO * *------------------------------------------* * Do some pre-game initialization. * *------------------------------------------* * NG2 CALL CLEAR * XRA A Say that no extra shooter has been given STA EXGVN * STA PRCBYT Say that no shooter missile is firing * MVI A,99H Say that no screens of raiders have been killed STA CLRCNT (99+1 ==> DAA equals zero) * MVI A,3 This is the initial number of shooters STA SHTNUM * MVI A,6 Number of times STRRDR is decremented by 64 STA DWNCNT * LXI H,0 Initialize the score SHLD SCORE * LXI H,LASTORG Tell where the last phoney shooter is SHLD LASTLC * LXI H,STRRDR-64 Indicate where to start the raiders SHLD RPOINT * LXI H,UFOST Initialize the UFO routine SHLD STKUFO LXI H,STKUFO-8 SHLD PNTUFO * LXI H,MSLARY Clear the raider missile array MVI B,12 Total of six 2-byte missile addresses NG3 MVI M,0 Zero it all INX H DCR B JNZ NG3 * LXI D,BOTTXT Print the bottom text LXI H,SCREEN+3C0H This is where to put it MVI C,COLOR Inversed or not MVI B,1 Print it fast CALL PRINT Do it now * LHLD HIGH Print the high score XCHG LXI H,NWHADR This is the location MVI C,30H+COLOR Make it inversed (probably) MOV A,D Print the high byte CALL PRHEX MOV A,E Now the low CALL PRHEX * *------------------------------------------* * Entry point for "cleared all raiders" * *------------------------------------------* * RESET CALL INIT Do some mid-game initialization * *------------------------------------------* * Entry point for "move the raiders" * *------------------------------------------* * MAIN CALL MNRDR Move the raiders * LXI H,0 After the 1st time printing the raiders, SHLD PRNRDR speed up the printing * LHLD MNWT Reset the wait count * *------------------------------------------* * This is the main loop of the program. * *------------------------------------------* * MAIN1 CALL MNRFR Go move some missiles * LDA ENDGME Is the game over? ORA A JNZ OVER Yes, so go indicate it * XRA A Go move our missile CALL CHKMV * CALL MNUFO Go move the UFO * *------------------------------------------* * If shooter is exploding, don't fire/move * *------------------------------------------* * LDA NOINPT Are we exploding? ORA A JNZ MAIN2 Yes, ignore all input * CALL MNSHT Move the shooter * *------------------------------------------* * Is the demonstration mode on? * *------------------------------------------* * LDA DEMO If so, then no user input allowed ORA A JNZ MN1 Nope, regular play * CMA . Fire a missile before each move CALL CHKMV * CALL INPUT Ignore any input * PUSH H LHLD DONE Wait till done goes zero to do anything DCX H MOV A,H ORA L SHLD DONE Don't fire too often POP H JNZ MAIN2 * PUSH H Reset the wait count LXI H,DMOVAL SHLD DONE POP H * CALL RNDOM What are we going to do? ANI 7 JZ MN2 * CPI 4 Move left if 1, 2, or 3 MVI B,CHLEFT Move the shooter left JC MN0 * MVI B,CHRGHT 4, 5, 6, 7 mean move the shooter right * MN0 MOV A,B Go continue JMP MN2 * *------------------------------------------* * No demonstration, accept input * *------------------------------------------* * MN1 CALL INPUT Go check for input JZ MAIN2 Nothing, exit directly * MN2 STA DRTBYT Save this for the fire routine * CPI FRCHR Are we firing? JNZ MAIN2 No, we are moving or stopping * MVI A,1 Yes, fire! CALL CHKMV * *------------------------------------------* * Is it time to move the raiders again? * *------------------------------------------* * MAIN2 DCX H Decrement the time counter MOV A,H Ready to move? ORA L JNZ MAIN1 No, not yet * INX H This is a precation in case a raider is exploding * LDA EXFLG Is a raider exploding? ORA A JZ MAIN1 Yes, so wait before moving the raiders * JMP MAIN No, go move the raiders * *------------------------------------------* * This is the game over routine. It * * prints the game over message and, if * * necessary, the new high message. * *------------------------------------------* * OVER LDA DEMO If demo is in action, only one hit allowed ORA A CZ MESWT Wait a bit JZ START Now, restart * XRA A Erase the raiders if they will be in the way STA RDRDRT Putting 0 here causes raiders to be erased CALL ADVNC * LXI D,OVRTXT Point to what is to be printed LXI H,OVRADR This is where to put it MVI C,0 Not inversed MVI B,PRTSPD Speed at which to print the text CALL PRINT Go do it * LHLD SCORE Do we have a new high score? XCHG LHLD HIGH CALL HLDE Let's check JNC OVR1 No, it's not a new high score * XCHG . Yes, it is a new high score SHLD HIGH * PUSH H Print the new high score message LXI D,NWHTXT LXI H,HGHADR CALL PRINT * XCHG . Now, print the new value POP H XCHG * MOV A,D This does it all MVI C,NUMNRM CALL PRHEX MOV A,E CALL PRHEX MVI M,0+NUMNRM Put an extra zero on the end * OVR1 MVI A,3 Leave the game over message on awhile PUSH PSW * CALL MESWT Wait for a spell * POP PSW DCR A JNZ OVR1+2 * JMP START Start a new game * * * Routine: Move-the-shooter (MOVE) * * Purpose: The purpose of this routine is to move the * shooter one space left or one space right * depending upon what the direction byte * equals. If it does not contain a direction * value, then the shooter will not be * moved. This routine is written for use * in conjuction with software interrupts, * thus the necessity for status flags. * * * * *------------------------------------------* * This is the main loop of MOVE. * *------------------------------------------* * MOVE LDA DRTBYT What direction do we move? CPI CHLEFT Left? LXI D,-1 JZ MVSHTR Yes CPI CHRGHT Right? LXI D,1 JZ MVSHTR Yes JMP MVINTR Don't move at all * *------------------------------------------* * Move the shooter if necessary. * *------------------------------------------* * MVSHTR LHLD SHTLOC Get shooter location DAD D Add the offset MOV A,L Are we on an edge boundry? CPI 7FH JZ MVINTR Yes CPI 0BCH JZ MVINTR Yes * SHLD SHTLOC No, so print new shooter * LXI D,SHOOTR Print it now MVI B,5 It's five characters long * SHTPRT LDAX D This does it MOV M,A Put it on the screen INX D INX H DCR B Done? JNZ SHTPRT No * *------------------------------------------* * Call the main tasker for other * *------------------------------------------* * MVINTR LDA RDRCNT Wait time = (# of raiders / 4) + SHTWT RRC . /4 RRC . ANI 3FH ADI SHTWT +SHTWT MVI H,0 HL MUST contain the value MOV L,A * MVWAT SHLD SHTWB This is a short wait routine * CALL SHTMN It is interrupted each time through * LHLD SHTWB DCX H MOV A,H ORA L JNZ MVWAT * JMP MOVE Keep moving when done waiting * * * Routine: Move-the-raiders (RDRMV) * * Purpose: The purpose of this routine is to move the * raiders down the screen at a moderate pace. * The more raiders there, the slower they * move. One raider will approach quickly and * must be subdued. If they reach the bottom, * you are dead. This routine is written for * use in conjuction with software interrupts, * thus the necessity for status flags. * * * NOTES: Raiders will be printed if PRNVAL contains a -1. * If it contains 0, it is the firing routine simply * wanting to know where the raiders are. * *------------------------------------------* * Are we moving down or across? * *------------------------------------------* * RDRMV LDA ENDFLG Let's check ORA A JNZ RDRDWN Yes, so do it * CALL ADVNC * RDR1 CALL RDRMN Interrupt to main * CALL AVDONE Move the raiders * JMP RDRMV * *------------------------------------------* * Move the raiders down a line. * *------------------------------------------* * RDRDWN LDA RDRDRT Tell the print routine to blank raiders PUSH PSW Save the old value for later XRA A Erase raiders STA RDRDRT CALL ADVNC Go do it * POP PSW Negate the direction byte CMA . INR A STA RDRDRT * LHLD SCRPNT Adjust pointer to move down LXI D,64 DAD D SHLD SCRPNT * CALL ADVNC Print them now * XRA A Initialize side of screen flag STA ENDFLG * JMP RDR1 All done * *------------------------------------------* * Move the raiders on the screen. * *------------------------------------------* * ADVNC XRA A Set the row STA RROW LXI H,0 Set the location SHLD RMSLOC LHLD SCRPNT Get screen location LXI D,RDRARY Point to raider array * ADV0 LDA RROW Increment the row count INR A STA RROW LDAX D Get value from array PUSH PSW * LDA TROW Are we on the proper row for fire routine? MOV B,A LDA RROW Get the real row CMP B Compare it with the test row JNZ ADCN Not the same? * POP PSW They are the same ORA A Is there a raider? JZ ADCN+1 No * SHLD RMSLOC Inform the fire routine JMP ADCN+1 * ADCN POP PSW MOV B,A CPI 80H End of row? JC ADV1 No CPI 85H Possibly JNC ADV1 No * *------------------------------------------* * End of row, maybe end of array * *------------------------------------------* * ANI 0FH Strip value for checking CPI 4 Check the end of row value RNC . If at end of array, then exit * INX D Move down a line for next row of raiders LXI B,20 DAD B Do it now * XRA A JMP ADV0+3 Go print the next row * *------------------------------------------* * We must now print the raider. * *------------------------------------------* * ADV1 ORA A JNZ ADV2 * LXI B,4 No, this one is dead DAD B Skip over to the next raiders location INX D Get info on the next raider JMP ADV0 Go process it * ADV2 MOV B,A If we are erasing the raiders, LDA PRNVAL then don't flap their arms ORA A MOV A,B JZ ADVSKP * CMA . Negate the information byte INR A This negation makes him flap his arms * ADVSKP STAX D Now, save it * LDA RDRDRT Erase the raider if we are moving down ORA A Zero says to erase MOV A,B JNZ ADVZRO Go print the raider XRA A Erase the raider * ADVZRO PUSH D PUSH H * *------------------------------------------* * Determine which raider-picture to print. * * See table RDRTBL for the calculations. * *------------------------------------------* * MOV E,A Set the offset value. (i.e. -1 or 1) CPI 80H Register D holds this value MVI A,0 JC ADV3 MVI A,0FFH ADV3 MOV D,A All done * LXI H,0 Multiply the offset by 6 MVI B,6 * ADV4 DAD D Do it now DCR B JNZ ADV4 * DCX H Now, subtract 3 DCX H DCX H XCHG . D has the fixed offset * LXI H,TBLCTR Point to the table DAD D Add the offset XCHG . DE is now pointing to the raider * POP H Get the screen location * LDA LFTEDG Get value of leftmost raider CALL LGTA MOV A,C STA LFTEDG * LXI B,5 LDA PRNVAL ORA A JNZ ADV5 * DAD B JMP ADVN1+1 * ADV5 LDAX D Print the raider CPI 20H If there is a missle on the screen, JNZ ADV6 don't erase it. MOV A,M CPI CHMSL MVI A,20H JZ ADV6+1 * ADV6 MOV M,A Put the character to the screen INX H INX D DCX B Are we done printing? MOV A,B ORA C JNZ ADV5 No, keep going * PUSH H When first putting the raiders on the screen, LHLD PRNRDR it looks more impressive if they are put * ADVN0 MOV A,H on slowly ORA L JZ ADVN1 DCX H JMP ADVN0 Wait some more * ADVN1 POP H DCX H MOV A,H Are we cn the bottom of the screen? CPI BOTLN JNZ ADV7 MOV A,L RAL JNC ADV7 STA ENDGME Yes, we have been invaded * ADV7 LDA RGTEDG Save value of rightmost raider CALL LGTA MOV A,B STA RGTEDG * ADV8 POP D Get array pointer back INX D Get info for next raider * JMP ADV0 Process it now * *------------------------------------------* * Move the raiders down the screen. * *------------------------------------------* * AVDONE LDA RDRDRT Which direction are we moving? ORA A JM AVD0 We are moving to the left * LDA RGTEDG No, to the right CPI 3FH Are we on the right edge? JNZ AVD1 No JMP AVCLR Yes, change directions * AVD0 LDA LFTEDG Are we on the left edge? ORA A JNZ AVD1 No * AVCLR MVI A,1 Yes, we must change directions STA ENDFLG JMP AVD3 Go reset edge values * AVD1 LDA RDRDRT Get the offset (-1 or 1) MOV E,A Convert it to 16 bit format CPI 0FFH MVI A,0 JNZ AVD2 MVI A,0FFH AVD2 MOV D,A DE has the offset * LHLD SCRPNT Add it to the screen location DAD D SHLD SCRPNT Save this value * AVD3 XRA A Initialize edge values STA RGTEDG MVI A,3FH STA LFTEDG * RET . * *------------------------------------------* * A Table containing the Raiders. * * * * RAIDER=TBLCTR + (TOP,MID,or BTM)*6-3 * *------------------------------------------* * RDRTBL DB 20H,R10L,R10M,R10R,20H,1 10 point raider DB 20H,R20L,R20M,R20R,20H,2 20 point raider DB 20H,R30L,R30M,R30R,20H,3 30 point raider * TBLCTR EQU $+3 ASCZ ' ' Blank raider * DB 20H,R30R,R30M,R30L,20H,3 30 point raider DB 20H,R20R,R20M,R20L,20H,2 20 point raider DB 20H,R10R,R10M,R10L,20H,1 10 point raider * * * Routine: Move-the-UFO (MVUFO) * * Purpose: The purpose of this routine is to simply * move a UFO across the screen. It may * move in either direction. It will come * out only occasionally, and if shot will * be worth 50, 100, 150, 200, 250 or 300 * points. This routine is written for use * in conjuction with software interrupts, * thus the necessity for status flags. * * Calls: Random (RNDOM) * * UFOST LXI B,TBUFO Set the count * *------------------------------------------* * Wait for a spell. * *------------------------------------------* * MVUFO DCX B Count down one more * CALL UFOMN Interrupt to the main processor * MOV A,B Done waiting? ORA C Yes, if down to zero JNZ MVUFO Not done yet * LDA RDRCNT If there are less than 8 raiders, CPI 8 then don't print a UFO JC UFOST * *------------------------------------------* * Determine which direction to move. * *------------------------------------------* * CALL RNDOM Randomly choose the direction ANI 1 Make value a 0 or a 1 LXI H,LFTSD Set for moving right JNZ MV1 If not 0, then it's okay * LXI H,RGTSD Reset for moving left DCR A It's 0, Subtract 1 to make it -1 * MV1 STA UFODRT Save this for later SHLD UFOLOC * *------------------------------------------* * Paint the UFO on the screen * *------------------------------------------* * UFOPNT LHLD UFOLOC Initialize the UFO location LXI D,UFO-1 Initialize UFO print counter MVI B,8 Length of UFO picture plus one * PNT0 INX D Bump counter to the beginning INX H Bump UFO location to proper spot MOV A,L Are we partly off the screen? CPI 40H JC PNT1 No, so print this character * DCR B Are we done printing? JNZ PNT0 Yes, go put on the roving dot JMP ROVER No, keep going * PNT1 DCR B Are we done? JZ ROVER Yes, paint the roving dot * LDAX D MOV M,A No, put on the character JMP PNT0 Keep going * *------------------------------------------* * Put on the infamous roving dot. * *------------------------------------------* * ROVER LXI D,2 Initialize the location counter LHLD UFOLOC Get the UFO location LDA RVRCNT Get location of the dot * INR A Add 1 making it a 1, 2, or 3 CPI 4 This keeps it a modulo 2 JC PNT2 If it's over 2, make it 0 MVI A,1 PNT2 STA RVRCNT Save this for later * ADD E Put the dot on the screen MOV E,A DAD D MOV A,L CPI 40H Is the dot off the screen? JNC UFOWT-3 Yes, so don't print it MVI M,CHROV Print the dot * *------------------------------------------* * Wait between moving the UFO. * * Checks for SHOT-status as well. * *------------------------------------------* * LXI B,MOVWT Get amount of time to wait * UFOWT CALL UFOMN Interrupt to the main processor * LDA MOVSTT Check SHOT-status flag ORA A Have we been shot? JNZ UFOSHT Oh no, we've been hit! * DCX B Still safe, time to move? MOV A,B Let's see ORA C JNZ UFOWT Not yet, wait a bit more * *------------------------------------------* * Time to move the UFO again. * *------------------------------------------* * MVI D,0 Prepare the offset for moving LHLD UFOLOC Get the UFO location on the screen LDA UFODRT Now, the direction * MOV E,A Adjust offset according to direction CPI 1 JZ UFOMV MVI D,0FFH All done * UFOMV DAD D Now, move the UFO SHLD UFOLOC Save this value * MOV A,L Are we off the screen? CPI 0F8H The left side? JZ UFOST Yes CPI 3FH The right side? JZ UFOST Yes JMP UFOPNT No, still on the screen * *------------------------------------------* * Hey, we've been shot down! * *------------------------------------------* * UFOSHT LXI B,WTSHT Get amount of time to wait * CALL UFOMN Process something in MAIN * DCX B Are we done waiting? MOV A,B Let's check ORA C JNZ UFOSHT+3 No, not yet * LHLD UFOLOC Now, we must erase the score MVI B,5 Print five blanks over the UFO * CLRSCR MVI M,20H Do it now INX H DCR B Done? JNZ CLRSCR No, not yet * STA MOVSTT * JMP UFOST Go re-initialize * * * * Routine: Raiders-fire (RDRFRE) * * Purpose: The purpose of this routine is to move the * missiles of the raiders down so that the * shooter can get killed as opposed to being * invaded by the raiders. This makes it more * difficult to obtain high scores -- thus * making it more challenging. * * * RDRFRE LDA TIMBYT Should we fire another missile? ORA A JZ RFR0 Yes, go ahead if you want * XRA A Set for firing the next time STA TIMBYT JMP RFR2 * RFR0 CALL RNDOM Do we want to fire? ANI 01H JNZ RFR2 Nope * *------------------------------------------* * Fire a missile from a raider. * *------------------------------------------* * CMA . Yes, say we shouldn't next time STA TIMBYT * LXI H,MSLARY Point to the missile array start MVI B,6 This is the number of elements * RFR1 MOV A,M Find an empty element (i.e. 0000) INX H ORA M JZ ARYSR Ah ha! found one INX H DCR B Are we at the array end? JNZ RFR1 No, not yet * * Already firing the maximum number of missiles * RFR2 CALL RFR3 Move the old missiles JMP ARY3 * *------------------------------------------* * Get new missile shape, location. * *------------------------------------------* * ARYSR DCX H HL has the array location PUSH H * ARY1 CALL RNDOM Determine the raider column number ANI 0FH There are 11 columns of raiders that can fire CPI 11 Is the number too big? JNC ARY1 Yes, keep going until it's okay INR A Put the number in range STA TROW Save this for testing * XRA A Tell the Raider-move that we only want an address STA PRNVAL This does it CALL ADVNC Get the address MVI A,-1 Tell the routine to move next time STA PRNVAL * CALL RFR3 Move the other missiles * LHLD RMSLOC Get the new missile location (from RDRMV) LXI D,64 Move it down a line DAD D INX H make it come out of the center of the raider INX H XCHG POP H * * DE has the screen location; HL the array location * ARY2 MOV M,E Put the screen location in the array INX H MOV M,D XCHG . Now, get the screen location back * MOV A,M Is the shooter below the shooting raider? CPI SHEND JZ ARY3 Yes, missiles automatically neutralized CPI CHSHT JZ ARY3 Yes CPI 20H JZ ARY23 * MVI B,1 Destroy whatever is there CALL RDRSHT JMP ARY3 * * Randomly choose the missile shape to fire * ARY23 CALL RNDOM ANI 3 MVI M,RMSL1 JNZ ARY3 MVI M,RMSL3 * ARY3 CALL RFR6 Go wait a bit JMP RDRFRE * *------------------------------------------* * Move missiles and check for hits * *------------------------------------------* * RFR3 LXI H,MSLARY Point to the array start MVI B,6 Move each missile * RFR4 MOV E,M DE has the missile address INX H MOV D,M * MOV A,D Is there a missile? ORA E JNZ RFR7 Yes, so move it now * * No missile, so check the next element * RFR5 INX H Go to the next address DCR B All done? JNZ RFR4 No * RET . Completed * *------------------------------------------* * This is the task interface routine * *------------------------------------------* * RFR6 LDA RDRCNT Wait speed = (# of raiders/4)+80 RRC . Do the division RRC . ANI 3FH ADI 80 Now, add the offset MOV B,A * RFR65 CALL RFRMN Interrupt now * DCR B JNZ RFR65 Loop until done waiting * RET . * *------------------------------------------* * Rotate the missile character. * *------------------------------------------* * RFR7 XCHG . Save the address MOV A,M Get the character PUSH B * MVI B,RMSL2 CPI RMSL1 If it is a missile still, change character JZ RFR8 * MVI B,RMSL1 CPI RMSL2 JZ RFR8 * MVI B,RMSL4 CPI RMSL3 JZ RFR8 * MVI B,RMSL3 CPI RMSL4 JZ RFR8 * CPI EXPL1 JNZ RFR9 It's not a missile -- don't erase it * POP B After the explosion, put on the old missile LDA OLDMSL MOV M,A XCHG JMP RFR5 * *------------------------------------------* * Blank the old missile and change it. * *------------------------------------------* * RFR8 MOV A,B Change the missile shape STA MSLCHR MVI M,20H Blank the old missile * *------------------------------------------* * Move the missile down one line. * *------------------------------------------* * RFR9 POP B Move down a line PUSH D LXI D,64 DAD D POP D * XCHG . Get array location MOV M,D Put new address in it DCX H MOV M,E INX H XCHG * MOV A,H If we hit the bottom, explode CPI BOTLN JNZ RFRA MOV A,L CPI 0C0H JNC RDRS5 * RFRA MOV A,M Have we hit something? CPI 20H JNZ RDRSHT Yes, go check * LDA MSLCHR Put on the new missile character MOV M,A XCHG JMP RFR5 Go do the next missile * *------------------------------------------* * The raiders have shot something * *------------------------------------------* * * Have we hit the shooter? * RDRSHT CPI SHEND Let's investigate JZ RDRS6 Got him! CPI CHSHT JZ RDRS6 Yep! * *------------------------------------------* * Have they hit a blockade? * *------------------------------------------* * RDRS1 MOV A,M Have we hit a blockade? CPI CHBL1 JNZ RRS15 * MVI A,CHBL2 Put on some debris JMP RDRS2 * RRS15 CPI CHBL2 JNZ RDRS3 No, got something else * MVI A,20H * RDRS2 MOV M,A This does the modification JMP RDRS5 * *------------------------------------------* * Did we get the shooter's missile? * *------------------------------------------* * RDRS3 CPI CHMSL JNZ RDRS5 * XRA A Detonate shooter missile STA PRCBYT * MVI M,EXPL1 Now blank the missile * LDA MSLCHR STA OLDMSL * XCHG JMP RFR5 * *------------------------------------------* * The detonate missile exit routine * *------------------------------------------* * RDRS5 XCHG MVI M,0 DCX H MVI M,0 INX H JMP RFR5 * *------------------------------------------* * They shot our shooter! * *------------------------------------------* * RDRS6 MVI A,6 Let's flash an explosion * STA NOINPT Turn all input off * DCR A Done flashing? JZ RDRSC Yes * LHLD SHTLOC Put on some debris INX H MVI M,EXPL1 INX H MVI M,EXPL1 INX H MVI M,EXPL1 * PUSH PSW * CALL RFRWT * LHLD SHTLOC Now, erase the debris INX H MVI M,20H INX H MVI M,20H INX H MVI M,20H * CALL RFRWT * POP PSW JMP RDRS6+5 Go do it again * *------------------------------------------* * Inintialize necessary parameters * *------------------------------------------* * RDRSC MVI A,',' Initialize the shooter location STA DRTBYT LXI H,SCREEN+381H SHLD SHTLOC LXI H,1 SHLD SHTWB * LDA DEMO ORA A JZ RDREND * LDA SHTNUM Decrement the shooter count DCR A STA SHTNUM * JNZ RDRS7 Nope, not yet * RDREND CMA . Yes, so indicate STA ENDGME JMP RDRS8 * *------------------------------------------* * Re-initialize the shooter * *------------------------------------------* * RDRS7 LDA SHTNUM Print the number on the screen ADI 30H+COLOR STA SHTNMB * LHLD LASTLC Erase the phony shooter MVI M,20H+COLOR INX H MVI M,20H+COLOR INX H MVI M,20H+COLOR LXI B,-7 DAD B SHLD LASTLC * RDRS8 XRA A STA NOINPT RET . * *------------------------------------------* * Continue dropping missiles down * *------------------------------------------* * RFRWT LXI B,WSTWT DCX B MOV A,B ORA C JNZ RFRWT+3 * CALL RFR6 CALL RFR3 * RET . *