bram777 / d2x-cios

Automatically exported from code.google.com/p/d2x-cios
0 stars 0 forks source link

Can't save game with The Beatles Rock Band on emulated NAND #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. Load The Beatles : Rock Band with partial NAND emulation or full NAND 
emulation (I tried with USB Loader GX 2.3 r1123)
2. The game tries to create a new savegame (if a game save already exists, goto 
the in-game menu Options > Manage Data > Save Data)
3. The game is unable to save on emulated NAND, and there is an error message : 
"Saving has failed for an unknown reason. Selected storage device is no longer 
available"

Original issue reported on code.google.com by yps...@gmail.com on 11 Dec 2011 at 9:30

GoogleCodeExporter commented 8 years ago
To be more specific : I used d2x v7 final, IOS 249, base 56.

Original comment by yps...@gmail.com on 11 Dec 2011 at 9:43

GoogleCodeExporter commented 8 years ago
OK I found the problem.
This game has quite stupid and apparently harmless bug made by developers.
It opens the savefile twice in write mode. See the log:
  FS_CreateFile("/title/00010000/52394a50/data/proj9.dat", 03, 00, 00, 00)
  FS_CreateFile: ret = 0
  FS_Open("/title/00010000/52394a50/data/proj9.dat", 3)
  FS_Open: ret = 1
  FS_Open("/title/00010000/52394a50/data/proj9.dat", 3)
  FS_Open: ret = 2
  FS_Write(2, 0x0115d3a0, 1048576)
  FS_Write: ret = 1048576
  FS_Close(2)
  FS_Close: ret = 0
  FS_Close(1)
  FS_Close: ret = 0

Note that the file is open twice but it is writtent to by fd 2 only. I believe 
it works on real nand just because the 2nd close, i.e. the one on fd 1, has 
nothing to flush. Otherwise real nand corruption would be possible.

Anyways after disabling file sharing control in the fat library this game has 
started working on emu nand too.
Now a bit of code clean up then I'll release a new beta with this fix.

Original comment by dav...@yahoo.it on 3 Jan 2012 at 10:34

GoogleCodeExporter commented 8 years ago
Great news! Thanks a lot. (I know my comment is not really useful, but I wanted 
to say thanks).

Original comment by yps...@gmail.com on 4 Jan 2012 at 9:59

GoogleCodeExporter commented 8 years ago
Fix released with r41.

Original comment by dav...@yahoo.it on 7 Jan 2012 at 2:05