nba-emu / NanoBoyAdvance

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

EEPROM saves are too fast #288

Closed metroko closed 11 months ago

metroko commented 1 year ago

Apologies in advance if I missed an option somewhere but saving in games using EEPROM is way faster than on real GBA hardware with an original cartridge. This is rather undesirable when speedrunning, because we want to maintain an even playing field.

https://youtu.be/EfSNfUUJsdw?t=269

The video isn't completely accurate timing wise just due to the variety of sources that were used and the way they were recorded but should still give a good enough idea of what the speed should be like.

Tested on 1.7 with real BIOS enabled and the speeds appear similar to VBA-M and Wii U in the video, almost 2 seconds faster than original cartridge.

fleroviux commented 1 year ago

This probably needs emulation of real EEPROM transfer timings. I imagined I would have to implement that some day sooner or later and now may be a good point in time, since the rest of the core is in pretty good shape regarding accuracy already.

fleroviux commented 11 months ago

The latest development build now emulates EEPROM write timings. Based on a quick comparison, the save timing in TLoZ: Minish Cap is much much closer to "Game Boy Player" in the linked video now.

It is not really possible to get exact timing for this since in reality the timing would vary from cartridge to cartridge and under different temperature conditions (for example the cartridge I tested with was faster by ~0.1 ms per unit write after I put it into the freezer for 30 minutes).