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

ARCADE 0.212

Recommended Posts

The person who made the change in Mame isn't finished yet, however if things stay as they are now, then I agree we should drop all support (reading and writing) of plugin.ini

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

A little report.
Maybe have another modification to the code. Overclocks don't save anymore.
Tested on Cps1 games. Neo Geo and Double Dragon

Edited by Danielrsti

Share this post


Link to post
Share on other sites
28 minutes ago, Danielrsti said:

A little report.
Maybe have another modification to the code. Overclocks don't save anymore.

I guess that the support for saving overclock has been dropped out during the recent big change in internal UI code made by an official MAME Developer. I don't know if Robert will be able (or better will have the time) to re-implement it.

  • Like 3

Share this post


Link to post
Share on other sites
Posted (edited)

Truxton 2 stereo sound enabled is gone and it's probably gone from some long time. It's even gone in my source.

 

For overclocks, sound volume save please wait for groovymame new patch.

Edited by haynor666

Share this post


Link to post
Share on other sites

Here is also new code for saving volume/overclocking. It has also frame_delay code but I'm sure it's easy to cut only interesting part.

diff -Nru src/frontend/mame/ui/ui.cpp src/frontend/mame/ui/ui.cpp
--- src/frontend/mame/ui/ui.cpp	2019-08-03 12:28:56.000000000 +0200
+++ src/frontend/mame/ui/ui.cpp	2019-08-05 11:16:09.000000000 +0200
@@ -31,6 +31,7 @@
 #include "ui/viewgfx.h"
 #include "imagedev/cassette.h"
 #include "../osd/modules/lib/osdobj_common.h"
+#include "config.h"
 
 
 /***************************************************************************
@@ -193,6 +194,9 @@
 	// request a callback upon exiting
 	machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&mame_ui_manager::exit, this));
 
+	// register callbacks
+	machine().configuration().config_register("sliders", config_load_delegate(&mame_ui_manager::config_load, this), config_save_delegate(&mame_ui_manager::config_save, this));
+
 	// create mouse bitmap
 	uint32_t *dst = &m_mouse_bitmap.pix32(0);
 	memcpy(dst,mouse_bitmap,32*32*sizeof(uint32_t));
@@ -1348,6 +1352,9 @@
 	// add overall volume
 	m_sliders.push_back(slider_alloc(SLIDER_ID_VOLUME, _("Master Volume"), -32, 0, 0, 1, nullptr));
 
+	// add frame delay
+	m_sliders.push_back(slider_alloc(SLIDER_ID_FRAMEDELAY, _("Frame Delay"), 0, machine.options().frame_delay(), 9, 1, nullptr));
+
 	// add per-channel volume
 	mixer_input info;
 	for (int item = 0; machine.sound().indexed_mixer_input(item, info); item++)
@@ -1492,6 +1499,8 @@
 	}
 #endif
 
+	config_apply();
+
 	std::vector<ui::menu_item> items;
 	for (auto &slider : m_sliders)
 	{
@@ -1515,6 +1524,8 @@
 {
 	if (id == SLIDER_ID_VOLUME)
 		return slider_volume(machine, arg, id, str, newval);
+	else if (id == SLIDER_ID_FRAMEDELAY)
+		return slider_framedelay(machine, arg, id, str, newval);
 	else if (id >= SLIDER_ID_MIXERVOL && id <= SLIDER_ID_MIXERVOL_LAST)
 		return slider_mixervol(machine, arg, id, str, newval);
 	else if (id >= SLIDER_ID_ADJUSTER && id <= SLIDER_ID_ADJUSTER_LAST)
@@ -1579,6 +1590,21 @@
 
 
 //-------------------------------------------------
+//  slider_framedelay - global frame delay slider
+//  callback
+//-------------------------------------------------
+
+int32_t mame_ui_manager::slider_framedelay(running_machine &machine, void *arg, int id, std::string *str, int32_t newval)
+{
+	if (newval != SLIDER_NOCHANGE)
+		machine.video().set_framedelay(newval);
+	if (str)
+		*str = string_format(_("%1$3d"), machine.video().framedelay());
+	return machine.video().framedelay();
+}
+
+
+//-------------------------------------------------
 //  slider_mixervol - single channel volume
 //  slider callback
 //-------------------------------------------------
@@ -2195,3 +2221,83 @@
 	m_dipsw_color = options.dipsw_color();
 	m_slider_color = options.slider_color();
 }
+
+//-------------------------------------------------
+//  config_load - read data from the
+//  configuration file
+//-------------------------------------------------
+
+void mame_ui_manager::config_load(config_type cfg_type, util::xml::data_node const *parentnode)
+{
+	// we only care about game files
+	if (cfg_type != config_type::GAME)
+		return;
+
+	// might not have any data
+	if (parentnode == nullptr)
+		return;
+
+	// iterate over slider nodes
+	for (util::xml::data_node const *slider_node = parentnode->get_child("slider"); slider_node; slider_node = slider_node->get_next_sibling("slider"))
+	{
+		const char *desc = slider_node->get_attribute_string("desc", "");
+		int32_t saved_val = slider_node->get_attribute_int("value", 0);
+
+		// create a dummy slider to store the saved value
+		m_sliders_saved.push_back(slider_alloc(0, desc, 0, saved_val, 0, 0, 0));
+	}
+}
+
+
+//-------------------------------------------------
+//  config_appy - apply data from the conf. file
+//  This currently needs to be done on a separate
+//  step because sliders are not created yet when
+//  configuration file is loaded
+//-------------------------------------------------
+
+void mame_ui_manager::config_apply(void)
+{
+	// iterate over sliders and restore saved values
+	for (auto &slider : m_sliders)
+	{
+		for (auto &slider_saved : m_sliders_saved)
+		{
+			if (!strcmp(slider->description.c_str(), slider_saved->description.c_str()))
+			{
+				std::string tempstring;
+				slider->update(machine(), slider->arg, slider->id, &tempstring, slider_saved->defval);
+				break;
+
+			}
+		}
+	}
+}
+
+
+//-------------------------------------------------
+//  config_save - save data to the configuration
+//  file
+//-------------------------------------------------
+
+void mame_ui_manager::config_save(config_type cfg_type, util::xml::data_node *parentnode)
+{
+	// we only care about game files
+	if (cfg_type != config_type::GAME)
+		return;
+
+	std::string tempstring;
+	util::xml::data_node *slider_node;
+
+	// save UI sliders
+	for (auto &slider : m_sliders)
+	{
+		int32_t curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE);
+		if (curval != slider->defval)
+		{
+			slider_node = parentnode->add_child("slider", nullptr);
+			slider_node->set_attribute("desc", slider->description.c_str());
+			slider_node->set_attribute_int("value", curval);
+		}
+	}
+}
\ No newline at end of file
diff -Nru src/frontend/mame/ui/ui.h src/frontend/mame/ui/ui.h
--- src/frontend/mame/ui/ui.h	2019-08-03 12:28:56.000000000 +0200
+++ src/frontend/mame/ui/ui.h	2019-08-05 11:07:28.000000000 +0200
@@ -53,6 +53,7 @@
 enum
 {
 	SLIDER_ID_VOLUME                = 0,
+	SLIDER_ID_FRAMEDELAY,
 	SLIDER_ID_MIXERVOL,
 	SLIDER_ID_MIXERVOL_LAST         = SLIDER_ID_MIXERVOL + SLIDER_DEVICE_SPACING,
 	SLIDER_ID_ADJUSTER,
@@ -234,6 +235,11 @@
 	void start_save_state();
 	void start_load_state();
 
+	// config callbacks
+	void config_load(config_type cfg_type, util::xml::data_node const *parentnode);
+	void config_save(config_type cfg_type, util::xml::data_node *parentnode);
+	void config_apply(void);
+
 	// slider controls
 	std::vector<ui::menu_item>&  get_slider_list(void);
 
@@ -300,6 +306,7 @@
 	virtual int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) override;
 
 	int32_t slider_volume(running_machine &machine, void *arg, int id, std::string *str, int32_t newval);
+	int32_t slider_framedelay(running_machine &machine, void *arg, int id, std::string *str, int32_t newval);
 	int32_t slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, int32_t newval);
 	int32_t slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, int32_t newval);
 	int32_t slider_overclock(running_machine &machine, void *arg, int id, std::string *str, int32_t newval);
@@ -326,6 +333,7 @@
 	#endif
 
 	std::vector<std::unique_ptr<slider_state>> m_sliders;
+	std::vector<std::unique_ptr<slider_state>> m_sliders_saved;
 };

 

Share this post


Link to post
Share on other sites
Posted (edited)

Sengoku 2 title screen still has one bad line so maybe check that was in source is still needed.

 

@@ -520,12 +521,9 @@
 {
 	int scanline = param;
 
-	/* we are at the beginning of a scanline -
-	   we need to draw the previous scanline and parse the sprites on the current one */
-	if (scanline != 0)
-		screen().update_partial(scanline - 1);
-
-	parse_sprites(scanline);
+	/* we are at the beginning of a scanline */
+	if (m_neogeo_raster_hack & 0x10)	/* raster interrupt enabled */
+	{
+		if (strcmp(machine().system().name, "sengoku2") == 0)
+			m_screen->update_partial(scanline - 1);
+		else
+			m_screen->update_partial(scanline + 1);
+	}

 
 	/* let's come back at the beginning of the next line */
 	scanline = (scanline + 1) % NEOGEO_VTOTAL;

 

Edited by haynor666

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.


×
×
  • Create New...