PLM disassembly --------------- Charge Beam (EEEB) EE64 - E15B EE64: BE 87 1C A9 45 00 20 B4 82 AF 1A D9 7E 1A 8F 1A D9 7E 60 LDX $1C87,y ;7E:1C87 - 7E:1CD6 PLM's location in the room (nth block * 2) LDA #$0045 JSR $82B4 ;82B4 : X must contain a block location in ram, and A has new status for it. High byte becomes the new block-prop (second nybble should be 0), and low byte becomes the new bts value. LDA $7ED91A INC A STA $7ED91A RTS E15B: 64 87 00 8B 00 00 00 00 00 00 00 00 7C 88 85 E1 24 8A 7B E1 C1 86 89 DF 4F E0 67 E0 24 87 73 E1 99 88 DD 8B 02 B0 88 00 10 0E 24 87 A9 DF 8764 : Used by all pickups with custom graphics. Determines what pickup looks like: First argument (2 bytes) is a pointer to the tiles to use (bank 89); two blocks are loaded (the pickup flashes). The rest of the bytes (8) determine the pallete: Frame 1(Top left, Top right, Bottom left, Bottom right), Frame 2(repeat). arguments: 00 8B 00 00 00 00 00 00 00 00 ----- *887C : Check if item has been picked up (with 1DC7,X, aka the room call argument). If so, use the address given by the argument as the next instruction(by calling 8724). If not, go to instruction past the argument. NOTE: If the room call argument is negative, it is assumed to not be picked up; i.e. 8724 is NOT called, and the plm continues with the next instruction in line. arguments: E185 *8A24 : Store the argument as the target instruction for special routines. Stored in 7E:DEBC,X arguments: E17B ----- *86C1 : Stores the argument to 7E:1CD7,X, which will be executed every frame before the PLM instruction(s) until something overwrites it. arguments: DF89 ----- E04F : Complex. Loads 7E:DF0C,X, puts that in Y, then uses that to load 84:E05F,Y, and puts that in 7E:DE6C,X. I think this is determining which graphic to display. It then stores the original Y to 7E:1D27,X, then jumps to three subroutines. The first (861E) checks if Samus touches it, which triggers the pickup routine (as aided by 8A24, I think). The second (8290) determines which PLM to draw to, and the third (8DAA) actually draws that PLM. It finally returns afterwords. No arguments are used. Set the delay counter to 4, and pulls before returning (thus ending the instructions run this frame). E067 : Extremely similar to above, but loads from 84:E077,Y. Causes the flashing animation. (USED BY CUSTOM-GRAPHIC PICKUPS, SEE 8764) *8724 : Use the address given by the argument as the next instruction. arguments: E173 *8899 : Mark this item as picked up. No effect on PLMs with a negative calling argument (see 887C) 8BDD : Plays a specific track (only music-control available), depending on the argument. For some unknown purpose, stores zeroes to 7E:060B - 7E:062A ($20 bytes), and also 7E:063D and 7E:063F. Then it stores 7E:0639 to 7E:063B. arguments: 02 88B0 : Pick up a beam (including Charge Beam. No missiles, super missiles, etc.). Argument (2 bytes) tells which beam(s) to add. Noteworthy info: Calls 90:AC8D to change(reload?) the beam graphics and pallete (including the pallete of explosions), calls 82:E118, which restore previous music when the pickup music is finished, and calls 85:8080, which brings up the item-pickup box, with the aid of the 3rd byte of the argument (only 1 byte). Also contains code to disable plasma or spazer if the other is picked up. arguments: 1000 0E *8724 : Use the address given by the argument as the next instruction. arguments: DFA9 8764: AD 2D 1C 9F 0C DF 7E AA 1A 1A 29 06 00 8D 2D 1C BD CD 87 85 12 BD D5 87 85 14 BD DD 87 85 16 98 9D 2F 1C AE 30 03 A9 00 01 95 D0 B9 00 00 95 D2 A9 89 00 95 D4 A5 12 95 D5 8A 18 69 07 00 8D 30 03 C8 C8 A6 14 8A 18 69 10 00 85 18 B9 00 00 29 FF 00 EB 0A 0A 18 65 16 9F 00 A0 7E E6 16 C8 E8 E8 E4 18 D0 E7 AE 27 1C 60 LDA $1C2D STA $7EDF0C,x TAX INC A INC A AND #$0006 STA $1C2D STA $87CD STA $12 STA $87D5 STA $14 STA $87DD STA $16 TYA STA $1C2F,x LDX $0330 LDA #$0100 STA $D0,x LDA $0000,y STA $D2,x LDA #$0089 STA $D4,x LDA $12 STA $D5,x TXA CLC ADC #$0007 STA $0330 INY INY LDX $14 TXA CLC ADC #$0010 STA $18 BIT #$0000 AND #$00FF XBA ASL A ASL A CLC ADC $16 STA $7EA000,x INC $16 INY INX INX INX $18 BNE $E7 LDX $1C27 RTS