GenericSave complete, still needs some testing

This commit is contained in:
Wes Hampson
2020-03-11 00:12:40 -07:00
parent 5bc51f8462
commit c7f16879df
7 changed files with 120 additions and 81 deletions

View File

@ -1,6 +1,9 @@
#include "common.h"
#include "patcher.h"
#include "Stats.h"
WRAPPER void CStats::SaveStats(uint8 *buf, uint32 *size) { EAXJMP(0x4ab3e0); }
int32 &CStats::DaysPassed = *(int32*)0x8F2BB8;
int32 &CStats::HeadsPopped = *(int32*)0x8F647C;
bool& CStats::CommercialPassed = *(bool*)0x8F4334;

View File

@ -73,4 +73,5 @@ public:
static void CheckPointReachedUnsuccessfully() { KillsSinceLastCheckpoint = 0; };
static void CheckPointReachedSuccessfully() { TotalLegitimateKills += KillsSinceLastCheckpoint; KillsSinceLastCheckpoint = 0; };
static void RegisterElBurroTime(int32);
static void SaveStats(uint8 *buf, uint32 *size);
};

View File

@ -321,9 +321,9 @@ _TWEEKCLASS(CTweakFloat, float);
#undef _TWEEKCLASS
#ifdef VALIDATE_SAVE_SIZE
extern int32 _bufBytesRead;
#define INITSAVEBUF _bufBytesRead = 0;
#define VALIDATESAVEBUF(b) assert(_bufBytesRead == b);
extern int32 _saveBufCount;
#define INITSAVEBUF _saveBufCount = 0;
#define VALIDATESAVEBUF(b) assert(_saveBufCount == b);
#else
#define INITSAVEBUF
#define VALIDATESAVEBUF(b)
@ -333,7 +333,7 @@ inline void SkipSaveBuf(uint8 *&buf, int32 skip)
{
buf += skip;
#ifdef VALIDATE_SAVE_SIZE
_bufBytesRead += skip;
_saveBufCount += skip;
#endif
}

View File

@ -449,7 +449,7 @@ void re3_trace(const char *filename, unsigned int lineno, const char *func, cons
}
#ifdef VALIDATE_SAVE_SIZE
int32 _bufBytesRead;
int32 _saveBufCount;
#endif
void