Mte90 / GBAATM-Rebirth

From the original source code a new rebirth, to add a Trainer in your GBA roms!
GNU General Public License v3.0
58 stars 3 forks source link

Plain text cheat not working like original GBAATM #4

Closed blackrose28 closed 4 years ago

blackrose28 commented 4 years ago

In rom 0171 - Golden Sun (U)(Mode7).gba, when I input the cheats like this:

No Random Battles 3200047A 0000

Max Money 82000250 E0FF 82000252 05F5

The original GBAATM would generate correct cheat code in output file, but GBAATM-Rebirth generate it wrong. This can be check via cheat menu

blackrose28 commented 4 years ago

QTextStream(stdout) << QString("Parsed cheat char %1\n").arg(strptr);

I believe this was the problem, it modify cheatcodechar variable

Mte90 commented 4 years ago

Hi thanks for the hints, I will do debugging. Right now the code has a lot of memory leaks and I was thinking to do a refactoring to avoid this issues.

Can you share the output file you mentioned?

About the line you mentioned https://github.com/Mte90/GBAATM-Rebirth/blob/master/core/cheatcodes.cpp#L427 I saw that without this line the cheat is broken in my tests, this was one of the reason of my refactoring thoughts.

blackrose28 commented 4 years ago

No need to see the output file, when I debug with QtCreator, right after running that line, the cheatcodevar was modify into: "P", messing up the big for loop

Mte90 commented 4 years ago

Ok is more clear now, I was thinking that you generated a file modifying the code.

I have to test again with koh (the rom I used for testing without that line if everything is ok).

Mte90 commented 4 years ago

I think that this issue is part of https://github.com/Mte90/GBAATM-Rebirth/issues/3

Mte90 commented 4 years ago

Line removed seems that the error is not happening anymore, maybe the refactoring I started helped.