gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
771 stars 179 forks source link

OOT/Paper Mario Pause Menu without hack? #2784

Closed olivieryuyu closed 6 months ago

olivieryuyu commented 1 year ago

Some folks are reverse engineering the OOT code and here what we can find when it comes to the pause menu:

https://github.com/zeldaret/oot/blob/master/src/code/PreRender.c#L360C6-L360C33

I think it is to allow a better anti alising effect.

weinerschnitzel commented 1 year ago

That makes alot of sense. Nice to have the decomp to provide source of truth on coverage theories, etc. with this one.

gonetz commented 1 year ago

Cool! Comments in the code are really great.

gonetz commented 6 months ago

I checked the PreRender.c code more carefully. Since GLideN64 does not calculate coverage as N64 does, it can't reproduce that pause menu trick. PreRender_FetchFbufCoverage fetches the coverage of the current framebuffer into an image of the same format as the current color image, storing it over the framebuffer in memory. It currently won't work. The texture image with coverage values is used as alpha input for resulting color image and it will be wrong. In practice we don't need this image. We don't see it thanks to HWFBE. We need an image in RDRAM, which the program recognizes as the "correct" one, and the "white screen" hack works well there. Of course, it would be cool to emulate everything and remove that hack, but without proper coverage emulation it is hardly possible. However now, when I know how this code works, I can detect the pause menu with guarantee. I corrected the code: e568babdc

olivieryuyu commented 6 months ago

very nice :)

we know what is going on and we have a trick to sort out the matter. It is good enough imo.