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
|
|
|
|
2016-04-19 21:19:31 +00:00
|
|
|
#include <functional>
|
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
|
|
|
|
{
|
2009-02-20 00:07:35 +00:00
|
|
|
AREntry() {}
|
|
|
|
AREntry(u32 _addr, u32 _value) : cmd_addr(_addr), value(_value) {}
|
2008-12-08 04:46:09 +00:00
|
|
|
u32 cmd_addr;
|
|
|
|
u32 value;
|
|
|
|
};
|
|
|
|
|
2010-04-08 16:59:35 +00:00
|
|
|
struct ARCode
|
|
|
|
{
|
2008-12-08 04:46:09 +00:00
|
|
|
std::string name;
|
|
|
|
std::vector<AREntry> ops;
|
|
|
|
bool active;
|
2013-09-07 23:02:49 +02:00
|
|
|
bool user_defined;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|
|
|
|
|
2008-12-17 04:14:24 +00:00
|
|
|
void RunAllActive();
|
|
|
|
bool RunCode(const ARCode &arcode);
|
2016-04-19 21:19:31 +00:00
|
|
|
void ApplyCodes(const std::vector<ARCode>& codes);
|
|
|
|
void AddCode(const ARCode& new_code);
|
|
|
|
void* RegisterCodeChangeCallback(std::function<void()> callback);
|
|
|
|
void UnregisterCodeChangeCallback(void* token);
|
|
|
|
void LoadAndApplyCodes(const IniFile& globalini, const IniFile& localIni);
|
|
|
|
std::vector<ARCode> LoadCodes(const IniFile& globalini, const IniFile& localIni);
|
2008-12-17 04:14:24 +00:00
|
|
|
size_t GetCodeListSize();
|
|
|
|
ARCode GetARCode(size_t index);
|
|
|
|
void SetARCode_IsActive(bool active, size_t index);
|
|
|
|
void UpdateActiveList();
|
|
|
|
void EnableSelfLogging(bool enable);
|
|
|
|
const std::vector<std::string> &GetSelfLog();
|
|
|
|
bool IsSelfLogging();
|
|
|
|
} // namespace
|