Prev: A89C Up: Map Next: A955
A8CD: Hazard handler routine? Triggered at road split
hazard_handler_a8cd A8CD LD A,($A230) Return if perp_caught_stage > 0
A8D1 JR NZ,hazard_handler_a8cd_0
A8D3 LD A,($A225) Check stop_car_spawning flag
A8D7 JR Z,hazard_handler_a8cd_1
hazard_handler_a8cd_0 A8D9 LD (IX+$0E),$01 IX[14] = $01 -- horizontal position
A8DD LD (IX+$0D),$FF IX[13] = $FF
hazard_handler_a8cd_1 A8E1 LD C,(IX+$01) C = IX[1] -- buffer offset
A8E4 CALL get_spawn_lanes Call get_spawn_lanes
A8E7 LD A,(IX+$11) A = IX[17]
A8EA CP B If A < B IX[18] = B
A8EB JR NC,hazard_handler_a8cd_2
A8ED LD (IX+$12),B
hazard_handler_a8cd_2 A8F0 CP C If A > C IX[18] = C
A8F1 JR Z,hazard_handler_a8cd_3
A8F3 JR C,hazard_handler_a8cd_3
A8F5 LD (IX+$12),C
hazard_handler_a8cd_3 A8F8 LD A,(IX+$12) A = IX[18]
A8FB CP (IX+$11) Jump to hazard_handler_a8cd_6 if A == IX[17]
A8FE JR Z,hazard_handler_a8cd_6
A900 RL B
A902 LD HL,$A7E6 HL = $A7E6 -> table_a7e7 data block
A905 LD C,A C = A
A906 ADD A,L L += A
A907 LD L,A
A908 LD A,(IX+$05) A = IX[5]
A90B RR B test bottom bit?
A90D JR NC,hazard_handler_a8cd_4
A90F SUB $05 A -= 5
A911 CP (HL) CP *HL
A912 JR NC,hazard_handler_a8cd_5
A914 LD A,(HL) A = *HL
A915 LD (IX+$11),C IX[17] = C
A918 JR hazard_handler_a8cd_5 Jump to hazard_handler_a8cd_5
hazard_handler_a8cd_4 A91A ADD A,$05 A += 5
A91D JR C,hazard_handler_a8cd_5
A91F LD A,(HL) A = *HL
A920 LD (IX+$11),C IX[17] = C
hazard_handler_a8cd_5 A923 LD (IX+$05),A IX[5] = A
hazard_handler_a8cd_6 A926 LD A,(IX+$07) A = IX[7]
A929 AND A Set flags
A92A RET Z Return if zero
A92B EX AF,AF' Preserve AF
A92C LD (IX+$07),$00 IX[7] = 0
A930 LD A,($B326) Return if crashed flag set
A933 AND A
A is zero.
A935 LD (IX+$00),A IX[0] = 0 -- unused hazard
A938 LD ($A13C),A overtake_bonus = 0
A93B LD A,$96 A = $96
A93D EX AF,AF' Restore AF
A93E CP $03 Jump if A < 3
A940 JR C,hazard_handler_a8cd_7
A942 SUB $03 A -= 3
hazard_handler_a8cd_7 A944 CALL check_collisions_8
A947 LD HL,$9904 HL = ouch_chatter
A94A LD A,$03 Set priority to 3
A94C CALL chatter Call chatter (priority 3)
A94F LD BC,$0302 BC = $0302
A952 JP start_sfx Call start_sfx
Prev: A89C Up: Map Next: A955