Enemy Header F0FF (chozo statue WS and LN) 1200 E31D 0014 0028 0010 0024 AA 00 00 00 0000 E725 0001 0000 E7A7 800F 804C 8041 0000 00 00 00000000 0000 000000000000 E7DB E7DC 0000 ACBE00 05 F452 EEC6 0000 ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^ ^^ ^^ yy ^^^^ ^^^^ ^^^^ xxyy ^^^^ ^^^^ ^^^^ ^^^^ ^^^^ ^^ yy xxyyxxyy ^^^^ xxyyxxyyxxyy ^^^^ ^^^^ xxyy ^^^^^^ yy ^^^^ ^^^^ ^^^^ tile pal hp dmg wide high Bank # of hurt Boss AI Part Norm Grap Hurt Froz XRay die PB Tch. Beam Tile | | | | get ptr Ptr "hurt" snd. num Init Cnt. Move AI AI AI or anim Pntr Pntr Pntr Pointr | | | name pointer lgth frames 0=>1 AI? Rsrv | | pointer to enemy resistances ??? 0=>4 AI | pointer to enemy drop chances background/foreground ; special = 2000 (always) speed2 = 0002 LN statue 0000 WS statue E725: Initialization(?) AI E7A7: Pointer to main movement AI. E7DB: Touch AI Just an RTL lol E7DC: Shot AI Just an RTL lol Palette data WS statue: E31D forground: 00 38 3F 63 9F 4A DF 2D 39 67 73 4E 8C 31 C6 18 FF 27 F7 1A CE 0D C6 00 FF 3F 39 2B FF 7F 00 00 E33D background: 00 38 3F 63 9F 4A DF 2D 10 42 8C 31 08 21 84 10 FF 27 F7 1A CE 0D C6 00 FF 3F 39 2B 94 52 00 00 LN statue: E35D forground: 00 38 3F 63 9F 4A DF 2D 7C 2F 95 22 8D 11 E8 08 FF 27 F7 1A CE 0D C6 00 FF 3F 39 2B DF 73 43 00 E37D background: 00 38 3F 63 9F 4A DF 2D 95 22 8D 11 E8 08 85 00 FF 27 F7 1A CE 0D C6 00 FF 3F 39 2B 94 52 01 00 LN chozo statue Graphic AI table: E39D: Lower Norfair statue graphic AI table 6B 80 45 E4 store #$E445 to $0FB2 01 00 D8 EF tilemap and delay 2F 81 sit on this instruction until something tells it to change E3A7: 74 80 load #$807B (pointer to RTS) to $0FB2,x and end D8 E5 20 00 index for tables to move enemy, align to slopes, then align samus to enemy. 20 00 D8 EF tilemap and delay D8 E5 22 00 index for tables to move enemy, align to slopes, then align samus to enemy. 08 00 34 F0 tilemap and delay D8 E5 24 00 index for tables to move enemy, align to slopes, then align samus to enemy. 30 00 8B F0 tilemap and delay 7F E5 play a sound (statue grabbing onto Samus) D8 E5 26 00 index for tables to move enemy, align to slopes, then align samus to enemy. 40 00 E2 F0 tilemap and frame delay 06 00 B4 F4 tilemap and delay 08 00 10 F5 tilemap and delay 0A 00 6C F5 tilemap and delay 0C 00 C8 F5 tilemap and delay 60 00 24 F6 tilemap and delay 29 E4 setup FX3 movement 23 81 05 00 store #$0005 to $0F90,x (loop counter) E3E5: 0B 00 10 F5 tilemap and delay 08 00 6C F5 tilemap and delay 06 00 C8 F5 tilemap and delay 08 00 24 F6 tilemap and delay 06 00 C8 F5 tilemap and delay 08 00 6C F5 tilemap and delay 10 81 E5 E3 decriment $0F90,x. if 0 skip E3E5, if non-zero use E3E5 as a loop pointer 74 80 load #$807B (pointer to RTS) to $0FB2,x and end D8 E5 26 00 index for tables to move enemy, align to slopes, then align samus to enemy. 80 00 E2 F0 tilemap and delay D8 E5 24 00 index for tables to move enemy, align to slopes, then align samus to enemy. 50 00 8B F0 tilemap and delay D8 E5 22 00 index for tables to move enemy, align to slopes, then align samus to enemy. 08 00 34 F0 tilemap and delay D8 E5 20 00 index for tables to move enemy, align to slopes, then align samus to enemy. 20 00 D8 EF tilemap and delay 3D E4 return control of Samus to normal 36 E4 store #$02D2 to FX3 height (finished moving liquids) 2F 81 sit on this instruction until something tells it to change ;Setup for moving liquids (FX3) $AAE429 A9 20 00 LDA #$0020 $AAE42C 8D 80 19 STA $1980 [$7E:1980] FX3, frames to wait till beginning movement. (0 means 10000) $AAE42F A9 40 00 LDA #$0040 $AAE432 8D 7C 19 STA $197C [$7E:197C] FX3 height adjustment speed (signed) $AAE435 6B RTL ;set FX3 height (finished moving liquids) $AAE436 A9 D2 02 LDA #$02D2 $AAE439 8D 78 19 STA $1978 [$7E:1978] FX3 height (average?) (measured from top of room down) $AAE43C 6B RTL ;return control of samus to normal $AAE43D A9 01 00 LDA #$0001 $AAE440 22 84 F0 90 JSL $90F084[$90:F084] Put #$E695 into $0A42, #$E725 into $0A44 (RETURNS CONTROL OF SAMUS TO NORMAL?) $AAE444 6B RTL ;running AI for LN chozo statue $AAE445 BD B4 0F LDA $0FB4,x[$7E:0FB4] speed value in SMILE (statue activation flag?) $AAE448 F0 0C BEQ $0C [$E456] if 0 then end $AAE44A A9 A7 E3 LDA #$E3A7 otherwise load #$E3A7 $AAE44D 9D 92 0F STA $0F92,x[$7E:0F92] AND STORE TO pointer to AI structure $AAE450 A9 01 00 LDA #$0001 $AAE453 9D 94 0F STA $0F94,x[$7E:0F94] SET DELAY TO 0001 $AAE456 60 RTS WS chozo statue: Graphic AI structure table: E457: 6B 80 AE E7 ;store $#E7AE to $0FB2,x 01 00 DD E7 frame delay and tilemap 2F 81 sit on this instruction until something tells it to change E461: 74 80 load #$807B (pointer to RTS) to $0FB2,x D8 E5 00 00 index for tables to move enemy, align to slopes, then align samus to enemy. 20 00 DD E7 tilemap and delay D8 E5 02 00 index for tables to move enemy, align to slopes, then align samus to enemy. 08 00 39 E8 tilemap and delay D8 E5 04 00 index for tables to move enemy, align to slopes, then align samus to enemy. 50 00 90 E8 tilemap and delay 7F E5 play sound (statue grabbing samus) D8 E5 06 00 index for tables to move enemy, align to slopes, then align samus to enemy. 80 00 E7 E8 tilemap and delay 06 00 B9 EC tilemap and delay 08 00 15 ED tilemap and delay 0A 00 71 ED tilemap and delay 0C 00 CD ED tilemap and delay 80 00 29 EE tilemap and delay 23 81 04 00 store the following argument to $0F90,x (loop counter) 0B 00 15 ED tilemap and delay 08 00 71 ED tilemap and delay 06 00 CD ED tilemap and delay 08 00 29 EE tilemap and delay 06 00 CD ED tilemap and delay 08 00 71 ED tilemap and delay 10 81 9D E4 decriment $0F90,x (loop counter), if not 0 then loop back to following argument 6B 80 DA E7 store the following argument to $0FB2,x (main Running AI pointer) 23 81 10 00 store the following argument to $0F90,x (loop counter) D8 E5 16 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 F8 FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 08 00 49 EC tilemap and delay 87 E5 play stepping sound D8 E5 08 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 EC FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 0B 00 43 E9 tilemap and delay D8 E5 0A 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 F0 FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 08 00 AE E9 tilemap and delay D8 E5 0C 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 00 00 look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 06 00 1E EA tilemap and delay D8 E5 0E 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 F8 FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 08 00 8E EA tilemap and delay 87 E5 play stepping sound D8 E5 10 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 EC FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 0B 00 FE EA tilemap and delay D8 E5 12 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 F0 FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 08 00 69 EB tilemap and delay D8 E5 14 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 00 00 look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 06 00 D9 EB tilemap and delay 10 81 C1 E4 decriment $0F90,x (loop counter), if not 0 then loop back to following argument D8 E5 16 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 F8 FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 08 00 49 EC tilemap and delay D8 E5 08 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 EC FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 0B 00 43 E9 tilemap and delay D8 E5 0A 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 F0 FF look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 08 00 AE E9 tilemap and delay D8 E5 0C 00 index for tables to move enemy, align to slopes, then align samus to enemy. 8F E5 00 00 look at the block in the following position relative to enemy, if block below it is a spike block then play breaking animation and spawn e/r projectile #$AF68 in its place (dust clouds) 06 00 1E EA tilemap and delay 74 80 load #$807B (pointer to RTS) to $0FB2,x D8 E5 06 00 index for tables to move enemy, align to slopes, then align samus to enemy. 80 00 E7 E8 tilemap and delay D8 E5 04 00 index for tables to move enemy, align to slopes, then align samus to enemy. 50 00 90 E8 tilemap and delay D8 E5 02 00 index for tables to move enemy, align to slopes, then align samus to enemy. 08 00 39 E8 tilemap and delay D8 E5 00 00 index for tables to move enemy, align to slopes, then align samus to enemy. 20 00 DD E7 tilemap and delay F0 E6 Return control of samus to player, change scrolling for room, and spawn PLM #$D6FC 2F 81 sit on this instruction until something tells it to change ;play a sound, statue grabbing samus $AAE57F A9 1C 00 LDA #$001C $AAE582 22 CB 90 80 JSL $8090CB[$80:90CB] play a sound $AAE586 6B RTL ;play a sound, footstep of statue $AAE587 A9 4B 00 LDA #$004B $AAE58A 22 CB 90 80 JSL $8090CB[$80:90CB] play a sound $AAE58E 6B RTL ;check tile in floor in front of statue, if it's a spike block then play the block break animation above it and spawn dust clouds $AAE58F DA PHX $AAE590 5A PHY $AAE591 BD 7A 0F LDA $0F7A,x[$7E:0F7A] x position of enemy $AAE594 18 CLC $AAE595 79 00 00 ADC $0000,y[$AA:E4C7] all the argument following the routine pointer $AAE598 48 PHA $AAE599 BD 7E 0F LDA $0F7E,x[$7E:0F7E] enemy Y position $AAE59C 18 CLC $AAE59D 69 1C 00 ADC #$001C add pixel distance to position $AAE5A0 48 PHA $AAE5A1 22 70 BB A0 JSL $A0BB70[$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) $AAE5A5 AD C4 0D LDA $0DC4 [$7E:0DC4] Current block index (nth block of the room) $AAE5A8 18 CLC $AAE5A9 6D A5 07 ADC $07A5 [$7E:07A5] Current room's width in blocks (add to current block to go one block down) $AAE5AC 0A ASL A $AAE5AD AA TAX $AAE5AE BF 02 00 7F LDA $7F0002,x[$7F:14D8] load tile data for specific block $AAE5B2 29 00 F0 AND #$F000 $AAE5B5 C9 00 A0 CMP #$A000 check if it is a spike block $AAE5B8 D0 19 BNE $19 [$E5D3] if not then branch to end $AAE5BA 8A TXA $AAE5BB 38 SEC $AAE5BC ED A5 07 SBC $07A5 [$7E:07A5] if so, go one block above $AAE5BF AA TAX $AAE5C0 A9 13 D1 LDA #$D113 generic block break animation PLM header $AAE5C3 22 E7 84 84 JSL $8484E7[$84:84E7] spawn PLM $AAE5C7 7A PLY $AAE5C8 5A PHY $AAE5C9 B9 00 00 LDA $0000,y[$AA:E507] $AAE5CC A0 68 AF LDY #$AF68 header for dust cloud $AAE5CF 22 97 80 86 JSL $868097[$86:8097] spawn e/r projectile $AAE5D3 7A PLY $AAE5D4 FA PLX $AAE5D5 C8 INY $AAE5D6 C8 INY $AAE5D7 6B RTL ;move enemy, align to slopes, adjust samus' position relative to enemy $AAE5D8 B9 00 00 LDA $0000,y[$AA:E465] grab argument after routine pointer (used as an index) $AAE5DB 9D AC 0F STA $0FAC,x[$7E:0FAC] store to general use enemy RAM $AAE5DE 5A PHY $AAE5DF 64 12 STZ $12 [$7E:0012] $AAE5E1 64 14 STZ $14 [$7E:0014] $AAE5E3 BC AC 0F LDY $0FAC,x[$7E:0FAC] load it into Y $AAE5E6 B9 30 E6 LDA $E630,y[$AA:E630] grab value for movement distance from table $AAE5E9 10 02 BPL $02 [$E5ED] if positive (moving right) then branch $AAE5EB C6 14 DEC $14 [$7E:0014] $AAE5ED 85 13 STA $13 [$7E:0013] $AAE5EF 22 AB C6 A0 JSL $A0C6AB[$A0:C6AB] Common horizontal movement routine, moves by $14.$12. TODO $AAE5F3 B0 00 BCS $00 [$E5F5] useless branch that does nothing lol >.> $AAE5F5 64 12 STZ $12 [$7E:0012] $AAE5F7 64 14 STZ $14 [$7E:0014] $AAE5F9 BC AC 0F LDY $0FAC,x[$7E:0FAC] reload index back into Y $AAE5FC B9 30 E6 LDA $E630,y[$AA:E630] and reload movement distance from table $AAE5FF 10 04 BPL $04 [$E605] if positive (moving down here) then branch $AAE601 49 FF FF EOR #$FFFF if not, then invert value $AAE604 1A INC A $AAE605 10 02 BPL $02 [$E609] $AAE609 85 13 STA $13 [$7E:0013] $AAE60B 22 86 C7 A0 JSL $A0C786[$A0:C786] Common vertical movement routine, moves by $14.$12. TODO $AAE60F B0 00 BCS $00 [$E611] $AAE611 22 AD C8 A0 JSL $A0C8AD[$A0:C8AD] X must hold enemy pointer. Align enemy vertically to slopes if currently in contact with slopes. $AAE615 BC AC 0F LDY $0FAC,x[$7E:0FAC] reload index yet again... $AAE618 BD 7A 0F LDA $0F7A,x[$7E:0F7A] enemy x position $AAE61B 18 CLC $AAE61C 79 70 E6 ADC $E670,y[$AA:E670] horizontal alignment table $AAE61F 8D F6 0A STA $0AF6 [$7E:0AF6] Samus's X position in pixels $AAE622 BD 7E 0F LDA $0F7E,x[$7E:0F7E] enemy Y position $AAE625 18 CLC $AAE626 79 B0 E6 ADC $E6B0,y[$AA:E6B0] vertical alignment table $AAE629 8D FA 0A STA $0AFA [$7E:0AFA] Samus's Y position in pixels $AAE62C 7A PLY $AAE62D C8 INY $AAE62E C8 INY $AAE62F 6B RTL E630: table of values for moving distance 00 00 00 00 00 00 00 00 00 FE 00 FD 00 F2 00 F8 00 FE 00 FD 00 F2 00 F8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 03 00 0E 00 08 00 02 00 03 00 0E 00 08 00 00 00 00 00 00 00 00 E670: table of values for bringing samus in alignment with statue (horizontally) E4 FF E2 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF E0 FF 1C 00 1E 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 E6B0: table of values for bringing samus in alignment with statue (vertically) E0 FF E7 FF E9 FF E9 FF E9 FF E8 FF E7 FF E8 FF E9 FF E8 FF E7 FF E8 FF E9 FF E9 FF E9 FF E9 FF E0 FF E7 FF E9 FF E9 FF E9 FF E8 FF E7 FF E8 FF E9 FF E8 FF E7 FF E8 FF E9 FF E9 FF E9 FF E9 FF ;return control of samus to normal and set scrolls, spawn PLM $AAE6F0 A9 01 00 LDA #$0001 $AAE6F3 22 84 F0 90 JSL $90F084[$90:F084] return control of samus to normal $AAE6F7 A9 00 00 LDA #$0000 $AAE6FA 8F 26 CD 7E STA $7ECD26[$7E:CD26] [7E:CD20 - 7E:CD51 Scrollmap for current room] set new scrolling for room $AAE6FE 8F 28 CD 7E STA $7ECD28[$7E:CD28] $AAE702 8F 29 CD 7E STA $7ECD29[$7E:CD29] $AAE706 A9 01 00 LDA #$0001 $AAE709 8F 2D CD 7E STA $7ECD2D[$7E:CD2D] $AAE70D 22 D7 83 84 JSL $8483D7[$84:83D7] spawn PLM 17 1D FC D6 $AAE715 6B RTL ;unknown routine, seems to set palette for enemy 1? never called, just randomly stuck in the middle of statue AI routines $AAE716 A2 3E 00 LDX #$003E $AAE719 BD DD E2 LDA $E2DD,x[$AA:E31B] $AAE71C 9F 20 C3 7E STA $7EC320,x[$7E:C35E] Unknown (Enemy 1 pallete?) $AAE720 CA DEX $AAE721 CA DEX $AAE722 10 F5 BPL $F5 [$E719] $AAE724 6B RTL Initiation AI (WS and LN chozo statues): $AAE725 AE 54 0E LDX $0E54 [$7E:0E54] current enemy index $AAE728 BD 86 0F LDA $0F86,x[$7E:0F86] property bits (enemy RAM) $AAE72B 09 00 A8 ORA #$A800 set bits to ignore samus and projectiles, and make enemy invisible $AAE72E 9D 86 0F STA $0F86,x[$7E:0F86] store back to property bits $AAE731 A9 4D 80 LDA #$804D $AAE734 9D 8E 0F STA $0F8E,x[$7E:0F8E] graphics/hitbox pointer (points to part of general enemy bank setup coding (universal between enemy banks)) $AAE737 A9 01 00 LDA #$0001 $AAE73A 9D 94 0F STA $0F94,x[$7E:0F94] action delay timer. used to start enemy running AI processing in this case $AAE73D 9E 90 0F STZ $0F90,x[$7E:0F90] ??? (Used by Mochtroid) (LN Chozo uses it as a loop counter) $AAE740 A9 A6 E7 LDA #$E7A6 points to an RTS lol $AAE743 9D B2 0F STA $0FB2,x[$7E:0FB2] general AI subroutine pointer $AAE746 A9 00 00 LDA #$0000 $AAE749 9D B4 0F STA $0FB4,x[$7E:0FB4] Used by AI routines. Speed in SMILE (statue activation flag?) $AAE74C 9E 96 0F STZ $0F96,x[$7E:0F96] which palette entry to use for the enemy $AAE74F 9C 9A 0F STZ $0F9A [$7E:0F9A] layer control $AAE752 BC B6 0F LDY $0FB6,x[$7E:0FB6] Used by AI routines. Speed2 in SMILE $AAE755 B9 A2 E7 LDA $E7A2,y[$AA:E7A2] load value from a table based on speed2 which statue to use $AAE758 9D 92 0F STA $0F92,x[$7E:0F92] and use as pointer to AI structure $AAE75B 98 TYA $AAE75C D0 26 BNE $26 [$E784] branch if LN statue $AAE75E A2 1E 00 LDX #$001E $AAE761 BD 3D E3 LDA $E33D,x[$AA:E35B] $AAE764 9F 40 C3 7E STA $7EC340,x[$7E:C35E] Target enemy color palette line 0002 $AAE768 BD 1D E3 LDA $E31D,x[$AA:E33B] $AAE76B 9F 20 C3 7E STA $7EC320,x[$7E:C33E] Target enemy color palette line 0001 $AAE76F CA DEX $AAE770 CA DEX $AAE771 10 EE BPL $EE [$E761] loop to set full palette $AAE773 22 D7 83 84 JSL $8483D7[$84:83D7] Creates PLMs. The routine that calls it must have after it the X and Y coordinate of the PLM and the address of the PLM header, in that order, after the JSL to 84:83D7. The PLM will be set up completely and run once. Then the code will resume, after those four bytes. If there are already too many PLMs and the game fails to make a new one, it just resumes code past those four bytes. 4A 17 EE D6 $AAE77B 22 D7 83 84 JSL $8483D7[$84:83D7] Creates PLMs. The routine that calls it must have after it the X and Y coordinate of the PLM and the address of the PLM header, in that order, after the JSL to 84:83D7. The PLM will be set up completely and run once. Then the code will resume, after those four bytes. If there are already too many PLMs and the game fails to make a new one, it just resumes code past those four bytes. 17 1D FC D6 $AAE783 6B RTL go here if statue is Lower Norfair: $AAE784 A2 1E 00 LDX #$001E $AAE787 BD 7D E3 LDA $E37D,x[$AA:E39B] $AAE78A 9F 40 C3 7E STA $7EC340,x[$7E:C35E] Target enemy color palette line 0002 $AAE78E BD 5D E3 LDA $E35D,x[$AA:E37B] $AAE791 9F 20 C3 7E STA $7EC320,x[$7E:C33E] Target enemy color palette line 0001 $AAE795 CA DEX $AAE796 CA DEX $AAE797 10 EE BPL $EE [$E787] loop to set full palette $AAE799 22 D7 83 84 JSL $8483D7[$84:83D7] Creates PLMs. The routine that calls it must have after it the X and Y coordinate of the PLM and the address of the PLM header, in that order, after the JSL to 84:83D7. The PLM will be set up completely and run once. Then the code will resume, after those four bytes. If there are already too many PLMs and the game fails to make a new one, it just resumes code past those four bytes. 0C 1D D6 D6 (acid drain plug x/y location) $AAE7A1 6B RTL $AAE7A2: Graphic AI pointer table for WS/LN statues E457 E39D $AAE7A6 60 RTS generalized Running AI for chozo statues (before being reset by PLMs): $AAE7A7 AE 54 0E LDX $0E54 [$7E:0E54] current enemy index $AAE7AA FC B2 0F JSR ($0FB2,x)[$AA:E7A6] general AI subroutine pointer (#$E7A6 setup by init AI) $AAE7AD 6B RTL ;general running AI for WS chozo statue $AAE7AE DA PHX $AAE7AF AE 9F 07 LDX $079F [$7E:079F] Region Number $AAE7B2 BF 28 D8 7E LDA $7ED828,x[$7E:D82B] Boss bits. 1 byte per area (C-B-N-W-M-T-C-D $AAE7B6 FA PLX $AAE7B7 29 01 00 AND #$0001 $AAE7BA F0 1D BEQ $1D [$E7D9] if boss not defeated, then end $AAE7BC BD B4 0F LDA $0FB4,x[$7E:0FB4] Used by AI routines. Speed in SMILE (statue activation flag?) $AAE7BF F0 18 BEQ $18 [$E7D9] if not set, then end $AAE7C1 A9 61 E4 LDA #$E461 $AAE7C4 9D 92 0F STA $0F92,x[$7E:0F92] pointer to graphic AI $AAE7C7 A9 01 00 LDA #$0001 $AAE7CA 9D 94 0F STA $0F94,x[$7E:0F94] action delay $AAE7CD A9 00 FF LDA #$FF00 $AAE7D0 9D A8 0F STA $0FA8,x[$7E:0FA8] general enemy RAM $AAE7D3 A9 00 01 LDA #$0100 $AAE7D6 9D AA 0F STA $0FAA,x[$7E:0FAA] general enemy RAM $AAE7D9 60 RTS ;tilemaps ============================================ E7DD: 12 00 FA 01 DF 7D 23 D6 C3 E7 20 23 E6 01 E7 0F 23 E6 C3 EF 22 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 E839: 11 00 FA 01 DF 7D 23 E9 C3 ED 2A 23 D9 C3 ED 28 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 E890: 11 00 E8 C3 ED 26 23 D8 C3 ED 24 23 FA 01 DF 7D 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 E8E7: 12 00 E8 C3 ED 26 23 D8 C3 E9 2C 23 E0 01 F9 1F 23 FA 01 DF 7D 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 E943: 15 00 E0 01 F9 1F 23 E8 C3 ED 26 23 FA 01 DF 79 23 E9 C3 1B 71 23 E1 C3 1B 70 23 EE C3 10 58 23 EE C3 08 48 23 F4 C3 FD 44 23 F4 C3 F7 08 23 FC C3 F7 09 23 10 C2 15 75 25 04 C2 09 4E 25 FB C3 FD 42 65 FB C3 05 52 65 D8 C3 E9 2C 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 E9AE: 16 00 E0 01 F8 1F 23 E8 C3 EC 26 23 FA 01 DE 7A 23 EC C3 1C 71 23 E4 C3 1C 70 23 F1 C3 11 58 23 F1 C3 09 48 23 F7 C3 04 52 23 F7 C3 FC 42 23 F4 C3 F6 08 23 FC C3 F6 09 23 09 C2 16 75 25 FC C3 09 4E 25 F9 C3 04 50 25 F9 C3 FC 40 25 D8 C3 E8 2C 23 ED C3 EB 0D 23 F5 C3 E3 0B 23 FC C3 E6 06 23 EC C3 E6 04 23 FC C3 D6 02 23 EC C3 D6 00 23 EA1E: 16 00 E8 C3 EB 26 23 E0 01 F7 1F 23 FA 01 DD 7B 23 FA C3 1E 71 23 F2 C3 1E 70 23 FA C3 13 5C 23 FA C3 0B 4C 23 FD C3 17 73 25 F9 C3 03 50 23 F9 C3 FB 40 23 FA C3 08 4E 25 F4 C3 F5 08 23 FC C3 F5 09 23 F7 C3 03 52 25 F7 C3 FB 42 25 D8 C3 E7 2C 23 ED C3 EA 0D 23 F5 C3 E2 0B 23 FC C3 E5 06 23 EC C3 E5 04 23 FC C3 D5 02 23 EC C3 D5 00 23 EA8E: 16 00 E0 01 F8 1F 23 E8 C3 EC 26 23 FA 01 DE 7C 23 01 C2 1D 71 23 F9 C3 1D 70 23 01 C2 12 56 23 01 C2 0A 46 23 FB C3 04 52 63 FB C3 FC 42 63 F2 C3 1B 73 25 F3 C3 10 56 25 F3 C3 08 46 25 F4 C3 F6 08 23 FC C3 F6 09 23 F4 C3 FC 44 25 D8 C3 E8 2C 23 ED C3 EB 0D 23 F5 C3 E3 0B 23 FC C3 E6 06 23 EC C3 E6 04 23 FC C3 D6 02 23 EC C3 D6 00 23 EAFE: 15 00 E8 C3 ED 26 23 E0 01 F9 1F 23 FA 01 DF 79 23 10 C2 15 75 23 04 C2 09 4E 23 FB C3 05 52 63 FB C3 FD 42 63 F4 C3 F7 08 23 FC C3 F7 09 23 E1 C3 1B 70 25 E9 C3 1B 71 25 EE C3 10 58 25 EE C3 08 48 25 F4 C3 FD 44 25 D8 C3 E9 2C 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 EB69: 16 00 E0 01 F8 1F 23 E8 C3 EC 26 23 FA 01 DE 7A 23 09 C2 16 75 23 FC C3 09 4E 23 F9 C3 04 50 23 F9 C3 FC 40 23 D8 C3 E8 2C 23 F5 C3 E3 0B 23 ED C3 EB 0D 23 F4 C3 F6 08 23 FC C3 F6 09 23 FC C3 E6 06 23 EC C3 E6 04 23 FC C3 D6 02 23 EC C3 D6 00 23 E4 C3 1C 70 25 EC C3 1C 71 25 F1 C3 11 58 25 F1 C3 09 48 25 F7 C3 04 52 25 F7 C3 FC 42 25 EBD9: 16 00 E8 C3 EB 26 23 E0 01 F7 1F 23 FA 01 DD 7B 23 FD C3 17 73 23 FA C3 08 4E 23 F7 C3 03 52 23 F7 C3 FB 42 23 F2 C3 1E 70 25 FA C3 1E 71 25 FA C3 13 5C 25 FA C3 0B 4C 25 F9 C3 03 50 25 F9 C3 FB 40 25 D8 C3 E7 2C 23 ED C3 EA 0D 23 F5 C3 E2 0B 23 F4 C3 F5 08 23 FC C3 F5 09 23 FC C3 E5 06 23 EC C3 E5 04 23 FC C3 D5 02 23 EC C3 D5 00 23 EC49: 16 00 E0 01 F8 1F 23 E8 C3 EC 26 23 FA 01 DE 7C 23 F2 C3 1B 73 23 F3 C3 10 56 23 F3 C3 08 46 23 F4 C3 FC 44 23 F9 C3 1D 70 25 01 C2 1D 71 25 01 C2 12 56 25 01 C2 0A 46 25 F4 C3 F6 08 23 FC C3 F6 09 23 FB C3 FC 42 65 FB C3 04 52 65 D8 C3 E8 2C 23 ED C3 EB 0D 23 F5 C3 E3 0B 23 FC C3 E6 06 23 EC C3 E6 04 23 FC C3 D6 02 23 EC C3 D6 00 23 ECB9: 12 00 E8 C3 ED 26 23 E0 01 F9 1F 23 FA 01 DF 7D 23 D8 C3 E9 2C 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 ED15: 12 00 E0 01 F9 1F 23 E8 C3 ED 26 23 FA 01 DF 7C 23 D8 C3 E9 2C 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 ED71: 12 00 D8 C3 E9 2C 23 E8 C3 ED 26 23 E0 01 F9 1F 23 FA 01 DF 7B 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 EDCD: 12 00 E0 01 F9 1F 23 E8 C3 ED 26 23 FA 01 DF 7A 23 D8 C3 E9 2C 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 EE29: 12 00 D8 C3 E9 2C 23 E0 01 F9 1F 23 E8 C3 ED 26 23 FA 01 DF 79 23 ED C3 EC 0D 23 F5 C3 E4 0B 23 F2 C3 1F 70 23 FA C3 1F 71 23 FA C3 0D 4C 23 FA C3 15 5C 23 F9 C3 05 50 23 F9 C3 FD 40 23 F4 C3 F7 08 23 FC C3 F7 09 23 FC C3 E7 06 23 EC C3 E7 04 23 FC C3 D7 02 23 EC C3 D7 00 23 unknown data (tilemaps?) EE85 - EFD7: 2A 00 E0 C3 98 44 23 42 C2 98 4A 23 32 C2 A0 58 23 32 C2 98 48 23 22 C2 A0 5C 23 22 C2 98 4C 23 02 C2 98 4E 23 12 C2 A0 56 23 12 C2 98 46 23 01 C2 B8 4E 25 11 C2 C0 56 25 11 C2 B8 46 25 41 C2 B8 4A 25 31 C2 C0 58 25 31 C2 B8 48 25 21 C2 C0 5C 25 21 C2 B8 4C 25 D8 C3 F0 77 25 C8 C3 F0 75 25 B8 C3 F0 73 25 A0 C3 F0 70 25 A8 C3 F0 71 25 D8 C3 E0 77 23 C8 C3 E0 75 23 B8 C3 E0 73 23 A8 C3 E0 71 23 A0 C3 E0 70 23 D0 C3 A0 52 23 D0 C3 98 42 23 B0 C3 A0 52 63 B0 C3 98 42 63 C0 C3 A0 50 23 C0 C3 98 40 23 A0 C3 98 44 63 A1 C3 B8 44 65 B0 C3 B8 42 65 B0 C3 C0 52 65 D0 C3 C0 52 25 C0 C3 C0 50 25 E0 C3 B8 44 25 D0 C3 B8 42 25 C0 C3 B8 40 25 19 00 38 C2 88 0D 23 40 C2 80 0B 23 3E 00 EF 39 23 36 C2 DF 2C 23 46 C2 E7 2A 23 20 C2 DB 2A 23 10 C2 DB 28 23 45 C2 C8 26 23 45 00 C0 1F 23 35 C2 C0 24 23 11 C2 C0 20 23 21 00 C0 0F 23 21 C2 C8 22 23 B7 C3 BD 4C 23 B7 C3 C5 5C 23 99 C3 D7 50 23 99 C3 CF 40 23 DA C3 CA 70 23 E2 C3 CA 71 23 F1 C3 A8 08 23 F9 C3 A8 09 23 F9 C3 98 06 23 E9 C3 98 04 23 F9 C3 88 02 23 E9 C3 88 00 23 EFD8: 12 00 FE 01 DF 7D 63 1A C2 E7 20 63 12 00 E7 0F 63 0A C2 EF 22 63 03 C2 EC 0D 63 FB C3 E4 0B 63 F6 C3 1F 71 63 F6 C3 0D 4C 63 F6 C3 15 5C 63 F7 C3 05 50 63 F7 C3 FD 40 63 FC C3 F7 08 63 F4 C3 F7 09 63 F4 C3 E7 06 63 04 C2 E7 04 63 F4 C3 D7 02 63 04 C2 D7 00 63 F034: 11 00 FE 01 DF 7D 63 07 C2 ED 2A 63 17 C2 ED 28 63 03 C2 EC 0D 63 FB C3 E4 0B 63 FE C3 1F 70 63 F6 C3 1F 71 63 F6 C3 0D 4C 63 F6 C3 15 5C 63 F7 C3 05 50 63 F7 C3 FD 40 63 FC C3 F7 08 63 F4 C3 F7 09 63 F4 C3 E7 06 63 04 C2 E7 04 63 F4 C3 D7 02 63 04 C2 D7 00 63 F08B: 11 00 08 C2 ED 26 63 18 C2 ED 24 63 FE 01 DF 7D 63 03 C2 EC 0D 63 FB C3 E4 0B 63 FE C3 1F 70 63 F6 C3 1F 71 63 F6 C3 0D 4C 63 F6 C3 15 5C 63 F7 C3 05 50 63 F7 C3 FD 40 63 FC C3 F7 08 63 F4 C3 F7 09 63 F4 C3 E7 06 63 04 C2 E7 04 63 F4 C3 D7 02 63 04 C2 D7 00 63 F0E2: 12 00 08 C2 ED 26 63 18 C2 E9 2C 63 18 00 F9 1F 63 FE 01 DF 7D 63 03 C2 EC 0D 63 FB C3 E4 0B 63 FE C3 1F 70 63 F6 C3 1F 71 63 F6 C3 0D 4C 63 F6 C3 15 5C 63 F7 C3 05 50 63 F7 C3 FD 40 63 FC C3 F7 08 63 F4 C3 F7 09 63 F4 C3 E7 06 63 04 C2 E7 04 63 F4 C3 D7 02 63 04 C2 D7 00 63 ;------------------------------------------------------------- PLM data: 25181 - 83 to 08 A1149 - 2F 86 to DA D6 Norfair Chozo Statue To make Golden Chozo works in every area. (Found by JAM & Kej) D6D6: LN chozo statue PLM header D18E init pointer D13F running pointer $84D18E 60 RTS $84D13F 2D 88 0C 00 Load the argument (2 bytes) to A and go to 80:8233 to check the corresponding event bit. If Carry is set (event bit set), use the next argument (2 bytes) as the address to the next instruction. 4D D1 ;pointer to AI branch that removes acid plug and sets fx3 height C1 86 Stores the argument to 7E:1CD7,X, which will be executed every frame before the PLM instruction(s) until something overwrites it. 5C D1 change specific tile properties of a tile to crumble/BTS-83 (chozo statue hand) B4 86 Do nothing. Absolutely, positively, nothing. The PLM will sit on this instruction until something else (often pre-PLM instruction) tells it to change. BC 86 Deletes the PLM header, then exits the instruction loop (PLA, RTS). Used to delete PLMs D14D: ;acid lowering event is set 55 D1 set FX3 height 01 00 B5 A2 frame delay and tilemap BC 86 Deletes the PLM header, then exits the instruction loop (PLA, RTS). Used to delete PLMs A2B5: 01 00 FF 00 00 00 ;one tile, set as air and clear graphic $84D155 A9 D2 02 LDA #$02D2 $84D158 8D 78 19 STA $1978 [$7E:1978] FX3 height (average?) (measured from top of room down) $84D15B 60 RTS $84D15C DA PHX $84D15D E2 20 SEP #$20 $84D15F A9 08 LDA #$08 $84D161 8D 02 42 STA $4202 [$7E:4202] $84D164 AD A5 07 LDA $07A5 [$7E:07A5] $84D167 8D 03 42 STA $4203 [$7E:4203] $84D16A A9 04 LDA #$04 $84D16C C2 20 REP #$20 $84D16E 29 FF 00 AND #$00FF $84D171 18 CLC $84D172 6D 16 42 ADC $4216 [$7E:4216] $84D175 0A ASL A $84D176 AA TAX $84D177 BF 02 00 7F LDA $7F0002,x[$7F:030A] $84D17B C9 FF 00 CMP #$00FF $84D17E D0 0C BNE $0C [$D18C] $84D180 A9 83 B0 LDA #$B083 crumble block with BTS of 83 $84D183 20 B4 82 JSR $82B4 [$84:82B4] alternate PLM spawning routine (alters block type and BTS directly) $84D186 AE 27 1C LDX $1C27 [$7E:1C27] $84D189 9E 37 1C STZ $1C37,x[$7E:1C7F] $84D18C FA PLX $84D18D 60 RTS Enemy spawned PLM will spawn crumble block with BTS 83. D6DA: (crumble BTS 83 spawned block header) D18F init pointer AAE3 running pointer D18F: $84D18F AD A4 09 LDA $09A4 [$7E:09A4] equipped items $84D192 29 00 02 AND #$0200 spacejump $84D195 F0 47 BEQ $47 [$D1DE] if no spacejump, then branch $84D197 AD 02 0B LDA $0B02 [$7E:0B02] What kind of collision detection to use for Samus. 03 = below, 02 = above, 01 = right, 00 = left $84D19A 29 0F 00 AND #$000F $84D19D C9 03 00 CMP #$0003 $84D1A0 D0 3C BNE $3C [$D1DE] if not checking for collisions below Samus, then delete PLM and end $84D1A2 AD 1C 0A LDA $0A1C [$7E:0A1C] current position/state $84D1A5 C9 1D 00 CMP #$001D moving as morph, facing right $84D1A8 F0 0A BEQ $0A [$D1B4] $84D1AA C9 79 00 CMP #$0079 springball facing right $84D1AD F0 05 BEQ $05 [$D1B4] $84D1AF C9 7A 00 CMP #$007A springball facing left $84D1B2 D0 2A BNE $2A [$D1DE] $84D1B4 A9 0C 00 LDA #$000C $84D1B7 22 FA 81 80 JSL $8081FA[$80:81FA] set event (lava drained by statue) $84D1BB A9 01 00 LDA #$0001 $84D1BE 8D B4 0F STA $0FB4 [$7E:0FB4] enemy RAM, Used by AI routines. Speed in SMILE (statue activation flag?) $84D1C1 BE 87 1C LDX $1C87,y[$7E:1CD1] table for PLM's location in the room (7E:0002 array) $84D1C4 BF 02 00 7F LDA $7F0002,x[$7F:030A] $84D1C8 29 FF 0F AND #$0FFF $84D1CB 9F 02 00 7F STA $7F0002,x[$7F:030A] ;turn tiletype of PLM to air? $84D1CF A9 00 00 LDA #$0000 $84D1D2 22 84 F0 90 JSL $90F084[$90:F084] Put #$E713 into $0A42, #$E8DC into $0A44 (ignore player input from moving Samus) $84D1D6 22 D7 83 84 JSL $8483D7[$84:83D7] Creates PLMs. The routine that calls it must have after it the X and Y coordinate of the PLM and the address of the PLM header, in that order, after the JSL to 84:83D7. The PLM will be set up completely and run once. Then the code will resume, after those four bytes. If there are already too many PLMs and the game fails to make a new one, it just resumes code past those four bytes. 0C 1D 13 D1 ;x/y and PLM header $84D1DE A9 00 00 LDA #$0000 $84D1E1 99 37 1C STA $1C37,y[$7E:1C81] stz to PLM header (delete PLM) $84D1E4 38 SEC $84D1E5 60 RTS AAE3: BC 86 Deletes the PLM header, then exits the instruction loop (PLA, RTS). Used to delete PLMs So, the crumble block spawns yet ANOTHER plm... D113: ;yet another PLM spawned by this monstrosity D108 init pointer ;turn the block into air D0F6 running pointer ;generic block breaking animation? D108: $84D108 BE 87 1C LDX $1C87,y[$7E:1CCB] PLM's location in the room (nth block * 2) $84D10B 29 FF 0F AND #$0FFF $84D10E 9F 02 00 7F STA $7F0002,x[$7F:158C] $84D112 60 RTS D0F6: 04 00 45 A3 04 00 4B A3 04 00 51 A3 01 00 57 A3 BC 86 Deletes the PLM header, then exits the instruction loop (PLA, RTS). Used to delete PLMs ;===================================================== WS chozo statue PLMs generated by enemy: D6FC: first of WS statue PLMs, turns slopes in the floor into generic Spike blocks D6F7 init pointer D3EC running pointer $84D6F7 60 RTS D3EC: 01 00 0F 9D frame delay and graphic tilemap F4 D3 spawn 2 spike blocks (BTS 00) in room BC 86 Deletes the PLM header, then exits the instruction loop (PLA, RTS). Used to delete PLMs $84D3F4 DA PHX $84D3F5 A2 08 16 LDX #$1608 block location $84D3F8 A9 00 A0 LDA #$A000 spike block, BTS 00 $84D3FB 20 B4 82 JSR $82B4 [$84:82B4] alternate PLM spawning routine (alters block type and BTS directly) $84D3FE A2 0A 16 LDX #$160A block location $84D401 A9 00 A0 LDA #$A000 spike block, BTS 00 $84D404 20 B4 82 JSR $82B4 [$84:82B4] alternate PLM spawning routine (alters block type and BTS directly) $84D407 FA PLX $84D408 60 RTS D6EE: Main WS statue PLM (creates statue hand, spike bts 80) D616 init pointer AAE3 running pointer $84D616 BE 87 1C LDX $1C87,y[$7E:1CCB] PLM's location in the room (nth block * 2) $84D619 A9 80 B0 LDA #$B080 crumble block with BTS of 80 $84D61C 20 B4 82 JSR $82B4 [$84:82B4] alternate PLM spawning routine (alters block type and BTS directly) $84D61F 60 RTS AAE3: BC 86 Deletes the PLM header, then exits the instruction loop (PLA, RTS). Used to delete PLMs D6F2: crumble BTS 80 D620 init pointer AAE3 running pointer $84D620 A9 01 00 LDA #$0001 $84D623 22 DC 81 80 JSL $8081DC[$80:81DC] checks if the boss bit for the current area matches A. SEC if there's a match. It also pushes and pulls Y for ABSOLUTELY NO REASON. $84D627 90 4E BCC $4E [$D677] if boss not defeated, delete PLM and end $84D629 AD 02 0B LDA $0B02 [$7E:0B02] What kind of collision detection to use for Samus. 03 = below, 02 = above, 01 = right, 00 = left $84D62C 29 0F 00 AND #$000F $84D62F C9 03 00 CMP #$0003 $84D632 D0 43 BNE $43 [$D677] if not colliding with bottom of samus' hitbox, delete PLM and end $84D634 AD 1C 0A LDA $0A1C [$7E:0A1C] current position/state $84D637 C9 1D 00 CMP #$001D moving as morph facing right $84D63A F0 0A BEQ $0A [$D646] $84D63C C9 79 00 CMP #$0079 springball facing right $84D63F F0 05 BEQ $05 [$D646] $84D641 C9 7A 00 CMP #$007A springball facing left $84D644 D0 31 BNE $31 [$D677] $84D646 A9 01 00 LDA #$0001 $84D649 8D B4 0F STA $0FB4 [$7E:0FB4] enemy RAM, Used by AI routines. Speed in SMILE (statue activation flag?) $84D64C A9 02 02 LDA #$0202 $84D64F 8F 27 CD 7E STA $7ECD27[$7E:CD27] set scrolling $84D653 A9 01 01 LDA #$0101 $84D656 8F 2D CD 7E STA $7ECD2D[$7E:CD2D] set scrolling $84D65A BE 87 1C LDX $1C87,y[$7E:1CCB] $84D65D BF 02 00 7F LDA $7F0002,x[$7F:11D6] $84D661 29 FF 0F AND #$0FFF $84D664 9F 02 00 7F STA $7F0002,x[$7F:11D6] set crumble BTS 80 now as air BTS 80 $84D668 A9 00 00 LDA #$0000 $84D66B 22 84 F0 90 JSL $90F084[$90:F084] Put #$E713 into $0A42, #$E8DC into $0A44 (ignore player input from moving Samus) $84D66F 22 D7 83 84 JSL $8483D7[$84:83D7] Creates PLMs. The routine that calls it must have after it the X and Y coordinate of the PLM and the address of the PLM header, in that order, after the JSL to 84:83D7. The PLM will be set up completely and run once. Then the code will resume, after those four bytes. If there are already too many PLMs and the game fails to make a new one, it just resumes code past those four bytes. 17 1D F8 D6 ;x/y and PLM header $84D677 A9 00 00 LDA #$0000 $84D67A 99 37 1C STA $1C37,y[$7E:1C7B] stz to PLM header (delete PLM) $84D67D 38 SEC $84D67E 60 RTS D6F8: another PLM spawned by the Crumble BTS 80 D6F6 init pointer D3CF running pointer $84D6F6 60 RTS D3CF: 01 00 C5 9C frame delay and graphic tilemap D7 D3 spawn slope tiles BC 86 Deletes the PLM header, then exits the instruction loop (PLA, RTS). Used to delete PLMs $84D3D7 DA PHX $84D3D8 A2 08 16 LDX #$1608 block location $84D3DB A9 12 10 LDA #$1012 slope BTS 12 $84D3DE 20 B4 82 JSR $82B4 [$84:82B4] alternate PLM spawning routine (alters block type and BTS directly) $84D3E1 A2 0A 16 LDX #$160A block location $84D3E4 A9 13 10 LDA #$1013 slope BTS 13 $84D3E7 20 B4 82 JSR $82B4 [$84:82B4] alternate PLM spawning routine (alters block type and BTS directly) $84D3EA FA PLX $84D3EB 60 RTS ;============================================= ;== GOLDEN CHOZO INSTRUCTIONS BY SCYZER ====== ;============================================= Gold Chozo Instructions Touch/Shot AI both point to RTL Running AI - Only checks for Samus morphed into it's hand, at which point it changes the instruction pointer to $E3A7 and sets the delay ($0F94,X) to #$0001 ;E7A7 LDX $0E54 JMP [$0FB2,X] RTL ;E445 LDA $0FB4,X ;Check Speed BEQ $0C ;If 0, end routine LDA #$E3A7 STA $0F92,X ;Set pointer to instructions LDA #$0001 STA $0F94,X ;Set delay of instruction to #$0001 RTS Dormant Instructions start at $AA:E39D $806B,$E445 ;Store the argument to $0FB2,X $0001,$EFD8 ;Pointer to a tilemap $812F ;Decrement Y by 2 and store to $0F92,X, then pulls the return address and puts #$C2AE onto the stack Activated instructions start at $AA:E3A7 $8074 ;Store #$807B to $0FB2,X. Makes the running AI jump to RTS $E5D8,$0020 ;Stores argument (#$0020) to $0FAC,X, then uses that value as an index to load a value at $AA:E630, to be used to move the enemy. Then it grabs an X and Y value to center Samus in the claw. $0020,$EFD8 ;Pointer to a tilemap \ $E5D8,$0022 ;Move Chozo claw and Samus | $0008,$F034 ;Pointer to a tilemap | $E5D8,$0024 ;Move Chozo claw and Samus | Extend Chozo arm and grab Samus $0030,$F08B ;Pointer to a tilemap | $E57F ;Play 'Chozo Grab' SFX | $E5D8,$0026 ;Move Chozo claw and Samus / $0040,$F0E2 ;Pointer to a tilemap for #$0040 frames $0006,$F0B4 ;Pointer to a tilemap \ $0008,$F510 ;Pointer to a tilemap | $000A,$F56C ;Pointer to a tilemap | Chozo's eye flash $000C,$F5C8 ;Pointer to a tilemap | $0060,$F624 ;Pointer to a tilemap / $E429 ;Store #$0020 to $1980 (delay until FX3 movement) and #$0040 to $197C (height adjustment speed) $8123,$0005 ;Store the argument (#$0005) to $0F90,X. Used as a loop counter ;E3E5 $000B,$F510 ;Pointer to a tilemap \ $0008,$F56C ;Pointer to a tilemap | $0006,$F5C8 ;Pointer to a tilemap | Chozo blinking $0008,$F624 ;Pointer to a tilemap | $0006,$F5C8 ;Pointer to a tilemap | $0008,$F56C ;Pointer to a tilemap / $8110,$E3E5 ;Decrement $0F90,X. If not 0, jump to argument ($E3E5) -> Blinking animation $8074 ;Store #$807B to #$0FB2,X $E5D8,$0026 ;Move Chozo claw and Samus \ $0080,$F0E2 ;Pointer to a tilemap | $E5D8,$0024 ;Move Chozo claw and Samus | $0050,$F08B ;Pointer to a tilemap | Chozo retracting arm $E5D8,$0022 ;Move Chozo claw and Samus | $0008,$F034 ;Pointer to a tilemap | $E5D8,$0020 ;Move Chozo claw and Samus | $0020,$EFD8 ;Pointer to a tilemap / $E43D ;Put #$E695 into $0A42, #$E725 into $0A44. Allows Samus to move again $E436 ;Put #$02D2 into $1978 (FX3 height) $812F ;Decrement Y by 2 and store to $0F92,X, then pulls the return address and puts #$C2AE onto the stack as a new return address. This essentially makes the enemy sit on this instruction