* * File Name: RAIDR1:S * ORG 100H XEQ STRGME * TITL Space Raiders Version 1.0"Written by Stephen Maguire * *------------------------------------------------------------* * * * Space Raiders Version 1.0 * * Written by Stephen Maguire * * * * P. O. Box 3742 DT * * Anchorage, AK 99510 * * * * Copyright (C) 1979 * * All rights reserved * * * * * * This is an 8080/Z80 video game written for all * * VDM type monitors such as in the Sol, Radio * * Shack, Polymorphic, etc. All necessary equates * * changes can be made by changing the pertinent * * EQU statements. This video game is based on the * * "Space Invaders" game in which the Japanese spent * * over 2,730,000,000 dollars playing!!! This was * * written to demonstrate the use of software inter- * * rupts and different methods of data storage and * * data access. The author assisted with the pro- * * gramming of the original arcade version. This * * version is identical in function to the original. * * (less sound effects) However, the code is entirely * * different. * * * *------------------------------------------------------------* * *-------------------------------------------* * Screen equates of the VDM. * * If you are using a SOL, then ignore * * these. TRS-80, etc. must change these. * *-------------------------------------------* * SCREEN EQU 0CC00H These are VDM locations (TRS-80 = 3C00H) BOTSCR EQU 0D0H Just below the bottom (TRS-80 = 40H) TOPSCR EQU 0CBH Just above the top (TRS-80 = 3BH) BOTLN EQU 0CFH The very bottom of the screen (TRS-80 = 3FH) * SDESCR EQU 3BH Just on the left side (These are OK) LFTSD EQU SCREEN-6 The left side RGTSD EQU SCREEN+3FH The right side * SCRLOC EQU SCREEN+3DFH Screen location of score BINLOC EQU SCREEN+0DDH Location of big number NWHADR EQU SCREEN+3F9H High score screen address HGHADR EQU SCREEN+1C9H New high score screen address OVRADR EQU SCREEN+114H Game over screen address CMPADR EQU SCREEN+056H Company name screen address CPYADR EQU SCREEN+0CBH Copyright screen address STTADR EQU SCREEN+38BH Press key to start address * PLYADR EQU SCREEN+04CH Player start screen address FREADR EQU SCREEN+14BH Fire! screen address MOVADR EQU SCREEN+1CBH Move-keys screen address CLRADR EQU SCREEN+24BH "CLEAR" address DELADR EQU SCREEN+350H "DEL" address ESCADR EQU SCREEN+2CFH "ESC" address * R3ADR EQU SCREEN+194H Raider value addresses R2ADR EQU SCREEN+214H R1ADR EQU SCREEN+294H RUADR EQU SCREEN+313H UFO value screen address STRRDR EQU SCREEN+82H Initial location of raiders on screen * *-------------------------------------------* * Equates for shooter routine. * *-------------------------------------------* * LASTORG EQU SCREEN+3CBH Address of last phoney shooter SHTNMB EQU SCREEN+3C2H Address of "number of shooters" * *-------------------------------------------* * Equates for all wait states in program. * *-------------------------------------------* * MWAIT EQU 1200 The wait time between raider movements MWTME EQU -22 Time decrement for each raider shot -(MWAIT/55) WSTWT EQU 1500 Time between raider missiles movements FRSTWT EQU 7FFH Time between printing raiders for 1st time * PRTSPD EQU 10H Normal text printing speed (the >, the slower) LTRSPD EQU 17FFH Giant text printing speed SHTWT EQU 63 Wait value between moving the shooter CHKWT EQU 20 Wait time to sychronize the timing loops DMOVAL EQU 1000 Wait time between demo moves * TBUFO EQU 18000 Time between UFOs coming across screen MOVWT EQU 110 Time between UFO movements during time on screen WTSHT EQU 1000 Time UFO "hit" score remains on screen OVRWT EQU 3FFFH Time between games * *-------------------------------------------* * Set these equates properly. * * If your VDM supports inversed letters, * * then equate the respective values. * *-------------------------------------------* * COLOR EQU 80H Inversed (80H) or not (00H) NUMINV EQU 030H Inversed (0B0H) or not (30H) NUMNRM EQU 30H Same as above * INVBLK EQU 0A0H An inversed blank (TRS-80 = 0BFH) * *------------------------------------------* * These equates describe how the raiders * * shall look. the raiders are in the * * form of: * * * * >T< ]M[ )B( * * * * NOTE: None of these characters can * * be the same as raider missiles. * *------------------------------------------* * R30L EQU '>' The ">" character above R30M EQU 07H The "T" R30R EQU '<' The "<" * R20L EQU ']' Etc. R20M EQU 0FH R20R EQU '[' * R10L EQU ')' R10M EQU 05H R10R EQU '(' * *------------------------------------------* * The barricade definition equates * *------------------------------------------* * CHBL1 EQU 0A0H An inversed blank CHBL2 EQU 0FFH An inversed delete EXPL1 EQU 07FH The explosion character EXVAL EQU 7FH The explosion wait time * *------------------------------------------* * The raider missile definition equates * *------------------------------------------* * RMSL1 EQU 19H The raider missiles RMSL2 EQU '$' RMSL3 EQU '{' RMSL4 EQU '}' * *------------------------------------------* * The shooter definition equates. Form * * is: missile: * * xXx M * *------------------------------------------* * SHEND EQU 'm' The "x" character above CHSHT EQU 0EH The "X" CHMSL EQU 19H The "M" * *------------------------------------------* * UFO definition equates: * *------------------------------------------* * UFOLEN EQU '<' The "<" character above UFOMID EQU 'O' The "O" UFOREN EQU '>' The ">" CHROV EQU 0FH The "0" * *------------------------------------------* * Input definition equates. * *------------------------------------------* * MONIN EQU 0C01FH Input routine address MONEX EQU 0BCBCH Entry point to PTDOS monitor * FRCHR EQU 20H Space bar fires a missile CHSTT EQU 'S' The letter "S" starts the game CHLEFT EQU ',' Move shooter left CHRGHT EQU '.' Move shooter right CHDEL EQU 7FH Delete key says restart game CHCLR EQU 8BH Clear high score and restart game CHESC EQU 1BH Escape key says go back to monitor * *-------------------------------------------* * Begin execution of the program. * *-------------------------------------------* * STRGME LXI H,0 Erase the high score upon execution SHLD HIGH * START LXI SP,MNSTK Print next message 3 times MVI B,4 * STT DCR B All done? JZ DODEMO Yes, go do a demo play * PUSH B CALL CLEAR Clear the screen * LXI D,STTMES Print the press-key-to-start message LXI H,STTADR Put it here MVI B,PRTSPD Tell how fast to print MVI C,0 Print it in normal letters CALL PRINT * LXI H,2000 Pause a bit CALL MESWT+3 * LXI H,SCREEN Print "SPACE" LXI D,BIGLTR CALL PRTLR Do it now INX D Print "RAIDERS!" LXI H,SCREEN+190H CALL PRTLR Go do it * XRA A STA DEMO If not, turn demo on POP B * CALL MESWT Wait for a bit * JMP STT * *-------------------------------------------* * Start processing a demonstration game * *-------------------------------------------* * DODEMO CALL CLEAR Print the company name message LXI D,CPYMES LXI H,CMPADR LXI B,PRTSPD*100H CALL PRINT * LXI H,CPYADR Print the copyright message CALL PRINT * LXI H,R3ADR Print the value of 30 point raider CALL PRINT * LXI H,R2ADR Print the value of 20 point raider CALL PRINT * LXI H,R1ADR Print the value of 10 point raider CALL PRINT * LXI H,RUADR Print the UFO values CALL PRINT * CALL MESWT Wait a bit * XRA A Do a demonstration STA DEMO * JMP NEWGME * *-----------------------------------------* * This is a routine to print a string * * of giant letters. * *-----------------------------------------* * PRTLR PUSH H Starting screen address * LDAX D Get a character definition byte CPI 0FFH Are we done? JNZ PRTL2 No, keep printing this letter * POP H Yes, get location of next letter * INX D Are we at the end of the string? LDAX D CPI 0FFH RZ . Yes, all done so return * LXI B,LTRSPD Wait a spell * PRTL0 DCX B MOV A,B ORA C JNZ PRTL0 No, keep going * LXI B,6 Calculate the new letter's location DAD B * JMP PRTLR Go print it * *-------------------------------------------* * This routine prints one definition byte * * as explained just before BIGLTR starts * *-------------------------------------------* * PRTL2 ADD A Get to the significant bits ADD A ADD A MVI B,5 Only the lower five are important * PRTL3 RAL . Should we light up this dot? MVI M,20H Put in a blank in case of 'no' JNC PRTL4 If bit is one, then yes * MVI M,INVBLK "Turn on" the location with an inversed blank * PRTL4 INX H Move to the next screen location DCR B Are we done with all 5 bits? JNZ PRTL3 No, not yet * LXI B,59 Move down on the screen and do the next byte DAD B INX D Point to the next byte JMP PRTLR+1 Go print it * *-------------------------------------------* * This is a short wait routine * *-------------------------------------------* * MESWT LXI H,27FFH Wait a bit * CALL INPUT Go see if ESC, DEL, CLR, or "S" has been typed * DCX H MOV A,H ORA L JNZ MESWT+3 * RET . * *-------------------------------------------* * Exit routine. Return to the monitor * *-------------------------------------------* * EXIT CALL MONEX Do a PTDOS exit DB 0DH * *-------------------------------------------* * This is how a giant letter is made: * * * * 1 1 1 1 1 = 1FH ! * * 1 0 0 0 0 = 10H ! * * 1 1 1 1 1 = 1FH !==> the letter "S" * * 0 0 0 0 1 = 01H ! defined * * 1 1 1 1 1 = 1FH ! * * 0FFH ==> end of letter * * mark * *-------------------------------------------* * BIGLTR DB 1FH,10H,1FH,01H,1FH,0FFH "S" DB 1FH,11H,1FH,10H,10H,0FFH "P" DB 1FH,11H,1FH,11H,11H,0FFH "A" DB 1FH,10H,10H,10H,1FH,0FFH "C" DB 1FH,10H,1EH,10H,1FH,0FFH "E" DB 0FFH * DB 1FH,11H,1FH,14H,17H,0FFH "R" DB 1FH,11H,1FH,11H,11H,0FFH "A" DB 1FH,04H,04H,04H,1FH,0FFH "I" DB 1EH,11H,11H,11H,1EH,0FFH "D" DB 1FH,10H,1EH,10H,1FH,0FFH "E" DB 1FH,11H,1FH,14H,17H,0FFH "R" DB 1FH,10H,1FH,01H,1FH,0FFH "S" DB 10H,10H,10H,00H,10H,0FFH "!" DB 0FFH * BIGNUM DB 0,0,0,0,0,0FFH,0FFH A blank * DB 0EH,13H,15H,19H,0EH,0FFH,0FFH "0" DB 07H,0FH,03H,03H,03H,0FFH,0FFH "1" DB 1FH,01H,1FH,10H,1FH,0FFH,0FFH "2" DB 1FH,01H,0FH,01H,1FH,0FFH,0FFH "3" DB 12H,12H,1FH,02H,02H,0FFH,0FFH "4" DB 1FH,10H,1FH,01H,1FH,0FFH,0FFH "5" DB 1FH,10H,1FH,11H,1FH,0FFH,0FFH "6" DB 1FH,01H,02H,04H,04H,0FFH,0FFH "7" DB 1FH,11H,1FH,11H,1FH,0FFH,0FFH "8" DB 1FH,11H,1FH,01H,1FH,0FFH,0FFH "9" * *-------------------------------------------* * Some necessary messages to print * *-------------------------------------------* * CPYMES ASCZ " The Space Invaders " ASCZ " Copyright (C) 1979 by Stephen Maguire " R3MES DB R30L,R30M,R30R 30 point raider message ASCZ " = 3 0 p o i n t s" R2MES DB R20L,R20M,R20R 20 point message ASCZ " = 2 0 p o i n t s" R1MES DB R10L,R10M,R10R 10 point message ASCZ " = 1 0 p o i n t s" RUMES DB UFOLEN,UFOMID,UFOMID,UFOMID,UFOREN Ufo message ASCZ " = ? ? ? p o i n t s" * STTMES ASCZ 'Press "S" anytime to start playing . . .' * OVRTXT ASCZ ' G a m e O v e r ' NWHTXT ASCZ ' N e w H i g h S c o r e o f ' * BOTTXT ASC ' 3: ' DB SHEND,CHSHT,SHEND,20H,20H,SHEND,CHSHT,SHEND ASC ' Score: 00000 High Score: ' ASCZ '00000 ' * PLYTXT ASCZ ' * * * Press any key to start * * * ' PLYBLK ASCZ ' ' FRETXT ASCZ 'Pressing the SPACE BAR shoots a missile.' MOVTXT ASCZ 'The keys "<" and ">" direct the shooter.' CLRTXT ASCZ '"CLEAR" resets the high score and game.' ESCTXT ASCZ '"ESCAPE" exits to the monitor.' DELTXT ASCZ '"DEL" resets the game only.' *