Prev: AC3C Up: Map Next: AD51
AD0D: Routine at AD0D
Used by the routine at read_map.
sub_ad0d AD0D LD A,($A221) Return if the inhibit_collision_detection flag is set
AD10 AND A
AD11 RET NZ
AD12 LD IX,$A188 IX = &hazards[0]
AD16 LD DE,$0014 DE = 20 -- stride of hazards
AD19 LD B,$06 B = 6
sub_ad0d_0 AD1B RLC (IX+$00) If the hazard is not active continue to next one
AD1F JR NC,ad0d_continue
AD21 EXX Bank
AD22 LD HL,$AD4B Address of ad0d_unbank_continue
AD25 PUSH HL Push -- this makes RETs below jump to ad0d_unbank_continue
AD26 LD A,(IX+$0F) A = IX[15] + 1
AD29 INC A
AD2A JR NZ,sub_ad0d_1 Jump if non-zero
AD2C LD A,(IX+$11) A = IX[17]
AD2F AND A Set flags
AD30 RET NZ UNBANK_CONTINUE if non-zero
sub_ad0d_1 AD31 LD A,(IX+$01) A = IX[1] -- distance related
AD34 CP $14 UNBANK_CONTINUE if >= 20
AD36 RET NC
AD37 LD D,$00 D = 0 -- not SM
AD39 CALL sub_ad51 Call ? below
AD3C LD A,D A = D
AD3D AND A Set flags
AD3E RET Z UNBANK_CONTINUE if zero
AD3F LD A,(IX+$0F) A = IX[15] + 1
AD42 INC A
AD43 RET Z UNBANK_CONTINUE if zero
AD44 LD L,(IX+$0B) HL = wordat(IX + 11) -- presumably the hit handler
AD47 LD H,(IX+$0C)
AD4A JP (HL) Jump to it (then return to the next instr)
ad0d_unbank_continue AD4B EXX Unbank
ad0d_continue AD4C ADD IX,DE Move to next hazard
AD4E DJNZ sub_ad0d_0 Loop
AD50 RET Return
Prev: AC3C Up: Map Next: AD51