Sly 1:GS

GS (Game State) is a data structure in. It stores information about the current save file, including an array of World States which in turn each store an array of Level States.

Structure
The GS struct is declared as follows:

World states array
is an array of 5  structs, one for each world. In the release build, the order is as follows:
 * 0:
 * 1:
 * 2:
 * 3:
 * 4:
 * 5:

Unlockable flags
There are three sets of flags after the world states.

Settings flags (GRFGS)
There is a set of flags of type  whose purpose is unclear. At least some of the bits appear to be used for game settings. is an alias of  and occupies 4 bytes, or 32 bits.

Powerup flags (GRFVAULT)
There is a set of flags of type  for the unlocked powerups, with each bit corresponding to a particular powerup being unlocked. is an alias of  and occupies 4 bytes, or 32 bits.

Cutscene flags
There are 16 bits for the cutscene flags, with each bit corresponding to a particular cutscene being unlocked. It is probably also stored as a typedef alias of  but the type is currently unknown.

Game state flags
The current game state is represented by the  enum, which has the following possible values: