xemu
xemu copied to clipboard
ESPN College Hoops - Menu Letters Turn Into Blocks
Title
https://xemu.app/titles/53450024/#ESPN-College-Hoops
Bug Description
The menus (and the pause menu) have this strange issue where some letters (the final letters of the words) turn into white or semi transparent blocks for a second then they turn into normal.

Expected Behavior
Since it keeps switching, this how it's supposed to look (permanently):

xemu Version
0.7.45
System Information
Windows 11 Intel i7-10875H RTX 2070 Drivers: 516.40
Additional Context
No response
I suspect this is due to the same cause as #799
also affects ESPN NHL Hockey, Digimon World X and Shadow The Hedgehog
test on v0.8.58 and no change
Here a rederdoc https://drive.google.com/file/d/18ca7-5uwF6U4Kfd1g3vCjKop1f5fmChk/view?usp=sharing
Looks like the corrupt letters have NaN's as their texture coordinates. which seems odd (and only happens for the corrupt letters). It looks like the NaNs are provided as part of the v2 inputs to the shader itself, so this is probably not an issue with the shader.
Shader:
DP4 R0.x, v0, c[188]
DP4 R0.y, v0, c[189]
DP4 R0.z, v0, c[190]
DP4 R0.w, v0, c[191]
MUL oD0.xyzw, v1, c[23]
MOV oPos.xyzw, R0
DPH oT0.x, v2, c[5] + RCC R1.x, R12.w
DPH oT0.y, v2, c[6]
DPH oT0.z, v2, c[7]
DPH oT1.x, v2, c[9]
DPH oT1.y, v2, c[10]
DPH oT1.z, v2, c[11]
DPH oT2.x, v2, c[13]
DPH oT2.y, v2, c[14]
DPH oT2.z, v2, c[15]
DPH oT3.x, v2, c[17]
DPH oT3.y, v2, c[18]
DPH oT3.z, v2, c[19]
MIN oFog.x, R12.w, c[38].x
MUL oPos.xyz, R12, R1.x
Also effects ESPN NHL Hockey
@abaire Did you want a mult capture for this issue?
@abaire Did you want a mult capture for this issue?
No thanks, the capture you already provided shows that the bad values are coming into the shader, so it's unlikely that we can learn anything new by looking at multiple frames.
I will take a deeper look at the pgraph trace; when I quickly looked at it it seemed like it was only passing values for two of the three inputs that are used by the shader (with the third input being the one with NaNs). It may be that there's some defaulting or carryover behavior done on nv2a that isn't emulated by xemu.
One of the bad text draws is helpfully using immediate mode to specify the geometry and the NaNs are visible there:
...
Set data array format to
v0: (0x32 {Type:Float, Size:3, Stride:0 (0x0)})
v1: (0x40 {Type:UB D3D, Size:4, Stride:0 (0x0)})
v2: (0x32 {Type:Float, Size:3, Stride:0 (0x0)})
...
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x43150000 => 149.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x42280000 => 42.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x00000000 => 0.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> 0xFFC8C8C8
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x3F480000 => 0.781250)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x3DE00000 => 0.109375)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0xFFFFFF98 => nan)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x43090000 => 137.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x42280000 => 42.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x00000000 => 0.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> 0xFFC8C8C8
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x3F3C0000 => 0.734375)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x3DE00000 => 0.109375)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0xFFFFFF98 => nan)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x43090000 => 137.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x41600000 => 14.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x00000000 => 0.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> 0xFFC8C8C8
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x3F3C0000 => 0.734375)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0x00000000 => 0.000000)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_INLINE_ARRAY<0x1818> (0xFFFFFF98 => nan)
So either there is something wrong further upstream that caused the nan values to be calculated erroneously or there is some reliance on nan interpretation that xemu isn't emulating today.
Just playing around in RenderDoc; if I run NaNToOne on the v2 input for the shader it renders correctly:
@Triticum0 I have a temporary PR against my own repo here: https://github.com/abaire/xemu/pull/11 if you feel like testing it (I don't have this particular version of College Hoops, I only have CH 2005). I'd be interested in whether it actually fixes this issue and whether there's a noticeable performance degradation in other games due to the extra checks done on each draw.
Before I create a xemu PR I need to write some new tests to verify that the nv2a really does treat NaNs on all inputs as 1.0s. It doesn't seem like it should be the case for values that might be in 3d space like positions/normals, though I guess having NaNs there would cause unexpected behavior in xemu as well.
@abaire I tested the build it fixed the issue. Only problem is it cause vukan to crash
Thanks for checking, I didn't have a chance to test with Vulkan and missed the way some of the inputs are declared in the shader. Should be fixed now if you want to recheck (once it finishes the build action).
np, testing all ESPN game think all the 2004 series have the same menu but i only reproduce the graphical issue on ESPN NHL Hockey. you could maybe try ESPN 2004 football as you have it. but i just tested it with your fix and didn't reproduce the menu issue.
@abaire I tested college hoops and espn hockey and couldn't reproduce the issue