; Routine: Run Tail AI: Sound, control AI, X/Y positions, tail extension, hurt Samus { $A6:CAF5 20 AA D2 JSR $D2AA [$A6:D2AA] ; Play swishing sound if tail is moving fast $A6:CAF8 AF 00 20 7E LDA $7E2000[$7E:2000] ; Tail control index $A6:CAFC 0A ASL A $A6:CAFD AA TAX $A6:CAFE FC 21 CB JSR ($CB21,x)[$A6:CB20] $A6:CB01 8B PHB $A6:CB02 F4 7E 7E PEA $7E7E $A6:CB05 AB PLB $A6:CB06 AB PLB $A6:CB07 20 BA CE JSR $CEBA [$A6:CEBA] $A6:CB0A 20 5A CF JSR $CF5A [$A6:CF5A] $A6:CB0D AB PLB $A6:CB0E AD 86 0F LDA $0F86 [$7E:0F86] ; Property bits of Ridley $A6:CB11 29 00 04 AND #$0400 $A6:CB14 0D A8 18 ORA $18A8 [$7E:18A8] $A6:CB17 0F 36 78 7E ORA $7E7836[$7E:7836] ; Set if Ridley is holding Samus $A6:CB1B D0 03 BNE $03 [$CB20] $A6:CB1D 4C D9 DF JMP $DFD9 [$A6:DFD9] ; Tail/Samus interaction ; Tail AI: RTS { $A6:CB20 60 RTS } $A6:CB21 dw $CB20 $A6:CB23 dw $CBC0 $A6:CB25 dw $CB33 ; Extended tail (downwards, for pogo) $A6:CB27 dw $CB45 $A6:CB29 dw $CBC7 $A6:CB2B dw $CBCE $A6:CB2D dw $CB4E $A6:CB2F dw $CB60 $A6:CB31 dw $CBD5 } ; Tail AI { $A6:CB33 A9 08 00 LDA #$0008 $A6:CB36 8F 14 20 7E STA $7E2014[$7E:2014] ; Tail rotational speed $A6:CB3A 20 72 CB JSR $CB72 [$A6:CB72] $A6:CB3D A9 03 00 LDA #$0003 $A6:CB40 8F 00 20 7E STA $7E2000[$7E:2000] ; Tail control index $A6:CB44 60 RTS } ; Tail AI { $A6:CB45 A9 08 00 LDA #$0008 $A6:CB48 8F 14 20 7E STA $7E2014[$7E:2014] ; Tail rotational speed $A6:CB4C 80 24 BRA $24 [$CB72] } ; Tail AI { $A6:CB4E A9 03 00 LDA #$0003 $A6:CB51 8F 14 20 7E STA $7E2014[$7E:2014] ; Tail rotational speed $A6:CB55 20 72 CB JSR $CB72 [$A6:CB72] $A6:CB58 A9 06 00 LDA #$0006 $A6:CB5B 8F 00 20 7E STA $7E2000[$7E:2000] ; Tail control index $A6:CB5F 60 RTS } ; Missing Tail AI CB60 ; Tail routine/part of AI { $A6:CB72 AF 20 78 7E LDA $7E7820[$7E:7820] ; Ridley's direction (0 = left, 2 = right) $A6:CB76 D0 10 BNE $10 [$CB88] $A6:CB78 A9 00 40 LDA #$4000 $A6:CB7B 8F 1C 20 7E STA $7E201C[$7E:201C] $A6:CB7F A9 FF FF LDA #$FFFF $A6:CB82 8F 1A 20 7E STA $7E201A[$7E:201A] $A6:CB86 80 0E BRA $0E [$CB96] $A6:CB88 A9 00 40 LDA #$4000 $A6:CB8B 8F 1A 20 7E STA $7E201A[$7E:201A] $A6:CB8F A9 FF FF LDA #$FFFF $A6:CB92 8F 1C 20 7E STA $7E201C[$7E:201C] $A6:CB96 20 C7 CB JSR $CBC7 [$A6:CBC7] $A6:CB99 AF 20 20 7E LDA $7E2020[$7E:2020] ; Tail 1 $A6:CB9D 0F 34 20 7E ORA $7E2034[$7E:2034] ; Tail 2 $A6:CBA1 0F 48 20 7E ORA $7E2048[$7E:2048] ; Tail 3 $A6:CBA5 0F 5C 20 7E ORA $7E205C[$7E:205C] ; Tail 4 $A6:CBA9 0F 70 20 7E ORA $7E2070[$7E:2070] ; Tail 5 $A6:CBAD 0F 84 20 7E ORA $7E2084[$7E:2084] ; Tail 6 $A6:CBB1 0F 98 20 7E ORA $7E2098[$7E:2098] ; Tail 7 $A6:CBB5 F0 01 BEQ $01 [$CBB8] $A6:CBB7 60 RTS $A6:CBB8 A9 04 00 LDA #$0004 $A6:CBBB 8F 00 20 7E STA $7E2000[$7E:2000] ; Tail control index $A6:CBBF 60 RTS } ; Tail AI { $A6:CBC0 A9 39 CC LDA #$CC39 $A6:CBC3 85 12 STA $12 [$7E:0012] $A6:CBC5 80 15 BRA $15 [$CBDC] } ; Tail AI { $A6:CBC7 A9 24 CD LDA #$CD24 $A6:CBCA 85 12 STA $12 [$7E:0012] $A6:CBCC 80 0E BRA $0E [$CBDC] } ; Tail AI { $A6:CBCE A9 AA CD LDA #$CDAA $A6:CBD1 85 12 STA $12 [$7E:0012] $A6:CBD3 80 07 BRA $07 [$CBDC] } ; Missing Tail AI CB60 ; Part of Tail AI { $A6:CBDC 8B PHB $A6:CBDD F4 7E 7E PEA $7E7E $A6:CBE0 AB PLB $A6:CBE1 AB PLB $A6:CBE2 F4 E7 CB PEA $CBE7 $A6:CBE5 6C 12 00 JMP ($0012)[$A6:CC39] $A6:CBE8 A9 07 00 LDA #$0007 $A6:CBEB A2 00 00 LDX #$0000 $A6:CBEE 48 PHA $A6:CBEF 20 9F D0 JSR $D09F [$A6:D09F] $A6:CBF2 8A TXA $A6:CBF3 18 CLC $A6:CBF4 69 14 00 ADC #$0014 $A6:CBF7 AA TAX $A6:CBF8 68 PLA $A6:CBF9 3A DEC A $A6:CBFA D0 F2 BNE $F2 [$CBEE] $A6:CBFC AB PLB $A6:CBFD 60 RTS } ; Tail Routine: Set min and max tail angles based on direction { $A6:CBFE AD 20 78 LDA $7820 [$7E:7820] $A6:CC01 0A ASL A $A6:CC02 AA TAX $A6:CC03 BF 12 CC A6 LDA $A6CC12,x[$A6:CC12] $A6:CC07 8D 16 20 STA $2016 [$7E:2016] $A6:CC0A BF 18 CC A6 LDA $A6CC18,x[$A6:CC18] $A6:CC0E 8D 18 20 STA $2018 [$7E:2018] $A6:CC11 60 RTS $A6:CC12 db F0, 3F, F0, 3F, C0, 3F, 40, 40, 40, 40, 10, 40 } ; Tail Routine: SEC if all tail parts are rotating, else CLC { $A6:CC1E AD 20 20 LDA $2020 [$7E:2020] $A6:CC21 2D 34 20 AND $2034 [$7E:2034] $A6:CC24 2D 48 20 AND $2048 [$7E:2048] $A6:CC27 2D 5C 20 AND $205C [$7E:205C] $A6:CC2A 2D 70 20 AND $2070 [$7E:2070] $A6:CC2D 2D 84 20 AND $2084 [$7E:2084] $A6:CC30 2D 98 20 AND $2098 [$7E:2098] $A6:CC33 F0 02 BEQ $02 [$CC37] $A6:CC35 38 SEC $A6:CC36 60 RTS $A6:CC37 18 CLC $A6:CC38 60 RTS } ; Tail routine { $A6:CC39 20 FE CB JSR $CBFE [$A6:CBFE] ; Set min and max tail angles based on direction $A6:CC3C 20 1E CC JSR $CC1E [$A6:CC1E] ; SEC if all tail parts are rotating, else CLC $A6:CC3F 90 03 BCC $03 [$CC44] $A6:CC41 20 7D CC JSR $CC7D [$A6:CC7D] $A6:CC44 AD 20 20 LDA $2020 [$7E:2020] $A6:CC47 0D 34 20 ORA $2034 [$7E:2034] $A6:CC4A 0D 48 20 ORA $2048 [$7E:2048] $A6:CC4D 0D 5C 20 ORA $205C [$7E:205C] $A6:CC50 0D 70 20 ORA $2070 [$7E:2070] $A6:CC53 0D 84 20 ORA $2084 [$7E:2084] $A6:CC56 0D 98 20 ORA $2098 [$7E:2098] $A6:CC59 F0 01 BEQ $01 [$CC5C] $A6:CC5B 60 RTS $A6:CC5C A9 00 80 LDA #$8000 $A6:CC5F 8D 20 20 STA $2020 [$7E:2020] $A6:CC62 A9 FF FF LDA #$FFFF $A6:CC65 8D 1A 20 STA $201A [$7E:201A] $A6:CC68 8D 1C 20 STA $201C [$7E:201C] $A6:CC6B A9 02 00 LDA #$0002 $A6:CC6E AC F6 0A LDY $0AF6 [$7E:0AF6] ; Samus' X position $A6:CC71 C0 70 00 CPY #$0070 $A6:CC74 B0 03 BCS $03 [$CC79] $A6:CC76 A9 01 00 LDA #$0001 $A6:CC79 8D 14 20 STA $2014 [$7E:2014] $A6:CC7C 60 RTS } ; Tail routine { $A6:CC7D AD 04 20 LDA $2004 [$7E:2004] $A6:CC80 F0 08 BEQ $08 [$CC8A] $A6:CC82 AD 1C 20 LDA $201C [$7E:201C] $A6:CC85 2D 1A 20 AND $201A [$7E:201A] $A6:CC88 30 27 BMI $27 [$CCB1] $A6:CC8A AD 02 20 LDA $2002 [$7E:2002] $A6:CC8D F0 2A BEQ $2A [$CCB9] $A6:CC8F AD E5 05 LDA $05E5 [$7E:05E5] $A6:CC92 29 FF 00 AND #$00FF $A6:CC95 C9 F0 00 CMP #$00F0 $A6:CC98 B0 17 BCS $17 [$CCB1] $A6:CC9A AD F6 0A LDA $0AF6 [$7E:0AF6] ; Samus' X position $A6:CC9D 38 SEC $A6:CC9E ED 7A 0F SBC $0F7A [$7E:0F7A] ; Ridley's X position $A6:CCA1 10 04 BPL $04 [$CCA7] $A6:CCA3 49 FF FF EOR #$FFFF $A6:CCA6 1A INC A $A6:CCA7 C9 80 00 CMP #$0080 $A6:CCAA B0 0D BCS $0D [$CCB9] $A6:CCAC A9 00 00 LDA #$0000 $A6:CCAF 80 04 BRA $04 [$CCB5] $A6:CCB1 AD 04 20 LDA $2004 [$7E:2004] $A6:CCB4 3A DEC A $A6:CCB5 20 9D D1 JSR $D19D [$A6:D19D] ; Target an angle (towards a missile or Samus) for tail. Note: Actual angle is actually twice the angle chosen, since each tail segment doubles it. Also, tail circles 2*A amount of times first $A6:CCB8 68 PLA $A6:CCB9 9C 04 20 STZ $2004 [$7E:2004] $A6:CCBC 60 RTS } ; Tail routine { $A6:CD24 20 FE CB JSR $CBFE [$A6:CBFE] ; Set min and max tail angles based on direction $A6:CD27 20 1E CC JSR $CC1E [$A6:CC1E] ; SEC if all tail parts are rotating, else CLC $A6:CD2A 90 33 BCC $33 [$CD5F] $A6:CD2C AD E5 05 LDA $05E5 [$7E:05E5] $A6:CD2F 29 FF 00 AND #$00FF $A6:CD32 C9 F0 00 CMP #$00F0 $A6:CD35 B0 13 BCS $13 [$CD4A] $A6:CD37 AD F6 0A LDA $0AF6 [$7E:0AF6] ; Samus' X position $A6:CD3A 38 SEC $A6:CD3B EF 7A 0F 00 SBC $000F7A[$7E:0F7A] ; Ridley's X position $A6:CD3F 10 04 BPL $04 [$CD45] $A6:CD41 49 FF FF EOR #$FFFF $A6:CD44 1A INC A $A6:CD45 C9 80 00 CMP #$0080 $A6:CD48 B0 15 BCS $15 [$CD5F] $A6:CD4A AD 1C 20 LDA $201C [$7E:201C] $A6:CD4D 2D 1A 20 AND $201A [$7E:201A] $A6:CD50 10 0D BPL $0D [$CD5F] $A6:CD5F AD 20 20 LDA $2020 [$7E:2020] $A6:CD62 0D 34 20 ORA $2034 [$7E:2034] $A6:CD65 0D 48 20 ORA $2048 [$7E:2048] $A6:CD68 0D 5C 20 ORA $205C [$7E:205C] $A6:CD6B 0D 70 20 ORA $2070 [$7E:2070] $A6:CD6E 0D 84 20 ORA $2084 [$7E:2084] $A6:CD71 0D 98 20 ORA $2098 [$7E:2098] $A6:CD74 F0 01 BEQ $01 [$CD77] $A6:CD76 60 RTS $A6:CD77 2C AC 0F BIT $0FAC [$7E:0FAC] ; Y speed (1/100 pixels) $A6:CD7A 30 06 BMI $06 [$CD82] $A6:CD7C A9 05 00 LDA #$0005 $A6:CD7F 8D 00 20 STA $2000 [$7E:2000] $A6:CD82 A9 FF FF LDA #$FFFF $A6:CD85 8D 1A 20 STA $201A [$7E:201A] $A6:CD88 8D 1C 20 STA $201C [$7E:201C] $A6:CD8B AD 10 20 LDA $2010 [$7E:2010] $A6:CD8E D0 04 BNE $04 [$CD94] $A6:CD90 8D 14 20 STA $2014 [$7E:2014] $A6:CD93 60 RTS } ; Tail routine { $A6:CDAA 20 FE CB JSR $CBFE [$A6:CBFE] ; Set min and max tail angles based on direction $A6:CDAD 20 1E CC JSR $CC1E [$A6:CC1E] ; SEC if all tail parts are rotating, else CLC $A6:CDB0 90 33 BCC $33 [$CDE5] $A6:CDE5 AD 20 20 LDA $2020 [$7E:2020] $A6:CDE8 0D 34 20 ORA $2034 [$7E:2034] $A6:CDEB 0D 48 20 ORA $2048 [$7E:2048] $A6:CDEE 0D 5C 20 ORA $205C [$7E:205C] $A6:CDF1 0D 70 20 ORA $2070 [$7E:2070] $A6:CDF4 0D 84 20 ORA $2084 [$7E:2084] $A6:CDF7 0D 98 20 ORA $2098 [$7E:2098] $A6:CDFA F0 01 BEQ $01 [$CDFD] $A6:CDFD 2C AC 0F BIT $0FAC [$7E:0FAC] ; Y speed (1/100 pixels) $A6:CE00 30 3C BMI $3C [$CE3E] $A6:CE02 A9 06 00 LDA #$0006 $A6:CE05 8D 00 20 STA $2000 [$7E:2000] $A6:CE08 A9 00 0A LDA #$0A00 $A6:CE0B 8D 28 20 STA $2028 [$7E:2028] $A6:CE0E 8D 3C 20 STA $203C [$7E:203C] $A6:CE11 8D 50 20 STA $2050 [$7E:2050] $A6:CE14 8D 64 20 STA $2064 [$7E:2064] $A6:CE17 8D 78 20 STA $2078 [$7E:2078] $A6:CE1A 8D 8C 20 STA $208C [$7E:208C] $A6:CE1D 8D A0 20 STA $20A0 [$7E:20A0] $A6:CE20 A9 00 40 LDA #$4000 $A6:CE23 8D 2A 20 STA $202A [$7E:202A] $A6:CE26 8D 3E 20 STA $203E [$7E:203E] $A6:CE29 8D 52 20 STA $2052 [$7E:2052] $A6:CE2C 8D 66 20 STA $2066 [$7E:2066] $A6:CE2F 8D 7A 20 STA $207A [$7E:207A] $A6:CE32 8D 8E 20 STA $208E [$7E:208E] $A6:CE35 8D A2 20 STA $20A2 [$7E:20A2] $A6:CE38 A9 00 80 LDA #$8000 $A6:CE3B 8D 20 20 STA $2020 [$7E:2020] $A6:CE3E A9 FF FF LDA #$FFFF $A6:CE41 8D 1A 20 STA $201A [$7E:201A] $A6:CE44 8D 1C 20 STA $201C [$7E:201C] $A6:CE47 AD 10 20 LDA $2010 [$7E:2010] $A6:CE4A D0 03 BNE $03 [$CE4F] $A6:CE4C 4C 61 CE JMP $CE61 [$A6:CE61] $A6:CE61 8D 14 20 STA $2014 [$7E:2014] $A6:CE64 60 RTS } ; Tail routine: Update tail positions { $A6:CEBA AD 7E 0F LDA $0F7E [$7E:0F7E] ; Ridley's Y position $A6:CEBD 18 CLC $A6:CEBE 6D 32 20 ADC $2032 [$7E:2032] $A6:CEC1 18 CLC $A6:CEC2 69 10 00 ADC #$0010 $A6:CEC5 8D 2E 20 STA $202E [$7E:202E] $A6:CEC8 18 CLC $A6:CEC9 6D 46 20 ADC $2046 [$7E:2046] $A6:CECC 8D 42 20 STA $2042 [$7E:2042] $A6:CECF 18 CLC $A6:CED0 6D 5A 20 ADC $205A [$7E:205A] $A6:CED3 8D 56 20 STA $2056 [$7E:2056] $A6:CED6 18 CLC $A6:CED7 6D 6E 20 ADC $206E [$7E:206E] $A6:CEDA 8D 6A 20 STA $206A [$7E:206A] $A6:CEDD 18 CLC $A6:CEDE 6D 82 20 ADC $2082 [$7E:2082] $A6:CEE1 8D 7E 20 STA $207E [$7E:207E] $A6:CEE4 18 CLC $A6:CEE5 6D 96 20 ADC $2096 [$7E:2096] $A6:CEE8 8D 92 20 STA $2092 [$7E:2092] $A6:CEEB 18 CLC $A6:CEEC 6D AA 20 ADC $20AA [$7E:20AA] $A6:CEEF 8D A6 20 STA $20A6 [$7E:20A6] $A6:CEF2 AD 20 78 LDA $7820 [$7E:7820] $A6:CEF5 3A DEC A $A6:CEF6 F0 0A BEQ $0A [$CF02] $A6:CEF8 1A INC A $A6:CEF9 0A ASL A $A6:CEFA AA TAX $A6:CEFB BF 54 CF A6 LDA $A6CF54,x[$A6:CF54] $A6:CEFF 6D 30 20 ADC $2030 [$7E:2030] $A6:CF02 18 CLC $A6:CF03 6D 7A 0F ADC $0F7A [$7E:0F7A] ; Ridley's X position $A6:CF06 8D 2C 20 STA $202C [$7E:202C] $A6:CF09 AD 20 78 LDA $7820 [$7E:7820] $A6:CF0C 3A DEC A $A6:CF0D D0 17 BNE $17 [$CF26] $A6:CF0F AD 7A 0F LDA $0F7A [$7E:0F7A] ; Ridley's X position $A6:CF12 8D 40 20 STA $2040 [$7E:2040] $A6:CF15 8D 54 20 STA $2054 [$7E:2054] $A6:CF18 8D 68 20 STA $2068 [$7E:2068] $A6:CF1B 8D 7C 20 STA $207C [$7E:207C] $A6:CF1E 8D 90 20 STA $2090 [$7E:2090] $A6:CF21 8D A4 20 STA $20A4 [$7E:20A4] $A6:CF24 80 2D BRA $2D [$CF53] $A6:CF26 AD 2C 20 LDA $202C [$7E:202C] $A6:CF29 18 CLC $A6:CF2A 6D 44 20 ADC $2044 [$7E:2044] $A6:CF2D 8D 40 20 STA $2040 [$7E:2040] $A6:CF30 18 CLC $A6:CF31 6D 58 20 ADC $2058 [$7E:2058] $A6:CF34 8D 54 20 STA $2054 [$7E:2054] $A6:CF37 18 CLC $A6:CF38 6D 6C 20 ADC $206C [$7E:206C] $A6:CF3B 8D 68 20 STA $2068 [$7E:2068] $A6:CF3E 18 CLC $A6:CF3F 6D 80 20 ADC $2080 [$7E:2080] $A6:CF42 8D 7C 20 STA $207C [$7E:207C] $A6:CF45 18 CLC $A6:CF46 6D 94 20 ADC $2094 [$7E:2094] $A6:CF49 8D 90 20 STA $2090 [$7E:2090] $A6:CF4C 18 CLC $A6:CF4D 6D A8 20 ADC $20A8 [$7E:20A8] $A6:CF50 8D A4 20 STA $20A4 [$7E:20A4] $A6:CF53 60 RTS $A6:CF54 db 20, 00 $A6:CF58 db E0, FF } ; Tail routine: Tail extending { $A6:CF5A AD 3C 20 LDA $203C [$7E:203C] $A6:CF5D F0 1F BEQ $1F [$CF7E] $A6:CF5F CD 3A 20 CMP $203A [$7E:203A] $A6:CF62 10 06 BPL $06 [$CF6A] $A6:CF64 A9 00 00 LDA #$0000 $A6:CF67 8D 3C 20 STA $203C [$7E:203C] $A6:CF6A AD 3A 20 LDA $203A [$7E:203A] $A6:CF6D 18 CLC $A6:CF6E 6D 12 20 ADC $2012 [$7E:2012] $A6:CF71 C9 00 18 CMP #$1800 $A6:CF74 30 03 BMI $03 [$CF79] $A6:CF76 A9 00 18 LDA #$1800 $A6:CF79 8D 3A 20 STA $203A [$7E:203A] $A6:CF7C 80 12 BRA $12 [$CF90] $A6:CF7E A9 00 08 LDA #$0800 $A6:CF81 CD 3A 20 CMP $203A [$7E:203A] $A6:CF84 10 0A BPL $0A [$CF90] $A6:CF86 AD 3A 20 LDA $203A [$7E:203A] $A6:CF89 38 SEC $A6:CF8A E9 80 00 SBC #$0080 $A6:CF8D 8D 3A 20 STA $203A [$7E:203A] $A6:CF90 AD 50 20 LDA $2050 [$7E:2050] $A6:CF93 F0 1F BEQ $1F [$CFB4] $A6:CF95 CD 4E 20 CMP $204E [$7E:204E] $A6:CF98 10 06 BPL $06 [$CFA0] $A6:CF9A A9 00 00 LDA #$0000 $A6:CF9D 8D 50 20 STA $2050 [$7E:2050] $A6:CFA0 AD 4E 20 LDA $204E [$7E:204E] $A6:CFA3 18 CLC $A6:CFA4 6D 12 20 ADC $2012 [$7E:2012] $A6:CFA7 C9 00 18 CMP #$1800 $A6:CFAA 30 03 BMI $03 [$CFAF] $A6:CFAC A9 00 18 LDA #$1800 $A6:CFAF 8D 4E 20 STA $204E [$7E:204E] $A6:CFB2 80 12 BRA $12 [$CFC6] $A6:CFB4 A9 00 08 LDA #$0800 $A6:CFB7 CD 4E 20 CMP $204E [$7E:204E] $A6:CFBA 10 0A BPL $0A [$CFC6] $A6:CFBC AD 4E 20 LDA $204E [$7E:204E] $A6:CFBF 38 SEC $A6:CFC0 E9 80 00 SBC #$0080 $A6:CFC3 8D 4E 20 STA $204E [$7E:204E] $A6:CFC6 AD 64 20 LDA $2064 [$7E:2064] $A6:CFC9 F0 1F BEQ $1F [$CFEA] $A6:CFCB CD 62 20 CMP $2062 [$7E:2062] $A6:CFCE 10 06 BPL $06 [$CFD6] $A6:CFD0 A9 00 00 LDA #$0000 $A6:CFD3 8D 64 20 STA $2064 [$7E:2064] $A6:CFD6 AD 62 20 LDA $2062 [$7E:2062] $A6:CFD9 18 CLC $A6:CFDA 6D 12 20 ADC $2012 [$7E:2012] $A6:CFDD C9 00 16 CMP #$1600 $A6:CFE0 30 03 BMI $03 [$CFE5] $A6:CFE2 A9 00 16 LDA #$1600 $A6:CFE5 8D 62 20 STA $2062 [$7E:2062] $A6:CFE8 80 12 BRA $12 [$CFFC] $A6:CFEA A9 00 08 LDA #$0800 $A6:CFED CD 62 20 CMP $2062 [$7E:2062] $A6:CFF0 10 0A BPL $0A [$CFFC] $A6:CFF2 AD 62 20 LDA $2062 [$7E:2062] $A6:CFF5 38 SEC $A6:CFF6 E9 80 00 SBC #$0080 $A6:CFF9 8D 62 20 STA $2062 [$7E:2062] $A6:CFFC AD 78 20 LDA $2078 [$7E:2078] $A6:CFFF F0 1F BEQ $1F [$D020] $A6:D001 CD 76 20 CMP $2076 [$7E:2076] $A6:D004 10 06 BPL $06 [$D00C] $A6:D006 A9 00 00 LDA #$0000 $A6:D009 8D 78 20 STA $2078 [$7E:2078] $A6:D00C AD 76 20 LDA $2076 [$7E:2076] $A6:D00F 18 CLC $A6:D010 6D 12 20 ADC $2012 [$7E:2012] $A6:D013 C9 00 16 CMP #$1600 $A6:D016 30 03 BMI $03 [$D01B] $A6:D018 A9 00 16 LDA #$1600 $A6:D01B 8D 76 20 STA $2076 [$7E:2076] $A6:D01E 80 12 BRA $12 [$D032] $A6:D020 A9 00 08 LDA #$0800 $A6:D023 CD 76 20 CMP $2076 [$7E:2076] $A6:D026 10 0A BPL $0A [$D032] $A6:D028 AD 76 20 LDA $2076 [$7E:2076] $A6:D02B 38 SEC $A6:D02C E9 80 00 SBC #$0080 $A6:D02F 8D 76 20 STA $2076 [$7E:2076] $A6:D032 AD 8C 20 LDA $208C [$7E:208C] $A6:D035 F0 1F BEQ $1F [$D056] $A6:D037 CD 8A 20 CMP $208A [$7E:208A] $A6:D03A 10 06 BPL $06 [$D042] $A6:D03C A9 00 00 LDA #$0000 $A6:D03F 8D 8C 20 STA $208C [$7E:208C] $A6:D042 AD 8A 20 LDA $208A [$7E:208A] $A6:D045 18 CLC $A6:D046 6D 12 20 ADC $2012 [$7E:2012] $A6:D049 C9 00 12 CMP #$1200 $A6:D04C 30 03 BMI $03 [$D051] $A6:D04E A9 00 12 LDA #$1200 $A6:D051 8D 8A 20 STA $208A [$7E:208A] $A6:D054 80 12 BRA $12 [$D068] $A6:D056 A9 00 08 LDA #$0800 $A6:D059 CD 8A 20 CMP $208A [$7E:208A] $A6:D05C 10 0A BPL $0A [$D068] $A6:D05E AD 8A 20 LDA $208A [$7E:208A] $A6:D061 38 SEC $A6:D062 E9 80 00 SBC #$0080 $A6:D065 8D 8A 20 STA $208A [$7E:208A] $A6:D068 AD A0 20 LDA $20A0 [$7E:20A0] $A6:D06B F0 1F BEQ $1F [$D08C] $A6:D06D CD 9E 20 CMP $209E [$7E:209E] $A6:D070 10 06 BPL $06 [$D078] $A6:D078 AD 9E 20 LDA $209E [$7E:209E] $A6:D07B 18 CLC $A6:D07C 6D 12 20 ADC $2012 [$7E:2012] $A6:D07F C9 00 05 CMP #$0500 $A6:D082 30 03 BMI $03 [$D087] $A6:D084 A9 00 05 LDA #$0500 $A6:D087 8D 9E 20 STA $209E [$7E:209E] $A6:D08A 80 12 BRA $12 [$D09E] $A6:D08C A9 00 05 LDA #$0500 $A6:D08F CD 9E 20 CMP $209E [$7E:209E] $A6:D092 10 0A BPL $0A [$D09E] $A6:D09E 60 RTS } ; Tail routine { $A6:D09F BD 20 20 LDA $2020,x[$7E:2020] $A6:D0A2 30 21 BMI $21 [$D0C5] $A6:D0A4 BD 2A 20 LDA $202A,x[$7E:202A] $A6:D0A7 4C 6D D1 JMP $D16D [$A6:D16D] $A6:D0AA 9E 20 20 STZ $2020,x[$7E:2020] $A6:D0AD 9E 22 20 STZ $2022,x[$7E:2022] $A6:D0B0 BD 24 20 LDA $2024,x[$7E:2024] $A6:D0B3 49 00 80 EOR #$8000 $A6:D0B6 9D 24 20 STA $2024,x[$7E:2024] $A6:D0B9 60 RTS $A6:D0BA BD 22 20 LDA $2022,x[$7E:2022] $A6:D0BD 18 CLC $A6:D0BE 6D 14 20 ADC $2014 [$7E:2014] $A6:D0C1 9D 22 20 STA $2022,x[$7E:2022] $A6:D0C4 60 RTS $A6:D0C5 BD 22 20 LDA $2022,x[$7E:2022] $A6:D0C8 CD 1E 20 CMP $201E [$7E:201E] $A6:D0CB 90 ED BCC $ED [$D0BA] $A6:D0CD C9 FF FF CMP #$FFFF $A6:D0D0 F0 12 BEQ $12 [$D0E4] $A6:D0D2 A9 FF FF LDA #$FFFF $A6:D0D5 9D 22 20 STA $2022,x[$7E:2022] $A6:D0D8 A9 00 80 LDA #$8000 $A6:D0DB 9D 34 20 STA $2034,x[$7E:2034] $A6:D0DE BD 24 20 LDA $2024,x[$7E:2024] $A6:D0E1 9D 38 20 STA $2038,x[$7E:2038] $A6:D0E4 BD 24 20 LDA $2024,x[$7E:2024] $A6:D0E7 30 3F BMI $3F [$D128] $A6:D0E9 AD 1C 20 LDA $201C [$7E:201C] $A6:D0EC 30 23 BMI $23 [$D111] $A6:D0EE A9 00 0C LDA #$0C00 $A6:D0F1 9D 28 20 STA $2028,x[$7E:208C] $A6:D0F4 BD 2A 20 LDA $202A,x[$7E:208E] $A6:D0F7 18 CLC $A6:D0F8 6D 14 20 ADC $2014 [$7E:2014] $A6:D0FB CD 1C 20 CMP $201C [$7E:201C] $A6:D0FE 30 6A BMI $6A [$D16A] $A6:D100 8A TXA $A6:D101 F0 05 BEQ $05 [$D108] $A6:D103 BD 0C 20 LDA $200C,x[$7E:2070] $A6:D106 D0 15 BNE $15 [$D11D] $A6:D108 AD 1C 20 LDA $201C [$7E:201C] $A6:D10B 9D 2A 20 STA $202A,x[$7E:202A] $A6:D10E 4C AA D0 JMP $D0AA [$A6:D0AA] $A6:D111 BD 2A 20 LDA $202A,x[$7E:202A] $A6:D114 18 CLC $A6:D115 6D 14 20 ADC $2014 [$7E:2014] $A6:D118 CD 18 20 CMP $2018 [$7E:2018] $A6:D11B 30 4D BMI $4D [$D16A] $A6:D11D A9 00 80 LDA #$8000 $A6:D120 9D 24 20 STA $2024,x[$7E:2024] $A6:D123 AD 18 20 LDA $2018 [$7E:2018] $A6:D126 80 42 BRA $42 [$D16A] $A6:D128 AD 1A 20 LDA $201A [$7E:201A] $A6:D12B 30 24 BMI $24 [$D151] $A6:D12D A9 00 0C LDA #$0C00 $A6:D130 9D 28 20 STA $2028,x[$7E:2064] $A6:D133 BD 2A 20 LDA $202A,x[$7E:2066] $A6:D136 38 SEC $A6:D137 ED 14 20 SBC $2014 [$7E:2014] $A6:D13A 3A DEC A $A6:D13B CD 1A 20 CMP $201A [$7E:201A] $A6:D13E 10 29 BPL $29 [$D169] $A6:D140 8A TXA $A6:D141 F0 05 BEQ $05 [$D148] $A6:D143 BD 0C 20 LDA $200C,x[$7E:2048] $A6:D146 D0 16 BNE $16 [$D15E] $A6:D148 AD 1A 20 LDA $201A [$7E:201A] $A6:D14B 9D 2A 20 STA $202A,x[$7E:202A] $A6:D14E 4C AA D0 JMP $D0AA [$A6:D0AA] $A6:D151 BD 2A 20 LDA $202A,x[$7E:202A] $A6:D154 38 SEC $A6:D155 ED 14 20 SBC $2014 [$7E:2014] $A6:D158 3A DEC A $A6:D159 CD 16 20 CMP $2016 [$7E:2016] $A6:D15C 10 0B BPL $0B [$D169] $A6:D15E A9 00 00 LDA #$0000 $A6:D161 9D 24 20 STA $2024,x[$7E:2024] $A6:D164 AD 16 20 LDA $2016 [$7E:2016] $A6:D167 80 01 BRA $01 [$D16A] $A6:D169 1A INC A $A6:D16A 9D 2A 20 STA $202A,x[$7E:202A] $A6:D16D 29 FF 00 AND #$00FF $A6:D170 85 12 STA $12 [$7E:0012] $A6:D172 8A TXA $A6:D173 F0 0B BEQ $0B [$D180] $A6:D175 A5 12 LDA $12 [$7E:0012] $A6:D177 18 CLC $A6:D178 7D 16 20 ADC $2016,x[$7E:202A] $A6:D17B 29 FF 00 AND #$00FF $A6:D17E 85 12 STA $12 [$7E:0012] $A6:D180 BD 26 20 LDA $2026,x[$7E:2026] $A6:D183 EB XBA $A6:D184 29 FF 00 AND #$00FF $A6:D187 22 60 C4 A9 JSL $A9C460[$A9:C460] $A6:D18B 9D 30 20 STA $2030,x[$7E:2030] $A6:D18E BD 26 20 LDA $2026,x[$7E:2026] $A6:D191 EB XBA $A6:D192 29 FF 00 AND #$00FF $A6:D195 22 65 C4 A9 JSL $A9C465[$A9:C465] $A6:D199 9D 32 20 STA $2032,x[$7E:2032] $A6:D19C 60 RTS } ; Tail routine: Target an angle (towards a missile or Samus) for tail. Note: Actual angle is actually twice the angle chosen, since each tail segment doubles it. Also, tail circles 2*A amount of times first { $A6:D19D 29 FF 00 AND #$00FF $A6:D1A0 EB XBA $A6:D1A1 8D 0A 20 STA $200A [$7E:200A] $A6:D1A4 AD 20 78 LDA $7820 [$7E:7820] $A6:D1A7 3A DEC A $A6:D1A8 F0 1B BEQ $1B [$D1C5] $A6:D1AA AD 02 78 LDA $7802 [$7E:7802] $A6:D1AD F0 16 BEQ $16 [$D1C5] $A6:D1AF 20 42 D2 JSR $D242 [$A6:D242] ; Tail: Target a missile/super missile if available $A6:D1B2 90 12 BCC $12 [$D1C6] $A6:D1C5 60 RTS $A6:D1C6 AD F6 0A LDA $0AF6 [$7E:0AF6] ; Samus' X position $A6:D1C9 38 SEC $A6:D1CA ED 2C 20 SBC $202C [$7E:202C] $A6:D1CD 85 12 STA $12 [$7E:0012] $A6:D1CF AD FA 0A LDA $0AFA [$7E:0AFA] ; Samus' Y position $A6:D1D2 18 CLC $A6:D1D3 69 18 00 ADC #$0018 $A6:D1D6 38 SEC $A6:D1D7 ED 2E 20 SBC $202E [$7E:202E] $A6:D1DA 85 14 STA $14 [$7E:0014] $A6:D1DC 8B PHB $A6:D1DD 4B PHK $A6:D1DE AB PLB $A6:D1DF 22 AE C0 A0 JSL $A0C0AE[$A0:C0AE] $A6:D1E3 AB PLB $A6:D1E4 38 SEC $A6:D1E5 E9 80 00 SBC #$0080 $A6:D1E8 49 FF FF EOR #$FFFF $A6:D1EB 1A INC A $A6:D1EC 29 FF 00 AND #$00FF $A6:D1EF 85 12 STA $12 [$7E:0012] $A6:D1F1 AD 20 78 LDA $7820 [$7E:7820] $A6:D1F4 D0 26 BNE $26 [$D21C] $A6:D1F6 A5 12 LDA $12 [$7E:0012] $A6:D1F8 C9 18 00 CMP #$0018 $A6:D1FB 90 08 BCC $08 [$D205] $A6:D1FD C9 E8 00 CMP #$00E8 $A6:D200 B0 03 BCS $03 [$D205] $A6:D202 A9 E8 00 LDA #$00E8 $A6:D205 18 CLC $A6:D206 69 00 3F ADC #$3F00 $A6:D209 38 SEC $A6:D20A ED 0A 20 SBC $200A [$7E:200A] $A6:D20D CD 2A 20 CMP $202A [$7E:202A] $A6:D210 B0 09 BCS $09 [$D21B] $A6:D212 8D 1A 20 STA $201A [$7E:201A] $A6:D215 A9 08 00 LDA #$0008 $A6:D218 8D 14 20 STA $2014 [$7E:2014] $A6:D21B 60 RTS $A6:D21C A5 12 LDA $12 [$7E:0012] $A6:D21E C9 18 00 CMP #$0018 $A6:D221 90 08 BCC $08 [$D22B] $A6:D223 C9 E8 00 CMP #$00E8 $A6:D226 B0 03 BCS $03 [$D22B] $A6:D22B 18 CLC $A6:D22C 69 00 40 ADC #$4000 $A6:D22F 18 CLC $A6:D230 6D 0A 20 ADC $200A [$7E:200A] $A6:D233 CD 2A 20 CMP $202A [$7E:202A] $A6:D236 90 09 BCC $09 [$D241] $A6:D238 8D 1C 20 STA $201C [$7E:201C] $A6:D23B A9 08 00 LDA #$0008 $A6:D23E 8D 14 20 STA $2014 [$7E:2014] $A6:D241 60 RTS } ; Tail routine: Target a missile/super missile if available { $A6:D242 AD A4 20 LDA $20A4 [$7E:20A4] $A6:D245 85 12 STA $12 [$7E:0012] $A6:D247 AD A6 20 LDA $20A6 [$7E:20A6] $A6:D24A 85 14 STA $14 [$7E:0014] $A6:D24C A9 40 00 LDA #$0040 $A6:D24F 85 16 STA $16 [$7E:0016] $A6:D251 85 18 STA $18 [$7E:0018] $A6:D253 AD CE 0C LDA $0CCE [$7E:0CCE] $A6:D256 D0 02 BNE $02 [$D25A] $A6:D258 18 CLC $A6:D259 60 RTS $A6:D25A A0 00 00 LDY #$0000 $A6:D25D B9 19 0C LDA $0C19,y[$7E:0C19] $A6:D260 29 0F 00 AND #$000F $A6:D263 3A DEC A $A6:D264 F0 03 BEQ $03 [$D269] $A6:D266 3A DEC A $A6:D267 D0 2C BNE $2C [$D295] $A6:D269 B9 64 0B LDA $0B64,y[$7E:0B66] $A6:D26C 38 SEC $A6:D26D E5 12 SBC $12 [$7E:0012] $A6:D26F 10 04 BPL $04 [$D275] $A6:D271 49 FF FF EOR #$FFFF $A6:D274 1A INC A $A6:D275 38 SEC $A6:D276 F9 B4 0B SBC $0BB4,y[$7E:0BB6] $A6:D279 90 04 BCC $04 [$D27F] $A6:D27B C5 16 CMP $16 [$7E:0016] $A6:D27D B0 16 BCS $16 [$D295] $A6:D295 C8 INY $A6:D296 C8 INY $A6:D297 C0 0A 00 CPY #$000A $A6:D29A 30 C1 BMI $C1 [$D25D] $A6:D29C 18 CLC $A6:D29D 60 RTS } ; Tail routine: Play swishing sound if tail is moving fast { $A6:D2AA AF 14 20 7E LDA $7E2014[$7E:2014] ; Tail rotational speed $A6:D2AE C9 08 00 CMP #$0008 $A6:D2B1 30 1B BMI $1B [$D2CE] $A6:D2B3 AF 1C 78 7E LDA $7E781C[$7E:781C] $A6:D2B7 1A INC A $A6:D2B8 8F 1C 78 7E STA $7E781C[$7E:781C] $A6:D2BC C9 10 00 CMP #$0010 $A6:D2BF 30 14 BMI $14 [$D2D5] $A6:D2C1 AF 1E 78 7E LDA $7E781E[$7E:781E] $A6:D2C5 D0 07 BNE $07 [$D2CE] $A6:D2C7 A9 21 00 LDA #$0021 $A6:D2CA 22 4D 91 80 JSL $80914D[$80:914D] $A6:D2CE A9 00 00 LDA #$0000 $A6:D2D1 8F 1C 78 7E STA $7E781C[$7E:781C] $A6:D2D5 60 RTS } ; Tail routine: Initialize stuff { $A6:D2D6 A9 01 00 LDA #$0001 $A6:D2D9 8F 14 20 7E STA $7E2014[$7E:2014] ; Tail rotational speed $A6:D2DD A9 F0 3F LDA #$3FF0 $A6:D2E0 8F 16 20 7E STA $7E2016[$7E:2016] $A6:D2E4 A9 40 40 LDA #$4040 $A6:D2E7 8F 18 20 7E STA $7E2018[$7E:2018] $A6:D2EB A9 FF FF LDA #$FFFF $A6:D2EE 8F 1A 20 7E STA $7E201A[$7E:201A] $A6:D2F2 8F 1C 20 7E STA $7E201C[$7E:201C] $A6:D2F6 A9 F0 00 LDA #$00F0 $A6:D2F9 8F 12 20 7E STA $7E2012[$7E:2012] ; Tail extension rate $A6:D2FD A9 10 00 LDA #$0010 $A6:D300 8F 1E 20 7E STA $7E201E[$7E:201E] ; Tail movement threshold $A6:D304 1A INC A $A6:D305 8F 22 20 7E STA $7E2022[$7E:2022] $A6:D309 8F 36 20 7E STA $7E2036[$7E:2036] $A6:D30D 8F 4A 20 7E STA $7E204A[$7E:204A] $A6:D311 8F 5E 20 7E STA $7E205E[$7E:205E] $A6:D315 8F 72 20 7E STA $7E2072[$7E:2072] $A6:D319 8F 86 20 7E STA $7E2086[$7E:2086] $A6:D31D 8F 9A 20 7E STA $7E209A[$7E:209A] $A6:D321 A2 6E D3 LDX #$D36E $A6:D324 A0 24 20 LDY #$2024 $A6:D327 20 B4 D3 JSR $D3B4 [$A6:D3B4] ; Copy 7 entries from (X) to 7E:(Y), 7E:(Y+14), 7E:(Y+28), 7E:(Y+3C), etc. $A6:D32A A2 7C D3 LDX #$D37C $A6:D32D A0 26 20 LDY #$2026 $A6:D330 20 B4 D3 JSR $D3B4 [$A6:D3B4] ; Copy 7 entries from (X) to 7E:(Y), 7E:(Y+14), 7E:(Y+28), 7E:(Y+3C), etc. $A6:D333 A2 8A D3 LDX #$D38A $A6:D336 A0 2A 20 LDY #$202A $A6:D339 20 B4 D3 JSR $D3B4 [$A6:D3B4] ; Copy 7 entries from (X) to 7E:(Y), 7E:(Y+14), 7E:(Y+28), 7E:(Y+3C), etc. $A6:D33C A2 98 D3 LDX #$D398 $A6:D33F A0 2C 20 LDY #$202C $A6:D342 20 B4 D3 JSR $D3B4 [$A6:D3B4] ; Copy 7 entries from (X) to 7E:(Y), 7E:(Y+14), 7E:(Y+28), 7E:(Y+3C), etc. $A6:D345 A2 A6 D3 LDX #$D3A6 $A6:D348 A0 2E 20 LDY #$202E $A6:D34B 20 B4 D3 JSR $D3B4 [$A6:D3B4] ; Copy 7 entries from (X) to 7E:(Y), 7E:(Y+14), 7E:(Y+28), 7E:(Y+3C), etc. $A6:D34E A9 00 00 LDA #$0000 $A6:D351 8F 20 20 7E STA $7E2020[$7E:2020] ; Tail 1 $A6:D355 8F 34 20 7E STA $7E2034[$7E:2034] ; Tail 2 $A6:D359 8F 48 20 7E STA $7E2048[$7E:2048] ; Tail 3 $A6:D35D 8F 5C 20 7E STA $7E205C[$7E:205C] ; Tail 4 $A6:D361 8F 70 20 7E STA $7E2070[$7E:2070] ; Tail 5 $A6:D365 8F 84 20 7E STA $7E2084[$7E:2084] ; Tail 6 $A6:D369 8F 98 20 7E STA $7E2098[$7E:2098] ; Tail 7 $A6:D36D 60 RTS } $A6:D36E db 00, 80, 00, 80, 00, 80, 00, 80, 00, 80, 00, 80, 00, 80, 00, 02, 00, 08, 00, 08, 00, 08, 00, 08, 00, 08, 00, 05, 00, 40, 10, 40, 20, 40, 30, 40, 40, 40, 50, 40, 60, 40, 00, 00, 03, 00, 07, 00, 07, 00, 03, 00, FD, FF, FC, FF, 02, 00, 07, 00, 03, 00, FD, FF, F9, FF, F9, FF, FF, FF ; Tail routine: Copy 7 entries from (X) to 7E:(Y), 7E:(Y+14), 7E:(Y+28), 7E:(Y+3C), etc. { $A6:D3B4 A9 7E 00 LDA #$007E $A6:D3B7 85 14 STA $14 [$7E:0014] $A6:D3B9 84 12 STY $12 [$7E:0012] $A6:D3BB A0 00 00 LDY #$0000 $A6:D3BE A9 07 00 LDA #$0007 $A6:D3C1 48 PHA $A6:D3C2 BD 00 00 LDA $0000,x[$A6:D36E] $A6:D3C5 97 12 STA [$12],y[$7E:2024] $A6:D3C7 E8 INX $A6:D3C8 E8 INX $A6:D3C9 98 TYA $A6:D3CA 18 CLC $A6:D3CB 69 14 00 ADC #$0014 $A6:D3CE A8 TAY $A6:D3CF 68 PLA $A6:D3D0 3A DEC A $A6:D3D1 D0 EE BNE $EE [$D3C1] $A6:D3D3 60 RTS } ; Tail routine: Set all tail parts to moving { $A6:D3D9 A9 00 80 LDA #$8000 $A6:D3DC 8F 20 20 7E STA $7E2020[$7E:2020] ; Tail 1 $A6:D3E0 8F 34 20 7E STA $7E2034[$7E:2034] ; Tail 2 $A6:D3E4 8F 48 20 7E STA $7E2048[$7E:2048] ; Tail 3 $A6:D3E8 8F 5C 20 7E STA $7E205C[$7E:205C] ; Tail 4 $A6:D3EC 8F 70 20 7E STA $7E2070[$7E:2070] ; Tail 5 $A6:D3F0 8F 84 20 7E STA $7E2084[$7E:2084] ; Tail 6 $A6:D3F4 8F 98 20 7E STA $7E2098[$7E:2098] ; Tail 7 $A6:D3F8 60 RTS } ; Tail routine: Tail/Samus interaction { $A6:DFD9 A9 0E 00 LDA #$000E $A6:DFDC 85 16 STA $16 [$7E:0016] $A6:DFDE 85 18 STA $18 [$7E:0018] $A6:DFE0 AF A4 20 7E LDA $7E20A4[$7E:20A4] ; Tail tip X position $A6:DFE4 85 12 STA $12 [$7E:0012] $A6:DFE6 AF A6 20 7E LDA $7E20A6[$7E:20A6] ; Tail tip Y position $A6:DFEA 85 14 STA $14 [$7E:0014] $A6:DFEC 20 29 DF JSR $DF29 [$A6:DF29] ; Efficient collision detection for Samus and $12/$14 (size of $12/$14 is $16/$18). SEC if collision $A6:DFEF 90 29 BCC $29 [$E01A] $A6:DFF1 AF 38 78 7E LDA $7E7838[$7E:7838] $A6:DFF5 22 5E A4 A0 JSL $A0A45E[$A0:A45E] $A6:DFF9 22 51 DF 91 JSL $91DF51[$91:DF51] $A6:DFFD A9 60 00 LDA #$0060 $A6:E000 8D A8 18 STA $18A8 [$7E:18A8] $A6:E003 A9 05 00 LDA #$0005 $A6:E006 8D AA 18 STA $18AA [$7E:18AA] $A6:E009 A0 00 00 LDY #$0000 $A6:E00C AD F6 0A LDA $0AF6 [$7E:0AF6] ; Samus' X position $A6:E00F 38 SEC $A6:E010 EF A4 20 7E SBC $7E20A4[$7E:20A4] ; Tail tip X position $A6:E014 30 01 BMI $01 [$E017] $A6:E016 C8 INY $A6:E017 8C 54 0A STY $0A54 [$7E:0A54] $A6:E01A 60 RTS } ; Tail routine: Tail tip kills projectiles { $A6:E088 AD 86 0F LDA $0F86 [$7E:0F86] ; Property bits of Ridley $A6:E08B 29 00 04 AND #$0400 $A6:E08E F0 01 BEQ $01 [$E091] $A6:E090 60 RTS $A6:E091 A9 0E 00 LDA #$000E $A6:E094 85 16 STA $16 [$7E:0016] $A6:E096 85 18 STA $18 [$7E:0018] $A6:E098 AF A4 20 7E LDA $7E20A4[$7E:20A4] ; Tail tip X position $A6:E09C 85 12 STA $12 [$7E:0012] $A6:E09E AF A6 20 7E LDA $7E20A6[$7E:20A6] ; Tail tip Y position $A6:E0A2 85 14 STA $14 [$7E:0014] $A6:E0A4 20 A6 DE JSR $DEA6 [$A6:DEA6] ; Check Tail/Projectile collisions $A6:E0A7 B0 7D BCS $7D [$E126] $A6:E0A9 A9 0A 00 LDA #$000A $A6:E0AC 85 16 STA $16 [$7E:0016] $A6:E0AE 85 18 STA $18 [$7E:0018] $A6:E0B0 AF 90 20 7E LDA $7E2090[$7E:2090] $A6:E0B4 85 12 STA $12 [$7E:0012] $A6:E0B6 AF 92 20 7E LDA $7E2092[$7E:2092] $A6:E0BA 85 14 STA $14 [$7E:0014] $A6:E0BC 20 A6 DE JSR $DEA6 [$A6:DEA6] ; Check Tail/Projectile collisions $A6:E0BF B0 65 BCS $65 [$E126] $A6:E0C1 60 RTS $A6:E126 B9 64 0B LDA $0B64,y[$7E:0B64] $A6:E129 85 12 STA $12 [$7E:0012] $A6:E12B B9 78 0B LDA $0B78,y[$7E:0B78] $A6:E12E 85 14 STA $14 [$7E:0014] $A6:E130 B9 19 0C LDA $0C19,y[$7E:0C19] $A6:E133 29 0F 00 AND #$000F $A6:E136 A0 0C 00 LDY #$000C $A6:E139 3A DEC A $A6:E13A D0 0A BNE $0A [$E146] $A6:E13C A9 3D 00 LDA #$003D $A6:E13F 22 49 90 80 JSL $809049[$80:9049] $A6:E143 A0 06 00 LDY #$0006 $A6:E146 98 TYA $A6:E147 A0 09 E5 LDY #$E509 $A6:E14A 22 97 80 86 JSL $868097[$86:8097] $A6:E14E 60 RTS }