J-D-K / JKSM

JK's Save Manager for 3DS
GNU General Public License v3.0
358 stars 23 forks source link

"There was an error opening the file for writing" for Professor Layon vs Phoenix Wright #38

Closed NurioHin closed 4 years ago

NurioHin commented 5 years ago

When trying to backup the save on a legitimate cartridge for Professor Layton vs Phoenix Wright (EU version), I get the following error:

error

Perhaps it has something to do with the title of the game. Perhaps it's the period in the title that messes with it. You can see the title in this screenshot:

title

Note the period after "Prof". The reason I think this period might be the cause is because someone else is having the same issue with other Professor Layton games here: #19

Another reason I think this might be the reason is because Checkpoint can backup the save without issue. And when I check the title there, it has removed the period after "Prof" and replaced it with a space instead

NurioHin commented 5 years ago

Okay, a little bit of an update on my speculation. Apparently it is probably not the period, since JKSM seems to parse "New Super Mario Bros. 2" just fine by removing the period there. I can only assume it does (or at least tries to) the same for "Prof. Layton"...

Then I imagine it might be the length of the title. As you can see in the screenshot above, it's being truncated (at the exact same length as Checkpoint does, in fact) as it's way too long. But maybe JKSM glitches out here when trying to write the save to the SD card whereas Checkpoint properly truncates it? And since all Professor Layton titles are so long, it only makes sense that the other Layton games suffer from the same problem as noted here: #19

J-D-K commented 5 years ago

Do you mind uploading the title cache from your SD card so I can check it out? I can use it to see what's up when it tries to create the directory.

NurioHin commented 5 years ago

I don't particularly mind, but it only holds currently installed titles, right? Meaning that my PLvsPW cartridge doesn't show up there at all (since it's a cartridge), so I don't know how much use it is

titles.zip

Unless you mean something else when you mention the title cache?

J-D-K commented 5 years ago

Yeah, sorry. I glossed over the cartridge part. Use this special version of JKSM. It has an extra option to dump the cart title to sdmc:/JKSV/cart.bin in the main menu. Upload that and I should be able to figure it out. JKSM.zip

NurioHin commented 5 years ago

Here you go:

cart.zip

I checked the file myself too and it seems to parse and truncate the title just fine, at least when dumping it to this file, though it does seem to have two spaces at the end of the title, possibly transformed from the periods at the end?

J-D-K commented 5 years ago

Thank you. I think I know what's happening. JKSM is replacing .'s with spaces, but that leaves two spaces at the end of the file safe string in this case. JKSM only handles one if I remember right, to deal with Smash. I'll get back to ya with a fix.

NurioHin commented 5 years ago

Do you happen to have a fix?

NurioHin commented 5 years ago

It's been a while. Not to sound impatient, but do you have a fix now?

J-D-K commented 5 years ago

I apologize. I have been very busy lately. Here, I attempted to write a quick fix for ya, but I don't have any games to test it with. Let me know if it works for you. I added a function that should trim spaces from the end of safe title strings. Reload your titles to be 100% sure it took effect. JKSM.zip

trlkly commented 5 years ago

The CIA in the zip file worked for me. I was able to export and then import the saves from Prof. Layton vs. Phoenix Wright.

I imported my completed save file, and thus was able to get access to the extra content.

TheShadowRunner commented 4 years ago

Any chance to make that special build an official release?

J-D-K commented 4 years ago

Latest build contains the code that fixes this.