B318: Routine at B318
main_loop_24 |
B318 |
LD HL,($A24A) |
|
B31B |
LD A,H |
|
B31C |
OR L |
|
B31D |
JR NZ,main_loop_24_0 |
|
B31F |
LD ($B3DC),A |
|
B322 |
LD ($A23E),A |
main_loop_24_0 |
B325 |
LD A,$00 |
|
B327 |
AND A |
|
B328 |
JR Z,main_loop_24_7 |
|
B32A |
LD ($A24D),A |
|
B32D |
PUSH HL |
|
B32E |
LD BC,$0000 |
|
B331 |
SBC HL,BC |
|
B333 |
POP HL |
|
B334 |
JR C,main_loop_24_1 |
|
B336 |
LD D,H |
|
B337 |
LD A,L |
|
B338 |
SRL D |
|
B33A |
RR A |
|
B33C |
SRL A |
|
B33E |
OR $03 |
|
B340 |
LD E,A |
|
B341 |
SBC HL,DE |
|
B343 |
JR Z,main_loop_24_1 |
|
B345 |
LD A,$02 |
|
B347 |
JR NC,main_loop_24_2 |
main_loop_24_1 |
B349 |
XOR A |
|
B34A |
LD ($B326),A |
|
B34D |
INC A |
|
B34E |
JR main_loop_24_3 |
main_loop_24_2 |
B350 |
LD ($A24A),HL |
main_loop_24_3 |
B353 |
LD ($A250),A |
|
B356 |
LD HL,$0000 |
|
B359 |
LD D,H |
|
B35A |
LD E,L |
|
B35B |
SRL D |
|
B35D |
RR E |
|
B35F |
SRL E |
|
B361 |
SRL E |
|
B363 |
SRL E |
|
B365 |
SBC HL,DE |
|
B367 |
LD ($B357),HL |
|
B36A |
EX DE,HL |
|
B36B |
LD HL,($A26C) |
|
B36E |
LD C,$00 |
|
B370 |
LD A,C |
|
B371 |
AND $01 |
|
B373 |
LD ($A251),A |
|
B376 |
DEC C |
|
B377 |
JR Z,main_loop_24_4 |
|
B379 |
DEC C |
|
B37A |
JR Z,main_loop_24_5 |
|
B37C |
ADD HL,DE |
|
B37D |
JR main_loop_24_5 |
main_loop_24_4 |
B37F |
SBC HL,DE |
main_loop_24_5 |
B381 |
LD ($A26C),HL |
|
B384 |
LD A,$00 |
|
B386 |
AND A |
|
B387 |
JR Z,main_loop_24_6 |
|
B389 |
DEC A |
|
B38A |
LD ($B385),A |
|
B38D |
LD A,$00 |
main_loop_24_6 |
B38F |
LD ($B3DC),A |
main_loop_24_7 |
B392 |
LD HL,($A26C) |
|
B395 |
LD DE,$0048 |
|
B398 |
LD A,H |
|
B399 |
AND A |
|
B39A |
JP M,main_loop_24_9 |
|
B39D |
JR NZ,main_loop_24_8 |
|
B39F |
LD A,L |
|
B3A0 |
SUB E |
|
B3A1 |
JR C,main_loop_24_9 |
main_loop_24_8 |
B3A3 |
LD DE,$01D8 |
|
B3A6 |
LD A,H |
|
B3A7 |
CP D |
|
B3A8 |
JR C,main_loop_24_10 |
|
B3AA |
JR NZ,main_loop_24_9 |
|
B3AC |
LD A,L |
|
B3AD |
SUB E |
|
B3AE |
JR C,main_loop_24_10 |
main_loop_24_9 |
B3B0 |
EX DE,HL |
main_loop_24_10 |
B3B1 |
LD ($A26C),HL |
|
B3B4 |
LD A,($A24D) |
|
B3B7 |
LD HL,$A24F |
|
B3BA |
OR (HL) |
|
B3BB |
LD BC,$0105 |
|
B3BE |
CALL NZ,start_sfx |
|
B3C1 |
LD A,($A230) |
|
B3C4 |
AND A |
|
B3C5 |
JR Z,main_loop_24_12 |
|
B3C7 |
DEC A |
|
B3C8 |
JR Z,main_loop_24_12 |
|
B3CA |
CP $02 |
|
B3CC |
JR C,main_loop_24_11 |
|
B3CE |
LD A,$02 |
main_loop_24_11 |
B3D0 |
LD ($A250),A |
|
B3D3 |
LD A,$01 |
|
B3D5 |
LD ($A251),A |
main_loop_24_12 |
B3D8 |
CALL sub_b549 |
|
B3DB |
LD A,$00 |
|
B3DD |
AND A |
|
B3DE |
JR Z,main_loop_24_15 |
|
B3E0 |
LD C,A |
|
B3E1 |
RLCA |
|
B3E2 |
ADD A,C |
|
B3E3 |
ADD A,$18 |
|
B3E5 |
LD C,A |
|
B3E6 |
LD A,($A250) |
|
B3E9 |
CP $02 |
|
B3EB |
JR C,main_loop_24_14 |
|
B3ED |
LD A,($A251) |
|
B3F0 |
AND A |
|
B3F1 |
JR Z,main_loop_24_13 |
|
B3F3 |
INC C |
main_loop_24_13 |
B3F4 |
INC C |
main_loop_24_14 |
B3F5 |
EXX |
|
B3F6 |
LD A,($A234) |
|
B3F9 |
AND $01 |
|
B3FB |
LD B,A |
|
B3FC |
RLCA |
|
B3FD |
LD C,A |
|
B3FE |
EXX |
|
B3FF |
LD A,C |
|
B400 |
CALL sub_b67c_2 |
|
B403 |
XOR A |
|
B404 |
LD ($A23E),A |
main_loop_24_15 |
B407 |
CALL main_loop_24_19 |
|
B40A |
LD B,$00 |
|
B40C |
LD A,($A23E) |
|
B40F |
DEC A |
|
B410 |
JR NZ,main_loop_24_16 |
|
B412 |
LD A,($A236) |
|
B415 |
AND $01 |
|
B417 |
LD B,A |
|
B418 |
ADD A,A |
|
B419 |
ADD A,B |
|
B41A |
LD B,A |
main_loop_24_16 |
B41B |
LD A,($A250) |
|
B41E |
CALL draw_car |
|
B421 |
LD A,($A228) |
|
B424 |
AND A |
|
B425 |
JR Z,main_loop_24_17 |
|
B427 |
XOR A |
|
B428 |
LD BC,$0102 |
|
B42B |
CALL sub_b67c |
main_loop_24_17 |
B42E |
LD A,($A234) |
|
B431 |
LD B,A |
|
B432 |
LD HL,$A24D |
|
B435 |
LD A,(HL) |
|
B436 |
AND A |
|
B437 |
JR NZ,main_loop_24_18 |
|
B439 |
LD A,($A236) |
|
B43C |
LD B,A |
|
B43D |
INC HL |
|
B43E |
LD A,(HL) |
|
B43F |
INC HL |
|
B440 |
OR (HL) |
|
B441 |
JR NZ,main_loop_24_18 |
|
B443 |
LD A,($A23E) |
|
B446 |
CP $02 |
|
B448 |
RET NZ |
main_loop_24_18 |
B449 |
XOR A |
|
B44A |
EX AF,AF' |
|
B44B |
LD A,B |
|
B44C |
PUSH AF |
|
B44D |
CALL draw_smoke |
|
B450 |
LD A,$01 |
|
B452 |
EX AF,AF' |
|
B453 |
POP AF |
|
B454 |
JP draw_smoke |
main_loop_24_19 |
B457 |
LD A,($A22F) |
|
B45A |
AND A |
|
B45B |
RET Z |
|
B45C |
DEC A |
|
B45D |
JR Z,main_loop_24_20 |
|
B45F |
EXX |
|
B460 |
LD B,A |
|
B461 |
LD C,$00 |
|
B463 |
EXX |
|
B464 |
LD A,($A250) |
|
B467 |
CP $02 |
|
B469 |
LD A,$24 |
|
B46B |
JP NZ,sub_b67c_2 |
|
B46E |
LD A,($A251) |
|
B471 |
ADD A,$25 |
|
B473 |
JP sub_b67c_2 |
main_loop_24_20 |
B476 |
LD C,$00 |
|
B478 |
LD A,$00 |
|
B47A |
DEC A |
|
B47B |
LD ($B479),A |
|
B47E |
JR NZ,main_loop_24_22 |
|
B480 |
LD B,$02 |
|
B482 |
INC C |
|
B483 |
LD A,C |
|
B484 |
CP $04 |
|
B486 |
JR NC,main_loop_24_21 |
|
B488 |
INC A |
|
B489 |
LD C,A |
|
B48A |
CP $02 |
|
B48C |
JR NZ,main_loop_24_21 |
|
B48E |
INC B |
main_loop_24_21 |
B48F |
LD A,B |
|
B490 |
LD ($B479),A |
main_loop_24_22 |
B493 |
LD A,C |
|
B494 |
LD ($B477),A |
|
B497 |
CP $07 |
|
B499 |
JR C,main_loop_24_23 |
|
B49B |
XOR A |
|
B49C |
LD ($A22F),A |
|
B49F |
RET |
main_loop_24_23 |
B4A0 |
LD A,($A250) |
|
B4A3 |
CP $02 |
|
B4A5 |
LD A,$06 |
|
B4A7 |
JR NZ,main_loop_24_24 |
|
B4A9 |
LD A,($A251) |
|
B4AC |
LD B,A |
|
B4AD |
RLCA |
|
B4AE |
RLCA |
|
B4AF |
RLCA |
|
B4B0 |
SUB B |
|
B4B1 |
ADD A,$0D |
main_loop_24_24 |
B4B3 |
ADD A,C |
|
B4B4 |
PUSH AF |
|
B4B5 |
CALL sub_b67c_1 |
|
B4B8 |
POP AF |
|
B4B9 |
LD C,A |
|
B4BA |
LD A,($B477) |
|
B4BD |
CP $04 |
|
B4BF |
JR NC,main_loop_24_25 |
|
B4C1 |
INC C |
|
B4C2 |
LD A,C |
|
B4C3 |
JP sub_b67c_1 |
main_loop_24_25 |
B4C6 |
LD A,$01 |
|
B4C8 |
LD ($A228),A |
|
B4CB |
RET |