Skip to content

Commit

Permalink
Cheats: Use "name" instead of "description". Allow whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
bearoso committed Jun 4, 2018
1 parent 28332c5 commit 13769ee
Show file tree
Hide file tree
Showing 2 changed files with 27,171 additions and 27,171 deletions.
12 changes: 6 additions & 6 deletions cheats2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,21 +546,21 @@ SCheat S9xTextToCheat (char *text)
byte = c.byte;
}

else if (sscanf (text, "%x=%x?%x", &c.address, &cond_byte, &byte) == 3)
else if (sscanf (text, "%x = %x ? %x", &c.address, &cond_byte, &byte) == 3)
{
c.conditional = true;
}

else if (sscanf (text, "%x=%x", &c.address, &byte) == 2)
else if (sscanf (text, "%x = %x", &c.address, &byte) == 2)
{
}

else if (sscanf (text, "%x/%x/%x", &c.address, &cond_byte, &byte) == 3)
else if (sscanf (text, "%x / %x / %x", &c.address, &cond_byte, &byte) == 3)
{
c.conditional = true;
}

else if (sscanf (text, "%x/%x", &c.address, &byte) == 2)
else if (sscanf (text, "%x / %x", &c.address, &byte) == 2)
{
}

Expand Down Expand Up @@ -742,7 +742,7 @@ static void S9xLoadCheatsFromBMLNode (bml_node *n)
bml_node *c = n->child[i];
bml_node *tmp = NULL;

tmp = bml_find_sub(c, "description");
tmp = bml_find_sub(c, "name");
desc = tmp->data;
if (!desc)
desc = (char *) "";
Expand Down Expand Up @@ -847,7 +847,7 @@ bool8 S9xSaveCheatFile (const char *filename)

fprintf (file,
"cheat\n"
" description: %s\n"
" name: %s\n"
" code: %s\n"
"%s\n",
Cheat.g[i].name ? Cheat.g[i].name : "",
Expand Down
Loading

0 comments on commit 13769ee

Please sign in to comment.