Prev: E54D Up: Map Next: E5CB
E54E: Draw Room.
Used by the routines at Game_Start, Update_RollRock and Room_Enter.
Input
Output
RoomDraw E54E LD A,(Wally_RoomNo) Get room number.
E551 ADD A,A Work out address of room pointer.
E552 LD E,A
E553 LD D,$00
E555 LD HL,RoomData
E558 ADD HL,DE
E559 LD E,(HL) Get address to room description data.
E55A INC HL
E55B LD D,(HL)
E55C EX DE,HL
E55D LD A,(HL) Get first byte and test for drawing of walls etc.
E55E CP $F5
E560 CALL Z,Draw_CeilingWallFloor
RoomDraw_0 E563 LD A,(HL)
E564 CP $FF
E566 JR Z,RoomDraw_5
E568 CP $F4
E56A JR NZ,RoomDraw_2
E56C LD BC,Tile_DrawFlip Modify code so that the furniture draw routine calls the function to draw upside down tiles.
RoomDraw_1 E56F LD ($E1E0),BC
E573 LD ($E1D8),BC
E577 INC HL
E578 JR RoomDraw_0
RoomDraw_2 E57A CP $F3
E57C JR NZ,RoomDraw_3
E57E LD BC,TileDraw
E581 JR RoomDraw_1
RoomDraw_3 E583 CP $DE
E585 JR NZ,RoomDraw_4
E587 INC HL
E588 LD C,(HL) Get address of action flag.
E589 INC HL
E58A LD B,(HL)
E58B INC HL
E58C LD A,(BC)
E58D OR A If not set then handle action.
E58E JR Z,RoomDraw_5
E590 JR RoomDraw_0 else continue onto next byte.
RoomDraw_4 E592 LD E,A
E593 INC HL
E594 LD D,(HL)
E595 INC HL
E596 LD A,(HL) Get index of furniture item.
E597 INC HL
E598 PUSH HL
E599 ADD A,A Workout address of item string.
E59A LD C,A
E59B LD B,$00
E59D LD HL,FurniturePtrTable
E5A0 ADD HL,BC
E5A1 LD A,(HL)
E5A2 INC HL
E5A3 LD H,(HL)
E5A4 LD L,A
E5A5 CALL FurnitureDraw
E5A8 POP HL
E5A9 JR RoomDraw_0
RoomDraw_5 E5AB LD A,(Wally_RoomNo)
E5AE LD E,A
E5AF ADD A,A
E5B0 ADD A,E
E5B1 LD E,A
E5B2 LD D,$00
E5B4 LD HL,Room_ObjSlots
E5B7 ADD HL,DE
E5B8 LD A,(HL)
E5B9 LD (BitmapX),A
E5BC INC HL
E5BD LD A,(HL)
E5BE ADD A,$10
E5C0 LD (BitmapY),A
E5C3 INC HL
E5C4 LD A,(HL)
E5C5 ADD A,$50
E5C7 CALL Bitmap16Draw
E5CA RET
Prev: E54D Up: Map Next: E5CB