Prev: C9F6 Up: Map Next: CA8E
CA65: Maroc is moving through a doorway
Follows checks from the previous routine at C9F6.
Sets a couple of bytes/flags in the connecting door table at 6790 to indicate Maroc's entry point for this door.
CA65 LD A,($EB46) Door set number in the connecting room data at 6790
CA68 LD ($EAB4),A Copy to working data buffer
CA6B LD A,($EB4A) Door's vertical pixel position
CA6E DEC A Very minor vertical adjustment (-1 pixel)
CA6F LD ($EB74),A Store as new room vertical entry position
CA72 LD HL,($EB44) Address pointer for door set number in the connecting room data at 6790
CA75 LD ($EAB5),HL Copy to working data buffer
CA78 INC HL
CA79 INC HL
CA7A INC HL
CA7B LD (HL),$00 Set the 4th byte of the relevant door set (in the table at 6790) to 0. This is the standard event collision identifier for Maroc (touching a doorway space).
CA7D LD A,$FF Room number set to 255 - signifies that the next room number will need calculating (using the door connector table at 6790)
CA7F LD ($EAB0),A
CA82 LD A,($EB4E) Door properties byte
CA85 AND $0F Keep bits 0-3
CA87 OR $80 Set bit 7 - used to flag that Maroc has entered through this door
CA89 LD ($EAF5),A The byte stored here will be put in byte 3 of the connecting door set at 6790, in the routine at C5E0
CA8C JR $CAF3 Jump to end of door routine checks
Prev: C9F6 Up: Map Next: CA8E