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