mame: remove patch causing sound regression
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
@@ -1,125 +0,0 @@
|
||||
From 240445aea325423722a2588208846d71e33ca1f5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
|
||||
Date: Fri, 8 Mar 2019 01:50:44 +0100
|
||||
Subject: [PATCH 2/2] pokey: yet another performance enhancement
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In case
|
||||
|
||||
* no counters are running at high speed without prescalers - and
|
||||
* no prescalers have triggered - and
|
||||
* there is no borrow counter expected to finish
|
||||
|
||||
there is no need to continue on step_one_clock.
|
||||
|
||||
Performance measuements:
|
||||
Before:
|
||||
./mame64 -bench 50 missile -> Average speed: 1322.75% (49 seconds)
|
||||
./mame64 -bench 50 starwars -> Average speed: 548.97% (49 seconds)
|
||||
./mame64 -bench 50 jedi -> Average speed: 375.08% (49 seconds)
|
||||
After:
|
||||
./mame64 -bench 50 missile -> Average speed: 1503.10% (49 seconds)
|
||||
./mame64 -bench 50 starwars -> Average speed: 648.10% (49 seconds)
|
||||
./mame64 -bench 50 jedi -> Average speed: 444.25% (49 seconds)
|
||||
|
||||
Upstream-Status: Submitted [1]
|
||||
|
||||
[1] https://github.com/mamedev/mame/pull/4735
|
||||
|
||||
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
|
||||
---
|
||||
src/devices/sound/pokey.cpp | 36 ++++++++++++++++++++++++++++++------
|
||||
src/devices/sound/pokey.h | 4 +++-
|
||||
2 files changed, 33 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp
|
||||
index 3372ac70a8..fc794fbf74 100644
|
||||
--- a/src/devices/sound/pokey.cpp
|
||||
+++ b/src/devices/sound/pokey.cpp
|
||||
@@ -243,6 +243,7 @@ void pokey_device::device_start()
|
||||
m_out_filter = 0;
|
||||
m_out_raw = 0;
|
||||
m_old_raw_inval = true;
|
||||
+ m_borrow_all_max = 0;
|
||||
m_kbd_state = 0;
|
||||
|
||||
/* reset more internal state */
|
||||
@@ -581,15 +582,34 @@ void pokey_device::step_one_clock(void)
|
||||
clock_triggered[CLK_114] = 1;
|
||||
}
|
||||
|
||||
+ /* in case
|
||||
+ * no channel is at high speed AND
|
||||
+ * no prescaler-clock has triggered AND
|
||||
+ * we are not expecting a borrow-count finish
|
||||
+ * => we are done and can exit here
|
||||
+ *
|
||||
+ * Note: for best performance on no-match case (matching case has to ask
|
||||
+ * for all conditions anyway), the sequence chosen is:
|
||||
+ * most likely no-match -> least likely no-match */
|
||||
+ if (!clock_triggered[CLK_28] && !clock_triggered[CLK_114] &&
|
||||
+ m_borrow_all_max == 0 &&
|
||||
+ (m_AUDCTL & (CH1_HICLK || CH3_HICLK)) == 0)
|
||||
+ {
|
||||
+ /* not quite: high speed potentiometer requires handling on each
|
||||
+ * cycle */
|
||||
+ if ((m_SKCTL & SK_PADDLE) && (m_pot_counter < 228))
|
||||
+ step_pot();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
int const base_clock = (m_AUDCTL & CLK_15KHZ) ? CLK_114 : CLK_28;
|
||||
- int clk = (m_AUDCTL & CH1_HICLK) ? CLK_1 : base_clock;
|
||||
- if (clock_triggered[clk])
|
||||
+ /* increment CHAN1 & CHAN3 at each cycle for high speed or on prescaler
|
||||
+ * clock trigger */
|
||||
+ if ((m_AUDCTL & CH1_HICLK) || clock_triggered[base_clock])
|
||||
m_channel[CHAN1].inc_chan();
|
||||
-
|
||||
- clk = (m_AUDCTL & CH3_HICLK) ? CLK_1 : base_clock;
|
||||
- if (clock_triggered[clk])
|
||||
+ if ((m_AUDCTL & CH3_HICLK) || clock_triggered[base_clock])
|
||||
m_channel[CHAN3].inc_chan();
|
||||
-
|
||||
+ /* same for CHAN2 & CHAN4 - if not joined as upper bits */
|
||||
if (clock_triggered[base_clock])
|
||||
{
|
||||
if (!(m_AUDCTL & CH12_JOINED))
|
||||
@@ -607,6 +627,10 @@ void pokey_device::step_one_clock(void)
|
||||
step_keyboard();
|
||||
}
|
||||
|
||||
+ /* performance-cheap decrement of shared helper max borrow counter */
|
||||
+ if(m_borrow_all_max != 0)
|
||||
+ m_borrow_all_max--;
|
||||
+
|
||||
/* do CHAN2 before CHAN1 because CHAN1 may set borrow! */
|
||||
if (m_channel[CHAN2].check_borrow())
|
||||
{
|
||||
diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h
|
||||
index 7e63e89e54..6d15a49275 100644
|
||||
--- a/src/devices/sound/pokey.h
|
||||
+++ b/src/devices/sound/pokey.h
|
||||
@@ -242,7 +242,8 @@ private:
|
||||
m_counter = (m_counter + 1) & 0xff;
|
||||
if (m_counter == 0 && m_borrow_cnt == 0)
|
||||
{
|
||||
- m_borrow_cnt = 3;
|
||||
+ m_borrow_cnt = m_parent->m_borrow_all_max = 3;
|
||||
+
|
||||
if (m_parent->m_IRQEN & m_INTMask)
|
||||
{
|
||||
/* Exposed state has changed: This should only be updated after a resync ... */
|
||||
@@ -286,6 +287,7 @@ private:
|
||||
|
||||
uint32_t m_out_raw; /* raw output */
|
||||
bool m_old_raw_inval; /* true: recalc m_out_raw required */
|
||||
+ uint32_t m_borrow_all_max; /* max borrow count for all channels */
|
||||
double m_out_filter; /* filtered output */
|
||||
|
||||
int32_t m_clock_cnt[3]; /* clock counters */
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -14,7 +14,6 @@ SRC_URI = " \
|
||||
file://0006-pokey_device-step_pot-remove-operations-with-no-effe.patch \
|
||||
file://0007-pokey-force-recalculation-of-raw-sound-output-after-.patch \
|
||||
file://0008-pokey-remove-unused-macros.patch \
|
||||
file://0009-pokey-yet-another-performance-enhancement.patch \
|
||||
file://no-upstream/0001-pokey-Make-step_one_clock-inline.patch \
|
||||
file://mame.desktop \
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user