2013-05-23 13:10:39 +02:00
|
|
|
// Rough and ready CwCheats implementation, disabled by default.
|
|
|
|
// Will not enable by default until the TOOD:s have been addressed.
|
2013-05-16 15:42:25 -05:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <iostream>
|
|
|
|
#include <sstream>
|
2013-05-23 13:10:39 +02:00
|
|
|
|
|
|
|
#include "base/basictypes.h"
|
|
|
|
#include "Core/MemMap.h"
|
2013-05-16 15:42:25 -05:00
|
|
|
|
2013-10-07 07:46:18 -07:00
|
|
|
class PointerWrap;
|
|
|
|
|
2013-05-17 23:49:44 -05:00
|
|
|
void __CheatInit();
|
|
|
|
void __CheatShutdown();
|
2013-10-07 07:46:18 -07:00
|
|
|
void __CheatDoState(PointerWrap &p);
|
|
|
|
|
2013-06-16 17:59:59 -05:00
|
|
|
std::vector<std::string> makeCodeParts(std::vector<std::string> CodesList);
|
2013-05-16 15:42:25 -05:00
|
|
|
|
2013-05-18 17:04:01 -05:00
|
|
|
class CWCheatEngine {
|
2013-05-16 15:42:25 -05:00
|
|
|
public:
|
2013-05-18 17:04:01 -05:00
|
|
|
CWCheatEngine();
|
2013-05-23 13:10:39 +02:00
|
|
|
std::string String();
|
|
|
|
void AddCheatLine(std::string& line);
|
|
|
|
std::vector<std::string> GetCodesList();
|
2013-05-30 02:08:20 -05:00
|
|
|
void CreateCodeList();
|
2013-05-17 23:49:44 -05:00
|
|
|
void Exit();
|
|
|
|
void Run();
|
2013-05-30 03:49:15 -05:00
|
|
|
std::vector<int> GetNextCode();
|
2013-06-16 17:59:59 -05:00
|
|
|
|
2013-05-16 15:42:25 -05:00
|
|
|
|
2013-05-23 13:10:39 +02:00
|
|
|
private:
|
|
|
|
void SkipCodes(int count);
|
|
|
|
void SkipAllCodes();
|
2013-06-16 17:59:59 -05:00
|
|
|
bool cheatsOn, exit2, cheatEnabled;
|
2013-05-23 13:10:39 +02:00
|
|
|
int GetAddress(int value);
|
2013-06-16 17:59:59 -05:00
|
|
|
std::vector<std::string> codeNameList;
|
2013-05-16 15:42:25 -05:00
|
|
|
|
2013-06-16 17:59:59 -05:00
|
|
|
std::vector<std::string> codes, initialCodesList, parts;
|
2013-05-31 22:15:38 -07:00
|
|
|
size_t currentCode;
|
2013-05-23 13:10:39 +02:00
|
|
|
};
|