;;; Enemy instruction: Go to ;;; $A780ED B9 00 00 LDA $0000,y[$A7:E8D4] $A780F0 A8 TAY $A780F1 6B RTL ;;; Enemy instruction: Kill ;;; $A7812F 88 DEY $A78130 88 DEY $A78131 98 TYA $A78132 9D 92 0F STA $0F92,x[$7E:0F92] $A78135 68 PLA $A78136 F4 AE C2 PEA $C2AE $A78139 6B RTL ;;; Kraid Target colour palette line 6 ;;; $A786C7 dw 6B04, 6B2D, 6B2D, 862D, C219, 4014, 0008, ED04, C631, C318, 2010, 5204, 6B02, 522D, 004A, FF00 ;;; Kraid foot instructions ;;; $A786E7 dw 7FFF,A565, 812F ; Kill $A786ED dw 7FFF,8CE3, 812F ; Kill { $A786F3 dw B633, ; NOP 0004,8CE3, 0004,8CF5, 0004,8D07, 0004,8D19, 0004,8D2B, 0004,8D3D, 0004,8D4F, 0004,8D61, 0004,8D73, 0004,8D85, 0004,8D97, 0003,8DA9, 0001,8DBB, 0001,8DCD, 0001,8DDF, 0001,8DF1, 0001,8E03, 0010,8E15, B636, ; Decrement Kraid Y position B65A, ; Decrement Kraid X position 0001,8E27, B636, ; Decrement Kraid Y position B65A, ; Decrement Kraid X position 0001,8E39, B633, ; NOP 0003,8E39, B636, ; Decrement Kraid Y position B65A, ; Decrement Kraid X position 0001,8E39, B633, ; NOP 0003,8E39, B636, ; Decrement Kraid Y position B65A, ; Decrement Kraid X position 0001,8E5D, B633, ; NOP 0003,8E5D, B63C, ; Increment Kraid Y position, set screen shaking B65A, ; Decrement Kraid X position 0001,8E6F, B63C, ; Increment Kraid Y position, set screen shaking B65A, ; Decrement Kraid X position 0001,8E81, B63C, ; Increment Kraid Y position, set screen shaking B65A, ; Decrement Kraid X position 0001,8E93, B63C, ; Increment Kraid Y position, set screen shaking B65A, ; Decrement Kraid X position B64E, ; Play sound library 2: 76h 0001,8EA5, B633, ; NOP B65A, ; Decrement Kraid X position 0001,8EB7, B65A, ; Decrement Kraid X position 0001,8EC9, B65A, ; Decrement Kraid X position 0001,8EDB, B65A, ; Decrement Kraid X position 0001,8EED, B65A, ; Decrement Kraid X position 0001,8EFF, B65A, ; Decrement Kraid X position 0001,8F11, 0001,8CE3, 812F ; Kill } ; This is just $86F3 but faster { $A787BD dw B633, ; NOP 0001,8CE3, 0001,8CF5, 0001,8D07, 0001,8D19, 0001,8D2B, 0001,8D3D, 0001,8D4F, 0001,8D61, 0001,8D73, 0001,8D85, 0001,8D97, 0001,8DA9, 0001,8DBB, 0001,8DCD, 0001,8DDF, 0001,8DF1, 0001,8E03, 0004,8E15, B636, ; Decrement Kraid Y position B667, ; Decrement Kraid X position 0001,8E27, B636, ; Decrement Kraid Y position B667, ; Decrement Kraid X position 0001,8E39, B633, ; NOP 0001,8E39, B636, ; Decrement Kraid Y position B667, ; Decrement Kraid X position 0001,8E39, B633, ; NOP 0001,8E39, B636, ; Decrement Kraid Y position B667, ; Decrement Kraid X position 0001,8E5D, B633, ; NOP 0001,8E5D, B63C, ; Increment Kraid Y position, set screen shaking B667, ; Decrement Kraid X position 0001,8E6F, B63C, ; Increment Kraid Y position, set screen shaking B667, ; Decrement Kraid X position 0001,8E81, B63C, ; Increment Kraid Y position, set screen shaking B667, ; Decrement Kraid X position 0001,8E93, B63C, ; Increment Kraid Y position, set screen shaking B667, ; Decrement Kraid X position B64E, ; Play sound library 2: 76h 0001,8EA5, B633, ; NOP B667, ; Decrement Kraid X position 0001,8EB7, B667, ; Decrement Kraid X position 0001,8EC9, B667, ; Decrement Kraid X position 0001,8EDB, B667, ; Decrement Kraid X position 0001,8EED, B667, ; Decrement Kraid X position 0001,8EFF, 0001,8F11, B667, ; Decrement Kraid X position 0001,8CE3, 812F ; Kill } { $A78887 dw B633, ; NOP B674, ; Increment Kraid X position 0004,8F47, B674, ; Increment Kraid X position 0001,8F23, B674, ; Increment Kraid X position 0001,8EFF, B674, ; Increment Kraid X position 0001,8EED, B674, ; Increment Kraid X position 0001,8EDB, B674, ; Increment Kraid X position 0001,8EC9, B674, ; Increment Kraid X position 0001,8EB7, B636, ; Decrement Kraid Y position B674, ; Increment Kraid X position 0001,8EA5, B636, ; Decrement Kraid Y position B674, ; Increment Kraid X position 0001,8E93, B636, ; Decrement Kraid Y position B674, ; Increment Kraid X position 0001,8E81, B636, ; Decrement Kraid Y position B674, ; Increment Kraid X position 0001,8E6F, B63C, ; Increment Kraid Y position, set screen shaking B674, ; Increment Kraid X position 0001,8E5D, B63C, ; Increment Kraid Y position, set screen shaking B674, ; Increment Kraid X position 0001,8E4B, B63C, ; Increment Kraid Y position, set screen shaking B674, ; Increment Kraid X position 0001,8E39, B63C, ; Increment Kraid Y position, set screen shaking B64E, ; Play sound library 2: 76h 0001,8E27, B633, ; NOP 0014,8E15, 0004,8E03, 0004,8DF1, 0004,8DDF, 0004,8DCD, 0004,8DBB, 0004,8DA9, 0004,8D97, 0004,8D85, 0001,8D73, 0001,8D61, 0001,8D4F, 0001,8D3D, 0001,8D2B, 0001,8D19, 0001,8D07, 0001,8CF5, 80ED,8887 ; Go to start } { ;$A7893D dw B633, ; NOP ; B683, ; 0004,8F47, ; B683, ; 0001,8F23, ; B683, ; 0001,8EFF, ; B683, ; 0001,8EED, ; B683, ; 0001,8EDB, ; B683, ; 0001,8EC9, ; B683, ; 0001,8EB7, ; B636, ; Decrement Kraid Y position ; B683, ; 0001,8EA5, ; B636, ; Decrement Kraid Y position ; B683, ; 0001,8E93, ; B636, ; Decrement Kraid Y position ; B683, ; 0001,8E81, ; B636, ; Decrement Kraid Y position ; B683, ; 0001,8E6F, ; B63C, ; Increment Kraid Y position, set screen shaking ; B683, ; 0001,8E5D, ; B63C, ; Increment Kraid Y position, set screen shaking ; B683, ; 0001,8E4B, ; B63C, ; Increment Kraid Y position, set screen shaking ; B683, ; 0001,8E39, ; B63C, ; Increment Kraid Y position, set screen shaking ; B64E, ; Play sound library 2: 76h ; 0001,8E27, ; B633, ; NOP ; 0014,8E15, 0004,8E03, 0004,8DF1, 0004,8DDF, 0004,8DCD, 0004,8DBB, 0004,8DA9, 0004,8D97, 0004,8D85, 0001,8D73, 0001,8D61, 0001,8D4F, 0001,8D3D, 0001,8D2B, 0001,8D19, 0001,8D07, 0001,8CF5, ; 80ED,893D ; Go to start } ;;; Kraid arm instructions ;;; $A789F3 dw 0006,8F59, 0006,8F83, 0006,8FAD, 0006,8FD7, 0006,9001, 0006,902B, 0006,9055, 0006,907F, 0006,90A9, 0006,90D3, 0006,907F, 0006,9055, 0006,902B, 0006,9001, 0006,8FD7, 0006,8FAD, 0006,8F83, 0020,8F59, 8A8F, ; If Kraid HP < 1/2 Kraid health: go to $8A41 80ED,89F3 ; Go to start ; This is just $89F3 but slower $A78A41 dw 0008,8F59, 0008,8F83, 0008,8FAD, 0008,8FD7, 0008,9001, 0008,902B, 0008,9055, 0008,907F, 0008,90A9, 0008,90D3, 0008,907F, 0008,9055, 0008,902B, 0008,9001, 0008,8FD7, 0008,8FAD, 0008,8F83, 0030,8F59, 8A8F, ; Nothing 80ED,8A41 ; Go to start ;;; $A78A8F AD 8C 0F LDA $0F8C [$7E:0F8C] ;\ $A78A92 CF 12 78 7E CMP $7E7812[$7E:7812] ;} If Kraid HP < 1/2 Kraid health: $A78A96 10 0B BPL $0B [$8AA3] ;/ $A78A98 AD D2 0F LDA $0FD2 [$7E:0FD2] ;\ $A78A9B C9 41 8A CMP #$8A41 ;} If Kraid arm instruction < $8A41 $A78A9E 10 03 BPL $03 [$8AA3] ;/ $A78AA0 A0 41 8A LDY #$8A41 ; Slow down arm movement $A78AA3 6B RTL ;;; Kraid arm instructions ;;; $A78AA4 dw 0006,90FD, 0006,9127, 0006,9151, 0006,917B, 0006,91A5, 0006,91CF, 0006,91F9, 0006,9223, 0006,924D, 0006,9277, 0006,9223, 0006,91F9, 0006,91CF, 0006,91A5, 0006,917B, 0006,9151, 0006,9127, 0020,90FD, 80ED,8AA4 ; Go to start $A78AF0 dw 0006,8F59, 0006,92A1, 7FFF,92AB, 812F ; Kill ;;; Kraid lint instructions ;;; $A78AFE dw 7FFF,A5DF, 812F ; Kill $A78B04 dw 7FFF,8C6C, 812F ; Kill ;;; Kraid fingernail_A instructions ;;; $A78B0A dw 0003,A617, 0003,A623, 0003,A639, 0003,A645, 0003,A65B, 0003,A667, 0003,A67D, 0003,A689, 80ED,8B0A ; Go to start ;$A78B2E dw 0002, 0000,0000,9572,93F7, FFF7,FFF6,94E1,92D1 ;$A78B40 dw 0002, FFF9,FFF8,94E8,92EB, 0001,0000,9572,93F7 ;$A78B52 dw 0002, FFF8,FFF8,94F4,92F9, 0000,0000,9572,93F7 ;$A78B64 dw 0002, FFF8,FFF8,94FB,9313, 0000,0000,9572,93F7 ;$A78B76 dw 0002, FFF6,0001,94E8,92EB, 0000,0000,952D,9371 ;$A78B88 dw 0002, FFF6,0000,94F4,92F9, 0000,0000,952D,9371 ;$A78B9A dw 0002, FFF6,0000,94FB,9313, 0000,0000,952D,9371 ;$A78BAC dw 0002, FFF6,0000,9507,9321, 0000,0000,952D,9371 ;$A78BBE dw 0002, FFFA,0006,94F4,92F9, 0000,0000,9539,937F ;$A78BD0 dw 0002, FFFA,0006,94FB,9313, 0000,0000,9539,937F ;$A78BE2 dw 0002, FFF8,0006,9507,9321, 0000,0000,9539,937F ;$A78BF4 dw 0002, FFF8,0006,950E,933B, 0000,0000,9539,937F ;$A78C06 dw 0002, 0001,000A,94FB,9313, 0000,0000,9540,9399 ;$A78C18 dw 0002, 0000,000A,9507,9321, 0000,0000,9540,9399 ;$A78C2A dw 0002, FFFF,000C,950E,933B, 0000,0000,9540,9399 ;$A78C3C dw 0002, 0000,000B,951A,9349, 0000,0000,9540,9399 ;$A78C4E dw 0001, 0000,0000,95B4,9439 ;$A78C58 dw 0001, 0000,0000,958A,941F ;$A78C62 dw 0001, 0000,0000,9579,9411 ;;; Kraid lint OAM entries ;;; $A78C6C dw 0005, 01F4,08,21C2, 81E4,00,21B0, 81F4,F8,21A2, 81E4,F8,21A0, 8004,F8,21A9 ;$A78C88 dw 0001, 0000,0000,94DA,92C3 ;$A78C92 dw 0002, 0000,0000,95DE,92C3, 000C,0030,9686,92C3 ;$A78CA4 dw 0002, 0000,0000,9608,92C3, 0000,0039,9686,92C3 ;$A78CB6 dw 0002, 0000,0000,9632,92C3, FFF0,003F,9686,92C3 ;$A78CD8 dw 0002, 0000,0000,965C,92C3, FFDF,003D,9686,92C3 ;$A78CEA dw 0001, 0000,0000,96CB,9461 ;;; Kraid foot OAM / hitboxes ;;; { $A78CE3 dw 0002, 0008,0028,9686,9453, 0000,0000,95DE,9453 $A78CF5 dw 0002, 0006,0027,9686,9453, FFFE,FFFF,95DE,9453 $A78D07 dw 0002, 0004,0026,9686,9453, FFFC,FFFE,95DE,9453 $A78D19 dw 0002, 0002,0025,9686,9453, FFFA,FFFD,95DE,9453 $A78D2B dw 0002, 0000,0024,9686,9453, FFF8,FFFC,95DE,9453 $A78D3D dw 0002, FFFE,0023,9686,9453, 0005,FFF1,9608,9453 $A78D4F dw 0002, FFFC,0022,9686,9453, 0003,FFF0,9608,9453 $A78D61 dw 0002, FFFA,0021,9686,9453, 0001,FFEF,9608,9453 $A78D73 dw 0002, FFF8,0020,9686,9453, FFFF,FFEE,9608,9453 $A78D85 dw 0002, FFF6,001F,9686,9453, FFFD,FFED,9608,9453 $A78D97 dw 0002, FFF4,001D,9686,9453, 000C,FFE6,9632,9453 $A78DA9 dw 0002, FFF2,001C,9686,9453, 001A,FFE9,965C,9453 $A78DBB dw 0002, FFF0,001E,9686,9453, 0018,FFEB,965C,9453 $A78DCD dw 0002, FFEE,0020,9686,9453, 0016,FFED,965C,9453 $A78DDF dw 0002, FFEC,0022,9686,9453, 0014,FFEF,965C,9453 $A78DF1 dw 0002, FFEA,0024,9686,9453, 0012,FFF1,965C,9453 $A78E03 dw 0002, FFE8,0026,9686,9453, 0010,FFF3,965C,9453 $A78E15 dw 0002, FFE6,0028,9686,9453, 000E,FFF5,965C,9453 $A78E27 dw 0002, FFE8,0028,9686,9453, 0010,FFF6,965C,9453 $A78E39 dw 0002, FFEA,0028,9686,9453, 0012,FFF6,965C,9453 $A78E4B dw 0002, FFEC,0028,9686,9453, 0014,FFF6,965C,9453 $A78E5D dw 0002, FFEE,0028,9686,9453, 0006,FFF1,9632,9453 $A78E6F dw 0002, FFF0,0028,9686,9453, 0008,FFF1,9632,9453 $A78E81 dw 0002, FFF2,0028,9686,9453, FFF9,FFF6,9608,9453 $A78E93 dw 0002, FFF4,0028,9686,9453, FFFB,FFF6,9608,9453 $A78EA5 dw 0002, FFF6,0028,9686,9453, FFFD,FFF6,9608,9453 $A78EB7 dw 0002, FFF8,0028,9686,9453, FFFF,FFF6,9608,9453 $A78EC9 dw 0002, FFFA,0028,9686,9453, 0001,FFF6,9608,9453 $A78EDB dw 0002, FFFC,0028,9686,9453, 0003,FFF6,9608,9453 $A78EED dw 0002, FFFE,0028,9686,9453, 0005,FFF6,9608,9453 $A78EFF dw 0002, 0000,0028,9686,9453, 0007,FFF6,9608,9453 $A78F11 dw 0002, 0002,0028,9686,9453, FFFA,0000,95DE,9453 $A78F23 dw 0002, 0004,0028,9686,9453, FFFC,0000,95DE,9453 ;$A78F35 dw 0002, 0006,0028,9686,9453, FFFE,0000,95DE,9453 $A78F47 dw 0002, 0008,0028,9686,9453, 0000,0000,95DE,9453 } ;;; Kraid arm OAM / hitboxes ;;; { $A78F59 dw 0005, FFDC,FFDF,94E1,92D1, FFE4,FFE8,9572,93F7, 0000,0000,95B4,9439, FFDC,FFD8,94E1,92D1, FFE4,FFE1,9572,93F7 $A78F83 dw 0005, FFDA,FFDF,94E8,92EB, FFE2,FFE6,9572,93F7, 0000,0000,95B4,9439, FFDC,FFD8,94E1,92D1, FFE4,FFE1,9572,93F7 $A78FAD dw 0005, FFD0,FFF3,94F4,92F9, FFDA,FFF3,952D,9371, 0000,0000,958A,941F, FFD3,FFE5,94E8,92EB, FFDB,FFED,9572,93F7 $A78FD7 dw 0005, FFD2,FFF3,94FB,9313, FFDB,FFF3,952D,9371, 0000,0000,958A,941F, FFD3,FFED,94F4,92F9, FFDC,FFEE,952D,9371 $A79001 dw 0005, FFD3,0008,9507,9321, FFDA,0002,9539,937F, 0000,0000,9579,9411, FFD2,0003,94FB,9313, FFD9,FFFD,9539,937F $A7902B dw 0005, FFD4,0008,9507,9321, FFDB,0002,9539,937F, 0000,0000,9579,9411, FFD2,0004,9507,9321, FFD9,FFFE,9539,937F $A79055 dw 0005, FFD9,000A,950E,933B, FFDA,0000,9540,9399, 0000,0000,9579,9411, FFD5,000A,950E,933B, FFD7,FFFE,9540,9399 $A7907F dw 0005, FFD9,000A,950E,933B, FFDA,0000,9540,9399, 0000,0000,9579,9411, FFD5,0009,950E,933B, FFD7,FFFE,9540,9399 $A790A9 dw 0005, FFD9,000A,951A,9349, FFDA,0000,9540,9399, 0000,0000,9579,9411, FFD5,0009,950E,933B, FFD7,FFFE,9540,9399 $A790D3 dw 0005, FFD9,000A,951A,9349, FFDA,0000,9540,9399, 0000,0000,9579,9411, FFD6,0009,951A,9349, FFD6,FFFE,9540,9399 $A790FD dw 0005, FFDC,FFDF,A47C,92D1, FFE4,FFE8,A4DB,93F7, 0000,0000,A53B,9439, FFDC,FFD8,A47C,92D1, FFE4,FFE1,A4DB,93F7 $A79127 dw 0005, FFDA,FFDF,A483,92EB, FFE2,FFE6,A4DB,93F7, 0000,0000,A53B,9439, FFDC,FFD8,A47C,92D1, FFE4,FFE1,A4DB,93F7 $A79151 dw 0005, FFD0,FFF3,A48F,92F9, FFDA,FFF3,A4BC,9371, 0000,0000,A511,941F, FFD3,FFE5,A483,92EB, FFDB,FFED,A4DB,93F7 $A7917B dw 0005, FFD2,FFF3,A496,9313, FFDB,FFF3,A4BC,9371, 0000,0000,A511,941F, FFD3,FFED,A48F,92F9, FFDC,FFEE,A4BC,9371 $A791A5 dw 0005, FFD3,0008,A4A2,9321, FFDA,0002,A4C8,937F, 0000,0000,A500,9411, FFD2,0003,A496,9313, FFD9,FFFD,A4C8,937F $A791CF dw 0005, FFD4,0008,A4A2,9321, FFDB,0002,A4C8,937F, 0000,0000,A500,9411, FFD2,0004,A4A2,9321, FFD9,FFFE,A4C8,937F $A791F9 dw 0005, FFD9,000A,A4A9,933B, FFDA,0000,A4CF,9399, 0000,0000,A500,9411, FFD5,000A,A4A9,933B, FFD7,FFFE,A4CF,9399 $A79223 dw 0005, FFD9,000A,A4A9,933B, FFDA,0000,A4CF,9399, 0000,0000,A500,9411, FFD5,0009,A4A9,933B, FFD7,FFFE,A4CF,9399 $A7924D dw 0005, FFD9,000A,A4B5,9349, FFDA,0000,A4CF,9399, 0000,0000,A500,9411, FFD5,0009,A4A9,933B, FFD7,FFFE,A4CF,9399 $A79277 dw 0005, FFD9,000A,A4B5,9349, FFDA,0000,A4CF,9399, 0000,0000,A500,9411, FFD6,0009,A4B5,9349, FFD6,FFFE,A4CF,9399 $A792A1 dw 0001, 0000,0000,A69F,946F $A792AB dw 0001, 0000,0000,A6DD,947D } ;;; Kraid arm hitbox entries ;;; $A792D1 dw 0002, FFF3,FFF5,FFFD,FFFB,9490,94B6, FFF7,FFFB,0001,0002,9490,94B6 $A792EB dw 0001, FFF0,FFFB,0001,0002,9490,94B6 $A792F9 dw 0002, FFF7,FFFE,0001,0007,9490,94B6, FFF4,0003,FFFA,000C,9490,94B6 $A79313 dw 0001, FFFA,FFFF,0001,000E,9490,94B6 $A79321 dw 0002, FFFD,FFFE,0006,0009,9490,94B6, 0002,0007,000B,000B,9490,94B6 $A7933B dw 0001, FFFF,FFFC,000E,0004,9490,94B6 $A79349 dw 0002, FFFD,FFF9,0006,0002,9490,94B6, 0004,FFF4,000A,FFFF,9490,94B6 $A79371 dw 0001, FFF1,FFFB,0002,0004,9490,94B6 $A7937F dw 0002, FFF5,0002,FFFC,000A,9490,94B6, FFFA,FFFD,0003,0005,9490,94B6 $A79399 dw 0001, FFFC,FFFE,0003,000D,9490,94B6 $A793F7 dw 0002, FFF4,FFF4,FFFD,FFFD,9490,94B6, FFFA,FFFA,0003,0002,9490,94B6 $A79411 dw 0001, FFD3,FFF7,0004,0008,948B,94B6 $A7941F dw 0002, FFE4,FFEF,FFF4,0000,948B,94B6, FFD6,FFE9,FFE4,FFFA,948B,94B6 $A79439 dw 0002, FFEA,FFE7,FFF8,FFFB,948B,94B6, FFDD,FFDD,FFED,FFEF,948B,94B6 ;;; Kraid foot hitbox entry ;;; $A79453 dw 0001, FFFA,FFFA,0006,0006,948B,94B5 ;$A79461 dw 0001, FFFE,FFFD,0002,0003,948B,94B5 ;;; Kraid arm hitbox entry ;;; $A7946F dw 0001, FFC0,FFD0,FFE0,FFF0,948B,94B6 $A7947D dw 0001, FFC0,FFFC,0000,0004,948B,94B6 ;;; Kraid limbs Samus collision ;;; $A7948B 22 77 A4 A0 JSL $A0A477[$A0:A477] ; Normal Enemy Touch AI $A7948F 6B RTL ;;; Kraid arm Touch AI / Samus collision ;;; $A79490 AD A8 18 LDA $18A8 [$7E:18A8] ; Invincibility timer $A79493 F0 01 BEQ $01 [$9496] $A79495 6B RTL $A79496 20 A4 94 JSR $94A4 [$A7:94A4] ; Knock Samus back $A79499 A9 9B B8 LDA #$B89B ; Move forwards? $A7949C 8D A8 10 STA $10A8 [$7E:10A8] ;;; Kraid Touch AI ;;; $A7949F 22 97 A4 A0 JSL $A0A497[$A0:A497] ; Normal touch AI, but skips death animation $A794A3 6B RTL ;;; Knock Samus back ;;; $A794A4 A9 04 00 LDA #$0004 $A794A7 8D 58 0B STA $0B58 [$7E:0B58] $A794AA A9 F8 FF LDA #$FFF8 $A794AD 8D 5C 0B STA $0B5C [$7E:0B5C] $A794B0 60 RTS ;;; Normal Enemy Shot AI ;;; $A794B1 22 3D A6 A0 JSL $A0A63D[$A0:A63D] $A794B5 6B RTL ;;; Kraid arm projectile collision ;;; $A794B6 BB TYX $A794B7 20 CB B0 JSR $B0CB [$A7:B0CB] ; Spawn explosion enemy projectile $A794BA B9 04 0C LDA $0C04,y[$A7:F10D] ;\ $A794BD 09 10 00 ORA #$0010 ;} Kill beam $A794C0 99 04 0C STA $0C04,y[$A7:F10D] ;/ $A794C3 6B RTL ;;; Some Kraid arm OAM entries ;;; $A794E1 dx 0001, 81F2,F4,3126 $A794E8 dx 0002, 01F9,FB,3129, 01F1,FB,3128 $A794F4 dx 0001, 81F2,FD,312A $A794FB dx 0002, 01FA,07,3139, 01FA,FF,3138 $A79507 dx 0001, 81FD,FD,F126 $A7950E dx 0002, 01FF,FD,F129, 0007,FD,F128 $A7951A dx 0001, 81FD,F4,F12A ;$A79521 dx 0002, 01FC,F2,F139, 01FC,FA,F138 ;$A7952D dx 0002, 01FA,FC,F12E, 01F2,FC,B12E ;$A79539 dx 0001, 81F4,FC,B12C ;$A79540 dx 0002, 01FC,06,B13E, 01FC,FE,313E ;$A7954C dx 0001, 81FC,FC,312C ;$A79553 dx 0002, 0006,FC,712E, 01FE,FC,312E ;$A7955F dx 0001, 81FC,F4,712C ;$A79566 dx 0002, 01FD,FA,F13E, 01FD,F2,713E ;$A79572 dx 0001, 81F4,F4,312C ;$A79579 dx 0003, 81F4,F8,3104, 81E4,F8,3102, 81D4,F8,3100 ;$A7958A dx 0008, 01EC,00,311C, 01FC,F0,310F, 01F4,F0,310E, 01E4,E8,310D, 01DC,F8,310C, 81F4,F8,310A, 81E4,F0,3108, 81D4,E8,3106 ;$A795B4 dx 0008, 01FC,ED,313F, 01EC,FD,312F, 01EC,F5,311F, 01EC,DD,311E, 01E4,ED,311D, 81F4,F5,3124, 81EC,E5,3122, 81DC,DD,3120 ;;; Some Kraid foot OAM entries ;;; $A795DE dx 0008, 8020,1C,315A, 8020,14,314A, 8010,1C,3148, 01F8,0C,314C, 8010,0C,3146, 8000,0C,3144, 8008,FC,3142, 81F8,FC,3140 $A79608 dx 0008, 8012,28,3168, 800A,28,3167, 8010,18,3182, 8000,18,3180, 8008,08,3165, 81F8,08,3163, 8000,F8,3161, 81F8,F8,3160 $A79632 dx 0008, 81F9,2C,31AD, 81F8,1C,318D, 81F8,0C,316D, 81F8,FC,314D, 8001,2C,31AE, 8000,1C,318E, 8000,0C,316E, 8000,FC,314E $A7965C dx 0008, 81F0,2C,31A5, 81E8,2C,31A4, 81F8,1C,31CE, 81E8,1C,31CC, 8000,0C,317A, 81F0,0C,3188, 8000,FC,3186, 81F0,FC,3184 $A79686 dx 000C, 01D8,F4,31C3, 0018,F4,319A, 8000,F4,31C8, 81F0,F4,31C6, 81E0,F4,31C4, 81D0,FC,31A7, 8020,FC,31AB, 8020,F4,319B, 8010,FC,31DA, 8000,FC,31D8, 81F0,FC,31D6, 81E0,FC,31D4 ;$A796C4 dx 0001, 81F8,F8,21D0 ;$A796CB dx 0001, 01FC,FC,21D2 ;;; Some $0FAA instructions ;;; $A796D2 dw 000A,97C8,9788,FFFF, 000A,9AC8,9790,97B0, 000A,9DC8,9798,97B8, AF94, 0040,A0C8,97A0,97C0, 000A,9DC8,9798,97B8, 000A,9AC8,9790,97B0, 000A,97C8,9788,FFFF, FFFF $A7974A dw 0005,97C8,9788,FFFF, $A79752 dw 000A,9AC8,9790,97B0, 0005,97C8,9788,FFFF, FFFF ;;; $A79788 dw 0010, FF88, 0028, FFA8 $A79790 dw 0010, FF88, 0028, FF98 $A79798 dw 0010, FF80, 0028, FF90 $A797A0 dw 0010, FF80, 0028, FF88 ;$A797A8 dw 0000, 0000, 0000, 0000 $A797B0 dw 0006, FFA0, 0020, FFB0 $A797B8 dw 0000, FF98, 0020, FFB0 $A797C0 dw 0000, FF90, 0020, FFB0 ;;; { $A797C8 dw 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C00, 3C01, 3C02, 3C03, 3C04, 3C05, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C06, 3C07, 3C08, 3C09, 3C0A, 3C0B, 3C0C, 3C0D, 3C0E, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C0F, 3C10, 3C11, 3C12, 3C13, 3C14, 3C15, 3C16, 3C17, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C18, 3C19, 3C1A, 3C1B, 3C1C, 3C1D, 3C1E, 3C1F, 3C20, 3C21, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C22, 3C23, 3C24, 3C25, 3C26, 3C27, 3C28, 3C29, 3C2A, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C2B, 3C2C, 3C2D, 3C2E, 3C2F, 3C30, 3C31, 3C32, 3C33, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C34, 3C35, 3C36, 3C37, 3C38, 3C39, 3C3A, 3C3B, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C3C, 3C3D, 3C3E, 3C3F, 3C40, 3C41, 3C42, 3C43, 3C44, 3C45, 3C46, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C47, 3C48, 3C49, 3C4A, 3C4B, 3C4C, 3C4D, 3C4E, 3C4F, 3C50, 3C51, 3C52, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C53, 3C54, 3C55, 3C56, 3C57, 3C58, 3C59, 3C5A, 3C5B, 3C5C, 3C5D, 3C5E, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C5F, 3C60, 3C61, 3D50, 3D50, 3C62, 3C63, 3C64, 3C65, 3C66, 3C67, 3C68, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C69, 3C6A, 3D50, 3D50, 3D50, 3C6B, 3C6C, 3C6D, 3C6E, 3C6F, 3C70, 3C71, 3C72, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338 $A79AC8 dw 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C73, 3C74, 3C75, 3C76, 3C77, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C78, 3C79, 3C7A, 3C7B, 3C7C, 3C7D, 3C7E, 3C7F, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C80, 3C81, 3C82, 3C83, 3C84, 3C85, 3C86, 3C87, 3C88, 3C89, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C8A, 3C8B, 3C8C, 3C8D, 3C8E, 3C8F, 3C90, 3C91, 3C92, 3C93, 3C94, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C95, 0338, 3C96, 3C97, 3C98, 3C99, 3C9A, 3C9B, 3C9C, 3C9D, 3C9E, 3C9F, 3CA0, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CA1, 3CA2, 3CA3, 3CA4, 3CA5, 3CA6, 3CA7, 3CA8, 3CA9, 3CAA, 3CAB, 3CAC, 3CAD, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CAE, 3CAF, 3CB0, 3CB1, 3CB2, 3CB3, 3CB4, 3C43, 3C44, 3C45, 3C46, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CB5, 3CB6, 3CB7, 3CB8, 3C4C, 3C4D, 3C4E, 3C4F, 3C50, 3C51, 3C52, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CB9, 3CBA, 3CBB, 3C56, 3C57, 3C58, 3C59, 3C5A, 3C5B, 3C5C, 3C5D, 3C5E, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C5F, 3C60, 3C61, 3D50, 3D50, 3C62, 3C63, 3C64, 3C65, 3C66, 3C67, 3C68, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C69, 3C6A, 3D50, 3D50, 3D50, 3C6B, 3C6C, 3C6D, 3C6E, 3C6F, 3C70, 3C71, 3C72, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338 $A79DC8 dw 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CBC, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CBD, 3CBE, 3CBF, 3CC0, 3CC1, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CC2, 3CC3, 3CC4, 3CC5, 3CC6, 3CC7, 3CC8, 3CC9, 3CCA, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CCB, 3CCC, 3CCD, 3CCE, 3CCF, 3CD0, 3CD1, 3CD2, 3CD3, 3CD4, 3D43, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CD5, 3CD6, 3CD7, 3CD8, 3CD9, 3CDA, 3CDB, 3CDC, 3CDD, 3CDE, 3CDF, 3CE0, 3CE1, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CE2, 3CE3, 3CE4, 3CE5, 3CE6, 3CE7, 3CE8, 3CE9, 3CEA, 3CEB, 3CEC, 3CED, 3CEE, 3CEF, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CF0, 3CF1, 3CF2, 3CF3, 3CF4, 3CF5, 3CF6, 3CF7, 3CF8, 3CF9, 3CFA, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CFB, 3CFC, 3CB7, 3CFD, 3CFE, 3C4D, 3C4E, 3C4F, 3C50, 3C51, 3CFF, 3D00, 3D44, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CB9, 3CBA, 3CBB, 3C56, 3C57, 3C58, 3C59, 3C5A, 3C5B, 3C5C, 3C5D, 3C5E, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C5F, 3C60, 3C61, 3D50, 3D50, 3C62, 3C63, 3C64, 3C65, 3C66, 3C67, 3C68, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C69, 3C6A, 3D50, 3D50, 3D50, 3C6B, 3C6C, 3C6D, 3C6E, 3C6F, 3C70, 3C71, 3C72, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338 $A7A0C8 dw 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3D01, 3D02, 0338, 3D03, 3D04, 3D05, 3D06, 3D07, 3D08, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3D09, 3D0A, 3D0B, 3D0C, 3D0D, 3D0E, 3D0F, 3D10, 3D11, 3D12, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3D13, 3D14, 3D15, 3D16, 3D17, 3D18, 3D19, 3D1A, 3D1B, 3D1C, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3D1D, 3D1E, 3D1F, 3D20, 3D21, 3D22, 3D23, 3D24, 3D25, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3D26, 3D27, 3D28, 3D29, 3D2A, 3D2B, 3D2C, 3D2D, 3D2E, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3D2F, 3D30, 3CB7, 3D31, 3D32, 3D33, 3D34, 3D35, 3D36, 3C51, 3D37, 3D38, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3CB9, 3CBA, 3CBB, 3C56, 3C57, 3C58, 3C59, 3D39, 3D3A, 3D3B, 3D3C, 3D3D, 3D3E, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C5F, 3C60, 3C61, 3D50, 3D50, 3C62, 3C63, 3C64, 3C65, 3C66, 3D3F, 3D40, 3D41, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 3C69, 3C6A, 3D50, 3D50, 3D50, 3C6B, 3C6C, 3C6D, 3C6E, 3C6F, 3C70, 3C71, 3D42, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338, 0338 } ;;; Kraid arm OAM entries ;;; $A7A47C dx 0001, 81F2,F4,2126 $A7A483 dx 0002, 01F9,FB,2129, 01F1,FB,2128 $A7A48F dx 0001, 81F2,FD,212A $A7A496 dx 0002, 01FA,07,2139, 01FA,FF,2138 $A7A4A2 dx 0001, 81FD,FD,E126 $A7A4A9 dx 0002, 01FF,FD,E129, 0007,FD,E128 $A7A4B5 dx 0001, 81FD,F4,E12A $A7A4BC dx 0002, 01FA,FC,E12E, 01F2,FC,A12E $A7A4C8 dx 0001, 81F4,FC,A12C $A7A4CF dx 0002, 01FC,06,A13E, 01FC,FE,213E $A7A4DB dx 0001, 81F4,F4,212C $A7A500 dx 0003, 81F4,F8,2104, 81E4,F8,2102, 81D4,F8,2100 $A7A511 dx 0008, 01EC,00,211C, 01FC,F0,210F, 01F4,F0,210E, 01E4,E8,210D, 01DC,F8,210C, 81F4,F8,210A, 81E4,F0,2108, 81D4,E8,2106 $A7A53B dx 0008, 01FC,ED,213F, 01EC,FD,212F, 01EC,F5,211F, 01EC,DD,211E, 01E4,ED,211D, 81F4,F5,2124, 81EC,E5,2122, 81DC,DD,2120 ;;; Kraid foot OAM / hitbox ;;; $A7A565 dw 0002, 0008,0028,A5A1,9453, 0000,0000,A577,9453 ;;; Kraid foot OAM entries ;;; $A7A577 dx 0008, 8020,1C,215A, 8020,14,214A, 8010,1C,2148, 01F8,0C,214C, 8010,0C,2146, 8000,0C,2144, 8008,FC,2142, 81F8,FC,2140 $A7A5A1 dx 000C, 01D8,F4,21C3, 0018,F4,219A, 8000,F4,21C8, 81F0,F4,21C6, 81E0,F4,21C4, 81D0,FC,21A7, 8020,FC,21AB, 8020,F4,219B, 8010,FC,21DA, 8000,FC,21D8, 81F0,FC,21D6, 81E0,FC,21D4 ;;; Kraid lint OAM entries ;;; $A7A5DF dx 0005, 0000,08,11C2, 81F0,00,11B0, 8000,F8,11A2, 81F0,F8,11A0, 8000,08,11A9 ;;; Kraid fingernail_A OAM entries ;;; $A7A617 dx 0002, C3F4,F8,212A, C3FC,F8,212C $A7A623 dx 0004, 01F9,FB,2138, 01F9,03,2139, 0002,F9,612E, 01FA,F9,212E $A7A639 dx 0002, C3F9,FB,E126, C3F9,F4,612C $A7A645 dx 0004, 01FC,FF,E129, 0004,FF,E128, 01F9,FE,E13E, 01F9,F6,613E $A7A65B dx 0002, C3FC,F8,E12A, C3F4,F8,212C $A7A667 dx 0004, 01FF,FD,E138, 01FF,F5,E139, 01FD,FF,E12E, 01F5,FF,A12E $A7A67D dx 0002, C3F7,F4,2126, C3F7,FC,A12C $A7A689 dx 0004, 01FD,F9,2129, 01F5,F9,2128, 01FF,03,A13E, 01FF,FB,213E ;;; 200h bytes of area graphics (VRAM $3F00) ;;; $A7A716 db 3F, FF, 4C, F3, 5F, E0, CB, F0, B9, C0, 8F, F0, B6, C9, B1, CE, 00, FF, 3F, C0, 39, C6, 3C, C3, 76, 89, 71, 8E, 7F, 80, 7F, 80, FF, FF, 3F, FF, 8F, 7F, 4E, BF, E7, 1F, EF, 1F, CF, 3F, 1F, FF, 03, FC, FB, 04, FF, 00, FF, 00, FE, 01, FD, 02, F3, 0C, E8, 17, 07, FF, 8F, FF, FE, FF, FE, FF, FF, FF, FF, FF, F6, FF, C3, FF, FE, 01, FE, 01, FD, 02, FD, 02, FF, 00, BB, 44, 0F, F0, 3F, C0, FF, F9, 07, FE, 13, EF, 29, D7, BD, C3, D5, EB, E1, FF, 61, FF, 06, F9, F9, 06, FC, 03, FE, 01, 7E, 81, BE, 41, DE, 21, DE, 21, 8D, F2, 0B, F4, E0, FF, 0F, FF, E7, 1F, 5B, A7, B4, 4B, FC, 03, 7F, 80, 7F, 80, 1F, E0, F0, 0F, FE, 01, FF, 00, FF, 00, CF, 30, 3E, FF, 3E, FD, 7F, F8, FB, F4, F9, F6, EF, F0, E5, FA, E3, FC, D1, 2E, E3, 1C, C7, 38, CF, 30, 4E, B1, 3E, C1, 9F, 60, DF, 20, E1, 1F, EC, 13, 7A, 85, 9E, 01, 99, 06, FF, 00, FE, 01, F8, 87, FF, 00, FF, 00, 9F, 60, 6F, D0, 67, 98, 07, F8, 8F, 70, FF, 00, E1, FF, A3, FF, FC, FF, 70, FF, 60, FF, 66, F9, 43, FC, 4F, F0, DE, 21, FC, 03, E3, 1C, EF, 10, FF, 00, DF, 20, FF, 00, FD, 02, 4E, 81, CE, 01, F8, 07, B4, 4B, B1, 4F, 23, DF, 02, FF, 0F, FF, B7, 68, B7, 48, CF, 30, FF, 00, FE, 01, FD, 02, FD, 02, F1, 0E, 66, F9, 71, FE, 70, FF, FC, FF, 87, FF, 03, FF, 1D, C3, 3E, C1, FF, 00, EF, 10, CF, 30, CB, 34, FF, 00, FF, 00, EF, 10, CF, 30, EC, 13, 68, 97, 41, BF, 03, FF, 8F, FF, FE, FF, F8, FF, F1, FE, FF, 00, FF, 00, FF, 00, FE, 01, F7, 08, FF, 00, FF, 00, FF, 00, CF, F0, EF, F0, E3, FC, E2, FD, F1, FE, 02, FF, EA, 17, 9D, 03, FC, 03, 9E, 61, 1F, E0, 1F, E0, 8F, 70, FD, 02, FD, 02, FE, 41, 3F, FF, FF, FF, C7, F9, 9F, E0, 9F, E0, 8E, F1, C3, FF, FF, 7F, C1, 3E, 01, FE, 3E, C1, 7F, 80, 77, 88, 7F, 80, 3C, C3, 80, 7F, 74, 8B, B9, C7, C1, FF, FB, FF, FF, FF, 9F, FF, FE, FF, 3C, FF, FF, 00, FF, 00, FF, 00, E7, 18, 27, D8, 6F, 90, 0F, F0, DF, 20, F3, FC, F2, FD, 79, FE, F9, FF, F8, FF, FC, FF, 3F, FF, 0F, FD, DF, 20, DF, 20, C7, 38, 07, F8, C7, 38, E3, 1C, F8, 07, F2, 0D, 9D, 03, F5, 0B, B9, 47, D3, 2F, A7, DF, 0F, FF, 1F, F9, FF, EF, 6E, 91, 8E, 71, FE, 01, FC, 03, F8, 07, F0, 0F, E6, 19, 10, EF ;;; Kraid lint function timers ;;; $A7A916 dw 0120, 00A0, 0040 ;;; Kraid Y speed ;;; $A7A91C dw 0003 ;;; ;$A7A91E dw 0005 ;;; Kraid X speed ;;; $A7A920 dw 0003 ;;; ;$A7A922 dw 0004 ;;; ;$A7A924 dw 0110 ;;; Kraid arm X (sub)speed ;;; $A7A926 dw 8000, 0003 ;;; Check Kraid-dead flag ;;; ; Returns A=0000 if clear, A=0001 if set $A7A92C DA PHX $A7A92D AE 9F 07 LDX $079F [$7E:079F] $A7A930 BF 28 D8 7E LDA $7ED828,x[$7E:D829] $A7A934 89 01 00 BIT #$0001 $A7A937 F0 05 BEQ $05 [$A93E] $A7A939 FA PLX $A7A93A A9 01 00 LDA #$0001 $A7A93D 60 RTS $A7A93E FA PLX $A7A93F A9 00 00 LDA #$0000 $A7A942 60 RTS ;;; Set enemy properties to dead ;;; $A7A943 AE 54 0E LDX $0E54 [$7E:0E54] $A7A946 BD 86 0F LDA $0F86,x[$7E:0FC6] $A7A949 09 00 07 ORA #$0700 $A7A94C 29 FF F7 AND #$F7FF ;\ $A7A94F 29 FF DF AND #$DFFF ;} ~headdesk~, AND 57FFh, bit-clears A800h $A7A952 29 FF 7F AND #$7FFF ;/ $A7A955 9D 86 0F STA $0F86,x[$7E:0FC6] $A7A958 60 RTS ;;; Kraid Initiation AI ;;; ; Good thing the BG1 and BG2 character bases are both $0000 ; [$5D] wasn't shifted correctly, it should be shifted left by 13 $A7A959 E2 20 SEP #$20 $A7A95B A9 A7 LDA #$A7 ;\ $A7A95D 8D 06 06 STA $0606 [$7E:0606] ;| $A7A960 A9 A7 LDA #$A7 ;| $A7A962 8D 03 06 STA $0603 [$7E:0603] ;| $A7A965 C2 20 REP #$20 ;} $0601 = $A7C325 (is this ever executed?) (done) $A7A967 A9 4E C2 LDA #$C24E ;} $0604 = $A7C24E (is this ever executed?) (done) $A7A96A 8D 04 06 STA $0604 [$7E:0604] ;| $A7A96D A9 25 C3 LDA #$C325 ;| $A7A970 8D 01 06 STA $0601 [$7E:0601] ;/ $A7A973 20 2C A9 JSR $A92C [$A7:A92C] ;\ $A7A976 D0 03 BNE $03 [$A97B] ;} If Kraid is dead: $A7A978 4C DC A9 JMP $A9DC [$A7:A9DC] ;/ $A7A97B A2 C0 00 LDX #$00C0 ;\ $A7A97E A0 00 00 LDY #$0000 ;| ;| $A7A981 B9 C7 86 LDA $86C7,y[$A7:86C7] ;| $A7A984 9F 00 C2 7E STA $7EC200,x[$7E:C2C0] ;| $A7A988 E8 INX ;} Write target colour palette line 6 $A7A989 E8 INX ;| $A7A98A C8 INY ;| $A7A98B C8 INY ;| $A7A98C C0 20 00 CPY #$0020 ;| $A7A98F 30 F0 BMI $F0 [$A981] ;/ $A7A991 A2 FE 07 LDX #$07FE ;\ $A7A994 A9 38 03 LDA #$0338 ;| ;| $A7A997 9F 00 20 7E STA $7E2000,x[$7E:27FE] ;} $7E2000..27FF = 0338h $A7A99B CA DEX ;| $A7A99C CA DEX ;| $A7A99D 10 F8 BPL $F8 [$A997] ;/ $A7A99F A9 00 00 LDA #$0000 ;\ $A7A9A2 8F 04 78 7E STA $7E7804[$7E:7804] ;} $7E7804 = 0 $A7A9A6 AE 30 03 LDX $0330 [$7E:0330] ;\ $A7A9A9 A9 00 02 LDA #$0200 ;| $A7A9AC 95 D0 STA $D0,x [$7E:00D0] ;| $A7A9AE A9 16 A7 LDA #$A716 ;| $A7A9B1 95 D2 STA $D2,x [$7E:00D2] ;| $A7A9B3 E2 20 SEP #$20 ;| $A7A9B5 A9 A7 LDA #$A7 ;| $A7A9B7 95 D4 STA $D4,x [$7E:00D4] ;| $A7A9B9 C2 20 REP #$20 ;| $A7A9BB A5 5D LDA $5D [$7E:005D] ;} $A7A716..A915 -> VRAM[BG1 character base + 3F00h] $A7A9BD 29 0F 00 AND #$000F ;| $A7A9C0 EB XBA ;| $A7A9C1 18 CLC ;| $A7A9C2 69 00 3F ADC #$3F00 ;| $A7A9C5 95 D5 STA $D5,x [$7E:00D5] ;| $A7A9C7 8A TXA ;| $A7A9C8 18 CLC ;| $A7A9C9 69 07 00 ADC #$0007 ;| $A7A9CC 8D 30 03 STA $0330 [$7E:0330] ;/ $A7A9CF 20 68 C1 JSR $C168 [$A7:C168] ; Clear ceiling $A7A9D2 20 71 C1 JSR $C171 [$A7:C171] ; Clear spikes $A7A9D5 A9 15 C7 LDA #$C715 ;\ $A7A9D8 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = fade in regular background (done) $A7A9DB 6B RTL ; Kraid is not dead: $A7A9DC E2 20 SEP #$20 $A7A9DE A9 43 LDA #$43 ;\ $A7A9E0 85 59 STA $59 [$7E:0059] ;} BG2 tilemap base = $4000, enable BG2 horizontal and vertical mirroring $A7A9E2 C2 20 REP #$20 $A7A9E4 A9 02 00 LDA #$0002 ;\ $A7A9E7 8D 41 09 STA $0941 [$7E:0941] ;} $0941 = 0002 $A7A9EA A9 00 00 LDA #$0000 ;\ $A7A9ED 8F 20 CD 7E STA $7ECD20[$7E:CD20] ;| $A7A9F1 A9 01 00 LDA #$0001 ;} Lock camera to bottom-left screen $A7A9F4 8F 22 CD 7E STA $7ECD22[$7E:CD22] ;/ $A7A9F8 A9 44 01 LDA #$0144 ;\ $A7A9FB 8F 08 78 7E STA $7E7808[$7E:7808] ;} $7E7808 = 0144h $A7A9FF A2 00 00 LDX #$0000 ;\ $A7AA02 AD 8C 0F LDA $0F8C [$7E:0F8C] ;| $A7AA05 4A LSR A ;| $A7AA06 4A LSR A ;| $A7AA07 4A LSR A ;| $A7AA08 85 12 STA $12 [$7E:0012] ;| ;} $7E780C[n] = Kraid health / 8 * (n+1) $A7AA0A 9F 0C 78 7E STA $7E780C,x[$7E:780C] ;} n = 0..7 $A7AA0E 18 CLC ;| $A7AA0F 65 12 ADC $12 [$7E:0012] ;| $A7AA11 E8 INX ;| $A7AA12 E8 INX ;| $A7AA13 E0 10 00 CPX #$0010 ;| $A7AA16 30 F2 BMI $F2 [$AA0A] ;/ $A7AA18 A9 FF DF LDA #$DFFF ;\ $A7AA1B 85 12 STA $12 [$7E:0012] ;} $12 = DFFFh (tile priority anti-mask) $A7AA1D AE 54 0E LDX $0E54 [$7E:0E54] ;} Set up Kraid graphics with the tile priority cleared (done) $A7AA20 20 C6 AA JSR $AAC6 [$A7:AAC6] ;/ $A7AA23 AD 8C 0F LDA $0F8C [$7E:0F8C] ;\ $A7AA26 4A LSR A ;| $A7AA27 4A LSR A ;| $A7AA28 8F 20 78 7E STA $7E7820[$7E:7820] ;| $A7AA2C 18 CLC ;| $A7AA2D 6F 20 78 7E ADC $7E7820[$7E:7820] ;| $A7AA31 8F 22 78 7E STA $7E7822[$7E:7822] ;} $7E7820[n] = Kraid health / 4 * (n+1) $A7AA35 18 CLC ;} n = 0..3 $A7AA36 6F 20 78 7E ADC $7E7820[$7E:7820] ;| $A7AA3A 8F 24 78 7E STA $7E7824[$7E:7824] ;| $A7AA3E 18 CLC ;| $A7AA3F 6F 20 78 7E ADC $7E7820[$7E:7820] ;| $A7AA43 8F 26 78 7E STA $7E7826[$7E:7826] ;/ $A7AA47 A9 00 00 LDA #$0000 ;\ $A7AA4A 8F 3E 78 7E STA $7E783E[$7E:783E] ;} $7E783E = 0000 $A7AA4E A9 B0 00 LDA #$00B0 ;\ $A7AA51 8D 7A 0F STA $0F7A [$7E:0F7A] ;} Kraid X position = 00B0h $A7AA54 A9 50 02 LDA #$0250 ;\ $A7AA57 8D 7E 0F STA $0F7E [$7E:0F7E] ;} Kraid Y position = 0250h $A7AA5A AD 86 0F LDA $0F86 [$7E:0F86] ;\ $A7AA5D 09 00 04 ORA #$0400 ;} Set Kraid to ignore Samus/projectiles $A7AA60 8D 86 0F STA $0F86 [$7E:0F86] ;/ $A7AA63 A9 65 C8 LDA #$C865 ;\ $A7AA66 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = restrict Samus X position to first screen; decrement enemy function timer (done) $A7AA69 A9 2C 01 LDA #$012C ;\ $A7AA6C 8D B2 0F STA $0FB2 [$7E:0FB2] ;} Kraid function timer = 300 $A7AA6F A9 6B C8 LDA #$C86B ;\ $A7AA72 8F 00 78 7E STA $7E7800[$7E:7800] ;} Kraid next function = $C86B (done) $A7AA76 A9 40 00 LDA #$0040 ;\ $A7AA79 8D AC 0F STA $0FAC [$7E:0FAC] ;} $0FAC = 40h $A7AA7C 22 E2 A7 90 JSL $90A7E2[$90:A7E2] ; Disable minimap and set entire room as explored $A7AA80 A2 3E 00 LDX #$003E ;\ $A7AA83 A9 38 03 LDA #$0338 ;| ;| $A7AA86 9F C0 2F 7E STA $7E2FC0,x[$7E:2FFE] ;} $7E2FC0..FF = 0338h $A7AA8A CA DEX ;| $A7AA8B CA DEX ;| $A7AA8C 10 F8 BPL $F8 [$AA86] ;/ $A7AA8E A9 05 00 LDA #$0005 ;\ $A7AA91 8D 3E 18 STA $183E [$7E:183E] ;} Set screen shaking to 5 $A7AA94 A2 00 00 LDX #$0000 ;\ ;| $A7AA97 BD A6 AA LDA $AAA6,x[$A7:AAA6] ;| $A7AA9A 9F 60 C3 7E STA $7EC360,x[$7E:C360] ;| $A7AA9E E8 INX ;} Write target colour palette line 3 $A7AA9F E8 INX ;| $A7AAA0 E0 20 00 CPX #$0020 ;| $A7AAA3 30 F2 BMI $F2 [$AA97] ;/ $A7AAA5 6B RTL ; Target enemy colour palette line 3 $A7AAA6 dw 0000, 0000, 0000, 0000, 0000, 0DF6, 0D92, 0CEC, 0CA9, 0000, 0000, 0000, 0000, 0000, 0000, 0000 ;;; Set up Kraid graphics with the tile priority cleared ;;; ; $7E2000..27FF = Kraid BGi ; $7E2800..2DFF = Kraid ass BGi $A7AAC6 E2 20 SEP #$20 $A7AAC8 A9 38 LDA #$38 ;\ $A7AACA 8F 47 00 00 STA $000047[$7E:0047] ;| $A7AACE A9 FA LDA #$FA ;| $A7AAD0 8F 48 00 00 STA $000048[$7E:0048] ;| $A7AAD4 A9 B9 LDA #$B9 ;| $A7AAD6 8F 49 00 00 STA $000049[$7E:0049] ;} Decompress $B9FA38 to $7E4000 (Kraid BGi) $A7AADA A9 00 LDA #$00 ;| $A7AADC 8F 4C 00 00 STA $00004C[$7E:004C] ;| $A7AAE0 A9 40 LDA #$40 ;| $A7AAE2 8F 4D 00 00 STA $00004D[$7E:004D] ;| $A7AAE6 22 19 B1 80 JSL $80B119[$80:B119] ;/ $A7AAEA A9 3E LDA #$3E ;\ $A7AAEC 8F 47 00 00 STA $000047[$7E:0047] ;| $A7AAF0 A9 FE LDA #$FE ;| $A7AAF2 8F 48 00 00 STA $000048[$7E:0048] ;| $A7AAF6 A9 B9 LDA #$B9 ;| $A7AAF8 8F 49 00 00 STA $000049[$7E:0049] ;} Decompress $B9FE3E to $7E2000 (Kraid ass BGi) $A7AAFC A9 00 LDA #$00 ;| $A7AAFE 8F 4C 00 00 STA $00004C[$7E:004C] ;| $A7AB02 A9 20 LDA #$20 ;| $A7AB04 8F 4D 00 00 STA $00004D[$7E:004D] ;| $A7AB08 22 19 B1 80 JSL $80B119[$80:B119] ;/ $A7AB0C C2 20 REP #$20 $A7AB0E A9 00 00 LDA #$0000 ;\ $A7AB11 8F 2A 78 7E STA $7E782A[$7E:782A] ;} Clear $7E782A..2D $A7AB15 8F 2C 78 7E STA $7E782C[$7E:782C] ;/ $A7AB19 A2 00 00 LDX #$0000 $A7AB1C BF 00 20 7E LDA $7E2000,x[$7E:2000] ;\ $A7AB20 29 FF DF AND #$DFFF ;| $A7AB23 9F 00 28 7E STA $7E2800,x[$7E:2800] ;| $A7AB27 E8 INX ;} $7E2000..25FF -> DFFFh mask -> $7E2800..2DFF $A7AB28 E8 INX ;} DFFFh mask clears the tile priority $A7AB29 E0 00 06 CPX #$0600 ;| $A7AB2C 30 EE BMI $EE [$AB1C] ;/ $A7AB2E A2 00 00 LDX #$0000 $A7AB31 BF 00 40 7E LDA $7E4000,x[$7E:4000] ;\ $A7AB35 25 12 AND $12 [$7E:0012] ;| $A7AB37 9F 00 20 7E STA $7E2000,x[$7E:2000] ;| $A7AB3B E8 INX ;} $7E4000..47FF -> [$12] mask -> $7E2000..27FF $A7AB3C E8 INX ;} $12 seems to always be DFFFh $A7AB3D E0 00 08 CPX #$0800 ;| $A7AB40 30 EF BMI $EF [$AB31] ;/ $A7AB42 60 RTS ;;; Kraid arm Initiation AI ;;; $A7AB43 20 2C A9 JSR $A92C [$A7:A92C] ;\ $A7AB46 D0 1C BNE $1C [$AB64] ;} If Kraid not dead: $A7AB48 AD 96 0F LDA $0F96 [$7E:0F96] ;\ $A7AB4B 8D D6 0F STA $0FD6 [$7E:0FD6] ;} Kraid arm palette = Kraid palette $A7AB4E A9 2D BA LDA #$BA2D ;\ $A7AB51 8D E8 0F STA $0FE8 [$7E:0FE8] ;} Kraid arm function = RTS $A7AB54 A9 A4 8A LDA #$8AA4 ;\ $A7AB57 8D D2 0F STA $0FD2 [$7E:0FD2] ;} Kraid arm instruction = $8AA4 (done) $A7AB5A A9 01 00 LDA #$0001 ;\ $A7AB5D 8D D4 0F STA $0FD4 [$7E:0FD4] ;} Kraid arm instruction timer = 1 $A7AB60 9C EA 0F STZ $0FEA [$7E:0FEA] ; Kraid arm $0FAA = 0 $A7AB63 6B RTL $A7AB64 20 43 A9 JSR $A943 [$A7:A943] ; Else (Kraid dead): Set enemy properties to dead $A7AB67 6B RTL ;;; Kraid top lint Initiation AI ;;; $A7AB68 20 2C A9 JSR $A92C [$A7:A92C] ;\ $A7AB6B D0 2B BNE $2B [$AB98] ;} If Kraid not dead: $A7AB6D AD 96 0F LDA $0F96 [$7E:0F96] ;\ $A7AB70 8D 16 10 STA $1016 [$7E:1016] ;} Kraid top lint palette = Kraid palette $A7AB73 A9 FF 7F LDA #$7FFF ;\ $A7AB76 8D 14 10 STA $1014 [$7E:1014] ;} Kraid top lint instruction delay = 7FFFh $A7AB79 A9 FE 8A LDA #$8AFE ;\ $A7AB7C 8D 12 10 STA $1012 [$7E:1012] ;} Kraid top lint instruction = $8AFE (done) $A7AB7F A9 DF A5 LDA #$A5DF ;\ $A7AB82 8D 0E 10 STA $100E [$7E:100E] ;} Kraid top lint OAM / hitbox = $A5DF (done) $A7AB85 A9 31 B8 LDA #$B831 ;\ $A7AB88 8D 28 10 STA $1028 [$7E:1028] ;} Kraid top lint function = RTL $A7AB8B A9 FF 7F LDA #$7FFF ;\ $A7AB8E 8D 32 10 STA $1032 [$7E:1032] ;} Kraid top lint function timer = 7FFFh $A7AB91 A9 00 00 LDA #$0000 ;\ $A7AB94 8D 2C 10 STA $102C [$7E:102C] ;} Kraid top lint $0FAC = 0 $A7AB97 6B RTL $A7AB98 20 43 A9 JSR $A943 [$A7:A943] ; Else (Kraid dead): Set enemy properties to dead $A7AB9B 6B RTL ;;; Kraid middle lint Initiation AI ;;; $A7AB9C 20 2C A9 JSR $A92C [$A7:A92C] ;\ $A7AB9F D0 25 BNE $25 [$ABC6] ;} If Kraid not dead: $A7ABA1 AD 96 0F LDA $0F96 [$7E:0F96] ;\ $A7ABA4 8D 56 10 STA $1056 [$7E:1056] ;} Kraid middle lint palette = Kraid palette $A7ABA7 A9 FF 7F LDA #$7FFF ;\ $A7ABAA 8D 54 10 STA $1054 [$7E:1054] ;} Kraid middle lint instruction delay = 7FFFh $A7ABAD A9 FE 8A LDA #$8AFE ;\ $A7ABB0 8D 52 10 STA $1052 [$7E:1052] ;} Kraid middle lint instruction = $8AFE (done) $A7ABB3 A9 DF A5 LDA #$A5DF ;\ $A7ABB6 8D 4E 10 STA $104E [$7E:104E] ;} Kraid middle lint OAM / hitbox = $A5DF (done) $A7ABB9 A9 31 B8 LDA #$B831 ;\ $A7ABBC 8D 68 10 STA $1068 [$7E:1068] ;} Kraid middle lint function = RTL $A7ABBF A9 F0 FF LDA #$FFF0 ;\ $A7ABC2 8D 6C 10 STA $106C [$7E:106C] ;} Kraid middle lint $0FAC = 7FFFh $A7ABC5 6B RTL $A7ABC6 20 43 A9 JSR $A943 [$A7:A943] ; Else (Kraid dead): Set enemy properties to dead $A7ABC9 6B RTL ;;; Kraid bottom lint Initiation AI ;;; $A7ABCA 20 2C A9 JSR $A92C [$A7:A92C] ;\ $A7ABCD D0 25 BNE $25 [$ABF4] ;} If Kraid not dead: $A7ABCF AD 96 0F LDA $0F96 [$7E:0F96] ;\ $A7ABD2 8D 96 10 STA $1096 [$7E:1096] ;} Kraid bottom lint palette = Kraid palette $A7ABD5 A9 FF 7F LDA #$7FFF ;\ $A7ABD8 8D 94 10 STA $1094 [$7E:1094] ;} Kraid bottom lint instruction delay = 7FFFh $A7ABDB A9 FE 8A LDA #$8AFE ;\ $A7ABDE 8D 92 10 STA $1092 [$7E:1092] ;} Kraid bottom lint instruction = $8AFE (done) $A7ABE1 A9 DF A5 LDA #$A5DF ;\ $A7ABE4 8D 8E 10 STA $108E [$7E:108E] ;} Kraid bottom lint OAM / hitbox = $A5DF (done) $A7ABE7 A9 31 B8 LDA #$B831 ;\ $A7ABEA 8D A8 10 STA $10A8 [$7E:10A8] ;} Kraid bottom lint function = RTL $A7ABED A9 F0 FF LDA #$FFF0 ;\ $A7ABF0 8D AC 10 STA $10AC [$7E:10AC] ;} Kraid bottom lint $0FAC = 7FFFh $A7ABF3 6B RTL $A7ABF4 20 43 A9 JSR $A943 [$A7:A943] ; Else (Kraid dead): Set enemy properties to dead $A7ABF7 6B RTL ;;; Kraid foot Initiation AI ;;; $A7ABF8 20 2C A9 JSR $A92C [$A7:A92C] ;\ $A7ABFB D0 20 BNE $20 [$AC1D] ;} If Kraid not dead: $A7ABFD AD 96 0F LDA $0F96 [$7E:0F96] ;\ $A7AC00 8D D6 10 STA $10D6 [$7E:10D6] ;} Kraid foot palette = Kraid palette $A7AC03 A9 E7 86 LDA #$86E7 ;\ $A7AC06 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86E7 (done) $A7AC09 A9 01 00 LDA #$0001 ;\ $A7AC0C 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction timer = 1 $A7AC0F A9 2D BA LDA #$BA2D ;\ $A7AC12 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = RTL $A7AC15 A9 00 00 LDA #$0000 ;\ $A7AC18 8F 40 79 7E STA $7E7940[$7E:7940] ;} Kraid foot next function = 0000 $A7AC1C 6B RTL $A7AC1D 20 43 A9 JSR $A943 [$A7:A943] ; Else (Kraid dead): Set enemy properties to dead $A7AC20 6B RTL ;;; Break ceiling into platform ;;; { $A7AC4D AD B6 05 LDA $05B6 [$7E:05B6] ;\ $A7AC50 29 07 00 AND #$0007 ;} If frame counter is multiple of 8: $A7AC53 D0 03 BNE $03 [$AC58] ;/ $A7AC55 20 95 C9 JSR $C995 [$7E:C995] ; Spawn random earthquake projectile $A7AC58 A0 01 00 LDY #$0001 ;\ $A7AC5B AD 7E 0F LDA $0F7E [$7E:0F7E] ;| $A7AC5E 89 02 00 BIT #$0002 ;| $A7AC61 F0 03 BEQ $03 [$AC66] ;} $12 = 1 if Kraid Y position / 2 is odd, else $12 = -1: $A7AC63 A0 FF FF LDY #$FFFF ;| ;| $A7AC66 84 12 STY $12 [$7E:0012] ;/ $A7AC68 AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7AC6B 18 CLC ;| $A7AC6C 65 12 ADC $12 [$7E:0012] ;} Kraid X position += $12 $A7AC6E 8D 7A 0F STA $0F7A [$7E:0F7A] ;/ $A7AC71 CE 7E 0F DEC $0F7E [$7E:0F7E] ; Kraid Y position -= 1 $A7AC74 AD 7E 0F LDA $0F7E [$7E:0F7E] ;\ $A7AC77 29 03 00 AND #$0003 ;} If Kraid Y position is multiple of 4: $A7AC7A D0 28 BNE $28 [$ACA4] ;/ $A7AC7C AE B2 0F LDX $0FB2 [$7E:0FB2] ;\ $A7AC7F E0 12 00 CPX #$0012 ;} If [$0FB2] < 18: $A7AC82 10 20 BPL $20 [$ACA4] ;/ $A7AC84 BD B3 AC LDA $ACB3,x[$A7:ACB3] ;\ $A7AC87 A0 53 9C LDY #$9C53 ;| $A7AC8A AE 54 0E LDX $0E54 [$7E:0E54] ;} Spawn ER projectile $9C53 with parameter [$ACB3 + [$0FB2]] $A7AC8D 22 27 80 86 JSL $868027[$86:8027] ;/ $A7AC91 AE B2 0F LDX $0FB2 [$7E:0FB2] ;\ $A7AC94 BD C5 AC LDA $ACC5,x[$A7:ACC5] ;| $A7AC97 85 12 STA $12 [$7E:0012] ;} Execute [$ACC5 + [$0FB2]] $A7AC99 6C 12 00 JMP ($0012) ;/ $A7AC9C AE B2 0F LDX $0FB2 [$7E:0FB2] ;\ $A7AC9F E8 INX ;| $A7ACA0 E8 INX ;} $0FB2 += 2 $A7ACA1 8E B2 0F STX $0FB2 [$7E:0FB2] ;/ $A7ACA4 AD 7E 0F LDA $0F7E [$7E:0F7E] ;\ $A7ACA7 C9 28 01 CMP #$0128 ;} If Kraid Y position < 128h $A7ACAA 10 06 BPL $06 [$ACB2] ;/ $A7ACAC A9 3A AD LDA #$AD3A ;\ $A7ACAF 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $AD3A $A7ACB2 6B RTL $A7ACB3 dw 0068, 00D8, 0028, 00A8, 0058, 00C8, 0038, 00B8, 0048 $A7ACC5 dw AD03, AD2F, ACD7, AD0E, ACF8, AD24, ACE2, AD19, ACED ;;; The following PLM spawns are for the ceiling crumbling into the platform $A7ACD7 22 D7 83 84 JSL $8483D7[$84:83D7] $A7ACDB dx 02, 12, B7A3 $A7ACDF 4C 9C AC JMP $AC9C [$A7:AC9C] $A7ACE2 22 D7 83 84 JSL $8483D7[$84:83D7] $A7ACE6 dx 03, 12, B7AB $A7ACEA 4C 9C AC JMP $AC9C [$A7:AC9C] $A7ACED 22 D7 83 84 JSL $8483D7[$84:83D7] $A7ACF1 dx 04, 12, B7B3 $A7ACF5 4C 9C AC JMP $AC9C [$A7:AC9C] $A7ACF8 22 D7 83 84 JSL $8483D7[$84:83D7] $A7ACFC dx 05, 12, B7AB $A7AD00 4C 9C AC JMP $AC9C [$A7:AC9C] $A7AD03 22 D7 83 84 JSL $8483D7[$84:83D7] $A7AD07 dx 06, 12, B7B3 $A7AD0B 4C 9C AC JMP $AC9C [$A7:AC9C] $A7AD0E 22 D7 83 84 JSL $8483D7[$84:83D7] $A7AD12 dx 0A, 12, B7B3 $A7AD16 4C 9C AC JMP $AC9C [$A7:AC9C] $A7AD19 22 D7 83 84 JSL $8483D7[$84:83D7] $A7AD1D dx 0B, 12, B7AB $A7AD21 4C 9C AC JMP $AC9C [$A7:AC9C] $A7AD24 22 D7 83 84 JSL $8483D7[$84:83D7] $A7AD28 dx 0C, 12, B7B3 $A7AD2C 4C 9C AC JMP $AC9C [$A7:AC9C] $A7AD2F 22 D7 83 84 JSL $8483D7[$84:83D7] $A7AD23 dx 0D, 12, B7AB $A7AD37 4C 9C AC JMP $AC9C [$A7:AC9C] ;;; $A7AD3A A2 00 00 LDX #$0000 ;\ ;| $A7AD3D BF 00 20 7E LDA $7E2000,x[$7E:2000] ;| $A7AD41 09 00 20 ORA #$2000 ;| $A7AD44 9F 00 20 7E STA $7E2000,x[$7E:2000] ;} $7E2000..2FFF |= 2000h $A7AD48 E8 INX ;| $A7AD49 E8 INX ;| $A7AD4A E0 00 10 CPX #$1000 ;| $A7AD4D 30 EE BMI $EE [$AD3D] ;/ $A7AD4F AD C6 0F LDA $0FC6 [$7E:0FC6] ;\ $A7AD52 29 FF FB AND #$FBFF ;} Set Kraid arm to ignore Samus/projectiles $A7AD55 8D C6 0F STA $0FC6 [$7E:0FC6] ;/ $A7AD58 A9 61 AD LDA #$AD61 ;\ $A7AD5B 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $AD61 $A7AD5E 4C 74 C8 JMP $C874 [$A7:C874] ; Kraid BGi -> VRAM[BG2 tilemap base] ;;; $A7AD61 A9 8E AD LDA #$AD8E ;\ $A7AD64 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $AD8E $A7AD67 A9 01 00 LDA #$0001 ;\ $A7AD6A 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7AD6D A9 ED 86 LDA #$86ED ;\ $A7AD70 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86ED (done) $A7AD73 A9 04 8B LDA #$8B04 ;\ $A7AD76 8D 12 10 STA $1012 [$7E:1012] ;| $A7AD79 8D 52 10 STA $1052 [$7E:1052] ;} Kraid lints instruction = $8B04 (done) $A7AD7C 8D 92 10 STA $1092 [$7E:1092] ;/ $A7AD7F A9 6C 8C LDA #$8C6C ;\ $A7AD82 8D 0E 10 STA $100E [$7E:100E] ;| $A7AD85 8D 4E 10 STA $104E [$7E:104E] ;} Kraid lints OAM = $8C6C (done) $A7AD88 8D 8E 10 STA $108E [$7E:108E] ;/ $A7AD8B 4C B6 C8 JMP $C8B6 [$A7:C8B6] ; Kraid ass BGi -> VRAM[BG2 tilemap base + $0800] ;;; ; Good thing the BG1 and BG2 character bases are both $0000 ; [$5D] wasn't shifted correctly, it should be shifted left by 13 $A7AD8E A9 23 AE LDA #$AE23 ;\ $A7AD91 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $AE23 $A7AD94 9C B0 0F STZ $0FB0 [$7E:0FB0] ; $0FB0 = 0 $A7AD97 9C B2 0F STZ $0FB2 [$7E:0FB2] ; Kraid function timer = 0 $A7AD9A A2 C0 00 LDX #$00C0 ;\ $A7AD9D A0 00 00 LDY #$0000 ;| ;| $A7ADA0 B9 C7 86 LDA $86C7,y[$A7:86C7] ;| $A7ADA3 9F 00 C2 7E STA $7EC200,x[$7E:C2C0] ;| $A7ADA7 E8 INX ;} Write target colour palette line 6 $A7ADA8 E8 INX ;| $A7ADA9 C8 INY ;| $A7ADAA C8 INY ;| $A7ADAB C0 20 00 CPY #$0020 ;| $A7ADAE 30 F0 BMI $F0 [$ADA0] ;/ $A7ADB0 A9 00 00 LDA #$0000 ;\ $A7ADB3 8F 00 C4 7E STA $7EC400[$7E:C400] ;} Colour palette change fraction numerator = 0 $A7ADB7 AE 30 03 LDX $0330 [$7E:0330] ;\ $A7ADBA A9 00 02 LDA #$0200 ;| $A7ADBD 95 D0 STA $D0,x [$7E:00D0] ;| $A7ADBF A9 16 A7 LDA #$A716 ;| $A7ADC2 95 D2 STA $D2,x [$7E:00D2] ;| $A7ADC4 E2 20 SEP #$20 ;| $A7ADC6 A9 A7 LDA #$A7 ;| $A7ADC8 95 D4 STA $D4,x [$7E:00D4] ;| $A7ADCA C2 20 REP #$20 ;| $A7ADCC A5 5D LDA $5D [$7E:005D] ;} $A7A716..A915 -> VRAM[BG1 character base + 3F00h] $A7ADCE 29 0F 00 AND #$000F ;| $A7ADD1 EB XBA ;| $A7ADD2 18 CLC ;| $A7ADD3 69 00 3F ADC #$3F00 ;| $A7ADD6 95 D5 STA $D5,x [$7E:00D5] ;| $A7ADD8 8A TXA ;| $A7ADD9 18 CLC ;| $A7ADDA 69 07 00 ADC #$0007 ;| $A7ADDD 8D 30 03 STA $0330 [$7E:0330] ;/ $A7ADE0 6B RTL } ;;; { $A7ADE1 A9 C4 AE LDA #$AEC4 ;\ $A7ADE4 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $AEC4 (done) $A7ADE7 80 06 BRA $06 [$ADEF] ; Branch to $ADEF ;;; $A7ADE9 A9 A4 AE LDA #$AEA4 ;\ $A7ADEC 8D A8 0F STA $0FA8 [$8C:0FA8] ;} Kraid function = $AEA4 (done) $A7ADEF AD 7E 0F LDA $0F7E [$8C:0F7E] ;\ $A7ADF2 38 SEC ;| $A7ADF3 E9 14 00 SBC #$0014 ;} Kraid top lint Y position = Kraid Y position - 14h $A7ADF6 8D FE 0F STA $0FFE [$8C:0FFE] ;/ $A7ADF9 AD 7E 0F LDA $0F7E [$8C:0F7E] ;\ $A7ADFC 18 CLC ;| $A7ADFD 69 2E 00 ADC #$002E ;} Kraid middle lint Y position = Kraid Y position + 2Eh $A7AE00 8D 3E 10 STA $103E [$8C:103E] ;/ $A7AE03 AD 7E 0F LDA $0F7E [$8C:0F7E] ;\ $A7AE06 18 CLC ;| $A7AE07 69 70 00 ADC #$0070 ;} Kraid bottom lint Y position = Kraid Y position + 70h $A7AE0A 8D 7E 10 STA $107E [$8C:107E] ;/ $A7AE0D AD E5 05 LDA $05E5 [$8C:05E5] ;\ $A7AE10 29 07 00 AND #$0007 ;} A = random number % 8 $A7AE13 D0 03 BNE $03 [$AE18] ; If A == 0: $A7AE15 A9 02 00 LDA #$0002 ; A = 2 $A7AE18 0A ASL A ;\ $A7AE19 0A ASL A ;| $A7AE1A 0A ASL A ;| $A7AE1B 0A ASL A ;} $7E7806 = A * 64 $A7AE1C 0A ASL A ;| $A7AE1D 0A ASL A ;| $A7AE1E 8F 06 78 7E STA $7E7806[$7E:7806] ;/ $A7AE22 60 RTS ;;; $A7AE23 C2 30 REP #$30 $A7AE25 22 6C D9 82 JSL $82D96C[$82:D96C] ; Iteration of gradual colour change of area colour palette line 6 $A7AE29 B0 01 BCS $01 [$AE2C] ;\ $A7AE2B 6B RTL ;} If colour palette change numerator <= 13: return $A7AE2C 20 E1 AD JSR $ADE1 [$A7:ADE1] ; Execute subroutine $ADE1 (done) $A7AE2F A2 80 00 LDX #$0080 ;\ $A7AE32 AD 16 A9 LDA $A916 [$A7:A916] ;| $A7AE35 20 90 AE JSR $AE90 [$A7:AE90] ;| $A7AE38 A2 C0 00 LDX #$00C0 ;| $A7AE3B AD 18 A9 LDA $A918 [$A7:A918] ;} Set Kraid lint functions and timers $A7AE3E 20 90 AE JSR $AE90 [$A7:AE90] ;| $A7AE41 A2 00 01 LDX #$0100 ;| $A7AE44 AD 1A A9 LDA $A91A [$A7:A91A] ;| $A7AE47 20 90 AE JSR $AE90 [$A7:AE90] ;/ $A7AE4A A9 60 BD LDA #$BD60 ;\ $A7AE4D 8F 80 79 7E STA $7E7980[$7E:7980] ;} Kraid fingernail next function = $BD60 (done) $A7AE51 8F C0 79 7E STA $7E79C0[$7E:79C0] ;/ $A7AE55 A9 2D B9 LDA #$B92D ;\ $A7AE58 8D 28 11 STA $1128 [$7E:1128] ;} Kraid fingernail function = decrement enemy function timer $A7AE5B 8D 68 11 STA $1168 [$7E:1168] ;/ $A7AE5E A9 40 00 LDA #$0040 ;\ $A7AE61 8D 32 11 STA $1132 [$7E:1132] ;} Kraid fingernail_A function timer = 64 $A7AE64 A9 80 00 LDA #$0080 ;\ $A7AE67 8D 72 11 STA $1172 [$7E:1172] ;} Kraid fingernail_B function timer = 128 $A7AE6A A9 01 00 LDA #$0001 ;\ $A7AE6D 8D EC 0F STA $0FEC [$7E:0FEC] ;} Kraid arm instruction timer = 1 $A7AE70 A9 DA 96 LDA #$96DA ;\ $A7AE73 8D AA 0F STA $0FAA [$7E:0FAA] ;} $0FAA = $96DA (done) $A7AE76 A9 20 01 LDA #$0120 ;\ $A7AE79 8F 1E 78 7E STA $7E781E[$7E:781E] ;} $7E781E = 120h $A7AE7D A9 6E BB LDA #$BB6E ;\ $A7AE80 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = $BB6E (done) $A7AE83 A9 01 00 LDA #$0001 ;\ $A7AE86 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7AE89 A9 87 88 LDA #$8887 ;\ $A7AE8C 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $8887 (done) $A7AE8F 6B RTL ;;; $A7AE90 9D B2 0F STA $0FB2,x[$7E:1032] ; Enemy functiom timer = A $A7AE93 A9 23 B9 LDA #$B923 ;\ $A7AE96 9D A8 0F STA $0FA8,x[$7E:1028] ;} Enemy function = vertically align enemy to Kraid; decrement enemy function timer $A7AE99 A9 32 B8 LDA #$B832 ;\ $A7AE9C 9F 00 78 7E STA $7E7800,x[$7E:7880] ;} Enemy next function = $B832 (done) $A7AEA0 9E AA 0F STZ $0FAA,x[$7E:102A] ; $0FAA = 0 $A7AEA3 60 RTS ;;; $A7AEA4 AF 06 78 7E LDA $7E7806[$7E:7806] ;\ $A7AEA8 F0 19 BEQ $19 [$AEC3] ;} If [$7E7806] == 0: return $A7AEAA 3A DEC A ;\ $A7AEAB 8F 06 78 7E STA $7E7806[$7E:7806] ;} --$7E7806 $A7AEAF D0 12 BNE $12 [$AEC3] ; If [$7E7806] != 0: return $A7AEB1 A9 EA BB LDA #$BBEA ;\ $A7AEB4 8D A8 0F STA $0FA8 [$A7:0FA8] ;} Kraid function = $BBEA (done) $A7AEB7 A9 DA 96 LDA #$96DA ;\ $A7AEBA 8D AA 0F STA $0FAA [$A7:0FAA] ;} $0FAA = $96DA (done) $A7AEBD AD D2 96 LDA $96D2 [$A7:96D2] ;\ $A7AEC0 8D AC 0F STA $0FAC [$A7:0FAC] ;} $0FAA timer = 10 $A7AEC3 6B RTL $A7AEC4 AF 06 78 7E LDA $7E7806[$7E:7806] ;\ $A7AEC8 F0 19 BEQ $19 [$AEE3] ;} If [$7E7806] == 0: return $A7AECA 3A DEC A ;\ $A7AECB 8F 06 78 7E STA $7E7806[$7E:7806] ;} --$7E7806 $A7AECF D0 12 BNE $12 [$AEE3] ; If [$7E7806] != 0: return $A7AED1 A9 E4 AE LDA #$AEE4 ;\ $A7AED4 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $AEE4 (done) $A7AED7 A9 DA 96 LDA #$96DA ;\ $A7AEDA 8D AA 0F STA $0FAA [$7E:0FAA] ;} $0FAA = $96DA (done) $A7AEDD AD D2 96 LDA $96D2 [$A7:96D2] ;\ $A7AEE0 8D AC 0F STA $0FAC [$7E:0FAC] ;} $0FAA timer = 10 $A7AEE3 6B RTL } ;;; $A7AEE4 20 32 AF JSR $AF32 [$A7:AF32] ; Process Kraid instruction ($0FAA) $A7AEE7 C9 FF FF CMP #$FFFF ;\ $A7AEEA D0 3C BNE $3C [$AF28] ;} If not returned A = FFFFh: return ; This branch will never be executed (I swear!?) $A7AEEC A9 A4 AE LDA #$AEA4 ;\ $A7AEEF 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $AEA4 (done) $A7AEF2 A9 5A 00 LDA #$005A ;\ $A7AEF5 8D AC 0F STA $0FAC [$7E:0FAC] ;} $0FAC = 90 $A7AEF8 AF 0A 78 7E LDA $7E780A[$7E:780A] ;\ $A7AEFC 89 04 00 BIT #$0004 ;} If [$7E780A] hasn't 0004h: clear $7E780A and return $A7AEFF F0 28 BEQ $28 [$AF29] ;/ $A7AF00 28 PLP $A7AF01 38 SEC ;\ $A7AF02 E9 00 01 SBC #$0100 ;} $7E780A -= 100h $A7AF05 8F 0A 78 7E STA $7E780A[$7E:780A] ;/ $A7AF09 29 00 FF AND #$FF00 ;\ $A7AF0C F0 1B BEQ $1B [$AF29] ;} If [$7E780B] == 0: clear $7E780A and return $A7AF0E A9 2D B9 LDA #$B92D ;\ $A7AF11 8D A8 0F STA $0FA8 [$80:0FA8] ;} Kraid function = decrement enemy function timer $A7AF14 A9 40 00 LDA #$0040 ;\ $A7AF17 8D B2 0F STA $0FB2 [$80:0FB2] ;} Kraid function timer = 64 $A7AF1A A9 BF B6 LDA #$B6BF ;\ $A7AF1D 8F 00 78 7E STA $7E7800[$7E:7800] ;} Kraid next function = $B6BF (done) $A7AF21 A9 02 00 LDA #$0002 ;\ $A7AF24 8F 02 78 7E STA $7E7802[$7E:7802] ;} $7E7802 = 2 $A7AF28 6B RTL $A7AF29 A9 00 00 LDA #$0000 $A7AF2C 8F 0A 78 7E STA $7E780A[$7E:780A] $A7AF30 80 F6 BRA $F6 [$AF28] ;;; Process Kraid instruction ($0FAA) ;;; ; Hopefully [$0FAA] != 7FFFh ^_^; $A7AF32 AD AC 0F LDA $0FAC [$7E:0FAC] ;\ $A7AF35 F0 05 BEQ $05 [$AF3C] ;} If [$0FAC] == 0: return A = 0 $A7AF37 CE AC 0F DEC $0FAC [$7E:0FAC] ; Decrement [$0FAC] $A7AF3A F0 01 BEQ $01 [$AF3D] ; If [$0FAC] != 0: return A = [$0FAC] $A7AF3C 60 RTS $A7AF3D AE AA 0F LDX $0FAA [$7E:0FAA] ; X = [$0FAA] $A7AF40 BD 00 00 LDA $0000,x[$A7:9752] ; A = [X] $A7AF43 C9 FF FF CMP #$FFFF ;\ $A7AF46 F0 3A BEQ $3A [$AF82] ;} If A == FFFFh: return $A7AF48 30 39 BMI $39 [$AF83] ; If A+1 >= 0: $A7AF4A 8D AC 0F STA $0FAC [$7E:0FAC] ; $0FAC = A $A7AF4D 8A TXA ;\ $A7AF4E 18 CLC ;| $A7AF4F 69 08 00 ADC #$0008 ;} $0FAA += 8 $A7AF52 8D AA 0F STA $0FAA [$7E:0FAA] ;/ $A7AF55 BD 02 00 LDA $0002,x[$A7:9754] ;\ $A7AF58 A8 TAY ;| $A7AF59 DA PHX ;| $A7AF5A AE 30 03 LDX $0330 [$7E:0330] ;| $A7AF5D A9 C0 02 LDA #$02C0 ;| $A7AF60 95 D0 STA $D0,x [$7E:00D0] ;| $A7AF62 E8 INX ;| $A7AF63 E8 INX ;| $A7AF64 94 D0 STY $D0,x [$7E:00D2] ;| $A7AF66 E8 INX ;| $A7AF67 E8 INX ;| $A7AF68 E2 20 SEP #$20 ;| $A7AF6A A9 A7 LDA #$A7 ;} $A7:[X+2]..[X+2]+02BFh -> VRAM[BG2 tilemap base] $A7AF6C 95 D0 STA $D0,x [$7E:00D4] ;| $A7AF6E C2 20 REP #$20 ;| $A7AF70 E8 INX ;| $A7AF71 A5 59 LDA $59 [$7E:0059] ;| $A7AF73 29 FC 00 AND #$00FC ;| $A7AF76 EB XBA ;| $A7AF77 95 D0 STA $D0,x [$7E:00D5] ;| $A7AF79 E8 INX ;| $A7AF7A E8 INX ;| $A7AF7B 8E 30 03 STX $0330 [$7E:0330] ;| $A7AF7E FA PLX ;/ $A7AF7F A9 01 00 LDA #$0001 ; Return A = 1 $A7AF82 60 RTS $A7AF83 85 12 STA $12 [$7E:0012] ;\ Else ([$0FAA]+1 < 0): $A7AF85 6C 12 00 JMP ($0012)[$A7:AF94] ;} Execute [$0FAA] $A7AF88 AD AA 0F LDA $0FAA [$7E:0FAA] ;\ $A7AF8B 18 CLC ;| $A7AF8C 69 02 00 ADC #$0002 ;} $0FAA += 2 $A7AF8F 8D AA 0F STA $0FAA [$7E:0FAA] ;/ $A7AF92 80 A9 BRA $A9 [$AF3D] ; Next! ;;; $A7AF94 DA PHX $A7AF95 A9 2D 00 LDA #$002D ;\ $A7AF98 22 CB 90 80 JSL $8090CB[$80:90CB] ;} Sound library 2: 2Dh $A7AF9C FA PLX $A7AF9D 80 E9 BRA $E9 [$AF88] ; $0FAA += 2; next! ;;; $A7AF9F DA PHX $A7AFA0 A9 2E 00 LDA #$002E ;\ $A7AFA3 22 A3 90 80 JSL $8090A3[$80:90CB] ;} Sound library 2: 2Eh $A7AFA7 FA PLX $A7AFA8 80 DE BRA $DE [$AF88] ; $0FAA += 2; next! ;;; Spawn explosion enemy projectile ;;; $A7B0CB BD 64 0B LDA $0B64,x[$7E:0B64] ;\ $A7B0CE 85 12 STA $12 [$7E:0012] ;} $12 = projectile X position $A7B0D0 BD 78 0B LDA $0B78,x[$7E:0B78] ;\ $A7B0D3 85 14 STA $14 [$7E:0014] ;} $14 = projectile Y position $A7B0D5 BD 18 0C LDA $0C18,x[$7E:0C18] ;\ $A7B0D8 A0 1D 00 LDY #$001D ;| $A7B0DB 89 00 02 BIT #$0200 ;| $A7B0DE D0 03 BNE $03 [$B0E3] ;} If super missile, A=001Dh, else A=0006h (stored to $1993) $A7B0E0 A0 06 00 LDY #$0006 ;| ;| $A7B0E3 98 TYA ;/ $A7B0E4 A0 09 E5 LDY #$E509 ; Y = E509h $A7B0E7 22 97 80 86 JSL $868097[$86:8097] ; Spawn enemy projectile $A7B0EB A9 3D 00 LDA #$003D ;\ $A7B0EE 22 49 90 80 JSL $809049[$80:9049] ;} Sound library 1: 3Dh $A7B0F2 60 RTS ;;; Enemy instruction: NOP ;;; $A7B633 DA PHX $A7B634 FA PLX $A7B635 6B RTL ;;; Enemy instruction: Decrement Kraid Y position ;;; $A7B636 DA PHX $A7B637 CE 7E 0F DEC $0F7E [$7E:0F7E] $A7B63A FA PLX $A7B63B 6B RTL ;;; Enemy instruction: Increment Kraid Y position, set screen shaking ;;; $A7B63C DA PHX $A7B63D EE 7E 0F INC $0F7E [$7E:0F7E] $A7B640 A9 01 00 LDA #$0001 ;\ $A7B643 8D 3E 18 STA $183E [$7E:183E] ;} Set screen shaking to 1 $A7B646 A9 0A 00 LDA #$000A ;\ $A7B649 8D 40 18 STA $1840 [$7E:1840] ;} Screen shaking timer = 10 $A7B64C FA PLX $A7B64D 6B RTL ;;; Enemy instruction: Play sound library 2: 76h ;;; $A7B64E DA PHX $A7B64F 5A PHY $A7B650 A9 76 00 LDA #$0076 $A7B653 22 CB 90 80 JSL $8090CB[$80:90CB] $A7B657 7A PLY $A7B658 FA PLX $A7B659 6B RTL ;;; Enemy instruction: Decrement Kraid X position ;;; $A7B65A DA PHX $A7B65B AD 7A 0F LDA $0F7A [$7E:0F7A] $A7B65E 38 SEC $A7B65F ED 1C A9 SBC $A91C [$A7:A91C] $A7B662 8D 7A 0F STA $0F7A [$7E:0F7A] $A7B665 FA PLX $A7B666 6B RTL ;;; Enemy instruction: Decrement Kraid X position ;;; ; This is exactly identical to $B65A $A7B667 DA PHX $A7B668 AD 7A 0F LDA $0F7A [$7E:0F7A] $A7B66B 38 SEC $A7B66C ED 1C A9 SBC $A91C [$A7:A91C] $A7B66F 8D 7A 0F STA $0F7A [$7E:0F7A] $A7B672 FA PLX $A7B673 6B RTL ;;; Enemy instruction: Increment Kraid X position ;;; $A7B674 DA PHX $A7B675 5A PHY $A7B676 AD 20 A9 LDA $A920 [$A7:A920] $A7B679 18 CLC $A7B67A 6D 7A 0F ADC $0F7A [$7E:0F7A] $A7B67D 8D 7A 0F STA $0F7A [$7E:0F7A] $A7B680 7A PLY $A7B681 FA PLX $A7B682 6B RTL ;;; Enemy instruction: ;;; ;$A7B683 DA PHX ;$A7B684 5A PHY ;$A7B685 AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ ;$A7B688 C9 40 01 CMP #$0140 ;} If Kraid X position >= 0140h: ;$A7B68B 30 0B BMI $0B [$B698] ;/ ;$A7B68D AF 1E 78 7E LDA $7E781E[$7E:781E] ;\ ;$A7B691 3A DEC A ;} --$7E781E ;$A7B692 8F 1E 78 7E STA $7E781E[$7E:781E] ;/ ;$A7B696 D0 10 BNE $10 [$B6A8] ; If [$7E781E] != 0: return ;$A7B698 A2 00 00 LDX #$0000 ;\ ;$A7B69B 64 12 STZ $12 [$7E:0012] ;| ;$A7B69D AD 22 A9 LDA $A922 [$82:A922] ;} Move Kraid right 4 pixels ;$A7B6A0 85 14 STA $14 [$7E:0014] ;| ;$A7B6A2 22 AB C6 A0 JSL $A0C6AB[$A0:C6AB] ;/ ;$A7B6A6 B0 03 BCS $03 [$B6AB] ;} If returned carry clear: return ;$A7B6A8 7A PLY ;$A7B6A9 FA PLX ;$A7B6AA 6B RTL ;$A7B6AB A9 00 00 LDA #$0000 ;\ Else (returned carry set): ;$A7B6AE 8D 3E 18 STA $183E [$7E:183E] ;} Set room shaking 0 ;$A7B6B1 A9 07 00 LDA #$0007 ;\ ;$A7B6B4 8D 40 18 STA $1840 [$7E:1840] ;} Room shaking timer = 7 ;$A7B6B7 AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ ;$A7B6BA 8D BA 10 STA $10BA [$7E:10BA] ;} Kraid foot X position = Kraid X position ;$A7B6BD 80 E9 BRA $E9 [$B6A8] ;;; { $A7B6BF A9 E4 AE LDA #$AEE4 ;\ $A7B6C2 8D A8 0F STA $0FA8 [$7E:0FA8] ;} ...Just go back to sleep $A7B6C5 A9 D7 B6 LDA #$B6D7 ;\ $A7B6C8 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $B6D7 (done) $A7B6CB A9 52 97 LDA #$9752 ;\ $A7B6CE 8D AA 0F STA $0FAA [$7E:0FAA] ;} $0FAA = $9752 (done) $A7B6D1 AD 4A 97 LDA $974A [$A7:974A] ;\ $A7B6D4 8D AC 0F STA $0FAC [$7E:0FAC] ;} $0FAA delay = 5 $A7B6D7 DA PHX $A7B6D8 5A PHY $A7B6D9 20 32 AF JSR $AF32 [$A7:AF32] ; Process Kraid instruction ($0FAA) $A7B6DC C9 FF FF CMP #$FFFF ;\ $A7B6DF D0 06 BNE $06 [$B6E7] ;} If returned A = FFFFh: (never) $A7B6E1 A9 00 01 LDA #$0100 ;\ $A7B6E4 AD AC 0F LDA $0FAC [$7E:0FAC] ;} $0FAA delay = 0100h $A7B6E7 A2 E2 00 LDX #$00E2 ;\ $A7B6EA A0 00 00 LDY #$0000 ;| ;| $A7B6ED BF 00 C0 7E LDA $7EC000,x[$7E:C0E2] ;| $A7B6F1 29 1F 00 AND #$001F ;| $A7B6F4 18 CLC ;| $A7B6F5 69 01 00 ADC #$0001 ;| $A7B6F8 C9 1F 00 CMP #$001F ;| $A7B6FB 30 04 BMI $04 [$B701] ;| $A7B6FD C8 INY ;| $A7B6FE A9 1F 00 LDA #$001F ;| ;| $A7B701 85 12 STA $12 [$7E:0012] ;| $A7B703 BF 00 C0 7E LDA $7EC000,x[$7E:C0E2] ;| $A7B707 29 E0 03 AND #$03E0 ;| $A7B70A 18 CLC ;} Increment yellow component of $7E:C0E2..E7 $A7B70B 69 20 00 ADC #$0020 ;} Y = number of maximum intensities of green and red $A7B70E C9 E0 03 CMP #$03E0 ;| $A7B711 30 04 BMI $04 [$B717] ;| $A7B713 C8 INY ;| $A7B714 A9 E0 03 LDA #$03E0 ;| ;| $A7B717 85 14 STA $14 [$7E:0014] ;| $A7B719 BF 00 C0 7E LDA $7EC000,x[$7E:C0E2] ;| $A7B71D 29 00 FC AND #$FC00 ;| $A7B720 05 12 ORA $12 [$7E:0012] ;| $A7B722 05 14 ORA $14 [$7E:0014] ;| $A7B724 9F 00 C0 7E STA $7EC000,x[$7E:C0E2] ;| $A7B728 E8 INX ;| $A7B729 E8 INX ;| $A7B72A E0 E8 00 CPX #$00E8 ;| $A7B72D 30 BE BMI $BE [$B6ED] ;/ $A7B72F C0 06 00 CPY #$0006 ;\ $A7B732 30 06 BMI $06 [$B73A] ;} If maximum yellow: $A7B734 A9 3D B7 LDA #$B73D ;\ $A7B737 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $B73D (done) $A7B73A 7A PLY $A7B73B FA PLX $A7B73C 6B RTL ;;; $A7B73D DA PHX $A7B73E 5A PHY $A7B73F A2 0E 00 LDX #$000E ;\ $A7B742 AD 8C 0F LDA $0F8C [$7E:0F8C] ;| ;| $A7B745 DF 0C 78 7E CMP $7E780C,x[$7E:781A] ;| $A7B749 10 04 BPL $04 [$B74F] ;| $A7B74B CA DEX ;| $A7B74C CA DEX ;| $A7B74D D0 F6 BNE $F6 [$B745] ;| ;} Y = (Current eighth of health) * 32 $A7B74F E8 INX ;| $A7B750 E8 INX ;| $A7B751 8A TXA ;| $A7B752 0A ASL A ;| $A7B753 0A ASL A ;| $A7B754 0A ASL A ;| $A7B755 0A ASL A ;| $A7B756 A8 TAY ;/ $A7B757 A2 E2 00 LDX #$00E2 ;\ $A7B75A 64 14 STZ $14 [$7E:0014] ;| ;| $A7B75C BF 00 C0 7E LDA $7EC000,x[$7E:C0E2] ;| $A7B760 29 1F 00 AND #$001F ;| $A7B763 85 12 STA $12 [$7E:0012] ;| $A7B765 B9 D5 B3 LDA $B3D5,y[$A7:B4D5] ;| $A7B768 29 1F 00 AND #$001F ;| $A7B76B C5 12 CMP $12 [$7E:0012] ;| $A7B76D F0 0B BEQ $0B [$B77A] ;| $A7B76F E6 14 INC $14 [$7E:0014] ;| $A7B771 BF 00 C0 7E LDA $7EC000,x[$7E:C0E2] ;| $A7B775 3A DEC A ;| $A7B776 9F 00 C0 7E STA $7EC000,x[$7E:C0E2] ;| ;| $A7B77A BF 00 C0 7E LDA $7EC000,x[$7E:C0E2] ;| $A7B77E 29 E0 03 AND #$03E0 ;} Decrement yellow component of $7E:C0E2..E7 down to [$B3D5+Y..B3DA+Y] $A7B781 85 12 STA $12 [$7E:0012] ;} $14 = number of green and red components that reached their destination $A7B783 B9 D5 B3 LDA $B3D5,y[$A7:B4D5] ;| $A7B786 29 E0 03 AND #$03E0 ;| $A7B789 C5 12 CMP $12 [$7E:0012] ;| $A7B78B F0 0E BEQ $0E [$B79B] ;| $A7B78D E6 14 INC $14 [$7E:0014] ;| $A7B78F BF 00 C0 7E LDA $7EC000,x[$7E:C0E2] ;| $A7B793 38 SEC ;| $A7B794 E9 20 00 SBC #$0020 ;| $A7B797 9F 00 C0 7E STA $7EC000,x[$7E:C0E2] ;| ;| $A7B79B E8 INX ;| $A7B79C E8 INX ;| $A7B79D C8 INY ;| $A7B79E C8 INY ;| $A7B79F E0 E8 00 CPX #$00E8 ;| $A7B7A2 30 B8 BMI $B8 [$B75C] ;/ $A7B7A4 A5 14 LDA $14 [$7E:0014] ;\ $A7B7A6 D0 12 BNE $12 [$B7BA] ;} If $14 == 0: $A7B7A8 A9 E4 AE LDA #$AEE4 ;\ $A7B7AB 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $AEE4 (done) $A7B7AE A9 DA 96 LDA #$96DA ;\ $A7B7B1 8D AA 0F STA $0FAA [$7E:0FAA] ;| $A7B7B4 AD D2 96 LDA $96D2 [$A7:96D2] ;} $0FAA = $96DA (done) $A7B7B7 8D AC 0F STA $0FAC [$7E:0FAC] ;/ $A7B7BA 7A PLY $A7B7BB FA PLX $A7B7BC 6B RTL } $A7B831 6B RTL ;;; { $A7B832 BD 86 0F LDA $0F86,x[$7E:1086] ;\ $A7B835 29 FF FE AND #$FEFF ;| $A7B838 29 FF FB AND #$FBFF ;} Clear 0500h from enemy property bits (invisible and untouchable) $A7B83B 9D 86 0F STA $0F86,x[$7E:1086] ;/ $A7B83E AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7B841 18 CLC ;| $A7B842 7D AC 0F ADC $0FAC,x[$7E:10AC] ;| $A7B845 38 SEC ;} Enemy X position += [$0FAC,X] - [$0FAA,X] $A7B846 FD AA 0F SBC $0FAA,x[$7E:10AA] ;| $A7B849 9D 7A 0F STA $0F7A,x[$7E:107A] ;/ $A7B84C BD AA 0F LDA $0FAA,x[$7E:10AA] ;\ $A7B84F 18 CLC ;| $A7B850 69 01 00 ADC #$0001 ;} Increment $0FAA,X $A7B853 9D AA 0F STA $0FAA,x[$7E:10AA] ;/ $A7B856 C9 20 00 CMP #$0020 ;\ $A7B859 30 0C BMI $0C [$B867] ;} If [$0FAA,X] >= 20h: $A7B85B A9 68 B8 LDA #$B868 ;\ $A7B85E 9D A8 0F STA $0FA8,x[$7E:10A8] ;} $0FA8,X = $B868 $A7B861 A9 1E 00 LDA #$001E ;\ $A7B864 9D B2 0F STA $0FB2,x[$7E:10B2] ;} $0FB2,X = 001Eh $A7B867 6B RTL ;;; $A7B868 A0 00 00 LDY #$0000 ;\ $A7B86B BD B2 0F LDA $0FB2,x[$7E:10B2] ;| $A7B86E 89 01 00 BIT #$0001 ;| $A7B871 F0 03 BEQ $03 [$B876] ;| $A7B873 A0 00 0E LDY #$0E00 ;} If [$0FB2,X] has 0001: enemy palette slot = 0E00h, else = 0000 ;| $A7B876 98 TYA ;| $A7B877 9D 96 0F STA $0F96,x[$7E:1096] ;/ $A7B87A AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7B87D 18 CLC ;| $A7B87E 7D AC 0F ADC $0FAC,x[$7E:10AC] ;| $A7B881 38 SEC ;} Enemy X position += [$0FAC,X] - [$0FAA,X] $A7B882 FD AA 0F SBC $0FAA,x[$7E:10AA] ;| $A7B885 9D 7A 0F STA $0F7A,x[$7E:107A] ;/ $A7B888 DE B2 0F DEC $0FB2,x[$7E:10B2] ; Decrement $0FB2,X $A7B88B D0 0D BNE $0D [$B89A] ; If [$0FB2,X] == 0: $A7B88D A9 9B B8 LDA #$B89B ;\ $A7B890 9D A8 0F STA $0FA8,x[$7E:10A8] ;} $0FA8,X = $B89B $A7B893 A9 1F 00 LDA #$001F ;\ $A7B896 22 4D 91 80 JSL $80914D[$80:914D] ;} Sound library 3: 1Fh $A7B89A 6B RTL ;;; $A7B89B BD 7C 0F LDA $0F7C,x[$7E:107C] ;\ $A7B89E 38 SEC ;| $A7B89F ED 26 A9 SBC $A926 [$A7:A926] ;| $A7B8A2 9D 7C 0F STA $0F7C,x[$7E:107C] ;} Enemy X position -= 3.8000h $A7B8A5 BD 7A 0F LDA $0F7A,x[$7E:107A] ;| $A7B8A8 ED 28 A9 SBC $A928 [$A7:A928] ;| $A7B8AB 9D 7A 0F STA $0F7A,x[$7E:107A] ;/ $A7B8AE C9 38 00 CMP #$0038 ;\ $A7B8B1 10 0B BPL $0B [$B8BE] ;} If enemy X position < 38h $A7B8B3 48 PHA $A7B8B4 BD 86 0F LDA $0F86,x[$7E:1086] ;\ $A7B8B7 09 00 04 ORA #$0400 ;} Sets enemy properties to ignore Samus/projectiles $A7B8BA 9D 86 0F STA $0F86,x[$7E:1086] ;/ $A7B8BD 68 PLA $A7B8BE C9 20 00 CMP #$0020 ;\ $A7B8C1 10 1F BPL $1F [$B8E2] ;} If Enemy X position < 20h $A7B8C3 BD 86 0F LDA $0F86,x[$7E:1086] ;\ $A7B8C6 09 00 01 ORA #$0100 ;} Set enemy properties to invisible $A7B8C9 9D 86 0F STA $0F86,x[$7E:1086] ;/ $A7B8CC A9 23 B9 LDA #$B923 ;\ $A7B8CF 9D A8 0F STA $0FA8,x[$7E:10A8] ;} Enemy function = vertically align enemy to Kraid; decrement enemy function timer $A7B8D2 A9 2C 01 LDA #$012C ;\ $A7B8D5 9D B2 0F STA $0FB2,x[$7E:10B2] ;} Enemy function timer = 012Ch $A7B8D8 A9 32 B8 LDA #$B832 ;\ $A7B8DB 9F 00 78 7E STA $7E7800,x[$7E:7900] ;} Enemy next function = $B832 (done) $A7B8DF 9E AA 0F STZ $0FAA,x[$7E:10AA] ; Clear $0FAA,X $A7B8E2 22 E7 AB A0 JSL $A0ABE7[$A0:ABE7] ;\ $A7B8E6 29 FF FF AND #$FFFF ;} If Samus is not touching the enemy: return $A7B8E9 F0 1B BEQ $1B [$B906] ;/ $A7B8EB AD 56 0B LDA $0B56 [$7E:0B56] ;\ $A7B8EE 38 SEC ;| $A7B8EF ED 26 A9 SBC $A926 [$A7:A926] ;| $A7B8F2 8D 56 0B STA $0B56 [$7E:0B56] ;| $A7B8F5 AD 58 0B LDA $0B58 [$7E:0B58] ;| $A7B8F8 ED 28 A9 SBC $A928 [$A7:A928] ;} Distance to move Samus -= 3.8000h, cap at -10h $A7B8FB C9 F0 FF CMP #$FFF0 ;| $A7B8FE 10 03 BPL $03 [$B903] ;| $A7B900 A9 F0 FF LDA #$FFF0 ;| ;| $A7B903 8D 58 0B STA $0B58 [$7E:0B58] ;/ $A7B906 6B RTL } ;;; $A7B907 AD FA 0F LDA $0FFA [$7E:0FFA] ;\ $A7B90A C9 00 01 CMP #$0100 ;} If top lint X position >= 100h: $A7B90D 30 13 BMI $13 [$B922] ;/ $A7B90F BF 00 78 7E LDA $7E7800,x[$7E:7808] ;\ $A7B913 9D A8 0F STA $0FA8,x[$7E:0FB0] ;} Enemy function = enemy next function $A7B916 BD 86 0F LDA $0F86,x[$7E:0F8E] ;\ $A7B919 29 FF FE AND #$FEFF ;| $A7B91C 29 FF FB AND #$FBFF ;} Clear enemy properties to visibile and interactible $A7B91F 9D 86 0F STA $0F86,x[$7E:0F8E] ;/ $A7B922 6B RTL ;;; Vertically align enemy to Kraid; decrement enemy function timer ;;; $A7B923 AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7B926 38 SEC ;| $A7B927 FD 82 0F SBC $0F82,x[$7E:1002] ;} Enemy X position = Kraid X position - enemy X-radius $A7B92A 9D 7A 0F STA $0F7A,x[$7E:0FFA] ;/ $A7B92D BD B2 0F LDA $0FB2,x[$7E:0FB2] ;\ $A7B930 F0 0C BEQ $0C [$B93E] ;} If enemy function timer != 0: $A7B932 DE B2 0F DEC $0FB2,x[$7E:0FB2] ; Decrement enemy function timer $A7B935 D0 07 BNE $07 [$B93E] ; If enemy function == 0: $A7B937 BF 00 78 7E LDA $7E7800,x[$7E:7980] ;\ $A7B93B 9D A8 0F STA $0FA8,x[$7E:1128] ;} Enemy function = next enemy function $A7B93E 6B RTL ;;; Decrement enemy function timer; set enemy instruction $8887 ;;; $A7B93F AE 54 0E LDX $0E54 [$7E:0E54] $A7B942 BD B2 0F LDA $0FB2,x[$7E:10F2] ;\ $A7B945 F0 18 BEQ $18 [$B95F] ;} If enemy function timer != 0: $A7B947 DE B2 0F DEC $0FB2,x[$7E:10F2] ; Decrement enemy function timer $A7B94A D0 13 BNE $13 [$B95F] ; If enemy function == 0: $A7B94C BF 00 78 7E LDA $7E7800,x[$7E:7940] ;\ $A7B950 9D A8 0F STA $0FA8,x[$7E:10E8] ;} Enemy function = next enemy function $A7B953 A9 87 88 LDA #$8887 ;\ $A7B956 9D 92 0F STA $0F92,x[$7E:10D2] ;} Enemy instruction = $8887 (done) $A7B959 A9 01 00 LDA #$0001 ;\ $A7B95C 9D 94 0F STA $0F94,x[$7E:10D4] ;} Enemy instruction delay = 1 $A7B95F 6B RTL ;;; $A7B960 20 05 C0 JSR $C005 [$A7:C005] ; Execute subroutine $C005 (done) $A7B963 80 C8 BRA $C8 [$B92D] ; Decrement enemy function timer ;;; Process Kraid instruction and decrement enemy function timer ;;; $A7B965 20 32 AF JSR $AF32 [$A7:AF32] ; Process Kraid instruction ($0FAA) $A7B968 80 C3 BRA $C3 [$B92D] ; Decrement enemy function timer $A7BA2D 6B RTL ;;; $A7BA2E AF 40 79 7E LDA $7E7940[$7E:7940] ;\ $A7BA32 3A DEC A ;} Decrement Kraid foot next function $A7BA33 8F 40 79 7E STA $7E7940[$7E:7940] ;/ $A7BA37 D0 43 BNE $43 [$BA7C] ; If Kraid foot next function != 0: return $A7BA39 A2 00 00 LDX #$0000 ;\ ;| $A7BA3C AD 7A 0F LDA $0F7A [$7E:0F7A] ;| $A7BA3F DD 7D BA CMP $BA7D,x[$A7:BA7D] ;| $A7BA42 F0 0C BEQ $0C [$BA50] ;| $A7BA44 E8 INX ;} X = index of Kraid X position in [$BA7D + X] or 18h (18h should fail horribly though) :/ $A7BA45 E8 INX ;| $A7BA46 E8 INX ;| $A7BA47 E8 INX ;| $A7BA48 E0 18 00 CPX #$0018 ;| $A7BA4B 30 EF BMI $EF [$BA3C] ;/ $A7BA50 AD E5 05 LDA $05E5 [$7E:05E5] ;\ $A7BA53 29 1C 00 AND #$001C ;| $A7BA56 C9 10 00 CMP #$0010 ;} A = randomly 10h, 14h, 18h or 1Ch $A7BA59 30 03 BMI $03 [$BA5E] ;| $A7BA5B A9 10 00 LDA #$0010 ;/ $A7BA5E 18 CLC ;\ $A7BA5F 7D 7F BA ADC $BA7F,x[$A7:BA83] ;} X = [$BA7D + X+2] + A $A7BA62 AA TAX ;/ $A7BA63 BD 02 00 LDA $0002,x[$A7:BABB] ;\ $A7BA66 A8 TAY ;} Y = [X+2] $A7BA67 BD 00 00 LDA $0000,x[$A7:BAB9] ;\ $A7BA6A CD 7A 0F CMP $0F7A [$7E:0F7A] ;} If [X] < Kraid X position: $A7BA6D 10 07 BPL $07 [$BA76] ;/ $A7BA6F BD 00 00 LDA $0000,x[$A7:BAF9] $A7BA72 20 29 BB JSR $BB29 [$A7:BB29] ; Execute subroutine $BB29 (done) $A7BA75 6B RTL $A7BA76 BD 00 00 LDA $0000,x[$A7:BAB9] ;\ Else ([X] >= Kraid X position): $A7BA79 20 0D BB JSR $BB0D [$A7:BB0D] ; Execute subroutine $BB0D (done) $A7BA7C 6B RTL $A7BA7D dw 00F0,BA95, 0160,BAA9, 0180,BABD, 00D0,BAD1, 0140,BAE5, 0170,BAF9, 0180,0158 ;;; $A7BB0D 8F 1E 78 7E STA $7E781E[$7E:781E] ; $7E781E = A $A7BB11 98 TYA ;\ $A7BB12 8F 40 79 7E STA $7E7940[$7E:7940] ;} Kraid foot next function = Y (probably not actually, Y=180) $A7BB16 A9 45 BB LDA #$BB45 ;\ $A7BB19 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = $BB45 (done) $A7BB1C A9 01 00 LDA #$0001 ;\ $A7BB1F 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BB22 A9 87 88 LDA #$8887 ;\ $A7BB25 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $8887 (done) $A7BB28 60 RTS ;;; $A7BB29 8F 1E 78 7E STA $7E781E[$7E:781E] ; $7E781E = A $A7BB2D 98 TYA ;\ $A7BB2E 8F 40 79 7E STA $7E7940[$7E:7940] ;} Kraid foot next function = Y $A7BB32 A9 AE BB LDA #$BBAE ;\ $A7BB35 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = $BBAE (done) $A7BB38 A9 01 00 LDA #$0001 ;\ $A7BB3B 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BB3E A9 F3 86 LDA #$86F3 ;\ $A7BB41 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86F3 (done) $A7BB44 60 RTS ;;; $A7BB45 AF 1E 78 7E LDA $7E781E[$7E:781E] ;\ $A7BB49 CD 7A 0F CMP $0F7A [$7E:0F7A] ;| $A7BB4C F0 05 BEQ $05 [$BB53] ;} If [$7E781E] > Kraid X position: return $A7BB4E 10 1D BPL $1D [$BB6D] ;/ $A7BB50 8D 7A 0F STA $0F7A [$7E:0F7A] ; Kraid X position = [$7E781E] $A7BB53 AD D2 10 LDA $10D2 [$7E:10D2] ;\ $A7BB56 C9 39 89 CMP #$8939 ;} If Kraid foot instruction >= $8939: $A7BB59 30 12 BMI $12 [$BB6D] ;/ $A7BB5B A9 2E BA LDA #$BA2E ;\ $A7BB5E 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = $BA2E (done) $A7BB61 A9 01 00 LDA #$0001 ;\ $A7BB64 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BB67 A9 ED 86 LDA #$86ED ;\ $A7BB6A 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86ED (done) $A7BB6D 6B RTL ;;; { $A7BB6E AF 1E 78 7E LDA $7E781E[$7E:781E] ;\ $A7BB72 CD 7A 0F CMP $0F7A [$7E:0F7A] ;| $A7BB75 F0 05 BEQ $05 [$BB7C] ;} If [$7E781E] > Kraid X position: return $A7BB77 10 2A BPL $2A [$BBA3] ;/ $A7BB79 8D 7A 0F STA $0F7A [$7E:0F7A] ; Kraid X position = [$7E781E] $A7BB7C AD D2 10 LDA $10D2 [$7E:10D2] ;\ $A7BB7F C9 39 89 CMP #$8939 ;} If Kraid foot instruction >= $8939: $A7BB82 30 1F BMI $1F [$BBA3] ;/ $A7BB84 A9 2D B9 LDA #$B92D ;\ $A7BB87 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = decrement enemy function timer $A7BB8A A9 B4 00 LDA #$00B4 ;\ $A7BB8D 8D F2 10 STA $10F2 [$7E:10F2] ;} Kraid foot function timer = 180 $A7BB90 A9 A4 BB LDA #$BBA4 ;\ $A7BB93 8F 40 79 7E STA $7E7940[$7E:7940] ;} Kraid foot next function = $BBA4 (done) $A7BB97 A9 01 00 LDA #$0001 ;\ $A7BB9A 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BB9D A9 ED 86 LDA #$86ED ;\ $A7BBA0 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86ED (done) $A7BBA3 6B RTL ;;; $A7BBA4 A9 60 01 LDA #$0160 ; A = 0160h $A7BBA7 A0 B4 00 LDY #$00B4 ; Y = 180 $A7BBAA 20 0D BB JSR $BB0D [$A7:BB0D] ; Execute subroutine $BB0D (done) $A7BBAD 6B RTL } ;;; $A7BBAE AF 1E 78 7E LDA $7E781E[$7E:781E] ;\ $A7BBB2 CD 7A 0F CMP $0F7A [$7E:0F7A] ;} If [$7E781E] < Kraid X position: $A7BBB5 30 1E BMI $1E [$BBD5] ;/ $A7BBB7 8D 7A 0F STA $0F7A [$7E:0F7A] ; Kraid X position = [$7E781E] $A7BBBA AD D2 10 LDA $10D2 [$7E:10D2] ;\ $A7BBBD C9 BB 87 CMP #$87BB ;} If Kraid foot instruction == $8939: $A7BBC0 D0 12 BNE $12 [$BBD4] ;/ $A7BBC2 A9 2E BA LDA #$BA2E ;\ $A7BBC5 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = $BA2E (done) $A7BBC8 A9 01 00 LDA #$0001 ;\ $A7BBCB 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BBCE A9 ED 86 LDA #$86ED ;\ $A7BBD1 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86ED (done) $A7BBD4 6B RTL $A7BBD5 AD D2 10 LDA $10D2 [$7E:10D2] ;\ Else ([$7E781E] >= Kraid X position): $A7BBD8 C9 BB 87 CMP #$87BB ;} If Kraid foot instruction == $87BB $A7BBDB D0 F7 BNE $F7 [$BBD4] ;/ $A7BBDD A9 F3 86 LDA #$86F3 ;\ $A7BBE0 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86F3 (done) $A7BBE3 A9 01 00 LDA #$0001 ;\ $A7BBE6 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BBE9 6B RTL ;;; $A7BBEA 20 32 AF JSR $AF32 [$A7:AF32] ; Process Kraid instruction ($0FAA) $A7BBED C9 FF FF CMP #$FFFF ;\ $A7BBF0 F0 31 BEQ $31 [$BC23] ;} If not returned A = FFFFh: $A7BBF2 AD AA 0F LDA $0FAA [$7E:0FAA] ;\ $A7BBF5 38 SEC ;| $A7BBF6 E9 08 00 SBC #$0008 ;| $A7BBF9 AA TAX ;} If [[$0FAA]-6] == $A0C8: $A7BBFA BD 02 00 LDA $0002,x[$A7:96D4] ;| $A7BBFD C9 C8 A0 CMP #$A0C8 ;| $A7BC00 D0 20 BNE $20 [$BC22] ;/ $A7BC02 AD AC 0F LDA $0FAC [$7E:0FAC] ;\ $A7BC05 29 0F 00 AND #$000F ;} If [$0FAC] is multiple of 16: $A7BC08 D0 18 BNE $18 [$BC22] ;/ $A7BC0A A0 45 9C LDY #$9C45 ;\ $A7BC0D AD E5 05 LDA $05E5 [$7E:05E5] ;| $A7BC10 29 0E 00 AND #$000E ;| $A7BC13 AA TAX ;} Spawn ER projectile $9C45 with random parameter FB40h/FB80h/FC00h/FC40h $A7BC14 BD 65 BC LDA $BC65,x[$A7:BC65] ;| $A7BC17 22 27 80 86 JSL $868027[$86:8027] ;/ $A7BC1B A9 1E 00 LDA #$001E ;\ $A7BC1E 22 4D 91 80 JSL $80914D[$80:914D] ;} Sound library 3: 1Eh $A7BC22 6B RTL ; This branch is never taken, $AF32 cannot return A = FFFFh $A7BC23 20 E9 AD JSR $ADE9 [$A7:ADE9] ; Execute subroutine $ADE9 (done) $A7BC26 A9 5A 00 LDA #$005A ;\ $A7BC29 8D AC 0F STA $0FAC [$7E:0FAC] ;} $0FAC = 90 $A7BC2C AF 0A 78 7E LDA $7E780A[$7E:780A] ;\ $A7BC30 89 04 00 BIT #$0004 ;} If [$7E780A] hasn't 0004h: clear $7E780A and return $A7BC33 F0 28 BEQ $28 [$BC5D] ;/ $A7BC35 38 SEC ;\ $A7BC36 E9 00 01 SBC #$0100 ;} $7E780A -= 100h $A7BC39 8F 0A 78 7E STA $7E780A[$7E:780A] ;/ $A7BC3D 29 00 FF AND #$FF00 ;\ $A7BC40 F0 1B BEQ $1B [$BC5D] ;} If [$7E780B] == 0: clear $7E780A and return $A7BC42 A9 2D B9 LDA #$B92D ;\ $A7BC45 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = decrement enemy function timer $A7BC48 A9 40 00 LDA #$0040 ;\ $A7BC4B 8D B2 0F STA $0FB2 [$7E:0FB2] ;} Kraid function timer = 64 $A7BC4E A9 BF B6 LDA #$B6BF ;\ $A7BC51 8F 00 78 7E STA $7E7800[$7E:7800] ;} Kraid next function = $B6BF (done) $A7BC55 A9 02 00 LDA #$0002 ;\ $A7BC58 8F 02 78 7E STA $7E7802[$7E:7802] ;} $7E7802 = 2 $A7BC5C 6B RTL $A7BC5D A9 00 00 LDA #$0000 $A7BC60 8F 0A 78 7E STA $7E780A[$7E:780A] $A7BC64 6B RTL $A7BC65 dw FC00, FC40, FB40, FB80, FB40, FC00, FB80, FC40 ;;; Kraid fingernail_A touch AI ;;; $A7BCCF 22 77 A4 A0 JSL $A0A477[$A0:A477] ; Normal enemy touch AI $A7BCD3 AE 54 0E LDX $0E54 [$7E:0E54] $A7BCD6 22 AF A3 A0 JSL $A0A3AF[$A0:A3AF] ; Death animation $A7BCDA AE 54 0E LDX $0E54 [$7E:0E54] $A7BCDD 6B RTL ;;; Kraid fingernail_B touch AI ;;; $A7BCDE 22 77 A4 A0 JSL $A0A477[$A0:A477] ; Normal enemy touch AI $A7BCE2 AE 54 0E LDX $0E54 [$7E:0E54] $A7BCE5 22 AF A3 A0 JSL $A0A3AF[$A0:A3AF] ; Death animation $A7BCE9 AE 54 0E LDX $0E54 [$7E:0E54] $A7BCEC 6B RTL ;;; Kraid fingernail_A initiation AI ;;; { $A7BCEF AE 54 0E LDX $0E54 [$7E:0E54] $A7BCF2 AD 96 0F LDA $0F96 [$7E:0F96] ;\ $A7BCF5 9D 96 0F STA $0F96,x[$7E:1116] ;} Enemy palette = Kraid palette $A7BCF8 A9 28 00 LDA #$0028 ;\ $A7BCFB 9D AA 0F STA $0FAA,x[$7E:112A] ;} [$0FAA + X] = 40 $A7BCFE BD 86 0F LDA $0F86,x[$7E:1106] ;\ $A7BD01 09 00 01 ORA #$0100 ;} Set enemy invisible $A7BD04 9D 86 0F STA $0F86,x[$7E:1106] ;/ $A7BD07 A9 FF 7F LDA #$7FFF ;\ $A7BD0A 9D 94 0F STA $0F94,x[$7E:1114] ;} Enemy instruction delay = 7FFFh $A7BD0D A9 0A 8B LDA #$8B0A ;\ $A7BD10 9D 92 0F STA $0F92,x[$7E:1112] ;} Enemy instruction = $8B0A (done) $A7BD13 AD 0C 8B LDA $8B0C [$A7:8B0C] ;\ $A7BD16 9D 8E 0F STA $0F8E,x[$7E:110E] ;} Enemy OAM / hitbox = $A617 (done) $A7BD19 A9 60 BD LDA #$BD60 ;\ $A7BD1C 9F 00 78 7E STA $7E7800,x[$7E:7980] ;} Enemy next function = $BD60 (done) $A7BD20 A9 2D B9 LDA #$B92D ;\ $A7BD23 9D A8 0F STA $0FA8,x[$7E:1128] ;} Enemy function = decrement enemy function timer $A7BD26 A9 40 00 LDA #$0040 ;\ $A7BD29 9D B2 0F STA $0FB2,x[$7E:1132] ;} Enemy function timer = 64 $A7BD2C 6B RTL ;;; Kraid fingernail_B initiation AI ;;; ; If you even thought about looking at these next two instructions, you're just monkeying around $A7BD2D AE 54 0E LDX $0E54 [$7E:0E54] $A7BD30 80 C0 BRA $C0 [$BCF2] ;;; $A7BD60 AD E5 05 LDA $05E5 [$7E:05E5] ;\ $A7BD63 29 06 00 AND #$0006 ;} Y = 0, 2, 4 or 6 randomly $A7BD66 A8 TAY ;/ $A7BD67 AD 30 11 LDA $1130 [$7E:1130] ;\ $A7BD6A AE 54 0E LDX $0E54 [$7E:0E54] ;| $A7BD6D E0 80 01 CPX #$0180 ;} If Kraid fingernail_A: A = Kraid fingernail_B $0FB0 $A7BD70 D0 03 BNE $03 [$BD75] ;} Else: A = Kraid fingernail_A $0FB0 $A7BD72 AD 70 11 LDA $1170 [$7E:1170] ;/ $A7BD75 C9 00 00 CMP #$0000 ;\ $A7BD78 10 05 BPL $05 [$BD7F] ;} If A >= 0: $A7BD7A B9 3E BE LDA $BE3E,y[$A7:BE42] ;\ $A7BD7D 80 03 BRA $03 [$BD82] ;} A = $BE4E + Y*8 $A7BD7F B9 46 BE LDA $BE46,y[$A7:BE4A] ; Else (A < 0): A = $BE56 + Y*8 $A7BD82 A8 TAY ; Y = A $A7BD83 B9 00 00 LDA $0000,y[$A7:BE76] ;\ $A7BD86 9D AA 0F STA $0FAA,x[$7E:112A] ;| $A7BD89 B9 02 00 LDA $0002,y[$A7:BE78] ;| $A7BD8C 9D AC 0F STA $0FAC,x[$7E:112C] ;| $A7BD8F B9 04 00 LDA $0004,y[$A7:BE7A] ;} Enemy speeds = [Y..Y+7] $A7BD92 9D AE 0F STA $0FAE,x[$7E:112E] ;| $A7BD95 B9 06 00 LDA $0006,y[$A7:BE7C] ;| $A7BD98 9D B0 0F STA $0FB0,x[$7E:1130] ;/ $A7BD9B A9 01 00 LDA #$0001 ;\ $A7BD9E 9D B4 0F STA $0FB4,x[$7E:1134] ;} Enemy 'speed' = 1 $A7BDA1 BD 86 0F LDA $0F86,x[$7E:1106] ;\ $A7BDA4 29 FF FE AND #$FEFF ;| $A7BDA7 29 FF FB AND #$FBFF ;} Set enemy to respect Samus/projectiles and visible $A7BDAA 9D 86 0F STA $0F86,x[$7E:1106] ;/ $A7BDAD A9 01 00 LDA #$0001 ;\ $A7BDB0 9D 94 0F STA $0F94,x[$7E:1114] ;} Enemy instruction delay = 1 $A7BDB3 A9 0A 8B LDA #$8B0A ;\ $A7BDB6 9D 92 0F STA $0F92,x[$7E:1112] ;} Enemy instruction = $8B0A (done) $A7BDB9 A9 8E BE LDA #$BE8E ;\ $A7BDBC 9D A8 0F STA $0FA8,x[$7E:1128] ;} Enemy function = $BE8E (done) $A7BDBF AD E5 05 LDA $05E5 [$7E:05E5] ;\ $A7BDC2 89 01 00 BIT #$0001 ;} Randomly: $A7BDC5 D0 23 BNE $23 [$BDEA] ;/ $A7BDC7 A9 00 00 LDA #$0000 ;\ $A7BDCA 9F 0E 78 7E STA $7E780E,x[$7E:798E] ;} Enemy $7E780E = 0 $A7BDCE AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7BDD1 38 SEC ;| $A7BDD2 ED 82 0F SBC $0F82 [$7E:0F82] ;| $A7BDD5 38 SEC ;} Enemy X position = Kraid left boundary - enemy width, aligned to the tile $A7BDD6 FD 82 0F SBC $0F82,x[$7E:1102] ;| $A7BDD9 29 F0 FF AND #$FFF0 ;| $A7BDDC 9D 7A 0F STA $0F7A,x[$7E:10FA] ;/ $A7BDDF AD BE 0F LDA $0FBE [$7E:0FBE] ;\ $A7BDE2 18 CLC ;| $A7BDE3 69 80 00 ADC #$0080 ;} Enemy Y position = Kraid arm Y position + 80h $A7BDE6 9D 7E 0F STA $0F7E,x[$7E:10FE] ;/ $A7BDE9 6B RTL ; Else randomly: $A7BDEA AF 8E 79 7E LDA $7E798E[$7E:798E] ; A = [Kraid fingernail_A $7E780E] $A7BDEE E0 C0 01 CPX #$01C0 ;} If A != Kraid fingernail_B index: $A7BDF1 F0 04 BEQ $04 [$BDF7] ;/ $A7BDF3 AF CE 79 7E LDA $7E79CE[$7E:79CE] ; A = [Kraid fingernail_B $7E780E] $A7BDF7 C9 01 00 CMP #$0001 ;\ $A7BDFA F0 CB BEQ $CB [$BDC7] ;} If A == 1: execute the other random branch $A7BDFC A9 01 00 LDA #$0001 ;\ $A7BDFF 9F 0E 78 7E STA $7E780E,x[$7E:798E] ;} Enemy $7E780E = 1 $A7BE03 A9 32 00 LDA #$0032 ;\ $A7BE06 9D 7A 0F STA $0F7A,x[$7E:10FA] ;} Enemy X position = 0032h $A7BE09 A9 F0 00 LDA #$00F0 ;\ $A7BE0C 9D 7E 0F STA $0F7E,x[$7E:10FE] ;} Enemy Y position = 00F0h $A7BE0F A9 00 00 LDA #$0000 ;\ $A7BE12 9D AA 0F STA $0FAA,x[$7E:112A] ;} Enemy X subspeed = 0 $A7BE15 A9 01 00 LDA #$0001 ;\ $A7BE18 9D AC 0F STA $0FAC,x[$7E:112C] ;} Enemy X speed = 1 $A7BE1B A9 00 00 LDA #$0000 ;\ $A7BE1E 9D AE 0F STA $0FAE,x[$7E:112E] ;} Enemy Y subspeed = 0 $A7BE21 A9 00 00 LDA #$0000 ;\ $A7BE24 9D B0 0F STA $0FB0,x[$7E:1130] ;} Enemy Y speed = 0 $A7BE27 A9 07 B9 LDA #$B907 ;\ $A7BE2A 9D A8 0F STA $0FA8,x[$7E:1128] ;} Enemy function = $B907 (done) $A7BE2D A9 8E BE LDA #$BE8E ;\ $A7BE30 9F 00 78 7E STA $7E7800,x[$7E:7980] ;} Enemy next function = $BE8E (done) $A7BE34 BD 86 0F LDA $0F86,x[$7E:1106] ;\ $A7BE37 09 00 05 ORA #$0500 ;} Set enemy to ignore Samus/projectiles and invisible $A7BE3A 9D 86 0F STA $0F86,x[$7E:1106] ;/ $A7BE3D 6B RTL ; Table of Kraid fingernail rightward speeds $A7BE3E dw BE4E, BE5E, BE6E, BE7E ; Table of Kraid fingernail leftward speeds $A7BE46 dw BE56, BE66, BE76, BE86 ; Kraid fingernail speeds: $A7BE4E dw 0000, FFFF, 0000, 0001 $A7BE56 dw 0000, FFFF, 0000, FFFF $A7BE5E dw 0000, FFFF, 0000, 0001 $A7BE66 dw 0000, FFFF, 0000, FFFF $A7BE6E dw 0000, FFFF, 0000, 0001 $A7BE76 dw 0000, FFFF, 0000, FFFF $A7BE7E dw 0000, FFFF, 0000, 0001 $A7BE86 dw 0000, FFFF, 0000, FFFF ;;; $A7BE8E BD AA 0F LDA $0FAA,x[$7E:112A] ;\ $A7BE91 85 12 STA $12 [$7E:0012] ;| $A7BE93 BD AC 0F LDA $0FAC,x[$7E:112C] ;} Move enemy horizontally $A7BE96 85 14 STA $14 [$7E:0014] ;| $A7BE98 22 AB C6 A0 JSL $A0C6AB[$A0:C6AB] ;/ $A7BE9C 90 16 BCC $16 [$BEB4] ; If returned carry set: $A7BE9E BD AA 0F LDA $0FAA,x[$7E:112A] ;\ $A7BEA1 49 FF FF EOR #$FFFF ;| $A7BEA4 1A INC A ;} Negate enemy subspeed $A7BEA5 9D AA 0F STA $0FAA,x[$7E:112A] ;/ $A7BEA8 BD AC 0F LDA $0FAC,x[$7E:112C] ;\ $A7BEAB 49 FF FF EOR #$FFFF ;| $A7BEAE 1A INC A ;} Negate enemy speed $A7BEAF 9D AC 0F STA $0FAC,x[$7E:112C] ;/ $A7BEB2 80 42 BRA $42 [$BEF6] $A7BEB4 A0 00 00 LDY #$0000 ;\ Else (returned carry clear): ;| $A7BEB7 AD 7E 0F LDA $0F7E [$7E:0F7E] ;| $A7BEBA 18 CLC ;| $A7BEBB 79 1F BF ADC $BF1F,y[$A7:BF1F] ;| $A7BEBE DD 7E 0F CMP $0F7E,x[$7E:10FE] ;| $A7BEC1 30 06 BMI $06 [$BEC9] ;} Y = first index of $BF1D,Y such that [$BF1F+Y] < enemy Y position - Kraid Y position $A7BEC3 C8 INY ;| $A7BEC4 C8 INY ;| $A7BEC5 C8 INY ;| $A7BEC6 C8 INY ;| $A7BEC7 80 EE BRA $EE [$BEB7] ;/ $A7BEC9 AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7BECC 18 CLC ;| $A7BECD 79 1D BF ADC $BF1D,y[$A7:BF1D] ;| $A7BED0 85 12 STA $12 [$7E:0012] ;| $A7BED2 BD 7A 0F LDA $0F7A,x[$7E:10FA] ;} If [$BF1D+Y] <= enemy right boundary - Kraid X position: $A7BED5 18 CLC ;| $A7BED6 7D 82 0F ADC $0F82,x[$7E:1102] ;| $A7BED9 C5 12 CMP $12 [$7E:0012] ;| $A7BEDB 30 19 BMI $19 [$BEF6] ;/ $A7BEDD BD AC 0F LDA $0FAC,x[$7E:112C] ;\ $A7BEE0 30 14 BMI $14 [$BEF6] ;} And moving right: $A7BEE2 BD AA 0F LDA $0FAA,x[$7E:116A] ;\ $A7BEE5 49 FF FF EOR #$FFFF ;| $A7BEE8 1A INC A ;} Negate enemy X subspeed $A7BEE9 9D AA 0F STA $0FAA,x[$7E:116A] ;/ $A7BEEC BD AC 0F LDA $0FAC,x[$7E:116C] ;\ $A7BEEF 49 FF FF EOR #$FFFF ;| $A7BEF2 1A INC A ;} Negative enemy X speed $A7BEF3 9D AC 0F STA $0FAC,x[$7E:116C] ;/ $A7BEF6 BD AE 0F LDA $0FAE,x[$7E:112E] ;\ $A7BEF9 85 12 STA $12 [$7E:0012] ;| $A7BEFB BD B0 0F LDA $0FB0,x[$7E:1130] ;} Move enemy vertically $A7BEFE 85 14 STA $14 [$7E:0014] ;| $A7BF00 22 86 C7 A0 JSL $A0C786[$A0:C786] ;/ $A7BF04 90 16 BCC $16 [$BF1C] ; If returned carry set: $A7BF06 BD AE 0F LDA $0FAE,x[$7E:116E] ;\ $A7BF09 49 FF FF EOR #$FFFF ;| $A7BF0C 1A INC A ;} Negate enemy Y subspeed $A7BF0D 9D AE 0F STA $0FAE,x[$7E:116E] ;/ $A7BF10 BD B0 0F LDA $0FB0,x[$7E:1170] ;\ $A7BF13 49 FF FF EOR #$FFFF ;| $A7BF16 69 00 00 ADC #$0000 ;} Negate enemy Y speed $A7BF19 9D B0 0F STA $0FB0,x[$7E:1170] ;/ $A7BF1C 6B RTL $A7BF1D dw FFC0,0010, FFD8,FFD8, FFF0,FFA0, 0008,FF80 } ;;; { $A7BF2D 20 05 C0 JSR $C005 [$A7:C005] ; Execute subroutine $C005 (done) $A7BF30 AD D2 0F LDA $0FD2 [$7E:0FD2] ;\ $A7BF33 C9 37 8A CMP #$8A37 ;} If Kraid arm instruction >= $8A37: $A7BF36 30 24 BMI $24 [$BF5C] ;/ $A7BF38 A9 F0 8A LDA #$8AF0 ;\ $A7BF3B 8D D2 0F STA $0FD2 [$7E:0FD2] ;} Kraid arm instruction = $8AF0 (done) $A7BF3E A9 01 00 LDA #$0001 ;\ $A7BF41 8D D4 0F STA $0FD4 [$7E:0FD4] ;} Kraid arm instruction delay = 1 $A7BF44 A9 01 00 LDA #$0001 ;\ $A7BF47 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BF4A A9 BD 87 LDA #$87BD ;\ $A7BF4D 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $87BD (done) $A7BF50 A9 5D BF LDA #$BF5D ;\ $A7BF53 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = $BF5D (done) $A7BF56 A9 00 00 LDA #$0000 ;\ $A7BF59 8D F2 10 STA $10F2 [$7E:10F2] ;} Kraid foot function timer = 0 $A7BF5C 6B RTL ;;; $A7BF5D 20 05 C0 JSR $C005 [$A7:C005] ; Execute subroutine $C005 (done) $A7BF60 AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7BF63 C9 5C 00 CMP #$005C ;} If Kraid X position < 005Ch $A7BF66 10 06 BPL $06 [$BF6E] ;/ $A7BF68 A9 5C 00 LDA #$005C ;\ $A7BF6B 8D 7A 0F STA $0F7A [$7E:0F7A] ;} Kraid X position = 005Ch $A7BF6E AD D2 10 LDA $10D2 [$7E:10D2] ;\ $A7BF71 C9 85 88 CMP #$8885 ;} If Kraid foot instruction != $8885: return $A7BF74 D0 34 BNE $34 [$BFAA] ;/ $A7BF76 AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7BF79 C9 5C 00 CMP #$005C ;} If Kraid X position != 005Ch: $A7BF7C F0 0D BEQ $0D [$BF8B] ;/ $A7BF7E A9 01 00 LDA #$0001 ;\ $A7BF81 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BF84 A9 BD 87 LDA #$87BD ;\ $A7BF87 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $87BD $A7BF8A 6B RTL $A7BF8B A9 AB BF LDA #$BFAB ;\ Else (Kraid X position == 005Ch): $A7BF8E 8F 40 79 7E STA $7E7940[$7E:7940] ;} Kraid foot next function = $BFAB (done) $A7BF92 A9 3F B9 LDA #$B93F ;\ $A7BF95 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = decrement enemy function timer; set enemy instruction $8887 $A7BF98 A9 01 00 LDA #$0001 ;\ $A7BF9B 8D F2 10 STA $10F2 [$7E:10F2] ;} Kraid foot function delay = 1 $A7BF9E A9 01 00 LDA #$0001 ;\ $A7BFA1 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BFA4 A9 ED 86 LDA #$86ED ;\ $A7BFA7 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86ED (done) $A7BFAA 6B RTL ;;; $A7BFAB 20 05 C0 JSR $C005 [$A7:C005] ; Execute subroutine $C005 (done) $A7BFAE AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7BFB1 C9 B0 00 CMP #$00B0 ;} If Kraid X position >= 00B0h $A7BFB4 30 06 BMI $06 [$BFBC] ;/ $A7BFB6 A9 B0 00 LDA #$00B0 ;\ $A7BFB9 8D 7A 0F STA $0F7A [$7E:0F7A] ;} Kraid X position = 00B0h $A7BFBC AD D2 10 LDA $10D2 [$7E:10D2] ;\ $A7BFBF C9 39 89 CMP #$8939 ;} If Kraid foot instruction < $8939: return $A7BFC2 30 40 BMI $40 [$C004] ;/ $A7BFC4 AD 7A 0F LDA $0F7A [$7E:0F7A] ;\ $A7BFC7 C9 B0 00 CMP #$00B0 ;} If Kraid X position != 00B0h: $A7BFCA F0 0D BEQ $0D [$BFD9] ;/ $A7BFCC A9 87 88 LDA #$8887 ;\ $A7BFCF 9D 92 0F STA $0F92,x[$7E:10D2] ;} Kraid instruction = $8887 (done) $A7BFD2 A9 01 00 LDA #$0001 ;\ $A7BFD5 9D 94 0F STA $0F94,x[$7E:10D4] ;} Kraid instruction delay = 1 $A7BFD8 6B RTL $A7BFD9 A9 F3 89 LDA #$89F3 ;\ Else (Kraid X position == 00B0h): $A7BFDC 8D D2 0F STA $0FD2 [$7E:0FD2] ;} Kraid arm instruction = $89F3 (done) $A7BFDF A9 01 00 LDA #$0001 ;\ $A7BFE2 8D D4 0F STA $0FD4 [$7E:0FD4] ;} Kraid arm instruction delay = 1 $A7BFE5 A9 01 00 LDA #$0001 ;\ $A7BFE8 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7BFEB A9 ED 86 LDA #$86ED ;\ $A7BFEE 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86ED (done) $A7BFF1 A9 60 B9 LDA #$B960 ;\ $A7BFF4 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = $B960 (done) $A7BFF7 A9 2C 01 LDA #$012C ;\ $A7BFFA 8D F2 10 STA $10F2 [$7E:10F2] ;} Kraid foot function timer = 300 $A7BFFD A9 2D BF LDA #$BF2D ;\ $A7C000 8F 40 79 7E STA $7E7940[$7E:7940] ;} Kraid foot next function = $BF2D (done) $A7C004 6B RTL } ;;; { $A7C005 AD 8C 0F LDA $0F8C [$7E:0F8C] ;\ $A7C008 CF 18 78 7E CMP $7E7818[$7E:7818] ;| $A7C00C 30 01 BMI $01 [$C00F] ;} If Kraid HP >= 7/8 Kraid health: return $A7C00E 60 RTS ;/ $A7C00F A9 65 B9 LDA #$B965 ;\ $A7C012 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = process Kraid instruction and decrement enemy function timer (done) $A7C015 A9 B4 00 LDA #$00B4 ;\ $A7C018 8D B2 0F STA $0FB2 [$7E:0FB2] ;} Kraid function timer = 180 $A7C01B A9 A1 C0 LDA #$C0A1 ;\ $A7C01E 8F 00 78 7E STA $7E7800[$7E:7800] ;} Kraid next function = $C0A1 (done) $A7C022 AD AA 0F LDA $0FAA [$7E:0FAA] ;\ $A7C025 AA TAX ;} A = [[$0FAA] + 2] $A7C026 BD 02 00 LDA $0002,x[$A7:96F6] ;/ $A7C029 A0 32 00 LDY #$0032 ;\ $A7C02C C9 C8 97 CMP #$97C8 ;} If A == $97C8: Y = 50 $A7C02F F0 13 BEQ $13 [$C044] ;/ $A7C031 A0 2A 00 LDY #$002A ;\ $A7C034 C9 C8 9A CMP #$9AC8 ;} Else if A == $9AC8: Y = 42 $A7C037 F0 0B BEQ $0B [$C044] ;/ $A7C039 A0 22 00 LDY #$0022 ;\ $A7C03C C9 C8 9D CMP #$9DC8 ;} Else if A == $9DC8: Y = 34 $A7C03F F0 03 BEQ $03 [$C044] ;/ $A7C041 A0 1A 00 LDY #$001A ; Else Y = 26 $A7C044 98 TYA ;\ $A7C045 18 CLC ;| $A7C046 69 DA 96 ADC #$96DA ;} $0FAA = $96DA + Y $A7C049 8D AA 0F STA $0FAA [$7E:0FAA] ;/ $A7C04C B9 D2 96 LDA $96D2,y[$A7:96F4] ;\ $A7C04F 8D AC 0F STA $0FAC [$7E:0FAC] ;} $0FAC = [$96D2 + Y] $A7C052 A9 04 00 LDA #$0004 ;\ $A7C055 8D 3E 18 STA $183E [$7E:183E] ;} Screen shaking type = 4 $A7C058 A9 54 01 LDA #$0154 ;\ $A7C05B 8D 40 18 STA $1840 [$7E:1840] ;} Screen shaking timer = 340 $A7C05E A9 E7 86 LDA #$86E7 ;\ $A7C061 8D D2 10 STA $10D2 [$7E:10D2] ;} Kraid foot instruction = $86E7 (done) $A7C064 A9 01 00 LDA #$0001 ;\ $A7C067 8D D4 10 STA $10D4 [$7E:10D4] ;} Kraid foot instruction delay = 1 $A7C06A A9 2D BA LDA #$BA2D ;\ $A7C06D 8D E8 10 STA $10E8 [$7E:10E8] ;} Kraid foot function = RTS $A7C070 A9 F3 89 LDA #$89F3 ;\ $A7C073 8D D2 0F STA $0FD2 [$7E:0FD2] ;} Kraid arm instruction = $89F3 (done) $A7C076 A9 01 00 LDA #$0001 ;\ $A7C079 8D D4 0F STA $0FD4 [$7E:0FD4] ;} Kraid arm instruction delay = 1 $A7C07C AD 06 10 LDA $1006 [$7E:1006] ;\ $A7C07F 09 00 01 ORA #$0100 ;| $A7C082 8D 06 10 STA $1006 [$7E:1006] ;| $A7C085 AD 46 10 LDA $1046 [$7E:1046] ;| $A7C088 09 00 01 ORA #$0100 ;} Set Kraid lint invisible $A7C08B 8D 46 10 STA $1046 [$7E:1046] ;| $A7C08E AD 86 10 LDA $1086 [$7E:1086] ;| $A7C091 09 00 01 ORA #$0100 ;| $A7C094 8D 86 10 STA $1086 [$7E:1086] ;/ $A7C097 AD C6 0F LDA $0FC6 [$7E:0FC6] ;\ $A7C09A 09 00 04 ORA #$0400 ;} Set Kraid arm to ignore Samus/projectiles $A7C09D 8D C6 0F STA $0FC6 [$7E:0FC6] ;/ $A7C0A0 60 RTS ;;; $A7C0A1 A9 4D AC LDA #$AC4D ;\ $A7C0A4 8D A8 0F STA $0FA8 [$00:0FA8] ;} Kraid function = break ceiling into platform $A7C0A7 A9 02 02 LDA #$0202 ;\ $A7C0AA 8F 20 CD 7E STA $7ECD20[$7E:CD20] ;| $A7C0AE A9 01 01 LDA #$0101 ;} Release camera (like scroll pointer = 0000) $A7C0B1 8F 22 CD 7E STA $7ECD22[$7E:CD22] ;/ $A7C0B5 A9 A4 00 LDA #$00A4 ;\ $A7C0B8 8F 08 78 7E STA $7E7808[$7E:7808] ;} $7E7808 = 00A4h $A7C0BC 6B RTL } ;;; Spawns PLM to clear the ceiling ;;; $A7C168 22 D7 83 84 JSL $8483D7[$84:83D7] $A7C16C dx 02, 12, B7B7 $A7C170 60 RTS ;;; Spawns PLM to clear the spikes ;;; $A7C171 22 D7 83 84 JSL $8483D7[$84:83D7] $A7C175 dx 05, 1B, B7BB $A7C179 60 RTS ;;; ; Good thing the BG1 and BG2 character bases are both $0000 ; [$5D] wasn't shifted correctly, it should be shifted left by 13 $A7C1FB 08 PHP $A7C1FC E2 20 SEP #$20 $A7C1FE 22 6F 83 80 JSL $80836F[$80:836F] ; Set force blank $A7C202 A9 00 LDA #$00 ;\ $A7C204 8D 16 21 STA $2116 [$80:2116] ;| $A7C207 A5 5D LDA $5D [$7E:005D] ;| $A7C209 29 0F AND #$0F ;| $A7C20B 0A ASL A ;| $A7C20C 0A ASL A ;| $A7C20D 0A ASL A ;| $A7C20E 0A ASL A ;| $A7C20F 18 CLC ;} $A7A716..A915 -> VRAM[BG1 character base + 3F00h] $A7C210 69 3F ADC #$3F ;| $A7C212 8D 17 21 STA $2117 [$80:2117] ;| $A7C215 A9 80 LDA #$80 ;| $A7C217 8D 15 21 STA $2115 [$80:2115] ;| $A7C21A 22 A9 91 80 JSL $8091A9[$80:91A9] ;| $A7C21E dx 01, 01, 18, A7A716, 0200 ;| $A7C226 A9 02 LDA #$02 ;| $A7C228 8D 0B 42 STA $420B [$7E:420B] ;/ $A7C22B A9 00 LDA #$00 ;\ $A7C22D 8D 16 21 STA $2116 [$7E:2116] ;| $A7C230 A9 40 LDA #$40 ;| $A7C232 8D 17 21 STA $2117 [$7E:2117] ;| $A7C235 A9 80 LDA #$80 ;| $A7C237 8D 15 21 STA $2115 [$7E:2115] ;} $9AB200..B9FF -> VRAM[4000..47FF] (BG3 characters) $A7C23A 22 A9 91 80 JSL $8091A9[$80:91A9] ;| $A7C23E dx 01, 01, 18, 9AB200, 0800 ;| $A7C246 A9 02 LDA #$02 ;| $A7C248 8D 0B 42 STA $420B [$7E:420B] ;/ $A7C24B 4C 78 C2 JMP $C278 [$80:C278] ;;; ; Good thing the BG1 and BG2 character bases are both $0000 ; First, [$5D] wasn't shifted correctly, it should be shifted left by 9 or 13 ; Second, [$5D] wasn't masked $A7C24E 08 PHP $A7C24F E2 20 SEP #$20 $A7C251 22 6F 83 80 JSL $80836F[$80:836F] ; Set force blank $A7C255 A9 00 LDA #$00 ;\ $A7C257 8D 16 21 STA $2116 [$7E:2116] ;| $A7C25A A5 5D LDA $5D [$7E:005D] ;| $A7C25C 18 CLC ;| $A7C25D 69 3E ADC #$3E ;| $A7C25F 8D 17 21 STA $2117 [$7E:2117] ;| $A7C262 A9 80 LDA #$80 ;} $7E5000..53FF -> VRAM[BG1/2 character base + 3E00h] $A7C264 8D 15 21 STA $2115 [$7E:2115] ;| $A7C267 22 A9 91 80 JSL $8091A9[$80:91A9] ;| $A7C26B dx 01, 01, 18, 7E5000, 0400 ;| $A7C273 A9 02 LDA #$02 ;| $A7C275 8D 0B 42 STA $420B [$7E:420B] ;/ $A7C278 A9 00 LDA #$00 ;\ $A7C27A 8D 16 21 STA $2116 [$7E:2116] ;| $A7C27D A5 59 LDA $59 [$7E:0059] ;| $A7C27F 29 FC AND #$FC ;| $A7C281 8D 17 21 STA $2117 [$7E:2117] ;| $A7C284 A9 80 LDA #$80 ;} $7E2000..27FF -> VRAM[BG2 tilemap] $A7C286 8D 15 21 STA $2115 [$7E:2115] ;| $A7C289 22 A9 91 80 JSL $8091A9[$80:91A9] ;| $A7C28D dx 01, 01, 18, 7E2000, 0800 ;| $A7C295 A9 02 LDA #$02 ;| $A7C297 8D 0B 42 STA $420B [$7E:420B] ;/ $A7C29A 22 82 83 80 JSL $808382[$80:8382] ; Clear force blank $A7C29E 28 PLP $A7C29F 6B RTL ;;; ; Good thing the BG1 and BG2 character bases are both $0000 ; First, [$5D] wasn't shifted correctly, it should be shifted left by 9 or 13 ; Second, 00FCh is the mask for tilemap bases, not character bases $A7C325 08 PHP $A7C326 C2 30 REP #$30 $A7C328 AE 60 03 LDX $0360 [$7E:0360] ;\ $A7C32B A5 5D LDA $5D [$7E:005D] ;| $A7C32D 29 FC 00 AND #$00FC ;| $A7C330 EB XBA ;| $A7C331 18 CLC ;| $A7C332 69 00 3E ADC #$3E00 ;| $A7C335 9D 40 03 STA $0340,x[$7E:0340] ;| $A7C338 A9 81 00 LDA #$0081 ;| $A7C33B 9D 42 03 STA $0342,x[$7E:0342] ;| $A7C33E A9 39 00 LDA #$0039 ;| $A7C341 9D 43 03 STA $0343,x[$7E:0343] ;} $7E5000..53FF -> VRAM[BG1/2 character base + 3E00h] $A7C344 A9 00 50 LDA #$5000 ;| $A7C347 9D 44 03 STA $0344,x[$7E:0344] ;| $A7C34A A9 7E 00 LDA #$007E ;| $A7C34D 9D 46 03 STA $0346,x[$7E:0346] ;| $A7C350 A9 00 04 LDA #$0400 ;| $A7C353 9D 47 03 STA $0347,x[$7E:0347] ;| $A7C356 8A TXA ;| $A7C357 18 CLC ;| $A7C358 69 09 00 ADC #$0009 ;| $A7C35B 8D 60 03 STA $0360 [$7E:0360] ;/ $A7C35E 28 PLP $A7C35F 6B RTL ;;; Fade in regular background ;;; { $A7C715 E2 20 SEP #$20 $A7C717 A9 48 LDA #$48 ;\ $A7C719 85 59 STA $59 [$7E:0059] ;} BG2 tilemap address = $4800 $A7C71B C2 20 REP #$20 $A7C71D A2 FE 07 LDX #$07FE ;\ $A7C720 A9 38 03 LDA #$0338 ;| ;| $A7C723 9F 00 20 7E STA $7E2000,x[$7E:27FE] ;} $7E2000..27FF = 0338h $A7C727 CA DEX ;| $A7C728 CA DEX ;| $A7C729 10 F8 BPL $F8 [$C723] ;/ $A7C72B AE 30 03 LDX $0330 [$7E:0330] ;\ $A7C72E A9 00 04 LDA #$0400 ;| $A7C731 95 D0 STA $D0,x [$7E:00D0] ;| $A7C733 A9 00 20 LDA #$2000 ;| $A7C736 95 D2 STA $D2,x [$7E:00D2] ;| $A7C738 A9 7E 00 LDA #$007E ;| $A7C73B 95 D4 STA $D4,x [$7E:00D4] ;} $7E2000..23FF -> VRAM[4800..4BFF] $A7C73D A9 00 48 LDA #$4800 ;| $A7C740 95 D5 STA $D5,x [$7E:00D5] ;| $A7C742 8A TXA ;| $A7C743 18 CLC ;| $A7C744 69 07 00 ADC #$0007 ;| $A7C747 8D 30 03 STA $0330 [$7E:0330] ;/ $A7C74A A9 51 C7 LDA #$C751 ;\ $A7C74D 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $C751 (done) $A7C750 6B RTL ;;; $A7C751 AE 30 03 LDX $0330 [$7E:0330] ;\ $A7C754 A9 00 04 LDA #$0400 ;| $A7C757 95 D0 STA $D0,x [$7E:00D0] ;| $A7C759 A9 00 20 LDA #$2000 ;| $A7C75C 95 D2 STA $D2,x [$7E:00D2] ;| $A7C75E A9 7E 00 LDA #$007E ;| $A7C761 95 D4 STA $D4,x [$7E:00D4] ;} $7E2000..23FF -> VRAM[4A00..4DFF] $A7C763 A9 00 4A LDA #$4A00 ;| $A7C766 95 D5 STA $D5,x [$7E:00D5] ;| $A7C768 8A TXA ;| $A7C769 18 CLC ;| $A7C76A 69 07 00 ADC #$0007 ;| $A7C76D 8D 30 03 STA $0330 [$7E:0330] ;/ $A7C770 A9 77 C7 LDA #$C777 ;\ $A7C773 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $C777 (done) $A7C776 6B RTL ;;; $A7C777 A9 FB C1 LDA #$C1FB ;\ $A7C77A 8D 04 06 STA $0604 [$7E:0604] ;} $0604 = $C1FB (done) $A7C77D A9 A3 C7 LDA #$C7A3 ;\ $A7C780 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $C7A3 (done) $A7C783 AE 30 03 LDX $0330 [$7E:0330] ;\ $A7C786 A9 00 04 LDA #$0400 ;| $A7C789 95 D0 STA $D0,x [$7E:00D0] ;| $A7C78B A9 00 B2 LDA #$B200 ;| $A7C78E 95 D2 STA $D2,x [$7E:00D2] ;| $A7C790 A9 9A 00 LDA #$009A ;| $A7C793 95 D4 STA $D4,x [$7E:00D4] ;} $9AB200..B5FF -> VRAM[4000..43FF] $A7C795 A9 00 40 LDA #$4000 ;| $A7C798 95 D5 STA $D5,x [$7E:00D5] ;| $A7C79A 8A TXA ;| $A7C79B 18 CLC ;| $A7C79C 69 07 00 ADC #$0007 ;| $A7C79F 8D 30 03 STA $0330 [$7E:0330] ;/ $A7C7A2 6B RTL ;;; $A7C7A3 A9 C9 C7 LDA #$C7C9 ;\ $A7C7A6 8D A8 0F STA $0FA8 [$80:0FA8] ;} Kraid function = $C7C9 (done) $A7C7A9 AE 30 03 LDX $0330 [$80:0330] ;\ $A7C7AC A9 00 04 LDA #$0400 ;| $A7C7AF 95 D0 STA $D0,x [$7E:00D0] ;| $A7C7B1 A9 00 B6 LDA #$B600 ;| $A7C7B4 95 D2 STA $D2,x [$7E:00D2] ;| $A7C7B6 A9 9A 00 LDA #$009A ;| $A7C7B9 95 D4 STA $D4,x [$7E:00D4] ;} $9AB600..B9FF -> VRAM[4200..45FF] $A7C7BB A9 00 42 LDA #$4200 ;| $A7C7BE 95 D5 STA $D5,x [$7E:00D5] ;| $A7C7C0 8A TXA ;| $A7C7C1 18 CLC ;| $A7C7C2 69 07 00 ADC #$0007 ;| $A7C7C5 8D 30 03 STA $0330 [$80:0330] ;/ $A7C7C8 6B RTL ;;; $A7C7C9 A9 EF C7 LDA #$C7EF ;\ $A7C7CC 8D A8 0F STA $0FA8 [$80:0FA8] ;} Kraid function = $C7EF (done) $A7C7CF AE 30 03 LDX $0330 [$80:0330] ;\ $A7C7D2 A9 00 04 LDA #$0400 ;| $A7C7D5 95 D0 STA $D0,x [$7E:00D0] ;| $A7C7D7 A9 00 BA LDA #$BA00 ;| $A7C7DA 95 D2 STA $D2,x [$7E:00D2] ;| $A7C7DC A9 9A 00 LDA #$009A ;| $A7C7DF 95 D4 STA $D4,x [$7E:00D4] ;} $9ABA00..BDFF -> VRAM[4400..47FF] $A7C7E1 A9 00 44 LDA #$4400 ;| $A7C7E4 95 D5 STA $D5,x [$7E:00D5] ;| $A7C7E6 8A TXA ;| $A7C7E7 18 CLC ;| $A7C7E8 69 07 00 ADC #$0007 ;| $A7C7EB 8D 30 03 STA $0330 [$80:0330] ;/ $A7C7EE 6B RTL ;;; $A7C7EF A9 15 C8 LDA #$C815 ;\ $A7C7F2 8D A8 0F STA $0FA8 [$80:0FA8] ;} Kraid function = $C815 (done) $A7C7F5 AE 30 03 LDX $0330 [$80:0330] ;\ $A7C7F8 A9 00 04 LDA #$0400 ;| $A7C7FB 95 D0 STA $D0,x [$7E:00D0] ;| $A7C7FD A9 00 BE LDA #$BE00 ;| $A7C800 95 D2 STA $D2,x [$7E:00D2] ;| $A7C802 A9 9A 00 LDA #$009A ;| $A7C805 95 D4 STA $D4,x [$7E:00D4] ;} $9ABE00..C1FF -> VRAM[4600..49FF] $A7C807 A9 00 46 LDA #$4600 ;| $A7C80A 95 D5 STA $D5,x [$7E:00D5] ;| $A7C80C 8A TXA ;| $A7C80D 18 CLC ;| $A7C80E 69 07 00 ADC #$0007 ;| $A7C811 8D 30 03 STA $0330 [$80:0330] ;/ $A7C814 6B RTL ;;; $A7C815 22 6C D9 82 JSL $82D96C[$82:D96C] ;\ $A7C819 90 20 BCC $20 [$C83B] ;} If $82D96C returned carry clear: return $A7C81B A9 03 00 LDA #$0003 ;\ $A7C81E 22 C1 8F 80 JSL $808FC1[$80:8FC1] ;} Set music to 03 $A7C822 AE 9F 07 LDX $079F [$80:079F] ;\ $A7C825 BF 28 D8 7E LDA $7ED828,x[$7E:D828] ;| $A7C829 89 01 00 BIT #$0001 ;} If Kraid not-dead: $A7C82C D0 0E BNE $0E [$C83C] ;/ $A7C82E 09 01 00 ORA #$0001 ;\ $A7C831 9F 28 D8 7E STA $7ED828,x[$7E:D828] ;} Set Kraid dead $A7C835 A9 43 C8 LDA #$C843 ;\ $A7C838 8D A8 0F STA $0FA8 [$80:0FA8] ;} Kraid function = $C843 (done) $A7C83B 6B RTL $A7C83C A9 51 C8 LDA #$C851 ;\ Else (Kraid dead): $A7C83F 8D A8 0F STA $0FA8 [$80:0FA8] ;} Kraid function = $C851 (done) $A7C842 6B RTL ;;; $A7C843 20 2C A9 JSR $A92C [$80:A92C] ;\ $A7C846 F0 05 BEQ $05 [$C84D] ;| $A7C848 AD 11 09 LDA $0911 [$80:0911] ;} If Kraid not dead or screen X != 0: $A7C84B F0 03 BEQ $03 [$C850] ;/ $A7C84D 20 43 A9 JSR $A943 [$80:A943] ; Set enemy properties to dead $A7C850 6B RTL ;;; $A7C851 20 2C A9 JSR $A92C [$80:A92C] ;\ $A7C854 F0 05 BEQ $05 [$C85B] ;| $A7C856 AD 11 09 LDA $0911 [$80:0911] ;} If Kraid not dead or screen X != 0: $A7C859 F0 03 BEQ $03 [$C85E] ;/ $A7C85B 20 43 A9 JSR $A943 [$80:A943] ; Set enemy properties to dead $A7C85E A9 FF FF LDA #$FFFF ;\ $A7C861 8D FF 08 STA $08FF [$80:08FF] ;} Blocks scrolled X = -1 $A7C864 6B RTL } ;;; Restrict Samus X position to first screen; decrement enemy function timer ;;; $A7C865 20 EE C9 JSR $C9EE [$A7:C9EE] ; Restrict Samus X position to first screen $A7C868 4C 2D B9 JMP $B92D [$A7:B92D] ; Decrement enemy function timer ;;; { $A7C86B 20 EE C9 JSR $C9EE [$A7:C9EE] ; Restrict Samus X position to first screen $A7C86E A9 9A C8 LDA #$C89A ;\ $A7C871 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $C89A (done) $A7C874 AE 30 03 LDX $0330 [$7E:0330] ;\ $A7C877 A9 00 08 LDA #$0800 ;| $A7C87A 95 D0 STA $D0,x [$7E:00D0] ;| $A7C87C A9 00 20 LDA #$2000 ;| $A7C87F 95 D2 STA $D2,x [$7E:00D2] ;| $A7C881 E2 20 SEP #$20 ;| $A7C883 A9 7E LDA #$7E ;| $A7C885 95 D4 STA $D4,x [$7E:00D4] ;| $A7C887 C2 20 REP #$20 ;} Kraid BGi -> VRAM[BG2 tilemap base] $A7C889 A5 59 LDA $59 [$7E:0059] ;| $A7C88B 29 FC 00 AND #$00FC ;| $A7C88E EB XBA ;| $A7C88F 95 D5 STA $D5,x [$7E:00D5] ;| $A7C891 8A TXA ;| $A7C892 18 CLC ;| $A7C893 69 07 00 ADC #$0007 ;| $A7C896 8D 30 03 STA $0330 [$7E:0330] ;/ $A7C899 6B RTL ;;; $A7C89A 20 EE C9 JSR $C9EE [$A7:C9EE] ; Restrict Samus X position to first screen $A7C89D A9 E0 C8 LDA #$C8E0 ;\ $A7C8A0 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $C8E0 (done) $A7C8A3 A9 78 00 LDA #$0078 ;\ $A7C8A6 8D B2 0F STA $0FB2 [$7E:0FB2] ;} Kraid function timer = 120 $A7C8A9 A9 F0 01 LDA #$01F0 ;\ $A7C8AC 8D 40 18 STA $1840 [$7E:1840] ;} Screen shaking timer = 496 $A7C8AF A9 05 00 LDA #$0005 ;\ $A7C8B2 22 C1 8F 80 JSL $808FC1[$80:8FC1] ;} Set audio to 0005 $A7C8B6 AE 30 03 LDX $0330 [$7E:0330] ;\ $A7C8B9 A9 00 08 LDA #$0800 ;| $A7C8BC 95 D0 STA $D0,x [$7E:00D0] ;| $A7C8BE A9 00 28 LDA #$2800 ;| $A7C8C1 95 D2 STA $D2,x [$7E:00D2] ;| $A7C8C3 E2 20 SEP #$20 ;| $A7C8C5 A9 7E LDA #$7E ;| $A7C8C7 95 D4 STA $D4,x [$7E:00D4] ;| $A7C8C9 C2 20 REP #$20 ;| $A7C8CB A5 59 LDA $59 [$7E:0059] ;} Kraid ass BGi -> VRAM[BG2 tilemap base + $0800] $A7C8CD 29 FC 00 AND #$00FC ;| $A7C8D0 EB XBA ;| $A7C8D1 18 CLC ;| $A7C8D2 69 00 08 ADC #$0800 ;| $A7C8D5 95 D5 STA $D5,x [$7E:00D5] ;| $A7C8D7 8A TXA ;| $A7C8D8 18 CLC ;| $A7C8D9 69 07 00 ADC #$0007 ;| $A7C8DC 8D 30 03 STA $0330 [$7E:0330] ;/ $A7C8DF 6B RTL ;;; $A7C8E0 20 EE C9 JSR $C9EE [$A7:C9EE] ; Restrict Samus X position to first screen $A7C8E3 AD B2 0F LDA $0FB2 [$7E:0FB2] ;\ $A7C8E6 3A DEC A ;} Decrement Kraid function timer $A7C8E7 8D B2 0F STA $0FB2 [$7E:0FB2] ;/ $A7C8EA D0 0D BNE $0D [$C8F9] ; If Kraid function timer == 0: $A7C8EC A9 02 C9 LDA #$C902 ;\ $A7C8EF 8D A8 0F STA $0FA8 [$7E:0FA8] ;} Kraid function = $C902 (done) $A7C8F2 A9 60 00 LDA #$0060 ;\ $A7C8F5 8D B2 0F STA $0FB2 [$7E:0FB2] ;} Kraid function timer = 96 $A7C8F8 6B RTL $A7C8F9 29 0F 00 AND #$000F ;\ Else (Kraid function timer != 0): $A7C8FC D0 03 BNE $03 [$C901] ;} If Kraid function timer is a multiple of 10h $A7C8FE 20 95 C9 JSR $C995 [$A7:C995] ; Spawn random earthquake projectile $A7C901 6B RTL ;;; $A7C902 20 EE C9 JSR $C9EE [$81:C9EE] ; Restrict Samus X position to first screen $A7C905 AD B2 0F LDA $0FB2 [$82:0FB2] ;\ $A7C908 3A DEC A ;} Decrement Kraid function timer $A7C909 8D B2 0F STA $0FB2 [$82:0FB2] ;/ $A7C90C D0 0D BNE $0D [$C91B] ; If Kraid function timer == 0: $A7C90E A9 24 C9 LDA #$C924 ;\ $A7C911 8D A8 0F STA $0FA8 [$82:0FA8] ;} Kraid function = $C924 (done) $A7C914 A9 20 01 LDA #$0120 ;\ $A7C917 8D B2 0F STA $0FB2 [$82:0FB2] ;} Kraid function timer = 288 $A7C91A 6B RTL $A7C91B 29 07 00 AND #$0007 ;\ Else (Kraid function timer != 0): $A7C91E D0 03 BNE $03 [$C923] ;} If Kraid function timer is a multiple of 10h $A7C920 20 95 C9 JSR $C995 [$81:C995] ; Spawn random earthquake projectile $A7C923 6B RTL ;;; $A7C924 20 EE C9 JSR $C9EE [$81:C9EE] ; Restrict Samus X position to first screen $A7C927 AD 40 18 LDA $1840 [$82:1840] ;\ $A7C92A 89 05 00 BIT #$0005 ;} If screen shaking timer % 6 == 0 or 2: $A7C92D D0 03 BNE $03 [$C932] ;/ $A7C92F 20 95 C9 JSR $C995 [$81:C995] ; Spawn random earthquake projectile $A7C932 A0 01 00 LDY #$0001 ;\ $A7C935 AD 7E 0F LDA $0F7E [$82:0F7E] ;| $A7C938 89 02 00 BIT #$0002 ;| $A7C93B D0 03 BNE $03 [$C940] ;} $12 = 1 if Kraid Y position / 2 is odd, else $12 = -1: $A7C93D A0 FF FF LDY #$FFFF ;| ;| $A7C940 84 12 STY $12 [$00:0012] ;/ $A7C942 AD 7A 0F LDA $0F7A [$82:0F7A] ;\ $A7C945 18 CLC ;| $A7C946 65 12 ADC $12 [$00:0012] ;} Kraid X position += $12 $A7C948 8D 7A 0F STA $0F7A [$82:0F7A] ;/ $A7C94B AD 80 0F LDA $0F80 [$82:0F80] ;\ $A7C94E 38 SEC ;| $A7C94F E9 00 80 SBC #$8000 ;| $A7C952 8D 80 0F STA $0F80 [$82:0F80] ;} Kraid Y position -= 0.8000h $A7C955 AD 7E 0F LDA $0F7E [$82:0F7E] ;| $A7C958 E9 00 00 SBC #$0000 ;| $A7C95B 8D 7E 0F STA $0F7E [$82:0F7E] ;/ $A7C95E AD 7E 0F LDA $0F7E [$82:0F7E] ;\ $A7C961 C9 C9 01 CMP #$01C9 ;} If Kraid Y position >= 01C9h: return $A7C964 10 2E BPL $2E [$C994] ;/ $A7C966 A9 B0 00 LDA #$00B0 ;\ $A7C969 8D 7A 0F STA $0F7A [$82:0F7A] ;} Kraid X position = 00B0h $A7C96C A9 60 B9 LDA #$B960 ;\ $A7C96F 8D E8 10 STA $10E8 [$82:10E8] ;} Kraid foot function = $B960 (done) $A7C972 A9 2C 01 LDA #$012C ;\ $A7C975 8D F2 10 STA $10F2 [$82:10F2] ;} Kraid foot function timer = 300 $A7C978 A9 2D BF LDA #$BF2D ;\ $A7C97B 8F 40 79 7E STA $7E7940[$7E:7940] ;} $7E7940 = $BF2D (done) $A7C97F A9 DA 96 LDA #$96DA ;\ $A7C982 8D AA 0F STA $0FAA [$82:0FAA] ;} $0FAA = $96DA (done) $A7C985 20 E9 AD JSR $ADE9 [$81:ADE9] ; Execute subroutine $ADE9 (done) $A7C988 A9 F3 89 LDA #$89F3 ;\ $A7C98B 8D D2 0F STA $0FD2 [$82:0FD2] ;} Kraid arm instruction = $89F3 (done) $A7C98E A9 01 00 LDA #$0001 ;\ $A7C991 8D D4 0F STA $0FD4 [$82:0FD4] ;} Kraid arm instruction delay = 1 $A7C994 6B RTL } ;;; Spawn random earthquake projectile ;;; ; This first part is dreadful, here's my optimisation: ; LDA $05E5 : AND #$003F : BIT #$0002 : BNE $03 : EOR #$FFFF ; CLC : ADC $0F7A : STA $12 ; This generates a random number from: ; 3F, 3E, -3E, -3D, 3B, 3A, -3A, -39, 37, 36, -36, -35, 33, 32, -32, -31, 2F, 2E, -2E, -2D, 2B, 2A, -2A, -29, 27, 26, -26, -25, 23, 22, -22, -21, 1F, 1E, -1E, -1D, 1B, 1A, -1A, -19, 17, 16, -16, -15, 13, 12, -12, -11, 0F, 0E, -0E, -0D, 0B, 0A, -0A, -09, 07, 06, -06, -05, 03, 02, -02, -01 $A7C995 AD B5 05 LDA $05B5 [$7E:05B5] $A7C998 89 02 00 BIT #$0002 $A7C99B AD E5 05 LDA $05E5 [$7E:05E5] ;\ $A7C99E 29 3F 00 AND #$003F ;| $A7C9A1 AA TAX ;| $A7C9A2 AD E5 05 LDA $05E5 [$7E:05E5] ;| $A7C9A5 89 02 00 BIT #$0002 ;| $A7C9A8 D0 05 BNE $05 [$C9AF] ;| $A7C9AA 8A TXA ;| $A7C9AB 49 FF FF EOR #$FFFF ;} $12 = random number -3Eh..3Fh $A7C9AE AA TAX ;| ;| $A7C9AF 8A TXA ;| $A7C9B0 18 CLC ;| $A7C9B1 6D 7A 0F ADC $0F7A [$82:0F7A] ;| $A7C9B4 85 12 STA $12 [$7E:0012] ;/ $A7C9B6 AD E5 05 LDA $05E5 [$82:05E5] ;\ $A7C9B9 29 00 3F AND #$3F00 ;| $A7C9BC EB XBA ;| $A7C9BD 85 14 STA $14 [$7E:0014] ;| $A7C9BF A9 C0 01 LDA #$01C0 ;} $14 = random number 81h..1C0h $A7C9C2 38 SEC ;| $A7C9C3 E5 14 SBC $14 [$7E:0014] ;| $A7C9C5 85 14 STA $14 [$7E:0014] ;/ $A7C9C7 A9 15 00 LDA #$0015 ;\ $A7C9CA 85 16 STA $16 [$7E:0016] ;} $16 = 15h (smoke?) $A7C9CC 64 18 STZ $18 [$7E:0018] ; $18 = 0 $A7C9CE 22 26 BC B4 JSL $B4BC26[$B4:BC26] ; Create enemy-related sprite $A7C9D2 A0 61 9C LDY #$9C61 ;\ $A7C9D5 AD E5 05 LDA $05E5 [$82:05E5] ;| $A7C9D8 89 10 00 BIT #$0010 ;| $A7C9DB F0 03 BEQ $03 [$C9E0] ;| $A7C9DD A0 6F 9C LDY #$9C6F ;| ;} Spawn either ER projectile $9C61 or $9C6F randomly with random number parameter $A7C9E0 AE 54 0E LDX $0E54 [$82:0E54] ;| $A7C9E3 AD E5 05 LDA $05E5 [$82:05E5] ;| $A7C9E6 29 F0 03 AND #$03F0 ;| $A7C9E9 22 27 80 86 JSL $868027[$86:8027] ;/ $A7C9ED 60 RTS ;;; Restrict Samus X position to first screen ;;; $A7C9EE AD F6 0A LDA $0AF6 [$82:0AF6] ;\ $A7C9F1 38 SEC ;| $A7C9F2 E9 00 01 SBC #$0100 ;} If Samus' X position >= 100h: $A7C9F5 30 09 BMI $09 [$CA00] ;/ $A7C9F7 A9 00 01 LDA #$0100 ;\ $A7C9FA 8D F6 0A STA $0AF6 [$82:0AF6] ;} Samus X position = previous Samus X position = 100h $A7C9FD 8D 10 0B STA $0B10 [$82:0B10] ;/ $A7CA00 60 RTS