Prev: B648 Up: Map Next: B716
B67C: Routine at B67C
Used by the routine at main_loop_24.
Input
A ?
B ? (gets compared to turn_speed) e.g. 1
C ? (used wrt flipping) e.g. 2
sub_b67c B67C LD H,A A += counter_C & 1
B67D LD A,($A236)
B680 AND $01
B682 ADD A,H
B683 EX AF,AF' Bank A
B684 LD A,($A250) Jump to sub_b67c_0 if turn_speed < B
B687 CP B
B688 JR C,sub_b67c_0
B68A LD A,($A251) A = flip
B68D AND A Set flags
B68E LD A,$00 A = 0
B690 JR Z,sub_b67c_no_flip Jump to sub_b67c_no_flip if flip is zero
B692 ADD A,C A += C
sub_b67c_no_flip B693 ADD A,C A += C
B694 LD C,A C = A
B695 EX AF,AF'
B696 ADD A,C A += C
B697 EX AF,AF'
sub_b67c_0 B698 EX AF,AF'
This entry point is used by the routine at main_loop_24.
sub_b67c_1 B699 EXX
B69A LD BC,$0000 BC = 0 -- not self modified
B69D EXX
This entry point is used by the routine at main_loop_24.
sub_b67c_2 B69E LD E,$80 E = $80
B6A0 LD B,$00 BC = A * 3
B6A2 LD C,A
B6A3 RLCA
B6A4 ADD A,C
B6A5 LD C,A
B6A6 LD HL,$CFB2 HL = unknown_cfb2 + BC -> unknown_cfb2
B6A9 ADD HL,BC
B6AA LD A,(HL) D = *HL++ + $79
B6AB INC HL
B6AC ADD A,$79
B6AE LD D,A
B6AF LD A,(HL) E = *HL++ + E
B6B0 INC HL
B6B1 ADD A,E
B6B2 LD E,A
B6B3 LD C,(HL) C = *HL -- B is still zero
B6B4 LD HL,$D027 HL = &car_adornments + BC
B6B7 ADD HL,BC
B6B8 LD B,(HL) B = *HL++ -- height
B6B9 INC HL
B6BA LD C,(HL) C = *HL++ -- byte width
B6BB INC HL
B6BC LD A,(HL) HL = wordat(HL); HL++ -- masked bitmap data
B6BD INC HL
B6BE LD H,(HL)
B6BF LD L,A
B6C0 LD A,C A = C
B6C1 EXX
B6C2 LD E,A E = A -- bank byte width in E'
B6C3 EXX
B6C4 LD A,($B5AB) Read from SUB @ B5AA
B6C7 NEG D -= A
B6C9 ADD A,D
B6CA LD D,A
B6CB LD A,($B5B0) A = *$B5B0 -- Self modified value in draw_car
B6CE SRL A A >>= 1
B6D0 JR Z,sub_b67c_3 Jump to sub_b67c_3 if zero
B6D2 SUB $02
B6D4 ADD A,D D += A - 2
B6D5 LD D,A
This entry point is used by the routines at draw_car and draw_smoke.
sub_b67c_3 B6D6 LD A,($A22A) D -= var_a22a
B6D9 NEG
B6DB ADD A,D
B6DC LD D,A
This entry point is used by the routines at main_loop_23 and sub_b549.
sub_b67c_4 B6DD LD A,E A = E
B6DE AND $F8 Divide by 8
B6E0 RRCA
B6E1 RRCA
B6E2 RRCA
B6E3 LD E,A E = A
B6E4 LD A,D A = D
B6E5 EX AF,AF'
B6E6 LD A,D D = (D & $0F) + $F0
B6E7 AND $0F
B6E9 ADD A,$F0
B6EB LD D,A
B6EC EX AF,AF'
B6ED AND $70 E += (A & $70) * 2
B6EF ADD A,A
B6F0 ADD A,E
B6F1 LD E,A
B6F2 PUSH DE
B6F3 LD E,C E = C -- byte width
B6F4 SLA E E <<= 1
B6F6 EXX
B6F7 POP HL
B6F8 LD A,E A = E
B6F9 SRL B B >>= 1
B6FB EX AF,AF' Is this EX'ing AF to get the carry flag?
B6FC ADD HL,BC HL += BC
B6FD EX AF,AF'
B6FE JP C,plot_masked_sprite_flipped_0
This entry point is used by the routine at draw_object_right.
sub_b67c_5 B701 LD IX,$B729 IX = plot_masked_sprite_core_thingy
B705 CPL A = ~A + 9 == (8 - A)
B706 ADD A,$09
B708 RLCA This multiplies by six - the length of each load-mask-store step in the plotter core.
B709 LD C,A
B70A RLCA
B70B ADD A,C
B70C LD C,A Add that to IX
B70D LD B,$00
B70F ADD IX,BC
B711 LD B,$0F B = 15 -- Set loop counter for 15 iterations?
B713 EXX
B714 LD D,$00 D = 0 -- fall through
Prev: B648 Up: Map Next: B716