2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 22:43:11 -04:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2015-05-08 17:28:03 -04:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
class IniFile;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2008-12-17 04:14:24 +00:00
|
|
|
namespace ActionReplay
|
|
|
|
{
|
2010-04-08 16:59:35 +00:00
|
|
|
struct AREntry
|
|
|
|
{
|
2016-06-24 10:43:46 +02:00
|
|
|
AREntry() {}
|
|
|
|
AREntry(u32 _addr, u32 _value) : cmd_addr(_addr), value(_value) {}
|
|
|
|
u32 cmd_addr;
|
|
|
|
u32 value;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|
2016-07-23 01:05:04 +00:00
|
|
|
constexpr bool operator==(const AREntry& left, const AREntry& right)
|
|
|
|
{
|
|
|
|
return left.cmd_addr == right.cmd_addr && left.value == right.value;
|
|
|
|
}
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2010-04-08 16:59:35 +00:00
|
|
|
struct ARCode
|
|
|
|
{
|
2016-06-24 10:43:46 +02:00
|
|
|
std::string name;
|
|
|
|
std::vector<AREntry> ops;
|
|
|
|
bool active;
|
|
|
|
bool user_defined;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|
|
|
|
|
2008-12-17 04:14:24 +00:00
|
|
|
void RunAllActive();
|
2016-04-22 10:42:16 +00:00
|
|
|
|
2016-04-19 21:19:31 +00:00
|
|
|
void ApplyCodes(const std::vector<ARCode>& codes);
|
2016-04-22 10:42:16 +00:00
|
|
|
void AddCode(ARCode new_code);
|
|
|
|
void LoadAndApplyCodes(const IniFile& global_ini, const IniFile& local_ini);
|
|
|
|
|
|
|
|
std::vector<ARCode> LoadCodes(const IniFile& global_ini, const IniFile& local_ini);
|
|
|
|
void SaveCodes(IniFile* local_ini, const std::vector<ARCode>& codes);
|
|
|
|
|
2008-12-17 04:14:24 +00:00
|
|
|
void EnableSelfLogging(bool enable);
|
2016-04-22 10:42:16 +00:00
|
|
|
std::vector<std::string> GetSelfLog();
|
|
|
|
void ClearSelfLog();
|
2008-12-17 04:14:24 +00:00
|
|
|
bool IsSelfLogging();
|
|
|
|
} // namespace
|