-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
nv2a: Handle SIZE_IN > SIZE_OUT case #1178
nv2a: Handle SIZE_IN > SIZE_OUT case #1178
Conversation
This comment was marked as spam.
This comment was marked as spam.
Excellent. I was able to figure out why the tests were breaking, but fixing that also slightly changed the behavior; rather than immediately tearing down the overlay it looks like it just freezes the frame. Will push a new change in a couple hours when I can get back to this. UPDATE: It doesn't freeze the frame, it looks like it actually just treats the input size as the same as the output size and that this is generally the case (setting SIZE_IN to 2x SIZE_OUT acts as though they're equal, it does not scale the content to fit SIZE_OUT) |
2be5703
to
b5ce084
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
That one is unusual since the in_size is already equal to the out_size and all of the values other than pitch look reasonable. I think this is a different bug and should be filed separately. I'll write a separate test that lies about the pitch and see how the HW behaves. I also just ordered the game and can look at it in a couple weeks when it arrives. UPDATE: from my test it looks like the hardware can handle the pitch being < the expected pitch just fine. It still respects the pitch, so you can get a staircase effect. |
Can you enable the As far as I can see from my test case, it is valid to give an incorrect (larger than output) size and the hardware does not tear down the display, so something else must be happening for these games that exhibit issues without the need to eject the disc or reset. |
This comment was marked as off-topic.
This comment was marked as off-topic.
In the monitor If you're running with this PR it sounds like you shouldn't hit the assertion (for |
This comment was marked as outdated.
This comment was marked as outdated.
You can in GDB; set a breakpoint in |
This comment was marked as off-topic.
This comment was marked as off-topic.
`NV_PVIDEO_SIZE_IN` is set to 0xFFFFFFFF during initialization and teardown of the PVIDEO overlay. In some cases this can happen before the overlay is explicitly stopped, leading to an assert. On hardware SIZE_IN values larger than SIZE_OUT are capped (content is not scaled). Fixes xemu-project#330 [Test](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/pvideo_tests.cpp)
b5ce084
to
fd2b0d4
Compare
Ping #general or #help, it's not something related to this code review :) Can you check Midway again with the latest version of this PR? I confirmed that a pitch less than a full row is supported by the hardware and removed the assert. The output doesn't exactly match HW but is close. Also looking at the log you posted, I don't see an explicit teardown of the PVIDEO, but I do see some writes to PVIDEO registers that I've not seen before so I'm guessing that may be what's missing. Will write another test case to see what happens when I duplicate what I see logged. UPDATE: Writing to those registers has no effect, so I'm not sure what causes the PVIDEO to be hidden in that game. As far as I can see the overlay should remain up forever... |
@Triticum0 can you test all games again with the commit I just now pushed (sorry to keep asking for retests!) I don't see anything in the Ultimate Beach Soccer log that looks like it should tear down the overlay, but I also have checked a number of games and only see 0xFFFFFFFF being used when video is about to be shown (immediately replaced with a valid size) or about to be torn down (promptly followed by a write to the STOP register with the low bit set). Thus I think it's safe for now to treat it as a command that should just hide the video. If we find a real world case where this causes a problem (e.g., a video overlay blinking or disappearing) we can dig into how UBS is causing the overlay to be hidden and remove the FIXME that I added. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as outdated.
This comment was marked as outdated.
If you can let me know if the behavior is the same after the latest commit I can take a look. From the log you sent I'm not sure how this could happen, as the size in is clearly less than the size out except for the end of the video when it sets it to 0xFFFFFFFF
So for the frames in the log, the change should have no effect at all until the part that would've asserted. It may be that there is some initial frame that isn't in the log that has things mismatched, but the output size and position are controlled by the out register and not influenced by this PR. If it's still doing this on with the latest commit, can you get a |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
3d5b8e7
to
9a39898
Compare
@Triticum0 there was a silly mistake in the way I was doing the scaling, fixed now. I don't think it matches hardware but hopefully looks better now. |
Still has the orginal issue as before im using a usa verison i redumped it off my xbox again just to make sure the dump wasn't causing any issue hopfully this log will be more useful Here another log 2022-07-12.00-19-51.-.Copy.mp4 |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm confused as to how it's behaving so differently from my tests using the exact same parameters.. You don't have to capture any more logs, none of the changes I'm making to attempt to fix the scaling will have any effect on what is logged so there's nothing useful in there. What are your View menu settings (resolution scale and display mode)? |
Also this fixes breaks other games with seeing over y axis top boarders as well as misalignment on fmv other than the games affected. |
Can you give me a few examples? That'll probably help me figure out where things are different. I've been using Serious Sam as a spot test, the intro FMV looks correct to me, as does the video that plays on the loading screen. |
Update: I found a video that ends up being wrong, the THQ intro for Spongebob. Will debug and push another fix. |
scaled and 1x internal resoultion. The seeing over y axis top boarders only occurs on pal region game i tested call England International Football on the codemaster intro |
9a39898
to
f241ce1
Compare
There was a conflict between the way I was blindly capping width/height in the older commit and the correct handling of the dIn/dOut registers. The output of the pgraph test now matches HW and the Spongebob THQ video (720x480=>640x480) is no longer wrapping incorrectly. @Triticum0 can you check again with this new commit? |
yes, give me 15 mins |
I retested it looks correct there are just now 4 diffrent screens simultaneously 2022-07-12.02-34-27.-.Copy.mp4 |
I went ahead and ordered the game, it's not clear to me why the behavior differs so much between what you're seeing and what I see in other games and my test program. Will come back to this in a couple weeks when it arrives. I am somewhat curious what you see if you run the "PVIDEO" > "PAL into NTSC" test from https://github.com/abaire/nxdk_pgraph_tests/releases, but I expect I'll be able to figure out whatever is broken once I can test directly. |
Thanks for testing, there is something very different between the behavior on your machine and my my two, I don't see doubling on either. I assume you're still testing in Windows on your nvidia card? Just to rule it out, can you also try rebooting? |
yes, I'm using Nvidia 30 series and windows updated to the latest drivers + reboot did nothing. |
Thanks for checking. I have one last thing to try, I don't expect it to make any difference but want to rule out the possibility that Thanks again for all your help remote-debugging this :) |
ds_dx and dt_dy describe how the PVIDEO content should be scaled to fit the output area. Each is calculated via `((in - 1) << 20) / (out - 1)`, this commit calculates the full frame scale (in / out) and applies that when determining the texture coordinates for the overlay.
c2d1134
to
353de20
Compare
@Triticum0 I was able to reproduce the quadrupling of output by setting my render scale to 2x, can you double check that your render scale was still set to 1x in your last round of testing? I also just pushed a fix that handles higher scales, so hopefully that'll also make the problem go away. |
@abaire Yeah can say with full confidence that you fixed all the issues that I was having on the pr. It seems to match hardware now. Thank you for your patients and hard work. 2022-07-13.21-36-43.mp4Hardware: Note: retested all games on the list not work properly and other issues i have are fixed |
Note: special case doesn't fix Broken-Sword-The-Sleeping-Dragon and Disney-s-The-Haunted-Mansion. haven't test with both pr combined and squash commits when made the test build don't know if it has an effect? |
I suspect they're just different underlying issues, can you file separate title bugs for them? |
Edit #1183 has I video so you can look at what it looks like. Ping me if you need any help |
NV_PVIDEO_SIZE_IN
is set to 0xFFFFFFFF during initialization and teardown of the PVIDEO overlay. In some cases this can happen before the overlay is explicitly stopped, leading to an assert.On hardware any SIZE_IN > SIZE_OUT is silently capped to SIZE_OUT.
Fixes #330
Test