0010  NAM LANDER
0020  OPT NOG,NOP,O,NOS
0030 OUTEE EQU $E1D1
0040 INEEE EQU $E1AC
0050 PDATA EQU $E07E
0060  ORG $0080
0070 BURST FDB $0000
0080 ALTI FDB $1000
0090 SPEED FDB $0100
0100 FUEL FDB $0100
0110 TIME FDB $0120
0120 STATUS FCB $0
0130 WON FDB $0001
0140  ORG $1000
0150 TEMP2 RMB 2
0160 TEMP1 RMB 2
0170 DECSUB SEC
0180 DCSB1 LDAA #$99
0190  ADC A #$00
0200  SBCA X
0210  STX TEMP1
0220  LDX TEMP2
0230  ADCA X
0240  DAA
0250  STAA X
0260  INX
0270  STX TEMP2
0280  LDX TEMP1
0290  INX
0300  DECB
0310  BNE DCSB1
0320  ROLA
0330  COMA
0340  RORA
0350  RTS
0360  ORG $2000
0370 ONE LDX #TIME+1
0380  STX TEMP2
0390  LDX #WON+1
0400  LDAB #$02
0410  JSR DECSUB
0420  BCS TMLMT
0430  TST BURST+1
0440  BEQ ALTCK
0450  LDX #SPEED+1
0460  STX TEMP2
0470  LDX #BURST+1
0480  LDAB #$02
0490  JSR DECSUB
0500  LDX #FUEL+1
0510  STX TEMP2
0520  LDX #BURST+1
0530  LDAB #$02
0540  JSR DECSUB
0550  BCS EMPTY
0560 ALTCK LDX #ALTI+1
0570  STX TEMP2
0580  LDX #SPEED+1
0590  LDAB #$02
0600  JSR DECSUB
0610  BCS DOWN
0611 FIN LDX #$00C8
0612  STX $0003
0620  INC 0
0630  JSR $E333
0640  NOP
0650  SEI
0660  INC $A00E
0670  SWI
0680  JMP ONE
0690 EMPTY CLR FUEL
0700  CLR FUEL+1
0710  CLR BURST
0720  LDAA STATUS
0730  ORAA #$06
0740  STAA STATUS
0750  BRA ALTCK
0760 TMLMT LDAA STATUS
0770  ORAA #$08
0780  STAA STATUS
0790  BRA FIN
0800 DOWN CLR ALTI
0810  CLR ALTI+1
0820  LDAA STATUS
0830  ORAA #$01
0840  STAA STATUS
0850  BRA FIN
0860  ORG $2800
0870 MSGA FDB $0D0A
0880  FCC /OUT OF FUEL/
0890 MSGZ FDB $0D0A
0900  FCB $04
0910 MSGF FDB $0D0A
0920  FCC /WANT TO TRY AGAIN?/
0930  FCB $04
0940 TWO LDX #200
0950  STX $0003
0960 TOO CLI
0970  LDAA STATUS
0980  TAP
0990  BMI EOGI
1000  BCS EOGI
1010  BVS MT
1020  BEQ WAIT
1030  JSR INEEE
1040  ANDA #$0F
1050  STAA BURST+1
1060  NOP
1070  SEI
1080  JSR DATA
1090  CLI
1100 WAIT WAI
1110  CLI
1120  BRA TOO
1130 MT LDX #MSGA
1140  NOP
1150  SEI
1160  JSR PDATA
1170  CLI
1180  LDAA STATUS
1190  ANDA #$FD
1200  STAA STATUS
1210  BRA WAIT
1220 EOGI BRA EOG
1230 DATA JSR NEXT
1240  NOP
1250  LDAA #$42
1260  JSR OUTEE
1270  JSR $E0CC
1280  LDX #BURST
1290  JSR $E0C8
1300  JSR NEXT
1310  LDAA #$41
1320  JSR OUTEE
1330  JSR $E0CC
1340  LDX #ALTI
1350  JSR $E0C8
1360  JSR NEXT
1370  LDAA #$53
1380  JSR OUTEE
1390  JSR $E0CC
1400  LDX #SPEED
1410  JSR $E0C8
1420  JSR NEXT
1430  LDAA #$46
1440  JSR OUTEE
1450  JSR $E0CC
1460  LDX #FUEL
1470  JSR $E0C8
1480  JSR NEXT
1490  LDAA #$54
1500  JSR OUTEE
1510  JSR $E0CC
1520  LDX #TIME
1530  JSR $E0C8
1540  JSR NEXT
1550  RTS
1560 NEXT LDX #MSGZ
1570  JSR PDATA
1580  RTS
1590 EOG NOP
1600  SEI
1610  JSR DATA
1620  LDX #MSGF
1630  JSR PDATA
1640  JSR INEEE
1650  CMPA 'Y
1660  BNE STOP
1670  JSR NEXT
1680  CLR STATUS
1690  LDX #$0120
1700  STX TIME
1710  LDX #$0100
1720  STX FUEL
1730  LDX #$0100
1740  STX SPEED
1750  LDX #$1000
1760  STX ALTI
1770  LDX #$0000
1780  STX BURST
1790  CLI
1800  JMP TOO
1810 STOP JSR $E0E3
1820  ORG $2F80
1830  RMB 30
1840  FDB ONE
1850 ONEPT EQU *-8
1860  RMB 40
1870  FDB TWO
1880 TWOPT EQU *-8
1890  ORG $A050
1900  FCB 0,0,0
1910  FCB $07
1920  FDB ONEPT
1930  FCB $87
1940  FDB TWOPT
1950  FCB 0,0,0,0,0,0,0,0,0
1960  FCB 0,0,0,0,0,0,0,0,0
1970  FCB 0,0,0,0,0,0,0,0,0
1980  FCB 0,0,0,0,0,0,0,0,0
1990  FCB 0,0,0
2000  ORG $000A
2010  FCB $81
2020  FCB 0
2030  ORG $0003
2040  FDB 200
2050  END
