Prev: A97E Up: Map Next: AA38
A9DE: Dust/Stones stuff
Used by the routine at main_loop_23.
sub_A9DE A9DE LD A,$00 A = <self modified> Self modified by A97A, A9A3
A9E0 AND A Set flags
A9E1 RET Z Return if zero
A9E2 LD HL,$ED28 Point HL at (something above the stack)
A9E5 LD A,(HL) A = *HL; HL += 2
A9E6 INC HL
A9E7 INC HL
A9E8 AND A Set flags
A9E9 JR NZ,sub_A9DE_0 Jump to A9F1 if non-zero
A9EB INC HL HL += 2
A9EC INC HL
A9ED LD ($A9E3),HL Self modify 'LD HL,x' @ A9E2 to load HL
A9F0 RET Return
sub_A9DE_0 A9F1 LD DE,($5D0C) DE = *stones_lods
A9F5 DEC A A--
A9F6 JR Z,sub_A9DE_1 If non-zero DE = *dust_lods
A9F8 LD DE,($5D0E)
sub_A9DE_1 A9FC LD C,(HL) C = *HL++
A9FD INC HL
A9FE LD A,(HL) A = *HL
A9FF EX AF,AF'
AA00 INC HL HL++
AA01 LD ($A9E3),HL Self modify 'LD HL,x' @ A9E2 to load HL
AA04 XOR A A = 0
AA05 LD ($933E),A Self modify 'LD D,x' @ draw_object_right_8 to load zero
AA08 LD H,A H = A
AA09 LD A,B A = B
AA0A DEC A A--
AA0B CP $0B If A > 10 A = 10
AA0D JR C,sub_A9DE_2
AA0F LD A,$0A
sub_A9DE_2 AA11 SRL A A >>= 1
AA13 LD L,A L = A * 7
AA14 RLCA
AA15 RLCA
AA16 RLCA
AA17 SUB L
AA18 LD L,A
AA19 ADD HL,DE HL += DE
AA1A LD E,(HL) E = *HL * 8
AA1B RLC E
AA1D RLC E
AA1F RLC E
AA21 EX AF,AF'
AA22 AND A Set flags
AA23 LD A,C A = C
AA24 LD C,$00 C = $00
AA26 JP M,sub_A9DE_3 Jump to sub_A9DE_3 if negative
AA29 RET NZ Return if non-zero
AA2A CP $80 Jump to 9303 if A >= 128
AA2C JP NC,draw_object_right_3
AA2F ADD A,E A += E
AA30 JP draw_object_left_1 Exit via draw_object_left_1
sub_A9DE_3 AA33 ADD A,E A += E
AA34 RET NC Return if no carry
AA35 JP draw_object_left_1 Exit via draw_object_left_1
Prev: A97E Up: Map Next: AA38