Bsnes Hd input delay

I won’t say “never” but cheats and achievements are going to be very difficult to add to this core.

1 Like

Hi @Sour,

Sorry to bother you again. I don’t know it the buildbot has not compiled your latest changes yet, but I’ve tried to update the core right now to test the cheats functions, and does not seem to work. Tried F-Zero and Super Mario World, both GameGenie and Action Replay chjeats, and neither of them apply.

The core version on RA only says “Mesen-S (0.2.0)”, so don’t know if it is an updated build or not.

Greetings.

It looks like the buildbot was failing to build the core because of the changes I did to add the cheats to libretro - it should be fixed now, so the next build the buildbot makes (within the next few hours most likely) should have cheat support working (hopefully)

1 Like

Sorry to say @Sour,

Not working yet on my end.

Greetings.

I just retested to be sure and it seems to be working properly on my end. How are you trying to input the codes? Are they game genie codes? For game genie codes, you have to put the dash (otherwise the core will process the code as a pro action replay code)

If that doesn’t help, let me know what game/codes you’re trying to use and I’ll check those specifically.

1 Like

Hi @Sour,

Ok, after your comments I’ve done some extended testing. Seems like Game Genie codes work well, but Action Replay codes don’t. I’m using RetroArch cheats (downloaded fromn the built-in updater). It has mixed GameGenie and Action Replay codes. I’ve been testing those ones:

Super Mario World (USA) Cheat file: Super Mario World (World) (Action Replay).cht I’m selecting the code from RA menu, but opening the file with a text editor, the cheat I’m trying to use is: cheat0_desc = “Mario Cape” cheat0_code = “7E001902”

It does not work. It does work on snes9x.

Unfortunately, there is no GameGenie cheat code on RA’s database for Super Mario World, but I’ve tested FD-Zero (USA), as there are GameGenie and Action Replay codes for this one. In fact, GameGenie codes are working: Game: F-Zero (USA) Cheat file: F-Zero (World) (Game Genie).cht Cheat tested: cheat4_desc = “Infinite Turbos” cheat4_code = “D484-D404” Result: Works!

But the same cheat on Action Replay format doesn’t work: File: F-Zero (World) (Action Replay) Code: cheat0_desc = “Infinite Turbos” cheat0_code = “7E0CF303” Result: Does not work.

So, seems like GameGenie codes work, but the Action Replay codes don’t. I’ve done additional tests with Mega Man X and Contra III, and it happens the same.

Greetings.

Thanks for testing! Turns out the problem was actually not specific to libretro. Some PAR codes for work ram (those starting by 7E0 and 7E1 specifically) weren’t being applied on all equivalent memory addresses, which was causing the cheats to not be applied properly in most scenarios.

This should be fixed now, so the next build should hopefully be working properly.

Hi @Sour,

Yes, cheats are working properly now, according to all tests I’ve done. Thanks for that! Unfortunately, Runahead seems to be broken now. Not only runahead, savestates are not working. You can save a state, but when you try to load it, RA itself freezes.

Greetings.

Any specific game? Both save states & runahead seem to work for me. I did change some things in the save states, though, which means previous save states will probably crash/fail to load (need to change it one more time to ensure it just doesn’t load the state instead of crashing the application)

Beyond that, though, it seems to be working correctly when loading newly created states on my end.

Hi @Sour,

I tried with a fresh install again, and I still have the same problem. I’ll try to give you all the info:

Downloaded and installed RetroArch 1.7.9 (windows 64bit). All default config parameters. Start RA > Online Updater > Update core info files. Online updater > Update core > Select Mesen-S. Start content > Super Mario World (USA) with Mesen-S core.

Game starts. I can save state. When I try to load a state, it crashes.

I’ve done same tests with Contra III (USA) and Mega Man X (USA). All of them no-intro dumps. I don’t think it’s game-related.

I’ve repeated the tests with a fresh new RA build, this time not the 1.7.9 stable, but latest nightly from today. Repeated same steps. Same results.

I’m on Windows 10 Pro 1809 64bit, AMD Ryzen 3 2200G w/ integrated VEGA graphics. 8GB RAM. At this point, if you cannot reproduce this, could it be windows specific? I’ve tried with a fresh 32bit build, same results.

I’ve also tried running RA with admin privileges, same results.

I’ll try tomorrow on a different machine (my gaming pc) to see if results differ.

Greetings.

I’m fairly certain I’ve found and fixed the problem. Essentially the bug only occurred when compiling with gcc or clang (which is what the buildbot uses), but not with msvc (which is what I’m using locally.)

It was caused by some of the save state changes I did a couple of days ago. The next build should hopefully be working properly.

1 Like

Hi @Sour, Well, indeed now runahead/savestates are working again. Cheats are working too… but something feels wrong. I’ll try to explain it the best I can:

-Running a game with RunAhead (second instance): Apparently works ok, but sound crackles a bit every one or two seconds… Feels like it has problem to achieve fullspeed, or like if states weren’t consistent enough. I’m discarding being it a problem of my PC performance, as I have a Skylake I7-6700K clocked at 4.2GHz, 16GB DDR4 Ram, GTX9700 gpu. Anyways, gamespeed seems to stay at fullspeed.

-Running a game with Runahead (single instance): Now game is much slower. It does not have sense, single instance should be faster than running two instances of the emulation, but in fact single instance it’s like half speed more or less, and of course sound crackles alot.

I tried cheats while running runahead (both single and second instance modes), and things become weird:

First I’ll explain a real scenario and how things should work (like they do on snes9x): Playing Super Mario World, applied “Mario Cape” cheat. This cheat applies your character with the infinite cape powerup. You never lose the powerup even if an enemie hits you (the cheat will turn your character automatically to Mario Cape-powered again after losing it). So essentially with this cheat you never die by being hit by an opponent. Besides that, with this powerup when you jump you’ll be falling slowly (you can control your landing). Besides that, if you keep running for a few seconds and jumnp, you’ll literally fly very high. Oh, and you can also kill enemies pressing Y button, which makes your character rotate and the cape rotates with you killing enemies if hitting.

Ok, let’s see what happens with different configs on Mesen-S:

-Runahead second instance + cheats: It’s like if game logic was affected by the applied cheat, but video output is not. Mario sprite is the little one (no powerup), but you have the mario-cape powers (fall slowly after a jump, you can kill enemies with Y button, and you can do a fly after running for a while and jumping). If you are hit by an enemie, for the next 500 milliseconds you can see Mario sprite dying (which is what would happen if you have no powerup), but half a second later you can see Mario again (little one, no powerup) and you are not dead, you keep playing, and you are still keeping your Cape powers.

I think it’s hard to explain, and sorry for my poor english, it’s just my third language. But, in essence, it’s like game-logic being affected by the cheat, but the video corresponding to an instance not affected by the cheat? If I haven0t explained myself well enough, I could make a video of the several explained scenarios.

-Things are different with Runahead single instance: With single instance, cheats seem to be working correctly. Game-logic and video output seem to be synchronized. You get the cape, Mario sprite is Mario-Cape, and such…

Well, I hope to be helping you with all these bug-reports, would not like to be pissing you off :slight_smile: Greetings!

Does that sort of thing work with other runahead-compatible cores? That is, cheats+runahead? I ask because it may be a limitation of the second-instance not getting cheats loaded.

@hunterk it works perfectly with snes9x core. Also tried with genesisplusgx core for some genesis games and it works ok there too.

1 Like

Thanks for the report!

As far as I can tell, it looks like this is a bug in RetroArch. The cheats don’t seem to be applied to the “secondary instance”, which is causing the glitches. I’m assuming it works in snes9x because the cheats permanently alter the values in RAM when they get enabled (and this is not the case in Mesen-S) I’ve opened up an issue on RetroArch’s github about it: https://github.com/libretro/RetroArch/issues/9639

For the performance part, I think it might be in part because the buildbot uses GCC to build the Mesen-S core, and GCC usually hates my code (for reasons I have not quite figured out.) Building with clang often results in a 30-40% performance boost I think, so might be worth looking into making the buildbot use clang for this core instead.

1 Like

Hi @Sour,

Thanks for opening the issue. And have a nice weekend!

For me, Bsnes core does not work with runahead correctly, it causes weird issues. Best example is Megaman X, when charging the weapon while jumping, moving etc. the weapon will randomly shoot as if the button was let go. Sometimes it’s just a visual artifact and does not really shoot.

Super Mario Allstars is similar, but here it almost seems the game rewinds sometimes and weird things occur.

I don’t use any cheats, and have not found any settings that would change the result. If it matters, I’m on Windows, GTX 1070, Intel 6700k. I update retroarch and cores using stellaris and should have the latest. Bsnes proper does not do this.