Prev: 8999 Up: Map Next: 89EB
899E: Handle sprite types $18 - $1C
Used by the routine at handle_sprite_types_0E_11.
handle_sprite_types_18_1C 899E CP $18 Is sprite type < $18
89A0 RET C Then return
89A1 CP $1A Is sprite type < $1A
89A3 JR C,handle_sprite_types_18_1C_1 If so, jump ahead
Sprite types $1A - $1C (circular enemies)
89A5 LD B,A B = sprite type
89A6 LD A,(frame_counter) Frame counter
89A9 AND $03 Mod 4
89AB JR NZ,handle_sprite_types_18_1C_1 If not zero the skip ahead
89AD LD A,B A = sprite type
89AE INC A A = sprite type + 1
89AF CP $1D Is sprite type + 1 < $1D, i.e. sprite type < $1C, i.e. $1A or $1B
89B1 JR C,handle_sprite_types_18_1C_0 Then skip next
89B3 LD A,$1A Else set sprite type to $1A
handle_sprite_types_18_1C_0 89B5 LD (IX+$00),A This means rotate between $1A, $1B, and $1C
Sprite types $18 - $19 (three spheres, star shape) plus $1A - 1C
handle_sprite_types_18_1C_1 89B8 BIT 7,(IX+$07) Text flag bit 7
89BC JR Z,L8A2D If reset, move towards viewer
89BE LD A,(sprite_countdown) Return if countdown
89C1 OR A is not zero
89C2 RET NZ ...
89C3 LD L,(IX+$06) Get path address
89C6 LD H,(IX+$07) ...
89C9 LD A,(IX+$03) Get counter
89CC SUB $10 Decrement upper nybble
89CE LD (IX+$03),A Save counter
89D1 JR NC,move_sprite_along_path If upper nybble >= 0 then jump ahead
89D3 INC HL Next path address
89D4 LD A,(HL) Get path byte
89D5 SUB $10 Decrement upper nybble
89D7 JR C,L8A3C If < 0 then set flag and return
89D9 AND $F0 Isolate upper nybble
89DB LD B,A Save it
89DC LD A,(IX+$03) Get counter
89DF AND $0F And apply upper nybble
89E1 OR B ...
89E2 LD (IX+$03),A ...
89E5 LD (IX+$06),L Set path address
89E8 LD (IX+$07),H ... (continue into move_sprite_along_path)
Prev: 8999 Up: Map Next: 89EB