Prev: AF27 Up: Map Next: B0A6
AF3C: Menu, display and handle.
Used by the routine at _79b7.
Input
Output
Menu AF3C XOR A
AF3D LD (Mode_Demo),A
AF40 LD HL,$BB82
AF43 LD DE,Flag_dayNight
AF46 AND A
AF47 SBC HL,DE
AF49 LD (IO_Length),HL
AF4C LD (IY+$31),$18
AF50 LD A,$01
AF52 CALL $1601
AF55 LD HL,$4000 Clear DF
AF58 LD DE,$4001
AF5B LD BC,$1AFF
AF5E LD (HL),$00
AF60 LDIR
AF62 LD (IY+$0E),$07
AF66 XOR A Black border.
AF67 OUT ($FE),A
AF69 CALL Print_StrFromStack Return address will hold menu string.
Menu Text.
Text_Menu AF6C DEFB $10 menu.
AF6D DEFB $03
AF6E DEFB $11
AF6F DEFB $00
AF70 DEFB $16
AF71 DEFB $01
AF72 DEFB $0B
AF73 DEFM "options"
AF7A DEFB $16
AF7B DEFB $05
AF7C DEFB $05
AF7D DEFM "1. enter dun darach"
AF90 DEFB $16
AF91 DEFB $07
AF92 DEFB $05
AF93 DEFM "2. save game"
AF9F DEFB $16
AFA0 DEFB $09
AFA1 DEFB $05
AFA2 DEFM "3. restore game"
AFB1 DEFB $16
AFB2 DEFB $0B
AFB3 DEFB $05
AFB4 DEFM "4. demo mode"
AFC0 DEFB $5E
Return from print.
Menu_0 AFC1 LD (IY-$32),$00 Clear LAST_K (last key pressed.)
Menu_1 AFC5 LD A,(IY-$32) Check LAST_K, wait for a key.
AFC8 AND A
AFC9 JR Z,Menu_1
AFCB CP $31 '1'
AFCD JR Z,_Menu_Enter
AFCF CP $32 '2'
AFD1 JR Z,_Menu_Save
AFD3 CP $33 '3'
AFD5 JR Z,Menu_Restore
AFD7 CP $34 '4'
AFD9 JR NZ,Menu_0 Ignore any other key.
AFDB LD A,$02 Set for demo mode.
AFDD LD (Mode_Demo),A
Enter Dun Darach
_Menu_Enter AFE0 LD (IY+$31),$08
AFE4 RET
Save.
_Menu_Save AFE5 CALL IO_GetLetter
AFE8 CALL Print_StrFromStack
AFEB DEFB $16
AFEC DEFB $0E
AFED DEFB $02
AFEE DEFM "start tape then press a key"
B009 DEFB $5E
B00A LD (IY-$32),$00
Menu_2 B00E LD A,(IY-$32)
B011 AND A
B012 JR Z,Menu_2
B014 LD IX,IO_Lead
B018 LD DE,$0011
B01B XOR A
B01C CALL Menu_6
B01F CALL NC,Menu_Abort
B022 LD B,$28
Menu_3 B024 HALT
B025 DJNZ Menu_3
B027 LD IX,(IO_StartAddr)
B02B LD DE,(IO_Length)
B02F LD A,$FF
B031 CALL Menu_6
B034 CALL NC,Menu_Abort
B037 JP Menu
Restore
Menu_Restore B03A CALL IO_GetLetter
Menu_4 B03D LD IX,Offscreen_Bitmap
B041 LD DE,$0011
B044 XOR A
B045 CALL Menu_7
B048 JR NC,Menu_4
B04A LD DE,Offscreen_Bitmap
B04D LD HL,IO_Lead
B050 LD B,$11
Menu_5 B052 LD A,(DE)
B053 CP (HL)
B054 JR NZ,Menu_4
B056 INC DE
B057 INC HL
B058 DJNZ Menu_5
B05A LD IX,(IO_StartAddr)
B05E LD DE,(IO_Length)
B062 LD A,$FF
B064 CALL Menu_7
B067 CALL NC,Menu_Abort
B06A JP Menu
Menu_6 B06D CALL $04C6
B070 JR Menu_8
Menu_7 B072 SCF
B073 INC D
B074 EX AF,AF'
B075 DEC D
B076 DI
B077 LD A,$0F
B079 OUT ($FE),A
B07B CALL $0562
Menu_8 B07E PUSH AF
B07F XOR A
B080 OUT ($FE),A
B082 EI
B083 LD A,$7F
B085 IN A,($FE)
B087 RRA
B088 JR NC,Menu_9
B08A POP AF
B08B RET
Menu_9 B08C POP AF
Abort
Menu_Abort B08D CALL Print_StrFromStack
B090 DEFB $16
B091 DEFB $12
B092 DEFB $05
B093 DEFM "abandoned"
B09C DEFB $5E
B09D LD B,$FA
Menu_10 B09F HALT
B0A0 DJNZ Menu_10
B0A2 POP HL
B0A3 JP Menu
Prev: AF27 Up: Map Next: B0A6