User Tools

Site Tools




Author Peregrine Haphton
Compatibility Amstrad PCW 8256 / 8512 / 9512
Year 1987
Gender Arcade
Controls Keyboard
Language English
Status Preserved



You wake up one morning, bright and early, to the sound of the public address system: “… Have the captain of Kalibur report to the base commander's office. Repeat. We're on red alert, all men to stations.” Could the captain of Kalibur report immediately to the base commander's office?

In five minutes, he will be dressed and standing at the base commander's desk, facing the President of the United States. “As you know,” the President begins, “war was declared a year ago and both sides are aware of the consequences of pressing the button, so they will use any other way to erase each other”.

“It was on the cards that they would make a move against our biggest prey, as the havoc it would cause, if it were to break, would be great enough for them to invade without any resistance.”

“Well, it happened. They've dropped most of their air force and hundreds of remote-controlled underwater drones on the dam, and their ship is the only one we have in the area.”

“I hope you realize the danger of the situation and that, by being chosen for this mission, you are destined to be among America's greatest heroes…Buzz Aldrin, J.F. Kennedy, Kermit the frog…”

“Your orders are to advance towards the dam at full speed and defend it until help arrives. This mission is not impossible!”

You leave the office and go to yours. You activate the Vidi display and the Tac computer and begin transmitting orders to your Kalibur ship, the fate of America and the free world resting heavily on your shoulders.

Using Z and X to move your ship, you must try to destroy kamikaze submarines and bomb-dropping planes. To launch a missile, press RETURN, while the number keys will release a depth charge. The higher the number, the deeper it will go before detonating. If the dam is breached or the ship is bombed, the game ends and your score will be compared to the top 10.

Dam Defender is a game based on the famous Pearl Harbor war. Our mission is to destroy all enemy aircraft and submarines that try to sink our ship.

To attack our enemy we will have air missiles to attack the aircraft that do not stop launching missiles at us to sink our fleet and anti-submarine bombs since they pass the information to their aircraft so that they can locate us and sink us.

We will add points for each plane or submarine that we destroy and our record with the best score will always appear at the top of the screen.


  • Listing - DEFENDER.BAS
10 REM           DAM DEFENDER
20 REM        by Peregrine Haphton
30 REM (c) Computing with the Amstrad
40 REM -------------PCW--------------
50 GOSUB 1500:DIM d%(15),sb%(2,3),bo%(3,4):GOSUB 1180:GOSUB 1220
60 WHILE -1:GOSUB 980
70 mx%=255:my%=0:sx%=10:snd=-1:plx%=0:ply%=0:pl%=0:pla%=0:sp%=1:dead%=0:score=0:dp%=255:dp1%=0:dpx%=0
80 FOR f=1 TO 15:d%(f)=4:NEXT:FOR f=1 TO 3:bo%(f,1)=0:sb%(f-1,1)=0:NEXT
90 GOSUB 910:WHILE NOT(dead%):g%=-1
100 IF RND>0.5 AND pl%=0 THEN GOSUB 240
110 IF RND>0.5 AND sb%(sp%,1)=0 THEN GOSUB 280
120 FOR bp%=1 TO 3:IF pl% AND RND>0.25 AND bo%(bp%,1)=0 THEN GOSUB 310
130 NEXT:GOSUB 440:GOSUB 670:GOSUB 340:GOSUB 740
140 PRINT esc$"Y ":k$=LOWER$(INKEY$)
150 IF k$="z" AND sx%>0 THEN sx%=sx%-1
160 IF k$="x" AND sx%<32 THEN sx%=sx%+1
170 IF k$>"/" AND k$<":" THEN GOSUB 580
180 IF k$=CHR$(13) THEN GOSUB 630
190 IF k$="q" THEN snd=0 ELSE IF k$="s" THEN snd=-1
200 IF k$="e" THEN dead%=-1
210 WEND
220 IF snd THEN FOR f=1 TO 10:CALL dead:CALL zap:NEXT
230 WEND
240 REM new plane
250 pl%=-1:plx%=ABS(INT(RND*2))*40:IF plx%=40 THEN pla%=-1 ELSE pla%=1
260 ply%=4+INT(RND*8)
270 plx%=plx%+pla%:RETURN
280 REM new sub
290 sb%(sp%,1)=-1:sb%(sp%,2)=0:sb%(sp%,3)=1+INT(RND*10)
300 sp%=sp%+1:sp%=2*(sp%/2-sp%\2):RETURN
310 REM new bomb
320 bo%(bp%,1)=-1:bo%(bp%,2)=plx%-pla%:bo%(bp%,3)=ply%-1:bo%(bp%,4)=INT(RND*6)-3
340 REM move all
350 FOR f=1 TO 3
360 IF sb%(f-1,1) THEN sb%(f-1,2)=sb%(f-1,2)+1
370 IF bo%(f,1) THEN bo%(f,2)=bo%(f,2)+bo%(f,4):bo%(f,3)=bo%(f,3)-1:IF bo%(f,3)<0 THEN bo%(f,3)=0
380 IF bo%(f,2)<0 THEN bo%(f,1)=0:bo%(f,2)=0
390 NEXT
400 IF mx%<255 THEN my%=my%+1
410 IF dp%<255 THEN dp1%=dp1%+1
420 IF pl% THEN plx%=plx%+pla%
440 REM check dead
450 FOR f=1 TO 3:z%=0
460 IF sb%(f-1,1) AND ABS(dpx%-sb%(f-1,2))<2 AND ABS(dp1%-sb%(f-1,3))<2 AND dp%<>255 THEN sb%(f-1,1)=0:GOSUB 1370:score=score+250:dp%=255:IF snd THEN CALL dead
470 IF sb%(f-1,1) AND sb%(f-1,2)=34+(4-d%(sb%(f-1,3)+1)) THEN d%(sb%(f-1,3)+1)=d%(sb%(f-1,3)+1)-1:GOSUB 1370:l=1+sb%(f-1,3):GOSUB 880:z%=-1:sb%(f-1,1)=0:IF snd THEN CALL dead
480 IF z% AND d%(sb%(f-1,3)+1)=0 THEN dead%=-1
490 IF bo%(f,1) AND bo%(f,2)-sx%>0 AND bo%(f,2)-sx%<4 AND bo%(f,3)=0 THEN GOSUB 1460:bo%(f,1)=0:dead%=-1
500 IF bo%(f,2)>40 OR bo%(f,2)<2 OR bo%(f,3)<1 THEN GOSUB 1460:bo%(f,1)=0
510 NEXT
520 IF pl% AND mx%-plx%>=0 AND mx%-plx%<=2 AND ply%=my% THEN GOSUB 1410:pl%=0:score=score+100:mx%=255:IF snd THEN CALL dead
530 IF pl% AND plx%>39 THEN GOSUB 1410:pl%=0
540 IF pl% AND plx%=0 THEN GOSUB 1410:pl%=0
550 IF my%>10 THEN GOSUB 670:mx%=255
560 IF dp%=dp1% THEN dp%=255
580 REM depth charge
590 IF dp%<255 THEN RETURN
600 IF snd THEN CALL zap
610 dp%=1+VAL(k$):dp1%=0:dpx%=sx%+2
630 REM missile
640 IF mx%<255 THEN RETURN
650 IF snd THEN CALL zap
660 mx%=sx%+2:my%=1:RETURN
670 REM rub enemy
680 FOR f=1 TO 3
690 IF bo%(f,1) THEN a$=" ":x%=2*bo%(f,2):y%=12-bo%(f,3):POKE paper,0:POKE pen,255:CALL print1(x%,y%,a$)
700 NEXT
710 IF mx%<>255 THEN a$=" ":x%=mx%*2:y%=12-my%:POKE paper,0:POKE pen,255:CALL print1(x%,y%,a$)
720 a$=" ":x%=dpx%*2:y%=13+dp1%:POKE paper,85:POKE pen,255:CALL print1(x%,y%,a$)
740 REM print all
750 a$=RIGHT$(STR$(score),LEN(STR$(score))-1):x%=22:y%=29:POKE paper,0:POKE pen,255:CALL print1(x%,y%,a$)
760 IF snd THEN a$="ON " ELSE IF NOT(snd) THEN a$="OFF"
770 x%=28:y%=0:CALL print1(x%,y%,a$)
780 FOR f=1 TO 3
790 IF bo%(f,1) THEN a$=CHR$(4):x%=2*bo%(f,2):y%=12-bo%(f,3):POKE paper,0:POKE pen,255:CALL print1(x%,y%,a$)
800 IF f<>3 AND sb%(f-1,1) THEN a$=" "+CHR$(5)+CHR$(6):x%=2*sb%(f-1,2):y%=13+sb%(f-1,3):POKE paper,85:POKE pen,0:CALL print1(x%,y%,a$)
810 NEXT
820 IF mx%<255 THEN x%=mx%*2:y%=12-my%:a$=CHR$(11):POKE paper,0:POKE pen,255:CALL print1(x%,y%,a$)
830 IF pla%=1 THEN a$=" "+CHR$(0)+CHR$(1) ELSE a$=CHR$(2)+CHR$(3)+" "
840 IF pl% THEN x%=plx%*2:y%=12-ply%:POKE paper,0:POKE pen,255:CALL print1(x%,y%,a$)
850 IF dp%<255 THEN x%=2*dpx%:y%=13+dp1%:a$=CHR$(12):POKE paper,85:POKE pen,0:CALL print1(x%,y%,a$)
860 a$=" "+CHR$(7)+CHR$(8)+CHR$(9)+" ":x%=2*sx%:y%=12:POKE pen,255:POKE paper,0:CALL print1(x%,y%,a$)
880 REM print dam
890 a$=STRING$(4-d%(l)," ")+STRING$(d%(l),CHR$(10)):x%=72:y%=l+12:POKE paper,85:POKE pen,255:CALL print1(x%,y%,a$)
910 REM screen setup
920 PRINT esc$"X  @z"esc$"E"esc$"H"esc$"0"esc$"f"
930 FOR l=1 TO 15:GOSUB 880:NEXT:POKE paper,85:FOR f=1 TO 15:a$=STRING$(36," "):x%=0:y%=12+f:CALL print1(x%,y%,a$):NEXT
940 a$="    ":x%=80:y%=27:CALL print1(x%,y%,a$)
950 POKE paper,0:a$="*** SCORE :      ***":x%=0:y%=29:CALL print1(x%,y%,a$)
960 a$="SOUND EFFECTS":x%=0:y%=0:CALL print1(x%,y%,a$)
980 REM high-score table
990 FOR f=10 TO 1 STEP -1:IF score<hs(f) THEN p%=f:f=1
1000 IF f=1 AND score>hs(f) THEN p%=0
1010 NEXT
1020 IF p%=10 AND g% THEN 1110 ELSE IF p%=10 AND NOT(g%) THEN 1120
1030 p%=p%+1:FOR f=10 TO p%+1 STEP -1
1040 hs$(f)=hs$(f-1):hs(f)=hs(f-1)
1050 NEXT
1060 a$="Well done!":x%=35:y%=2:POKE pen,85:POKE paper,255:POKE double,1:CALL print1(x%,y%,a$)
1070 a$="You have attained":x%=28:y%=4:CALL print1(x%,y%,a$)
1080 a$="Rank number"+STR$(p%):x%=(90-2*LEN(a$))/2:y%=6:CALL print1(x%,y%,a$)
1090 PRINT esc$"Y)*";:INPUT "Enter your name :",hs$(p%):IF LEN(hs$(p%))>15 THEN hs$(p%)=LEFT$(h$(p%),15)
1100 hs(p%)=score:score=0:dead%=0
1110 a$="G a m e  O v e r":x%=29:y%=11:POKE double,1:POKE paper,85:POKE pen,255:CALL print1(x%,y%,a$):FOR f=1 TO 5000:NEXT
1120 PRINT esvc$"X  @z"esc$"E"esc$"H"esc$"0":CALL screen
1130 x%=13:y%=0:POKE double,0:POKE paper,170:POKE pen,255:a$="   T O D A Y ' S  H E R O E S   ":CALL print1(x%,y%,a$)
1140 POKE paper,0:POKE double,1:FOR f=1 TO 10:a$="000000":a$=LEFT$(a$,LEN(a$)-LEN(STR$(hs(f))))+RIGHT$(STR$(hs(f)),LEN(STR$(hs(f)))-1)+"      "+hs$(F):x%=10:y%=f*2:CALL print1(x%,y%,a$):NEXT
1150 a$="PRESS SPACE-BAR TO START OR K TO QUIT":x%=10:y%=29:POKE double,0:CALL print1(x%,y%,a$)
1160 k$="":WHILE k$="":r=RND:k$=INKEY$:IF UPPER$(k$)="K" THEN END:IF k$<>" " THEN k$=""
1170 WEND:g%=0:RETURN
1180 REM initialize high score table
1190 RESTORE 1210:FOR f=1 TO 10:READ hs$(f):hs(f)=(11-f)*100:NEXT:RETURN
1200 REM high scoring 'heroes'
1210 DATA Amstrad PCW,Amstrad PCW,Amstrad PCW,Amstrad PCW,Amstrad PCW,Amstrad PCW,Amstrad PCW,Amstrad PCW,Amstrad PCW,Amstrad PCW
1220 REM udg definitions
1230 RESTORE 1240:FOR f=0 TO 103:READ n:POKE (udg+f),n:NEXT:RETURN
1240 DATA 0,128,192,255,112,15,31,0
1250 DATA 0,0,0,224,124,191,0,0
1260 DATA 0,0,0,7,62,253,0,0
1270 DATA 0,1,3,255,14,240,248,0
1280 DATA 0,0,40,16,16,16,0,0
1290 DATA 0,4,14,15,127,255,255,127
1300 DATA 0,0,0,128,240,252,252,240
1310 DATA 0,0,0,32,115,255,127,63
1320 DATA 96,64,228,239,254,255,255,255
1330 DATA 0,0,2,231,31,254,252,240
1340 DATA 255,4,4,4,255,32,32,32
1350 DATA 0,0,16,16,16,40,0,0
1360 DATA 0,68,56,56,56,56,16,16
1370 REM rub sub
1380 x%=sb%(f-1,2)*2:y%=13+sb%(f-1,3)
1390 a$="  ":POKE paper,85:POKE pen,255
1400 CALL print1(x%,y%,a$):RETURN
1410 REM rub plane
1420 x%=plx%*2:y%=12-ply%:a$="  "
1430 POKE paper,0:POKE pen,255:CALL print1(x%,y%,a$)
1440 IF mx%<>255 THEN x%=mx%*2:y%=12-my%:a$=" ":CALL print1(x%,y%,a$)
1460 REM rub bomb
1470 x%=bo%(f,2)*2:y%=12-bo%(f,3):a$=" "
1480 POKE pen,255:POKE paper,0
1490 CALL print1(x%,y%,a$):RETURN
1510 esc$=CHR$(27)
1520 addr=&HE000:FOR i=1 TO 40:sum=0
1530 READ code$,check$
1540 FOR j=1 TO 21 STEP 2
1550 byte=VAL("&H"+MID$(code$,j,2))
1560 POKE addr,byte:sum=sum+byte
1570 addr=addr+1:NEXT
1580 IF sum<>VAL("&H"+check$) THEN PRINT "Error : line ";i*10+1660:CLEAR:RUN "menu.bas":END
1590 NEXT:screen=&HE000:print1=&HE003
1600 udg=&HD100:pen=&HD001:paper=&HD000
1610 double=&HD006:zap=&HE176
1620 dead=&HE191:POKE pen,255
1630 POKE paper,0:POKE double,0
1640 PRINT esc$+"E"+esc$+"H"
1650 CALL screen:RETURN
1660 REM machine code data
1670 DATA C306E0C35BE0CD29E01198,626
1680 DATA 2C2100B60168013E20F5D5,395
1690 DATA 3E0873237223133D20F8D1,3AA
1710 DATA FCE900C9661A6F2202D00A,49B
1720 DATA 3210D0030A6F030A67ED4B,33A
1730 DATA 10D006001113D0EDB02A02,3A3
1740 DATA D0CDFCE02204D02113D022,595
1750 DATA 11D0C9CD30E0CD29E0F32A,67A
1760 DATA 11D07E232211D0CDEAE011,52D
1770 DATA 4FE1010800EDB0DD2A04D0,4B1
1780 DATA 0E08FD214FE12A00D07D06,3E1
1790 DATA 08FDCB0006380D07DDCB08,3D2
1800 DATA 16DDCB001607C3A4E0CB04,4F1
1810 DATA DDCB0816DDCB0016CB04DD,530
1820 DATA CB0816DDCB001610D7FD23,4AE
1830 DATA 3A06D0A7CAD1E0DD7E08DD,672
1840 DATA 7709DD7E00DD7701DD2379,4A9
1850 DATA FE05C2D1E001C802DD094F,576
1860 DATA DD230DC282E02A04D00110,440
1870 DATA 00092204D02110D035C262,359
1880 DATA E0FBC91100B8FE20300311,4CF
1890 DATA 00D16F260029292919C95C,31F
1900 DATA 260054CB25010FE1094E23,2D5
1910 DATA 46EB29292909C93059005C,363
1920 DATA D05EA06170644067106AE0,504
1930 DATA 6CB06F807250752078F07A,544
1940 DATA C07D9080608330860089D0,53F
1950 DATA 8BA08E709140941097E099,5AE
1960 DATA B09C809F50A220A5F0A7C0,679
1970 DATA AA90AD60B0000000000000,2F7
1980 DATA 0000000000000000000000,000
1990 DATA 0000000000000000000000,000
2000 DATA 0000000000000000000000,000
2010 DATA F31E01168F3E0BD3F84210,41D
2020 DATA FE3E0CD3F84210FE1520EF,587
2030 DATA 1D20EAFBC9F32100011600,416
2040 DATA 237EE61F4F3E0BD3F84110,45A
2050 DATA FE3E0CD3F84110FE1520EA,581
2060 DATA FBC9000000000000000000,1C4


       Z = LEFT
       X = RIGHT
   1 to 9 = FIRE ANTI-SUBMARINE MISSILE (The higher the number, the deeper the anti-submarine charge goes)
       Q = SOUND OFF
       E = LEAVE GAME 

Loading the program

 1.- Insert the CP/M disc on side 2
 2.- Write BASIC and wait for it to load
 3.- Remove the CP/M disk and insert the disk containing the Dam Defender game
 4.- Type run "Defender" and press the "ENTER" key


  • Listing of the program in a large-circulation magazine of the time

dam_defender_01.jpg dam_defender_02.jpg dam_defender_03.jpg



en/dam_defender.txt · Last modified: 2022/06/29 14:47 by jevicac