Skip to content

Instantly share code, notes, and snippets.

@meleu
Last active November 16, 2017 19:12
Show Gist options
  • Save meleu/dbf1ba7efded144c47dcc7d2c604ff3a to your computer and use it in GitHub Desktop.
Save meleu/dbf1ba7efded144c47dcc7d2c604ff3a to your computer and use it in GitHub Desktop.
Cheevos Hunter description.

The debug/plugins folder has one subfolder or file for each Hunter's functionality.

The simple functionalities are implemented in a file. Examples:

  • info.cpp: show core info.
  • memeditor.cpp: show the memory editor.
  • cheats.cpp: allow the use of cheats in order to help the cheevos development (it would be useful if the user could load the cheats from RetroArch database and turn on/off a cheevo needed to help with cheevos development).

[XXX: ACHO QUE ISSO PRECISA DE UMA EXPLICAÇÃO MELHOR]

  • hunter/: allows the core memory scan looking for specific values. Memory snapshots can be generated, and filters created from the comparison between bytes with values, or between snapshots, or between filters...

The user can create a core memory snapshot. And then test the snapshot with a value, i.e. "in these snapshots give me all addresses with a byte = 15"

The comparison result is a filter, or better said, a set with addresses that match the condition that created them.

Example: the set of address which the byte value is 15

Filters can also be created comparing two snaps, i.e. "give me all addresses where the byte from snapshot1 has a bigger value than the byte from the same address from snapshot2.

The third functionality allow operations between filters.

As filters are sets, the user can perform a set joint, intersection or difference. And it results in a new filter.

The final goal is to find the place in memory which have the needed variable for the cheevo. This is what the Hunter does.

[XXX: não existe este folder na branch do radius. Check it out: https://github.com/fr500/RetroArch/tree/hunter/debug/plugins ] The actual cheevo creation would be made by the retrocheevos (a folder in debug/plugins).

The plugins follow an interface defined in C.

An example from info.cpp.

static const debugger_plugin_t plugin =
{
  ICON_FA_INFO_CIRCLE " Information",
  Info::s_create,
  Info::s_destroy,
  Info::s_draw
};

void init_info(debugger_register_plugin_t register_plugin, const debugger_t* info)
{
  s_info = info;
  register_plugin(&plugin);
}

The debugger_plugin_t struct has the plugin title, which is presented on the plugins instantiation screen, and on the instantiated plugins tab.

The other fields are pointers to functions to create, destroy and draw the plugin.

init_info is called by Hunter for plugin registration. This function also receive a pointer to debugger_t, which has a set of functions to communicate with RetroArch.

The already created plugins were written in C++. The info.cpp file can be used as an example.

Knowledge about ImGui is needed, once it is used for GUI.

Things that would be useful to implement:

  1. Copy & Paste, allowing to copy an address from Hunter and paste on the cheats or memeditor, in order to test if it really is what the cheevos developer want.
  2. Comunication between plugins: example, instantiate a memeditor inside the Hunter, showing the snapshot used to create the filter, highlighting the addresses contained in the filter.
  3. Usability improvements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment