diff --git a/recipes-emulators/mame/mame/0002-pokey-performance-optimization-by-not-using-modulus.patch b/recipes-emulators/mame/mame/0002-pokey-performance-optimization-by-not-using-modulus.patch new file mode 100644 index 0000000..5d021eb --- /dev/null +++ b/recipes-emulators/mame/mame/0002-pokey-performance-optimization-by-not-using-modulus.patch @@ -0,0 +1,43 @@ +From 20d22d8ccd644698a0103ddf116e97c3f365a98d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= +Date: Tue, 26 Feb 2019 08:35:46 +0100 +Subject: [PATCH] pokey: performance optimization by not using modulus +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Backport [1] + +[1] https://github.com/mamedev/mame/commit/d67456f6717faf7f06f422d1e8f1017650aeac46 + +Signed-off-by: Andreas Müller +--- + src/devices/sound/pokey.cpp | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp +index 9afe7e8dba..6cd63dca93 100644 +--- a/src/devices/sound/pokey.cpp ++++ b/src/devices/sound/pokey.cpp +@@ -589,10 +589,14 @@ uint32_t pokey_device::step_one_clock(void) + } + } + +- m_p4 = (m_p4 + 1) % 0x0000f; +- m_p5 = (m_p5 + 1) % 0x0001f; +- m_p9 = (m_p9 + 1) % 0x001ff; +- m_p17 = (m_p17 + 1 ) % 0x1ffff; ++ if (++m_p4 >= 0x0000f) ++ m_p4 = 0; ++ if (++m_p5 >= 0x0001f) ++ m_p5 = 0; ++ if (++m_p9 >= 0x001ff) ++ m_p9 = 0; ++ if (++m_p17 >= 0x1ffff) ++ m_p17 = 0; + + clk = (m_AUDCTL & CH1_HICLK) ? CLK_1 : base_clock; + if (clock_triggered[clk]) +-- +2.20.1 + diff --git a/recipes-emulators/mame/mame_0206.bb b/recipes-emulators/mame/mame_0206.bb index e01a399..1ffcbe5 100644 --- a/recipes-emulators/mame/mame_0206.bb +++ b/recipes-emulators/mame/mame_0206.bb @@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=798620970c471a3a6b7b5e9c9192fe12" SRC_URI = " \ https://github.com/mamedev/mame/archive/${BPN}${PV}.tar.gz \ file://0001-Show-video-mode-option-accel-in-help-and-GUI.patch \ + file://0002-pokey-performance-optimization-by-not-using-modulus.patch \ file://mame.desktop \ file://MAMElogo.svg \ "