-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run-ahead issues with 32X #156
Comments
I have done some work on save/load stuff which is also used by run-ahead. Could you try this again please, with a core having at least revision 688c90d? |
Tested briefly, looks like it's still glitchy using 688c90d. It still disables on its own when pressing a button, then there are the weird issues after closing content and starting again, etc. |
Is this happening too when saving? |
Pressing F2 to save state doesn't disable run-ahead, however |
Hmm. Which platform? Is this only with 32X games? How about MCD, MD, SMS, GG? |
Windows 10 64bit, I could try to reproduce on a Linux VM and Android a bit later. Run-ahead + states work fine with MD, SMS and GG AFAICT, with MCD it seems broken after the BIOS however, graphical glitches in Night Trap for example: with this kind of stuff in logs:
Sonic CD freezes multiple times on its main menu, once in-game it is playable but a bit slow, states work. |
I think this is due to the fact that save states can't grow over time in retroarch, which is what's happening with 32x, where save states get bigger after 32x is released from reset by the 68000. Try enabling runahead after the image ran up to the sega logo. |
Oooh, yeah if I load Chaotix and enable run-ahead only after loading a level it works fine then! |
There's no always-working easy test for a rom to check if it's using 32X or not. There's a field in the header which should carry this information, but it's presumably not always correct since it's not checked by the system (e.g. the original Sega SDK sample programs don't have it ;-)). |
OK, thanks for the replies and explanation! Seems tricky to handle indeed... :/ I don't use run-ahead anymore so not affected by this issue anymore but I'm always up for testing stuff, so if you ever come with an idea don't hesitate to ping me (here or on Discord) if you need a tester. Or I can just close the issue if you don't think it'll be possible to fix on the core side. |
I'm going to change the max calculation to always include the 32X stuff for MD/MCD. I guess the memory would only be relevant to something like the PS2 (if it offers run-ahead at all). Less ancient systems should probably have enough memory to handle this. |
I changed something in my repo to cover this, fixing 2 other bugs on the way. It should improve on both MCD and 32X run-ahead. Could you please check this? |
Run-ahead isn't disabled as soon as you press a button anymore, so progress! :D There are still some weird issues however in 32X and MCD (32X or not) with the image being frozen sometimes until you press or release a button:
And here's a quick video showing a few issues I've encountered in Sonic CD: picodrive_runahead.mp4You can see the intro glitches, the black screen on loading level, the freeze when hitting a sign and during the boss. For every of these glitches I have to either press a button or release the button I was holding during the freeze. That was with irixxxx@92f7a43 |
Ouf, I made an error merging from the dev branch to master. Could you please try this diff, please: |
OK just tried, all these weird image freezes are still there unfortunately. |
Is run-ahead configured as 2nd instance for this? |
Yup, 2nd instance ON and a single frame of run-ahead. Without 2nd instance Chaotix doesn't even boot, it stays on a black screen, MCD seems fine however. |
Could you recheck with the latest from my repo please. I've tried to fix some save/load problems and improve timing accuracy some, for md, mcd and 32x a bit. If possible do so in both one and two instance modes. |
Seems good with 2nd instance now 👍 No more weird image freezes or glitchy FMVs, etc. Without 2nd instance Chaotix now boots, but sometimes it can't load the level, Knuckles keeps spinning for ever in a completely black background: 32X_no_2nd_instance.mp4And sometimes it loads just fine 🤷 Same with content restart, sometimes it works fine sometimes it just freezes. I wasn't able to reproduce these 2 issues with 2nd instance. |
I had a small regression in that code which I fixed. Don't know if it is related though. |
Yeah I was able to trigger the bug after a few retries, so probably unrelated. Wish I knew how to reproduce consistently, seems completely random when it happens :/ |
Can't reproduce it under RA on x86 linux :-( |
What's your run-ahead config for this? What exactly have you done? |
In Settings > Latency:
I don't do anything special in-game, just starting it, pressing Start a few times until it loads the 1st level then it's random, either it'll load properly or Knuckles will spin indefinitely on a black screen. |
No luck with these settings, in a Ubuntu 20 64bit VM... |
Damn :/ Just tried on a fresh install of RA to make sure it's not a setting messing with this but nope, I was able to reproduce the bug after 5 or 6 tries. |
Hmm. I'm doing this:
that has succeeded for at least 30 times. |
MD5: 47B1095E68B053125CD2CD5B1AC4EB50 which matches No-Intro database. Only tested with the "(Japan, USA)" version. I'm building the core from your repo by simply using edit: Hm, looks like I can't reproduce the bug with the EU version 🤔 |
Your build is fine. I have 2 different md5sums for my 2 versions, though. |
No idea if this is a useful info or not but I just tried disabling dynarec from the core options and it seems to get rid of the issue, although it's always hard to tell for sure due to the random nature of the glitch, but I wasn't able to reproduce in ~50 tries. |
The timing isn't identical with interpreter and drc. The interpreter maintains the cycle counter on an instruction base, while the drc is doing this on a block base (a block being instructions from an address jumped to and the next jump). The drc is usually overdrawing its cycle budget for some instructions, while the interpreter stops after the instruction where the cycle budget runs out. |
I did more improvments on saving/loading states, which might help here. You might want to check it out. |
After some quick tests it seems to be fixed 👍 Just to be sure I'll do more tests later then close the issue if I can't reproduce anymore :) |
Sorry for the delay! So yeah I can't reproduce the Chaotix bug anymore with single instance, however I have another issue in Night Trap (the 32X version): cameras are replaced with a still image from the intro movie. Here's a video (you can skip to 0:40): NT32X_edit.mp4I don't know if the poor performances are normal also, sound is terrible and video stutters but since it's running without second instance maybe it's normal? |
Is this running OK without run-ahead? |
Yeah, without run-ahead or with run-ahead + second instance it runs perfectly fine, it performs great and the cameras work properly. |
While reproducing this issue: https://www.reddit.com/r/RetroArch/comments/ni4vwo/picodrive_32x_and_runahead/ I noticed multiple issue with run-ahead and 32X games:
Video to show the issue in action (with second instance), and step-by-step of what I'm doing and what's going on in it:
2021-05-22.12-06-53.mp4
So yeah, super weird 😅 Is it even normal that run-ahead is disabled for 32X?
The text was updated successfully, but these errors were encountered: