Rangi42 / polishedcrystal

An upgrade to Pokémon Crystal. Brings features and content up to date, and adds some original content.
https://hax.iimarckus.org/topic/6874/
1.03k stars 196 forks source link

Use GDMA for tile transfers #639

Open FredrIQ opened 3 years ago

FredrIQ commented 3 years ago

Consider using GDMA transfers (rHDMA1-5 registers) for tile copying to VRAM, if applicable. It's roughly 2-10 times faster compared to the Prism routine (worst vs best case improvement), generally around 4 times faster with LCD enabled and 10 times with it disabled.

There appears to be a brand new discovery of GDMA limitations in LCD mode 2 that isn't yet fully understood, so I'm filing this issue for revisiting later when more details are known.

FredrIQ commented 3 years ago

For reference about mode2 issues: https://github.com/gbdev/pandocs/issues/299

FredrIQ commented 2 years ago

This issue has been resolved on pandocs. GDMA is safe in Mode 2. So replacing Prism routines with GDMA when applicable should work perfectly.

FredrIQ commented 2 years ago

This resolves the caveat blocking the issue, meaning this is a feature I can adapt. Reopening the issue to clarify this