We just reached 30,000 articles on this wiki! 🥳
If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Arcade Flight Simulator (ZX Spectrum)

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

Arcade Flight Simulator

Developer: Amazing Games
Publisher: Codemasters
Platform: ZX Spectrum
Released in EU: 1989


SourceIcon.png This game has uncompiled source code.


Source Code Fragment

A large section of the code is left in the game. The code seen below can be seen with a hex editor, starting at A10A in the .tap dump of the game.

        LD	A,(FLPFLP)
        CP	0
        RET	Z
        LD	A,252
        LD	(ENGONF),A
        LD	A,(IX+0)
        CP	0
        JR	Z,HITGRD
        DEC	A
        LD	(IX+0),A
        LD	A,(DE)
        CP	100
        CALL	Z,FALLIN
        RET
HITGRD	LD	A,252
        LD	(IX+3),A
        LD	(ENGONF),A
        XOR	A
        LD	(DE),A
        LD	A,(STAGE)
        LD	(EXPCNT),A
        RET
EXPCNT	DEFB	0
EXPLOD	CP	255
        JR	Z,NODEPL
        INC	A
        LD	(IX+3),A
        RET
NODEPL	LD	A,(EXPCNT)
        CP	0
        JR	Z,GONDIE
        DEC	A
        LD	(EXPCNT),A
        LD	A,253
        LD	(ENGONF),A
        LD	(IX+3),A  
        LD	A,(EXPCNT)
        CP	0
        JR	Z,EXP1
        CP	1
        JR	Z,EXP2
        JR	EXP3
GONDIE	LD	(IX+2),0
        LD	(IX+3),0
        LD	A,(NOALIS)
        DEC	A
        LD	(NOALIS),A
        XOR	A
        LD	(DE),A
        RET
EXP1	LD	A,(IX+1)
        ADD	A,3
        LD	(IX+1),A
        LD	A,(IX+2)
        SUB	4
        LD	(IX+2),A
        RET
EXP2	LD	A,(IX+1)
        ADD	A,2
        LD	(IX+1),A
        LD	A,(IX+2)
        ADD	A,6 
        LD	(IX+2),A
        RET
EXP3	LD	A,(IX+1)
        SUB	4
        LD	(IX+1),A
        LD	A,(IX+2)
        SUB	4
        LD	(IX+2),A
        RET
HEIGHT	DEFB	0
BONDWN	LD	A,(HL)
        CP	"0"
        JR	NZ,FNDBOD
        DEC	HL
        DJNZ	BONDWN
        RET
FNDBOD	DEC	A
        LD	(HL),A
        LD	A,B
        CP	3
        RET	Z
        INC	HL
        LD	(HL),"9"
        CP	1
        RET	NZ
        INC	HL
        LD	(HL),"9"
        RET
GAMESU	LD	HL,SCORE1
        LD	DE,SCORE1+1
        LD	(HL),"0"
        LD	BC,15
        LDIR
        LD	A,"3"
        LD	(LIVES1),A
        LD	(LIVES2),A
        LD	HL,BONUS1
        LD	DE,BONUS1+1
        LD	BC,9
        LD	(HL),"0"
        LDIR
        LD	A,(STAGE)
        ADD	A,48
        LD	(BONUS1+1),A
        LD	(BONUS2+1),A
        RET
LIVES1	DEFB	0
LIVES2	DEFB	0
BETALS	DEFB	0
PERBET	DEFB	0
WOTPAT	DEFB	0
NOALIS	DEFB	0
REFILL	LD	A,(YOUHGT)   
        CP	0
        JR	NZ,PLYR2A
        LD	A,(YOUDIR)
        CP	250
        JR	NC,PLYR2A
        LD	A,(PERAM1)
        LD	(AMMO11),A
        LD	A,(PERAM2)
        LD	(AMMO12),A
        LD	HL,#5840
        LD	A,(AMMO11)
        CALL	AMOLIN
IPLYR2A	LD	A,(CONTR2)
        CP	4
        RET	Z
        LD	A,(TABADI)   
        CP	0
        RET	NZ
        LD	A,(PERAM1)
        LD	(AMMO21),A
        LD	A,(PERAM2)
        LD	(AMMO22),A
        LD	HL,#5840+28
        LD	A,(AMMO21)
        CALL	AMOLIN
        RET
WHICHP	DEFB	0
UNDER	LD	IX,YOUHGT
        LD	B,5
LUNDR	PUSH	BC
        LD	A,B
        LD	(WHICHP),A
        LD	A,(IX+0)
        CP	4
        JP	NC,PLNNOG
        LD	A,(IX+2)
        CP	193
        JP	NC,PLNNOG
        CP	16
        JP	C,PLNNOG
        LD	HL,COLBUF-26
        LD	A,(IX+2)
        ADD	A,7
        LD	DE,26
        AND	248
        RRCA
        RRCA
        RRCA
        LD	B,A
        INC	B
JLYVAU	ADD	HL,DE
        DJNZ	LYVAU
        LD	A,(IX+1)
        ADD	A,7
        AND	248
        RRCA
        RRCA
        RRCA
        LD	E,A
        LD	D,0
        ADD	HL,DE
        LD	A,(HL)
        CP	255
        JR	Z,PLNNOG
        LD	B,A
        LD	A,(IX+0)
        INC	B
        CP	B
        JR	C,KILPLN
ZKPLNNOG	LD	DE,13
            ADD	IX,DE
            POP	BC
            DJNZ	LUNDR
            RET
KILPLN	LD	A,(IX+3)
        CP	250
        JR	NC,PLNNOG
        LD	(IX+3),252
        LD	A,(WHICHP)
        CP	5
        JR	Z,PLNNOG
        LD	HL,NOALIS
        INC	(HL)
        JR	PLNNOG
KRUDEAD	LD	A,(YOURY)
        CP	0
        JP	NZ,NOTDE1
        LD	A,(LIVES1)
        CP	"1"
        JR	NZ,YURDE1
        LD	A,(TABADI+3)
        CP	250
        JR	C,YURDE1
        LD	HL,LIVES2
        DEC	(HL)
        JP	YURDE1
RUDED2	LD	A,(CONTR2)
        CP	4
        JP	Z,GAMEL1
        LD	A,(TABADI+2)
        CP	0
        JP	NZ,GAMEL1
        LD	A,(LIVES2)
        CP	"1"
        JR	NZ,YURDE2
        LD	A,(YOUDIR)
        CP	250
        JR	C,YURDE2
        LD	HL,LIVES1
        DEC	(HL)
YURDE2	LD	A,(LIVES2)
        DEC	A
        LD	(LIVES2),A
        CP	"0"
        JP	Z,GAMOVE
        LD	HL,(P1INIT+3)
        LD	(TABADI+1),HL
        XOR	A
        LD	(TABADI),A
        LD	(TABADI+3),A
        LD	A,(P1INIT+3+2)
        LD	(TABADI+4),A
        LD	HL,BONUS2
        LD	DE,BONUS2+1
        LD	BC,4
        LD	(HL),"0"
        LDIR
        LD	A,(STAGE)
        ADD	A,48
        LD	(BONUS2+1),A
        JP	GAMEL1
YURDE1	LD	A,(LIVES1)
        DEC	A
        LD	(LIVES1),A
        CP	"0"
        JP	Z,GAMOVE
        LD	IX,TABADI
        LD	B,4
        LD	C,0
LNOON	LD	A,(IX+2)
        CP	0
        JR	Z,NOTACC
        INC	C
NOTACC	LD	DE,13
        ADD	IX,DE
        DJNZ	LNOON
        LD	A,(NOALIS)
        ADD	A,C
        LD	(NOALIS),A
        LD	HL,BONUS1
        LD	DE,BONUS1+1
        LD	BC,4
        LD	(HL),"0"
        LDIR
        LD	A,(STAGE)
        ADD	A,48
        LD	(BONUS1+1),A
        LD	A,(CONTR2)
        CP	4
        JP	Z,REBEGI
        LD	HL,(P1INIT)
        LD	(YOURX),HL
        XOR	A
        LD	(YOUHGT),A
        LD	(YOUDIR),A
        LD	A,(P1INIT+2)
        LD	(YOUDI2),A
        JP	NOTDE1
GAMOVE	XOR	A
        LD	(ENGONF),A
        LD	A,(TABADI+2)
        CP	0
        JR	NZ,P1ONLY
        LD	HL,LIVES2
        DEC	(HL)
P1ONLY	LD	A,(CONTR2)
        CP	4
        JR	NZ,JSR1
JSR2	CALL	THEEND
        JP	GO
JSR1	LD	A,(AWAR)  
        CP	1
        JR	NZ,JSR2
        LD	A,(STAGE)
        CP	3
        JR	Z,JSR3
        CALL	ALLWGM
        JP	REBEG2
JSR3	CALL	THEEND
        CALL	ALLWGM
        JP	GO
THEEND	LD	HL,#4800+10
        LD	DE,GAMOS1
        LD	A,79
        LD	(ATTRVL),A
        LD	B,12
        CALL	STRING
        LD	HL,#4820+10
        LD	B,12
        CALL	STRING
        LD	HL,#4840+10
        LD	DE,GAMOS1
        LD	B,12
        CALL	STRING
        LD	B,150
GOWAIT	HALT
        DJNZ	GOWAIT
        RET
SHADGE	LD	A,(FLICKR)
        XOR	1
        LD	(FLICKR),A
        LD	HL,YOUHGT
        LD	DE,SHADOH
        LD	BC,4
        LDIR
        LD	IX,YOUHGT
        CALL	CALCSH
        LD	A,(CONTR2)
        CP	4
        RET	Z
        LD	A,(FLICKR)
        CP	0
        RET	Z
        LD	HL,TABADI
        LD	DE,SHADOH
        LD	BC,4
        LDIR
        LD	IX,TABADI
CALCSH	LD	A,(IX+0)
        CP	0
        RET	Z
        CP	1
        RET	Z
        LD	B,A
        LD	A,(IX+1)
        LD	C,2
CALCSL	ADD	A,C
        DJNZ	CALCSL
        LD	(SHADOX),A
        RET
ALLWGM	LD	A,(LIVES1)
        LD	HL,LIVES2
        CP	(HL)
        JR	Z,SAME
        JR	C,P2PLUS
        LD	HL,P1WARS
        INC	(HL)
        JR	SAME
P2PLUS	LD	HL,P2WARS
        INC	(HL)
SAME	CALL	FADE
        LD	HL,60000
        LD	DE,60001
        LD	(HL),"#"
        LD	BC,23
        LDIR
        LD	(HL),32
        LD	BC,24
        LDIR
        LD	A,"&"
        LD	(60024),A
        LD	(60024+23),A
        LD	A,66
        LD	(ATTRVL),A
        LD	A,";"
        LD	(60000),A
        LD	A,"%"
        LD	(60023),A
        LD	HL,#4820+4
        LD	DE,60000
        LD	B,24
        CALL	STRING
        LD	A,"'"
        LD	(60000),A
        LD	A,")"
        LD	(60023),A
        LD	HL,#48E0+4
        LD	DE,60000
        LD	B,24
        CALL	STRING
        LD	B,5
        LD	HL,#4840+4
LPEDGE	PUSH	BC
        PUSH	HL
        LD	DE,60024
        LD	B,24
        CALL	STRING
        POP	HL
        LD	DE,32
        ADD	HL,DE
        POP	BC
        DJNZ	LPEDGE
        LD	A,70
        LD	(ATTRVL),A
        LD	DE,P1WINM
        CALL	PUTAMN
        LD	A,71
        LD	(ATTRVL),A
        LD	HL,#48A0+9
        LD	A,(P1WARS)
        ADD	A,48
        CALL	DISASC
        LD	HL,#48A0+21
        LD	A,(P2WARS)
        ADD	A,48
        CALL	DISASC
        LD	A,87
        LD	(ATTRVL),A
        LD	HL,#40E0+10
        LD	DE,P1WINM-24
        LD	B,12
        CALL	STRING
        LD	HL,#4800+10
        LD	B,12
        CALL	STRING
        LD	HL,STAGE
        INC	(HL)
        LD	A,"3"
        LD	(LIVES1),A