A7F3: Spawns cars
spawn_cars |
A7F3 |
LD A,($A230) |
|
A7F6 |
LD C,A |
|
A7F7 |
LD A,($A225) |
|
A7FA |
OR C |
|
A7FB |
RET NZ |
|
A7FC |
LD A,($A254) |
|
A7FF |
AND A |
|
A800 |
RET Z |
|
A801 |
NEG |
|
A803 |
ADD A,$14 |
|
A805 |
LD ($A804),A |
|
A808 |
RET C |
|
A809 |
CALL rng |
|
A80C |
AND $0F |
|
A80E |
LD C,A |
|
A80F |
LD A,($A22E) |
|
A812 |
AND A |
|
A813 |
LD A,($5D1A) |
|
A816 |
JR Z,spawn_cars_0 |
|
A818 |
ADD A,$19 |
spawn_cars_0 |
A81A |
ADD A,C |
|
A81B |
LD ($A804),A |
|
A81E |
LD BC,$0500 |
|
A821 |
LD IX,$A19C |
|
A825 |
LD DE,$0014 |
sc_loop |
A828 |
RLC (IX+$00) |
|
A82C |
JR NC,sc_fill_in |
|
A82E |
LD A,(IX+$0F) |
|
A831 |
RLA |
|
A832 |
JP NC,spawn_cars_1 |
|
A835 |
RL C |
spawn_cars_1 |
A837 |
ADD IX,DE |
|
A839 |
DJNZ sc_loop |
|
A83B |
RET |
sc_fill_in |
A83C |
BIT 2,C |
|
A83E |
RET NZ |
|
A83F |
PUSH IX |
|
A841 |
POP DE |
|
A842 |
LD BC,$0014 |
|
A845 |
LD HL,$A623 |
|
A848 |
LDIR |
|
A84A |
LD C,$14 |
|
A84C |
CALL get_spawn_lanes |
|
A84F |
CALL rng |
|
A852 |
AND $03 |
|
A854 |
ADD A,B |
|
A855 |
CP C |
|
A856 |
JR C,spawn_cars_2 |
|
A858 |
LD A,C |
spawn_cars_2 |
A859 |
LD (IX+$11),A |
|
A85C |
LD (IX+$12),A |
|
A85F |
LD HL,$A7E6 |
|
A862 |
LD B,$00 |
|
A864 |
LD C,A |
|
A865 |
ADD HL,BC |
|
A866 |
LD A,(HL) |
|
A867 |
LD (IX+$05),A |
|
A86A |
LD A,($A22E) |
|
A86D |
AND A |
|
A86E |
LD A,$04 |
|
A870 |
JR Z,spawn_cars_3 |
|
A872 |
ADD A,A |
spawn_cars_3 |
A873 |
LD C,A |
|
A874 |
ADD HL,BC |
|
A875 |
LD A,(HL) |
|
A876 |
LD (IX+$0D),A |
|
A879 |
CALL rng |
|
A87C |
AND $06 |
|
A87E |
LD C,A |
|
A87F |
LD A,($A22E) |
|
A882 |
AND A |
|
A883 |
JR Z,spawn_cars_4 |
|
A885 |
LD A,$06 |
|
A887 |
CP C |
|
A888 |
JR NZ,spawn_cars_4 |
|
A88A |
DEC C |
|
A88B |
DEC C |
spawn_cars_4 |
A88C |
LD B,$00 |
|
A88E |
LD HL,$5D12 |
|
A891 |
ADD HL,BC |
|
A892 |
LD A,(HL) |
|
A893 |
INC HL |
|
A894 |
LD (IX+$09),A |
|
A897 |
LD A,(HL) |
|
A898 |
LD (IX+$0A),A |
|
A89B |
RET |