Difference between revisions of "G-Mode Save Station"

From A complete guide to Super Metroid speedrunning
Jump to: navigation, search
(words)
(Relevant Locations)
Line 13: Line 13:
 
$1D27 through $1D75 in RAM, though $1D75 seems to be the relevant address.
 
$1D27 through $1D75 in RAM, though $1D75 seems to be the relevant address.
  
Bank $84 instruction list locations for individual items. Note that the value shown at left is not the correct pointer address to watch for in RAM but the start of the list, nor is the PLM ID number shown at right. The pointer to collect the item is near the end of each list and is $88F3 (pointer to the function $8488F3, which collects the item and displays the message box), followed by two bytes for the equipment value, and one byte for the message box number.
+
Pointer locations for collecting items. When watching $1D75 in RAMwatch, it should contain the following location in order to obtain the item:
  
    ;;; $E099: Instruction list - PLM $EED7 (energy tank) ;;;
+
<nowiki>
     ;;; $E0BE: Instruction list - PLM $EEDB (missile tank) ;;;
+
Energy Tank     $E0B6
    ;;; $E0E3: Instruction list - PLM $EEDF (super missile tank) ;;;
+
Missile         $E0D6
    ;;; $E108: Instruction list - PLM $EEE3 (power bomb tank) ;;;
+
Super Missile  $E100
    ;;; $E12D: Instruction list - PLM $EEE7 (bombs) ;;;
+
Bomb $E152
    ;;; $E15B: Instruction list - PLM $EEEB (charge beam) ;;;
+
Charge Beam $E180
    ;;; $E189: Instruction list - PLM $EEEF (ice beam) ;;;
+
Ice Beam $E1AE
    ;;; $E1B7: Instruction list - PLM $EEF3 (hi-jump) ;;;
+
Hi-Jump Boots $E1DC
    ;;; $E1E5: Instruction list - PLM $EEF7 (speed booster) ;;;
+
Speed Booster $E20A
    ;;; $E213: Instruction list - PLM $EEFB (wave beam) ;;;
+
Wave Beam $E238
    ;;; $E241: Instruction list - PLM $EEFF (spazer beam) ;;;
+
Spazer $E266
    ;;; $E26F: Instruction list - PLM $EF03 (spring ball) ;;;
+
Spring Ball $E294
    ;;; $E29D: Instruction - clear charge beam counter ;;;
+
Varia Suit $E2C8
    ;;; $E2A1: Instruction list - PLM $EF07 (varia suit) ;;;
+
Gravity Suit $E2F6
    ;;; $E2D6: Instruction list - PLM $EF0B (gravity suit) ;;;
+
Plasma Beam $E358
    ;;; $E30B: Instruction list - PLM $EF0F (x-ray scope) ;;;
+
Grapple Beam $E386
    ;;; $E338: Instruction list - PLM $EF13 (plasma beam) ;;;
+
Space Jump $E3B8
    ;;; $E366: Instruction list - PLM $EF17 (grapple beam) ;;;
+
Screw Attack $E3E6
    ;;; $E393: Instruction list - PLM $EF1B (space jump) ;;;
+
Morphing Ball $E414
    ;;; $E3C1: Instruction list - PLM $EF1F (screw attack) ;;;
+
Reserve Tank $E442
    ;;; $E3EF: Instruction list - PLM $EF23 (morph ball) ;;;
+
</nowiki>
    ;;; $E41D: Instruction list - PLM $EF27 (reserve tank) ;;;
 
    ;;; $E44A: Instruction list - PLM $EF2B (energy tank, chozo orb) ;;;
 
    ;;; $E47C: Instruction list - PLM $EF2F (missile tank, chozo orb) ;;;
 
    ;;; $E4AE: Instruction list - PLM $EF33 (super missile tank, chozo orb) ;;;
 
    ;;; $E4E0: Instruction list - PLM $EF37 (power bomb tank, chozo orb) ;;;
 
    ;;; $E512: Instruction list - PLM $EF3B (bombs, chozo orb) ;;;
 
    ;;; $E54D: Instruction list - PLM $EF3F (charge beam, chozo orb) ;;;
 
    ;;; $E588: Instruction list - PLM $EF43 (ice beam, chozo orb) ;;;
 
    ;;; $E5C3: Instruction list - PLM $EF47 (hi-jump, chozo orb) ;;;
 
    ;;; $E5FE: Instruction list - PLM $EF4B (speed booster, chozo orb) ;;;
 
    ;;; $E63B: Instruction - FX Y velocity = FFE0h ;;;
 
    ;;; $E642: Instruction list - PLM $EF4F (wave beam, chozo orb) ;;;
 
    ;;; $E67D: Instruction list - PLM $EF53 (spazer beam, chozo orb) ;;;
 
    ;;; $E6B8: Instruction list - PLM $EF57 (spring ball, chozo orb) ;;;
 
    ;;; $E6F3: Instruction list - PLM $EF5B (varia suit, chozo orb) ;;;
 
    ;;; $E735: Instruction list - PLM $EF5F (gravity suit, chozo orb) ;;;
 
    ;;; $E777: Instruction list - PLM $EF63 (x-ray scope, chozo orb) ;;;
 
    ;;; $E7B1: Instruction list - PLM $EF67 (plasma beam, chozo orb) ;;;
 
    ;;; $E7EC: Instruction list - PLM $EF6B (grapple beam, chozo orb) ;;;
 
    ;;; $E826: Instruction list - PLM $EF6F (space jump, chozo orb) ;;;
 
    ;;; $E861: Instruction list - PLM $EF73 (screw attack, chozo orb) ;;;
 
    ;;; $E89C: Instruction list - PLM $EF77 (morph ball, chozo orb) ;;;
 
    ;;; $E8D7: Instruction list - PLM $EF7B (reserve tank, chozo orb) ;;;
 
    ;;; $E911: Instruction list - PLM $EF7F (energy tank, shot block) ;;;
 
    ;;; $E949: Instruction list - PLM $EF83 (missile tank, shot block) ;;;
 
    ;;; $E981: Instruction list - PLM $EF87 (super missile tank, shot block) ;;;
 
    ;;; $E9B9: Instruction list - PLM $EF8B (power bomb tank, shot block) ;;;
 
    ;;; $E9F1: Instruction list - PLM $EF8F (bombs, shot block) ;;;
 
    ;;; $EA32: Instruction list - PLM $EF93 (charge beam, shot block) ;;;
 
    ;;; $EA73: Instruction list - PLM $EF97 (ice beam, shot block) ;;;
 
    ;;; $EAB4: Instruction list - PLM $EF9B (hi-jump, shot block) ;;;
 
    ;;; $EAF5: Instruction list - PLM $EF9F (speed booster, shot block) ;;;
 
    ;;; $EB36: Instruction list - PLM $EFA3 (wave beam, shot block) ;;;
 
    ;;; $EB77: Instruction list - PLM $EFA7 (spazer beam, shot block) ;;;
 
    ;;; $EBB8: Instruction list - PLM $EFAB (spring ball, shot block) ;;;
 
    ;;; $EBF9: Instruction list - PLM $EFAF (varia suit, shot block) ;;;
 
    ;;; $EC41: Instruction list - PLM $EFB3 (gravity suit, shot block) ;;;
 
    ;;; $EC89: Instruction list - PLM $EFB7 (x-ray scope, shot block) ;;;
 
    ;;; $ECC9: Instruction list - PLM $EFBB (plasma beam, shot block) ;;;
 
    ;;; $ED0A: Instruction list - PLM $EFBF (grapple beam, shot block) ;;;
 
    ;;; $ED4A: Instruction list - PLM $EFC3 (space jump, shot block) ;;;
 
    ;;; $ED8B: Instruction list - PLM $EFC7 (screw attack, shot block) ;;;
 
    ;;; $EDCC: Instruction list - PLM $EFCB (morph ball, shot block) ;;;
 
    ;;; $EE0D: Instruction list - PLM $EFCF (reserve tank, shot block) ;;;
 
 
 
TODO: put the correct pointer value for each list here
 
  
 
== External Links ==
 
== External Links ==
  
 
[[https://patrickjohnston.org/bank/84 Bank log for $84]]
 
[[https://patrickjohnston.org/bank/84 Bank log for $84]]

Revision as of 06:01, 6 April 2023

During G-Mode, the game behaves in some ways as though X-ray scope were still active. The most noticeable are that the game does not process PLMs or projectiles. Stepping on a save station in G-Mode, and subsequently activating X-Ray to leave G-Mode, can execute a wide amount of code, most often crashing the game if done blindly, but can grant Samus any item in the game. This is used in the Glitched RBO world record route to obtain Gravity Suit.

Functioning

The game stores lists for each PLM, located in bank $84, of pointers to functions, and arguments for those functions. These are called instruction lists. There is a section of RAM from $1D27 through $1D76 where the game loads these pointers for running functions related to processing PLMs. For the save station, the pointer is loaded into $1D75 (probably because the game starts at the top of this range and works downwards. Since save rooms have two PLMs that are processed when entering the room: first the door, and then the save station. TODO: fact check this). In G-Mode PLMs aren't processed, and when Samus steps on the save station, $1D75 starts increasing by $02 every other frame, starting with whatever PLM instruction the game was last trying to execute. When entering a save room, $1D75 will contain $AFEC, which is the sleep instruction.

When X-Ray is activated, and G-Mode left, the game will look at whatever value is in $1D75, and interpret those two bytes as a location of a pointer in bank $84. This means that for collecting items, you'll need to stop on a correct byte in order to be granted the item. Every item in the game has three variants: normal, hidden, and in a chozo orb; and either of these will work for obtaining the item. However, the instruction lists for these variants are so far apart in the ROM that it is irrelevant. Therefore, using the one that appears first in the ROM (the normal, not hidden or orb variant) makes the most sense, since the game will either crash or do something else unexpected if X-Ray is not pressed in the two-frame window.

It is also possible to spawn energy refill and map stations (though unusable as they will spawn too close to the floor, on the left tile of the bottom of the save station), Samus Eaters (Vileplumes), shot blocks, door caps, and basically any other PLM. It is also possible to execute a lot of other code, with mostly unknown or undocumented results (or most likely, a crash).

Relevant Locations

$1D27 through $1D75 in RAM, though $1D75 seems to be the relevant address.

Pointer locations for collecting items. When watching $1D75 in RAMwatch, it should contain the following location in order to obtain the item:

Energy Tank     $E0B6
Missile	        $E0D6
Super Missile   $E100
Bomb 		$E152
Charge Beam 	$E180
Ice Beam	$E1AE
Hi-Jump Boots 	$E1DC
Speed Booster	$E20A
Wave Beam	$E238
Spazer		$E266
Spring Ball	$E294
Varia Suit	$E2C8
Gravity Suit	$E2F6
Plasma Beam	$E358
Grapple Beam	$E386
Space Jump	$E3B8
Screw Attack	$E3E6
Morphing Ball	$E414
Reserve Tank	$E442

External Links

[Bank log for $84]