Qt GUI fixes for recent changes to fceu core cheats API.

This commit is contained in:
harry 2022-08-19 19:57:27 -04:00
parent c37f86dbd1
commit f4ea336349
3 changed files with 7 additions and 14 deletions

View File

@ -670,7 +670,7 @@ void GuiCheatsDialog_t::lessThanValueCallback(void)
FCEU_WRAPPER_UNLOCK(); FCEU_WRAPPER_UNLOCK();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
int GuiCheatsDialog_t::activeCheatListCB(char *name, uint32 a, uint8 v, int c, int s, int type, void *data) int GuiCheatsDialog_t::activeCheatListCB(const char *name, uint32 a, uint8 v, int c, int s, int type, void *data)
{ {
QTreeWidgetItem *item; QTreeWidgetItem *item;
char codeStr[32]; char codeStr[32];
@ -710,7 +710,7 @@ int GuiCheatsDialog_t::activeCheatListCB(char *name, uint32 a, uint8 v, int c, i
return 1; return 1;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static int activeCheatListCB(char *name, uint32 a, uint8 v, int c, int s, int type, void *data) static int activeCheatListCB(const char *name, uint32 a, uint8 v, int c, int s, int type, void *data)
{ {
return win->activeCheatListCB(name, a, v, c, s, type, data); return win->activeCheatListCB(name, a, v, c, s, type, data);
} }
@ -971,7 +971,7 @@ void GuiCheatsDialog_t::updateCheatParameters(void)
FCEU_WRAPPER_LOCK(); FCEU_WRAPPER_LOCK();
FCEUI_SetCheat(row, name.c_str(), a, v, c, s, type); FCEUI_SetCheat(row, &name, a, v, c, s, type);
FCEU_WRAPPER_UNLOCK(); FCEU_WRAPPER_UNLOCK();
@ -983,7 +983,7 @@ void GuiCheatsDialog_t::actvCheatItemClicked(QTreeWidgetItem *item, int column)
uint32 a = 0; uint32 a = 0;
uint8 v = 0; uint8 v = 0;
int c = -1, s = 0, type = 0; int c = -1, s = 0, type = 0;
char *name = NULL; std::string name;
char stmp[64]; char stmp[64];
int row = actvCheatList->indexOfTopLevelItem(item); int row = actvCheatList->indexOfTopLevelItem(item);
@ -1021,14 +1021,7 @@ void GuiCheatsDialog_t::actvCheatItemClicked(QTreeWidgetItem *item, int column)
cheatCmpEntry->setText(tr("")); cheatCmpEntry->setText(tr(""));
} }
if (name != NULL) cheatNameEntry->setText(tr(name.c_str()));
{
cheatNameEntry->setText(tr(name));
}
else
{
cheatNameEntry->setText(tr(""));
}
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void GuiCheatsDialog_t::globalEnableCheats(int state) void GuiCheatsDialog_t::globalEnableCheats(int state)

View File

@ -30,7 +30,7 @@ public:
int addSearchResult(uint32_t a, uint8_t last, uint8_t current); int addSearchResult(uint32_t a, uint8_t last, uint8_t current);
int activeCheatListCB(char *name, uint32 a, uint8 v, int c, int s, int type, void *data); int activeCheatListCB(const char *name, uint32 a, uint8 v, int c, int s, int type, void *data);
void showActiveCheatList(bool redraw); void showActiveCheatList(bool redraw);

View File

@ -3243,7 +3243,7 @@ void QHexEdit::addBookMarkCB(void)
} }
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static int RamFreezeCB(char *name, uint32 a, uint8 v, int compare,int s,int type, void *data) static int RamFreezeCB(const char *name, uint32 a, uint8 v, int compare,int s,int type, void *data)
{ {
return ((QHexEdit*)data)->FreezeRam( name, a, v, compare, s, type ); return ((QHexEdit*)data)->FreezeRam( name, a, v, compare, s, type );
} }