Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Robert

ARCADE 0.188

Recommended Posts

Aha I could replicate it. I altered gui\interface.ini and added a long line of zzzzzzzzz after my correct folder name. Then I started Arcade32 and quit. Then I checked ini\ui.ini and the historypath just says J.

Share this post


Link to post
Share on other sites

Found the problem and added a solution.

 

The issue is that when you call 'set_value', it can corrupt the data you pass to it. So, "path" turned into garbage, so garbage was written to ui.ini.

 

I made a temporary variable and copied "path" to it, then use the temporary variable on the 2nd write.

 

 

 

It might be wise in the future to note that once any variable is passed to set_value, that variable becomes useless.

  • Like 1

Share this post


Link to post
Share on other sites

 

So looks like the problem is here:

void OptionsInit(void)
{
	// setup our INI folder
	SetIniDir("ini");
	// gamelist creation
	game_opts.add_entries();
	// now load the options and interface settings
	LoadOptionsAndInterface();
	// setup directory for datafiles in the Internal UI
	SetDatsDir(GetDatsDir());
}

?Specifically, these seems have broken during 0.187-0.188 development cycle:
const char * GetDatsDir(void)
{
	return winui_opts.value(MUIOPTION_DATS_DIRECTORY);
}

void SetDatsDir(const char *path)
{
	winui_opts.set_value(MUIOPTION_DATS_DIRECTORY, path, OPTION_PRIORITY_CMDLINE);
	ui_opts.set_value(OPTION_HISTORY_PATH, path, OPTION_PRIORITY_CMDLINE);
	SaveInternalUI();	// ensure we store again the new dats dir for the core
}

I don't know what could happened, because all worked as expected in 0.187. Also, I'm still not able to reproduce this. My UI.INI didn't get corrupted and the value from INTERFACE.INI is correctly copied.

Mistery.

Found the problem and added a solution.

 

The issue is that when you call 'set_value', it can corrupt the data you pass to it. So, "path" turned into garbage, so garbage was written to ui.ini.

 

I made a temporary variable and copied "path" to it, then use the temporary variable on the 2nd write.

 

 

 

It might be wise in the future to note that once any variable is passed to set_value, that variable becomes useless.

 

That's good news!

I'm glad that you found the cause. :cat:

 

Anyway, it’s really mystery that it doesn’t occur depending on the environment.

Edited by demonkatze

Share this post


Link to post
Share on other sites

@ Robbberto, are you going to release ARCADE 0.188a like you did with MAMEUI 0.188a? Because that was a pretty significant bugfix. And also it would give us a chance to sniff out any other bugs before the v0.189 release.

Share this post


Link to post
Share on other sites

No, because the bug that afflicted MAMEUI didn't exist in ARCADE.

Share this post


Link to post
Share on other sites

Side note on the fix, Robert: wouldn't be better use:

 

const char *t1 = path;
 

 

instead of the strcpy method? Result is the same, I know.

Share this post


Link to post
Share on other sites

No, because we are using pointers to the memory holding the contents of path. If your suggestion was used, t1 will simply point at path. Then when path gets corrupted, t1 will be corrupt too, since it is looking at the same part of memory.

By making a copy, each one gets its own section of memory.

Share this post


Link to post
Share on other sites

Oh, you're right. I'm a bit out of the way. We need to make a safe copy of the variable content, not simply create an identical one.

Share this post


Link to post
Share on other sites

Use clrmamepro or some other rom manager to get the ones you want into a new folder.

Share this post


Link to post
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
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.

Sign in to follow this  

×
×
  • Create New...