Prev: EFE0 Up: Map Next: F28B
F10E: Helicopter Something
Used by the routine at RunHandlers.
Something_Helicopter F10E LD B,$06 B=06.
F110 LD IX,$D2A7 IX=Table_SomethingHelicopters.
Something_Helicopter_0 F114 LD A,$07 A=EC-B.
F116 SUB B
F117 ADD A,$E5
F119 LD ($D408),A Write A to *D408.
F11C XOR A Write 00 to *Flag_Orientation.
F11D LD ($D247),A
F120 PUSH BC Stash BC on the stack.
F121 LD A,(IX+$00) Jump to Something_Helicopter_20 if *IX+00 is zero.
F124 OR A
F125 JP Z,Something_Helicopter_20
F128 LD A,(IX+$00) A=*IX+00.
F12B LD C,(IX+$01) C=*IX+01.
F12E LD E,(IX+$02) E=*IX+02.
F131 LD B,(IX+$03) B=*IX+03.
F134 XOR %00000001 Flip bit 0.
F136 LD (IX+$00),A Write A to *IX+00.
F139 AND %00000001 Keep only bit 0.
F13B LD D,A D=A.
F13C LD A,(IX+$00) A=*IX+00.
F13F RRCA RRCA.
F140 AND %00000111 Keep only bits 0-2.
F142 CP $01 Jump to Something_Helicopter_1 if A is equal to 01.
F144 JR Z,Something_Helicopter_1
F146 CP $02 Jump to Something_Helicopter_5 if A is equal to 02.
F148 JR Z,Something_Helicopter_5
F14A CP $03 Jump to Something_Helicopter_7 if A is equal to 03.
F14C JP Z,Something_Helicopter_7
F14F CP $04 Jump to Something_Helicopter_15 if A is equal to 04.
F151 JP Z,Something_Helicopter_15
F154 CP $05 Jump to Something_Helicopter_17 if A is equal to 05.
F156 JP Z,Something_Helicopter_17
F159 CP $06 Jump to Something_Helicopter_1 if A is equal to 06.
F15B JP Z,Something_Helicopter_1
F15E JP Something_Helicopter_5 Jump to Something_Helicopter_5.
Something_Helicopter_1 F161 LD A,E Jump to Something_Helicopter_2 if E is not equal to C.
F162 CP C
F163 JR NZ,Something_Helicopter_2
F165 INC (IX+$02) Increment *IX+02 by one.
F168 JR Something_Helicopter_3 Jump to Something_Helicopter_3.
Something_Helicopter_2 F16A LD A,D A=D.
F16B RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
F16C LD A,$E8 A=E8.
F16E JP NC,Something_Helicopter_19 Jump to Something_Helicopter_19 if the carry flag is not set.
F171 INC C Increment C by one.
F172 LD (IX+$01),C Write C to *IX+01.
F175 LD A,$E6 A=E6.
F177 JP Something_Helicopter_19 Jump to Something_Helicopter_19.
Something_Helicopter_3 F17A LD A,(IX+$00) A=*IX+00.
F17D AND %01111111 Keep only bits 0-6.
F17F CP $08 Jump to Something_Helicopter_4 if A is lower than 08.
F181 JR C,Something_Helicopter_4
F183 LD (IX+$00),$00 Write 00 to *IX+00.
F187 LD A,($D3F6) Decrease *NumberOnScreenHelicopters by one.
F18A DEC A
F18B LD ($D3F6),A
F18E JP Something_Helicopter_20 Jump to Something_Helicopter_20.
Something_Helicopter_4 F191 LD (IX+$00),$06 Write 06 to *IX+00.
F195 LD (IX+$01),B Write B to *IX+01.
F198 LD (IX+$03),$01 Write 01 to *IX+03.
F19C POP BC Restore BC from the stack.
F19D JP Something_Helicopter_0 Jump to Something_Helicopter_0.
Something_Helicopter_5 F1A0 LD A,$01 Write 01 to *Flag_Orientation.
F1A2 LD ($D247),A
F1A5 LD A,E Jump to Something_Helicopter_6 if E is not equal to C.
F1A6 CP C
F1A7 JR NZ,Something_Helicopter_6
F1A9 INC (IX+$02) Increment *IX+02 by one.
F1AC JR Something_Helicopter_3 Jump to Something_Helicopter_3.
Something_Helicopter_6 F1AE LD A,D A=D.
F1AF RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
F1B0 LD A,$E8 A=E8.
F1B2 JP NC,Something_Helicopter_19 Jump to Something_Helicopter_19 if the carry flag is not set.
F1B5 DEC C Decrease C by one.
F1B6 LD (IX+$01),C Write C to *IX+01.
F1B9 LD A,$E6 A=E6.
F1BB JP Something_Helicopter_19 Jump to Something_Helicopter_19.
Something_Helicopter_7 F1BE LD A,B Jump to Something_Helicopter_8 if B is equal to C.
F1BF CP C
F1C0 JR Z,Something_Helicopter_8
F1C2 LD B,C B=C.
F1C3 LD C,E C=E.
F1C4 LD A,D A=D.
F1C5 RRCA Rotate A right one position, setting the carry flag if bit 0 was set.
F1C6 LD A,$EC A=EC.
F1C8 JP NC,Something_Helicopter_19 Jump to Something_Helicopter_19 if the carry flag is not set.
F1CB DEC B Decrease B by one.
F1CC LD (IX+$01),B Write B to *IX+01.
F1CF LD A,$EA A=EA.
F1D1 JP Something_Helicopter_19 Jump to Something_Helicopter_19.
Something_Helicopter_8 F1D4 LD A,E A=E.
F1D5 CP $10 Jump to Something_Helicopter_9 if A is higher than 10.
F1D7 JR NC,Something_Helicopter_9
F1D9 LD (IX+$00),$08 Write 08 to *IX+00.
F1DD LD C,(IX+$02) C=*IX+02.
F1E0 DEC (IX+$02) Decrease *IX+02 by one.
F1E3 INC C Increment C by two.
F1E4 INC C
F1E5 LD D,$02 D=02.
F1E7 JR Something_Helicopter_10 Jump to Something_Helicopter_10.
Something_Helicopter_9 F1E9 LD (IX+$00),$0A Write 0A to *IX+00.
F1ED LD C,(IX+$02) C=*IX+02.
F1F0 LD D,$82 D=82.
Something_Helicopter_10 F1F2 LD (IX+$03),$12 Write 12 to *IX+03.
F1F6 LD B,$04 B=04.
F1F8 CALL Something_Helicopter_11 Call Something_Helicopter_11.
F1FB POP BC Restore BC from the stack.
F1FC JP Something_Helicopter_0 Jump to Something_Helicopter_0.
Something_Helicopter_11 F1FF LD A,($D3F9) A=*D3F9.
F202 CP $10 Return if A is higher than 10.
F204 RET NC
F205 ADD A,$03 A+=03.
F207 LD ($D3F9),A Write A to *D3F9.
F20A LD HL,$D2BC HL=D2BC.
Something_Helicopter_12 F20D INC HL Increment HL by three.
F20E INC HL
F20F INC HL
F210 LD A,(HL) Jump to Something_Helicopter_12 if *HL is not zero.
F211 AND A
F212 JR NZ,Something_Helicopter_12
F214 LD E,$03 E=03.
Something_Helicopter_13 F216 LD (HL),D Write D to *HL.
F217 INC HL Increment HL by one.
F218 LD (HL),C Write C to *HL.
F219 INC HL Increment HL by one.
F21A LD (HL),B Write B to *HL.
F21B INC HL Increment HL by one.
F21C INC B Increment B by one.
F21D INC C Increment C by one.
F21E LD A,D Jump to Something_Helicopter_14 if D is equal to 02.
F21F CP $02
F221 JR Z,Something_Helicopter_14
F223 DEC C Decrease C by two.
F224 DEC C
Something_Helicopter_14 F225 DEC E Decrease E by one.
F226 JR NZ,Something_Helicopter_13 Jump to Something_Helicopter_13 until E is zero.
F228 LD A,$02 Write melody ID 02 to *MelodyID.
F22A LD ($FF8D),A
F22D RET Return.
Something_Helicopter_15 F22E LD A,$01 Write 01 to *Flag_Orientation.
F230 LD ($D247),A
F233 LD A,B Jump to Something_Helicopter_16 if B is equal to C.
F234 CP C
F235 JR Z,Something_Helicopter_16
F237 LD A,$EE A=EE.
F239 INC C Increment C by one.
F23A LD (IX+$01),C Write C to *IX+01.
F23D INC E Increment E by one.
F23E LD (IX+$02),E Write E to *IX+02.
F241 LD B,C B=C.
F242 LD C,E C=E.
F243 JR Something_Helicopter_19 Jump to Something_Helicopter_19.
Something_Helicopter_16 F245 LD (IX+$00),$0C Write 0C to *IX+00.
F249 LD (IX+$01),E Write E to *IX+01.
F24C LD (IX+$02),$22 Write 22 to *IX+02.
F250 POP BC Restore BC from the stack.
F251 JP Something_Helicopter_0 Jump to Something_Helicopter_0.
Something_Helicopter_17 F254 LD A,B Jump to Something_Helicopter_18 if B is equal to C.
F255 CP C
F256 JR Z,Something_Helicopter_18
F258 LD A,$EE A=EE.
F25A INC C Increment C by one.
F25B LD (IX+$01),C Write C to *IX+01.
F25E DEC E Decrease E by one.
F25F LD (IX+$02),E Write E to *IX+02.
F262 LD B,C B=C.
F263 LD C,E C=E.
F264 JR Something_Helicopter_19 Jump to Something_Helicopter_19.
Something_Helicopter_18 F266 LD (IX+$00),$0E Write 0E to *IX+00.
F26A DEC E Decrease E by one.
F26B LD (IX+$01),E Write E to *IX+01.
F26E LD (IX+$02),$FA Write FA to *IX+02.
F272 POP BC Restore BC from the stack.
F273 JP Something_Helicopter_0 Jump to Something_Helicopter_0.
Something_Helicopter_19 F276 CALL PrintSprite Call PrintSprite.
F279 XOR A Write 00 to *Flag_Orientation.
F27A LD ($D247),A
Something_Helicopter_20 F27D INC IX Increment IX by four.
F27F INC IX
F281 INC IX
F283 INC IX
F285 POP BC Restore BC from the stack.
F286 DEC B Decrease B by one.
F287 JP NZ,Something_Helicopter_0 Jump to Something_Helicopter_0 until B is zero.
F28A RET Return.
Prev: EFE0 Up: Map Next: F28B