Skip to content
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

Van Helsing: Title Screen Assertion (Regression) #405

Closed
Kohryujin opened this issue Jul 11, 2021 · 8 comments · Fixed by #933
Closed

Van Helsing: Title Screen Assertion (Regression) #405

Kohryujin opened this issue Jul 11, 2021 · 8 comments · Fixed by #933
Labels
bug Something isn't working

Comments

@Kohryujin
Copy link

Title Information

Bug Description

The game asserts when trying to load in the title screen.

Steps to reproduce this issue:

  1. Load up the game.
  2. Skip logos and attract cinematic.
  3. You'll see a loading icon and then the game will assert.

Van Helsing Assertion 1

Expected Behavior

Normally the title screen would load in allowing you to start or load a game, etc..

Version

  • Version: 0.5.4-25-ged7cbef976
  • Last-known Working: 0.2.0 (According to the compat reports)

System Information

Field Value
OS Windows 10 Pro
CPU AMD FX(tm)-8350 Eight-Core Processor
Graphics Device Radeon RX 580
Graphics Driver Radeon 21.4.1

Additional Context

@Kohryujin Kohryujin added the bug Something isn't working label Jul 11, 2021
@Triticum0
Copy link

It was playable back in march https://www.youtube.com/watch?v=HzyUA5sKUwc

@Kohryujin
Copy link
Author

It was playable back in march https://www.youtube.com/watch?v=HzyUA5sKUwc

Would you happen to know which builds of Xemu came out in March then? I wouldn't mind testing to find out exactly when playability broke if I had a start point to go off of.

@Kohryujin
Copy link
Author

After some testing, it seems that this build of Xemu... https://github.com/mborgerson/xemu/actions/runs/975192291
Works without this particular assertion.

And this build... https://github.com/mborgerson/xemu/actions/runs/994891094
Is the one that introduces the error.

@Triticum0
Copy link

Triticum0 commented Nov 1, 2021

@Kohryujin Add the word (Regression) to the title of the issue. Also retest it might work now

@Kohryujin
Copy link
Author

Retested, still broken.
image

I feel like I've seen that error before or it was talked about, and not just for this game. But it's been long enough that I'm not sure what the fix was named that caused the regression.

@Kohryujin Kohryujin changed the title Van Helsing: Title Screen Assertion Van Helsing: Title Screen Assertion (Regression) Nov 1, 2021
@Triticum0
Copy link

Also affect Phantom crash

@abaire
Copy link
Contributor

abaire commented May 18, 2022

In this particular case, the game uses a surface at 101c000 with swizzle enabled and a size of 128x128.
It then sets a clip rect that has a 1,1 offset and a clip width/height of 126.

The clip offset triggers https://github.com/mborgerson/xemu/blob/38a0e46f8c59c6da50029c1b53712070f211ac74/hw/xbox/nv2a/pgraph.c#L5761 which erroneously causes the surface to be treated as 129x129, causing it to overlap with the zeta surface at 0x102C000.

Based on what I've seen from HW in the surface clip tests, specifying a clip region that goes beyond the end of the surface results in the nv2a raising an exception, so it's unclear to me why xemu is growing the required size based on the clip offset.

@abaire
Copy link
Contributor

abaire commented May 18, 2022

@mborgerson 's https://github.com/mborgerson/xemu/blob/0adb1c1b07684174b358340374018a4023b9961d/hw/xbox/nv2a/pgraph.c#L5580 fixes this problem.

The underlying issue is that surface clipping should never affect swizzled surfaces, so the offset is being incorrectly applied in this case, triggering the erroneous overlap. In a swizzle case, the clip size is used as the surface size, so it's guaranteed to never be larger than the actual surface allocation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants