Data Table for STOKE 0004 1289 1400 2800 0800 0800 A2 00 5300 0000 AD89 0100 0000 F089 0F80 4C80 4180 0000 0000 00000000 0000 000000000000 2380 2D80 0000 00D0AC 05 B6F3 1CEC 5DE1 tile pal hp dmg wide high | | hurt Boss AI Part Norm Grap Hurt Froz XRay die PB Tch. Beam | | | | | get ptr | | snd. num Init Cnt. Move AI AI AI or anim Pntr Pntr Pntr | | | | | lgth Bank Ptr | 0=>1 AI? Rsrv | | | | | ??? | AI Tile Pointr | | | | # of "hurt" frames 0=>4 background/foreground | | | pointer to enemy drop chances | | pointer to enemy resistances | name pointer Issues: AI Incomplete - does not interact with slopes or cliff edges Bad Palette Notes: Ideal speed (Speed2) value is between 2 & 4, IMHO Orientation (Speed) is 0000 for left, 0001 for right AI Initialization (A2:89AD => 11:09AD) AE 54 0E LDX $0E54 ;Enemy Index A9 4D 80 LDA #$804D ;Load the number 32845 9D 8E 0F STA $0F8E ;Store the AI Handler BD B6 0F LDA $0FB6 ;Load Speed2 0A ASL A ;Speed2 x 2 0A ASL A ;Speed2 x 4 0A ASL A ;Speed2 x 8 A8 TAY ;Flip this to Y B9 87 81 LDA $8187, Y ; Load something and add Y to it 9D AA 0F STA $0FAA ; Then store it here B9 89 81 LDA $8189, Y ; Load something else, add Y 9D A8 0F STA $0FA8 ; Put that here B9 8B 81 LDA $818B, Y ; 9D AE 0F STA $0FAE ; I'm seeing a pattern here... B9 8D 81 LDA $818D, Y ; (Not sure what is being loaded here though) 9D AC 0F STA $0FAC ; 20 F7 89 JSR $89F7 ; $1109F7 IN ROM A9 43 8A LDA #$8A43 ; Load the number 35395 9D B2 0F STA $0FB2 ; BD B4 0F LDA $0FB4 ;Load Speed 9D B0 0F STA $0FB0 ;Custom use, orientation is likely candidate F0 09 BEQ BRANCH_ALPHA; What was compared?? 20 1D 8A JSR $8A1D ; $110A1D IN ROM A9 5C 8A LDA #$8A5C ; Load the number 35420 9D B2 0F STA $0FB2 ; BRANCH_ALPHA 6B RTL $1109F7 AE 54 0E LDX $0E54 ;Enemy Index A9 01 00 LDA #$0001 ;Load the number 1 9D 94 0F STA $0F94 ;Store it here (action delay byte?) 9E 90 0F STZ $0F90, X ; A9 32 89 LDA #$8932 ; Load the number 35122 9D 92 0F STA $0F92 ; 60 RTS $110A0A AE 54 0E LDX $0E54 ;Enemy Index A9 01 00 LDA #$0001 ;Load the number 1 9D 94 0F STA $0F94 ; 9E 90 0F STZ $0F90, X ; A9 48 89 LDA #$8948 ; Load the number 35144 9D 92 0F STA $0F92 ; 60 RTS $110A1D AE 54 0E LDX $0E54 ;Enemy Index A9 01 00 LDA #$0001 ;Load the number 1 9D 94 0F STA $0F94 ; 9E 90 0F STZ $0F90, X ; A9 58 89 LDA #$8958 ; Load the number 35160 9D 92 0F STA $0F92 ; 60 RTS $110A30 AE 54 0E LDX $0E54 ;Enemy Index A9 01 00 LDA #$0001 ;Load the number 1 9D 94 0F STA $0F94 ; 9E 90 0F STZ $0F90, X ; A9 6E 89 LDA #$896E ; Load the number 35182 9D 92 0F STA $0F92 ; Store it here 60 RTS $110A43 AE 54 0E LDX $0E54 ;Enemy Index BD AE 0F LDA $0FAE ; 85 14 STA $14 BD AC 0F LDA $0FAC ; 85 12 STA $12 20 76 8A JSR $8A76 ; $110A76 IN ROM 20 A7 8A JSR $8AA7 ; $110AA7 IN ROM 90 03 BCC BRANCH_ALPHA; 20 0A 8A JSR $8A0A ; $110A0A IN ROM BRANCH_ALPHA 60 RTS $110A5C AE 54 0E LDX $0E54 ;Enemy Index BD AA 0F LDA $0FAA ; 85 14 STA $14 BD A8 0F LDA $0FA8 ; 85 12 STA $12 20 76 8A JSR $8A76 ; $110A76 IN ROM 20 A7 8A JSR $8AA7 ; $110AA7 IN ROM 90 03 BCC BRANCH_ALPHA;Branch to RTS 20 30 8A JSR $8A30 ; $110A30 IN ROM BRANCH_ALPHA 60 RTS ; $110A75 60 RTS ;Extra RTS? $110A76 AE 54 0E LDX $0E54 ;Enemy Index 22 AB C6 A0 JSL $A0C6AB ; $1046AB IN ROM (see bottom) 90 05 BCC BRANCH_ALPHA; 20 95 8A JSR $8A95 ; $110A95 IN ROM 80 10 BRA BRANCH_BETA ;Jump up to BETA BRANCH_ALPHA A9 02 00 LDA #$0002 ;Load the number 2 85 14 STA $14 64 RTL $110A8A 12 22 ORA $22 76 BC A0 ROR $A0BC, X B0 03 BCS BRANCH_ALPHA;Branch to RTS 20 95 8A JSR $8A95 ; $110A95 IN ROM BRANCH_BETA 60 RTS $110A95 (something with orientation?) AE 54 0E LDX $0E54 ;Enemy Index 20 F7 89 JSR $89F7 ; $1109F7 IN ROM. Back to top. BD B0 0F LDA $0FB0 ;Load Speed, which is STOKE's orientation 49 01 00 EOR $0001 ;True if it doesn't equal 0001 F0 03 BEQ BRANCH_ALPHA; 20 1D 8A JSR $8A1D ; $11091D IN ROM BRANCH_ALPHA 60 RTS $110AA7 (something to do with firing projectiles?; a counter between shots?) AE 54 0E LDX $0E54 ;Enemy Index 22 11 81 80 JSL $808111 ; guh? AD E5 05 LDA $05E5 ;Load a random number 18 CLC 7D A4 0F ADC $0FA4, X ;Add it to this and X 29 FF 00 AND #$00FF ;AND it with 00FF C9 02 00 CMP #$0002 ;Compare it to 0002 10 09 BPL ;Branch to CLC AND RTS A9 75 8A LDA #$8A75 ; 9D B2 0F STA $0FB2 ; 38 SEC 80 01 BRA ;Branch to RTS 18 CLC 60 RTS $1046AB 64 20 STZ $20 A5 12 LDA $12 05 14 ORA $14 D0 02 BNE 18 CLC 6B RTL Drop Chances (B4:F3B6) $1A73B6 50 50 50 05 05 05 Resistances (B4:EC1C) $1A6C1C 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 Name (B4:E15D) $1A615D 53 54 4F 4B 45 STOKE Bytes 00-01: Size of tile data. If minus, use room population index for offset to copy to VRAM (6X00, actually C000 - DE00) Bytes 02-03: pointer to the color pallete Bytes 04-05: Enemy HP Bytes 06-07: Damage from contact with enemy Bytes 08-09: *2 = number of pixels wide the enemy is? Bytes 0A-0B: *2 = number of pixels high the enemy is? Byte 0C: Pointer to bank, used with other pointers Byte 0D: Number of frames to run 'hurt' AI when hit, +8 = number of frames an enemy will flash if it's hurt. If #$00, #$04 is used instead? Byte 0E-0F: Sound played when enemy is hit Bytes 10-11: Special boss fight value Bytes 12-13: Initialization(?) AI Bytes 14-15: How many 'parts' this enemy is, 0 being understood to be 1. Seems to be almost unused in practice... MB does use it though. Bytes 16-17: Unknown Bytes 18-19: Pointer to main movement AI. (Gives Ripper IIs fire tails) Bytes 1A-1B: Grapple reaction. See below. Bytes 1C-1D: Extra AI routine. (Metroid latching) (Normally hit reaction?) Bytes 1E-1F: Extra AI routine. (Frozen AI, I think) Bytes 20-21: Extra AI routine. (Reserve Tank/X-Ray pause AI) Side note: 18 - 21 all seem to carry out basic movement Byte 22-23: Animation played when enemy dies. If 00 or 01 and killed by super missile, use 02 instead. Bytes 24-27: Unknown Bytes 28-29: Pointer to Powerbomb reaction (if 0000, uses 8037 instead; normal power bomb susceptibility) Bytes 2A-2F: Unknown Bytes 30-31: Pointer to Touch Action Bytes 32-33: Pointer to Projectile Action Bytes 34-35: Unknown Bytes 36-38: Long Pointer to Tile pallete Byte 39: Layer control (02 = In front of Samus, 05 = behind Samus, in front of background, 0B = behind background) Bytes 3A-3B: Pointer to enemy's item drop chances, often used by multiple enemies (bank B4) Bytes: 1 = Energy, 2 = Big Energy, 3 = Missiles, 4 = nothing, 5 = super missiles, 6 = power bombs Bytes 3C-3D: Pointer to enemy's resistances, often used by multiple enemies (bank B4) Bytes 3E-3F: Pointer to enemy's name (bank B4) Grapple actions: ## 00 = crash 00 80 = Grapple ignores enemy, enemy pauses one frame. Will unfreeze frozen enemies 01-04 80 = Grapple ignores enemy, enemy stops movement 05 80 = Grapple latches on to enemy, enemy stops until released 06 80 = Grapple ignores enemy, enemy stops movement 07-08 80 = Grapple curves, enemy unaffected 09 80 = Enemy stops 0A 80 = Grapple latches on to enemy, kills enemy 0B-0D 80 = Grapple curves, enemy unaffected 0E 80 = Grapple ignores enemy, enemy stops movement 0F 80 = Grapple is stopped by enemy, enemy not affected 14 80 = Grapple latches on to enemy, no effect on enemy 19 80 = Grapple latches on to enemy, enemy dies in about 1/4 a second 1E 80 = Grapple latches on to enemy for a moment, Samus is hurt and knocked off 23 80 = Grapple latches on to enemy for a moment, Samus is hurt once a frame for 1 damage until killed 28 80 = Grapple latches on to enemy for a moment, Samus is hurt once a frame for 1 damage until killed. Enemy is frozen 37 80 = Grapple ignores enemy, enemy is killed 3C 80 = Grapple ignores enemy, enemy stops movement and becomes untouchable 4B 80 = Crash Enemy resistance stuff for beams: If base beam resistance is FF, play the frozen sound if not already frozen, and set everything for frozen (see below). Done If charge beam and charge beam resistance is FF or X0, or the total damage is 0: Kill the beam, make a dud explosion at the beam's X/Y (#$0006 in $16, JSL $B4BC26), and play the dud sound. Done Set hurt time and hurt AI If not already frozen, play hurt sound and inc $0E2E (unknown) If plasma, set intangible timer to 10 If new health will be =< 0: Freeze if beam is ice, resistance is not 8X, enemy isn't already frozen Set freeze timer to 400 frames normally, 300 in Norfair, set frozen AI, set intangible for 0A frames, and play frozen sound. Health is not affected. Done If new health will be > 0, subtract it. Done STOKE Data & Disassembly by Herald83 0004 1289 1400 2800 0800 0800 A2 00 5300 0000 AD89 0100 0000 F089 0F80 4C80 4180 0000 0000 00000000 0000 000000000000 2380 2D80 0000 00D0AC 05 B6F3 1CEC 5DE1 tile pal hp dmg wide high | | hurt Boss AI Part Norm Grap Hurt Froz XRay die PB Tch. Beam | | | | | get ptr | | snd. num Init Cnt. Move AI AI AI or anim Pntr Pntr Pntr | | | | | lgth Bank Ptr | 0=>1 AI? Rsrv | | | | | ??? | AI Tile Pointr | | | | # of "hurt" frames 0=>4 background/foreground | | | pointer to enemy drop chances | | pointer to enemy resistances | name pointer Palette Edits: Red, Green, Blue R G B 1: 00 00 0E 2: 1F 1F 1F 3: UNUSED 4: 1E 05 02 5: 15 04 02 6: 0C 03 02 7: 07 02 01 8: UNUSED 9: 1E 18 15 10: 18 12 0E 11: 11 0B 08 12: UNUSED 13: 1F 1C 05 14: 17 13 00 15: UNUSED 16: 07 00 00 SMILE Notes Ideal speed (Speed2) value is between 0002 & 0004, IMHO. Max value is 0040. Orientation (Speed) is 0000 for left, 0001 for right Custom RAM Usage $7E:0F78 Enemy Index; #$CEFF $7E:0F7A* Enemy X Position $7E:0F7C* Enemy X Position sub-pixel $7E:0F7E* Enemy Y Position $7E:0F80 Enemy Y Position sub-pixel $7E:0F82 Enemy Collision 1/2 Width (from center); #$0008 $7E:0F84 Enemy COllision 1/2 Height (from center); #$0008 $7E:0F86 Property bits, Special in SMILE; #$2000 -> Bit D on: Process enemy's graphic AI $7E:0F88 Extra Bit Properties; #$0000 $7E:0F8A AI Handler; #$0000 (None) -> 18 $7E:0F8C* Enemy HP $7E:0F8E* Main Graphics/Hitbox Pointer $7E:0F90 Unused $7E:0F92* Pointer to AI Structure, Enemy Instructions; $89xx (see below for xx) **Haven't messed with this yet** Instruction Pointers (possibly incomplete) #$8932 90 89 08 00 CA 8A 10 00 D6 8A 08 00 E7 8A 08 00 F3 8A ED 80 34 89 BCC 89 #$8948 10 00 E7 8A 7E 89 00 00 10 00 FF 8A ED 80 32 89 #$8958 9D 89 08 00 15 8B 10 00 21 8B 08 00 32 8B 08 00 3E 8B ED 80 5A 89 #$896E Not sure how long this is but they all seem to end in 89... then again, some have 89's in the middle. FUCK. The Waver's all end in 2F 89... 10 00 32 8B 7E 89 8974 dunno if this is actually an instruction or just crap; starts after 6E; copied until another 89 01 00 10 00 4A 8B ED 80 58 89 $7E:0F94* Action Delay? $7E:0F96 Palette Pointer $7E:0F98 Index to graphics in VRAM $7E:0F9A Layer Control; #$0005 $7E:0F9C Hurt AI Timer (Kej:Set to (0F78),#$0D + #$08 when shot? This - 8 = timer for using Hurt AI.) $7E:0F9E Frozen Timer $7E:0FA0 Unused $7E:0FA2 Unused $7E:0FA4* Counter, loops at #$FFFF $7E:0FA6 Enemy Data Bank; #$A2 $7E:0FA7 Unused $7E:0FA8 Custom use, Initialized to table value based on Speed2 and is never changed $7E:0FAA Custom use, Initialized to table value based on Speed2 and is never changed $7E:0FAC Custom use, Initialized to table value based on Speed2 and is never changed $7E:0FAE Custom use, Initialized to table value based on Speed2 and is never changed $7E:0FB0* Custom Use, Current Orientation; #$0000 is facing left, #$0001 is facing right $7E:0FB2* Custom Use, Current Action; #$8A43 when walking left, #$8A5C when walking right, #$8A75 when shooting $7E:0FB4 Initialization Orientation; Speed in SMILE $7E:0FB6 Initialization Speed; Speed2 in SMILE *Variable values Drop Chances (B4:F3B6) $1A73B6 50 50 50 05 05 05 Resistances (B4:EC1C) $1A6C1C 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 Name (B4:E15D) $1A615D 53 54 4F 4B 45 STOKE AI Initialization (A2:89AD => 11:09AD) $A2:89AD AE 54 0E LDX $0E54 ;Enemy Index X:CEFF $A2:89B0 A9 4D 80 LDA #$804D ;Load the Main Graphics/Hitbox pointer value... $A2:89B3 9D 8E 0F STA $0F8E, X ; and store it where it belongs $A2:89B6 BD B6 0F LDA $0FB6, X ;Load Initial Speed (Speed2) $A2:89B9 0A ASL A ;Speed2 x 2 $A2:89BA 0A ASL A ;Speed2 x 4 $A2:89BB 0A ASL A ;Speed2 x 8 $A2:89BC A8 TAY ;Flip this to Y $A2:89BD B9 87 81 LDA $8187, Y ;From here down... $A2:89C0 9D AA 0F STA $0FAA, X ; $A2:89C3 B9 89 81 LDA $8189, Y ; $A2:89C6 9D A8 0F STA $0FA8, X ; $A2:89C9 B9 8B 81 LDA $818B, Y ; $A2:89CC 9D AE 0F STA $0FAE, X ; $A2:89CF B9 8D 81 LDA $818D, Y ; $A2:89D2 9D AC 0F STA $0FAC, X ; to here sets up some variables based on Speed2 Sidebar: These 9Ds seem to function as BDs; X is always #$0000 at this point. Wastes 4 cycles. Feh... :/ $A2:89D5 20 F7 89 JSR $89F7 ; $1109F7 IN ROM $A2:89D8 A9 43 8A LDA #$8A43 ;Load "Walk Left" value $A2:89DB 9D B2 0F STA $0FB2, X ;and store it to the current action $A2:89DE BD B4 0F LDA $0FB4, X ;Load Speed $A2:89E1 9D B0 0F STA $0FB0, X ;Custom use, current orientation $A2:89E4 F0 09 BEQ BR_ALPHA ; What was compared?? $A2:89E6 20 1D 8A JSR $8A1D ; $110A1D IN ROM $A2:89E9 A9 5C 8A LDA #$8A5C ;Load "Walk Right" value $A2:89EC 9D B2 0F STA $0FB2 ;and store it to the current action BR_ALPHA $A2:89F0 6B RTL $A2:89F7>11:09F7 $A2:89F7 AE 54 0E LDX $0E54 ;Enemy Index $A2:89FA A9 01 00 LDA #$0001 ; $A2:89FD 9D 94 0F STA $0F94 ; $A2:8A00 9E 90 0F STZ $0F90, X ; $A2:8A03 A9 32 89 LDA #$8932 ;Load instruction pointer $A2:8A06 9D 92 0F STA $0F92 ; $A2:8A09 60 RTS $A2:8A0A>11:0A0A $A2:8A0A AE 54 0E LDX $0E54 ;Enemy Index $A2:8A0D A9 01 00 LDA #$0001 ; $A2:8A10 9D 94 0F STA $0F94 ;Set Action Delay to #$0001 $A2:8A13 9E 90 0F STZ $0F90, X ; $A2:8A16 A9 48 89 LDA #$8948 ;Load instruction pointer $A2:8A19 9D 92 0F STA $0F92 ; $A2:8A1C 60 RTS $A2:8A1D>11:0A1D $A2:8A1D AE 54 0E LDX $0E54 ;Enemy Index $A2:8A20 A9 01 00 LDA #$0001 ; $A2:8A23 9D 94 0F STA $0F94 ;Set Action Delay to #$0001 $A2:8A26 9E 90 0F STZ $0F90, X ; $A2:8A29 A9 58 89 LDA #$8958 ;Load instruction pointer $A2:8A2C 9D 92 0F STA $0F92 ; $A2:8A2F 60 RTS $A2:8A30>11:0A30 $A2:8A30 AE 54 0E LDX $0E54 ;Enemy Index $A2:8A33 A9 01 00 LDA #$0001 ; $A2:8A36 9D 94 0F STA $0F94 ;Set Action Delay to #$0001 $A2:8A39 9E 90 0F STZ $0F90, X ; $A2:9A3C A9 6E 89 LDA #$896E ;Load instruction pointer $A2:8A3F 9D 92 0F STA $0F92 ; $A2:8A42 60 RTS $A2:8A43>11:0A43 $A2:8A43 AE 54 0E LDX $0E54 ;Enemy Index $A2:8A46 BD AE 0F LDA $0FAE ;#$FFFF when Speed2 = #$0003 $A2:8A49 85 14 STA $14 $A2:8A4B BD AC 0F LDA $0FAC ;$#D000 when Speed2 = #$0003 $A2:8A4E 85 12 STA $12 $A2:8A50 20 76 8A JSR $8A76 ; $110A76 IN ROM $A2:8A53 20 A7 8A JSR $8AA7 ;Projectile Firing Timer, $110AA7 IN ROM $A2:8A56 90 03 BCC BRANCH_ALPHA; $A2:8A58 20 0A 8A JSR $8A0A ; $110A0A IN ROM BRANCH_ALPHA $A2:8A5B 60 RTS $A2:8A5C>11:0A5C $A2:8A5C AE 54 0E LDX $0E54 ;Enemy Index $A2:8A5F BD AA 0F LDA $0FAA ;#$0000 when Speed2 = #$0003 $A2:8A62 85 14 STA $14 $A2:8A64 BD A8 0F LDA $0FA8 ;#$3000 when Speed2 = #$0003 $A2:8A67 85 12 STA $12 $A2:8A69 20 76 8A JSR $8A76 ; $110A76 IN ROM $A2:8A6C 20 A7 8A JSR $8AA7 ;Projectile Firing Timer, $110AA7 IN ROM $A2:8A6F 90 03 BCC BRANCH_ALPHA;Branch to RTS $A2:8A71 20 30 8A JSR $8A30 ; $110A30 IN ROM BRANCH_ALPHA $A2:8A74 60 RTS ; $A2:8A75>11:0A75 $A2:8A75 60 RTS ;This is actually called by something, not extra! $A2:8A76>11:0A76 $A2:8A76 AE 54 0E LDX $0E54 ;Enemy Index $A2:8A79 22 AB C6 A0 JSL $A0C6AB ;Horizontal Movement Routine, $1046AB IN ROM $A2:8A7D 90 05 BCC BRANCH_ALPHA; $A2:8A7F 20 95 8A JSR $8A95 ; $110A95 IN ROM $A2:8A82 80 10 BRA BRANCH_BETA ; BRANCH_ALPHA $A2:8A84 A9 02 00 LDA #$0002 $A2:8A87 85 14 STA $14 $A2:8A89 64 STZ $12 $A2:8A8A>11:0A8A $A2:8A8A 12 22 ORA $22 $A2:8A8C 76 BC A0 ROR $A0BC, X $A2:8A8F B0 03 BCS BRANCH_ALPHA;Branch to RTS $A2:8A91 20 95 8A JSR $8A95 ; $110A95 IN ROM BRANCH_BETA $A2:8A94 60 RTS $A2:8A95>11:0A95 (something with orientation?) $A2:8A95 AE 54 0E LDX $0E54 ;Enemy Index $A2:8A98 20 F7 89 JSR $89F7 ;Instruction #$8932, $1109F7 IN ROM $A2:8A9B BD B0 0F LDA $0FB0 ;Load Current Orientation $A2:8A9E 49 01 00 EOR $0001 ;True if it doesn't equal 0001 $A2:8AA1 F0 03 BEQ BRANCH_ALPHA; $A2:8AA3 20 1D 8A JSR $8A1D ;Instruction #$8958, $11091D IN ROM BRANCH_ALPHA $A2:8AA6 60 RTS $A2:8AA7>11:0AA7 Projectile Firing AI $A2:8AA7 AE 54 0E LDX $0E54 ;Enemy Index $A2:8AAA 22 11 81 80 JSL $808111 ;JSL to Random Number Generator $A2:8AAE AD E5 05 LDA $05E5 $A2:8AB1 18 CLC $A2:8AB2 7D A4 0F ADC $0FA4, X $A2:8AB5 29 FF 00 AND #$00FF $A2:8AB8 C9 02 00 CMP #$0002 $A2:8ABB 10 09 BPL ;CLC if pos, Fire Projectile and SEC if neg, then RTS $A2:8ABD A9 75 8A LDA #$8A75 ;Load "Fire Projectile" value $A2:8AC0 9D B2 0F STA $0FB2, X ;and store it to current action $A2:8AC3 38 SEC $A2:8AC4 80 01 BRA ;Branch to RTS $A2:8AC6 18 CLC $A2:8AC7 60 RTS