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 Source Code updated to latest MAME GIT - 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 Source Code updated to latest MAME GIT

- - - - -

  • Please log in to reply
10 replies to this topic

#1
mamesick

mamesick

    Member

  • Members+
  • 63 posts

Hello, Robbbert, I know you are already aware of Nathan Woods changes to MAME core, we already discussed about this.

I spent a couple of days in trying to update and keep working the ARCADE winui code and I must say that if Devs want to shut down ARCADE really, they must think something more serious. I'm joking, though, yes, I've been able to have all our features working again.

 

Relevant changes are:

- removed assignment opts1 = opts2 is now opts1.copy_from(opts2) The new code allows us to do this easily and it works.

- removed boolean operator opts1 == opts2 is now a new function written by me AreOptionsEqual(opts1, opts2) that perfectly reproduces the old behaviour. I experimented a lot of crashes while writing this new portion of code. But finally I found where was the crash bug.

- reverting a set of option is no more possible, but you can use a trick: setup a temporary set of option and copy it to the one that must be reverted. The temporary one will contain default values and et voila', reverting done:

void ResetInterface(void)
{
	winui_options winui_opts_temp;		// this should contain default values
	winui_opts.copy_from(winui_opts_temp);	// copy default to current
	SaveInterface();
} 

 

- parsing an .INI file requires now two boolean parameters that must be always both set as true. If not, in the scenario that you have some invalid options in your .INI, MAME core will crash with an MSVCRT.DLL exception. I don't know if it's a core bug or not, though with the correct parameters, all is fine.

Core function to use : void parse_ini_file(util::core_file &inifile, int priority, bool ignore_unknown_options, bool always_override);

So in our code : opts.parse_ini_file((util::core_file&)file, OPTION_PRIORITY_CMDLINE, true, true);

 

Last crashes I encountered were in LoadFolderFlags and AddFolderFlags that load and save respectively the custom filters you can setup for folders. Curiously, new code refuses to accept the dash "-" symbol as part of the name of an option. So I have to add a check for this char and replace it with underscore one.

Code:

			// Convert spaces and dashes to underscores or core will crash badly
			strcpy(folder_name, lpFolder->m_lpTitle);
			char *ptr = folder_name;

			while (*ptr)
			{
				if (*ptr == ' ' || *ptr == '-')
					*ptr = '_';

				ptr++;
			}

			std::string option_name = std::string(folder_name).append("_filters");
			// create entry
			entries[0].name = option_name.c_str();
			opts.add_entries(entries);

 

That's all. The rest was only a tedious work of remove that std::string error_string ---> assert(blah blah) that has been removed from the core when you need to store an option value;
 
Here's a download link with your full 0.187 ARCADE source code updated to this GIT commit: https://git.redump.n...a678b3067aa16cc
 
I probably missed something in ARCADE.FLT file, maybe there are new drivers that should be added there. It's up to you do this. I'm sorry that I cannot help you with standard MAMEUI but perhaps looking at my changes for ARCADE with the necessary attention will make you able to port them to your other build.
 
Time for a walk, it's quite hot and an ice cream will be good. 
Take care, see you soon.

Edited by mamesick, 29 June 2017 - 06:16 PM.


#2
Robert

Robert

    Alchemist

  • User Admin
  • 11,448 posts
  • Gender:Male
  • Location:Land of Oz
Thanks for your work, and a surprise as I was ready to have a few months break.

Should be much the same with MAMEUI... hopefully. :-)

#3
Robert

Robert

    Alchemist

  • User Admin
  • 11,448 posts
  • Gender:Male
  • Location:Land of Oz
Compiled fine. :-)

#4
Robert

Robert

    Alchemist

  • User Admin
  • 11,448 posts
  • Gender:Male
  • Location:Land of Oz
Got MESSUI to compile, but it doesn't start. Now need to track down where the fault lies.

#5
Robert

Robert

    Alchemist

  • User Admin
  • 11,448 posts
  • Gender:Male
  • Location:Land of Oz
HBMAMEUI converted over ok and working.

MESSUI/MAMEUI is a total dead duck though. I worked on MESSUI, and got it to start up, but there's many ways to crash it. The software section is totally ruined. Just trying to find out what software is loaded causes a crash.

I'm thinking of transplanting ARCADE's frontend onto MAMEUI, because I know this works, but of course no more software support. MESSUI will just die.

I'll need to add the "Menu" tickbox though, to enable NewUI. And I need someone to make a MAMEUI splash screen at start.

Anyway, John has been contacted, let's see if he's happy to do that.

#6
mamesick

mamesick

    Member

  • Members+
  • 63 posts

Sorry for the very late reply, I've been away for a couple of days... It's very hot here in Milan. I must say that it was exactly my fear the possibility that software section in MAMEUI/MESSUI could have been totally ruined by the new changes that have been introduced just to fix the many core issues with sofware lists handling (mount a slot, a device and so on) present in official MAME. It's a pity, but maybe it's just time to quit that huge of amount of very ancient code that is MAMEUI. I have no objections in porting ARCADE winui code to your other builds, so just make your decision considering that you'll receive probably some complaints from MAMEUI users for the absence of some features like background, etc.

 

Now, only a thing a noticed with the new code in ARCADE:

- PLUGINS folder must always exists with the executable, even in another directory configured via GUI. If not, it could happen the scenario that you launch ARCADE for the first time and it creates all the .INI files but if PLUGINS dir is not present, it will create an empty PLUGINS.INI. At the second launch, the startup will parse again all .INIs and the plugins one will cause a bad crash with an MSVCRT.DLL exception (I believe it's a core "feature") and all will stop.

So the solution is  distribute with the executable the PLUGINS folder or comment out in source the line that parses the ini. It's in LoadPluginsFile. Afterall, we don't handle the PLUGINS.INI in the GUI but only the core option -plugins so maybe all the portions of code related to plugins.ini could be removed.

Of course nothing happen if you launch the executable in a well standard configuration, with all the extra directories needed by MAME already present (or if a correct PLUGINS.INI already exists)



#7
Robert

Robert

    Alchemist

  • User Admin
  • 11,448 posts
  • Gender:Male
  • Location:Land of Oz
Thanks for the updated info on ARCADE.

I've made some progress with MESSUI software. For whatever reason, you can't access image information without passing the system name to the core first. Otherwise it just crashes (bad core design). Once this was fixed, the software part works, except that it is no longer possible to find out what software is already loaded. This is a definite regression in the core.

Next problem was that upon displaying the "Display" tab of the options, it would crash. I found that by commenting out the no-longer-used d3d-version selection box in messui.rc it was fixed. I can't see why it would crash, it just did. Anyway I put the d3d code in properties.cpp behind a #define, so now it will not be compiled in.

Everything else seems to be ok, apart from the fact that sometimes clicking on a game will just blow up. For example, clicking on Next computer, followed by NGEN, will crash. It also happens if you do NGEN first followed by Next. This needs to be investigated.

I still think that I'll make a MAMEUI version with ARCADE frontend, even if the normal one can be fixed. So you'll have a choice of which one you'd like to use.

#8
Robert

Robert

    Alchemist

  • User Admin
  • 11,448 posts
  • Gender:Male
  • Location:Land of Oz
Had a very quick look at the PLUGIN thing. MAME can handle the situation perfectly well, so it's a matter of seeing where ARCADE is going wrong.



EDIT: OK sorted that out, it won't crash now. The core tests the file with a TRY/CATCH, on failure it prints a message. I added the same, except on failure it tries to make a new file.

#9
Robert

Robert

    Alchemist

  • User Admin
  • 11,448 posts
  • Gender:Male
  • Location:Land of Oz
After a marathon week trying to track down the last elusive crash in MESSUI, it was found eventually.
Also I rearranged some code and voila the names of the loaded software appears.

So, as far as I know, it's all working correctly. Therefore a release of MESSUI/MAMEUI will be possible at the end of the month.

#10
mamesick

mamesick

    Member

  • Members+
  • 63 posts

I'm reading very good news! Nice that you sorted out all issues in your other builds.



#11
Robert

Robert

    Alchemist

  • User Admin
  • 11,448 posts
  • Gender:Male
  • Location:Land of Oz
Extensive testing of MESSUI uncovered more crashes. I've fixed most. The crashes that can still happen are if you select anything in the pc.cpp driver it might crash. Also, canonv30f (a msx2 machine) crashes.

I didn't test MAMEUI because there's so many games, but I did fix a crash with the megatech games.

Another source of crashes is corrupt ini files. So, if you select a game and it instantly blows up before you even get to run it, delete the game's ini file (if it exists).

For those who like to use my command-line version of MESS, I've fixed it so that invalid slot options won't kill MESS, and the game will still attempt to run.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users