2013-05-23 11:10:39 +00:00
|
|
|
// Rough and ready CwCheats implementation, disabled by default.
|
|
|
|
// Will not enable by default until the TOOD:s have been addressed.
|
2013-05-16 20:42:25 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <iostream>
|
|
|
|
#include <sstream>
|
2013-05-23 11:10:39 +00:00
|
|
|
|
|
|
|
#include "base/basictypes.h"
|
|
|
|
#include "Core/MemMap.h"
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-10-07 14:46:18 +00:00
|
|
|
class PointerWrap;
|
|
|
|
|
2013-05-18 04:49:44 +00:00
|
|
|
void __CheatInit();
|
|
|
|
void __CheatShutdown();
|
2013-10-07 14:46:18 +00:00
|
|
|
void __CheatDoState(PointerWrap &p);
|
|
|
|
|
2014-02-15 23:28:13 +00:00
|
|
|
// Return whether cheats are enabled and in effect.
|
|
|
|
bool CheatsInEffect();
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-05-18 22:04:01 +00:00
|
|
|
class CWCheatEngine {
|
2013-05-16 20:42:25 +00:00
|
|
|
public:
|
2013-05-18 22:04:01 +00:00
|
|
|
CWCheatEngine();
|
2016-06-21 04:29:26 +00:00
|
|
|
std::vector<std::string> GetCodesList();
|
2013-05-30 07:08:20 +00:00
|
|
|
void CreateCodeList();
|
2016-06-19 22:18:35 +00:00
|
|
|
void CreateCheatFile();
|
2013-05-18 04:49:44 +00:00
|
|
|
void Exit();
|
|
|
|
void Run();
|
2013-05-30 08:49:15 +00:00
|
|
|
std::vector<int> GetNextCode();
|
2014-02-15 23:28:13 +00:00
|
|
|
bool HasCheats();
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-05-23 11:10:39 +00:00
|
|
|
private:
|
2015-02-02 22:26:25 +00:00
|
|
|
void InvalidateICache(u32 addr, int size);
|
2013-05-23 11:10:39 +00:00
|
|
|
void SkipCodes(int count);
|
|
|
|
void SkipAllCodes();
|
2016-05-21 15:18:08 +00:00
|
|
|
bool exit2, cheatEnabled;
|
2013-05-23 11:10:39 +00:00
|
|
|
int GetAddress(int value);
|
2013-06-16 22:59:59 +00:00
|
|
|
std::vector<std::string> codeNameList;
|
2013-05-16 20:42:25 +00:00
|
|
|
|
2013-06-16 22:59:59 +00:00
|
|
|
std::vector<std::string> codes, initialCodesList, parts;
|
2013-06-01 05:15:38 +00:00
|
|
|
size_t currentCode;
|
2013-05-23 11:10:39 +00:00
|
|
|
};
|