Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
trs:savegame:tr1 [2017/03/25 16:01] – zdimension | trs:savegame:tr1 [2021/07/15 03:00] (current) – update savegame format with new discoveries stohrendorf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== TR1 ====== | ====== TR1 ====== | ||
+ | |||
+ | <note tip>When loading a save game, classic TR games read the name and number and then load everything after that directly into the game RAM, without checking anything. That's why savegames from original versions don't work in multipatched versions (and make the game crash). It also makes the " | ||
<code cpp> | <code cpp> | ||
Line 7: | Line 9: | ||
uint32_t saveNumber; // game clips it to 16 bits | uint32_t saveNumber; // game clips it to 16 bits | ||
uint8_t unknown2[15]; | uint8_t unknown2[15]; | ||
- | // First level use block 0, second use block 1... so that at the end of the game, | + | // First level use block 0, second use block 1... so that at the end of the game, |
// it sums up everything and/or checks if you found all secrets, etc | // it sums up everything and/or checks if you found all secrets, etc | ||
struct | struct | ||
{ | { | ||
- | uint16_t | + | uint16_t |
uint16_t ammoMagnums; | uint16_t ammoMagnums; | ||
uint16_t ammoUzis; | uint16_t ammoUzis; | ||
Line 20: | Line 22: | ||
/* 0 None | /* 0 None | ||
* 1 Climbing | * 1 Climbing | ||
- | * 2 ? | + | * 2 Draw weapon |
- | * 3 Single shot.? | + | * 3 Holster weapon |
- | * 4 Combat? | + | * 4 Combat |
*/ | */ | ||
uint8_t handStatus; | uint8_t handStatus; | ||
Line 31: | Line 33: | ||
* 4 Shotgun | * 4 Shotgun | ||
*/ | */ | ||
- | uint8_t weapon; // current held weapon | + | uint8_t weapon; // current held weapon |
/* 00000001 Level unlocked | /* 00000001 Level unlocked | ||
* 00000010 Pistols | * 00000010 Pistols | ||
Line 39: | Line 41: | ||
* 00100000 Midas Hand | * 00100000 Midas Hand | ||
*/ | */ | ||
- | uint8_t | + | uint8_t |
- | uint8_t | + | uint8_t |
- | } levelInitData[21]; | + | } levelInitData[21]; |
uint32_t elapsedTime; | uint32_t elapsedTime; | ||
uint32_t kills; | uint32_t kills; | ||
- | uint16_t secretsFound; | + | uint16_t secretsFound; |
uint16_t levelNumber; | uint16_t levelNumber; | ||
uint8_t numPickups; | uint8_t numPickups; | ||
Line 50: | Line 52: | ||
uint8_t hasItem141; // From decompiled game source. | uint8_t hasItem141; // From decompiled game source. | ||
uint8_t hasItem142; // Strangely, those (unknown) items aren't present in any official TR1 level | uint8_t hasItem142; // Strangely, those (unknown) items aren't present in any official TR1 level | ||
- | uint8_t | + | uint8_t |
uint8_t keys[4]; | uint8_t keys[4]; | ||
- | uint8_t | + | uint8_t |
uint8_t levelInitDataCRC; | uint8_t levelInitDataCRC; | ||
// 10240 bytes starting from now | // 10240 bytes starting from now | ||
uint8_t roomsAreSwapped; | uint8_t roomsAreSwapped; | ||
- | uint8_t flipFlags[10]; | + | uint8_t flipFlags[10]; |
- | uint16_t | + | uint16_t |
// items block here todo | // items block here todo | ||
- | #pragma pack(push, 8) | + | #pragma pack(push, 8) |
struct | struct | ||
{ | { | ||
Line 65: | Line 67: | ||
int16_t handStatus; | int16_t handStatus; | ||
WeaponID currentWeapon; | WeaponID currentWeapon; | ||
- | | + | |
int16_t climbFallSpeedOverride; | int16_t climbFallSpeedOverride; | ||
int16_t underwaterState; | int16_t underwaterState; | ||
Line 71: | Line 73: | ||
int16_t collisionFrame; | int16_t collisionFrame; | ||
int16_t collisionAxis; | int16_t collisionAxis; | ||
- | int16_t air; | + | int16_t air; // game ticks of air left |
- | int16_t swimToDiveKeypressDuration; | + | int16_t swimToDiveKeypressDuration; |
- | int16_t deadTime; | + | int16_t deadTime; |
int16_t underwaterCurrentStrength; | int16_t underwaterCurrentStrength; | ||
- | int16_t | + | int16_t |
- | Vertex4 *wallPosition; | + | Vertex4 *spasmSource; // from which direction Lara is hit |
#pragma pack(push, 1) | #pragma pack(push, 1) | ||
struct MeshTree | struct MeshTree | ||
Line 85: | Line 87: | ||
#pragma pack(pop) | #pragma pack(pop) | ||
ITEM *enemy; | ITEM *enemy; | ||
- | Vertex2YX | + | Vertex2YX |
int16_t yRotationSpeed; | int16_t yRotationSpeed; | ||
int16_t movementAngle; | int16_t movementAngle; | ||
Line 113: | Line 115: | ||
} lara; // 236 bytes | } lara; // 236 bytes | ||
#pragma pack(pop) | #pragma pack(pop) | ||
- | int32_t postFxFunc; // this is usually | + | int32_t postFxFunc; // this is usually |
int32_t animFxTime; | int32_t animFxTime; | ||
}; | }; | ||
Line 170: | Line 172: | ||
}; | }; | ||
#pragma pack(pop) | #pragma pack(pop) | ||
+ | |||
</ | </ | ||
- | <note tip>The '' | ||
- | |||
+ | <note tip>The ''< | ||
===== Identifications ===== | ===== Identifications ===== | ||
==== Levels ==== | ==== Levels ==== | ||
- | ^ ID ^ Level ^ Filename ^ Camera count ^ Items ^ Secrets ^ Puzzle ^^^^ Key ^^^^ | + | ^ID^Level^Filename^Camera count^Items^ |
- | ^ ::: ^ ::: ^ ::: ^ ::: ^ ::: ^ ::: ^ 1 ^ 2 ^ 3 ^ 4 ^ 1 ^ 2 ^ 3 ^ 4 ^ | + | | ::: | ::: | ::: | ::: | ::: | ::: ^1^2^3^4^1^2^3^4| |
- | | 0 | Lara's Home | '' | + | | 0| Lara's Home | '' |
- | | 1 | Caves | '' | + | | 1| Caves | '' |
- | | 2 | City of Vilcabamba | + | | 2| City of Vilcabamba |
- | | 3 | Lost Valley | + | | 3| Lost Valley |
- | | 4 | Tomb of Qualopec | + | | 4| Tomb of Qualopec |
- | | 5 | St. Francis' | + | | 5| St. Francis' |
- | | 6 | Colosseum | + | | 6| Colosseum |
- | | 7 | Palace Midas | '' | + | | 7| Palace Midas | '' |
- | | 8 | The Cistern | + | | 8| The Cistern |
- | | 9 | Tomb of Tihocan | + | | 9| Tomb of Tihocan |
- | | 10 | City of Khamoon | + | | 10| City of Khamoon |
- | | 11 | Obelisk of Khamoon | + | | 11| Obelisk of Khamoon |
- | | 12 | Sanctuary of the Scion | '' | + | | 12| Sanctuary of the Scion | '' |
- | | 13 | Natla' | + | | 13| Natla' |
- | | 14 | Atlantis | + | | 14| Atlantis |
- | | 15 | The Great Pyramid | + | | 15| The Great Pyramid |
- | | 16 | Cut Scene 1 | '' | + | | 16| Cut Scene 1 | '' |
- | | 17 | Cut Scene 2 | '' | + | | 17| Cut Scene 2 | '' |
- | | 18 | Cut Scene 3 | '' | + | | 18| Cut Scene 3 | '' |
- | | 19 | Cut Scene 4 | '' | + | | 19| Cut Scene 4 | '' |
- | | 20 | Title | '' | + | | 20| Title | '' |
- | | 21 | Current Position | + | | 21| Current Position |
+ | |||
+ | <note important> | ||
- | <note important> |