mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
Merge pull request #265 from superctr/master
C352: Add divider for System 23, change enum format
This commit is contained in:
commit
7045943321
@ -13,6 +13,14 @@
|
||||
Supports 8-bit linear and 8-bit muLaw samples
|
||||
Output: digital, 16 bit, 4 channels
|
||||
Output sample rate is the input clock / (288 * 2).
|
||||
|
||||
superctr: The clock divider appears to be configurable for each system.
|
||||
Below is a list of the divider values followed by the systems that use it.
|
||||
|
||||
* 228: System 11.
|
||||
* 288: System 22, Super 22, NB-1/2, ND-1, FL.
|
||||
* 296: System 23, Super 23.
|
||||
* 332: System 12.
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
@ -468,7 +476,7 @@ void c352_device::write_reg16(unsigned long address, unsigned short val)
|
||||
|
||||
void c352_device::device_start()
|
||||
{
|
||||
int i, divider;
|
||||
int i;
|
||||
double x_max = 32752.0;
|
||||
double y_max = 127.0;
|
||||
double u = 10.0;
|
||||
@ -476,21 +484,7 @@ void c352_device::device_start()
|
||||
// find our direct access
|
||||
m_direct = &space().direct();
|
||||
|
||||
switch(m_divider)
|
||||
{
|
||||
case C352_DIVIDER_228:
|
||||
divider=228;
|
||||
break;
|
||||
case C352_DIVIDER_288:
|
||||
default:
|
||||
divider=288;
|
||||
break;
|
||||
case C352_DIVIDER_332:
|
||||
divider=332;
|
||||
break;
|
||||
}
|
||||
|
||||
m_sample_rate_base = clock() / divider;
|
||||
m_sample_rate_base = clock() / m_divider;
|
||||
|
||||
m_stream = machine().sound().stream_alloc(*this, 0, 4, m_sample_rate_base);
|
||||
|
||||
|
@ -5,17 +5,6 @@
|
||||
#ifndef __C352_H__
|
||||
#define __C352_H__
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
enum
|
||||
{
|
||||
C352_DIVIDER_228 = 0,
|
||||
C352_DIVIDER_288 = 1,
|
||||
C352_DIVIDER_332 = 2
|
||||
};
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
@ -610,7 +610,7 @@ static MACHINE_CONFIG_START( namcofl, namcofl_state )
|
||||
MCFG_VIDEO_START_OVERRIDE(namcofl_state,namcofl)
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
MCFG_C352_ADD("c352", 48384000/2, C352_DIVIDER_288)
|
||||
MCFG_C352_ADD("c352", 48384000/2, 288)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
|
@ -1126,7 +1126,7 @@ static MACHINE_CONFIG_START( namconb1, namconb1_state )
|
||||
MCFG_VIDEO_START_OVERRIDE(namconb1_state,namconb1)
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
MCFG_C352_ADD("c352", MASTER_CLOCK/2, C352_DIVIDER_288)
|
||||
MCFG_C352_ADD("c352", MASTER_CLOCK/2, 288)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
@ -1163,7 +1163,7 @@ static MACHINE_CONFIG_START( namconb2, namconb1_state )
|
||||
MCFG_VIDEO_START_OVERRIDE(namconb1_state,namconb2)
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
MCFG_C352_ADD("c352", MASTER_CLOCK/2, C352_DIVIDER_288)
|
||||
MCFG_C352_ADD("c352", MASTER_CLOCK/2, 288)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
|
@ -307,7 +307,7 @@ static MACHINE_CONFIG_START( namcond1, namcond1_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_C352_ADD("c352", XTAL_49_152MHz/2, C352_DIVIDER_288)
|
||||
MCFG_C352_ADD("c352", XTAL_49_152MHz/2, 288)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
|
@ -571,7 +571,7 @@ static MACHINE_CONFIG_START( coh110, namcos11_state )
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_C352_ADD("c352", 20013200, C352_DIVIDER_228)
|
||||
MCFG_C352_ADD("c352", 20013200, 228)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
|
@ -1622,7 +1622,7 @@ static MACHINE_CONFIG_START( coh700, namcos12_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_C352_ADD("c352", 29168000, C352_DIVIDER_332)
|
||||
MCFG_C352_ADD("c352", 29168000, 332)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
|
@ -3781,7 +3781,7 @@ static MACHINE_CONFIG_START( namcos22, namcos22_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_C352_ADD("c352", SS22_MASTER_CLOCK/2, C352_DIVIDER_288)
|
||||
MCFG_C352_ADD("c352", SS22_MASTER_CLOCK/2, 288)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
@ -3830,7 +3830,7 @@ static MACHINE_CONFIG_START( namcos22s, namcos22_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_C352_ADD("c352", SS22_MASTER_CLOCK/2, C352_DIVIDER_288)
|
||||
MCFG_C352_ADD("c352", SS22_MASTER_CLOCK/2, 288)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
|
@ -1247,7 +1247,8 @@ Notes:
|
||||
#define JVSCLOCK (XTAL_14_7456MHz)
|
||||
#define H8CLOCK (16737350) /* from 2061 */
|
||||
#define BUSCLOCK (16737350*2) /* 33MHz CPU bus clock / input */
|
||||
#define C352CLOCK (25992000) /* measured at 25.992MHz from 2061 pin 9 (System 12 uses a divider of 332) */
|
||||
#define C352CLOCK (25992000) /* measured at 25.992MHz from 2061 pin 9 */
|
||||
#define C352DIV (296)
|
||||
#define VSYNC1 (59.8824)
|
||||
#define VSYNC2 (59.915)
|
||||
#define HSYNC (16666150)
|
||||
@ -3320,7 +3321,7 @@ static MACHINE_CONFIG_START( gorgon, namcos23_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_C352_ADD("c352", C352CLOCK, C352_DIVIDER_332)
|
||||
MCFG_C352_ADD("c352", C352CLOCK, C352DIV)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
@ -3389,7 +3390,7 @@ static MACHINE_CONFIG_START( s23, namcos23_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_C352_ADD("c352", C352CLOCK, C352_DIVIDER_332)
|
||||
MCFG_C352_ADD("c352", C352CLOCK, C352DIV)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
@ -3469,7 +3470,7 @@ static MACHINE_CONFIG_START( ss23, namcos23_state )
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_C352_ADD("c352", C352CLOCK, C352_DIVIDER_332)
|
||||
MCFG_C352_ADD("c352", C352CLOCK, C352DIV)
|
||||
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
|
||||
MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
|
||||
|
Loading…
Reference in New Issue
Block a user