For Qt version: Cheat codes with addresses ending in '0' are getting truncated. This … (#350)

* Cheat codes with addresses ending in '0' are getting truncated. This is due to the masking at line 141 (cheatAddrEntry->setInputMask( ">HHHH;0" );) combined with
cheatAddrEntry->displayText() on 860/934.
As per: https://doc.qt.io/qt-5/qlineedit.html#inputMask-prop

"When an input mask is set, the text() method returns a modified copy of the line edit content where all the blank characters have been removed.
The unmodified content can be read using displayText()."

So an address of "00B0" is returning as just "B"(as the mask as determined that 0 is a blank character. Which is what you want for an empty input
 field to have all 0;s.), which, when entered as an address, is just 0x000B. Fixing that by replacing text() with displayText() as
per documentation.

* same issue with cheatAddrEntry->text() exists with cheatValEntry->text(). Replacing those with displayText() as well
This commit is contained in:
sleepingkirby 2021-05-13 07:30:08 +08:00 committed by GitHub
parent e9a85d2e1c
commit 884bf21d4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -857,9 +857,9 @@ void GuiCheatsDialog_t::addActvCheat(void)
int c = -1;
std::string name, cmpStr;
a = strtoul(cheatAddrEntry->text().toStdString().c_str(), NULL, 16);
a = strtoul(cheatAddrEntry->displayText().toStdString().c_str(), NULL, 16);
v = strtoul(cheatValEntry->text().toStdString().c_str(), NULL, 16);
v = strtoul(cheatValEntry->displayText().toStdString().c_str(), NULL, 16);
cmpStr = cheatCmpEntry->text().toStdString();
@ -931,9 +931,9 @@ void GuiCheatsDialog_t::updateCheatParameters(void)
}
//printf("Row: %i \n", row );
a = strtoul(cheatAddrEntry->text().toStdString().c_str(), NULL, 16);
a = strtoul(cheatAddrEntry->displayText().toStdString().c_str(), NULL, 16);
v = strtoul(cheatValEntry->text().toStdString().c_str(), NULL, 16);
v = strtoul(cheatValEntry->displayText().toStdString().c_str(), NULL, 16);
cmpStr = cheatCmpEntry->text().toStdString();