Jump to content
LaunchBox Community Forums

Import ROMs from files: not whole filename imported?


sylandro

Recommended Posts

@Jason Carr Oops, I had forgot that I had added some other libraries that are not standard, and so your program is probably closing for that reason. I'll build an installer or self-contained exe and make sure that works before posting anything. Thanks for noticing that, spending too much time in VS :)
Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

Wow, you work fast! Thanks for the INI support. Unfortunately, these days I'm having very little spare time to try this out. Here's a little feedback I can give so far: - When pressing the Update under the Update Meta from Filename tab I don't get any progress bar, the first time I tried the application I thought it wasn't working. - After I loaded nes.ini, my Launchbox xml wouldn't load (perhaps a backup feature could be implemented in the future-- luckily I knew how to fix what happened). Here's the stacktrace (my OS in in spanish):
System.FormatException: No se puede reconocer la cadena como valor DateTime válido. en System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) en LaunchBox.Data.DataItem.LoadFromDataRow(DataRow row) en LaunchBox.Data.DataManager.Load() en LaunchBox.Data.DataManager..ctor(Boolean bare) en LaunchBox.Program.Main(String[] args)
The problem is that the Released field in the ini is a little inconsistent, sometimes it only contains the year, sometimes it only contains the format "Month, Year" and sometimes "Month Day, Year". A proper DateTime should be written on the ReleaseDate tag by specifying the input format and defaulting to January 01 if the month or day is missing.
Link to comment
Share on other sites

So this problem happens because I didn't realize that LaunchBox expects ReleaseDate to be a properly formatted datetime string. The INIs seem to just have a year for release date. How would you prefer it to be handled? (1) I could ignore the release date field. (2) I could create a custom release year field. (3) I could put release date as year-01-01 format so it gets parsed.
Link to comment
Share on other sites

OK, I've updated the program to be able to better handle these partial dates. I have it working and tested it on my own NES files and it seems to be working. As for the progress bar not animating, that is an issue with the library I am using. I don't really want to write a good WPF progress dialog, but if you know of a good one, let me know and I can see if I can migrate to it. Thanks for helping me test this a little. I do test myself, but it is easy to miss all edge cases.
Link to comment
Share on other sites

@Jason Carr That refers to the fact that they are using custom fields. If you don't have the premium version of LaunchBox and do anything that causes the xml file to change, then all of your custom fields will be deleted. I didn't want users without the premium version to rely on certain features, so I marked them as premium only. @sylandro Are you still getting parsing errors? It works for me. I did just check the repo though (not on dev machine right now), and it does look like I some how dropped the format string. Still, I tested it myself and had no problem loading the xml file anymore, so let me know if you are still running into problems.
Link to comment
Share on other sites

I tested it with the attached executable, and I still have parsing problems (I described the problem in the above post). For example, for the game Zombie Nation (USA), my ReleaseDate field has the following value: 1/09/1991 12:00:00 a. m. I have the "replace existing fields" checkbox checked in the application. Perhaps that has something to do?
Link to comment
Share on other sites

@sylandro My guess is that the problem was that he have different default regions, so the result of ToString on my machine is correctly parsed by LaunchBox, but not on your machine. Regardless, here is a new version that tries to match LaunchBox's value. I don't know if I have the right format string, as I can't check LaunchBox's code, but it does parse for me.
Link to comment
Share on other sites

@mathflair That worked! The ReleaseDate now has the correct format (1991-09-01T00:00:00-05:00). Now I'm getting another Exception, except this time I think it doesn't have anything related to the date: (Input string not in the correct format)
System.FormatException: La cadena de entrada no tiene el formato correcto. en System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) en System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) en LaunchBox.Data.DataItem.LoadFromDataRow(DataRow row) en LaunchBox.Data.DataManager.Load() en LaunchBox.Data.DataManager..ctor(Boolean bare) en LaunchBox.Program.Main(String[] args)
I don't have any clue what could be wrong this time... it's very hard to find which is the game with the incorrect value.
Link to comment
Share on other sites

Jason, using the following code releaseDate.ToString(CultureInfo.InvariantCulture.DateTimeFormat) I get an output of something that looks like "10/01/1985 00:00:00". When I look at the XML value though I see something of the form "1985-10-01T00:00:00-06:00". I am mimicking this value using releaseDate.ToString("yyyy-MM-ddT00:00:00K", CultureInfo.InvariantCulture.DateTimeFormat). I know you mention you use the InvariantCulture, but is the format string (i.e., "yyyy-MM-ddThh:mm:ssK") the same as what you are using?
Link to comment
Share on other sites

@mathflair About the SIFT files, I don't think it's neccesary anymore for your application to read these files. One can use the SIFT tool to alter the INIs and rename its game titles to match a specific datfile. That said, I think the INI feature is pretty much complete. I'll let you know if I find any issues. ------- E D I T ----------- I found a small issue: I've discovered that when using the ROM importer, Launchbox automatically changes the " - " strings for ": " (for example, a ROM named "1943 - The Battle for Midway" will be added as "1943: The Battle for Midway". While I think that's a great feature, I think LaunchboxAnnotator should do the same when matching the INI titles to the Launchbox titles. Some of my games are not having metadata added from the ini just because my ini has the " - " in its game title, and it never matches.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...