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

Halo 2: Flickering/depth issues on Apple M1 Macs #524

Open
mborgerson opened this issue Nov 2, 2021 · 11 comments
Open

Halo 2: Flickering/depth issues on Apple M1 Macs #524

mborgerson opened this issue Nov 2, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@mborgerson
Copy link
Member

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

@camden-smallwood
Copy link
Contributor

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

@bretthayes
Copy link

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

@camden-smallwood
Copy link
Contributor

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).

@MyHEROiSMe
Copy link

MyHEROiSMe commented Apr 1, 2024

@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"/

@camden-smallwood
Copy link
Contributor

@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.

@BiatuAutMiahn

This comment was marked as off-topic.

@xemu-project xemu-project deleted a comment from ryzendew Apr 2, 2024
@MyHEROiSMe
Copy link

@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?

@camden-smallwood
Copy link
Contributor

@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

@MyHEROiSMe
Copy link

@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.

@camden-smallwood
Copy link
Contributor

@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.

@MyHEROiSMe
Copy link

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

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

No branches or pull requests

5 participants