From 18123700cf5a71882c34f1e845da0b287599faaf Mon Sep 17 00:00:00 2001 From: iq_132 <1191709+iq132@users.noreply.github.com> Date: Sun, 4 Feb 2018 03:11:32 +0000 Subject: [PATCH] Hopefully the last few! Expose pAY8910Buffer to allow for filtering. --- src/burn/drv/galaxian/gal.h | 2 - src/burn/drv/galaxian/gal_run.cpp | 4 +- src/burn/drv/galaxian/gal_sound.cpp | 92 ++++------- src/burn/drv/konami/d_gyruss.cpp | 232 ++++++++++++++-------------- src/burn/drv/konami/d_junofrst.cpp | 14 +- src/burn/drv/konami/d_megazone.cpp | 16 +- src/burn/drv/konami/timeplt_snd.cpp | 23 +-- src/burn/drv/pre90s/d_btime.cpp | 56 ++++--- src/burn/drv/pre90s/d_fastfred.cpp | 15 +- src/burn/snd/ay8910.c | 26 ++-- src/burn/snd/ay8910.h | 2 + 11 files changed, 216 insertions(+), 266 deletions(-) diff --git a/src/burn/drv/galaxian/gal.h b/src/burn/drv/galaxian/gal.h index 1c5d8a0b1..b1018e333 100644 --- a/src/burn/drv/galaxian/gal.h +++ b/src/burn/drv/galaxian/gal.h @@ -272,8 +272,6 @@ INT32 GalFrame(); INT32 GalScan(INT32 nAction, INT32 *pnMin); // gal_sound.cpp -extern INT16* pFMBuffer; -extern INT16* pAY8910Buffer[9]; extern UINT8 GalSoundType; extern UINT8 HunchbksSoundIrqFire; extern UINT8 GalLastPort2; diff --git a/src/burn/drv/galaxian/gal_run.cpp b/src/burn/drv/galaxian/gal_run.cpp index 47c4a8b14..04da7822f 100644 --- a/src/burn/drv/galaxian/gal_run.cpp +++ b/src/burn/drv/galaxian/gal_run.cpp @@ -1754,7 +1754,7 @@ INT32 GalFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -1824,7 +1824,7 @@ INT32 GalFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } } diff --git a/src/burn/drv/galaxian/gal_sound.cpp b/src/burn/drv/galaxian/gal_sound.cpp index 88263bff3..e801e34b7 100644 --- a/src/burn/drv/galaxian/gal_sound.cpp +++ b/src/burn/drv/galaxian/gal_sound.cpp @@ -1,8 +1,5 @@ #include "gal.h" -INT16* pFMBuffer; -INT16* pAY8910Buffer[9]; - UINT8 GalSoundType; UINT8 HunchbksSoundIrqFire; @@ -118,64 +115,37 @@ void GalSoundReset() void GalSoundInit() { - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910) { - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * 3 * sizeof(INT16)); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * 6 * sizeof(INT16)); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910) { - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * 9 * sizeof(INT16)); - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC || GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - } - - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910) { - pAY8910Buffer[6] = pFMBuffer + nBurnSoundLen * 6; - pAY8910Buffer[7] = pFMBuffer + nBurnSoundLen * 7; - pAY8910Buffer[8] = pFMBuffer + nBurnSoundLen * 8; - } - if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_ZIGZAGAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMANAY8910 || GalSoundType == GAL_SOUND_HARDWARE_TYPE_JUMPBUGAY8910) { - AY8910Init(0, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1789750, 0); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_BONGOAY8910) { - AY8910Init(0, 1789750, nBurnSoundRate, &BongoDipSwitchRead, NULL, NULL, NULL); + AY8910Init2(0, 1789750, 0); + AY8910SetPorts(0, &BongoDipSwitchRead, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_CHECKMAJAY8910) { - AY8910Init(0, 1620000, nBurnSoundRate, &CheckmajPortARead, NULL, NULL, NULL); + AY8910Init2(0, 1620000, 0); + AY8910SetPorts(0, &CheckmajPortARead, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_MSHUTTLEAY8910) { // Port A Write - cclimber_sample_select_w - AY8910Init(0, 18432000 / 3 / 4, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 18432000 / 3 / 4, 0); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_FROGGERAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &FroggerSoundTimerRead, NULL, NULL); - + AY8910Init2(0, 14318000 / 8, 0); + AY8910SetPorts(0, &KonamiSoundLatchRead, &FroggerSoundTimerRead, NULL, NULL); + filter_rc_init(0, FLT_RC_LOWPASS, 1, 1, 1, 0, 0); filter_rc_init(1, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); filter_rc_init(2, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); - + filter_rc_set_src_gain(0, 0.75); filter_rc_set_src_gain(1, 0.75); filter_rc_set_src_gain(2, 0.75); @@ -186,8 +156,9 @@ void GalSoundInit() } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_KONAMIAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); + AY8910Init2(0, 14318000 / 8, 0); + AY8910Init2(1, 14318000 / 8, 1); + AY8910SetPorts(1, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); filter_rc_init(0, FLT_RC_LOWPASS, 1, 1, 1, 0, 0); filter_rc_init(1, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); @@ -212,16 +183,19 @@ void GalSoundInit() } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_EXPLORERAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, &KonamiSoundTimerRead, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, NULL, NULL, NULL); + AY8910Init2(0, 14318000 / 8, 0); + AY8910Init2(1, 14318000 / 8, 1); + AY8910SetPorts(0, &KonamiSoundTimerRead, NULL, NULL, NULL); + AY8910SetPorts(1, &KonamiSoundLatchRead, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SCORPIONAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); - AY8910Init(2, 14318000 / 8, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 14318000 / 8, 0); + AY8910Init2(1, 14318000 / 8, 1); + AY8910Init2(2, 14318000 / 8, 1); + AY8910SetPorts(1, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); filter_rc_init(0, FLT_RC_LOWPASS, 1, 1, 1, 0, 0); filter_rc_init(1, FLT_RC_LOWPASS, 1, 1, 1, 0, 1); @@ -246,22 +220,26 @@ void GalSoundInit() } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_AD2083AY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, &KonamiSoundTimerRead, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, NULL, NULL, NULL); + AY8910Init2(0, 14318000 / 8, 0); + AY8910Init2(1, 14318000 / 8, 1); + AY8910SetPorts(0, &KonamiSoundTimerRead, NULL, NULL, NULL); + AY8910SetPorts(1, &KonamiSoundLatchRead, NULL, NULL, NULL); AY8910SetAllRoutes(0, 1.00, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 1.00, BURN_SND_ROUTE_BOTH); } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_FANTASTCAY8910) { - AY8910Init(0, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1789750, 0); + AY8910Init2(1, 1789750, 1); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_SFXAY8910DAC) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, NULL, NULL, &SfxSoundLatch2Write, &SfxSampleControlWrite); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); + AY8910Init2(0, 14318000 / 8, 0); + AY8910Init2(1, 14318000 / 8, 1); + AY8910SetPorts(0, NULL, NULL, &SfxSoundLatch2Write, &SfxSampleControlWrite); + AY8910SetPorts(1, &KonamiSoundLatchRead, &KonamiSoundTimerRead, NULL, NULL); AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); @@ -310,8 +288,9 @@ void GalSoundInit() } if (GalSoundType == GAL_SOUND_HARDWARE_TYPE_HUNCHBACKAY8910) { - AY8910Init(0, 14318000 / 8, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 14318000 / 8, nBurnSoundRate, &KonamiSoundLatchRead, &HunchbksSoundTimerRead, NULL, NULL); + AY8910Init2(0, 14318000 / 8, 0); + AY8910Init2(1, 14318000 / 8, 1); + AY8910SetPorts(1, &KonamiSoundLatchRead, &HunchbksSoundTimerRead, NULL, NULL); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); @@ -462,9 +441,6 @@ void GalSoundExit() filter_rc_exit(); } - BurnFree(pFMBuffer); - for (INT32 i = 0; i < 9; i++) pAY8910Buffer[i] = NULL; - BurnFree(GalNoiseWave); BurnFree(GalShootWave); diff --git a/src/burn/drv/konami/d_gyruss.cpp b/src/burn/drv/konami/d_gyruss.cpp index 68da0d789..5d0dc9f2a 100644 --- a/src/burn/drv/konami/d_gyruss.cpp +++ b/src/burn/drv/konami/d_gyruss.cpp @@ -57,22 +57,22 @@ static INT32 scanline; static struct BurnInputInfo GyrussInputList[] = { {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, + {"P1 Start", BIT_DIGITAL, DrvJoy1 + 3, "p1 start" }, {"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" }, {"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" }, {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, + {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, + {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" }, {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, + {"P2 Start", BIT_DIGITAL, DrvJoy1 + 4, "p2 start" }, {"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" }, {"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" }, {"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, + {"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" }, + {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, + {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, {"Service", BIT_DIGITAL, DrvJoy1 + 2, "service" }, {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, @@ -84,55 +84,55 @@ STDINPUTINFO(Gyruss) static struct BurnDIPInfo GyrussDIPList[]= { // Default Values - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x3b, NULL }, - {0x12, 0xff, 0xff, 0x00, NULL }, + {0x10, 0xff, 0xff, 0xff, NULL }, + {0x11, 0xff, 0xff, 0x3b, NULL }, + {0x12, 0xff, 0xff, 0x00, NULL }, - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits " }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits " }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits " }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits " }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits " }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits " }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits " }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits " }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits " }, + {0 , 0xfe, 0 , 16, "Coin A" }, + {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits " }, + {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits " }, + {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits " }, + {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits " }, + {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits " }, + {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits " }, + {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits " }, + {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits " }, + {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits " }, + {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits " }, + {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits " }, + {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits " }, + {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits " }, + {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits " }, + {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits " }, {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits " }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits " }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits " }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits " }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits " }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits " }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits " }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits " }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits " }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits " }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits " }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits " }, + {0 , 0xfe, 0 , 16, "Coin B" }, + {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits " }, + {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits " }, + {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits " }, + {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits " }, + {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits " }, + {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits " }, + {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits " }, + {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits " }, + {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits " }, + {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits " }, + {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits " }, + {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits " }, + {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits " }, + {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits " }, + {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits " }, {0x10, 0x01, 0xf0, 0x00, "Free Play" }, - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, + {0 , 0xfe, 0 , 4, "Lives" }, + {0x11, 0x01, 0x03, 0x03, "3" }, + {0x11, 0x01, 0x03, 0x02, "4" }, + {0x11, 0x01, 0x03, 0x01, "5" }, {0x11, 0x01, 0x03, 0x00, "255 (Cheat)" }, - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, + {0 , 0xfe, 0 , 2, "Cabinet" }, + {0x11, 0x01, 0x04, 0x00, "Upright" }, + {0x11, 0x01, 0x04, 0x04, "Cocktail" }, {0 , 0xfe, 0 , 2, "Bonus Life" }, {0x11, 0x01, 0x08, 0x08, "30k 90k 60k+" }, @@ -140,98 +140,98 @@ static struct BurnDIPInfo GyrussDIPList[]= {0 , 0xfe, 0 , 8, "Difficulty" }, {0x11, 0x01, 0x70, 0x70, "1 (Easiest)" }, - {0x11, 0x01, 0x70, 0x60, "2" }, - {0x11, 0x01, 0x70, 0x50, "3" }, - {0x11, 0x01, 0x70, 0x40, "4" }, + {0x11, 0x01, 0x70, 0x60, "2" }, + {0x11, 0x01, 0x70, 0x50, "3" }, + {0x11, 0x01, 0x70, 0x40, "4" }, {0x11, 0x01, 0x70, 0x30, "5 (Average)" }, - {0x11, 0x01, 0x70, 0x20, "6" }, - {0x11, 0x01, 0x70, 0x10, "7" }, + {0x11, 0x01, 0x70, 0x20, "6" }, + {0x11, 0x01, 0x70, 0x10, "7" }, {0x11, 0x01, 0x70, 0x00, "8 (Hardest)" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, + {0x11, 0x01, 0x80, 0x80, "Off" }, + {0x11, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Demo Music" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, + {0x12, 0x01, 0x01, 0x01, "Off" }, + {0x12, 0x01, 0x01, 0x00, "On" }, }; STDDIPINFO(Gyruss) static struct BurnDIPInfo GyrussceDIPList[]= { - {0x10, 0xff, 0xff, 0xff, NULL }, - {0x11, 0xff, 0xff, 0x3b, NULL }, - {0x12, 0xff, 0xff, 0x20, NULL }, + {0x10, 0xff, 0xff, 0xff, NULL }, + {0x11, 0xff, 0xff, 0x3b, NULL }, + {0x12, 0xff, 0xff, 0x20, NULL }, - {0 , 0xfe, 0 , 16, "Coin A" }, - {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits " }, - {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits " }, - {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits " }, - {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits " }, - {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits " }, - {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits " }, - {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits " }, - {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits " }, - {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits " }, - {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits " }, - {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits " }, + {0 , 0xfe, 0 , 16, "Coin A" }, + {0x10, 0x01, 0x0f, 0x02, "4 Coins 1 Credits " }, + {0x10, 0x01, 0x0f, 0x05, "3 Coins 1 Credits " }, + {0x10, 0x01, 0x0f, 0x08, "2 Coins 1 Credits " }, + {0x10, 0x01, 0x0f, 0x04, "3 Coins 2 Credits " }, + {0x10, 0x01, 0x0f, 0x01, "4 Coins 3 Credits " }, + {0x10, 0x01, 0x0f, 0x0f, "1 Coin 1 Credits " }, + {0x10, 0x01, 0x0f, 0x03, "3 Coins 4 Credits " }, + {0x10, 0x01, 0x0f, 0x07, "2 Coins 3 Credits " }, + {0x10, 0x01, 0x0f, 0x0e, "1 Coin 2 Credits " }, + {0x10, 0x01, 0x0f, 0x06, "2 Coins 5 Credits " }, + {0x10, 0x01, 0x0f, 0x0d, "1 Coin 3 Credits " }, + {0x10, 0x01, 0x0f, 0x0c, "1 Coin 4 Credits " }, + {0x10, 0x01, 0x0f, 0x0b, "1 Coin 5 Credits " }, + {0x10, 0x01, 0x0f, 0x0a, "1 Coin 6 Credits " }, + {0x10, 0x01, 0x0f, 0x09, "1 Coin 7 Credits " }, {0x10, 0x01, 0x0f, 0x00, "Free Play" }, - {0 , 0xfe, 0 , 16, "Coin B" }, - {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits " }, - {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits " }, - {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits " }, - {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits " }, - {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits " }, - {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits " }, - {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits " }, - {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits " }, - {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits " }, - {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits " }, - {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits " }, - {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits " }, - {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits " }, + {0 , 0xfe, 0 , 16, "Coin B" }, + {0x10, 0x01, 0xf0, 0x20, "4 Coins 1 Credits " }, + {0x10, 0x01, 0xf0, 0x50, "3 Coins 1 Credits " }, + {0x10, 0x01, 0xf0, 0x80, "2 Coins 1 Credits " }, + {0x10, 0x01, 0xf0, 0x40, "3 Coins 2 Credits " }, + {0x10, 0x01, 0xf0, 0x10, "4 Coins 3 Credits " }, + {0x10, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits " }, + {0x10, 0x01, 0xf0, 0x30, "3 Coins 4 Credits " }, + {0x10, 0x01, 0xf0, 0x70, "2 Coins 3 Credits " }, + {0x10, 0x01, 0xf0, 0xe0, "1 Coin 2 Credits " }, + {0x10, 0x01, 0xf0, 0x60, "2 Coins 5 Credits " }, + {0x10, 0x01, 0xf0, 0xd0, "1 Coin 3 Credits " }, + {0x10, 0x01, 0xf0, 0xc0, "1 Coin 4 Credits " }, + {0x10, 0x01, 0xf0, 0xb0, "1 Coin 5 Credits " }, + {0x10, 0x01, 0xf0, 0xa0, "1 Coin 6 Credits " }, + {0x10, 0x01, 0xf0, 0x90, "1 Coin 7 Credits " }, {0x10, 0x01, 0xf0, 0x00, "Free Play" }, - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0x03, 0x03, "3" }, - {0x11, 0x01, 0x03, 0x02, "4" }, - {0x11, 0x01, 0x03, 0x01, "5" }, + {0 , 0xfe, 0 , 4, "Lives" }, + {0x11, 0x01, 0x03, 0x03, "3" }, + {0x11, 0x01, 0x03, 0x02, "4" }, + {0x11, 0x01, 0x03, 0x01, "5" }, {0x11, 0x01, 0x03, 0x00, "255 (Cheat)" }, - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x04, 0x00, "Upright" }, - {0x11, 0x01, 0x04, 0x04, "Cocktail" }, - + {0 , 0xfe, 0 , 2, "Cabinet" }, + {0x11, 0x01, 0x04, 0x00, "Upright" }, + {0x11, 0x01, 0x04, 0x04, "Cocktail" }, + {0 , 0xfe, 0 , 2, "Bonus Life" }, {0x11, 0x01, 0x08, 0x08, "50k 120k 70k+" }, {0x11, 0x01, 0x08, 0x00, "60k 140k 80k+" }, {0 , 0xfe, 0 , 8, "Difficulty" }, {0x11, 0x01, 0x70, 0x70, "1 (Easiest)" }, - {0x11, 0x01, 0x70, 0x60, "2" }, - {0x11, 0x01, 0x70, 0x50, "3" }, - {0x11, 0x01, 0x70, 0x40, "4" }, + {0x11, 0x01, 0x70, 0x60, "2" }, + {0x11, 0x01, 0x70, 0x50, "3" }, + {0x11, 0x01, 0x70, 0x40, "4" }, {0x11, 0x01, 0x70, 0x30, "5 (Average)" }, - {0x11, 0x01, 0x70, 0x20, "6" }, - {0x11, 0x01, 0x70, 0x10, "7" }, + {0x11, 0x01, 0x70, 0x20, "6" }, + {0x11, 0x01, 0x70, 0x10, "7" }, {0x11, 0x01, 0x70, 0x00, "8 (Hardest)" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x80, 0x80, "Off" }, - {0x11, 0x01, 0x80, 0x00, "On" }, + {0x11, 0x01, 0x80, 0x80, "Off" }, + {0x11, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Demo Music" }, - {0x12, 0x01, 0x01, 0x01, "Off" }, - {0x12, 0x01, 0x01, 0x00, "On" }, + {0x12, 0x01, 0x01, 0x01, "Off" }, + {0x12, 0x01, 0x01, 0x00, "On" }, }; STDDIPINFO(Gyrussce) @@ -983,7 +983,11 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); + AY8910Update(1, &pAY8910Buffer[3], nSegmentLength); + AY8910Update(2, &pAY8910Buffer[6], nSegmentLength); + AY8910Update(3, &pAY8910Buffer[9], nSegmentLength); + AY8910Update(4, &pAY8910Buffer[12], nSegmentLength); nSoundBufferPos += nSegmentLength; filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); @@ -1009,7 +1013,11 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); + AY8910Update(1, &pAY8910Buffer[3], nSegmentLength); + AY8910Update(2, &pAY8910Buffer[6], nSegmentLength); + AY8910Update(3, &pAY8910Buffer[9], nSegmentLength); + AY8910Update(4, &pAY8910Buffer[12], nSegmentLength); filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); diff --git a/src/burn/drv/konami/d_junofrst.cpp b/src/burn/drv/konami/d_junofrst.cpp index 4dd931437..dfee7ca5d 100644 --- a/src/burn/drv/konami/d_junofrst.cpp +++ b/src/burn/drv/konami/d_junofrst.cpp @@ -31,8 +31,6 @@ static UINT8 *blitterdata; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 soundlatch; static UINT8 soundlatch2; static UINT8 i8039_status; @@ -431,10 +429,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -507,7 +501,8 @@ static INT32 DrvInit() DACInit(0, 0, 1, DrvSyncDAC); DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH); - AY8910Init(0, 1789750, nBurnSoundRate, AY8910_0_portA, NULL, NULL, &AY8910_0_portBwrite); + AY8910Init2(0, 1789750, 0); + AY8910SetPorts(0, &AY8910_0_portA, NULL, NULL, &AY8910_0_portBwrite); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); filter_rc_init(0, FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(0), 0); @@ -644,7 +639,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); nSoundBufferPos += nSegmentLength; filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); @@ -656,8 +651,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); - + AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); diff --git a/src/burn/drv/konami/d_megazone.cpp b/src/burn/drv/konami/d_megazone.cpp index c4b38ca86..27fedda9c 100644 --- a/src/burn/drv/konami/d_megazone.cpp +++ b/src/burn/drv/konami/d_megazone.cpp @@ -34,8 +34,6 @@ static UINT8 *DrvShareRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[15]; - static UINT8 scrollx; static UINT8 scrolly; static UINT8 irq_enable; @@ -436,13 +434,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[ 0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[ 5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -549,7 +540,8 @@ static INT32 DrvInit() I8039SetIOReadHandler(megazone_i8039_read_port); I8039SetIOWriteHandler(megazone_i8039_write_port); - AY8910Init(0, 1789750, nBurnSoundRate, &AY8910_0_port_A_Read, NULL, &AY8910_0_port_A_Write, NULL); + AY8910Init2(0, 1789750, 0); + AY8910SetPorts(0, &AY8910_0_port_A_Read, NULL, &AY8910_0_port_A_Write, NULL); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); DACInit(0, 0, 1, DrvSyncDAC); @@ -759,7 +751,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); @@ -771,7 +763,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); filter_rc_update(2, pAY8910Buffer[2], pSoundBuf, nSegmentLength); diff --git a/src/burn/drv/konami/timeplt_snd.cpp b/src/burn/drv/konami/timeplt_snd.cpp index a731669cc..6781d3fd5 100644 --- a/src/burn/drv/konami/timeplt_snd.cpp +++ b/src/burn/drv/konami/timeplt_snd.cpp @@ -15,9 +15,6 @@ static UINT8 *z80ram; static INT32 z80_select = 0; static INT32 locomotnmode = 0; -static INT16 *pFMBuffer = NULL; -static INT16 *pAY8910Buffer[6]; - static void filter_write(INT32 num, UINT8 d) { INT32 C = 0; @@ -116,17 +113,6 @@ void TimepltSndReset() soundlatch = 0; } -static void TimepltSndAllocateBuffers() -{ - if (pFMBuffer != NULL) return; - - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16) * 6); - - for (INT32 i = 0; i < 6; i++) { - pAY8910Buffer[ 0] = pFMBuffer + i * nBurnSoundLen; - } -} - void TimepltSndInit(UINT8 *rom, UINT8 *ram, INT32 z80number) { z80rom = rom; @@ -144,8 +130,9 @@ void TimepltSndInit(UINT8 *rom, UINT8 *ram, INT32 z80number) ZetSetReadHandler(timeplt_sound_read); ZetClose(); - AY8910Init(0, 1789772, nBurnSoundRate, &AY8910_0_portA, &AY8910_0_portB, NULL, NULL); - AY8910Init(1, 1789772, nBurnSoundRate,NULL, NULL, NULL, NULL); + AY8910Init2(0, 1789772, 0); + AY8910Init2(1, 1789772, 1); + AY8910SetPorts(0, &AY8910_0_portA, &AY8910_0_portB, NULL, NULL); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); @@ -235,15 +222,11 @@ void TimepltSndExit() z80rom = NULL; z80ram = NULL; locomotnmode = 0; - - BurnFree(pFMBuffer); - pFMBuffer = NULL; } void TimepltSndUpdate(INT16 *pSoundBuf, INT32 nSegmentLength) { if (nSegmentLength <= 0) return; - TimepltSndAllocateBuffers(); AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); AY8910Update(1, &pAY8910Buffer[3], nSegmentLength); diff --git a/src/burn/drv/pre90s/d_btime.cpp b/src/burn/drv/pre90s/d_btime.cpp index 8cb01bd95..ace93472e 100644 --- a/src/burn/drv/pre90s/d_btime.cpp +++ b/src/burn/drv/pre90s/d_btime.cpp @@ -40,7 +40,6 @@ static UINT8 *DrvGfxROM3; static INT32 gfx0len; static INT32 gfx1len; -static INT16 *pAY8910Buffer[6]; static INT16 *hpfiltbuffer; static UINT8 DrvJoy1[8]; @@ -712,8 +711,9 @@ static void btimepalettewrite(UINT16 offset, UINT8 data) DrvPalette[offset] = BurnHighCol(r, g, b, 0); } -static UINT8 btime_main_read(UINT16 address) +static UINT8 btime_main_read(UINT16 addr) { + INT32 address = addr; RB(0x0000, 0x07ff, DrvMainRAM); RB(0x0c00, 0x0c1f, DrvPalRAM); RB(0x1000, 0x13ff, DrvVidRAM); @@ -753,8 +753,9 @@ static UINT8 btime_main_read(UINT16 address) return 0; } -static UINT8 bnj_main_read(UINT16 address) +static UINT8 bnj_main_read(UINT16 addr) { + INT32 address = addr; RB(0x0000, 0x07ff, DrvMainRAM); RB(0x5c00, 0x5c1f, DrvPalRAM); RB(0x4000, 0x43ff, DrvVidRAM); @@ -794,8 +795,9 @@ static UINT8 bnj_main_read(UINT16 address) return 0; } -static UINT8 zoar_main_read(UINT16 address) +static UINT8 zoar_main_read(UINT16 addr) { + INT32 address = addr; RB(0x0000, 0x07ff, DrvMainRAM); RB(0x8000, 0x83ff, DrvVidRAM); RB(0x8400, 0x87ff, DrvColRAM); @@ -834,8 +836,9 @@ static UINT8 zoar_main_read(UINT16 address) return 0; } -static UINT8 disco_main_read(UINT16 address) +static UINT8 disco_main_read(UINT16 addr) { + INT32 address = addr; RB(0x0000, 0x07ff, DrvMainRAM); RB(0x2000, 0x7fff, DrvCharRAM); RB(0x8000, 0x83ff, DrvVidRAM); @@ -874,8 +877,9 @@ static UINT8 mmonkeyop_main_read(UINT16 address) return DrvMainROMdec[address]; } -static UINT8 mmonkey_main_read(UINT16 address) +static UINT8 mmonkey_main_read(UINT16 addr) { + INT32 address = addr; RB(0x0000, 0x3bff, DrvMainRAM); RB(0x3c00, 0x3fff, DrvVidRAM); @@ -960,8 +964,9 @@ static void mmonkey_main_write(UINT16 address, UINT8 data) } } -static void btime_main_write(UINT16 address, UINT8 data) +static void btime_main_write(UINT16 addr, UINT8 data) { + INT32 address = addr; WB(0x0000, 0x07ff, DrvMainRAM); WB(0x1000, 0x13ff, DrvVidRAM); WB(0x1400, 0x17ff, DrvColRAM); @@ -1008,8 +1013,9 @@ static void btime_main_write(UINT16 address, UINT8 data) } } -static void zoar_main_write(UINT16 address, UINT8 data) +static void zoar_main_write(UINT16 addr, UINT8 data) { + INT32 address = addr; WB(0x0000, 0x07ff, DrvMainRAM); WB(0x8000, 0x83ff, DrvVidRAM); WB(0x8400, 0x87ff, DrvColRAM); @@ -1055,8 +1061,9 @@ static void zoar_main_write(UINT16 address, UINT8 data) } } -static void disco_main_write(UINT16 address, UINT8 data) +static void disco_main_write(UINT16 addr, UINT8 data) { + INT32 address = addr; WB(0x0000, 0x07ff, DrvMainRAM); WB(0x2000, 0x7fff, DrvCharRAM); WB(0x8000, 0x83ff, DrvVidRAM); @@ -1080,9 +1087,9 @@ static void disco_main_write(UINT16 address, UINT8 data) } } -static void bnj_main_write(UINT16 address, UINT8 data) +static void bnj_main_write(UINT16 addr, UINT8 data) { - + INT32 address = addr; WB(0x0000, 0x07ff, DrvMainRAM); WB(0x4000, 0x43ff, DrvVidRAM); WB(0x4400, 0x47ff, DrvColRAM); @@ -1127,8 +1134,9 @@ static void bnj_main_write(UINT16 address, UINT8 data) } } -static UINT8 btime_sound_read(UINT16 address) +static UINT8 btime_sound_read(UINT16 addr) { + INT32 address = addr; if (address <= 0x1fff) { return DrvSoundRAM[address & 0x3ff]; } @@ -1238,8 +1246,9 @@ static void btime_sound_write(UINT16 address, UINT8 data) } } -static UINT8 disco_sound_read(UINT16 address) +static UINT8 disco_sound_read(UINT16 addr) { + INT32 address = addr; RB(0x0000, 0x03ff, DrvSoundRAM); RB(0xf000, 0xffff, DrvSoundROM); @@ -1253,8 +1262,9 @@ static UINT8 disco_sound_read(UINT16 address) return 0; } -static void disco_sound_write(UINT16 address, UINT8 data) +static void disco_sound_write(UINT16 addr, UINT8 data) { + INT32 address = addr; WB(0x0000, 0x03ff, DrvSoundRAM); switch (address & 0xf000) @@ -1305,13 +1315,6 @@ static INT32 MemIndex() DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(INT32); - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - AllRam = Next; DrvMainRAM = Next; Next += 0x010000; @@ -1904,8 +1907,9 @@ static INT32 ZoarInit() M6502SetReadOpHandler(btime_sound_read); M6502Close(); - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, &ay8910_0_portA_write, NULL); - AY8910Init(1, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 3000000, 0); + AY8910Init2(1, 3000000, 1); + AY8910SetPorts(0, NULL, NULL, &ay8910_0_portA_write, NULL); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); @@ -2382,7 +2386,8 @@ static INT32 BtimeFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); + AY8910Update(1, &pAY8910Buffer[3], nSegmentLength); filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); @@ -2404,7 +2409,8 @@ static INT32 BtimeFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); + AY8910Update(1, &pAY8910Buffer[3], nSegmentLength); filter_rc_update(0, pAY8910Buffer[0], pSoundBuf, nSegmentLength); filter_rc_update(1, pAY8910Buffer[1], pSoundBuf, nSegmentLength); diff --git a/src/burn/drv/pre90s/d_fastfred.cpp b/src/burn/drv/pre90s/d_fastfred.cpp index 1d4d19b1f..97c54d145 100644 --- a/src/burn/drv/pre90s/d_fastfred.cpp +++ b/src/burn/drv/pre90s/d_fastfred.cpp @@ -24,8 +24,6 @@ static UINT8 *Gfx0, *Gfx1, *Gfx2, *Gfx3, *GfxImagoSprites, *Prom; static UINT8 DrvJoy1[8], DrvJoy2[8], DrvDips[2], DrvInput[2], DrvReset; -static INT16 *pAY8910Buffer[6]; - static UINT32 *DrvPalette; static UINT8 DrvRecalc; @@ -877,13 +875,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -941,8 +932,8 @@ static INT32 DrvInit() ZetSetReadHandler(fastfred_cpu1_read); ZetClose(); - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1536000, 0); + AY8910Init2(1, 1536000, 1); AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); @@ -1251,7 +1242,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); if (boggy84mode) { // hiss-removal lpf (see init) filter_rc_update(0, pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen); diff --git a/src/burn/snd/ay8910.c b/src/burn/snd/ay8910.c index 22b54b101..e16a1ae1f 100644 --- a/src/burn/snd/ay8910.c +++ b/src/burn/snd/ay8910.c @@ -47,7 +47,7 @@ static INT32 num = 0, ym_num = 0; static double AY8910Volumes[3 * 6]; static INT32 AY8910RouteDirs[3 * 6]; -static INT16 *AY8910Buffers[(MAX_8910 + 1) * 3]; +INT16 *pAY8910Buffer[(MAX_8910 + 1) * 3]; static INT32 nBurnSoundLenSave = 0; static INT32 AY8910AddSignal = 0; @@ -726,9 +726,9 @@ void AY8910Exit(INT32 chip) INT32 i; for (i = 0; i < 3; i++) { - if (AY8910Buffers[(chip * 3) + i]) { - free(AY8910Buffers[(chip * 3) + i]); - AY8910Buffers[(chip * 3) + i] = NULL; + if (pAY8910Buffer[(chip * 3) + i]) { + free(pAY8910Buffer[(chip * 3) + i]); + pAY8910Buffer[(chip * 3) + i] = NULL; } } } @@ -832,7 +832,7 @@ INT32 AY8910Init2(INT32 chip, INT32 clock, INT32 add_signal) for (i = 0; i < 3; i++) { - AY8910Buffers[(chip * 3) + i] = malloc(nBurnSoundLen * sizeof(INT16)); + pAY8910Buffer[(chip * 3) + i] = malloc(nBurnSoundLen * sizeof(INT16)); } num++; @@ -933,11 +933,11 @@ static inline void check_rate() for (i = 0; i < num * 3; i++) { - if (AY8910Buffers[i] != NULL) { - free (AY8910Buffers[i]); - AY8910Buffers[i] = NULL; + if (pAY8910Buffer[i] != NULL) { + free (pAY8910Buffer[i]); + pAY8910Buffer[i] = NULL; } - AY8910Buffers[i] = (INT16*)malloc(nBurnSoundLen * sizeof(INT16)); + pAY8910Buffer[i] = (INT16*)malloc(nBurnSoundLen * sizeof(INT16)); } } } @@ -956,7 +956,7 @@ void AY8910Render2(INT16* dest, INT32 length) check_rate(); for (i = 0; i < num; i++) { - AY8910Update(i, AY8910Buffers + (i * 3), length); + AY8910Update(i, pAY8910Buffer + (i * 3), length); } for (n = 0; n < length; n++) { @@ -964,9 +964,9 @@ void AY8910Render2(INT16* dest, INT32 length) for (i = 0; i < num * 3; i+=3) { - AY8910_ADD_SOUND(i + BURN_SND_AY8910_ROUTE_1, AY8910Buffers[i + 0]) - AY8910_ADD_SOUND(i + BURN_SND_AY8910_ROUTE_2, AY8910Buffers[i + 1]) - AY8910_ADD_SOUND(i + BURN_SND_AY8910_ROUTE_3, AY8910Buffers[i + 2]) + AY8910_ADD_SOUND(i + BURN_SND_AY8910_ROUTE_1, pAY8910Buffer[i + 0]) + AY8910_ADD_SOUND(i + BURN_SND_AY8910_ROUTE_2, pAY8910Buffer[i + 1]) + AY8910_ADD_SOUND(i + BURN_SND_AY8910_ROUTE_3, pAY8910Buffer[i + 2]) } nLeftSample = BURN_SND_CLIP(nLeftSample); diff --git a/src/burn/snd/ay8910.h b/src/burn/snd/ay8910.h index 358514bce..60392af64 100644 --- a/src/burn/snd/ay8910.h +++ b/src/burn/snd/ay8910.h @@ -16,6 +16,8 @@ struct AY8910interface void (*handler[MAX_8910])(INT32 irq); /* IRQ handler for the YM2203 */ }; +extern INT16 *pAY8910Buffer[(MAX_8910 + 1) * 3]; + extern INT32 ay8910burgertime_mode; extern INT32 ay8910_index_ym;