2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
2015-11-10 05:21:49 +00:00
|
|
|
* Project64 - A Nintendo 64 emulator. *
|
2012-12-19 09:30:18 +00:00
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
2015-12-06 09:59:58 +00:00
|
|
|
#include "N64RomClass.h"
|
2015-12-21 07:35:22 +00:00
|
|
|
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
|
2015-12-06 09:59:58 +00:00
|
|
|
#include <Project64-core/Plugins/PluginClass.h>
|
2012-12-19 09:30:18 +00:00
|
|
|
|
2015-11-07 03:32:23 +00:00
|
|
|
class CCheats
|
2015-02-26 10:57:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-11-07 03:32:23 +00:00
|
|
|
CCheats();
|
|
|
|
~CCheats(void);
|
2015-02-26 10:57:51 +00:00
|
|
|
|
2015-11-07 03:32:23 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
MaxCheats = 50000,
|
|
|
|
MaxGSEntries = 100,
|
|
|
|
};
|
2015-02-26 10:57:51 +00:00
|
|
|
|
2015-12-21 07:35:22 +00:00
|
|
|
void ApplyCheats(CMipsMemoryVM * MMU);
|
|
|
|
void ApplyGSButton(CMipsMemoryVM * MMU);
|
2015-11-07 03:32:23 +00:00
|
|
|
void LoadCheats(bool DisableSelected, CPlugins * Plugins);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-07 03:32:23 +00:00
|
|
|
static bool IsValid16BitCode(const char * CheatString);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-07 03:32:23 +00:00
|
|
|
private:
|
|
|
|
struct GAMESHARK_CODE
|
|
|
|
{
|
|
|
|
uint32_t Command;
|
|
|
|
uint16_t Value;
|
|
|
|
};
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-07 03:32:23 +00:00
|
|
|
typedef std::vector<GAMESHARK_CODE> CODES;
|
|
|
|
typedef std::vector<CODES> CODES_ARRAY;
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-07 03:32:23 +00:00
|
|
|
void LoadPermCheats(CPlugins * Plugins);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-07 03:32:23 +00:00
|
|
|
const CN64Rom * m_Rom;
|
|
|
|
CODES_ARRAY m_Codes;
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-07 03:32:23 +00:00
|
|
|
bool LoadCode(int32_t CheatNo, const char * CheatString);
|
2015-12-21 07:35:22 +00:00
|
|
|
int32_t ApplyCheatEntry(CMipsMemoryVM * MMU, const CODES & CodeEntry, int32_t CurrentEntry, bool Execute);
|
2015-01-31 19:27:27 +00:00
|
|
|
};
|