Why is reading/writing memory cards slow in PS1 emulators?

Speed of flash memory and other storage has improved quite a bit since the PS1 days—and now some emulators can provide higher-than-native reading speeds when loading a ‘CD’ in a game (e.g. PS Vita's built-in PSPEMU can do this). However, somehow this hasn't affected the speeds of reading or writing a PS1 memory card, in all emulators that I've used. Detecting a memory card is slow, writing it is slow, reading it is slow—even when the game clearly doesn't reload the game world but just reads a few numbers. Considering the minuscule size of PS1 saves by modern standards, they should be read or written in moments.

I'm curious: what limits the speed of PS1 memory cards in emulators?

It vaguely seems like games are doing some low-level electronics with the cards, instead of delegating to the console's API—so the emulator has to preserve the original timings and can't hijack the goings-on with a faster approach. If this is the reason, then how widespread was this method of talking to storage, in those days? And was it carried into the PS2 generation or later on?


Solution 1:

It absolutely has everything to do with timing. Keep in mind that though the PS1 was advanced for it's time, it was still pretty basic by today's standards. Both CD read times were fixed as we're memory card write times. This meant that if the developers wanted, there were some operations that could run or start while certain read and write operations were taking place. Devs could start a memory card write and know exactly how many CPU cycles it'd take to finish.

In actuality, there was probably a subsystem that was us was used to write whatever block of RAM holding the data to the memory card. Once the process was finished, an interrupt would be called that basically tells the unit "writing to the memory card, finished!". If the devs knew it specifically took X cycled to complete writing 256 bytes to the memory card RAM, they can use those background cycles to preload a stage or prep RAM data for managing player interaction for whatever comes next in the game.

In general, the PS1 had very tight timing control. Because of that, devs could use it as a "trick" up there sleeves to preload data and make the game feel overall faster. The downside to this trick is that years later, we are stuck having to emulate speeds that to us are slow.

But there is caviat! Apparently Sony partly cracked the code on spending up some of these operations without breaking to many games. I can't speak for the PS3, but there are options to speed up load times within the PS2 for PS1 games. I know there were warnings that the feature may not work with all games, so Sony was aware that it was a use-at-your-own-risk, quality of life feature. To my knowledge, the PS2 did not also integrate faster memory save operations, so they were definitely aware that it was a function they shouldn't change (although maximum write speeds for PS1 might have been part of that decision.)

It's my guess that the state of PS1 emulation is not where it needs to be to intelligently overcome the possibility of having some games needing specifically timed right behaviors. My gut tells me that if such a feature was implemented in a modern emulator, the devs would want to thoroughly test the function across the hundreds of game sin the library. True, it could be a feature toggled per game and saved in user settings, but my guess is it's just not yet been a priority.

I recommend making something like this a feature request on GitHub wherever any mainline emulator is hosted. I'm sure the devs can give you a more specific answer as to why this is intentionally delayed, and the obstacles involved to overcome the issue in the emulator. However, having it mentioned as a feature that can be set per game and is considered "experimental" might be something they'd try to implement some day.