(Nebuleon) Backport https://github.com/Nebuleon/PocketSNES/commit/fd707c09a2a586ca587d5481edf88ec3b64bcc5b