libretro / beetle-vb-libretro

Standalone hard fork of Mednafen VB to libretro.
GNU General Public License v2.0
25 stars 40 forks source link

(Regression) Runs too slow on the Wii/Wii U #48

Closed Cee123 closed 4 years ago

Cee123 commented 4 years ago

Suddenly this core is running far too slow on the Wii when it never used to. Not really sure what the problem is. It's also too slow on the New 3DS overclocked.

ghost commented 4 years ago

Yeah, it took like a 40% nosedive. I've got a few ideas to look into but it could be the new FPU and Exception handler code it uses.

inactive123 commented 4 years ago

That's pretty bad to hear. We really need to be on the lookout for this whenever somebody sends a commit updating code from an upstream version. We need to try to retain performance. If it's not possible, we need to perhaps create a separate core meant for platforms where the current mainline version cannot run at fullspeed. Upstream might not care about these older platforms, but we do.

Cee123 commented 4 years ago

Yeah, it took like a 40% nosedive. I've got a few ideas to look into but it could be the new FPU and Exception handler code it uses.

Oh ok. It may just be something small but who knows. I'm glad it's not just me then and that others have noticed the same thing. Good to know at least.

Cee123 commented 4 years ago

That's pretty bad to hear. We really need to be on the lookout for this whenever somebody sends a commit updating code from an upstream version. We need to try to retain performance. If it's not possible, we need to perhaps create a separate core meant for platforms where the current mainline version cannot run at fullspeed. Upstream might not care about these older platforms, but we do.

Absolutely. So true.

ghost commented 4 years ago

Checked mednafen-endian but compiler is smart enough to optimise it. Which leaves this one: https://github.com/toufy/beetle-vb-libretro/blob/master/mednafen/hw_cpu/v810/v810_oploop.inc#L85

Upstream Mednafen turns this on for most non-msvc compilers so I'll try figuring out how to flip the switch and see where we go. Reuse some old files if needed (thank you github!).

edit: Quick dirty hack test. No change. Huh. :mad:

ghost commented 4 years ago

Nothing budges the number. Upstream changed from "native float" to "int64" math, which must explain the problem as I've tried other tweaks.

Cee123 commented 4 years ago

Is there anywhere we can download the older version of the core? The one that worked well without the framedrops.

ghost commented 4 years ago

Older versions: http://buildbot.libretro.com/nightly/nintendo/wii/ http://buildbot.libretro.com/nightly/nintendo/wiiu/

Did the FP math really damage the speed that badly? If it's guilty, I'm wondering if some macro can be installed like FP_FAST that will use the old files. Maybe I'll try this myself since the hit is painful.

Cee123 commented 4 years ago

That's no good. That only goes back to about a month ago.

I tried earliest nightly 1.7.8 version from 16/09/2019 but the issue is still there and seems to have been there for quite some time.

Somehow we'd have to dig up an older version possibly from months ago or even last year.

ghost commented 4 years ago

Wii test 2019-01-03 core 2019-11-14 retroarch http://s000.tinyupload.com/index.php?file_id=08503984831439140149

Cee123 commented 4 years ago

I'll try that version. Thanks heaps!

I also found a Spanish website with older versions but I had to translate it using Google https://wii.scenebeta.com/noticia/retroarch-wii

Cee123 commented 4 years ago

Wii test 2019-01-03 core 2019-11-14 retroarch http://s000.tinyupload.com/index.php?file_id=08503984831439140149

Excellent! Thanks very much. I can confirm that version you sent runs at the proper speed.

ghost commented 4 years ago

Great! Here's the next one from 2019-05-26 http://s000.tinyupload.com/index.php?file_id=07660863519468334414

If this runs slow, go to options and set "CPU emulation" from "accurate" to "fast". Close Game. Load game. And try again.

Cee123 commented 4 years ago

Thanks! That seems to work as well. It did run slow at first, so I set it from "accurate" to "fast" and then I saved the core overrides so it keeps that setting for all the games. Although I'm not sure if there's a difference in performance between those two versions.

Cee123 commented 4 years ago

Wonder if that option would also work on the 3DS.

ghost commented 4 years ago

3ds for 05-26 http://s000.tinyupload.com/index.php?file_id=83870838786344457142

I'll try compiling 05-30 for 3ds and wii when I get a chance.

Cee123 commented 4 years ago

I kept that first version for the Wii as it seems to work at the proper speed, the second one was good but for some reason felt like it was running on frameskip and there were still the occasional frame drop of about 3-5fps.

Cee123 commented 4 years ago

3ds for 05-26 http://s000.tinyupload.com/index.php?file_id=83870838786344457142

I'll try compiling 05-30 for 3ds and wii when I get a chance.

Thanks! I'll try that one out on the 3DS as well.

ghost commented 4 years ago

05-30 both http://s000.tinyupload.com/index.php?file_id=02234904961456673138

You can try fast-forward to see max fps.

Cee123 commented 4 years ago

Thank you heaps. I'll try those ones out too.

I appreciate the kind help and you taking the time to gather those versions. Can't thank you enough!

ghost commented 4 years ago

Weird thing is for Wii 01-03-2019 = fullspeed

05-26-2019 = not much changed other than accurate flag https://github.com/libretro/beetle-vb-libretro/commit/1bdd3a0ec30bc4bd4e98bd64594ccdf16291ce98

But you're getting some stuttering on 05-26 which I can't explain from the changelog. I'll look at it some more because I'm still interested.

Cee123 commented 4 years ago

It's interesting. But I don't know if there is that big a difference between the fast setting on 05-26-2019 and the regular speed on 01-03-2019. But it does feel a bit like it's frame skipping as opposed to running that speed normally. I don't know, I could just be imagining it. Either way, it's interesting comparing the two versions.

ghost commented 4 years ago

Could be possible it dips once a while. Compiler has to predict between fast and accurate now. Before it was always fast and could throw away unused parts of code. Wii is more sensitive to forced inline code and such.

Is there a way to play nice? I might try churning out something to verify.

Cee123 commented 4 years ago

Whatever you guys have done with the latest versions, it's working fine now. It doesn't have the slowdowns anymore. I'll close this.