Sharp PC-1500 : INVADER game

"Invader" for Sharp PC-1500 +4,8,16 KB or PC-1500A.
Unpublished (based on the version published in Hebdogiciel #56).
Author: E. Beaurepaire.
BASIC program - 3277 bytes.

Download zipped WAV (35 KB)

Plot: Will you be able to make it trough the defenses of horrible planet zglu and destroy zgluars' horrible secret base to prevent this horrible civilization from destroying humanity ?
This program includes a couple of machine-code routines to perform a horizontal scroll of the screen and generate sci-fi sounds.
Caution: BE CAREFUL when entering the POKE data. If you enter wrong codes, the computer will likely stall at run time and you will have to reset it (button on the back), loosing your programs. Double check these lines before running the program.

Running the program:
Type RUN or DEF S
Keys:
9 : up
= : down
SPACE : smart bomb
Difficulty:
Level 1 : short game, 4 smart bombs
Level 2 : long game, 3 smart bombs
Scoring:
Fly as close to the ground as possible to increase your score. Flying through an isolated dot (see screen copy #2) gives 100 bonus points. Completing the game gives 5000 bonus points. To complete the game, you have to destroy the large base (a spare smart bomb is needed) and fly through it.


BASIC program.

1 "INVADER":REM v2.0 E.BEAUREPAIRE 1984-2000
2 "PC-1500 +4,8,16 Ko or PC-1500A
6 "S"CLEAR :CLS :WAIT 0: DIM A$(0)*36,B(5)
8 GOSUB 700
10 CURSOR 11:PRINT "Keys: 9/=/SPACE"
12 POKE &7050,&58,&76,&5A,&00,&FD,&18,&50,&50,&49,&0F,&15,&B9,&F0,&0B,&0E,&50,&40
14 POKE &7061,&5E,&4E,&99,&0D,&5C,&77,&8B,&19,&FD,&50,&5A,&00,&49,&0F,&15,&B9,&F0
16 POKE &7072,&0B,&0E,&40,&50,&4E,&4E,&99,&0D,&FD,&40,&4A,&00,&5A,&02,&9E,&2A,&49
18 POKE &7083,&0F,&40,&49,&0F,&9A
20 POKE &7088,&58,&76,&5A,&20,&15,&BD,&FF,&B9,&F0,&59,&0F,&1B,&1E,&50,&5E,&30,&99
22 POKE &7099,&0E,&BE,&70,&A9,&58,&76,&5A,&20,&59,&0F,&50,&5E,&30,&99,&07,&9A
24 POKE &70A9,&68,&03,&6A,&09,&48,&01,&4A,&02,&BE,&70,&C8,&62,&6E,&00,&99,&08,&BE
26 POKE &70BA,&70,&C8,&60,&6E,&32,&99,&08,&FD,&62,&6C,&00,&99,&1C,&9A
28 POKE &70C8,&FD,&A8,&FD,&88,&BE,&E6,&6F,&FD,&0A,&FD,&2A,&9A
30 GOSUB 400
35 CLS :WAIT 0:ON ERROR GOTO 210
40 GOSUB 700
45 CURSOR 13:PRINT " LEVEL? (1/2)"
50 A$=INKEY$ :IF A$="1"LET L=1:GOTO 65
55 IF A$="2"LET L=2:GOTO 65
60 GOTO 50
65 SB=5-L,L=L*3+1:CURSOR 13:PRINT "____"
70 B(0)=0,B(1)=1,B(2)=5,B(3)=21,B(4)=85
75 GCURSOR 74:GPRINT B(SB);B(SB);"007F"
80 CURSOR 7:PRINT "GO!"
85 GCURSOR 102:FOR I=1TO 3:RESTORE 299+RND 3
90 READ A$(0):GPRINT A$(0);:NEXT I
95 R=POINT 93,A=1,B=L-4,C=299,S=0
100 FOR Z=1TO 6
105 FOR D=1TO B
110 FOR I=1TO 18
115 GOSUB "SP"
120 NEXT I:RESTORE C+RND 3
125 READ A$(0):GCURSOR 138:GPRINT A$(0)
130 NEXT D:B=L,C=C+3:NEXT Z
135 FOR I=1TO 15:GOSUB "SP":NEXT I
140 GCURSOR 150: GPRINT "4E7F7B7F4E"
145 FOR I=1TO 65:GOSUB "SP":NEXT I
150 CURSOR 8:PRINT "BRAVO!"
155 POKE &70AA,5:POKE &70AC,1:POKE &70B0,10:POKE &70BE,60
160 CALL &70A9
165 POKE &70AA,3:POKE &70AC,9:POKE &70B0,2:POKE &70BE,50
170 S=S+5000:PRINT "SCORE :";S;" !!!":GOTO "END"
175 "SP"Q=R,R=POINT 94,S=S+INT (A/4)
180 CALL &7050
185 GCURSOR 92:GPRINT Q;ROR A
190 IF (RAND A)>0 GOTO "CR"
195 GOTO "*"+INKEY$
200 "*9"A=A/(1+(A>1)):GOTO 210
205 "*="IF A<64LET A=A*2
210 "*"CURSOR 7:PRINT S:RETURN
215 "* "IF SB>0LET SB=SB-1:GCURSOR 74:GPRINT B(SB);B(SB):CALL &7088
220 GOTO 210
225 "CR"IF A=RBEEP 1,20:S=S+100,R=0:GOTO 195
230 FOR I=0TO 5:POKE# 64000,1:NEXT I:BEEP 5,20,20:CURSOR 0:PRINT "SCORE :"
235 "END"CURSOR 13:PRINT " AGAIN? (Y/N)"
240 A$=INKEY$:IF A$="Y"GOTO 35
245 IF A$="N"CLS :END
250 GOTO 240
300 DATA "6060606060707070787E6060707860000000"
301 DATA "000000707070787860600000606000606070"
302 DATA "70707078787C7C7C78606078600000000000"
303 DATA "606060787E606060002000006070787C7060"
304 DATA "000000607870600020000060707878706000"
305 DATA "607000000000000060707C78706000200000"
306 DATA "416347030002000061430723310000046070"
307 DATA "6163410020006070787C7061430703100000"
308 DATA "0000004167634300005C5C00020000030710"
309 DATA "006063030000181800036360000006363000"
310 DATA "000303001818006060060600303003031818"
311 DATA "000C0C006063031818000006666000031B18"
312 DATA "636371797143474F4F4F4343417179717163"
313 DATA "636170787C7D7D7878797163474F47477363"
314 DATA "6343474F4F4F477371797979797171636363"
315 DATA "6343474F430063474F5F4F47636104716163"
316 DATA "6343474F6104414163717179797141104363"
317 DATA "636171797100100773797971614347104763"
400 FOR I=50TO 20STEP -1:BEEP 1,I,2:NEXT I
410 CURSOR 7:PRINT " "
420 A$(0)="00000C2F3F2F2F2F3E2C2C2C0C08"
430 GCURSOR 80:GPRINT "0E5F7F5F0E"
440 WAIT 0:FOR I=40TO 64:GCURSOR I:GPRINT A$(0)
450 IF INKEY$ <>""RETURN
460 NEXT I
470 CALL &70A9
480 FOR I=80TO 86:GCURSOR I-2:GPRINT 0:IF POINT I<>0GCURSOR I:GPRINT 8OR RND 127:POKE# 64000,1
490 GCURSOR I:GPRINT 8:NEXT I
500 GCURSOR I-2:GPRINT 0;0
510 FOR I=20TO 10STEP -1:BEEP 1,I,5:NEXT I
520 FOR I=66TO 88STEP 2:GCURSOR I:GPRINT A$(0)
530 IF INKEY$ <>""RETURN
540 NEXT I
550 WAIT 5
560 GCURSOR I+5:GPRINT "1818":POKE# 64000,1
570 GCURSOR I+2:GPRINT "08492A006B002A4908":POKE# 64000,1
580 GCURSOR I-1:GPRINT "08080800001441140000080808":POKE# 64000,1
590 GCURSOR I-1:GPRINT "00000000220000002200000000":POKE# 64000,1
600 GCURSOR I+3:GPRINT "0000000000":POKE# 64000,1
610 RETURN
700 GPRINT "7F5D415D7F417B776F417F79675F67797F436D6D6D437F415D5D5D63";
710 GPRINT "7F4155555D7F417575655B7F"
720 RETURN


Disassembling of the machine code part. (This is included in the BASIC program above and does not have to be entered separately.)

Shift right half-screen 1 pixel to the left
(relocatable routine)

7050 5876
7052 5A00
7054 FD18
7056 50
7057 50
7058 490F
705A 15
705B B9F0
705D 0B
705E 0E
705F 50
7060 40
7061 5E4E
7063 990D
7065 5C77
7067 8B19
7069 FD50
706B 5A00
706D 490F
706F 15
7070 B9F0
7072 0B
7073 0E
7074 40
7075 50
7076 4E4E
7078 990D
707A FD40
707C 4A00
707E 5A02
7080 9E2A
7082 490F
7084 40
7085 490F
7087 9A
LDI YH,76
LDI YL,00
LDX Y
INC YL
INC YL
ANI (X),0F
LDA (Y)
ANI A,F0
ORA (X)
STA (X)
INC YL
INC XL
CPI YL,4E
BZR -0D (7058)
CPI YH,77
BZS +19 (7082)
INC YH
LDI YL,00
ANI (X),0F
LDA (Y)
ANI A,F0
ORA (X)
STA (X)
INC XL
INC YL
CPI XL,4E
BZR -0D (706D)
INC XH
LDI XL,00
LDI YL,02
BCH -2A (7058)
ANI (X),0F
INC XL
ANI (X),0F
RTN

"Smart bomb": invert columns + call sci-fi sound + erase columns
(not relocatable)

7088 5876
708A 5A20
708C 15
708D BDFF
708F B9F0
7091 590F
7093 1B
7094 1E
7095 50
7096 5E30
7098 990E
709A BE70A9
709D 5876
709F 5A20
70A1 590F
70A3 50
70A4 5E30
70A6 9907
70A8 9A
LDI YH,76
LDI YL,20
LDA (Y)
EAI FF
ANI A,F0
ANI (Y),0F
ORA (Y)
STA (Y)
INC YL
CPI YL,30
BZR -0E (708C)
SJP 70A9
LDI YH,76
LDI YL,20
ANI (Y),0F
INC YL
CPI YL,30
BZR -07 (70A1)
RTN

Sci-fi sound
(not relocatable)

70A9 6803
70AB 6A09
70AD 4801
70AF 4A02
70B1 BE70C8
70B4 62
70B5 6E00
70B7 9908
70B9 BE70C8
70BC 60
70BD 6E32
70BF 9908
70C1 FD62
70C3 6C00
70C5 991C
70C7 9A
LDI UH,03
LDI UL,09
LDI XH,01
LDI XL,02
SJP 70C8
DEC UL
CPI UL,00
BZR -07 (70B1)
SJP 70C8
INC UL
CPI UL,32
BZR -08 (70B9}
DEC UH
CPI UH,00
BZR -1C (70AB)
RTN

Call beep routine

70C8 FDA8
70CA FD88
70CC BEE66F
70CF FD0A
70D1 FD2A
70D3 9A
PSH U
PSH X
SJP E66F
POP X
POP U
RTN

Return to the main page