Coin limit: Difference between revisions

Jump to navigation Jump to search
1,312 bytes removed ,  24 January 2023
No edit summary
 
(17 intermediate revisions by 10 users not shown)
Line 1: Line 1:
Note: Code shown in this section is recreated and may not be the exact code used by the game
{{rewrite}}
 
A '''coin limit''' is the maximum number of coins that can be collected or saved in a given area. Some courses allow infinite coins to be collected. However, in the NTSC (American) version, the coin counter is programmed to stay at the maximum of 999.
A '''coin limit''' is the maximum number of coins that can be collected or saved in a given area. Some courses allow infinite coins to be collected. However, in the NTSC (American) version, the coin counter is programmed to stay at the maximum of 999.


Line 7: Line 6:
==The 999 coin limit==
==The 999 coin limit==
The limit is intentionally put in by the programmers to prevent the game to count up coins greater than 999:
The limit is intentionally put in by the programmers to prevent the game to count up coins greater than 999:
 
  if (gMarioState->numCoins > 999) {
  if(coin_counter > 999) {
    gMarioState->numCoins = 999;
coin_counter := 999;
  }
  }
 
When Mario reaches the 999 coin limit, the coins are no longer counted and collecting a coin only makes noise if the value of the global timer is odd.
==The 255 coin limit==
==The 255 coin limit==
Separately, there is an unintentional coin limit involving the saved coin score. This value overflows and is set to 0 if the number of coins Mario collected in the course is a multiple of 256. (Not within the course, but when recording the saved coin score after Mario exits the course.) Thus, the easiest way to obtain the highest possible saved coin score in a level is to simply collect 255 coins. 511 and 767 also produce a saved coin score of 255, but collecting more than 255 coins is not as efficient as collecting a star when 255 coins have been collected. 1,023, 1,279, etc. also save as 255, but these coin scores cannot be obtained in the NTSC version.
Separately, there is an unintentional coin limit involving the saved coin score. This value overflows and is set to 0 if the number of coins Mario collected in the course is a multiple of 256. (Not within the course, but when recording the saved coin score after Mario exits the course.) Thus, the easiest way to obtain the highest possible saved coin score in a level is to simply collect 255 coins. 511 and 767 also produce a saved coin score of 255, but collecting more than 255 coins is not as efficient as collecting a star when 255 coins have been collected. 1,023, 1,279, etc. also save as 255, but these coin scores cannot be obtained in the NTSC version.
Line 18: Line 16:
Normally, the number of available coins in the course prevents the player from getting an excess number of coins to reach either of the coin limits. Nonetheless, there are ways for a player to perform infinite coin glitches such as moneybag duplication, [[cloning]] or utilizing certain exploits of the game, allowing infinite coin glitches in certain courses.
Normally, the number of available coins in the course prevents the player from getting an excess number of coins to reach either of the coin limits. Nonetheless, there are ways for a player to perform infinite coin glitches such as moneybag duplication, [[cloning]] or utilizing certain exploits of the game, allowing infinite coin glitches in certain courses.


Some courses have only a finite number of coins; in these courses, [[cloning]] is impossible and there are no infinite coin glitches. The three courses that don't fall into either of these categories, namely [[Tick Tock Clock]], [[Rainbow Ride]], and [[Bowser in the Fire Sea]], allow for clones to be created, but due to a lack of [[loading zone]]s, the clones fill up the game's [[object slot]]s. Due to this, there is a limitation of the number of coins that can be collected within these three courses.
Some courses have only a finite number of coins; in these courses, [[cloning]] is impossible and there are no infinite coin glitches. The three courses that don't fall into either of these categories, namely [[Tick Tock Clock]], [[Rainbow Ride]], and [[Bowser in the Fire Sea]], allow for clones to be created, but due to a lack of [[loading zone]]s, the clones fill up the game's [[object slot]]s. Due to this, there is a limitation on the number of coins that can be collected within these three courses.


In the table below, 999 coins represent stages with infinite coin glitches available that does not have clones occupy object slots making the game crash.
In the table below, 999 coins represent stages with infinite coin glitches available that does not have clones occupy object slots making the game crash.
 
{{Maximum_Coins}}
{|class="wikitable"
|-
!Course
!Available coins
!Maximum possible coins
!Strategy
|-
!colspan=4|Save-able courses
|-
|[[Bob-omb Battlefield]]||146 coins||999 coins||Breaking/Disappearing cork box glitch<br/>Bob-omb cloning is possible
|-
|[[Whomp's Fortress]]||141 coins||999 coins||Breaking/Disappearing cork box glitch
|-
|[[Jolly Roger Bay]]||104 coins||104 coins||
|-
|[[Cool, Cool Mountain]]||154 coins||154 coins||
|-
|[[Big Boo's Haunt]]||151 coins||151 coins||
|-
|[[Hazy Maze Cave]]||139 coins||139 coins||
|-
|[[Lethal Lava Land]]||133 coins||133 coins||
|-
|[[Shifting Sand Land]]||136 coins||999 coins||Breaking/Disappearing cork box glitch<br/>Bob-omb cloning is possible
|-
|[[Dire, Dire Docks]]||106 coins||999 coins||Shell cloning, loading area reset
|-
|[[Snowman's Land]]||127 coins||999 coins||Moneybag duplication
|-
|[[Wet-Dry World]]||152 coins||999 coins||Chuckya cloning, loading area reset
|-
|[[Tall, Tall Mountain]]||127 coins||999 coins||Bob-omb cloning, loading area reset
|-
|[[Tiny-Huge Island]]||192 coins*||999 coins||Piranha plant glitch
|-
|[[Tick Tock Clock]]||128 coins||279 coins**||Bob-omb cloning, with limit due to object slots
|-
|[[Rainbow Ride]]||146 coins||290 coins**||Bob-omb cloning, with limit due to object slots
|-
!colspan=4|Non-saveable courses
|-
|[[Bowser in the Dark World]]||80 coins||999 coins||Infinite coins from Bowser's fire
|-
|[[Bowser in the Fire Sea]]||80 coins||250 coins**||Bob-omb cloning, with limit due to object slots
|-
|[[Bowser in the Sky]]||76 coins||999 coins||Infinite coins from Bowser's fire
|-
|colspan=4|*Including [[the impossible coin]], underground, to the left of the line of 3 coins<br/>**Maximum number of objects allowed: 239 for TTC, and 227 in RR.
|}


==Unbounded Coin Limit Glitch (Japanese version)==
==Unbounded Coin Limit Glitch (Japanese version)==
In the Japanese version, there is no coin limit within the courses. When the coin counter reaches a value of 1,000, the game runs a few lines of code wherein there is a typo:
In the Japanese version, there is no coin limit within the courses. When the coin counter reaches a value of 1,000, the game runs a few lines of code wherein there is a typo:


  if(coin_counter > 999) {
 
lives_counter := 999;
  if (gMarioState->numCoins > 999) {
    gMarioState->numLives = (s8) 999; //! Wrong variable
  }
  }


This should be the following:
This should be the following:


  if(coin_counter > 999) {
  if (gMarioState->numCoins > 999) {
coin_counter := 999;
    gMarioState->numCoins = 999;
  }
  }


Because the lives counter is a signed short, the value of 999 overflows to -25. This is displayed in the HUD as "M25." (The "M" presumably means "minus.")
Because the lives counter is a signed short, the value of 999 overflows to -25. This is displayed in the HUD as "M25". (The "M" presumably means "minus".)


The coin display on the HUD freezes at the value 32,767. After that, only the coin count is the only incrementing value. Because the coin count is not limited, the player can obtain an in-course coin count of 65,535. If the player collected one more coin while the game was in this state, the coin counter would overflow and be set to 0. If one were to collect a 65,636<sup>th</sup> coin (65,536 for the overflow and 100 for the star), a second 100 coin star would spawn. This was a part of a strategy that could have been implemented in reducing "To the Top of the Fortress" to 0x, but it wasn't because a faster 0x strategy was discovered for that star.
After reaching a value of 32,767, the ''coin display'' remains at that value. After that, only the hidden ''coin count'' keeps incrementing. That is because the coin count is a signed short, so if the player collects more coins, the coin counter will overflow to -32,768. Since -32768 is not greater than 32,767, the coin display will not increment any further. If one were to collect a 65,636<sup>th</sup> coin (65,536 for the overflow and 100 for the star), a second 100 coin star would spawn. This was a part of a strategy that could have been applied to collect "To the Top of the Fortress" in 0x A presses,<ref>[https://youtu.be/GMOxYVtJhOI "WF Onto Tower 0x in Japanese Version" by UncommentatedPannen]</ref> but it wasn't because a faster 0xA strategy was discovered for that star.<ref>[https://youtu.be/M4M_OyUorRQ "SM64 - To the Top of the Fortress - 0x A Presses" by pannenkoek2012]</ref>


[[Category:Terms]]
==References==
[[Category:Values]]
<references/>
[[Category:Mechanics]]

Navigation menu