;;; WRAM ;;; { Slot ID Enemy Enemy RAM 0 $DDBF Crocomire $0F78..0FB7 1 $DDFF Crocomire's tongue $0FB8..0FF7 ; Crocomire $0FA8: Crocomire death sequence index { 0: Death sequence not started 2: Falling 4: Hop 1 - resting 6: Hop 1 - rising 8: Hop 1 - sinking Ah: Hop 2 - resting Ch: Hop 2 - rising Eh: Hop 2 - sinking 10h: Hop 3 - load melting tilemap 12h: Hop 3 - load melting tiles 14h: Hop 3 - uploading to VRAM 16h: Hop 3 - rising 18h: Hop 3 - queue cry and create Crocomire melting HDMA object 1Ah: Hop 3 - melting 1Ch: Hop 3 - clear tilemap 1Eh: Hop 3 - sinking 20h: Hop 4 - resting 22h: Hop 4 - rising 24h: Hop 4 - sinking 26h: Hop 5 - resting 28h: Hop 5 - rising 2Ah: Hop 5 - sinking 2Ch: Hop 6 - load melting tilemap 2Eh: Hop 6 - load melting tiles 30h: Hop 6 - uploading to VRAM 32h: Set index 34h 34h: Hop 6 - rising 36h: Hop 6 - queue cry and create Crocomire melting HDMA object 38h: Hop 6 - melting 3Ah: Hop 6 - clear tilemap 3Ch: Hop 6 - sinking 3Eh: Behind wall - wait for Samus 40h: Behind wall - rumbling 42h: Behind wall - no more rumbling 44h: Breaks down wall 46h: Skeleton falls 48h: Skeleton falls apart 4Ah: Unlock camera 4Ch: Set index 4Eh 4Eh: Set index 50h 50h: Mark event and start post-death music 52h: Dead (due to death sequence, final state) 54h: Set index 56h 56h: Dead (due to room entry, final state) 58h: Flowing down the river (between 3Ch and 3Eh) } $0FAA: Crocomire fight flags. Low byte is incremented when shot (sometimes correctly $BA05, sometimes incorrectly $B951), but never meaningfully read { 8000h: Awake 4000h: Samus hit by claw 2000h: Set by fight function index 1Ah/20h 800h: Damaged 400h: Set by fight function index 24h 200h: Set by fight function index 1Ch } $0FAC: Crocomire fight function index { 4: Asleep 6: Stepping forward 8: Projectile attack Ah: Near spike wall charge Ch: Stepping back Eh: Back off from spike wall 12h: Wait for first damage 14h: Wait for second damage 18h: Power bombed charge } $0FAE: { Crocomire step back/forward counter Crocomire Y subacceleration Crocomire rest timer Crocomire rumble table index Crocomire post-rumbling delay timer } $0FAF: Crocomire Y acceleration. Unit 1/100h px/frameĀ² $0FB0: { Low: Crocomire Y subvelocity. High: Crocomire Y velocity. Unit px/frame Crocomire skeleton X subvelocity } $0FB2: { Low: Crocomire projectile counter. High: Crocomire Y subposition during death sequence Crocomire skeleton X velocity } ; Crocomire's tongue $0FE8: Crocomire tongue X offset (from Crocomire) $0FEE: Crocomire rumbling Y offset $102E: { Crocomire rumble timer Crocomire falling apart timer Crocomire melting X position } $106E: Crocomire rumbling Y offset delta $7E:783E: Crocomire melting HDMA object index $7E:8000: Crocomire acid damage sound effect timer $7E:9000: Crocomire pre-bridge block dust cloud spawned flag $7E:9002: Crocomire bridge part 1 crumbled flag $7E:9006: Crocomire bridge part 2 crumbled flag $7E:900A: Set to 0, never read $7E:9016: Crocomire death sequence crumbling bridge index $7E:9018: Crocomire acid damage smoke timer $05A6: Adjusted source Y offset. [$0694] + y $0688: Crocomire skeleton loading index. Target number of pixels to erase per column (30h) during melting $068A: Crocomire melting tiles loading table (sub)index $068C: Number of pixels to erase per column per frame (30h) during melting $068E: Number of words to load (200h) when loading Crocomire melting tiles $0690: Crocomire melting X offset table index. Index for $9697 $0692: Crocomire melting displacement coefficient. Displacement = y * [$0692] / 10000h. Initialised to 100h. Incremented by 180h up to 5000h, finishing the melting $0694: Initial adjusted destination Y offset during melting. Initialised to 58h ($9BC5/$9C19). Decremented by 3 until 10h $0696: 30h. Never read $0698: Max adjusted destination Y offset (58h) during melting. HDMA data table is processed until [$0694] + y - displacement(y) >= [$0698] $069A: Crocomire melting tiles loading table (base) index $069C..071D: Crocomire melting Y offsets. Only $069C..CC used. Indexed by [$9697 + [$0690]] (melting X offset). Pretty useless, could be replaced by a simple loop counter in $96C8 $7E:2000..2FFF: BG2 tilemap $7E:4000..4FFF: Melting BG2 tiles $7E:CAE0..E7: Crocomire BG2 Y scroll indirect HDMA table. FFh,$CAF0, E1h,$CBEE, 0,0 $7E:CAF0..CCEF: Crocomire BG2 Y scroll HDMA data table } ;;; Execution flow ;;; { $8A5A: Crocomire initialisation { If not dead: Crocomire death sequence index = 0 Crocomire fight function index = 4 (asleep) Crocomire instruction list pointer = $BADE Else: Crocomire death sequence index = 54h Crocomire instruction list pointer = $E1CC } $8C04: Crocomire main AI { Execute [$8C14 + [Crocomire death sequence index]] } Crocomire fight AI functions: { $86F2: Fight intro { $86F2: Index 4 - asleep { If Samus is within E0h pixels: Crocomire fight function index = 12h (wait for first damage) Crocomire instruction list pointer = $BC56 } $8812: Index 12h - wait for first damage { If damaged: Crocomire fight function index = 14h (wait for second damage) Crocomire instruction list pointer = $BC30 (step back) Else if [Crocomire instruction list pointer] >= $BDA2: Crocomire instruction list pointer = $BD2A } $8836: Index 14h - wait for second damage { If damaged: Crocomire fight function index = Ch (stepping back) Crocomire instruction list pointer = $BC30 (step back) Else if [Crocomire instruction list pointer] >= $BDA2: Crocomire instruction list pointer = $BD2A } } $87CA: Stepping { $87CA: Index Ch - stepping back { If $0FAE (step back counter) is 0 or decrements to 0: Crocomire fight function index = 6 (stepping forward) Crocomire instruction list pointer = $BBCE (step forward) Else: Crocomire instruction list pointer = $BC34 (stepping back) } $8717: Index 6 - stepping forward { If damaged and [$0FAE] != 0: Crocomire fight function index = Ch (stepping back) Crocomire instruction list pointer = $BC30 (step back) Else if [Crocomire X position] < 300h: Crocomire fight function index = Ah (near spike wall charge) Crocomire instruction list pointer = $BE7E (near spike wall charge) Else if [Crocomire instruction list pointer] >= $BC34: Crocomire instruction list pointer = $BBCE (step forward) } $8717: Index Ah - near spike wall charge { If damaged: Crocomire fight function index = Ch (stepping back) Crocomire instruction list pointer = $BC30 (step back) } $87E9: Index Eh - back off from spike wall { ; Set by Crocomire instruction list $BE7E (near spike wall charge) If [Crocomire X position] >= 300h: Crocomire fight function index = 6 (stepping forward) Crocomire instruction list pointer = $BBCE (step forward) } } $876C: Index 8 - projectile attack { ; Set by Crocomire instruction lists $BBCE (step forward) If damaged: Crocomire fight function index = Ch (stepping back) Crocomire instruction list pointer = $BC30 (step back) Else if [Crocomire projectile counter] >= 12h: Crocomire fight function index = 6 (stepping forward) Crocomire instruction list pointer = $BBCA (step forward after delay) } } } ;;; Enemy headers ;;; { ________________ $DDBF: Crocomire | _______ $DDFF: Crocomire's tongue | | A600 2000 ; 0: Tile data size B87D B87D ; 2: Palette 7FFF 7FFF ; 4: Health 0028 0028 ; 6: Damage 0030 0008 ; 8: Width 0038 0008 ; Ah: Height A4 A4 ; Ch: Bank 00 00 ; Dh: Hurt AI time 0005 0000 ; Eh: Cry 0006 0006 ; 10h: Boss value 8A5A F67A ; 12h: Initialisation AI 0001 0001 ; 14h: Number of parts 8C04 F6BB ; 18h: Main AI 8005 8005 ; 1Ah: Grapple AI 8687 804C ; 1Ch: Hurt AI 8041 8041 ; 1Eh: Frozen AI 0000 0000 ; 20h: X-ray AI 0000 0000 ; 22h: Death animation B992 0000 ; 28h: Power bomb reaction B950 8023 ; 30h: Enemy touch 0000 802D ; 32h: Enemy shot AD8000 AD8000 ; 36h: Tile data 05 05 ; 39h: Layer F42E F428 ; 3Ah: Drop chances ($B4) F102 F102 ; 3Ch: Vulnerabilities ($B4) 0000 0000 ; 3Eh: Enemy name ($B4) } ;;; Enemy vulnerabilities ;;; { ; Vulnerability format: ; v = fddddddd ; If v = FFh: ; Freeze, no damage ; Else: ; d: Damage multiplier * 2 ; f: Does not freeze ; _________________________________________________________________ 0: Power ; | ______________________________________________________________ 1: Wave ; | | ___________________________________________________________ 2: Ice ; | | | ________________________________________________________ 3: Ice + wave ; | | | | _____________________________________________________ 4: Spazer ; | | | | | __________________________________________________ 5: Spazer + wave ; | | | | | | _______________________________________________ 6: Spazer + ice ; | | | | | | | ____________________________________________ 7: Spazer + ice + wave ; | | | | | | | | _________________________________________ 8: Plasma ; | | | | | | | | | ______________________________________ 9: Plasma + wave ; | | | | | | | | | | ___________________________________ Ah: Plasma + ice ; | | | | | | | | | | | ________________________________ Bh: Plasma + ice + wave ; | | | | | | | | | | | | ; | | | | | | | | | | | | ____________________________ Ch: Missile ; | | | | | | | | | | | | | _________________________ Dh: Super missile ; | | | | | | | | | | | | | | ______________________ Eh: Bomb ; | | | | | | | | | | | | | | | ___________________ Fh: Power bomb ; | | | | | | | | | | | | | | | | ________________ 10h: Speed booster ; | | | | | | | | | | | | | | | | | _____________ 11h: Shinespark ; | | | | | | | | | | | | | | | | | | __________ 12h: Screw attack ; | | | | | | | | | | | | | | | | | | | _______ 13h: Charged beam ; | | | | | | | | | | | | | | | | | | | | ____ 14h: Pseudo screw attack ; | | | | | | | | | | | | | | | | | | | | | _ 15h: Unused ; | | | | | | | | | | | | | | | | | | | | | | $B4:F102 db 80,80,80,80,80,80,80,80,80,80,80,80, 80,80,80,82,80,80,80,00,80,80 } ;;; Enemy drop chances ;;; { ; ________________ ; 0: Small health ; | _____________ ; 1: Big health ; | | __________ ; 2: Missiles ; | | | _______ ; 3: Nothing ; | | | | ____ ; 4: Super missiles ; | | | | | _ ; 5: Power bombs ; | | | | | | $B4:F428 db 00,0A,DC,05,14,00 ; 3.9% 86.3% 2.0% 7.8% - Crocomire's tongue $B4:F42E db 00,78,64,05,14,0A ; 47.1% 39.2% 2.0% 7.8% 3.9% - Crocomire } ;;; Enemy population ;;; { ; ____________________________________ Enemy ID ; | _______________________________ X position ; | | __________________________ Y position ; | | | _____________________ Initialisation parameter ; | | | | ________________ Properties (2000h: process instructions, 800h: process off-screen, 400h: intangible) ; | | | | | ___________ Extra properties (4: extended spritemap format) ; | | | | | | ______ Parameter 1 ; | | | | | | | _ Parameter 2 ; | | | | | | | | $A1:BB0E dx DDBF,0480,0078,BD2A,A800,0004,0000,0000, DDFF,0480,0078,BD2A,A800,0004,0000,0000 FFFF, 00 } ;;; Library background commands ;;; { $8F:B84D dx 0002,7E2000,4800,1000, 0000 $8F:B858 dx 0002,7E2000,4800,1000, 0000 }