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