gonetz / GLideN64

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

Regression: Check that texture fit TMEM before load #2641

Closed GhostlyDark closed 2 years ago

GhostlyDark commented 2 years ago

Doesn't happen with HD textures. Regression caused by 7417144f644217845d7106569f78dd3b13091756

image

Size is 64x64 THE LEGEND OF ZELDA#0BE442B9#3#2_all THE LEGEND OF ZELDA#0BE442B9#3#2_all.png

Usable savestate can be found here: https://github.com/gonetz/GLideN64/issues/2569 (blood.pj.zip)

GhostlyDark commented 2 years ago

image

GOLDENEYE#38C2DA20#4#0_all.png GOLDENEYE#38C2DA20#4#0_all

GoldenEye, first level. It seems that all textures 64x64 or bigger are affected.

fzurita commented 2 years ago

@gonetz Instead of aborting the copy all together, maybe just what is valid memory can be copied if it goes out of bounds. Or you could just make the TMEM buffer bigger to account for that kind of situation.

gonetz commented 2 years ago

@gonetz Instead of aborting the copy all together, maybe just what is valid memory can be copied if it goes out of bounds.

Yes, it should be done like this. It was a lazy fix, because the problem it fixes was obviously wrong. I'll do a proper fix. Thanks for the bug report.