SSBM Icon.png

Infinite Super Scope glitch

From SmashWiki, the Super Smash Bros. wiki
Revision as of 07:23, December 12, 2022 by 109.166.136.84 (talk)
Jump to navigationJump to search

The Infinite Super Scope glitch is a glitch in Super Smash Bros. Melee that allows players to shoot the Super Scope a seemingly infinite number of times, including charged shots. This is simply a name used to popularize the glitch, however, as the Infinite Super Scope glitch does not give the Super Scope truly infinite ammo; rather, it gives it a ridiculously large number of shots to the Super Scope, giving the idea of infinite ammo.

How to perform

First, the player must grab a Super Scope with full ammo and fire 15 individual shots with it. Since tapping the A button once results in a volley of three shots every time, this can be done by pressing it 5 times. Following this, the player must fire two fully charged shots from the Super Scope, and finally, charge one more shot and have someone attack them before they fire, neither too early nor too late. After this, the glitch should be triggered.

Explanation

The Infinite Super Scope Glitch occurs when the code loop to adjust the size and ammo of the Super Scope projectile runs to completion, instead of terminating abruptly which is how the programmers intended.

The aforementioned loop in the code contains a "switch", used in programming to specify behavior based on integer IDs, which correspond to Super Scope ammo here; if none of the expected ammunition values match, the default case is executed, which, in this scenario, is undefined behavior, and makes the game return a value of "nothing" against expectations.

The peculiar setup to fire 2 fully charged shots and 15 rapid-fire shots results in the remaining ammunition value not matching any of the switch cases, and thus, the "size increase, ammo decrement" function returns the same value that was entered when it was called; in this case, instead of a returning an expected integer number, the function exits without setting the "return register" which, when calling it, contains the pointer to the memory location of Super Scope's item object.

Because pointers in the PowerPC architecture (which the GameCube's CPU is built upon) generally lead to an area between the 0x80000000 and 0x81700000 range, the erroneously returned pointer is around the value 0x80D00000, which the game interprets as a "signed 32-bit integer," making this value read around negative 2.1 billion.

When the next function subtracts a proper integer from this value (except if it is exactly -1), the sign bit of the integer is flipped; in other words, it rolls over the negative number marker, and becomes positive. Thus, the user now has around 2.1 billion Super Scope ammunition.

The exact amount of ammunition regained from performing the Infinite Super Scope Glitch varies depending on how memory is allocated, which is influenced by the stage, characters, costumes, music, etc. that are loaded.

The Infinite Super Scope glitch is most well-known as being a necessary step in completing the black hole glitch.

Video

Trivia