Corrupt saves (Supercard DS One)

Subforum for discussion and help with ScummVM's Nintendo DS port

Moderator: ScummVM Team

Post Reply
Kurufinwe
Posts: 32
Joined: Tue Nov 29, 2005 10:22 pm

Corrupt saves (Supercard DS One)

Post by Kurufinwe »

I recently got a Supercard DS One, and was trying to get ScummVM 0.9.1a to work on my DS, but it seems to produce corrupt savegames, and is later unable to load them (crash with "illegal glob type 0").

I'm using the correct DLDI driver, and it is able to write on the SD card (the ini file where the settings are kept works, the saves exist on the card). What's more, it only happens for Scumm games with scummvmA (I've tried Loom, MI2, FOA). BASS, FOTAQ (with scummvmB) and Simon 1 (with ScummvmC) save and load fine.

The problem is related to saving, not loading, since I can put savegames made on the Win32 version of scummvm on the SD card and they load fine on the DS, whereas the savegames made on the DS generate the same crash when I tried to load them from Windows (that's only for the savegames made with scummvmA, obviously). I've, obviously, tried to re-patch scummvmA with the DLDI driver, to no avail.

Any idea? ScummVM on the DS is a great project, and I'd love to get the Scumm games to work on it.
ravioli156
Posts: 2
Joined: Sat Apr 21, 2007 11:30 am

Post by ravioli156 »

I have a Ninjapass X9 card, and I have exactly the same problem (and I'm not alone, all the X9 users have the same problem)

scummvm-b works like a charm, but scummvm-a fails when loading a save file it has created previously (with the error illegal glob type 0 ...)
agentq
ScummVM Porter
Posts: 805
Joined: Wed Dec 21, 2005 4:29 pm
Location: London, UK

Post by agentq »

The Ninjapass X9 driver doesn't have finished write support, according to this page: http://home.comcast.net/~c1284j/x9sd.html

As for the Supercard DS One, it has a bug when supporting unaligned address which causes the corrupted save. This is a problem with the DLDI and needs to be fixed by the author of the driver.
Kurufinwe
Posts: 32
Joined: Tue Nov 29, 2005 10:22 pm

Post by Kurufinwe »

OK, thanks. I guess I'll just have to wait for an update... :?
ravioli156
Posts: 2
Joined: Sat Apr 21, 2007 11:30 am

Post by ravioli156 »

Your information is out of date, the X9 has a definitively complete DLDI driver, wich supports read AND write perfectly, on all micro SD. This driver is made by the official ninjapass programmers.

The dldi driver, with sources, is avalaible on the home page of their website : http://ninjapass.com/

And why are the saves of scummvm-b ok, while the scummvm-a saves are bad ? There is a logical reason ?
agentq
ScummVM Porter
Posts: 805
Joined: Wed Dec 21, 2005 4:29 pm
Location: London, UK

Post by agentq »

I've looked at the source code on the site in your post and the X9 driver has the same unaligned data bug as the SCSD one. They need to fix this before scummvm will run properly.

The reason scummvm-b works most of the time is that those games tend not to use unaligned data writes.
cluny
Posts: 4
Joined: Mon Apr 30, 2007 3:05 pm

Post by cluny »

agentq wrote:I've looked at the source code on the site in your post and the X9 driver has the same unaligned data bug as the SCSD one. They need to fix this before scummvm will run properly.

The reason scummvm-b works most of the time is that those games tend not to use unaligned data writes.
I looked at the scDS1 dldi source code too in order to try to fix the problem by myself, but I'm afraid I don't have the knowledge enough.
Where is exactly the problem and how i could fix it?
cluny
Posts: 4
Joined: Mon Apr 30, 2007 3:05 pm

Post by cluny »

I did! it works!
If someone it's interested, please tell me and I'll upload it.
First I'm gonna test it a bit more.
agentq
ScummVM Porter
Posts: 805
Joined: Wed Dec 21, 2005 4:29 pm
Location: London, UK

Post by agentq »

You've probably worked this out by now by now, but the problem lies with the CPU requiring certain alignment for data. 16-bit data requires 2 byte alignment (the address must be even), and 32-bit data requires 4-byte alignment.

The quickest way to get over this problem is to copy the data into a global static buffer inside the DLDI. You will only need 512 bytes if you only write a sector at a time, but this will be slower than writing the whole block at once. But a slow write speed is probably not going to worry anyone.

If you've fixed the DLDI, you should definately contact chishm and get him to update his page here: http://chishm.drunkencoders.com/index.html
cluny
Posts: 4
Joined: Mon Apr 30, 2007 3:05 pm

Post by cluny »

Actually I only added one line of code :)
Looking in other dldi source codes I found the solution.

I've sent it to chishm as you said.
in the meantime, if someone wants to download it, here u have a link


Edit: available in DLDIwiki
crabfists
Posts: 2
Joined: Tue Oct 31, 2006 2:05 pm

Post by crabfists »

Just wanted to say thanks to cluny. I was tearing my hair out trying to work out why my Supercard DS One microSD would not save properly and then I noticed this post. I downloaded your updated driver and it works. Thanks!
Post Reply