The Castle Crush Glitch is an infamous game-breaking glitch in Donkey Kong Country 2: Diddy's Kong Quest. It can be done in the stage Castle Crush (hence the name) on the SNES, Wii U, and Nintendo Switch versions of the game. This glitch is unique in that it can potentially mess up save data (SRAM) in such a way that the game can not boot up normally, rendering it unplayable unless SRAM is cleared. Contrary to rumors, this glitch cannot permanently brick game cartridges or consoles.
The glitch essentially has two parts to it, the first being pulling in the nearest entity close to the player and the second scrambling the usual execution code when entering the Rambi Animal Barrel. Only the second part has the potential to affect the physical hardware, or even crash the game, however the first part can cause the player to be unable to complete the stage without dying.
Diddy needs to be the leading character and pickup the first DK Barrel. After picking up the Barrel, the player should move over to the far left side of the screen, place the Barrel on the moving floor then instantly pick it up again. If done correctly, the Barrel will break but Diddy's character will look like he is still holding it.
Once the Barrel is "thrown," a myriad of things can happen. Depending on the location of the player, it can pull other entities close including enemies, Barrels, projectiles and banana bunches. Only if the Rambi Barrel is drawn close and entered activates the second part of the glitch.
If the player manages to still be carrying the Barrel near the automatic Barrel Cannon encountered further in the stage, if the blast Barrel is moved, the player will not be able to progress any further as the line of path for the Barrel will be incorrect when shooting.
Entering the Rambi Barrel will not transform the player into a normal Rambi when they enter the Barrel; instead they will turn into a glitched entity. The entities that the player can transform into are (likely to be incomplete):
- Diddy Kong (defeated or after jumping on ending pad from a height)
- Dixie Kong (defeated or after jumping on ending pad from a height)
- Kleever (normal or swinging)
- Krow (defeated)
- Krow's egg
- King K. Rool
- King K. Rool's spiked Kannonball
- Unidentifiable small squiggle
Other outcomes that are not transforming into any of the entities above are stretched sprites, monkey noises, or instant game crashes. Most of these outcomes will lead to a game crash, although if an enemy defeats the player they may be returned to the map screen instead and able to play normally.
The first part of the glitch is caused by a pointer mismatch in the game, as it tries to draw close the nearest entity which under normal circumstances would have been the Barrel that the game thinks is still being held by Diddy.
The second part of the glitch involves some sort of buffer overflow, since enemies such as Klubba are not involved in the stage yet the game somehow manages to get those sprite references. The color palette for the entity is also incorrect.
Different button presses among other factors change the outcome of the second part of the glitch, which means the game is executing arbitrary code dependent on what is in the SRAM content at the time.
Back in the days games are coded in low level languages, and memory was a luxury. Lot of objects are swapped using pointers in SNES, which means each object has a temporary reference. Upon creation and deletion the reference pointers are swapped for other objects, therefore achieving low memory usage. It seems like upon picking up the Barrel assign it a reference to memory sector, but for some reason other objects are able to swap to its memory sector while that memory sector is still being used as a Barrel object (probably due to bad collision). Therefore the game, instead of presenting a Barrel object, present whatever is currently using that memory block - enemies, objects, etc. This memory block is most likely an index to an Array object - in some extreme cases I would assume the index of the Barrel memory sector went above the array length threshold, and caused an overflow issue - which can explain oddity like spawning of Klubba. In modern day gaming there is abundance of memory usage (assume code is optimized), so most developer won't run into this issue of memory-sharing anymore (remember how games comes in CDs instead of blocky cartridges?).
Depending on what the player transforms into, they can try move around but this usually causes the game to soon crash; whilst the player is Klubba, after a few seconds if they do not move they will seemingly drop down the screen at a fast rate which usually crashes the game soon after.
It is interesting to note that if the player becomes the discolored Rambi, they can seemingly keep ascending for a while after moving in any horizontal direction, though they cannot jump and making contact with an enemy will still hurt the character. The stage cannot be completed as the glitched Rambi even if they manage to reach the top, since they are unable to jump (on the ending pad).
Harmful side effects of the glitch include causing save files to be corrupt or erased after execution, as well as even damaging the ROM itself making it unplayable. This can happen to both the ROM file on an emulator and the physical SNES cartridge. The platform the game is played on (emulator or SNES) can also affect what the glitch does, such as displaying the corrupt SRAM message "An irregularity has been detected. Please turn the power off, wait for 10 seconds, and then turn the power on again." when played on a console.
The glitch was fixed on most re-releases of the game, but not the Wii U. This glitch is also present in the SNES Online service for the Nintendo Switch.
The best way to fix the effects of this glitch is to take out the cartridge's save battery, since the battery loses all of its data if it dies. Save states, like those on the Wii U's Virtual Console and in the SNES Online app for the Nintendo Switch, would actually be ideal for the best recovery.