(NAOMI) Backport https://github.com/flyinghead/flycast/commit/17c7e0b3ed531617ea0fe5d3357caec86f8b8bb6