Could a renaming of the “memcards” directory to the current running game (before running off course) not be an option? I tried it with symlinks in Linux. Go to “retroarch/system/pcsx2/” and rename the directory from “memcards” to let’s say “memcards_doa2”. And create a new directory “memcards_othergame”. Now create a symlink from named “memcards” that points to “memcards_doa2” in example, just before starting the game Dead or Alive 2. Deleting and creating a new symlink is extremely cheap and fast operation.
This way every game gets their own directory for both Memory Cards. I don’t know if this works with all operating systems. In a case where symlinks do not work well, maybe renaming the directory would be sufficient. In that case, its a bit risky, as if the core crashes then we need extra information to what original directory name it was before. With symlinks such an issue would not arise BTW.
Hope I was clear about. Here the example how it might look (off course the directory structure needs to be organized differently, its just testing here):
memcards -> symbolic link points to memcards_doa2
memcards_doa2 -- directory for Dead or Alive 2
memcards_another_game -- directory for Another Game