Debug code (Sly 1)

A **debug code** (or **cheat code**) in *Sly Cooper and the Thievius Raccoonus* refers to input sequences programmed by the developers to help with development of the game.

## Codes

There are 9 debug codes in Sly 1. They are as follows.

### Unlock All Levels

Instantly unlocks all worlds, all levels in map view, and set each hub to its final state (all keys unlocked). If you are in the Hideout, it will also automatically reload.

Once you save, this is permanent on your file.

### Unlock All Pages

Instantly unlocks all thief moves from the Thievius Raccoonus. You can still open vaults, but they will be empty and will not get marked as completed on your file.

Once you save, this is permanent on your file. To manually unlock all pages using hacks, set the two bytes at memory offset 0x27DC10 to 0xFFFF.

### Collect Clue Bottles

Instantly collects all clue bottles in the current level. The bottles will disappear from the world and you will be able to open the vault immediately.

Once you save, this is permanent on your file.

### Infinite Lucky Charms

Gives Sly infinite recovery from damage. Even if Sly does not have a lucky charm on his back, the game will behave as if he does. This is because the function that checks if Sly has a lucky charm when he takes damage also checks if this cheat is enabled.

This code will stay in effect until you use the *Reload + Disable Cheats* code, choose Save and Quit from the pause menu, or restart the game. To manually enable this cheat using hacks, set bit 1 at memory offset 0x262C64 to 1.

### Slippery Objects

This code adds slippery physics to certain game objects. Currently, the only known effects are that clue bottles will slide down slopes, and barrels will slide on slopes or when pushed.

This code will stay in effect until you use the *Reload + Disable Cheats* code, choose Save and Quit from the pause menu, or restart the game. To manually enable this cheat using hacks, set bit 3 at memory offset 0x262C64 to 1.

### Reload + Slippery Movement

Formerly called "Slippery Guards", this code reloads the current level and adds slippery physics to guards and Sly. It’s subtle, but you can observe it in action by doing generator skip, and the squid should fall off the roof with you. Some jumps and ledge grabs are more difficult with this code enabled.

This code will stay in effect until you use the *Reload + Disable Cheats* code, choose Save and Quit from the pause menu, or restart the game. To manually enable this cheat using hacks, set bit 2 at memory offset 0x262C64 to 1.

### Reload + Disable Cheats

This code will reload the current level and disable the effects of the Infinite Lucky Charms, Slippery Objects, and Slippery Movement codes.

To manually disable these cheats using hacks, set bits 1, 2, and 3 at memory offset 0x262C64 to 0.

### Level Reload Code

This code will reload the current level. There is no other effect.

### The password is: chetkido

*Main article: Chetkido password*

Entering this code under very specific conditions will cause a message to popup in the corner of the screen that reads "The password isː chetkido". The four conditions are:

1. Have 100% on your save file
2. Be in Perilous Ascent
3. Have exactly 99 coins
4. Have exactly 0 lives

## Implementation

Each debug code has a corresponding data structure that is loaded in the game's memory at all times. This structure stores the code input sequence, a counter, a callback function to execute when the code is entered, and one parameter that is passed to the callback function.

The function `check_all_cheatcode_sequences` is called every frame, which in turn calls `check_cheatcode_seq` nine times (once for each code). The checks your button inputs against each code sequence and increments the corresponding counter for each correct input.

Once any of the counters reaches a certain threshold, `check_cheatcode_sequence` detects that the full code has been entered and, the associated callback function is executed. If you stop pressing buttons or enter a wrong input, the counter(s) will reset back to zero.

The callback function and parameter for any code can be modified to point to any function in the game, provided it has one or zero parameters. This can be used to call any function from within the game itself, which is useful for debugging, reverse-engineering, or simply creating a custom cheat code.

## History

On August 15, 2019, NiV-L-A discovered the *Reload + Slippery Movement* code, and found the corresponding input counter in the game's memory. At the time it was known as the *Level Reload Code* by the community, and while the other counters were also found in memory nearby, it was believed that this was the only working code.

Almost a year later, on June 5, 2020, TheOnlyZac found that changing the last button press of the code would also result in a clicking sound, and he realized that each counter corresponded to a different code. Once it was confirmed that there were nine counters, and the input sequence for each counter was found, the community began experimenting to figure out what they actually do.

Seven of the remaining codes' functionality were found quickly. The Chetkido password code, known at the time as the *Square Square Square* code, would remain unknown until the Sly Reverse Engineering Project began, and the functions that control the debug codes were among the first to be fully reverse engineered.

## See also

* CheatCodeData
* Chetkido password

## References

1. ↑ 1.0 1.1 https://docs.google.com/document/d/1WMueShIbTVWnM86z6IrUR1xCSBIFaUjC\_\_sPz7lNSs0
2. ↑ https://discordapp.com/channels/439454661100175380/439467717846761472/611656445993156647
3. ↑ https://www.reddit.com/r/Slycooper/comments/cqwhyq/sly\_1\_reload\_cheat\_code/
4. ↑ https://discordapp.com/channels/439454661100175380/439459490702557195/718318705460641793
5. ↑ https://discordapp.com/channels/439454661100175380/439459490702557195/726776089636241458