; $C696: Initialisation AI - enemy $E1BF (Ridley's explosion) { $A6:C696 AE 54 0E LDX $0E54 [$7E:0E54] $A6:C699 A9 01 00 LDA #$0001 $A6:C69C 9D 94 0F STA $0F94,x[$7E:0FD4] $A6:C69F 9E 90 0F STZ $0F90,x[$7E:0FD0] $A6:C6A2 9E 98 0F STZ $0F98,x[$7E:0FD8] $A6:C6A5 A9 00 0E LDA #$0E00 $A6:C6A8 9D 96 0F STA $0F96,x[$7E:0FD6] ; Palette $A6:C6AB BC B4 0F LDY $0FB4,x[$7E:0FF4] $A6:C6AE B9 CE C6 LDA $C6CE,y[$A6:C6DA] $A6:C6B1 9D B2 0F STA $0FB2,x[$7E:0FF2] ; Counter $A6:C6B4 22 11 81 80 JSL $808111[$80:8111] $A6:C6B8 29 30 01 AND #$0130 $A6:C6BB 2C E5 05 BIT $05E5 [$7E:05E5] $A6:C6BE 10 04 BPL $04 [$C6C4] $A6:C6C0 49 FF FF EOR #$FFFF $A6:C6C3 1A INC A $A6:C6C4 9D AA 0F STA $0FAA,x[$7E:0FEA] ; X speed (1/100 pixels) $A6:C6C7 9E AC 0F STZ $0FAC,x[$7E:0FEC] ; Y speed (1/100 pixels) $A6:C6CA BB TYX $A6:C6CB 7C E6 C6 JMP ($C6E6,x)[$A6:C78E] $A6:C6CE dw 0048, 0050, 0058, 0060, 0068, 0070, 0078, 0028, 0030, 0038, 0080, 0040 $A6:C6E6 dw C6FE, C716, C72E, C746, C75E, C776, C78E, C7DA, C80C, C83E, C870, C8A2 } ; Explosion routine? { $A6:C6FE AE 54 0E LDX $0E54 [$7E:0E54] $A6:C701 AF 2C 20 7E LDA $7E202C[$7E:202C] $A6:C705 9D 7A 0F STA $0F7A,x[$7E:113A] ; Ridley's X position $A6:C708 AF 2E 20 7E LDA $7E202E[$7E:202E] $A6:C70C 9D 7E 0F STA $0F7E,x[$7E:113E] ; Ridley's Y position $A6:C70F A9 47 CA LDA #$CA47 $A6:C712 9D 92 0F STA $0F92,x[$7E:1152] ; PLM instructions $A6:C715 6B RTL } ; Explosion routine? { $A6:C716 AE 54 0E LDX $0E54 [$7E:0E54] $A6:C719 AF 40 20 7E LDA $7E2040[$7E:2040] $A6:C71D 9D 7A 0F STA $0F7A,x[$7E:10FA] ; Ridley's X position $A6:C720 AF 42 20 7E LDA $7E2042[$7E:2042] $A6:C724 9D 7E 0F STA $0F7E,x[$7E:10FE] ; Ridley's Y position $A6:C727 A9 47 CA LDA #$CA47 $A6:C72A 9D 92 0F STA $0F92,x[$7E:1112] ; PLM instructions $A6:C72D 6B RTL } ; Explosion routine? { $A6:C72E AE 54 0E LDX $0E54 [$7E:0E54] $A6:C731 AF 54 20 7E LDA $7E2054[$7E:2054] $A6:C735 9D 7A 0F STA $0F7A,x[$7E:10BA] ; Ridley's X position $A6:C738 AF 56 20 7E LDA $7E2056[$7E:2056] $A6:C73C 9D 7E 0F STA $0F7E,x[$7E:10BE] ; Ridley's Y position $A6:C73F A9 4D CA LDA #$CA4D $A6:C742 9D 92 0F STA $0F92,x[$7E:10D2] ; PLM instructions $A6:C745 6B RTL } ; Explosion routine? { $A6:C746 AE 54 0E LDX $0E54 [$7E:0E54] $A6:C749 AF 68 20 7E LDA $7E2068[$7E:2068] $A6:C74D 9D 7A 0F STA $0F7A,x[$7E:107A] ; Ridley's X position $A6:C750 AF 6A 20 7E LDA $7E206A[$7E:206A] $A6:C754 9D 7E 0F STA $0F7E,x[$7E:107E] ; Ridley's Y position $A6:C757 A9 4D CA LDA #$CA4D $A6:C75A 9D 92 0F STA $0F92,x[$7E:1092] ; PLM instructions $A6:C75D 6B RTL } ; Explosion routine? { $A6:C75E AE 54 0E LDX $0E54 [$7E:0E54] $A6:C761 AF 7C 20 7E LDA $7E207C[$7E:207C] $A6:C765 9D 7A 0F STA $0F7A,x[$7E:103A] ; Ridley's X position $A6:C768 AF 7E 20 7E LDA $7E207E[$7E:207E] $A6:C76C 9D 7E 0F STA $0F7E,x[$7E:103E] ; Ridley's Y position $A6:C76F A9 53 CA LDA #$CA53 $A6:C772 9D 92 0F STA $0F92,x[$7E:1052] ; PLM instructions $A6:C775 6B RTL } ; Explosion routine? { $A6:C776 AE 54 0E LDX $0E54 [$7E:0E54] $A6:C779 AF 90 20 7E LDA $7E2090[$7E:2090] $A6:C77D 9D 7A 0F STA $0F7A,x[$7E:0FFA] ; Ridley's X position $A6:C780 AF 92 20 7E LDA $7E2092[$7E:2092] $A6:C784 9D 7E 0F STA $0F7E,x[$7E:0FFE] ; Ridley's Y position $A6:C787 A9 53 CA LDA #$CA53 $A6:C78A 9D 92 0F STA $0F92,x[$7E:1012] ; PLM instructions $A6:C78D 6B RTL } ; Explosion routine? { $A6:C78E AE 54 0E LDX $0E54 [$7E:0E54] $A6:C791 AF A4 20 7E LDA $7E20A4[$7E:20A4] ; Tail tip X position $A6:C795 9D 7A 0F STA $0F7A,x[$7E:0FBA] ; Ridley's X position $A6:C798 AF A6 20 7E LDA $7E20A6[$7E:20A6] ; Tail tip Y position $A6:C79C 9D 7E 0F STA $0F7E,x[$7E:0FBE] ; Ridley's Y position $A6:C79F AF A2 20 7E LDA $7E20A2[$7E:20A2] $A6:C7A3 18 CLC $A6:C7A4 6F 8E 20 7E ADC $7E208E[$7E:208E] $A6:C7A8 18 CLC $A6:C7A9 69 08 00 ADC #$0008 $A6:C7AC 29 F0 00 AND #$00F0 $A6:C7AF 4A LSR A $A6:C7B0 4A LSR A $A6:C7B1 4A LSR A $A6:C7B2 A8 TAY $A6:C7B3 B9 BA C7 LDA $C7BA,y[$A6:C7BC] $A6:C7B6 9D 92 0F STA $0F92,x[$7E:0FD2] ; PLM instructions $A6:C7B9 6B RTL $A6:C7BC db 9B, CA } ; Explosion routine? { $A6:C7DA A0 00 00 LDY #$0000 $A6:C7DD AF 20 78 7E LDA $7E7820[$7E:7820] ; Ridley's direction (0 = left, 2 = right) $A6:C7E1 F0 03 BEQ $03 [$C7E6] $A6:C7E3 A0 02 00 LDY #$0002 $A6:C7E6 AE 54 0E LDX $0E54 [$7E:0E54] $A6:C7E9 B9 04 C8 LDA $C804,y[$A6:C806] $A6:C7EC 18 CLC $A6:C7ED 6D 7A 0F ADC $0F7A [$7E:0F7A] ; Ridley's X position $A6:C7F0 9D 7A 0F STA $0F7A,x[$7E:117A] ; Ridley's X position $A6:C7F3 A9 00 00 LDA #$0000 $A6:C7F6 18 CLC $A6:C7F7 6D 7E 0F ADC $0F7E [$7E:0F7E] ; Ridley's Y position $A6:C7FA 9D 7E 0F STA $0F7E,x[$7E:117E] ; Ridley's Y position $A6:C7FD B9 08 C8 LDA $C808,y[$A6:C80A] $A6:C800 9D 92 0F STA $0F92,x[$7E:1192] ; PLM instructions $A6:C803 6B RTL $A6:C806 db 00, 00 $A6:C80A db 5F, CA } ; Explosion routine? { $A6:C80C A0 00 00 LDY #$0000 $A6:C80F AF 20 78 7E LDA $7E7820[$7E:7820] ; Ridley's direction (0 = left, 2 = right) $A6:C813 F0 03 BEQ $03 [$C818] $A6:C815 A0 02 00 LDY #$0002 $A6:C818 AE 54 0E LDX $0E54 [$7E:0E54] $A6:C81B B9 36 C8 LDA $C836,y[$A6:C838] $A6:C81E 18 CLC $A6:C81F 6D 7A 0F ADC $0F7A [$7E:0F7A] ; Ridley's X position $A6:C822 9D 7A 0F STA $0F7A,x[$7E:11BA] ; Ridley's X position $A6:C825 A9 16 00 LDA #$0016 $A6:C828 18 CLC $A6:C829 6D 7E 0F ADC $0F7E [$7E:0F7E] ; Ridley's Y position $A6:C82C 9D 7E 0F STA $0F7E,x[$7E:11BE] ; Ridley's Y position $A6:C82F B9 3A C8 LDA $C83A,y[$A6:C83C] $A6:C832 9D 92 0F STA $0F92,x[$7E:11D2] ; PLM instructions $A6:C835 6B RTL $A6:C838 db F1, FF $A6:C83C db 6B, CA } ; Explosion routine? { $A6:C83E A0 00 00 LDY #$0000 $A6:C841 AF 20 78 7E LDA $7E7820[$7E:7820] ; Ridley's direction (0 = left, 2 = right) $A6:C845 F0 03 BEQ $03 [$C84A] $A6:C847 A0 02 00 LDY #$0002 $A6:C84A AE 54 0E LDX $0E54 [$7E:0E54] $A6:C84D B9 68 C8 LDA $C868,y[$A6:C86A] $A6:C850 18 CLC $A6:C851 6D 7A 0F ADC $0F7A [$7E:0F7A] ; Ridley's X position $A6:C854 9D 7A 0F STA $0F7A,x[$7E:123A] ; Ridley's X position $A6:C857 A9 E8 FF LDA #$FFE8 $A6:C85A 18 CLC $A6:C85B 6D 7E 0F ADC $0F7E [$7E:0F7E] ; Ridley's Y position $A6:C85E 9D 7E 0F STA $0F7E,x[$7E:123E] ; Ridley's Y position $A6:C861 B9 6C C8 LDA $C86C,y[$A6:C86E] $A6:C864 9D 92 0F STA $0F92,x[$7E:1252] ; PLM instructions $A6:C867 6B RTL $A6:C86A db 03, 00 $A6:C86E db 77, CA } ; Explosion routine? { $A6:C870 A0 00 00 LDY #$0000 $A6:C873 AF 20 78 7E LDA $7E7820[$7E:7820] ; Ridley's direction (0 = left, 2 = right) $A6:C877 F0 03 BEQ $03 [$C87C] $A6:C879 A0 02 00 LDY #$0002 $A6:C87C AE 54 0E LDX $0E54 [$7E:0E54] $A6:C87F B9 9A C8 LDA $C89A,y[$A6:C89C] $A6:C882 18 CLC $A6:C883 6D 7A 0F ADC $0F7A [$7E:0F7A] ; Ridley's X position $A6:C886 9D 7A 0F STA $0F7A,x[$7E:11FA] ; Ridley's X position $A6:C889 A9 00 00 LDA #$0000 $A6:C88C 18 CLC $A6:C88D 6D 7E 0F ADC $0F7E [$7E:0F7E] ; Ridley's Y position $A6:C890 9D 7E 0F STA $0F7E,x[$7E:11FE] ; Ridley's Y position $A6:C893 B9 9E C8 LDA $C89E,y[$A6:C8A0] $A6:C896 9D 92 0F STA $0F92,x[$7E:1212] ; PLM instructions $A6:C899 6B RTL $A6:C89C db F0, FF $A6:C8A0 db 83, CA } ; Explosion routine? { $A6:C8A2 A0 00 00 LDY #$0000 $A6:C8A5 AF 20 78 7E LDA $7E7820[$7E:7820] ; Ridley's direction (0 = left, 2 = right) $A6:C8A9 F0 03 BEQ $03 [$C8AE] $A6:C8AB A0 02 00 LDY #$0002 $A6:C8AE AE 54 0E LDX $0E54 [$7E:0E54] $A6:C8B1 B9 CC C8 LDA $C8CC,y[$A6:C8CE] $A6:C8B4 18 CLC $A6:C8B5 6D 7A 0F ADC $0F7A [$7E:0F7A] ; Ridley's X position $A6:C8B8 9D 7A 0F STA $0F7A,x[$7E:127A] ; Ridley's X position $A6:C8BB A9 07 00 LDA #$0007 $A6:C8BE 18 CLC $A6:C8BF 6D 7E 0F ADC $0F7E [$7E:0F7E] ; Ridley's Y position $A6:C8C2 9D 7E 0F STA $0F7E,x[$7E:127E] ; Ridley's Y position $A6:C8C5 B9 D0 C8 LDA $C8D0,y[$A6:C8D2] $A6:C8C8 9D 92 0F STA $0F92,x[$7E:1292] ; PLM instructions $A6:C8CB 6B RTL $A6:C8CE db F8, FF $A6:C8D2 db 8F, CA } ; $C8D4: Main AI - enemy $E1BF (Ridley's explosion) { $A6:C8D4 AE 54 0E LDX $0E54 [$7E:0E54] $A6:C8D7 20 13 C9 JSR $C913 [$A6:C913] $A6:C8DA BD AA 0F LDA $0FAA,x[$7E:0FEA] ; X speed (1/100 pixels) $A6:C8DD 10 04 BPL $04 [$C8E3] $A6:C8DF 49 FF FF EOR #$FFFF $A6:C8E2 1A INC A $A6:C8E3 18 CLC $A6:C8E4 69 FC FF ADC #$FFFC $A6:C8E7 10 03 BPL $03 [$C8EC] $A6:C8E9 A9 00 00 LDA #$0000 $A6:C8EC 3C AA 0F BIT $0FAA,x[$7E:0FEA] ; X speed (1/100 pixels) $A6:C8EF 10 04 BPL $04 [$C8F5] $A6:C8F1 49 FF FF EOR #$FFFF $A6:C8F4 1A INC A $A6:C8F5 9D AA 0F STA $0FAA,x[$7E:0FEA] ; X speed (1/100 pixels) $A6:C8F8 BD AC 0F LDA $0FAC,x[$7E:0FEC] ; Y speed (1/100 pixels) $A6:C8FB 18 CLC $A6:C8FC 69 04 00 ADC #$0004 $A6:C8FF 9D AC 0F STA $0FAC,x[$7E:0FEC] ; Y speed (1/100 pixels) $A6:C902 22 EF C3 A9 JSL $A9C3EF[$A9:C3EF] $A6:C906 DE B2 0F DEC $0FB2,x[$7E:0FF2] ; Counter $A6:C909 10 07 BPL $07 [$C912] $A6:C90B A9 00 00 LDA #$0000 $A6:C90E 5C AF A3 A0 JMP $A0A3AF[$A0:A3AF] $A6:C912 6B RTL } ; Routine: Something to do with Ridley's explision { $A6:C913 BD A4 0F LDA $0FA4,x[$7E:0FE4] $A6:C916 29 01 00 AND #$0001 $A6:C919 9D A4 0F STA $0FA4,x[$7E:0FE4] $A6:C91C F0 0A BEQ $0A [$C928] $A6:C91E BD 86 0F LDA $0F86,x[$7E:0FC6] ; Property bits of Ridley $A6:C921 09 00 01 ORA #$0100 $A6:C924 9D 86 0F STA $0F86,x[$7E:0FC6] ; Property bits of Ridley $A6:C927 60 RTS $A6:C928 BD 86 0F LDA $0F86,x[$7E:0FC6] ; Property bits of Ridley $A6:C92B 29 FF FE AND #$FEFF $A6:C92E 9D 86 0F STA $0F86,x[$7E:0FC6] ; Property bits of Ridley $A6:C931 60 RTS } ; Routine: Spawn individual parts from Ridley to fly off { $A6:C932 A2 E7 C9 LDX #$C9E7 $A6:C935 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C939 A2 D7 C9 LDX #$C9D7 $A6:C93C 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C940 A2 C7 C9 LDX #$C9C7 $A6:C943 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C947 A2 B7 C9 LDX #$C9B7 $A6:C94A 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C94E A2 A7 C9 LDX #$C9A7 $A6:C951 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C955 A2 97 C9 LDX #$C997 $A6:C958 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C95C A2 87 C9 LDX #$C987 $A6:C95F 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C963 A2 F7 C9 LDX #$C9F7 $A6:C966 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C96A A2 07 CA LDX #$CA07 $A6:C96D 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C971 A2 27 CA LDX #$CA27 $A6:C974 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C978 A2 17 CA LDX #$CA17 $A6:C97B 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C97F A2 37 CA LDX #$CA37 $A6:C982 22 75 92 A0 JSL $A09275[$A0:9275] $A6:C986 60 RTS $A6:C987 db BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 00, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 02, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 04, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 06, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 08, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 0A, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 0C, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 0E, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 10, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 12, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 14, 00, 00, 00, BF, E1, 00, 00, 00, 00, 00, 00, 00, 2C, 00, 00, 16, 00, 00, 00, 01, 00, 90, DC, 2F, 81, 01, 00, 97, DC, 2F, 81, 01, 00, 9E, DC, 2F, 81 }