400 block VMU on emulator
Posted: Thu May 05, 2022 11:37 pm
All VMUs to date have been limited to 128KB of storage with 200 blocks usable, with a few memory cards that basically combine multiple 128KB cards into one unit, switchable via a button on the side. From the perspective of the DC, though, they're all 128KB. It's also possible to rewrite the file system to report 241 blocks available by treating seeming unused space as usable. (This unused space is probably really used for wear leveling.) This works fine for most games, but a few (like DreamPassport) won't recognize the VMU. AFAIK, no one has ever made a unpaged VMU with more than 128KB storage.
However, the file system used on VMUs seems to support even larger memory cards, theoretically up to 16 or 32 MB. What would happen if you tried to have a VMU report that it's larger than 128KB?
I tried modifying emulators to do this before, but always had trouble getting them to compile. After seeing the work on VM2, I wanted to try again. I finally managed to get Flycast Dojo to compile. I had it report having a 256KB VMU with 400 blocks, and experimented to see what would work.
The BIOS worked just fine, and was able to format the VMU and see the entire space. There are even some games that work fine with VMUs larger than 128KB, however many games don't recognize larger VMUs, and some even corrupt the VMU's file allocation table.
I noticed that a block went missing on the BIOS somehow... there are 371 used and 28 free, so 399 blocks total. When I was testing games, I deleted some files at some point since I ran out of space. I guess that while the BIOS can format and read the space fine, the deletion code has issues sometimes? It does work correctly too, it just didn't at some point for this screenshot. Or maybe a game caused the block to disappear. I noticed something like this happened when I was using the 241 block trick on real hardware at one point, where I deleted a file but didn't get all of the space back. It might be because the values used to describe how the VMU is laid out are not what the BIOS expects.
I tried a random assortment of games.
The following games seem to work:
Sonic Adventure
Sonic Adventure 2
Soul Calibur
Test Drive Le Mans
Trickstyle
Surf Rocket Racers
Seventh Cross Evolution
Record of Lodoss War
Alien Front Online
Radirgy
Under Defeat
Trigger Heart Exelica
Space Channel 5 Part 2
Rez
Advanced Daisenryaku 2001
Bangai-Oh
Quake III Arena
Unreal Tournament
The following games either falsely report no VMU inserted or not enough space, or just don't allow you to select the VMU:
Crazy Taxi
Shenmue
Shenmue II
Phantasy Star Online v2
Daytona USA 2001
Jet Grind Radio
Skies of Arcadia
Fur Fighters
Virtua Fighter 3tb
NFL 2K1
Super Runabout
Half-Life Beta
Ecco the Dolphin
MDK2
Cosmic Smash
Ikaruga
Dead or Alive 2 will boot and show the start up logos, then hangs when accessing the VMU.
What's worse than a game not working? The following games seem to end up corrupting part of the file allocation table, causing random other saves to become unreadable:
Metropolis Street Racer
Propeller Arena (Says file damaged after saving)
Dynamite Cop (Says no card, allows selecting card anyways)
18 Wheeler (Says not enough space, saves anyways)
From what I remember, MSR doesn't recognize standard VMUs with 241 blocks enabled, so the fact that it saves on larger ones is odd.
I haven't looked closely into what kind of corruption is happening. When I try to look at the VMU in the BIOS, the BIOS tries to read block 65532 (or FFFC in hex). That value is used in the FAT to mark areas that are unallocated, so it looks like the block chain linked list was incorrectly updated when the saves where written.
It's possible that the corruption is happening because I have wrong values for how the VMU is laided out, but I doubt it in this case.
I can't be sure that the games that seemed to work will always work. It's possible that some might only work when the card is mostly empty, or only work when the file gets written to an address in the first 128KB, or something like that. Loading or updating saves might run into problems, too. For most games, I only tried getting the game to create the save, then checked the BIOS to see if it was written ok.
So while large, single-page VMUs are interesting and kind of work, I'm not sure they're supported well enough to try actually making any. Accidentally playing the wrong game and loosing your saves would be awful. I guess you could create a VMU that did copy-on-write, so you could rollback any changes, but that would be a lot of work.
Seems like 1MB is the limit.
However, the file system used on VMUs seems to support even larger memory cards, theoretically up to 16 or 32 MB. What would happen if you tried to have a VMU report that it's larger than 128KB?
I tried modifying emulators to do this before, but always had trouble getting them to compile. After seeing the work on VM2, I wanted to try again. I finally managed to get Flycast Dojo to compile. I had it report having a 256KB VMU with 400 blocks, and experimented to see what would work.
The BIOS worked just fine, and was able to format the VMU and see the entire space. There are even some games that work fine with VMUs larger than 128KB, however many games don't recognize larger VMUs, and some even corrupt the VMU's file allocation table.
I noticed that a block went missing on the BIOS somehow... there are 371 used and 28 free, so 399 blocks total. When I was testing games, I deleted some files at some point since I ran out of space. I guess that while the BIOS can format and read the space fine, the deletion code has issues sometimes? It does work correctly too, it just didn't at some point for this screenshot. Or maybe a game caused the block to disappear. I noticed something like this happened when I was using the 241 block trick on real hardware at one point, where I deleted a file but didn't get all of the space back. It might be because the values used to describe how the VMU is laid out are not what the BIOS expects.
I tried a random assortment of games.
The following games seem to work:
Sonic Adventure
Sonic Adventure 2
Soul Calibur
Test Drive Le Mans
Trickstyle
Surf Rocket Racers
Seventh Cross Evolution
Record of Lodoss War
Alien Front Online
Radirgy
Under Defeat
Trigger Heart Exelica
Space Channel 5 Part 2
Rez
Advanced Daisenryaku 2001
Bangai-Oh
Quake III Arena
Unreal Tournament
The following games either falsely report no VMU inserted or not enough space, or just don't allow you to select the VMU:
Crazy Taxi
Shenmue
Shenmue II
Phantasy Star Online v2
Daytona USA 2001
Jet Grind Radio
Skies of Arcadia
Fur Fighters
Virtua Fighter 3tb
NFL 2K1
Super Runabout
Half-Life Beta
Ecco the Dolphin
MDK2
Cosmic Smash
Ikaruga
Dead or Alive 2 will boot and show the start up logos, then hangs when accessing the VMU.
What's worse than a game not working? The following games seem to end up corrupting part of the file allocation table, causing random other saves to become unreadable:
Metropolis Street Racer
Propeller Arena (Says file damaged after saving)
Dynamite Cop (Says no card, allows selecting card anyways)
18 Wheeler (Says not enough space, saves anyways)
From what I remember, MSR doesn't recognize standard VMUs with 241 blocks enabled, so the fact that it saves on larger ones is odd.
I haven't looked closely into what kind of corruption is happening. When I try to look at the VMU in the BIOS, the BIOS tries to read block 65532 (or FFFC in hex). That value is used in the FAT to mark areas that are unallocated, so it looks like the block chain linked list was incorrectly updated when the saves where written.
It's possible that the corruption is happening because I have wrong values for how the VMU is laided out, but I doubt it in this case.
I can't be sure that the games that seemed to work will always work. It's possible that some might only work when the card is mostly empty, or only work when the file gets written to an address in the first 128KB, or something like that. Loading or updating saves might run into problems, too. For most games, I only tried getting the game to create the save, then checked the BIOS to see if it was written ok.
So while large, single-page VMUs are interesting and kind of work, I'm not sure they're supported well enough to try actually making any. Accidentally playing the wrong game and loosing your saves would be awful. I guess you could create a VMU that did copy-on-write, so you could rollback any changes, but that would be a lot of work.
Seems like 1MB is the limit.