-
-
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
Pirates: The Legend of Black Kat - FMVs are rendered as side-by-side duplicates #652
Comments
I think this is an interaction w/ anti-aliasing. According to VLC the source for the video is 640x480 mpeg2. I see the surface being created with that size but w/ AA set to
If I disable the width doubling in I'm guessing the problem is that anti-aliasing isn't actually being applied anywhere. As far as I can see the video frames are decoded someplace and then uploaded via |
I think the problem is that a surface's shape is set based on whatever the anti-aliasing flag happens to be set to when it is first created, and it stays stuck in that state forever. Based on the observed behavior, it seems like the |
Copying over some later findings from when I dug further into fixing this: Updating to capture the context: The problem is that the game does 3D rendering to the framebuffer with anti-aliasing enabled, then switches to doing direct CPU writes. xemu creates a SurfaceBinding for the 0x97-based renders, then erroneously continues to use it for the final blit in nv2a_get_framebuffer_surface. In hardware, only AvSetDisplayMode should have an effect on the interpretation of the framebuffer. |
Handles cases where a surface containing the framebuffer uses a format that does not match the VGA configuration and thus cannot directly represent the framebuffer contents. Fixes xemu-project#652 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
This is caused by 0x1021 - Should be 0x1121 This is used for resolution modes (i think) and helps set AA in games. I have some awkward notes on finding this, but have not been able to narrow down what its actually doing.. Pirates Video Fix (MOD) |
There's no problem with the game code, and the behavior is more easily identifiable by looking at the pgraph commands than by reversing the game code :) The game sets up anti-aliased rendering to the framebuffer for 3D for a draw, then later writes decompressed FMV frames directly to the framebuffer via the CPU. xemu has a bug that causes it to assume that if a 3d surface was set up pointing at the framebuffer than its (host) GL contents contain the framebuffer data and can be displayed. It has a further bug where it assumes that VRAM will be in the same format as the surface configuration, so when it sees that the guest VRAM has been modified, it reads it in as anti-aliased data, so when it's finally rendered the pitch is double what it should be. The draft PR fixes the xemu bug, but there is a remaining issue with how xemu grabs the framebuffer in a UI thread unrelated to the guest. |
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Handles two edge cases: 1) CPU blits to the framebuffer without using 3D rendering. 2) Fullscreen PVIDEO rendering without any 3D rendering. In both cases this change prevents the pgraph code from returning early, bypassing the special case VGA handling in `sdl2_gl_refresh` and instead using a special framebuffer texture to render the contents of VRAM. Fixes xemu-project#652 Fixes xemu-project#1165 [Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/main/src/tests/antialiasing_tests.cpp) [HW results](https://github.com/abaire/nxdk_pgraph_tests_golden_results/wiki/Results-Antialiasing_tests)
Title
https://xemu.app/titles/45410015/#Pirates-The-Legend-of-Black-Kat
Bug Description
The intro FMVs are duplicated side-by-side:
Expected Behavior
On hardware the videos are not duplicated:
![ship_xbox](https://user-images.githubusercontent.com/448413/149373522-bc220113-021a-40ca-b2fb-0e595d611437.jpg)
![westwood_xbox](https://user-images.githubusercontent.com/448413/149373524-0b668bd3-29a6-4c7f-bf69-acc82347848b.jpg)
xemu Version
Latest master
Version: 0.6.2-51-g3fd15218c7
Branch: master
Commit: 3fd1521
Date: Thu Jan 13 04:44:48 PM UTC 2022
System Information
OS: Kubuntu 21.04 - 5.11.0-38-generic
CPU: Core i7-6700K @ 4GHz
GPU: NVIDIA GeForce GTX 1070
GPU Driver: 4.6.0 NVIDIA 470.74
Additional Context
I started writing up a more detailed description of the problem here:
https://gist.github.com/abaire/8345ff167c4d89d4ff4a3a78e87b9ae4
The text was updated successfully, but these errors were encountered: