-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
VI: derive field timing from VI registers #2686
Conversation
Seems to fix this issue: https://code.google.com/p/dolphin-emu/issues/detail?id=7734 (Baten Kaitos Eternal Wings and the Lost Ocean Flickering in PAL version) |
Sonic Mega Collection: Blue Sphere has severe flickering in this; works in Master. |
FIXES NES PAL GAME AUDIO. |
Fixes the Wind Waker PAL50 Hang. |
Metroid Prime 3 no longer shits itself in Real/VirtualXFB |
Metroid Prime 2/3 no longer suffer from the black bar glitch with XFB enabled. |
Actually it seems that all the abnormal speed issues with virtual console games are fixed by this one with no need for progressive scan either in the snes and genesis games that needed it for normal speed. Neo geo games also work fine with no speed issues. |
nice. can NTSC_FIELD_RATE + etc be removed now? |
Ok, i did some more tests with Baten Kaitos. First, the flickering goes away(on master) when using an AR code to force the game to play at in 60/30 instead of 50/25 Hz mode. Also the small black bar at the bottom goes away in 60/30 Hz mode. I kinda expected this, because the NTSC version does not have flickering. The screen wobbles with virtual xfb with this pr. That is already known, but it randomly decides to flicker as well. When it flickers, it flickers above the screen in 50 Hz mode, and below the screen in 60 Hz mode. This can only be seen in windowed mode, see screenshots: Could the randomness be related to the game changing between 25/50 Hz modes? Could anything be related to the game using still pictures. I mean, the game does something weird with the nintendo logo at startup. If the window is resized, the logo does not change accordingly and stays at the same x/y position in the window at the same size. On master, the fps is 0(vps 50) at that time, and the logo does not flicker like the rest does. |
465f5bf
to
8e74842
Compare
54000000UL, | ||
}; | ||
|
||
static u64 s_ticks_last_line_start = 0; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
If the game changes modes (or does other things which could produce random/ugly output for a small time period), they should disable VI during that period, which results in a black screen since nothing gets drawn out. I'm not sure if this works correctly on dolphin. |
@@ -66,7 +66,7 @@ static Common::Event g_compressAndDumpStateSyncEvent; | |||
static std::thread g_save_thread; | |||
|
|||
// Don't forget to increase this after doing changes on the savestate system | |||
static const u32 STATE_VERSION = 44; // Last changed in PR 2464 | |||
static const u32 STATE_VERSION = 45; // Last changed in PR 2464 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
53bcfcf
to
4ea30db
Compare
@shuffle2 Yes, I've removed NTSC_FIELD_RATE et al. |
Is this ready to go? It would be great in the progress report! |
I think it needs to have the progressive hack put into it... It has a screen shaking issue in interlaced mode. |
48658a9
to
fb83ddc
Compare
Progressive hack added (see updated description in first comment). Only issue I'm still aware of is the Baten Kaitos problem @mimimi085181 mentioned. Could we get some clear repro steps with settings/etc? |
"Force Progressive Output" isn't a useful option to expose in the UI. I mean, it's useful in theory, but there isn't any point without actual interlacing support. |
I have to agree with magumagu, the option doesn't even do what it says, the main force progressive hack stays enabled. |
I'm wondering if progressive has actually ever worked properly? I'm assuming I've made a silly mistake somewhere, but here's what I've found: In current master (567d0b2...) Here's a filtered extract of the log:
The milliseconds between frames: 31, 31, 32, 31, 31. This corresponds to 1000/31 ~ 30-ish Hz. For Progressive (480p) we'd expect 60Hz... Looking at the code, Progressive is not interlaced so Progressive frames are emitted at line 1 of the scanout. The number of lines "virtually scanned out" is It looks like the second field is being counted through, but nothing being scanned out. A similar log generated in this PR:
The milliseconds between frames: 15, 16, 15, 16, 16. This corresponds to 1000/16 ~ 60-ish Hz, in the ballpark of what's expected. |
Progressive Scan + XFB outputs only half the frames in master (and this PR.) Perhaps related? Try playing F-Zero GX with it, it's full of sadness. Same with Wind Waker. |
Did a lot more testing and determined that the framedrop bug for Progressive Scan + XFB is fixed in single core within this Pull Request, but dualcore is broken still. @phire I think this is the only thing blocking virtual/hybrid XFB from moving toward default. Testing wise, LGTM. |
SyncGPU + RealXFB + Progressive works as well, as per @phire's request to test it. |
I found out that the Dualcore + RealXFB problems were due to it maxing out my GPU. Damn. There are literally no more problems/regressions with this, full LGTM this time. |
As I say that, I found a regression. Sonic Mega Collection games, such as Sonic And Knuckles suffer from constant flickering. |
Oh, one final think we need to solve before merging is the mystery of why FifoCI is rendering double frames. I didn't think Fifoplayer touched VI at all. |
Does the Fifo-Log include all those fields? Maybe they were actually interlaced or something, which now works correctly? |
fifo logs don't have the VI at all, only the XFB copy. That's why XFB is disabled on replaying fifo logs. So I wounder what's wrong here. I guess it's because of our (crappy) frame replay on avi dump: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/AVIDump.cpp#L231 We try to get a constant FPS there. Maybe this is wrong with the new VI code. |
While FifoPlayer has a very slightly different idea about cycles per frame. |
Couple of things I noticed. Virtual XFB on OpenGL still has stuff showing up below the bottom of the screen. D3D isn't doing it, so, I can't ponder a guess as to why. Sonic Mega Collection is still flickering. That's not good. At least Master + PR NoXFB are the same (flickering), but for some reason there's a regression on Virtual and RealXFB causing them to flicker too. |
magumagu@f93c87e contains a corrected implementation of the ForceProgressive option. |
Fixes Hydroventure (Fluidity PAL) in PAL50 mode. |
df4d6dc
to
187ab67
Compare
Virtual XFB is 100% broken in the latest version of the PR. Jitter bug is still there in RealXFB. Edit: Virtual XFB is broken only with force progressive off. |
Force-progressive being disabled while interlaced output is being emitted is expected to be broken at the moment. Earlier, it would force the effect of 'force progressive' to happen anyway. Now it actually tries to send the correct interlaced parameters to the code that scans out the image, but that code doesn't handle it properly (...yet). This is the effect of magumagu's patch mentioned above. |
Fair enough then. |
Bugfix: TargetRefreshRate uses rounded result NTSC's 59.94 was becoming 59 with integer division.
LGTM |
LGTM. Sonic may need interlacing support, and this fixes a ton of other games. |
VI: derive field timing from VI registers
Rather than hard coding field timing for PAL/NTSC/Progressive this should derive it from the values set in the VI registers.
This PR also adds an option to enable/disable the forcing of interlaced to progressive fields. The option is not exposed via the UI. It defaults to ON and when on forces interlaced video modes to emit full progressive fields. This restores the old force-progressive hack but makes it optional via INI edit.
PR created to trigger builds for testing.
Some problems:
% in title bar seems to be slightly off.Interlaced signal gives the one-line-jitter problem (again)save state version has been bumped, might need to be updated later on