xyproto / zsnes

A maintained fork of ZSNES, a Super Nintendo emulator. The original project needs patches to build and is not maintained anymore: https://sourceforge.net/projects/zsnes/
https://zsnes.com
GNU General Public License v2.0
131 stars 16 forks source link

Graphical issues on Yoshi's Island #18

Closed TrashRaccoonSnuffy closed 1 year ago

TrashRaccoonSnuffy commented 1 year ago

image image image

Most likely related to improper HDMA/DMA emulation (or the code being converted wrongly for 64-bit?), the game looks fine on ZSNES 1.51 and 1.42

xyproto commented 1 year ago

Thanks for reporting!

TrashRaccoonSnuffy commented 1 year ago

I've been investigating this issue myself and this seems to be a problem in c_reg420Cw in cpu/c_dma.c, Specifically the nexthdma & al == 0 part in the if statement.

If I remove that, the HDMA works as expected and the graphics bugs are gone. image Due to using a system to reduce the screen vertical resolution, Yoshi's Island does 2 writes to 420C (The HDMA Enable register), one with 00 and one with the actual expected value. A per-game hack will probably have to be done to fix this, since this issue was added after 1.51 when regs got ported to C. There might have been a wrong conversion somewhere in the code. I'll make a fix for it.

The other secondary fix I found was setting per2exec in zsnesl.cfg to 50, but this makes the game run very slowly and flicker.