Prev: 9BD2 Up: Map Next: 9D19
9BEA: Draw Room Frame
Used by the routine at EnterRoom.
DrawRoomFrame 9BEA XOR A
9BEB LD ($5E14),A
9BEE LD A,($EA91)
This entry point is used by the routine at GameComplete.
DrawRoomFrame_0 9BF1 LD BC,$A854
9BF4 LD L,A
9BF5 LD H,$00
9BF7 ADD HL,HL
9BF8 ADD HL,BC
9BF9 LD A,(HL)
9BFA INC HL
9BFB LD ($5E1A),A
9BFE EXX
9BFF LD HL,$5800
9C02 LD BC,$1818
9C05 LD A,($5E1A)
9C08 CALL ClearPlayArea_0
9C0B EXX
9C0C LD L,(HL)
9C0D LD H,$00
9C0F ADD HL,HL
9C10 LD C,L
9C11 LD B,H
9C12 ADD HL,HL
9C13 ADD HL,BC
9C14 LD BC,$A982
9C17 ADD HL,BC
9C18 LD A,(HL)
9C19 INC HL
9C1A LD ($5E1D),A
9C1D LD A,(HL)
9C1E INC HL
9C1F LD ($5E1E),A
9C22 LD E,(HL)
9C23 INC HL
9C24 LD D,(HL)
9C25 INC HL
9C26 LD A,(HL)
9C27 INC HL
9C28 LD H,(HL)
9C29 LD L,A
9C2A PUSH DE
9C2B POP IX
9C2D PUSH BC
DrawRoomFrame_1 9C2E POP BC
9C2F LD A,(HL)
9C30 INC HL
9C31 CP $FF
9C33 RET Z
9C34 SLA A
9C36 LD ($9C3F),A
9C39 INC A
9C3A LD ($9C42),A
9C3D LD C,(IX+$00)
9C40 LD B,(IX+$00)
DrawRoomFrame_2 9C43 PUSH BC
9C44 LD A,(HL)
9C45 INC HL
9C46 CP $FF
9C48 JR Z,DrawRoomFrame_1
9C4A SLA A
9C4C LD ($9C55),A
9C4F INC A
9C50 LD ($9C58),A
9C53 LD E,(IX+$00)
9C56 LD D,(IX+$00)
9C59 PUSH HL
9C5A CALL DrawRoomFrame_5
9C5D POP HL
9C5E POP BC
9C5F JR DrawRoomFrame_2
DrawRoomFrame_3 9C61 LD A,L
9C62 AND $07
9C64 INC A
9C65 LD B,A
9C66 XOR A
9C67 SCF
DrawRoomFrame_4 9C68 RRA
9C69 DJNZ DrawRoomFrame_4
9C6B PUSH HL
9C6C PUSH AF
9C6D EX AF,AF'
9C6E PUSH AF
9C6F CALL ScreenAddress
9C72 POP AF
9C73 EX AF,AF'
9C74 POP AF
9C75 OR (HL)
9C76 LD (HL),A
9C77 POP HL
9C78 RET
DrawRoomFrame_5 9C79 LD H,B
9C7A LD L,C
9C7B LD C,$00
9C7D LD A,H
9C7E SUB D
9C7F JR NC,DrawRoomFrame_6
9C81 NEG
9C83 SET 0,C
DrawRoomFrame_6 9C85 LD B,A
9C86 LD A,L
9C87 SUB E
9C88 JR NC,DrawRoomFrame_7
9C8A NEG
9C8C SET 1,C
DrawRoomFrame_7 9C8E CP B
9C8F EX AF,AF'
9C90 LD A,C
9C91 LD ($5E24),A
9C94 EX AF,AF'
9C95 JP C,DrawRoomFrame_11
9C98 LD ($5E23),A
9C9B PUSH DE
9C9C PUSH HL
9C9D LD E,A
9C9E LD D,$00
9CA0 LD L,D
9CA1 LD H,B
9CA2 CALL $A379
9CA5 LD A,($5E24)
9CA8 BIT 0,A
9CAA JR NZ,DrawRoomFrame_8
9CAC CALL $A39E
DrawRoomFrame_8 9CAF LD A,($5E24)
9CB2 BIT 1,A
9CB4 LD C,$01
9CB6 JR NZ,DrawRoomFrame_9
9CB8 LD C,$FF
DrawRoomFrame_9 9CBA EX DE,HL
9CBB POP HL
9CBC LD A,($5E23)
9CBF INC A
9CC0 LD B,A
9CC1 LD A,E
9CC2 EX AF,AF'
DrawRoomFrame_10 9CC3 PUSH BC
9CC4 CALL DrawRoomFrame_3
9CC7 LD A,L
9CC8 EX AF,AF'
9CC9 LD L,A
9CCA ADD HL,DE
9CCB LD A,L
9CCC EX AF,AF'
9CCD POP BC
9CCE ADD A,C
9CCF LD L,A
9CD0 DJNZ DrawRoomFrame_10
9CD2 POP HL
9CD3 JP DrawRoomFrame_3
DrawRoomFrame_11 9CD6 EX AF,AF'
9CD7 LD A,B
9CD8 LD ($5E23),A
9CDB EX AF,AF'
9CDC PUSH DE
9CDD PUSH HL
9CDE LD E,B
9CDF LD D,$00
9CE1 LD L,D
9CE2 LD H,A
9CE3 CALL $A379
9CE6 LD A,($5E24)
9CE9 BIT 1,A
9CEB JR NZ,DrawRoomFrame_12
9CED CALL $A39E
DrawRoomFrame_12 9CF0 LD A,($5E24)
9CF3 BIT 0,A
9CF5 LD C,$01
9CF7 JR NZ,DrawRoomFrame_13
9CF9 LD C,$FF
DrawRoomFrame_13 9CFB EX DE,HL
9CFC POP HL
9CFD LD A,($5E23)
9D00 INC A
9D01 LD B,A
9D02 LD A,E
9D03 EX AF,AF'
DrawRoomFrame_14 9D04 PUSH BC
9D05 CALL DrawRoomFrame_3
9D08 LD A,H
9D09 EX AF,AF'
9D0A LD H,L
9D0B LD L,A
9D0C ADD HL,DE
9D0D LD A,L
9D0E LD L,H
9D0F EX AF,AF'
9D10 POP BC
9D11 ADD A,C
9D12 LD H,A
9D13 DJNZ DrawRoomFrame_14
9D15 POP HL
9D16 JP DrawRoomFrame_3
Prev: 9BD2 Up: Map Next: 9D19