registry = ipsRegistry::instance(); $this->settings =& $this->registry->fetchSettings(); } public function getOutput() { return; } public function replaceOutput($output, $key) { require_once( IPSLib::getAppDir('ibprobattle') . '/sources/battleHooks.php' ); $this->battleHook = new battleHooks( $this->registry ); return $this->battleHook->statsTopicView($output, $key); } } ?>registry = ipsRegistry::instance(); $this->settings =& $this->registry->fetchSettings(); } public function getOutput() { require_once( IPSLib::getAppDir('ibprobattle') . '/sources/battleHooks.php' ); $this->battleHook = new battleHooks( $this->registry ); return $this->battleHook->statsTopicViewJS(); } } ?> ARCADE 0.188 - Page 4 - ARCADE - 1Emulation.com

Jump to content

Welcome to 1Emulation.com
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

ARCADE 0.188

- - - - -

  • Please log in to reply
45 replies to this topic

#34
Robert

Robert

    Alchemist

  • User Admin
  • 11,372 posts
  • Gender:Male
  • Location:Land of Oz
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.

#35
Robert

Robert

    Alchemist

  • User Admin
  • 11,372 posts
  • Gender:Male
  • Location:Land of Oz
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.

#36
mamesick

mamesick

    Member

  • Members+
  • 56 posts

Very good. 



#37
demonkatze

demonkatze

    Newbie

  • Members+
  • 17 posts
  • Gender:Not Telling

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, 07 August 2017 - 11:09 AM.


#38
Chanbara

Chanbara

    Novice

  • Members+
  • 22 posts
  • Gender:Male
  • Location:Greenland

@ 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.



#39
Robert

Robert

    Alchemist

  • User Admin
  • 11,372 posts
  • Gender:Male
  • Location:Land of Oz
No, because the bug that afflicted MAMEUI didn't exist in ARCADE.

#40
mamesick

mamesick

    Member

  • Members+
  • 56 posts

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.



#41
Robert

Robert

    Alchemist

  • User Admin
  • 11,372 posts
  • Gender:Male
  • Location:Land of Oz
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.

#42
mamesick

mamesick

    Member

  • Members+
  • 56 posts

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. 



#43
Zarzon

Zarzon

    Novice

  • Members+
  • 22 posts

How can I remove non-arcade roms from my roms folder?


Edited by Zarzon, 16 August 2017 - 08:00 AM.


#44
Robert

Robert

    Alchemist

  • User Admin
  • 11,372 posts
  • Gender:Male
  • Location:Land of Oz
Use clrmamepro or some other rom manager to get the ones you want into a new folder.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users