$808111 puts a randomly generated number into A and 05E5 $8090CB play a sound, library 2 $868027 spawns enemy projectile $868097 spawns enemy projectile $90BE00 used by fighter pirates, reflec, and bang to delete samus projectile and produce a new one (used in shot reaction AI and special hitbox coding) $A0A3AF Death animation $A0A477 enemy touch AI (enemy die on contact) $A0A597 alternate touch AI (enemy die on contact) $A0A63D A common hit routine, I think. JSR $A6DE, display the 'hit' graphic if applicable. If enemy is at 0 health, set 7E:7002,X to the projectile type ($0C18,Y, AND #$0F00), and play the death animation (JSL $A0A3AF) $A0A6A7 clear enemy hit flag, runs A6DE (beam damage etc.) $A0AEED samus/enemy colission detection (boundary calculations) LDA 0 or 1 dependant $A0B0B2 Cosine multiplication. (cos (A * 128/pi) * 0E32) --> 0E36.0E39 $A0B0C6 Sine multiplication, (-sin (A * 128/pi) * 0E32) --> 0E36.0E39 $A0B92B calculates X/Y position then spawns enemy specific projectiles (probably spawns fighter pirate energy/ammo drops after dying) $A0BBBF lots of enemy boundary calculations (seems to be trying to find it's location in room, possibly calculating x distance movement) used by walking pirates, looks like it's vertical colission routine to stop it from falling? NOP'd with no observable effects... (only runs when walking left) $A0C6AB Common horizontal movement routine, moves by $14.$12. TODO $A0C786 Common vertical movement routine, moves by $14.$12. TODO $B4BC26 creates enemy-related sprites like dud shots and hits (no sound). $12/$14 is X/Y, $16 is type. $18 is probably pallete or something... Used by Draygon for Evirs 0000 = Charge beam shine 0001 = 3 charge beam spots 0002 = 3 different charge beam spots, plus yellow shine (?) 0003 = Normal explosion 0004 = Bomb explosion 0005 = crumbling lights? Don't recognize it at all 0006 = Dud enemy explosion 0007 = Power bomb (lol) 0008 = Elevator light (larger than elevator) 0009 = Smoke (might be the stuff during exploding Ceres/Zebes) 000A = Small smoke (no idea where it's used) 000B = Water splash (footsteps in certain areas) 000C = Yellow smoke (I recognize it, but I don't remember where it's from) 000D = Small energy 000E = Large energy 000F = Bomb 0010 = Small energy (?), slow animation 0011 = Very similar to screw attack/speed run debris 0012 = Large smoke, fast animation (no idea where it's used) 0013 = Large smoke, fast animation + something in the center at the end of the animation 0014 = Large smoke, fast animation + something larger in the center 0015 = Large smoke, normal animation (used by Draygon at least) 0016 = Looks like miscolored plasma beam... 0017 = Fast miscolored plasma beam 0018 = Air bubbles, used by Samus and Draygon 0019 = Save station lights 001A = Slow closing gate 001B = Fast opening gate 001C = Elevator (doesn't go away) 001D = Large explosion 001E+ = Glitchy stuff (tested 1E, 1F, 20, 24, 31, 35, 36, 38, 40) 0032 = Looks like crackling electricity, doesn't go away. Supposedly used by something.. metroids? 0033 = More crackling electricity (might not be used) 0034 = Glitchy. Rapidly flashing stuff, shape suggests it's supposed to be a Metroid shell. Supposedly used, probably by Metroids 0037 = Freeze hit (used) 003B = Evirs that assist Draygon (facing left) 003C = Evirs that assist Draygon (facing right) 003D = Big air bubbles, used by Draygon $A0957E decriments frozen timer, checks if ice beam is equipped $A09F6D zeros out several enemy RAM locations $0F8A, $0FA0, $0F9E, $0FA2 $A09F7D grapple reaction (enemy freeze) $A09FC4 grapple reaction (enemy die) $A09FDF makes enemy run frozen AI pointer $A09FE9 grapple reaction (enemy freeze + other stuffs) $A0A03E grapple reaction (enemy unresponsive?) $A0A070 makes enemy run frozen AI pointer $A0A497 general enemy touch AI (contact damage to samus) $A0A5B7 general enemy touch AI (contact damage to enemy) $A0A8BC creates a dud shot (graphic and kills projectile) ========================================================================= A0:8687 Handle room shaking. 183E contains shake type, looks up displacement in table at A0:872D (2 byte values in pixels: BG1 X, BG1 Y, BG2 X, BG2 Y) $A0884D ; Something for sprites and sounds $A08EB6 ; Determine which enemies to process. A0:8FD4 Main routine. See MainEnemyRoutine.txt ; Enemy routines (but can still be killed by power bombs) $A09169 ; Handles Samus getting hurt? A0:9423 (JSR) Draws enemies, 1 at a time $A0957E decriments frozen timer, checks if ice beam is equipped $A09726 ; Something for the graphic update table. Unknown A0:9758 (JSR) Interaction with Samus, depends on $0F88,X's 2 bit. If set:(projectiles: JSR $9B7F, bombs: JSR $9D23, Samus: JSR $9A5A) Not set:(projectiles: JSR $A143, bombs: JSR $A236, Samus: JSR $A07A) A0:9785 Bomb Jump routine $A09894 ; Enemy/Room projectiles/objects collisions with Samus. Only does default routine, no customizable options. $A0996C ; Enemy/Room projectiles/objects collisions with Samus's projectiles. A0:9A5A (JSR) Check for collision with Samus. If they collide, JSL to that hitbox's 0Ath byte (Samus collision code). This routine disables Samus's invincibility if she is using blue suit or screw attack; if there are no enemies she'll get invincibility time with them. A0:9B7F (JSR) Check for collisions of all of the enemy's sprites/hitboxes in $0F8E with all projectiles. If there's a collision, JSL $A09D17 then RTS. A0:9D17 Small routine, just JML to code for enemy/projectile detection. Address used is at (($0F8E,X),(8*n1)),(C*n2). n1 = sprite number, n2 = hitbox number $A09F6D zeros out several enemy RAM locations $0F8A, $0FA0, $0F9E, $0FA2 $A09F7D grapple reaction (enemy freeze) $A09FC4 grapple reaction (enemy die) $A09FDF makes enemy run frozen AI pointer $A09FE9 grapple reaction (enemy freeze + other stuffs) $A0A03E grapple reaction (enemy unresponsive?) $A0A070 makes enemy run frozen AI pointer A0:A143 (JSR) Check for collisions of main hitbox with all projectiles. If there's a collision, JSL $A0A226 then RTS. A0:A226 Small routine, just JML to code for enemy/projectile detection. Address used is projectile pointer in enemy rom ($0F78 + 32) $A0A3AF Death animation A0:A45E Divide damage (A) by 4 for Gravity, or 2 for Varia. Nothing if neither suit. Result in A and $12 $A0A477 enemy touch AI (enemy die on contact) $A0A497 general enemy touch AI (contact damage to samus) $A0A597 alternate touch AI (enemy die on contact) $A0A5B7 general enemy touch AI (contact damage to enemy) $A0A63D A common hit routine, I think. JSR $A6DE, display the 'hit' graphic if applicable. If enemy is at 0 health, set 7E:7002,X to the projectile type ($0C18,Y, AND #$0F00), and play the death animation (JSL $A0A3AF) $A0A6A7 clear enemy hit flag, runs A6DE (beam damage etc.) A0:A6DE (JSR) Handles beam damage, freezing, and sound. $A0A8BC creates a dud shot (graphic and kills projectile) A0:A8F0 checks for collisions with (active) enemies, and puts something in A depending on the collisions. 0000 means no collisions, FFFF means yes collision(s). Sets 7E:182C,X and 7E:1834,X, 7E:184A - 7E:185B (see RAMMap.txt) $A0AD70 determines if enemy is on screen or not, LDA 0000 or 0001 dependent A0:ADE7 Determines if enemies with normal sprites are off screen. I guess. 1 at a time $A0AEE5 subtract samus x position from enemy x position and end. $A0AEED samus/enemy colission detection (boundary calculations) LDA 0 or 1 dependant $A0AEDD subtract Samus Y position from enemy Y position and end. $A0AF0B checks if enemy is in proximity to Samus (A= 0000 or 0001 depending) A0:B067 Get the absolute value of A (also into $0E32) $A0B07D x distance from samus to enemy (values inverted depending on direction) $A0B0B2 Cosine multiplication. (cos (A * 128/pi) * 0E32) --> 0E36.0E39 $A0B0C6 Sine multiplication, (-sin (A * 128/pi) * 0E32) --> 0E36.0E39 A0:B3C3 Not a routine. Table of -cos values (2 bytes each, values from FF00 to 0100. Angle (index/2) from 0 to 13F) A0:B443 Not a routine. Table of sin values (2 bytes each, values from FF00 to 0100. Angle (index/2) from 0 to FF) A0:B6FF 16bit ($26) * 16bit ($28) = 32bit ($2A) $A0B92B calculates X/Y position then spawns enemy specific projectiles A0:BB70 Call after pushing a X then Y pixel position onto the stack (2 bytes each). 0DC4 is set with block #, and stack is also cleaned up (do not try to pull Y and X position from stack) $A0BBBF lots of enemy boundary calculations (seems to be trying to find it's location in room, possibly calculating x distance movement) A0:C0AE Rough angle calculation given X (in $12) and Y (in $14). Angle 0 = up (-Y), 40 = right (X), 80 = down (Y), C0 = left (-X) $A0C18E determines if enemy is leaving screen SEC (A=0001 and enemy leaving screen) or CLC (A=0000 enemy still on screen) dependent A0:C26A (JSR) Enemy instruction AI loop (uses $0F92) $A0C6AB Common horizontal movement routine, moves by $14.$12. TODO $A0C786 Common vertical movement routine, moves by $14.$12. TODO A0:C8AD X must hold enemy pointer. Align enemy vertically to slopes if currently in contact with slopes.