TODO: Look at DE6C, 8DA0, and 861E. TODO: Look through Scroll PLM's touch detection routine for clues. Figure out why the jump to 861E is required to pick up beams. Normal Scroll PLM 01 00 62 AF B4 86 55 8B 24 87 8A AF FirstFour Touch Goto Goto BytesSkipped pntr? Instr pntr 8B55 (Scroll PLM Touch Pointer?) PHB 8B PHX DA PHY 5A STZ $1E17,X 9E 17 1E LDY $1DC7,X BC C7 1D PEA $8F00 F4 00 8F PLB AB PLB AB LDA #0000 A9 00 00 SEP #20 E2 20 LDA $0000,Y B9 00 00 BMI #0C 30 0C TAX AA LDA $0001,Y B9 01 00 STA $7ECD20,X 9F 20 CD 7E INY C8 INY C8 BRA #EF 80 EF REP #20 C2 20 PLY 7A PLX FA PLB AB PHX DA LDA $1C87,X BD 87 1C TAX AA LDA $7F0002,X BF 02 00 7F AND #0FFF 29 FF 0F ORA #3000 09 00 30 STA $7F0002,X 9F 02 00 7F PLX FA RTS 60 Edit: PHB 8B PHX DA PHY 5A STZ $1E17,X 9E 17 1E LDY $1DC7,X BC C7 1D PEA $8F00 F4 00 8F PLB AB PLB AB LDA $0000,Y B9 00 00 BMI #0E 30 0E TAX AA LDA $0002,Y B9 02 00 STA $7F0002,X 9F 02 00 7F INY C8 INY C8 INY C8 INY C8 BRA #ED 80 ED PLY 7A PLX FA PLB AB RTS 60 Custom Block-Edit PLM Insert the following into bank 84 at some location. Part 1: 71 B3 (Pointer to Part 2) (4 bytes) Part 2: 01 00 62 AF B4 86 (Pointer to Part 3) 24 87 ((Pointer to Part 2) + 4) (12 bytes) Part 3: 8B DA 5A 9E 17 1E BC C7 1D F4 00 8F AB AB B9 00 00 30 0E AA B9 02 00 9F 02 00 7F C8 C8 C8 C8 80 ED 7A FA AB 60 (37 bytes) When you want to use this plm in a room, make a plm with this format for the room: XXXX XX XX XXXX Pointer XandY Pointer ToPart1 Coord To New Blocks Also in bank 8F, put in the address for the blocks you want to change, followed by the new block to change it to. The address is calculated by taking the y coord of the block, multiplying by $10 * the number of screens wide the room is, adding the x coord, then multiplying that by two. Technically, the address is two bytes later, but the routine accounts for this, so you don't have to worry about it. When you're done changing blocks, put in 0080 to mark the end. It should look like this when you're done: (Pointer, NewBlock), (Pointer, NewBlock), (Pointer, NewBlock) ... (Pointer, NewBlock), 00 80 The block format: The lo-byte (first one you put in) is the graphic used. The low-nybble of the hi-byte is also used. $000-3FF are all different graphics, add $400 to flip it horizontally, and $800 to flip it vertically. The high nybble of the hi-byte tells what kind of block it is: 0 is air, 1 is slope, 3 is treadmill (also used by plms), 5 is two-wide (copys block to the left of it), 8 is a solid block, 9 is a door (changes to new room), A is spikes, B is a crumble block, C is a shot block, D is two-high (copys block above it), E is grapple block, and F is bomb block. PLM Routines At the very top, the room calls the PLM. It points to the PLM header, gives the X and Y coords, and finally an argument. The PLM header then has two pointers. The first calls code to run immediately to set the PLM up The second has the address of the first instruction, which is then stored in 1D27,X. I think. Assuming the startup code doesn't change the delay counter, the first PLM instruction executes immediately. It may use bytes from after the instruction as arguments, to modify exactly what that code is supposed to do. When it is finished, Y is pointing to the next instruction to load, which is then loaded. This process repeats until an instruction breaks out of it by pulling an extra argument (usually through A) before returning. When this happens, it also needs to set the next instruction to run in 1D27,X Afterwords, the PLM waits until the counter in 7E:DE1C,X reaches 0. When this happens, the next instruction (in 1D27,X) is run. Also note that the instruction in 1CD7,X is run once every frame *before* the PLM delay counter is even tested. Some words, to make describing this easier: Routine : The raw code that is called. Instruction : The direct pointers to routines. One instruction is run every frame the PLM exists. Header : The two pointers that are used to start a PLM (First pointer sets the plm up when the room loads, second pointer points to the start of the PLM's instructions). Door PLMs have three pointers. Most pointers in arguments will point to instructions, not to actual routines (code to run). This makes handling PLMs awkward sometimes. Some noteworthy info to begin with: 7E:05E7 is often used to check bits for completed tasks/picked up items. 7E:07A5 stores the current room's width in blocks. 7E:0DC4 is the block Samus is in contact with (nth block of the room) 7E:1C27 has the current PLM's room ID (I think). This is the value that's indexed extremely often through X. 7E:1C37,X has the pointer to the PLM header. 7E:1C87,X is the table for PLM's location in the room (7E:0002 array) 7E:1CD7,X is a pointer to code to run before the game runs the normal PLM instruction. Used to detect if the item is touched? (initialized to 84E6, a RTS) 7E:1D27,X is a pointer to current instruction to be run. 7E:1DC7,X is the argument from the room that calls the PLM. 7E:D820,X is the list of event bits (Uses PLM_Argument/8 for X, finds a specific bit) 7E:D870,X is the list of picked up items (Uses Room_Argument/8 for X, finds a specific bit) 7E:D8B0,X is the list of opened doors (Uses Room_Argument/8 for X, finds a specific bit) 7E:DE1C,X counts the frames until next instruction should be run. This is decremented *before* being tested, so 0 = wait 65535 frames. 7E:DE6C,X is a messy pointer. Initialized to 8DA0. Data at pointer is used to edit the blocks that a plm exists on top of. See 861E. 7E:DEBC,X has a special pointer used by some PLMs to find the next instruction. I think. 7E:DF0C,X is initialized to 0000. Initialized and used by items hidden in shotblocks (missiles use 000A). Used by X-ray scope (only?) to find tile to show. Used by doors as hit counter? 7E:1D77,X has an unknown use (initialized to 0000. Used by touch detection, I think... If Samus is touching PLM, this is **FF. Setting it to **FF will trigger pickups) (Used as a loop counter for hidden items) 7E:1E17,X has an unknown use (initialized to 0000 by the scroll PLM's startup code) (Changes PLM to this kind of block?)(Or use as a pointer to something)(Ok, this seems to have a lot of uses. Variable.) 7E:D91A has an unknown use (some sort of counter? Incremented by hidden item shot blocks initialization) X is originally used to identify the instance of the PLM in the room. The first is 3C, the second 3A, third 38, and so on. Y is originally used as a specific pointer to the bytes *after* the command that called the specific routine. This is often used to call the argument(s) for the command, or determine the next command. A may be set to something specific originally, but I doubt it; it doesn't seem to be used in any PLMs. It is often pulled to from the stack to exit the PLM loop, though. 84:83D7 is a routine to create a PLM at a single location. The routine that calls it must have after it the X and Y coordinate of the PLM and the address of the PLM header, in that order, after the JSL to 84:83D7. The PLM will be set up completely and run once. Then the code will resume, after those four bytes. If there are already too many PLMs and the game fails to make a new one, it just resumes code past those four bytes. External Routines called within PLM Instruction Routines (i.e. JSLs) 80:81DC checks if the boss bit for the current area matches A. SEC if there's a match. It also pushes and pulls Y for ABSOLUTELY NO REASON. 80:914D Play a sound effect, depending on A. 80:818E has code that winds up with a single bit set in 7E:05E7. The bit set (n) is equal to A mod 8. So if A is $0432, the 2nd bit will be set. If A is $7FFF, the 7th bit will be set. Also, X will be set to A/8. This is most often used for testing specific bits. 84:8290 calculates the X and Y coord of a PLM from it's absolute location (1C87,X). Results stored in $1C29(X) and $1C2B(Y). NOTE: This must be called LONG (JSL). Do not attempt to use this as a PLM instruction, even though it's in the same bank as PLMs. 80:8233 calls 80:818E and tests against 7E:D820,X. CLC if 0, SEC if 1. 86:8097 spawns some kind of projectiles? Only used by gate PLMs, so far as I can see. Also used by some enemies. 80:81FA marks an event as happened. Event bit # must be stored in A. 84:84E7 Creates PLMs. Before running, nth block is stored at $0DC4 (Block Samus is in contact with?) (Multiplied by two to get absolute address), A contains the PLM header. (TODO!) Routines (Called by what?) 8B05 : Store 1E17,X to the PLM's block data, and to $1E69. Store #$0001 to $1E67, and #$0000 to $1E6B. Set the PLM to run next frame, set Block Edit pointer (7E:DE6C,X) to #$1E67. Store the pointer to the currently running instruction (probably this; probably points to an 8B05) to run next. Then calls 861E, 84:8290, and 8DAA, then exits instructions (PLA, RTS) Routines called within PLM Instruction Routines 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. 84E6 : RTS. Often used for 1CD7,X. 861E : Called within routines very often. Uses DE6C,X as a pointer to new tile data. Format for new tile data: First byte tells how many blocks to extend, second tells whether to extend horizontally(right, 00) or vertically(down, 80). Data past the pointer is used to set block data (block type and graphic), starting at the PLM's location and moving down/right as far as the first byte tells it to go. After this, it checks the bytes past the last new block. If they're $#0000, it's done and returns. Otherwise, it uses the first next byte to see how far to move, and the second next byte to see in which direction to move (right, 00, down, 80. Unchecked). It repeats until it runs into a $#0000 at the end of new blocks. 8DAA : Called within routines very often. Stores $#5000 in $09, and #$53E0 in $0C. Loads DE6C,X (Pointer for block change data) and puts it into Y. It also puts a previously calculated X($1C29) and Y($1C2B) coordinate in $1E and $20. Then it starts doing stuff, for which I don't know what the purpose is. Effectively, however, this routine has been noted to draw (or perhaps to just refresh) graphics at the specified X and Y coordinates. RTS routines : 84E6, 853D PLM Instructions (* = Completely understood) <8000 : Set delay counter to this value. Also, redraw block using the argument (2 bytes, stored to 7E:DE6C,X) and 861E, 84:8290, and 8DAA. *86B4 : Do nothing. Absolutely, positively, nothing. The PLM will sit on this instruction until something else (often pre-PLM instruction) tells it to change. *86BC : Deletes the PLM header, then exits the instruction loop (PLA, RTS). Used to delete PLMs *86C1 : Stores the argument to 7E:1CD7,X, which will be executed every frame before the PLM instruction(s) until something overwrites it. *86CA : Stores #$86D0 to 7E:1CD7,X (RTS). Effectively disables pre-PLM instructions. *8724 : Use the address given by the argument as the next instruction. 873F : Decrement 7E:1D77,X. If not 0, use the address given by the argument as the next instruction. *874E : Set 7E:1D77,X to the argument (only 1 byte). 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). 882D : Load the argument (2 bytes) to A and go to 80:8233 to check the corresponding event bit. If Carry is set (event bit set), use the next argument (2 bytes) as the address to the next instruction. *883E : Mark the argument'th (2 bytes) event bit as set. *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. *8899 : Mark this item as picked up. No effect on PLMs with a negative calling argument (see 887C) 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. 8968 : Pick up Energy Tank. Refills health. Argument (2 bytes) tells how much to increase max health by. Calls messagebox 01 89A9 : Pick up Missile Tank. Argument (2 bytes) tells how much to increase max missiles and current missiles by. Calls messagebox 02 89D2 : Pick up Super Missile Tank. Argument (2 bytes) tells how much to increase max super missiles and current super missiles by. Calls messagebox 03 *8A24 : Store the argument as the target instruction for special routines. Stored in 7E:DEBC,X *8A2E : Store the address of the next instruction (i.e. Y + 2) to 7E:DEBC,X, and go to the argument. Inverse of 8A24. *8A3A : Go to 7E:DEBC,X. 8A72 : Load the room argument, and if positive, check that door bit. If set, use the argument as the next instruction. 8A91 : Increment hit counter. If at least as much as the argument (1 byte), set the door as opened, disable preplm code, and goto the second argument (2 bytes) 8ACD : Used by Draygon's turrets, probably more. Add 1 to 1DC7,X, if it's smaller than the first argument (1 byte), just RTS. Else store #$FFFF to $1DC7,X, disable pre-plm, and use the second argument (2 bytes) as the next argument's address. 8AF1 : Set the BTS at the PLM's location to the argument, 1 byte. 8B05 : 8B17 : Draw 1x1 tile at PLM's location, using 1E17,X as the tile. Sets delay to 0001, PLA and RTS. *8B55 : Edits the scrolling of the room, using the values given by the room-call argument/pointer. Resets plm block to treadmill for no apparent reason (touching it doesn't change it) 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. 8C10 : Load argument (Only first byte used) and go to 80:90CB. Plays sound. 8C19 : Load argument (Only first byte used) and go to 80:914D. Plays sound. 8C46 : Load argument (Only first byte used) and go to 80:90B7. Plays sound. (0A = bomb block break) 8C7C : Load argument (Only first byte used) and go to 80:90C1. Plays sound. 8C8F : Map Station. Set current area's map station and set area mapped, and JSL $858080 with A = #$0014. TODO 8CD0 : Checks number of missiles. If not equal to max, set it to max and pop up the MISSILE RELOAD COMPLETED. box. Also enables Samus's movement. B9B9 : Set 'Dachora and Etecoon escaped' event. Used by shot blocks in Bomb Torizo room. BB25 : Moves PLM right 4 blocks BBDD : Store 0 to $1D77,X. BBE1 : Load the argument (2 bytes) and create a new object with 86:8097. BBF0 : Gates only, probably: Load the position, and find the room object that has that at $1AFF,X (Object's X, not PLM's X). Store 1 to $1B8F,X, and increment $1B47,X twice. Crash if no object is found. *ALLOCATES ROOM FOR 2 BYTE ARGUMENT, BUT DOES NOT USE IT* BD0F : If not in a loop, skip this instruction. If in a loop, clear loop counter, set next instruction address to 7E:DEBC to run next frame. NOTE: This does not end the PLM loop, nor immediately jumps to 7E:DEBC. If it runs into a draw command or something, this does NOTHING but clear the loop. BE3F : Grey doors only: Load a value from 84:BE4B,Y (indexed by 1E17,X, grey door open condition index) and store it to 1CD7,X (check grey door conditions every frame) CD93 : Set this block's BTS to 01. Used by breakable grapple blocks D155 : Sets $1978 to #$02D2. Unknown purpose. D525 : Something to do with water settings. Enables water? D5E6 : Pauses Samus's animation. Might look into the details later. DB8E : Draygon's turrets. 1E17,X is pointer to ram, bank 7E, set it to #$0001, and also set the block at the current location and below to spike, BTS 03. 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) *E29D : Set charge (from charge beam) to 0. Used by suit pickups. F49D : Used by WS chozo. Changes two blocks from slopes to spikes. Can probably be safely deleted if you just change the two blocks to spikes in the ram, and remove the call to it. PLM startups NOTE: Most ####,X's are really ####,Y's during the startup routine, due to some assembly limitations. This will be ignored in these notes. B3CF : RTS B18B : Map station; If not already used, set right slot to crumble, BTS 47, set left slot to crumble, BTS 48 B1C8 , B1F0 : Check for proper collision, if good, load mapstation position and goto B146. Else delete self B245 : Missile station; Set self to solid, set right slot to crumble, BTS 4B, set left slot to crumble, BTS 4C B2D0 , B300 : Check for proper collision and missile supplies, if good, load missilestation position and goto B146. Else delete self B33A : Make the block a horizontal continuation with FF (copies one block to the left) and deletes the PLM. B345 : Make the block a horizontal continuation with 01 (copies one block to the right) and deletes the PLM. B350 : Make the block a vertical continuation with FF (copies one block above) and deletes the PLM. B35B : Make the block a vertical continuation with 01 (copies one block below) and deletes the PLM. B393 : Find the PLM on the same block, then if it's $1E17,X isn't negative, make it #$8000, increment its instruction counter by 2, and set it's delay to 0001. Else leave it alone. *SET UP TO CRASH IF THERE IS NO PLM ON THE SAME BLOCK* B3C1 : Make the block this is on a normal solid (if originally type 8-F) or air block (if originally type 0-7) B3D4 : Make the block this is on a normal air block D108 : Set the PLM's block to the block-prop in A. C794 : Used by grey doors. Takes the hi-byte of $1CD7,X, ANDs it with #$007C, divides by 2, then stores it in $1E17,X. $1DC7,X = $1DC7,X AND #$83FF. And sets the block-type with 82B4, but that's not very interesting. C7B1 : Used by hit-doors. Sets block to shootable, BTS 44. B146 triggers the PLM at the current spot, and disables Samus's movement. If there is no PLM at the calculated spot, it just deletes the current PLM. PLMs with a instruction pointer of AAE3 point to the delete PLM instruction - these PLMs simply run their setup and do nothing else. 8764: 1C2D = 0, 2, 4, or 6. PLM Graphics AF6E: 0001 5011 0000 AF74: 0001 5411 0000 AF7A: 0001 D800 0000 AFB0: 0001 D000 0000 Kill PLM (DONE) (Misc --> Misc, DFA9) 01 00 B5 A2 BC 86 (DIE! And the PLM was thus vanquished) Do Not Make PLM (DONE) (B62F --> B3CF (RTS), AAE3) BC 86 Continuation From Left (B63B --> B33A, AFA4) 01 00 74 AF BC 86 Continuation From Right (B63F --> B345, AF9E) 01 00 6E AF BC 86 Continuation From Above (B643 --> B350, AFB0) 01 00 80 AF BC 86 Continuation From Below (B647 --> B35B, AFAA) 01 00 7A AF BC 86 Map Station (B6D3 --> B18B, AD62) 24 8A 76 AD 06 00 25 9F 06 00 31 9F 06 00 3D 9F 24 87 66 AD AD76: 02 00 25 9F 02 00 31 9F 02 00 3D 9F 24 87 76 AD Map Station RightAccess (B6D7 --> B1C8, AD86) (Collision with Crumble BTS 47) 10 8C 37 06 00 49 9F 60 00 55 9F 8F 8C 06 00 55 9F 10 8C 38 06 00 55 9F 06 00 49 9F BC 86 Map Station LeftAccess (B6DB --> B1F0, ADA4) (Collision with Crumble BTS 48) 10 8C 37 06 00 5B 9F 60 00 67 9F 8F 8C 06 00 67 9F 10 8C 38 06 00 67 9F 06 00 5B 9F BC 86 Energy Station (B6DF --> B21D, ADC2) Missile Station (B6EB --> B245, AE4C) 24 8A 60 AE 06 00 91 9F 06 00 9D 9F 06 00 A9 9F 24 87 50 AE AE60: BF AE 77 AE 4E 87 10 03 00 91 9F 03 00 9D 9F 03 00 A9 9F 3F 87 67 AE 24 87 4C AE Missile Station RightAccess (B6EF --> B2D0, AE7B) (Collision with Crumble BTS 4B) BF AE 9B AE 10 8C 37 06 00 B5 9F 60 00 BB 9F D0 8C 06 00 BB 9F 10 8C 38 06 00 BB 9F 06 00 B5 9F BC 86 Missile Station LeftAccess (B6F3 --> B300, AE9D) (Collision with Crumble BTS 4C) BF AE BD AE 10 8C 37 06 00 C1 9F 60 00 C7 9F D0 8C 06 00 C7 9F 10 8C 38 06 00 C7 9F 06 00 C1 9F BC 86 Scroll Block Touch PLM (B6FF --> B393, AAE3) Normal Scroll PLM (DONE) (B703 --> B371, AF86) 01 00 62 AF B4 86 55 8B 24 87 8A AF Elevator platform ? (B70B --> B3C1, AFB6) Unknown Maridia-block PLM (B737 --> B541, AAE3) Save Station (B76F --> B5EE, AFE8) Speedbooster escape (B8AC --> B89C, B88A) (Setup: Deletes self if already outran lava) (Instructions go here. All they do is set pre-PLM code, which handle the lava rising as Samus moves) Shaktool PLM (B8EB --> B8DC, B8D6) (Setup: Does some scrolling config as if it's a ddb scroll pointer) C1 86 B0 B8 B4 86 B8B0: Some more scrolling, sets room as cleared if Samus is far enough right. Old Tourian Escape Shaft Escape PLM (B964 --> B3C1, B919) (Setup: AND block PLM is on with #$8FFF) C1 86 27 B9 B4 86 CA 86 01 00 83 92 BC 86 Escape Room before Old Escape Shaft PLM (B968 --> B3C1, B940) (Setup: AND block PLM is on with #$8FFF) C1 86 48 B9 B4 86 BC 86 Unknown shot block grapple-reaction (B974 --> B96C, AAE3) (Setup: STZ $26, store #$FFFF to $28) Dachora / Etecoon escape block reaction (B9C1 --> B978, B9A2) 10 8C 0A 04 00 5B 92 04 00 65 92 04 00 6F 92 01 00 79 92 B9 B9 BC 86 Bomb room escape PLM (B9ED --> B9C5, AAE3) ? (BAF4 --> C794, BA7F, BA4C) (SMILE marks it as a 5th grey door, facing right) Mainstreet Brinstar Escape PLM (DONE) (BB30 --> BB09, BB19) (Setup: Check event bit F, if it hasn't happened, delete self) 01 00 53 92 25 BB 01 00 53 92 BC 86 Left Green Gate Trigger reaction (C806 --> C54D, AAE3) Right Green Gate Trigger reaction (C80A --> C56C, AAE3) Left Red Gate Trigger reaction (C80E --> C58B, AAE3) (Setup: Check shot, if not missile or super, dud. Else trigger gate) Right Red Gate Trigger reaction (C812 --> C5AF, AAE3) Left Blue Gate Trigger reaction (C816 --> C610, AAE3) (Setup: Check shot, if bomb, ignore. Else trigger gate) Right Blue Gate Trigger reaction (C81A --> C627, AAE3) Left 'Orange' Gate Trigger reaction (C81E --> C5D3, AAE3) Right 'Orange' Gate Trigger reaction (C822 --> C5F1, AAE3) Normal Open Gate (C826 --> C6D8, BC13) 01 00 17 A5 DD BB C1 86 52 BB B4 86 10 00 17 A5 E1 BB 4B E6 19 8C 0E 10 00 25 A5 10 00 33 A5 10 00 41 A5 18 00 4F A5 ... (BC3A, below) BB52: Check if $1D77,X is set. If so, continue with the PLM, new pre-PLM instruction is BB6A (RTS) Normal Closed Gate (C82A --> C6BE, BC3A) 01 00 5D A5 DD BB C1 86 6B BB B4 86 F0 BB 66 E5 19 8C 0E 10 00 4F A5 10 00 41 A5 10 00 33 A5 18 00 25 A5 24 87 13 BC (BC13, above) BB6B: If Samus is inside the gate (below it) *or* if $1D77,X is set, continue with the PLM, new pre-PLM instruction is BBA3 (RTS) Upside Down Open Gate (C82E --> C6DC, BC61) 08 00 6B A5 DD BB C1 86 52 BB B4 86 10 00 6B A5 E1 BB 67 E6 19 8C 0E 10 00 7D A5 10 00 8F A5 10 00 A1 A5 10 00 B3 A5 ... (BC88, below) BB52: Check if $1D77,X is set. If so, continue with the PLM, new pre-PLM instruction is BB6A (RTS) Upside Down Closed Gate (C832 --> C6CB, BC88) 08 00 C5 A5 DD BB C1 86 A4 BB B4 86 F0 BB B0 E5 19 8C 0E 10 00 B3 A5 10 00 A1 A5 10 00 8F A5 10 00 7D A5 25 87 61 BC (BC61, above) BBA4: If Samus is inside the gate (above it) *or* if $1D77,X is set, continue with the PLM, new pre-PLM instruction is BBDC (RTS) 1x1 Respawning Crumble Block Bomb Reaction (CFFC --> CFA0, C8EC) (Setup: Load projectile type. If not bomb, delete self. Very commonly used) 01 00 9B A4 BC 86 Shot Gate Top PLM (C836 --> C6E0, BCAF) (C6E0 selects the appropriate PLM instructions for the gate) 01 00 D7 A5 BC 86 01 00 E3 A5 BC 86 01 00 EB A5 BC 86 01 00 F7 A5 BC 86 01 00 FF A5 BC 86 01 00 0B A6 BC 86 01 00 13 A6 BC 86 01 00 1F A6 BC 86 01 00 27 A6 BC 86 01 00 33 A6 BC 86 01 00 3B A6 BC 86 01 00 47 A6 BC 86 01 00 4F A6 BC 86 01 00 5B A6 BC 86 01 00 63 A6 BC 86 01 00 6F A6 BC 86 (Unused upside-down tiles) (C83E --> C7E2, AAE3) (Setup: Look for another PLM on this spot, if one's found, tell it that it was hit, and what hit the block via 1D77) BC 86 Grey Door (Facing Left) (C842 --> C794, BE70, BE59) (02 00 77 A6 02 00 CB A6 19 8C 08 02 00 BF A6 02 00 B3 A6 01 00 A7 A6) 72 8A B1 C4 24 8A 84 BE 3F BE 01 00 A7 A6 B4 86 ;Startup, wait till door conditions fulfilled BE80: 24 87 7E BE (When would it even get here?) BE84: 24 8A A8 BE C1 86 0F BD ;Door conditions fulfilled, set up door to be shot BE8C: 03 00 B3 A9 04 00 A7 A6 03 00 B3 A9 04 00 A7 A6 03 00 B3 A9 04 00 A7 A6 24 87 8C BE ;Flashing animation. Loop endlessly. BEA8: 91 8A 01 AD BE ;Door was shot. Increment hit counter... for a grey door?? BEAD: 19 8C 07 04 00 B3 A6 04 00 BF A6 04 00 CB A6 01 00 77 A6 BC 86 ;Door was shot enough (1) times. Open door sound and animation Grey Door (Facing Right) (C848 --> C794, BED9, BEC2) (Unconfirmed) Grey Door (Facing Up) (C84E --> C794, BF42, BF2B) (Unconfirmed) Grey Door (Facing Down) (C854 --> C794, BFAB, BF94) (Unconfirmed) Orange Door (Facing Left) (DONE) (C85A --> C7B1, C014, BFFD) (02 00 77 A6 02 00 8B A7 19 8C 08 02 00 7F A7 02 00 73 A7 01 00 67 A7) 72 8A B1 C4 24 8A 2A C0 C1 86 26 BD 01 00 67 A7 B4 86 24 87 24 C0 BD26: Check hit detection. If hit by a power bomb, set PLM instruction to DEBC,X and tell PLM to go. C02A: 91 8A 01 4B C0 03 00 B3 A9 04 00 67 A7 03 00 B3 A9 04 00 67 A7 03 00 B3 A9 04 00 67 A7 24 87 24 C0 C04B: 19 8C 07 04 00 73 A7 04 00 7F A7 04 00 8B A7 5C 00 77 A6 BC 86 Orange Door (Facing Right) (C860 --> C7B1, C077, C060) (02 00 83 A6 02 00 BB A7 19 8C 08 02 00 AF A7 02 00 A3 A7 01 00 97 A7) 72 8A E2 C4 24 8A 8D C0 C1 86 26 BD 01 00 97 A7 B4 86 24 87 87 C0 C08D: 91 8A 01 AE C0 03 00 EF A9 04 00 97 A7 03 00 EF A9 04 00 97 A7 03 00 EF A9 04 00 97 A7 24 87 87 C0 C0AE: 19 8C 07 06 00 A3 A7 06 00 AF A7 06 00 BB A7 01 00 83 A6 BC 86 Orange Door (Facing Up) (C866 --> C7B1, C0DA, C0C3) (02 00 8F A6 02 00 EB A7 19 8C 08 02 00 DF A7 02 00 D3 A7 01 00 C7 A7) 72 8A 13 C5 24 8A EC C0 C1 86 26 BD 01 00 C7 A7 B4 86 C0EC: 91 8A 01 0D C1 03 00 2B AA 04 00 C7 A7 03 00 2B AA 04 00 C7 A7 03 00 2B AA 04 00 C7 A7 24 87 EA C0 C10D: 19 8C 07 06 00 D3 A7 06 00 DF A7 06 00 EB A7 01 00 8F A6 BC 86 Orange Door (Facing Down) (C86C --> C7B1, C139, C122) (02 00 9B A6 02 00 1B A8 19 8C 08 02 00 0F A8 02 00 03 A8 01 00 F7 A7) 72 8A 44 C5 24 8A 4F C1 C1 86 26 BD 02 00 F7 A7 01 00 F7 A7 B4 86 C14F: 91 8A 01 70 C1 03 00 67 AA 04 00 F7 A7 03 00 67 AA 04 00 F7 A7 03 00 67 AA 04 00 F7 A7 24 87 4D C1 C170: 19 8C 07 06 00 03 A8 06 00 0F A8 06 00 1B A8 01 00 9B A6 BC 86 Green Door (Facing Left) (C872 --> ) Green Door (Facing Right) (C878 --> ) Green Door (Facing Up) (C87E --> ) Green Door (Facing Down) (C884 --> ) Red Door (Facing Left) (DONE) (C88A --> C7B1, C318, C301) (02 00 77 A6 02 00 0B A9 19 8C 08 02 00 FF A8 02 00 F3 A8 01 00 E7 A8) 72 8A B1 C4 24 8A 2A C3 C1 86 50 BD 01 00 E7 A8 B4 86 BD50: Check hit detection. If hit by a missile, set PLM instruction to DEBC,X and tell PLM to go. If hit by a super missile, set hit counter to 120 missiles and act as if a missile hit. C32A: 91 8A 05 4E C3 19 8C 09 03 00 B3 A9 04 00 E7 A8 03 00 B3 A9 04 00 E7 A8 03 00 B3 A9 04 00 E7 A8 24 87 28 C3 C34E: 19 8C 07 06 00 F3 A8 06 00 FF A8 06 00 0B A9 01 00 77 A6 BC 86 Red Door (Facing Right) (C890 --> ) Red Door (Facing Up) (C896 --> ) Red Door (Facing Down) (C89C --> ) Blue door opening (Facing Left) (C8A2 --> C7BB, C489, C49E?) 19 8C 07 06 00 BF A9 06 00 CB A9 06 00 D7 A9 5E 00 77 A6 BC 86 Blue door opening (Facing Right) (C8A8 --> C7BB, C4BA, C4CF?) (C7BB: If a powerbomb, delete PLM, else make PLM block solid) 19 8C 07 06 00 FB A9 06 00 07 AA 06 00 13 AA 5E 00 83 A6 BC 86 ;Play door open sound, open door Blue door opening (Facing Up) (C8AE --> C7BB, C4EB, C500?) 19 8C 07 06 00 37 AA 06 00 43 AA 06 00 4F AA 5E 00 8F A6 BC 86 Blue door opening (Facing Down) (C8B4 --> C7BB, C51C, C531?) 19 8C 07 06 00 73 AA 06 00 7F AA 06 00 8B AA 5E 00 9B A6 BC 86 Blue door closing (Facing Left) (C8BA --> B3C1, C49E) 02 00 77 A6 02 00 D7 A9 19 8C 08 02 00 CB A9 02 00 BF A9 F1 8A 40 01 00 B3 A9 BC 86 Blue door closing (Facing Right) (C8BE --> B3C1, C4CF) 02 00 83 A6 02 00 13 AA 19 8C 08 02 00 07 AA 02 00 FB A9 F1 8A 41 01 00 EF A9 BC 86 Blue door closing (Facing Down) (C8C2 --> B3C1, C500) Blue door closing (Facing Up) (C8C6 --> B3C1, C531) ? (C8CA --> ) (SMILE marks this as Tourian gate that closes behind you when escaping) Unknown door? (Doesn't look right with *any* graphic set, door graphics are 30F (doesn't flip) and 2E8 (flips)) (C8D0 --> B3C1, BB44) 02 00 73 94 02 00 7F 94 02 00 8B 94 BC 86 Door already opened (Facing Left) (???? --> ????, C4B1) F1 8A 40 01 00 B3 A9 BC 86 Unknown Brinstar-block PLM (Looks like a normal speed block) (D034 --> CDEA, C9CF) 1x1 Respawning Crumble Block Touch Reaction (D044 --> CE37, C9F9) (Setup: Load collision type. If Samus is landing on block, put block data (#$B0BC) in PLM's $1E17,X, #$F0BC in block's $7F0002,X, and delay as 4 frames. If collision is wrong, delete PLM) 7C 8C 0A 08 00 45 A3 06 00 4B A3 04 00 51 A3 10 00 57 A3 04 00 51 A3 04 00 4B A3 04 00 45 A3 17 8B BC 86 1x1 Respawning shot block reaction (D064 --> CE6B, CADF) 2x1 Respawning shot block reaction (D068 --> CE6B, CB02) 1x2 Respawning shot block reaction (D06C --> CE6B, CB27) 2x2 Respawning shot block reaction (D070 --> CE6B, CB4C) 1x1 Shot block reaction (D074 --> B3C1, CBB7) 2x1 Shot block reaction (D078 --> B3C1, CBCC) 1x2 Shot block reaction (D07C --> B3C1, CBE1) 2x2 Shot block reaction (D080 --> B3C1, CBF6) Respawning power bomb block reaction (D084 --> CF2E, CB94) Power bomb block reaction (D088 --> CF2E, CC20) Respawning super missile block reaction (D08C --> CF67, CB71) Super missile block reaction (D090 --> CF67, CC0B) Enemy breakable block (D094 --> B3D4, CD53) 46 8C 0A 04 00 45 A3 04 00 4B A3 04 00 51 A3 01 00 57 A3 BC 86 1x1 Respawning Bomb Block Collision Reaction (D098 --> ) (untested) 1x2 Respawning Bomb Block Collision Reaction (D09C --> ) (untested) 2x1 Respawning Bomb Block Collision Reaction (D0A0 --> ) (untested) 2x2 Respawning Bomb Block Collision Reaction (D0A4 --> ) (untested) 1x1 Bomb Block Collision Reaction (D0A8 --> ) (untested) 2x1 Bomb Block Collision Reaction (D0AC --> ) (CE83, CCFF) 1x2 Bomb Block Collision Reaction (D0B0 --> ) (untested) 2x2 Bomb Block Collision Reaction (D0B4 --> ) (untested) 1x1 Respawning Bomb Block Bomb Reaction (D0B8 --> CEDA, CC3C) (Setup: Check trigger. If not powerbomb or bomb, leave. If powerbomb, add 3 to PLM instruction pointer. For both powerbomb and bomb, store blocktype and bomb block graphic into 1E17,X, and store #$8FFF into current block) 46 8C 0A 04 00 45 A3 04 00 4B A3 04 00 51 A3 80 01 57 A3 04 00 51 A3 04 00 4B A3 04 00 45 A3 17 8B BC 86 1x2 Respawning Bomb Block Bomb Reaction (D0BC --> CEDA, CC66) (untested) 2x1 Respawning Bomb Block Bomb Reaction (D0C0 --> CEDA, CC92) (untested) 2x2 Respawning Bomb Block Bomb Reaction (D0C4 --> CEDA, CCBE) (untested) 1x1 Bomb Block Bomb Reaction (D0C8 --> CEDA, CCEA) (untested) 2x1 Bomb Block Bomb Reaction (D0CC --> CEDA, CD06) (untested) 1x2 Bomb Block Bomb Reaction (D0D0 --> CEDA, CD02) (untested) 2x2 Bomb Block Bomb Reaction (D0D4 --> CEDA, CD3E) (untested) Grapple block grapple-reaction (D0D8 --> CFCD, CD68) (Setup: SEC, SEV) BC 86 Respawning Breakable grapple block grapple-reaction (D0DC --> CFB5, CD6A) (Setup: Clear BTS, backup block graphic, SEC, SEV) F0 00 F9 A4 10 8C 0A 04 00 FF A4 04 00 05 A5 04 00 0B A5 06 00 11 A5 04 00 0B A5 04 00 05 A5 04 00 FF A4 93 CD 17 8B BC 86 Breakable grapple block grapple-reaction (D0E0 --> CFB5, CDA9) (Setup: Clear BTS, backup block graphic, SEC, SEV) 78 00 F9 A4 10 8C 0A 04 00 FF A4 04 00 05 A5 04 00 0B A5 01 00 11 A5 BC 86 Spike Grapple-reaction (D0E4 --> CFD1, CD68) (Setup: SEC, CLV) Draygon's Broken Turret Grapple-reaction (D0E8 --> CFD5, CD68) (Setup: 1.0000 environmental damage to Samus, SVC, SEC) BC 86 ? (D113 --> D108, D0F6) 04 00 45 A3 04 00 4B A3 04 00 51 A3 01 00 57 A3 BC 86 ? (D6DE --> ) (SMILE lists as MB's glass) Lower Norfair Chozo Hand (Done?) (D6D6 --> D18E(RTS), D13F) 2D 88 0C 00 4D D1 C1 86 5C D1 B4 86 D14D: 55 D1 01 00 B5 A2 BC 86 Lower Norfair Chozo Hand Test (A1128, X=4, Y=6, whenever Samus is in contact with the hand) (D6DA --> D18F, AAE3) ? (D6EA --> ) (SMILE lists as crumbling Chozo statue) WS Chozo Hand (DONE) (D6EE --> D616, AAE3) (D616 sets PLM block-type to B, and bts to 80) WS Chozo Floor Slope-->Spike (D6FC --> D6F7 (RTS), D3EC) 01 00 0F 9D F4 D3 BC 86 Maridia Bridge (D70C --> D6CC, D4D4) 2D 88 0B 00 21 D5 24 8A E8 D4 C1 86 26 BD 01 00 D1 98 B4 86 24 8A F2 D4 C1 86 BF D4 B4 86 CA 86 E6 D5 2C D5 30 00 D7 98 01 00 91 99 09 00 E5 99 10 8C 1A 43 D5 36 D5 60 00 DD 98 3E 88 0B 00 25 D5 EE D5 BC 86 01 00 E3 98 01 00 53 99 25 D5 BC 86 NOTE: D519-D524 seem to be unused, as well as 98E3 - 9990. They are redundant drawing instructions for the bridge. Maridia Bridge Drawing Information 0C 00 4181 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 4185 00 01 0C 00 2203 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 2207 00 02 0C 00 2303 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 2307 0000 01 00 4101 00 03 0C 00 230B FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 230F 00 04 0C 00 220B FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 220F 00 05 0C 00 4E81 4F81 FF00 FF00 FF00 FF00 FF00 FF00 FF00 FF00 4F85 4E85 0000 Set Event when Room Cleared (DONE) (DB44 --> DB1E, DB42) B4 86 ? (DB48 --> ) (SMILE says right-facing eye-door eye) ? (DB4C --> ) (SMILE says right-facing eye-door top) ? (DB52 --> ) (SMILE says right-facing eye-door bottom) ? (DB56 --> ) (SMILE says left-facing eye-door eye) ? (DB5A --> ) (SMILE says left-facing eye-door top) ? (DB60 --> ) (SMILE says left-facing eye-door bottom) Draygon's Left Turret (DF59 --> DE94, DCDE) (Setup: 1DC7,X into 1E17,X, #$0000 into 1DC7,X, change block to Shootable 44 and below to vertical copy FF) 24 8A F0 DC C1 86 64 DB 08 00 CD 9F B4 86 DCF0: CD 8A 03 11 DD 03 00 CD 9F 04 00 DD 9F 03 00 CD 9F 04 00 DD 9F 03 00 CD 9F 04 00 DD 9F 24 87 E6 DC Draygon's Left Broken Turret (DF65 --> DF4C, DD11) (Setup: 1DC7,X into 1E17,X, #$0003 into 1DC7,X) 8E DB 06 00 2D A0 06 00 3D A0 06 00 4D A0 06 00 5D A0 24 87 13 DD Draygon's Right Turret (DF71 --> DEF0, DDB9) Draygon's Right Broken Turret (DF7D --> ) Chozo Ball Animation (DONE) (Misc --> Misc, DFAF) C1 86 89 DF 14 00 C7 A2 0A 00 CD A2 14 00 D3 A2 0A 00 CD A2 24 87 B3 DF Chozo Ball Opening Animation? Need to confirm, otherwise DONE (Misc --> Misc, DFC7) CA 86 03 00 B5 A2 03 00 D9 A2 03 00 B5 A2 3A 8A Hidden Shotblock (Misc --> Misc, E007) C1 86 E6 DF B4 86 Restore Hidden Shotblock (Misc --> Misc, E020) CA 86 04 00 E9 A3 04 00 E3 A3 04 00 DD A3 05 8B 3A 8A CA 86 (EED3 --> EEAB, AAE3) (Setup:Find a PLM on this spot, crash if not found. Tell it what beam-type (?) hit the block via 1D77. Uncharged peashooter and non-beams = 0000) BC 86 Energy Tank (DONE) (EED7 --> EE4D, E099) 7C 88 BA E0 24 8A B1 E0 C1 86 89 DF 04 00 DF A2 04 00 E5 A2 24 87 A5 E0 99 88 DD 8B 02 68 89 64 00 24 87 A9 DF Missile (DONE) (EEDB --> EE52, E0BE) 7C 88 DF E0 24 8A D6 E0 C1 86 89 DF 04 00 EB A2 04 00 F1 A2 24 87 CA E0 99 88 DD 8B 02 A9 89 05 00 24 87 A9 DF Super Missile (DONE) (EEDF --> EE57, E0E3) 7C 88 04 E1 24 8A FB E0 C1 86 89 DF 04 00 F7 A2 04 00 FD A2 24 87 EF E0 99 88 DD 8B 02 D2 89 05 00 24 87 A9 DF Power Bomb (EEE3 --> ) Bombs (EEE7 --> ) Charge (DONE) (EEEB --> EE64, 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 Ice (EEEF --> ) Normal High Jump Boots (EEF3 --> EE64, E1B7) 64 87 00 84 00 00 00 00 00 00 00 00 7C 88 E1 E1 24 8A D7 E1 C1 86 89 DF 4F E0 67 E0 24 87 CF E1 99 88 DD 8B 02 F3 88 00 01 0B 24 87 A9 DF Speed Booster (EEF7 --> ) Wave (DONE) (EEFB --> EE64, E213) 64 87 00 8D 00 02 00 00 00 02 00 00 7C 88 3D E2 24 8A 33 E2 C1 86 89 DF 4F E0 67 E0 24 87 2B E2 99 88 DD 8B 02 B0 88 01 00 10 24 87 A9 DF Spazer (DONE) (EEFF --> EE64, E241) 64 87 00 8F 00 00 00 00 00 00 00 00 7C 88 6B E2 24 8A 61 E2 C1 86 89 DF 4F E0 67 E0 24 87 59 E2 99 88 DD 8B 02 B0 88 04 00 11 24 87 A9 DF Spring Ball (EF03 --> ) Varia Suit (EF07 --> ) Gravity Suit (EF0B --> ) X-Ray Scope (EF0F --> ) Plasma (EF13 --> ) Grapple (EF17 --> ) Space Jump (EF1B --> ) Screw Attack (EF1F --> ) Morph Ball (EF23 --> ) Reserve Tank (EF27 --> ) Chozo Ball Energy Tank (DONE) (EF2B --> EE4D, E44A) 7C 88 76 E4 2E 8A AF DF 2E 8A C7 DF 24 8A 6D E4 C1 86 89 DF 4E 87 16 04 00 DF A2 04 00 E5 A2 24 87 61 E4 99 88 DD 8B 02 68 89 64 00 01 00 B5 A2 BC 86 Chozo Ball Missile (DONE) (EF2F --> EE52, E47C) 7C 88 A8 E4 2E 8A AF DF 2E 8A C7 DF 24 8A 9F E4 C1 86 89 DF 4E 87 16 04 00 EB A2 04 00 F1 A2 24 87 93 E4 99 88 DD 8B 02 A9 89 05 00 01 00 B5 A2 BC 86 (END, next is Chozo Ball Super Missile) Chozo Ball Super Missile (DONE) (EF33 --> EE57, E4AE) 7C 88 DA E4 2E 8A AF DF 2E 8A C7 DF 24 8A D1 E4 C1 86 89 DF 4E 87 16 04 00 F7 A2 04 00 FD A2 24 87 C5 E4 99 88 DD 8B 02 D2 89 05 00 01 00 B5 A2 24 87 (END) Chozo Ball Power Bombs (EF37 --> ) Chozo Ball Bombs (EF3B --> ) Chozo Ball Charge (EF3F --> ) Chozo Ball Ice (EF43 --> ) Chozo Ball High Jump (EF47 --> ) Chozo Ball Speed Booster (EF4B --> ) Chozo Ball Wave (DONE) (EF4F --> EE64, E642) 64 87 00 8D 00 02 00 00 00 02 00 00 7C 88 77 E6 2E 8A AF DF 2E 8A AF DF 2E 8A C7 DF 24 8A 6D E6 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 65 E6 99 88 DD 8B 02 B0 88 01 00 10 01 00 B5 A2 BC 86 Chozo Ball Spazer (DONE) (EF53 --> EE64, E67D) 64 87 00 8F 00 00 00 00 00 00 00 00 7C 88 B2 E6 2E 8A AF DF 2E 8A AF DF 2E 8A C7 DF 24 8A A8 E6 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 A0 E6 99 88 DD 8B 02 B0 88 04 00 11 01 00 B5 A2 BC 86 Chozo Ball Spring Ball (EF57 --> ) Chozo Ball Varia Suit (EF5B --> ) Chozo Ball Gravity Suit (EF5F --> ) Chozo Ball X-Ray Scope (EF63 --> ) Chozo Ball Plasma (EF67 --> ) Chozo Ball Grapple (EF6B --> ) Chozo Ball Space Jump (EF6F --> ) Chozo Ball Screw Attack (EF73 --> ) Chozo Ball Morph Ball (EF77 --> ) Chozo Ball Reserve Tank (EF7B --> ) Chozo Ball Energy Tank (EF7F --> ) Hidden Shotblock Missile (EF83 --> EE7C, E949) 2E 8A 07 E0 7C 88 79 E9 24 8A 70 E9 C1 86 89 DF 4E 87 16 04 00 EB A2 04 00 F1 A2 3F 87 5C E9 2E 8A 20 E0 24 87 49 E9 99 88 DD 8B 02 A9 89 05 00 2E 8A 20 E0 24 87 49 E9 Hidden Shotblock Super Missile (EF87 --> ) Hidden Shotblock Power Bomb (EF8B --> ) Hidden Shotblock Bombs (EF8F --> ) Hidden Shotblock Charge (EF93 --> ) Hidden Shotblock Ice (EF97 --> ) Hidden Shotblock High Jump (EF9B --> ) Hidden Shotblock Speed Booster (EF9F --> ) Hidden Shotblock Wave (EFA3 --> ) Hidden Shotblock Spazer (EFA7 --> ) Hidden Shotblock Spring Ball (EFAB --> ) Hidden Shotblock Varia Suit (EFAF --> ) Hidden Shotblock Gravity Suit (EFB3 --> ) Hidden Shotblock X-Ray Scope (EFB7 --> ) Hidden Shotblock Plasma (EFBB --> ) Hidden Shotblock Grapple (EFBF --> ) Hidden Shotblock Space Jump (EFC3 --> ) Hidden Shotblock Screw Attack (EFC7 --> ) Hidden Shotblock Morph Ball (EFCB --> ) Hidden Shotblock Reserve Tank (EFCF --> ) ;=================================== ;==== PLM_LOOP.TXT ================= ;=================================== Start 84:85DA JSR ($1CD7,X) Pre PLM Command 84:85DD LDX $1C27 Load room ID 84:85E0 LDA $7EDE1C,X Load timer 84:85E4 DEC A Dec timer 84:85E5 STA $7EDE1C,X 84:85E9 BNE $861D If Timer =/= 0, return 84:85EB LDY $1D27,X Load pointer to next instruction 84:85EE LDA $0000,Y Load next instruction ID 84:85F1 BPL $85FD Go here if it's not a pointer 84:85F3 STA $12 Store instruction ID 84:85F5 INY Inc Y to target argument 84:85F6 INY 84:85F7 PEA $85ED Put 85ED onto stack 84:85FA JMP ($0012) Jump (return address is 85ED) to the PLM routine 84:85FD STA $7EDE1C,X Not a pointer! Store to timer 84:8601 LDA $0002,Y Load thing after the set-timer 84:8604 STA $7EDE6C,X and store here 84:8608 TYA Take the pointer to next instruction 84:8609 CLC 84:860A ADC #$0004 and add four 84:860D STA $1D27,X and return it, to be run when timer is up 84:8610 JSR $861E Edits the blocks where the PLM is located. Also detects if Samus is touching the PLM? 84:8613 LDX $1C27 Reload room ID 84:8616 JSR $848290 Find the X/Y coord PLM to draw 84:861A JSR $8DAA Draw it 84:861D RTS ;================================= ;=== PLMS.TXT BY CRASHTOUR99 ===== ;================================= $848764 AD 2D 1C LDA $1C2D [$7E:1C2D] 7E:1C2D - 7E:1C2E Current PLM's Index (used during unpausing graphics refresh) $848767 9F 0C DF 7E STA $7EDF0C,x[$7E:DF50] 7E:DF0C - 7E:DF5B Unknown PLM value. Initialized to #$0000 $84876B AA TAX $84876C 1A INC A $84876D 1A INC A $84876E 29 06 00 AND #$0006 $848771 8D 2D 1C STA $1C2D [$7E:1C2D] 7E:1C2D - 7E:1C2E Current PLM's Index (used during unpausing graphics refresh) $848774 BD CD 87 LDA $87CD,x[$84:87CD] $848777 85 12 STA $12 [$7E:0012] $848779 BD D5 87 LDA $87D5,x[$84:87D5] $84877C 85 14 STA $14 [$7E:0014] $84877E BD DD 87 LDA $87DD,x[$84:87DD] $848781 85 16 STA $16 [$7E:0016] $848783 98 TYA $848784 9D 2F 1C STA $1C2F,x[$7E:1C2F] 7E:1C2F - 7E:1C36 Pointer to graphics for special PLMs (beams, equipment, etc.) in bank 89 $848787 AE 30 03 LDX $0330 [$7E:0330] 7E:0330 - 7E:0331 'Stack' pointer for 00D0 table $84878A A9 00 01 LDA #$0100 how many bytes *change to #$0180 for 3 tiles $84878D 95 D0 STA $D0,x [$7E:00D0] store to table for gfx transfer $84878F B9 00 00 LDA $0000,y[$84:E3F1] load gfx pointer $848792 95 D2 STA $D2,x [$7E:00D2] store to table for gfx transfer $848794 A9 89 00 LDA #$0089 load gfx bank pointer $848797 95 D4 STA $D4,x [$7E:00D4] store to table for gfx transfer $848799 A5 12 LDA $12 [$7E:0012] VRAM target address $84879B 95 D5 STA $D5,x [$7E:00D5] store to table for gfx transfer $84879D 8A TXA $84879E 18 CLC $84879F 69 07 00 ADC #$0007 $8487A2 8D 30 03 STA $0330 [$7E:0330] $8487A5 C8 INY $8487A6 C8 INY $8487A7 A6 14 LDX $14 [$7E:0014] $8487A9 8A TXA $8487AA 18 CLC $8487AB 69 10 00 ADC #$0010 *change to #$0018 for 3 tiles $8487AE 85 18 STA $18 [$7E:0018] $8487B0 B9 00 00 LDA $0000,y[$84:E3F3] $8487B3 29 FF 00 AND #$00FF $8487B6 EB XBA $8487B7 0A ASL A $8487B8 0A ASL A $8487B9 18 CLC $8487BA 65 16 ADC $16 [$7E:0016] $8487BC 9F 00 A0 7E STA $7EA000,x[$7E:A470] $8487C0 E6 16 INC $16 [$7E:0016] $8487C2 C8 INY $8487C3 E8 INX $8487C4 E8 INX $8487C5 E4 18 CPX $18 [$7E:0018] $8487C7 D0 E7 BNE $E7 [$87B0] $8487C9 AE 27 1C LDX $1C27 [$7E:1C27] 7E:1C27 - 7E:1C28 Current PLM's Index. See PLM_Details.txt for PLM data $8487CC 60 RTS $8487CD 00 3E 80 3E 00 3F 80 3F ;vram target address table 70 04 80 04 90 04 A0 04 E0 03 E8 03 F0 03 F8 03 EEDB - MISSILES 52 EE BE E0 E0BE 7C 88 Check if item has been picked up DF E0 24 8A Store the argument as the target instruction for special routines. Stored in 7E:DEBC,X D6 E0 C1 86 Stores the argument to 7E:1CD7,X, which will be executed every frame before the PLM instruction(s) until something overwrites it. 89 DF 04 00 EB A2 04 00 F1 A2 24 87 Use the address given by the argument as the next instruction. CA E0 E0D6 99 88 Mark this item as picked up. No effect on PLMs with a negative calling argument (see 887C) DD 8B Plays a specific track (only music-control available), depending on the argument. 02 A9 89 Pick up Missile Tank. Argument (2 bytes) tells how much to increase max missiles and current missiles by. Calls messagebox 02 05 00 increase missiles by 0005 E0DF 24 87 Use the address given by the argument as the next instruction. A9 DF EEDF - SUPERMISSILES 57 EE E3 E0 E0E3 7C 88 04 E1 24 8A FB E0 C1 86 89 DF 04 00 F7 A2 04 00 FD A2 24 87 EF E0 99 88 DD 8B 02 D2 89 05 00 24 87 A9 DF EEE3 - POWERBOMBS 5C EE 08 E1 E108 7C 88 29 E1 24 8A 20 E1 C1 86 89 DF 04 00 03 A3 04 00 09 A3 24 87 14 E1 99 88 DD 8B 02 FB 89 05 00 24 87 A9 DF $84/82B4 DA PHX A:0010 X:0012 Y:00A8 P:envmxdizC $84/82B5 85 12 STA $12 [$00:0012] A:0010 X:0012 Y:00A8 P:envmxdizC $84/82B7 E2 20 SEP #$20 A:0010 X:0012 Y:00A8 P:envmxdizC $84/82B9 BF 03 00 7F LDA $7F0003,x[$7F:0015] A:0010 X:0012 Y:00A8 P:envMxdizC $84/82BD 29 0F AND #$0F A:0010 X:0012 Y:00A8 P:envMxdizC $84/82BF 05 13 ORA $13 [$00:0013] A:0010 X:0012 Y:00A8 P:envMxdizC $84/82C1 9F 03 00 7F STA $7F0003,x[$7F:0015] A:0010 X:0012 Y:00A8 P:envMxdizC $84/82C5 C2 20 REP #$20 A:0010 X:0012 Y:00A8 P:envMxdizC $84/82C7 8A TXA A:0010 X:0012 Y:00A8 P:envmxdizC $84/82C8 4A LSR A A:0010 X:0012 Y:00A8 P:envmxdizC $84/82C9 AA TAX A:0010 X:0012 Y:00A8 P:envmxdizC $84/82CA E2 20 SEP #$20 A:0010 X:0012 Y:00A8 P:envmxdizC $84/82CC A5 12 LDA $12 [$00:0012] A:0010 X:0012 Y:00A8 P:envMxdizC $84/82CE 9F 02 64 7F STA $7F6402,x[$7F:6414] A:0010 X:0012 Y:00A8 P:envMxdizC $84/82D2 C2 20 REP #$20 A:0010 X:0012 Y:00A8 P:envMxdizC $84/82D4 FA PLX A:0010 X:0012 Y:00A8 P:envmxdizC $84/82D5 60 RTS 88B0 pick up/equip beams $84/88B0 B9 00 00 LDA $0000,y[$84:E57F] $84/88B3 0D A8 09 ORA $09A8 [$7E:09A8] $84/88B6 8D A8 09 STA $09A8 [$7E:09A8] ;collected beams $84/88B9 B9 00 00 LDA $0000,y[$84:E57F] $84/88BC 0D A6 09 ORA $09A6 [$7E:09A6] $84/88BF 8D A6 09 STA $09A6 [$7E:09A6] ;equipped beams $84/88C2 B9 00 00 LDA $0000,y[$84:E57F] $84/88C5 0A ASL A $84/88C6 29 08 00 AND #$0008 $84/88C9 1C A6 09 TRB $09A6 [$7E:09A6] $84/88CC B9 00 00 LDA $0000,y[$84:E57F] $84/88CF 4A LSR A $84/88D0 29 04 00 AND #$0004 $84/88D3 1C A6 09 TRB $09A6 [$7E:09A6] ;gives plasma priority over spazer $84/88D6 DA PHX $84/88D7 5A PHY $84/88D8 22 8D AC 90 JSL $90AC8D[$90:AC8D] $84/88DC 7A PLY $84/88DD FA PLX $84/88DE A9 68 01 LDA #$0168 $84/88E1 22 18 E1 82 JSL $82E118[$82:E118] $84/88E5 B9 02 00 LDA $0002,y[$84:E581] $84/88E8 29 FF 00 AND #$00FF $84/88EB 22 80 80 85 JSL $858080[$85:8080] ;play a message box $84/88EF C8 INY $84/88F0 C8 INY $84/88F1 C8 INY $84/88F2 60 RTS 88F3 pick up/equip items $84/88F3 AD A2 09 LDA $09A2 [$88:09A2] collected items $84/88F6 19 00 00 ORA $0000,y[$88:0098] A:0490 X:000F Y:0098 P:envmxdizC $84/88F9 8D A2 09 STA $09A2 [$88:09A2] A:0490 X:000F Y:0098 P:envmxdizC $84/88FC AD A4 09 LDA $09A4 [$88:09A4] equipped items $84/88FF 19 00 00 ORA $0000,y[$88:0098] A:0490 X:000F Y:0098 P:envmxdizC $84/8902 8D A4 09 STA $09A4 [$88:09A4] A:0490 X:000F Y:0098 P:envmxdizC $84/8905 A9 68 01 LDA #$0168 A:0490 X:000F Y:0098 P:envmxdizC $84/8908 22 18 E1 82 JSL $82E118[$82:E118] A:0490 X:000F Y:0098 P:envmxdizC $84/890C B9 02 00 LDA $0002,y[$88:009A] A:0490 X:000F Y:0098 P:envmxdizC $84/890F 29 FF 00 AND #$00FF A:0490 X:000F Y:0098 P:envmxdizC $84/8912 22 80 80 85 JSL $858080[$85:8080] play message box $84/8916 C8 INY A:0490 X:000F Y:0098 P:envmxdizC $84/8917 C8 INY A:0490 X:000F Y:0098 P:envmxdizC $84/8918 C8 INY A:0490 X:000F Y:0098 P:envmxdizC $84/8919 60 RTS 891A pick up grapple $84891A AD A2 09 LDA $09A2 [$7E:09A2] $84891D 19 00 00 ORA $0000,y[$84:E81E] $848920 8D A2 09 STA $09A2 [$7E:09A2] $848923 AD A4 09 LDA $09A4 [$7E:09A4] $848926 19 00 00 ORA $0000,y[$84:E81E] $848929 8D A4 09 STA $09A4 [$7E:09A4] $84892C 22 2E 9A 80 JSL $809A2E[$80:9A2E] $848930 A9 68 01 LDA #$0168 $848933 22 18 E1 82 JSL $82E118[$82:E118] $848937 A9 05 00 LDA #$0005 $84893A 22 80 80 85 JSL $858080[$85:8080] $84893E C8 INY $84893F C8 INY $848940 60 RTS 8941 pick up xray $848941 AD A2 09 LDA $09A2 [$7E:09A2] $848944 19 00 00 ORA $0000,y[$84:E7A9] $848947 8D A2 09 STA $09A2 [$7E:09A2] $84894A AD A4 09 LDA $09A4 [$7E:09A4] $84894D 19 00 00 ORA $0000,y[$84:E7A9] $848950 8D A4 09 STA $09A4 [$7E:09A4] $848953 22 3E 9A 80 JSL $809A3E[$80:9A3E] $848957 A9 68 01 LDA #$0168 $84895A 22 18 E1 82 JSL $82E118[$82:E118] $84895E A9 06 00 LDA #$0006 $848961 22 80 80 85 JSL $858080[$85:8080] $848965 C8 INY $848966 C8 INY $848967 60 RTS 68 89 pick up etank 86 89 pick up reserve A9 89 pick up missiles D2 89 pick up supers FB 89 pick up pbs $848968 AD C4 09 LDA $09C4 [$7E:09C4] $84896B 18 CLC $84896C 79 00 00 ADC $0000,y[$84:E93F] $84896F 8D C4 09 STA $09C4 [$7E:09C4] $848972 8D C2 09 STA $09C2 [$7E:09C2] $848975 A9 68 01 LDA #$0168 $848978 22 18 E1 82 JSL $82E118[$82:E118] $84897C A9 01 00 LDA #$0001 $84897F 22 80 80 85 JSL $858080[$85:8080] $848983 C8 INY $848984 C8 INY $848985 60 RTS $848986 AD D4 09 LDA $09D4 [$7E:09D4] $848989 18 CLC $84898A 79 00 00 ADC $0000,y[$84:E909] $84898D 8D D4 09 STA $09D4 [$7E:09D4] $848990 AD C0 09 LDA $09C0 [$7E:09C0] $848993 D0 03 BNE $03 [$8998] $848995 EE C0 09 INC $09C0 [$7E:09C0] $848998 A9 68 01 LDA #$0168 $84899B 22 18 E1 82 JSL $82E118[$82:E118] $84899F A9 19 00 LDA #$0019 $8489A2 22 80 80 85 JSL $858080[$85:8080] $8489A6 C8 INY $8489A7 C8 INY $8489A8 60 RTS $84/89A9 AD C8 09 LDA $09C8 [$88:09C8] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89AC 18 CLC A:0010 X:0012 Y:00A8 P:envmxdizC $84/89AD 79 00 00 ADC $0000,y[$88:00A8] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89B0 8D C8 09 STA $09C8 [$88:09C8] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89B3 AD C6 09 LDA $09C6 [$88:09C6] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89B6 18 CLC A:0010 X:0012 Y:00A8 P:envmxdizC $84/89B7 79 00 00 ADC $0000,y[$88:00A8] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89BA 8D C6 09 STA $09C6 [$88:09C6] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89BD 22 CF 99 80 JSL $8099CF[$80:99CF] draw missile icon in HUD $84/89C1 A9 68 01 LDA #$0168 A:0010 X:0012 Y:00A8 P:envmxdizC $84/89C4 22 18 E1 82 JSL $82E118[$82:E118] something to do with checking gamestate $84/89C8 A9 02 00 LDA #$0002 A:0010 X:0012 Y:00A8 P:envmxdizC $84/89CB 22 80 80 85 JSL $858080[$85:8080] message box $84/89CF C8 INY A:0010 X:0012 Y:00A8 P:envmxdizC $84/89D0 C8 INY A:0010 X:0012 Y:00A8 P:envmxdizC $84/89D1 60 RTS A:0010 X:0012 Y:00A8 P:envmxdizC $84/89D2 AD CC 09 LDA $09CC [$88:09CC] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89D5 18 CLC A:0010 X:0012 Y:00A8 P:envmxdizC $84/89D6 79 00 00 ADC $0000,y[$88:00A8] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89D9 8D CC 09 STA $09CC [$88:09CC] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89DC AD CA 09 LDA $09CA [$88:09CA] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89DF 18 CLC A:0010 X:0012 Y:00A8 P:envmxdizC $84/89E0 79 00 00 ADC $0000,y[$88:00A8] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89E3 8D CA 09 STA $09CA [$88:09CA] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89E6 22 0E 9A 80 JSL $809A0E[$80:9A0E] draw super icon in HUD $84/89EA A9 68 01 LDA #$0168 A:0010 X:0012 Y:00A8 P:envmxdizC $84/89ED 22 18 E1 82 JSL $82E118[$82:E118] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89F1 A9 03 00 LDA #$0003 A:0010 X:0012 Y:00A8 P:envmxdizC $84/89F4 22 80 80 85 JSL $858080[$85:8080] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89F8 C8 INY A:0010 X:0012 Y:00A8 P:envmxdizC $84/89F9 C8 INY A:0010 X:0012 Y:00A8 P:envmxdizC $84/89FA 60 RTS A:0010 X:0012 Y:00A8 P:envmxdizC $84/89FB AD D0 09 LDA $09D0 [$88:09D0] A:0010 X:0012 Y:00A8 P:envmxdizC $84/89FE 18 CLC A:0010 X:0012 Y:00A8 P:envmxdizC $84/89FF 79 00 00 ADC $0000,y[$88:00A8] A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A02 8D D0 09 STA $09D0 [$88:09D0] A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A05 AD CE 09 LDA $09CE [$88:09CE] A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A08 18 CLC A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A09 79 00 00 ADC $0000,y[$88:00A8] A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A0C 8D CE 09 STA $09CE [$88:09CE] A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A0F 22 1E 9A 80 JSL $809A1E[$80:9A1E] draw pb icon in HUD $84/8A13 A9 68 01 LDA #$0168 A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A16 22 18 E1 82 JSL $82E118[$82:E118] changes music depending on game state $84/8A1A A9 04 00 LDA #$0004 A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A1D 22 80 80 85 JSL $858080[$85:8080] A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A21 C8 INY A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A22 C8 INY A:0010 X:0012 Y:00A8 P:envmxdizC $84/8A23 60 RTS A:0010 X:0012 Y:00A8 P:envmxdizC $84/E099 7C 88 BA E0 24 8A B1 E0 C1 86 89 DF 04 00 DF A2 04 00 E5 A2 24 87 A5 E0 99 88 DD 8B 02 68 89 64 00 24 87 A9 DF E-Tank: DW $887C : DW ENDPLM ;Jump if item already picked up DW $8A24 : DW ETTOUCH ;Set address to jump to when item is touched DW $86C1 : DW $DF89 ;Setup touch detection for PLM ETANIM: DW $0004 : DW $A2DF ;FRAME 1 ANIMATION (4 FRAMES, AND LOCATION OF FRAME DATA) DW $0004 : DW $A2E5 ;FRAME 2 ANIMATION DW $8724 : DW ETANIM ;LOOP BACK TO ANIMATE ETTOUCH: DW $8899 ;SET ITEM AS PICKED UP DW $8BDD : DB $02 ;PLAY A SOUND CLIP, $02 IS INDEX DW $8968 : DW $0064 ;PICK UP ETANK AND HOW MUCH ENERGY TO ADD ENDPLM: DW $8724 : DW $DFA9 ;Run code to delete graphic and kill PLM $84/E0BE 7C 88 DF E0 24 8A D6 E0 C1 86 89 DF 04 00 EB A2 04 00 F1 A2 24 87 CA E0 99 88 DD 8B 02 A9 89 05 00 24 87 A9 DF $84/E0E3 7C 88 04 E1 24 8A FB E0 C1 86 89 DF 04 00 F7 A2 04 00 FD A2 24 87 EF E0 99 88 DD 8B 02 D2 89 05 00 24 87 A9 DF $84/E108 7C 88 29 E1 24 8A 20 E1 C1 86 89 DF 04 00 03 A3 04 00 09 A3 24 87 14 E1 99 88 DD 8B 02 FB 89 05 00 24 87 A9 DF $84/E12D 64 87 00 80 00 00 00 00 00 00 00 00 7C 88 57 E1 24 8A 4D E1 C1 86 89 DF 4F E0 67 E0 24 87 45 E1 99 88 DD 8B 02 F3 88 00 10 13 24 87 A9 DF BOMBS: DW $8764 : DW $8000 ;TRANSFER GFX, GFX POINTER (IN $89) DB $00,$00,$00,$00 ;FRAME 1 PALETTE (FOR EACH 8X8 TILE) DB $00,$00,$00,$00 ;FRAME 2 PALETTE (FOR EACH 8X8 TILE) DW $887C : DW ENDPLM ;JUMP IF ITEM ALREADY PICKED UP DW $8A24 : DW BOMBSTOUCH ;Set address to jump to when item is touched DW $86C1 : DW $DF89 ;Setup touch detection for PLM ANIMATELOOP: DW $E04F : DW $E067 ;Draws the GFX DW $8724 : DW ANIMATELOOP ;Loop back to redraw GFX BOMBSTOUCH: DW $8899 ;SET ITEM AS PICKED UP DW $8BDD : DB $02 ;PLAY A SOUND CLIP, $02 IS INDEX DW $88F3 : DW $1000 : DB $13 ;SET ITEM BIT IN COLLECTED/EQUIPED INVENTORY AND PLAY MESSAGE BOX, ITEM BIT, MESSAGE BOX INDEX ENDPLM: DW $8724 : DW $DFA9 ;Run code to delete graphic and kill PLM ;draws gfx for normal item plms $84E04F 5A PHY $84E050 BF 0C DF 7E LDA $7EDF0C,x[$7E:DF50] Unknown PLM value. Initialized to #$0000 $84E054 A8 TAY $84E055 B9 5F E0 LDA $E05F,y[$84:E05F] $84E058 9F 6C DE 7E STA $7EDE6C,x[$7E:DEB0] PLM Block Edit pointer $84E05C 7A PLY $84E05D 80 20 BRA $20 [$E07F] $84E05F dw A30F A31B A327 A333 ;this section is actually right before tile data for door animations A30F 01 00 8E B0 00 00 ;extend 1 block, right, block type and graphic (CRE tiletable), 0000=end A315 01 00 8F B0 00 00 A31B 01 00 90 B0 00 00 A321 01 00 91 B0 00 00 A327 01 00 92 B0 00 00 A32D 01 00 93 B0 00 00 A333 01 00 94 B0 00 00 A339 01 00 95 B0 00 00 $84E067 5A PHY $84E068 BF 0C DF 7E LDA $7EDF0C,x[$7E:DF50] Unknown PLM value. Initialized to #$0000 $84E06C A8 TAY $84E06D B9 77 E0 LDA $E077,y[$84:E077] $84E070 9F 6C DE 7E STA $7EDE6C,x[$7E:DEB0] PLM Block Edit pointer $84E074 7A PLY $84E075 80 08 BRA $08 [$E07F] $84E077 dw A315 A321 A32D A339 $84E07F A9 04 00 LDA #$0004 $84E082 9F 1C DE 7E STA $7EDE1C,x[$7E:DE60] Loaded 'compressed' map data from SRAM. Only first 160 bytes or so are actually used by original game. $84E086 98 TYA $84E087 9D 27 1D STA $1D27,x[$7E:1D6B] Next PLM instruction $84E08A 20 1E 86 JSR $861E [$84:861E] Called within routines very often. Uses DE6C,X as a pointer to new tile data. Format for new tile data: First byte tells how many blocks to extend, second tells whether to extend horizontally(right, 00) or vertically(down, 80). Data past the pointer is used to set block data (block type and graphic), starting at the PLM's location and moving down/right as far as the first byte tells it to go. After this, it checks the bytes past the last new block. If they're $#0000, it's done and returns. Otherwise, it uses the first next byte to see how far to move, and the second next byte to see in which direction to move (right, 00, down, 80. Unchecked). It repeats until it runs into a $#0000 at the end of new blocks. $84E08D AE 27 1C LDX $1C27 [$7E:1C27] Current PLM's Index. See PLM_Details.txt for PLM data $84E090 22 90 82 84 JSL $848290[$84:8290] calculates the X and Y coord of a PLM from it's absolute location (1C87,X). Results stored in $1C29(X) and $1C2B(Y). NOTE: This must be called LONG (JSL). Do not attempt to use this as a PLM instruction, even though it's in the same bank as PLMs. $84E094 20 AA 8D JSR $8DAA [$84:8DAA] Called within routines very often. Stores $#5000 in $09, and #$53E0 in $0C. Loads DE6C,X (Pointer for block change data) and puts it into Y. It also puts a previously calculated X($1C29) and Y($1C2B) coordinate in $1E and $20. Then it starts doing stuff, for which I don't know what the purpose is. Effectively, however, this routine has been noted to draw (or perhaps to just refresh) graphics at the specified X and Y coordinates. $84E097 68 PLA $84E098 60 RTS $84/E099 etank 7C 88 BA E0 24 8A B1 E0 C1 86 89 DF 04 00 DF A2 04 00 E5 A2 24 87 A5 E0 99 88 DD 8B 02 68 89 64 00 24 87 A9 DF $84/E0BE missiles 7C 88 DF E0 24 8A D6 E0 C1 86 89 DF 04 00 EB A2 04 00 F1 A2 24 87 CA E0 99 88 DD 8B 02 A9 89 05 00 24 87 A9 DF $84/E0E3 supers 7C 88 04 E1 24 8A FB E0 C1 86 89 DF 04 00 F7 A2 04 00 FD A2 24 87 EF E0 99 88 DD 8B 02 D2 89 05 00 24 87 A9 DF $84/E108 powerbombs 7C 88 29 E1 24 8A 20 E1 C1 86 89 DF 04 00 03 A3 04 00 09 A3 24 87 14 E1 99 88 DD 8B 02 FB 89 05 00 24 87 A9 DF $84/E12D bombs F3 88 00 10 13 $84/E15B charge B0 88 00 10 0E $84/E189 ice B0 88 02 00 0F $84/E1B7 hijump F3 88 00 01 0B $84/E1E5 sb F3 88 00 20 0D $84/E213 wave B0 88 01 00 10 $84/E241 spazer B0 88 04 00 11 $84/E26F springball F3 88 02 00 08 $84/E29D STZ $0CD0 : RTS ;zeros current charge $84/E2A1 varia 9D E2 F3 88 01 00 07 0B 87 E4 D4 91 $84/E2D6 gravity 9D E2 F3 88 20 00 1A 0B 87 BA D5 91 $84/E30B xray 41 89 00 80 $84/E338 plasma B0 88 08 00 12 $84/E366 grapple 1A 89 00 40 $84/E393 sj F3 88 00 02 0C $84/E3C1 sa F3 88 08 00 0A $84/E3EF morph F3 88 04 00 09 $84/E41D reserve 86 89 64 00 $84/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 $84/E189 64 87 00 8C 00 03 00 00 00 03 00 00 7C 88 B3 E1 24 8A A9 E1 C1 86 89 DF 4F E0 67 E0 24 87 A1 E1 99 88 DD 8B 02 B0 88 02 00 0F 24 87 A9 DF $84/E1B7 64 87 00 84 00 00 00 00 00 00 00 00 7C 88 E1 E1 24 8A D7 E1 C1 86 89 DF 4F E0 67 E0 24 87 CF E1 99 88 DD 8B 02 F3 88 00 01 0B 24 87 A9 DF $84/E1E5 64 87 00 8A 00 00 00 00 00 00 00 00 7C 88 0F E2 24 8A 05 E2 C1 86 89 DF 4F E0 67 E0 24 87 FD E1 99 88 DD 8B 02 F3 88 00 20 0D 24 87 A9 DF $84/E213 64 87 00 8D 00 02 00 00 00 02 00 00 7C 88 3D E2 24 8A 33 E2 C1 86 89 DF 4F E0 67 E0 24 87 2B E2 99 88 DD 8B 02 B0 88 01 00 10 24 87 A9 DF $84/E241 64 87 00 8F 00 00 00 00 00 00 00 00 7C 88 6B E2 24 8A 61 E2 C1 86 89 DF 4F E0 67 E0 24 87 59 E2 99 88 DD 8B 02 B0 88 04 00 11 24 87 A9 DF $84/E26F 64 87 00 82 00 00 00 00 00 00 00 00 7C 88 99 E2 24 8A 8F E2 C1 86 89 DF 4F E0 67 E0 24 87 87 E2 99 88 DD 8B 02 F3 88 02 00 08 24 87 A9 DF $84/E29D STZ $0CD0 : RTS ;zeros current charge $84/E2A1 64 87 00 83 00 00 00 00 00 00 00 00 7C 88 D2 E2 24 8A C1 E2 C1 86 89 DF 4F E0 67 E0 24 87 B9 E2 99 88 DD 8B 02 9D E2 F3 88 01 00 07 0B 87 E4 D4 91 24 87 A9 DF $84/E2D6 64 87 00 81 00 00 00 00 00 00 00 00 7C 88 07 E3 24 8A F6 E2 C1 86 89 DF 4F E0 67 E0 24 87 EE E2 99 88 DD 8B 02 9D E2 F3 88 20 00 1A 0B 87 BA D5 91 24 87 A9 DF $84/E30B 64 87 00 89 01 01 00 00 03 03 00 00 7C 88 34 E3 24 8A 2B E3 C1 86 89 DF 4F E0 67 E0 24 87 23 E3 99 88 DD 8B 02 41 89 00 80 24 87 A9 DF $84/E338 64 87 00 8E 00 01 00 00 00 01 00 00 7C 88 62 E3 24 8A 58 E3 C1 86 89 DF 4F E0 67 E0 24 87 50 E3 99 88 DD 8B 02 B0 88 08 00 12 24 87 A9 DF $84/E366 64 87 00 88 00 00 00 00 00 00 00 00 7C 88 8F E3 24 8A 86 E3 C1 86 89 DF 4F E0 67 E0 24 87 7E E3 99 88 DD 8B 02 1A 89 00 40 24 87 A9 DF $84/E393 64 87 00 86 00 00 00 00 00 00 00 00 7C 88 BD E3 24 8A B3 E3 C1 86 89 DF 4F E0 67 E0 24 87 AB E3 99 88 DD 8B 02 F3 88 00 02 0C 24 87 A9 DF $84/E3C1 64 87 00 85 00 00 00 00 00 00 00 00 7C 88 EB E3 24 8A E1 E3 C1 86 89 DF 4F E0 67 E0 24 87 D9 E3 99 88 DD 8B 02 F3 88 08 00 0A 24 87 A9 DF $84/E3EF 64 87 00 87 00 00 00 00 00 00 00 00 7C 88 19 E4 24 8A 0F E4 C1 86 89 DF 4F E0 67 E0 24 87 07 E4 99 88 DD 8B 02 F3 88 04 00 09 24 87 A9 DF $84/E41D 64 87 00 90 00 00 00 00 00 00 00 00 7C 88 46 E4 24 8A 3D E4 C1 86 89 DF 4F E0 67 E0 24 87 35 E4 99 88 DD 8B 02 86 89 64 00 24 87 A9 DF $84/E44A 7C 88 76 E4 2E 8A AF DF 2E 8A C7 DF 24 8A 6D E4 C1 86 89 DF 4E 87 16 04 00 DF A2 04 00 E5 A2 24 87 61 E4 99 88 DD 8B 02 68 89 64 00 01 00 B5 A2 BC 86 $84/E47C 7C 88 A8 E4 2E 8A AF DF 2E 8A C7 DF 24 8A 9F E4 C1 86 89 DF 4E 87 16 04 00 EB A2 04 00 F1 A2 24 87 93 E4 99 88 DD 8B 02 A9 89 05 00 01 00 B5 A2 BC 86 $84/E4AE 7C 88 DA E4 2E 8A AF DF 2E 8A C7 DF 24 8A D1 E4 C1 86 89 DF 4E 87 16 04 00 F7 A2 04 00 FD A2 24 87 C5 E4 99 88 DD 8B 02 D2 89 05 00 01 00 B5 A2 BC 86 $84/E4E0 7C 88 0C E5 2E 8A AF DF 2E 8A C7 DF 24 8A 03 E5 C1 86 89 DF 4E 87 16 04 00 03 A3 04 00 09 A3 24 87 F7 E4 99 88 DD 8B 02 FB 89 05 00 01 00 B5 A2 BC 86 $84/E512 64 87 00 80 00 00 00 00 00 00 00 00 7C 88 47 E5 2E 8A AF DF 2E 8A C7 DF 24 8A 3D E5 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 35 E5 99 88 DD 8B 02 F3 88 00 10 13 01 00 B5 A2 BC 86 $84/E54D 64 87 00 8B 00 00 00 00 00 00 00 00 7C 88 82 E5 2E 8A AF DF 2E 8A C7 DF 24 8A 78 E5 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 70 E5 99 88 DD 8B 02 B0 88 00 10 0E 01 00 B5 A2 BC 86 $84/E588 64 87 00 8C 00 03 00 00 00 03 00 00 7C 88 BD E5 2E 8A AF DF 2E 8A C7 DF 24 8A B3 E5 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 AB E5 99 88 DD 8B 02 B0 88 02 00 0F 01 00 B5 A2 BC 86 $84/E5C3 64 87 00 84 00 00 00 00 00 00 00 00 7C 88 F8 E5 2E 8A AF DF 2E 8A C7 DF 24 8A EE E5 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 E6 E5 99 88 DD 8B 02 F3 88 00 01 0B 01 00 B5 A2 BC 86 $84/E5FE 64 87 00 8A 00 00 00 00 00 00 00 00 7C 88 35 E6 2E 8A AF DF 2E 8A C7 DF 24 8A 29 E6 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 21 E6 99 88 DD 8B 02 F3 88 00 20 0D 3B E6 01 00 B5 A2 BC 86 $84/E63B LDA #$FFE0 : STA $197C : RTS ;adjusts fx3 rising speed $84/E642 64 87 00 8D 00 02 00 00 00 02 00 00 7C 88 77 E6 2E 8A AF DF 2E 8A C7 DF 24 8A 6D E6 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 65 E6 99 88 DD 8B 02 B0 88 01 00 10 01 00 B5 A2 BC 86 $84/E67D 64 87 00 8F 00 00 00 00 00 00 00 00 7C 88 B2 E6 2E 8A AF DF 2E 8A C7 DF 24 8A A8 E6 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 A0 E6 99 88 DD 8B 02 B0 88 04 00 11 01 00 B5 A2 BC 86 $84/E6B8 64 87 00 82 00 00 00 00 00 00 00 00 7C 88 ED E6 2E 8A AF DF 2E 8A C7 DF 24 8A E3 E6 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 DB E6 99 88 DD 8B 02 F3 88 02 00 08 01 00 B5 A2 BC 86 $84/E6F3 64 87 00 83 00 00 00 00 00 00 00 00 7C 88 2F E7 2E 8A AF DF 2E 8A C7 DF 24 8A 1E E7 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 16 E7 99 88 DD 8B 02 9D E2 F3 88 01 00 07 0B 87 E4 D4 91 01 00 B5 A2 BC 86 $84/E735 64 87 00 81 00 00 00 00 00 00 00 00 7C 88 71 E7 2E 8A AF DF 2E 8A C7 DF 24 8A 60 E7 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 58 E7 99 88 DD 8B 02 9D E2 F3 88 20 00 1A 0B 87 BA D5 91 01 00 B5 A2 BC 86 $84/E777 64 87 00 89 01 01 00 00 03 03 00 00 7C 88 AB E7 2E 8A AF DF 2E 8A C7 DF 24 8A A2 E7 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 9A E7 99 88 DD 8B 02 41 89 00 80 01 00 B5 A2 BC 86 $84/E7B1 64 87 00 8E 00 01 00 00 00 01 00 00 7C 88 E6 E7 2E 8A AF DF 2E 8A C7 DF 24 8A DC E7 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 D4 E7 99 88 DD 8B 02 B0 88 08 00 12 01 00 B5 A2 BC 86 $84/E7EC 64 87 00 88 00 00 00 00 00 00 00 00 7C 88 20 E8 2E 8A AF DF 2E 8A C7 DF 24 8A 17 E8 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 0F E8 99 88 DD 8B 02 1A 89 00 40 01 00 B5 A2 BC 86 $84/E826 64 87 00 86 00 00 00 00 00 00 00 00 7C 88 5B E8 2E 8A AF DF 2E 8A C7 DF 24 8A 51 E8 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 49 E8 99 88 DD 8B 02 F3 88 00 02 0C 01 00 B5 A2 BC 86 $84/E861 64 87 00 85 00 00 00 00 00 00 00 00 7C 88 96 E8 2E 8A AF DF 2E 8A C7 DF 24 8A 8C E8 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 84 E8 99 88 DD 8B 02 F3 88 08 00 0A 01 00 B5 A2 BC 86 $84/E89C 64 87 00 87 00 00 00 00 00 00 00 00 7C 88 D1 E8 2E 8A AF DF 2E 8A C7 DF 24 8A C7 E8 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 BF E8 99 88 DD 8B 02 F3 88 02 00 09 01 00 B5 A2 BC 86 $84/E8D7 64 87 00 90 00 00 00 00 00 00 00 00 7C 88 0B E9 2E 8A AF DF 2E 8A C7 DF 24 8A 02 E9 C1 86 89 DF 4E 87 16 4F E0 67 E0 24 87 FA E8 99 88 DD 8B 02 86 89 64 00 01 00 B5 A2 BC 86 $84/E911 2E 8A 07 E0 7C 88 41 E9 24 8A 38 E9 C1 86 89 DF 4E 87 16 04 00 DF A2 04 00 E5 A2 3F 87 24 E9 2E 8A 20 E0 24 87 11 E9 99 88 DD 8B 02 68 89 64 00 2E 8A 32 E0 24 87 11 E9 $84/E949 2E 8A 07 E0 7C 88 79 E9 24 8A 70 E9 C1 86 89 DF 4E 87 16 04 00 EB A2 04 00 F1 A2 3F 87 5C E9 2E 8A 20 E0 24 87 49 E9 99 88 DD 8B 02 A9 89 05 00 2E 8A 32 E0 24 87 49 E9 $84/E981 2E 8A 07 E0 7C 88 B1 E9 24 8A A8 E9 C1 86 89 DF 4E 87 16 04 00 F7 A2 04 00 FD A2 3F 87 94 E9 2E 8A 20 E0 24 87 81 E9 99 88 DD 8B 02 D2 89 05 00 2E 8A 32 E0 24 87 81 E9 $84/E9B9 2E 8A 07 E0 7C 88 E9 E9 24 8A E0 E9 C1 86 89 DF 4E 87 16 04 00 03 A3 04 00 09 A3 3F 87 CC E9 2E 8A 20 E0 24 87 B9 E9 99 88 DD 8B 02 FB 89 05 00 2E 8A 32 E0 24 87 B9 E9 $84/E9F1 64 87 00 80 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 2A EA 24 8A 20 EA C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 10 EA 2E 8A 20 E0 24 87 FD E9 99 88 DD 8B 02 F3 88 00 10 13 2E 8A 32 E0 24 87 FD E9 $84/EA32 64 87 00 8B 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 6B EA 24 8A 61 EA C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 51 EA 2E 8A 20 E0 24 87 3E EA 99 88 DD 8B 02 B0 88 00 10 0E 2E 8A 32 E0 24 87 3E EA $84/EA73 64 87 00 8C 00 03 00 00 00 03 00 00 2E 8A 07 E0 7C 88 AC EA 24 8A A2 EA C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 92 EA 2E 8A 20 E0 24 87 7F EA 99 88 DD 8B 02 B0 88 02 00 0F 2E 8A 32 E0 24 87 7F EA $84/EAB4 64 87 00 84 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 ED EA 24 8A E3 EA C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 D3 EA 2E 8A 20 E0 24 87 C0 EA 99 88 DD 8B 02 F3 88 00 01 0B 2E 8A 32 E0 24 87 C0 EA $84/EAF5 64 87 00 8A 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 2E EB 24 8A 24 EB C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 14 EB 2E 8A 20 E0 24 87 01 EB 99 88 DD 8B 02 F3 88 00 20 0D 2E 8A 32 E0 24 87 01 EB $84/EB36 64 87 00 8D 00 02 00 00 00 02 00 00 2E 8A 07 E0 7C 88 6F EB 24 8A 65 EB C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 55 EB 2E 8A 20 E0 24 87 42 EB 99 88 DD 8B 02 B0 88 01 00 10 2E 8A 32 E0 24 87 42 EB $84/EB77 64 87 00 8F 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 B0 EB 24 8A A6 EB C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 96 EB 2E 8A 20 E0 24 87 83 EB 99 88 DD 8B 02 B0 88 04 00 11 2E 8A 32 E0 24 87 83 EB $84/EBB8 64 87 00 82 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 F1 EB 24 8A E7 EB C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 D7 EB 2E 8A 20 E0 24 87 C4 EB 99 88 DD 8B 02 F3 88 02 00 08 2E 8A 32 E0 24 87 C4 EB $84/EBF9 64 87 00 83 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 39 EC 24 8A 28 EC C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 18 EC 2E 8A 20 E0 24 87 05 EC 99 88 DD 8B 02 9D E2 F3 88 01 00 07 0B 87 E4 D4 91 2E 8A 32 E0 24 87 05 EC $84/EC41 64 87 00 81 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 81 EC 24 8A 70 EC C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 60 EC 2E 8A 20 E0 24 87 4D EC 99 88 DD 8B 02 9D E2 F3 88 20 00 1A 0B 87 BA D5 91 2E 8A 32 E0 24 87 4D EC $84/EC89 64 87 00 89 01 01 00 00 03 03 00 00 2E 8A 07 E0 7C 88 C1 EC 24 8A B8 EC C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 A8 EC 2E 8A 20 E0 24 87 95 EC 99 88 DD 8B 02 41 89 00 80 2E 8A 32 E0 24 87 95 EC $84/ECC9 64 87 00 8E 00 01 00 00 00 01 00 00 2E 8A 07 E0 7C 88 02 ED 24 8A F8 EC C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 E8 EC 2E 8A 20 E0 24 87 D5 EC 99 88 DD 8B 02 B0 88 08 00 12 2E 8A 32 E0 24 87 D5 EC $84/ED0A 64 87 00 88 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 42 ED 24 8A 39 ED C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 29 ED 2E 8A 20 E0 24 87 16 ED 99 88 DD 8B 02 1A 89 00 40 2E 8A 32 E0 24 87 16 ED $84/ED4A 64 87 00 86 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 83 ED 24 8A 79 ED C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 69 ED 2E 8A 20 E0 24 87 56 ED 99 88 DD 8B 02 F3 88 00 02 0C 2E 8A 32 E0 24 87 56 ED $84/ED8B 64 87 00 85 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 C4 ED 24 8A BA ED C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 AA ED 2E 8A 20 E0 24 87 97 ED 99 88 DD 8B 02 F3 88 08 00 0A 2E 8A 32 E0 24 87 97 ED $84/EDCC 64 87 00 87 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 05 EE 24 8A FB ED C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 EB ED 2E 8A 20 E0 24 87 D8 ED 99 88 DD 8B 02 F3 88 02 00 09 2E 8A 32 E0 24 87 D8 ED $84/EE0D 64 87 00 90 00 00 00 00 00 00 00 00 2E 8A 07 E0 7C 88 45 EE 24 8A 3C EE C1 86 89 DF 4E 87 16 4F E0 67 E0 3F 87 2C EE 2E 8A 20 E0 24 87 19 EE 99 88 DD 8B 02 86 89 64 00 2E 8A 32 E0 24 87 19 EE $84/EE4D A9 08 00 LDA #$0008 A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE50 80 0D BRA $0D [$EE5F] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE52 A9 0A 00 LDA #$000A A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE55 80 08 BRA $08 [$EE5F] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE57 A9 0C 00 LDA #$000C A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE5A 80 03 BRA $03 [$EE5F] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE5C A9 0E 00 LDA #$000E A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE5F BB TYX A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE60 9F 0C DF 7E STA $7EDF0C,x[$7E:DF1E] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE64 BE 87 1C LDX $1C87,y[$88:1D2F] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE67 A9 45 00 LDA #$0045 A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE6A 20 B4 82 JSR $82B4 [$88:82B4] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE6D AF 1A D9 7E LDA $7ED91A[$7E:D91A] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE71 1A INC A A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE72 8F 1A D9 7E STA $7ED91A[$7E:D91A] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE76 60 RTS A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE77 A9 08 00 LDA #$0008 A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE7A 80 0D BRA $0D [$EE89] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE7C A9 0A 00 LDA #$000A A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE7F 80 08 BRA $08 [$EE89] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE81 A9 0C 00 LDA #$000C A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE84 80 03 BRA $03 [$EE89] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE86 A9 0E 00 LDA #$000E A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE89 BB TYX A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE8A 9F 0C DF 7E STA $7EDF0C,x[$7E:DF1E] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE8E BE 87 1C LDX $1C87,y[$88:1D2F] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE91 A9 45 C0 LDA #$C045 A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE94 20 B4 82 JSR $82B4 [$88:82B4] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE97 BE 87 1C LDX $1C87,y[$88:1D2F] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE9A BF 02 00 7F LDA $7F0002,x[$7F:0014] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EE9E 99 17 1E STA $1E17,y[$88:1EBF] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEA1 AF 1A D9 7E LDA $7ED91A[$7E:D91A] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEA5 1A INC A A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEA6 8F 1A D9 7E STA $7ED91A[$7E:D91A] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEAA 60 RTS A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEAB AD 78 0A LDA $0A78 [$88:0A78] find PLM at this location, if none then break >.> $84/EEAE D0 1C BNE $1C [$EECC] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEB0 BB TYX A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEB1 BD 87 1C LDA $1C87,x[$88:1C99] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEB4 9E 87 1C STZ $1C87,x[$88:1C99] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEB7 A2 4E 00 LDX #$004E A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEBA DD 87 1C CMP $1C87,x[$88:1C99] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEBD F0 05 BEQ $05 [$EEC4] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEBF CA DEX A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEC0 CA DEX A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEC1 10 F7 BPL $F7 [$EEBA] A:0010 X:0012 Y:00A8 P:envmxdizC $84/EEC3 00 RANDOM 00 *COULD BREAK STUFF* $84/EEC4 A9 FF 00 LDA #$00FF A:0490 X:000C Y:0098 P:envmxdizc $84/EEC7 9D 77 1D STA $1D77,x[$88:1D83] A:0490 X:000C Y:0098 P:envmxdizc $84/EECA 18 CLC A:0490 X:000C Y:0098 P:envmxdizc $84/EECB 60 RTS A:0490 X:000C Y:0098 P:envmxdizc $84/EECC A9 00 00 LDA #$0000 A:0490 X:000C Y:0098 P:envmxdizc $84/EECF 99 37 1C STA $1C37,y[$88:1CCF] delete PLM $84/EED2 60 RTS $84/AAE3 86BC delete plm wtf? 874E 06 set 06 to $1D77 0004 92A3 this is a block breaking animation... ? 04, 00, 53, 00, 53, 00, 53, 00, 53, 00, 00, 00, 0004 92AF 04, 00, 54, 00, 54, 00, 54, 00, 54, 00, 00, 00, 0004 92BB 04, 00, 55, 00, 55, 00, 55, 00, 55, 00, 00, 00 0004 9297 04, 00, FF, 00, FF, 00, FF, 00, FF, 00, 00, 00, AB00 add room's width*2 to PLM's location in room 873F Decrement 7E:1D77,X. If not 0, use the address given by the argument as the next instruction. AAE8 loop back to animation start 86BC delete plm HEADER LOCATION | DESCRIPTION | | INITIATION POINTER | | | RUNNING CODE POINTER | | | | EED3 UNKNOWN *BROKEN* AB EE E3 AA EED7 E-TANK OPEN 4D EE 99 E0 EEDB MISSILE OPEN 52 EE BE E0 EEDF SM OPEN 57 EE E3 E0 EEE3 PB OPEN 5C EE 08 E1 EEE7 BOMBS OPEN 64 EE 2D E1 EEEB CHARGE OPEN 64 EE 5B E1 EEEF ICE OPEN 64 EE 89 E1 EEF3 HIJUMP OPEN 64 EE B7 E1 EEF7 SB OPEN 64 EE E5 E1 EEFB WAVE OPEN 64 EE 13 E2 EEFF SPAZER OPEN 64 EE 41 E2 EF03 SPRINGBALL OPEN 64 EE 6F E2 EF07 VARIA OPEN 64 EE A1 E2 EF0B GRAVITY OPEN 64 EE D6 E2 EF0F XRAY OPEN 64 EE 0B E3 EF13 PLASMA OPEN 64 EE 38 E3 EF17 GRAPPLE OPEN 64 EE 66 E3 EF1B SJ OPEN 64 EE 93 E3 EF1F SA OPEN 64 EE C1 E3 EF23 MORPH OPEN 64 EE EF E3 EF27 RESERVE OPEN 64 EE 1D E4 EF2B E-TANK BALL 4D EE 4A E4 EF2F MISSILE BALL 52 EE 7C E4 EF33 SM BALL 57 EE AE E4 EF37 PB BALL 5C EE E0 E4 EF3B BOMBS BALL 64 EE 12 E5 EF3F CHARGE BALL 64 EE 4D E5 EF43 ICE BALL 64 EE 88 E5 EF47 HIJUMP BALL 64 EE C3 E5 EF4B SB BALL 64 EE FE E5 EF4F WAVE BALL 64 EE 42 E6 EF53 SPAZER BALL 64 EE 7D E6 EF57 SPRINGBALL BALL 64 EE B8 E6 EF5B VARIA BALL 64 EE F3 E6 EF5F GRAVITY BALL 64 EE 35 E7 EF63 X-RAY BALL 64 EE 77 E7 EF67 PLASMA BALL 64 EE B1 E7 EF6B GRAPPLE BALL 64 EE EC E7 EF6F SJ BALL 64 EE 26 E8 EF73 SA BALL 64 EE 61 E8 EF77 MORPH BALL 64 EE 9C E8 EF7B RESERVE BALL 64 EE D7 E8 EF7F E-TANK HIDDEN 77 EE 11 E9 EF83 MISSILES HIDDEN 7C EE 49 E9 EF87 SM HIDDEN 81 EE 81 E9 EF8B PB HIDDEN 86 EE B9 E9 EF8F BOMBS HIDDEN 8E EE F1 E9 EF93 CHARGE HIDDEN 8E EE 32 EA EF97 ICE HIDDEN 8E EE 73 EA EF9B HIJUMP HIDDEN 8E EE B4 EA EF9F SB HIDDEN 8E EE F5 EA EFA3 WAVE HIDDEN 8E EE 36 EB EFA7 SPAZER HIDDEN 8E EE 77 EB EFAB SPRINGBALL HIDDEN 8E EE B8 EB EFAF VARIA HIDDEN 8E EE F9 EB EFB3 GRAVITY HIDDEN 8E EE 41 EC EFB7 X-RAY HIDDEN 8E EE 89 EC EFBB PLASMA HIDDEN 8E EE C9 EC EFBF GRAPPLE HIDDEN 8E EE 0A ED EFC3 SJ HIDDEN 8E EE 4A ED EFC7 SA HIDDEN 8E EE 8B ED EFCB MORPH HIDDEN 8E EE CC ED EFCF RESERVE HIDDEN 8E EE 0D EE [17:26] hihi Sadi :D [17:28] I haz a PLM question, if you don't mind my asking [17:28] rawr! [17:29] lol [17:30] well, I would like to add a 3rd animation frame to regular items. I've already figured out how to alter the routine @ $848764 to transfer the gfx properly (I think) [17:30] but I don't know how it decides which frame to show when [17:31] you mean upgrades? [17:31] suit upgrades and beams [17:31] yer. item plms [17:32] * crashed is going to rewrite all the plms to free up CRE space as well [17:32] you'll have to change the routine a bit to load more GFX, then also repoint a shitload of PLMs so you can add another 4 bytes to each one [17:32] then you have to reorganise all of the PLM GFX in bank $89 [17:32] so you have 3 tiles per PLM [17:32] yep [17:33] and that's pretty much it [17:33] and actually, if I alter 8764 I can repoint the gfx anywhere in the ROM ;) [17:33] well that too :P [17:33] since it's using the $D0 table for gfx transfer lol [17:34] so it's just a matter of adding another 4 bytes for palette stuffs to each PLM? [17:34] well, and altering the table @ 87CD (VRAM target address) [17:35] I'm pretty sure that it's because of that table (and VRAM space) that you can only have 4 different item PLMs in the same room [17:37] you can yes [17:37] or rather [17:38] theres only space to load 4 extra PLMs from the rom [17:38] any PLMs that are already in the CRE table dont count [17:38] so, you can have an ET, PB, missile and super in one room, and also up to 4 other upgrades [17:39] if you wanted to go all out, you could add every PLM to the CRE table, then you could have as many items in a room as you likes [17:39] yeh, but since I'll be changing those to be like the ones with gfx in the ROM... eh, I don't plan on having more than 1 item in any room anyway [17:40] haha I think that might be a little overboard there with ALL the item upgrades in CRE XD [17:42] my new plan is to use all that extra space in CRE (after putting all item PLMs in ROM and having door enemies) for animated tiles in every area ;=============================== ;==== PLM EetupComments.txt ==== ;=============================== entry information: 16 bit A: doesn't matter 16 bit X: pointer to a plm 16 bit Y: doesn't matter DB: doesn't matter terminology: plm: a single post-load modification. consists of a command, coordinates, and arguments. (1 word per component for a total of 6 bytes) plm command: really a pointer to the tables of subroutine pointer pairs in bank $84. =====[ plm preprocessing ]=================================================== ; First, some housekeeping. 84/846A: 08 PHP ; Push P, DBR, Y, and X onto the stack for use 84/846B: 8B PHB ; when exitting the subroutine. This is done 84/846C: 5A PHY ; because we have no idea which routine will be 84/846D: DA PHX ; calling us and if they'll be needing these values again. 84/846E: 4B PHK ; Set DBR to $84 by pushing the PBR... 84/846F: AB PLB ; ...and then pulling it into the DBR. ; OK, let's try to find an empty parking space in RAM to put this PLM's data. 84/8470: A04E00 LDY #$004E ; This is the size of the PLM workspaces in ; RAM. Each chunk of PLM workspace stores a ; different type of PLM data, but they're all ; 50h bytes in size. So if they're 50h bytes in ; size, why the hell does this say 4Eh? Because ; a) 0000h is the first number and ; b) a 16-bit LDA aimed at byte 4Eh will load both ; byte 4Eh and byte 4Fh. ; This is the PLM workspace index. 84/8473: B9371C LDA $1C37,Y ; Load from the PLM command workspace in RAM. <<<--------------------------. 84/8476: F00A BEQ $8482 ; Is what we loaded 0000h? Then we've found an empty spot. Branch! ----. | 84/8478: 88 DEY ; Since this one seems to be taken, let's subtract 2 | | 84/8479: 88 DEY ; from the index value so we can try the next one. | | 84/847A: 10F7 BPL $8473 ; Loop back and try the next one if the index value is still positive. ----' | ; We'll wind up here if all the PLM workspace is already used up. Uh-oh. | ; Better exit and tell whichever subroutine called us that we've failed. | | 84/847C: FA PLX ; Time to return! Pull to X! | 84/847D: 7A PLY ; Y! | 84/847E: AB PLB ; DBR! | 84/847F: 28 PLP ; P! | 84/8480: 38 SEC ; Set Carry because someone's stupid and is trying to use too many PLM commands. | 84/8481: 6B RTL ; Alright, we're done. | | ............................................................................. | | ; Calculate the location of the target tile's layer 1 data. Store it. | | 84/8482: E220 SEP #$20 ; We want an 8 bit A for this. <<<------------------------------------' 84/8484: BF03008F LDA $8F0003,X ; Load the number of rows to go down and put 84/8488: 8D0242 STA $4202 ; it into the first multiplication register. ; NOTE: That LDA $8F0003,X doesn't have to load from bank $8F. It can also load from LowRAM. ; Just store your PLM command, coords, and args one after the other into LowRAM and then ; set X to the beginning of your PLM in LowRAM. In fact, this is how the DDBs make PLM calls. ; They store the command in $0012, the coords in $0014, and then put #$0012 into X before ; invoking the PLM preprocessing subroutine. Sneaky. LoROM is fun! 84/848B: ADA507 LDA $07A5 ; Load "room width * 16t"(calculated during mdb load) and put it 84/848E: 8D0342 STA $4203 ; into the other multiplication register. 84/8491: BF02008F LDA $8F0002,X ; Load the number of columns to go over. 84/8495: C220 REP #$20 ; Back to a normal 16 bit A again. 84/8497: 29FF00 AND #$00FF ; Limit the number of columns to go over to FFh. 84/849A: 18 CLC ; Clear Carry while we wait for the multiplication result. 84/849B: 6D1642 ADC $4216 ; Add A with the hardware mult result and 84/849E: 0A ASL A ; multiply it by two(because the layer 1 map is in words, remember). 84/849F: 99871C STA $1C87,Y ; You now have the coords for a 16x16 tile in bytes, so let's store it. ; Store the arguments and the command. 84/84A2: BF04008F LDA $8F0004,X ; Load the arguments. 84/84A6: 99C71D STA $1DC7,Y ; Store the arguments. 84/84A9: BF00008F LDA $8F0000,X ; Load the command. 84/84AD: 99371C STA $1C37,Y ; Store the command. ; Let's switch some register contents around. ; When done, X will contain the PLM index. ; When done, Y will contain the PLM command. 84/84B0: BB TYX ; Transfer Y to X. 84/84B1: A8 TAY ; Transfer A to Y. ; I don't understand what this is for yet. It's preparing some workspace in RAM. 84/84B2: A90000 LDA #$0000 ; We like null! 84/84B5: 9F0CDF7E STA $7EDF0C,X ; We like to put it here. 84/84B9: A9E684 LDA #$84E6 ; We also like the value 84E6! 84/84BC: 9DD71C STA $1CD7,X ; So, let's put it here! ; There's at least two subroutine pointers for every PLM command. ; The first one is the subroutine which actually makes the mods ; to RAM. I don't yet know for certain what the second one is for, ; but this loads it and stores it. 84/84BF: B90200 LDA $0002,Y ; Use the PLM command to fetch the second subroutine pointer 84/84C2: 9D271D STA $1D27,X ; and stick it here. ; More workspace prep. 84/84C5: A90100 LDA #$0001 ; We like the value 0001! 84/84C8: 9F1CDE7E STA $7EDE1C,X ; Let's stick it here for some reason! 84/84CC: A9A08D LDA #$8DA0 ; Oh, we like the value 8DA0 too! 84/84CF: 9F6CDE7E STA $7EDE6C,X ; Let's put it here! 84/84D3: 9E771D STZ $1D77,X ; Let's store some null in here! ; Swap X and Y. 84/84D6: 8E271C STX $1C27 ; Store X, put Y in X, and load the stored X into Y. 84/84D9: BB TYX ; A X/Y switch is needed because indirect indexed JSR 84/84DA: AC271C LDY $1C27 ; can only use the X register. ; Execute the PLM command. The PLM commands are pointers to ; subroutine pointers. This type of JSR will use whatever is ; at the pointer's destination as the subroutine to call. ; EXAMPLE: PLM command: DEAD ; $84:DEAD: BEEF ; subroutine called: $84:BEEF ; NOTE: Example values are not in reverse byte order. ; In the ROM, the PLM command DEAD would be stored as ; ADDE and the subroutine pointer at $84:DEAD would be ; stored as EFBE. 84/84DD: FC0000 JSR ($0000,X) ; Summon the subroutine! ; Now that the subroutine has returned, we're finished. ; Clean up, tell our parent subroutine that we were successful, and return. 84/84E0: FA PLX ; Time to return! Pull to X! 84/84E1: 7A PLY ; Y! 84/84E2: AB PLB ; DBR! 84/84E3: 28 PLP ; P! 84/84E4: 18 CLC ; Clear Carry to signal our success. 84/84E5: 6B RTL ; Alright, we're done. ============================================================================= /////////////////////////////////////////////////////////////////////////// ////////// An Example PLM Command: plm_cmd_mapstation ////////// /////////////////////////////////////////////////////////////////////////// entry info: 16-bit A: 8DA0 16-bit X: plm command 16-bit Y: plm index value DBR: 84 1C37,index: plm command 1C87,index: ram mod address 1CD7,index: 84E6 1D27,index: second subroutine pointer 1D77,index: 0000 1DC7,index: arguments DE1C,index: 0001 DE6C,index: 8DA0 DF0C,index: 0000 =====[ map station ]========================================================= ; We're gonna place the important parts of a map station. ; First, let's make sure the tile has the right properties set. 84/B18B: BE871C LDX $1C87,Y ; X = mod address. 84/B18E: BF02007F LDA $7F0002,X ; Load the target tile's data from RAM. 84/B192: 29FF0F AND #$0FFF ; The first 12 bits are are the 16x16 tile to use, IIRC. ; Let's keep them the same. 84/B195: 090080 ORA #$8000 ; Let's set the highest nibble(16x16's properties) to 8. 84/B198: 9F02007F STA $7F0002,X ; Let's put it back where we found it. ; Now I guess this is checking to see if the map station has already been ; accessed by the player or not. 84/B19C: AE9F07 LDX $079F ; X = region number. 84/B19F: BF08D97E LDA $7ED908,X ; Let's load the station's byte. 84/B1A3: 29FF00 AND #$00FF ; AND it so that only our desired byte is present. 84/B1A6: D019 BNE $B1C1 ; If the station's already been used(byte != 0), branch. ----. | ; We're here because the map station hasn't yet been accessed. | ; Let's finish placing the station. | | 84/B1A8: BE871C LDX $1C87,Y ; X = mod address | 84/B1AB: E8 INX ; Now, it's... | 84/B1AC: E8 INX ; ...mod address + 2. (one 16x16 to the right) | 84/B1AD: A947B0 LDA #$B047 ; Load the mod values. The high byte is the 16x16 type you | ; wish to set the target tile to. It should be x0, where x | ; is the 16x16 type(in this example, B0). The low byte | ; is the target tile's new BTS data. | ; NOTE: When stored, it will be stored in reverse byte | ; order. | 84/B1B0: 20B482 JSR $82B4 ; Call the alter map subroutine. | 84/B1B3: BE871C LDX $1C87,Y ; X = mod address again | 84/B1B6: CA DEX ; Now it's | 84/B1B7: CA DEX ; 2 16x16s | 84/B1B8: CA DEX ; left of | 84/B1B9: CA DEX ; mod address. | 84/B1BA: A948B0 LDA #$B048 ; Load the mod values | 84/B1BD: 20B482 JSR $82B4 ; Call the alter map subroutine. | 84/B1C0: 60 RTS ; Return. | | ; We're here because the map station has already been accessed. | ; We'd better do this. | | 84/B1C1: A976AD LDA #$AD76 ; Let's go ahead and change <<<------------------------------' 84/B1C4: 99271D STA $1D27,Y ; the second subroutine pointer. 84/B1C7: 60 RTS ; Return. entry info: 16-bit A: tile mod values 16-bit X: mod address 16-bit Y: plm index =====[ alter map ]=========================================================== ; This subroutine gets used a lot, by pretty much every PLM command. ; First, prepare a little. 84/82B4: DA PHX ; Let's back up that mod address. 84/82B5: 8512 STA $12 ; Let's stick the tile mod values in $0012. ; Let's change the 16x16's properties. 84/82B7: E220 SEP #$20 ; 8 bit A. 84/82B9: BF03007F LDA $7F0003,X ; Load the second byte of the 16x16 we want to mod. 84/82BD: 290F AND #$0F ; Cut off the 16x16's properties. 84/82BF: 0513 ORA $13 ; Replace them with some of our own. 84/82C1: 9F03007F STA $7F0003,X ; Store it. 84/82C5: C220 REP #$20 ; 16 bit A. ; Let's get the address for the mod tile's BTS byte. 84/82C7: 8A TXA ; Put X into A so we can... 84/82C8: 4A LSR A ; ...divide it by 2 and then... 84/82C9: AA TAX ; ...put it back in X. ; Let's change the 16x16's BTS data. 84/82CA: E220 SEP #$20 ; 8 bit A. 84/82CC: A512 LDA $12 ; Load our own BTS data. 84/82CE: 9F02647F STA $7F6402,X ; Put it where it belongs. 84/82D2: C220 REP #$20 ; 16 bit A. ; OK, return. 84/82D4: FA PLX ; Restore X. 84/82D5: 60 RTS ; Back we go.