Prev: B4F0 Up: Map Next: B58E
B549: Routine at B549
Used by the routine at main_loop_24.
sub_b549 B549 LD A,$00 A = <self modified>
B54B AND A Set flags
B54C RET Z Return if zero
B54D DEC A A--
B54E LD ($B54A),A Self modify 'LD A' above
B551 RLCA Double A
B552 LD E,A DE = A
B553 LD D,$00
B555 LD ($B571),DE Self modify 'LD HL' below
B559 LD B,$03 3 iterations
B55B LD HL,$0000 HL = <self modified> by B503
sub_b549_0 B55E PUSH BC Preserve BC
B55F LD E,(HL) DE = wordat(HL); HL += 2
B560 INC HL
B561 LD D,(HL)
B562 INC HL
B563 PUSH HL Preserve HL
B564 LD A,(DE) A = (*DE + 1) & 3
B565 INC A
B566 AND $03
B568 LD (DE),A *DE = A
B569 RLCA A <<= 2
B56A RLCA
B56B LD C,A C = A
B56C RLCA A <<= 1
B56D ADD A,C C += A
B56E LD C,A
B56F INC DE DE++
B570 LD HL,$0000 HL = <self modified>
B573 LD B,H B = H
B574 ADD HL,DE HL += DE
B575 LD D,(HL) DE = wordat(HL)
B576 INC HL
B577 LD E,(HL)
B578 LD HL,$CEAA HL -> bitmap_debris_1/2/3/4
B57B ADD HL,BC
B57C LD BC,$0601 B = height, C = ?
B57F EXX Bank
B580 LD BC,$0000 B = 0
B583 LD E,$01 E = 1
B585 EXX Unbank
B586 CALL sub_b67c_4 Presumably plotting the debris
B589 POP HL Restore HL
B58A POP BC Restore BC
B58B DJNZ sub_b549_0 Loop
B58D RET Return
Prev: B4F0 Up: Map Next: B58E