xemu icon indicating copy to clipboard operation
xemu copied to clipboard

Halo 2: Flickering/depth issues on Apple M1 Macs

Open mborgerson opened this issue 4 years ago • 17 comments

Title

https://xemu.app/titles/4d530064/#Halo-2

Bug Description

Distinct from already known depth issues with Halo 2.

Possibly related to #523

Main menu blue overlay is broken, scene elements flicker:

Screen Shot 2021-11-02 at 12 52 39 AM

Chief arm/hand model flickers:

Screen Shot 2021-11-02 at 12 58 16 AM

Expected Behavior

xemu Version

v0.6.1-33-gbbcd5763e6

System Information

2020 M1 Mac mini macOS 11.6

Additional Context

No response

mborgerson avatar Nov 02 '21 08:11 mborgerson

I decided to take a look at this over the weekend and was able to implement something that fixed a large chunk of the missing UI overlays on my M1 Mac mini. This does not address the flickering meshes or transparent meshes issues (which I believe to be related to a precision issue). There may be other issues that were addressed by the fix, these were just the things I noticed offhand.

The fix can be applied by replacing these lines in ./hw/xbox/nv2a/vsh.c#L852-L854 with the following:

"  if (clipRange.y > clipRange.x)\n"
"    oPos.z = (oPos.z - clipRange.x)/(0.5 * (clipRange.y - clipRange.x)) - 1;\n"
"  else\n"
"    oPos.z = (oPos.z - clipRange.y)/(0.5 * (clipRange.x - clipRange.y)) - 1;\n"/

xemu Version

v0.7.120

System Information

2020 M1 Mac mini macOS 14.1.1

Current Behavior

Missing blue background on mainmenu: image

Missing profile icons: image

Missing UI elements: image

Fixed Behavior

Restored blue background on mainmenu: image

Restored profile icons: image

Restored UI elements: image

camden-smallwood avatar Mar 26 '24 03:03 camden-smallwood

@camden-smallwood what an improvement! Does this improve the frame rate at all? You should consider contributing these changes in a PR.

bretthayes avatar Mar 26 '24 13:03 bretthayes

I didn't really notice any frame rate improvements on my machine, same variable level where it can sometimes run fine and sometimes it bogs down. I have no problem submitting a pull request for this change, but it will definitely require further changes to fix other issues (such as flickering and transparent meshes).

camden-smallwood avatar Mar 26 '24 14:03 camden-smallwood

@camden-smallwood I apologize for asking a stupid question. I'm new to learning about emulation / XEMU and I'm new to learning about coding.

I've never actually coded in my life so I wasn't 100% sure on how to implement the code that you provided below to fix those pesky UI issues for Halo 2. I was able to find tutorial videos on how to get everything installed on my M3 Macbook Pro, regarding XEMU and for setting up Insignia.

Though, I'm so lost on how to fix the UI issues for Halo 2. Because I don't know anything about coding and sorry for me not knowing what to do.

" if (clipRange.y > clipRange.x)\n" " oPos.z = (oPos.z - clipRange.x)/(0.5 * (clipRange.y - clipRange.x)) - 1;\n" " else\n" " oPos.z = (oPos.z - clipRange.y)/(0.5 * (clipRange.x - clipRange.y)) - 1;\n"/

MyHEROiSMe avatar Apr 01 '24 22:04 MyHEROiSMe

@MyHEROiSMe I've submitted this fix as a pull request here. You can download a build at the bottom if you would like to test it.

camden-smallwood avatar Apr 01 '24 22:04 camden-smallwood

@ryzendew you should also edit your reply.

BiatuAutMiahn avatar Apr 02 '24 04:04 BiatuAutMiahn

@camden-smallwood I clicked on the (here) / blue highlighted text and then I scrolled down to the bottom and I saw the builds.

Though how would I actually download the build of my choice?

MyHEROiSMe avatar Apr 03 '24 03:04 MyHEROiSMe

@MyHEROiSMe I didn't realize the downloads were on a different page. You can find them at the bottom of the artifacts page here: https://github.com/xemu-project/xemu/actions/runs/8438350576?pr=1620

camden-smallwood avatar Apr 03 '24 03:04 camden-smallwood

@camden-smallwood I still feel so so confused, regarding what to do (so that I can fix the UI for Halo 2).

Do I have to actually code stuff to fix the issue? Because I know absolutely nothing about coding or what I'm even doing.

Sorry again for being less educated, regarding this topic / coding / & how to fix the UI issue for Halo 2 on XEMU.

MyHEROiSMe avatar Apr 05 '24 00:04 MyHEROiSMe

@MyHEROiSMe go to the link I shared in my previous message, scroll to the bottom, you will see an "Artifacts" section. Click on the name of the xemu build you want in order to download it. This xemu build will have the code changes applied to fix the UI for Halo 2.

camden-smallwood avatar Apr 05 '24 03:04 camden-smallwood

@camden-smallwood Thanks and I appreciate that. I will give it a try later on tonight!

MyHEROiSMe avatar Apr 05 '24 20:04 MyHEROiSMe

Unfortunately, the artefacts do not seem to be available anymore.

blasterbug avatar Jun 20 '24 19:06 blasterbug

Unfortunately, the artefacts do not seem to be available anymore.

I just checked, they are still available. You can find them at the bottom of the page I linked above. The section looks like this: image

camden-smallwood avatar Jun 20 '24 20:06 camden-smallwood

Screenshot 2024-06-24 at 2 22 12 PM

for me it just says they are all expired

themacintoshnerd avatar Jun 24 '24 18:06 themacintoshnerd

I've decided to close the pull request for the time being. Hopefully the problem gets fixed.

camden-smallwood avatar Jun 24 '24 20:06 camden-smallwood

Why was this PR closed? It seems to fix a lot of halo 2 issues. Is it creating issues in other titles?

remojansen avatar Aug 22 '24 08:08 remojansen

@remojansen when the artifacts were tested from #1620 on different platforms (macOS/Steamdeck), the clipRange fix didn't fix all UI issues in other titles. An alternative fix will have to be explored.

bretthayes avatar Aug 25 '24 01:08 bretthayes

@mborgerson i am having the same exact isses on my apple M1 how can i apply this fix to XEMU mac?

vxlux avatar Feb 10 '25 13:02 vxlux

@camden-smallwood can you make the download available again

vxlux avatar Feb 10 '25 13:02 vxlux

Does this still happen since #2183 was merged in v0.8.65?

If so, is it fixed by the pending #2240 ?

abaire avatar Sep 23 '25 20:09 abaire