nba-emu / NanoBoyAdvance

A cycle-accurate Nintendo Game Boy Advance emulator.
GNU General Public License v3.0
955 stars 53 forks source link

RNG Issues in Gen 3 Pokemon Games #346

Open ScarlettHaze opened 5 months ago

ScarlettHaze commented 5 months ago

I'm catching Pokemon that have a single ability and it should always result in a Ability bit set to 0 but it's being set to 1 sometimes because some frames in the RNG shouldn't be landed on yet the emulator isn't as accurate with the RNG

The disassembly shows that if a Pokemon does not have a second ability defined, it does not set the ability bit https://github.com/pret/pokeemerald/blob/e4149e83f89b8b86478e03b8112c1d1e922e65a6/src/pokemon.c#L2296

ScarlettHaze commented 5 months ago

it's to do with vblank from what I've researched

fleroviux commented 5 months ago

Yes, I'm aware of RNG issues with games like Pokemon. Unfortunately this requires an extreme level of timing precision to get the same RNG values as real hardware and we're just not 100% there yet to make this work.