Prev: 5FB7 Up: Map Next: 613B
5FE1: Routine at 5FE1
Used by the routine at 6D87.
5FE1 LD HL,$5F2E Increase 1UP_Lives by one.
5FE4 INC (HL)
5FE5 CALL $6FFD Call 6FFD.
This entry point is used by the routine at 68C4.
5FE8 LD A,($5F2D) A=1UP_Level.
5FEB INC A
5FEC RET Z
5FED CALL CreateWindow Call CreateWindow.
5FF0 CALL $6017 Call 6017.
5FF3 CALL $7378 Call 7378.
Self modifying code; this updates the command at 7515 to "CP 1A".
5FF6 LD A,$1A Write 1A to 7516.
5FF8 LD ($7516),A
5FFB LD A,($5C78) Write FRAMES to LastFrame.
5FFE LD ($5F22),A
6001 RET Return.
6002 LD A,B A=B.
6003 EXX Switch to the shadow registers.
6004 LD C,A Create an offset in BC'.
6005 LD B,$00
6007 LD HL,$6011 Calculate the address using the offset and 6011.
600A ADD HL,BC
600B LD A,(HL) Write the data from the offset to 5F27.
600C LD ($5F27),A
600F EXX Switch to the normal registers.
6010 RET Return.
6011 DEFB $00,$43,$46,$42,$44,$46
The pantry is constructed like it is a font.
6017 LD HL,($5C36) Stash CHARS on the stack.
601A PUSH HL
601B LD HL,$7B4A Write CupboardGraphic to CHARS.
601E LD ($5C36),HL
6021 LD A,($5F2D) A=1UP_Level.
6024 AND %00000111 Keep only bits 0-2.
6026 LD B,A Store the result in B.
6027 LD A,$20 A=20.
6029 JR Z,$602F
602B SRL A
602D DJNZ $602B
602F LD ($5F2A),A
6032 LD DE,$613B DE=CupboardData.
6035 LD HL,$10D0 HL=10D0.
6038 CALL PrintString Call PrintString.
603B EXX
603C INC DE
603D LD HL,$18D0
6040 CALL PrintString
6043 EXX
6044 LD HL,$20D0
6047 INC DE
6048 LD B,$05
604A CALL $60BD
604D DJNZ $604A
604F LD DE,$616D
6052 LD HL,$98D0
6055 CALL PrintString
6058 LD DE,$6174
605B LD HL,$20D0
605E LD B,$05
6060 CALL $6002
6063 CALL $60FD
6066 DJNZ $6060
6068 LD HL,$A000
606B LD DE,$6198
606E LD C,$04
6070 LD A,$20
6072 CALL $60E2
6075 LD DE,$6218
6078 LD HL,$A000
607B LD C,$04
607D CALL $60A4
6080 POP HL
6081 LD ($5C36),HL
6084 LD B,$00
6086 CALL $6C88
6089 LD A,($5F30)
608C LD C,A
608D RRA
608E RRA
608F RRA
6090 RRA
6091 AND $0F
6093 ADD A,$30
6095 LD HL,$50FC
6098 CALL PrintScreen
609B LD A,C
609C AND $0F
609E ADD A,$30
60A0 CALL PrintScreen
60A3 RET
60A4 LD A,($5F28)
60A7 LD B,A
60A8 PUSH HL
60A9 PUSH BC
60AA CALL AttributeAddress
60AD POP BC
60AE LD A,(DE)
60AF LD (HL),A
60B0 INC HL
60B1 INC DE
60B2 DJNZ $60AE
60B4 POP HL
60B5 LD A,H
60B6 ADD A,$08
60B8 LD H,A
60B9 DEC C
60BA JR NZ,$60A4
60BC RET
60BD PUSH BC
60BE PUSH DE
60BF LD A,B
60C0 RLCA
60C1 RLCA
60C2 RLCA
60C3 AND $38
60C5 OR $47
60C7 LD ($60CE),A
60CA LD A,($5F2A)
60CD RLC B
60CF JR Z,$60D8
60D1 PUSH HL
60D2 LD HL,$0012
60D5 ADD HL,DE
60D6 EX DE,HL
60D7 POP HL
60D8 LD C,$03
60DA LD A,$06
60DC CALL $60E2
60DF POP DE
60E0 POP BC
60E1 RET
60E2 LD ($5F28),A
60E5 LD A,($5F28)
60E8 LD B,A
60E9 PUSH HL
60EA CALL ScreenAddress
60ED LD A,(DE)
60EE CALL PrintScreen
60F1 INC DE
60F2 DJNZ $60ED
60F4 POP HL
60F5 LD A,H
60F6 ADD A,$08
60F8 LD H,A
60F9 DEC C
60FA JR NZ,$60E5
60FC RET
60FD PUSH BC
60FE PUSH DE
60FF LD A,B
6100 RLCA
6101 RLCA
6102 RLCA
6103 AND $38
6105 OR $47
6107 LD ($610E),A
610A LD A,($5F2A)
610D BIT 0,A
610F JR Z,$6118
6111 PUSH HL
6112 LD HL,$0012
6115 ADD HL,DE
6116 EX DE,HL
6117 POP HL
6118 LD C,$03
611A LD B,$06
611C PUSH HL
611D PUSH BC
611E CALL AttributeAddress
6121 POP BC
6122 LD A,(DE)
6123 AND A
6124 CALL Z,$6137
6127 LD (HL),A
6128 INC DE
6129 INC HL
612A DJNZ $6122
612C POP HL
612D LD A,H
612E ADD A,$08
6130 LD H,A
6131 DEC C
6132 JR NZ,$611A
6134 POP DE
6135 POP BC
6136 RET
6137 LD A,($5F27)
613A RET
Prev: 5FB7 Up: Map Next: 613B