libretro / fuse-libretro

A port of the Fuse Unix Spectrum Emulator to libretro
GNU General Public License v3.0
36 stars 47 forks source link

Cheats with multiple pokes per cheat #63

Closed 2xtime closed 5 years ago

2xtime commented 5 years ago

Hi, I just tried IK+ and enabled the cheat to 'Always Play On'. But by doing this, after a few seconds the players freeze. I tried the original .POK file on Windows Fuse and it works fine. I noticed that this cheat uses two pokes and looks like this in the .CHT file -

cheat0_code = "M 8 32857 175 0\nZ 8 32858 201 0"

Is that \n supposed to be a new line and is it being handled properly ?

IK+ & Cheat.zip

2xtime commented 5 years ago

@leiradel I checked a few more (Barbarian, Batman, Manic Miner etc.) and all the cheats that use multiple pokes (they contain \n) don't work. It's obviously something to do with the \n. Any chance you could fix this please as there are a huge amount of cheats that won't work.

P.S. I double checked that they worked using the original .POK file and they do (on Windows Fuse).

leiradel commented 5 years ago

Thanks for the report, I'll take a look.

2xtime commented 5 years ago

@leiradel Sorry for being impatient ! Have you had a chance to take a quick look yet ? Is it anything to do with line 1144 of this commit https://github.com/libretro/fuse-libretro/commit/5a024e2da4a8ef12d91508646744ab14cae2cd49#diff-7a88199b5738262c9fda4a6bf68eb68cR1144 ?

ghost commented 5 years ago

@leiradel Any chance of fixing this ?

leiradel commented 5 years ago

@2xtime what appears in the log when using the cheat provided in .cht file above, IK+ & Cheat.zip? You can filter RetroArch's output with | grep "Enabled cheat".

ghost commented 5 years ago

My adb log doesn't really say anything -

I/RetroArch( 2304): Enabled cheat #0: M 8 32857 175 0\nZ 8 32858 201 0
I/RetroArch( 2304): Applying cheat changes.

What @2xtime said, the players freeze. I also tried the other games he listed and the pokes that contain \n don't work (which there are a lot). Have you also tried them ?

leiradel commented 5 years ago

It's fixed in https://github.com/libretro/fuse-libretro/commit/ed4fc305b8ffc863207d535028b28a04de45a47a

The buildbot will recompile the core, I'll close this issue when someone confirms it works.

ghost commented 5 years ago

They work now, thanks. I tested the multi-line cheats for IK+, Batman and Manic Miner and they all now work correctly.

I also found a minor bug with the control mapping. If you change the main fire button in the Core controls then you cannot select any keys on the on-screen keyboard.

leiradel commented 5 years ago

Great. Could you open another issue with this control mapping problem? Please add the steps to reproduce the problem.

Thanks.