Hi everyone! I don't know if there is someone still interested in this issue (hope there is), but anyway, I want to share my recent discoveries regarding this problem.
I recently started to use my EZ Junior again, and soon I remembered this annoying issue it used to have: sometimes save files are created instantly, but, sometimes, it takes some minutes for apparently no reason.
After thinking about it, an idea came to my mind. It is obvious that, everytime you want to create a new file in a file system, you first need to find free space to allocate the file onto. If the Junior finds this free space by scanning clusters sequentially from the beginning, this would explain why sometimes it takes less than a second but another times it could take several minutes. If there is free space at the beginning of the partition, it will be instantly, but, if there is not, it would have to traverse trough all used clusters until it finds the first free one.
To check my theory, I formatted a fresh 8GB card in FAT32 with 32k clusters, copied the "ezgb.dat" file, created and empty "SAVER" folder (so the Junior doesn't have to do it) and copied the whole GB and GBC romset (2.3GB).
After that, I started to run games. The save file of the first two games took less than a second to be created. For the third one, it took almost 2 minutes. I repeated the same process with 64k clusters and the result was the same but with one difference, the third game took only almost 1 minute to create the save file.
Then, I connected the SD card to the PC and analyzed the "SAVER" folder with an hexadecimal editor. As you can see in the attached image, the first two save files marked in green are at the beginning of the partition (sectors 8704 and 8832, or about 4MB from the beginning) and took less than a second to be created. The third one, marked in red, is at sector 4914432 (2,34GB from the beginning), just after all the ROM files, and took 1 or 2 minutes to be created, depending on the cluster size (64k/32k).
So all of the above confirm my initial assumptions: the Junior takes a lot of time traversing used clusters to find the first empty one, so it is recommended to leave empty space at the beginning of the partition. Also it is recommended to use the biggest clusters size possible so, in case the Junior needs to traverse trough a lot of files to find empty space, the number of used clusters is the smallest possible.
But, how to leave empty space at the beginning of the partition? Operating system doesn't allow the user to specify where files will be allocated (not easily at least), so a little trick can be used. Just after formatting the partition, copy an empty file of, for example 2GB, to the card, then copy the whole GB/GBC romset and finally delete the dummy file. By doing this, there will be 2GB of free space at the beginning of the partition, plenty enough for thousands of save files.
To sum up, my recommended way of formatting and preparing the SD card is the following:
- With Windows "diskpart" or Linux "fdisk" clean the card and create a small partition, 4GB is enough for the complete GB and GBC ROM set, but bigger also works fine
- Format the partition in FAT32 with 64k cluster size
- Copy the file "ezgb.dat" and create a "SAVER" folder in the root of the card
- With any hexadecimal editor, create an empty 2GB file and copy it to the root of the card
- Copy the entire GB and GBC ROM set to the card, at once, so every file will be correctly sorted
- Delete the empty 2GB file
With the above procedure I was able to create a lot of save files without any single problem.
If anyone is interested in this info and try this procedure, any feedback will be welcome.