Previous 15994 Revisions Next

r6401 Monday 16th November, 2009 at 08:38:17 UTC by Jonathan Gevaryahu
Add NCR7496 variant to sn76496.c
Switched Tandy machines to use NCR7496 variant.
Switched the SMS and Game gear PSGs to use an XOR instead of XNOR feedback, but this needs further verification. Updated comments to show which chips are verified.
[src/emu/sound]sn76496.c sn76496.h
[src/mess/drivers]pc.c

src/emu/sound/sn76496.c
r6400r6401
1111  channel sound generator, with three squarewave channels and a noise/arbitrary
1212  duty cycle channel.
1313
14  Noise emulation for all chips should be accurate:
15  SN76489 uses a 15-bit shift register with taps on bits D and E, output on E,
14  Noise emulation for all verified chips should be accurate:
15
16  ** SN76489 uses a 15-bit shift register with taps on bits D and E, output on E,
1617  XOR function; SN94624 is identical to SN76489.
17  * It uses a 15-bit ring buffer for periodic noise/arbitrary duty cycle.
18  SN76489A uses a 16-bit shift register with taps on bits D and E, output on F,
18  It uses a 15-bit ring buffer for periodic noise/arbitrary duty cycle.
19  ** SN76489A uses a 16-bit shift register with taps on bits D and E, output on F,
1920  XNOR function
20  * It uses a 16-bit ring buffer for periodic noise/arbitrary duty cycle.
21  SN76494 and SN76496 are PROBABLY identical in operation to the SN76489A
22  * They have an audio input line which is mixed with the 4 channels of output.
23  Sega Master System III/MD/Genesis PSG uses a 16-bit shift register with taps
21  It uses a 16-bit ring buffer for periodic noise/arbitrary duty cycle.
22  ** SN76494 and SN76496 are PROBABLY identical in operation to the SN76489A
23  They have an audio input line which is mixed with the 4 channels of output.
24  ** Sega Master System III/MD/Genesis PSG uses a 16-bit shift register with taps
2425  on bits C and F, output on F
25  * It uses a 16-bit ring buffer for periodic noise/arbitrary duty cycle.
26  Sega Game Gear PSG is identical to the SMS3/MD/Genesis one except it has an
26  It uses a 16-bit ring buffer for periodic noise/arbitrary duty cycle.
27  (whether it uses an XOR or XNOR needs to be verified)
28  ** Sega Game Gear PSG is identical to the SMS3/MD/Genesis one except it has an
2729  extra register for mapping which channels go to which speaker.
28
30  The register, connected to a z80 port, means:
31  for bits 7  6  5  4  3  2  1  0
32           L3 L2 L1 L0 R3 R2 R1 R0
33  ** NCR7496 (as used on the Tandy 1000) is similar to the SN76489 but with a
34  different noise LFSR patttern: taps on bits A and E, output on E
35  It uses a 15-bit ring buffer for periodic noise/arbitrary duty cycle.
36  (all this chip's info needs to be verified)
37 
2938  28/03/2005 : Sebastien Chevalier
3039  Update th SN76496Write func, according to SN76489 doc found on SMSPower.
3140   - On write with 0x80 set to 0, when LastRegister is other then TONE,
r6400r6401
5261  16/11/2009 : Lord Nightmare
5362  Fix screeching in regulus: When summing together four equal channels, the
5463  size of the max amplitude per channel should be 1/4 of the max range, not
55  1/3.
64  1/3. Added NCR7496. Changed sega psg/gamegear from XNOR to XOR.
5665
5766  TODO: * Implement a function for setting stereo regs for the game gear.
5867          Requires making the core support both mono and stereo, and have
r6400r6401
6372          max of 4Mhz and 32 clocks per sample on the SN76489A.
6473        * Implement the T6W28; has registers in a weird order, needs writes
6574          to be 'sanitized' first. Also is stereo, similar to game gear.
66        * Implement the NCR 7496; Is probably 100% compatible with SN76496,
67          but the whitenoise taps could be different. Needs someone with a
68          Tandy 1200 or whatever it was which uses this to run some tests.
75        * Test the NCR7496; Smspower says the whitenoise taps are A and E,
76          but this needs verification on real hardware.
77        * Test the SMS PSG/Gamegear PSG to see whether it uses XOR or XNOR
78          taps.
6979        * Factor out common code so that the SAA1099 can share some code.
7080***************************************************************************/
7181
r6400r6401
109119         sound_get_type(device) == SOUND_SN76489A ||
110120         sound_get_type(device) == SOUND_SN76494 ||
111121         sound_get_type(device) == SOUND_SN94624 ||
122         sound_get_type(device) == SOUND_NCR7496 ||
112123         sound_get_type(device) == SOUND_GAMEGEAR ||
113124         sound_get_type(device) == SOUND_SMSIII);
114125   return (sn76496_state *)device->token;
r6400r6401
359370
360371static DEVICE_START( sn76489 )
361372{
362   generic_start(device, 0x4000, 0x03, FALSE);
373   generic_start(device, 0x4000, 0x03, FALSE); // todo: verify; assumed to be the same as sn94624
363374}
364375
365376static DEVICE_START( sn76489a )
366377{
367   generic_start(device, 0x8000, 0x06, TRUE);
378   generic_start(device, 0x8000, 0x06, TRUE); // verified by plgdavid
368379}
369380
370381static DEVICE_START( sn76494 )
371382{
372   generic_start(device, 0x8000, 0x06, TRUE);
383   generic_start(device, 0x8000, 0x06, TRUE); // todo: verify; assumed to be the same as sn76489a
373384}
374385
375386static DEVICE_START( sn76496 )
376387{
377   generic_start(device, 0x8000, 0x06, TRUE);
388   generic_start(device, 0x8000, 0x06, TRUE); // todo: verify; assumed to be the same as sn76489a
378389}
379390
380391static DEVICE_START( sn94624 )
381392{
382   generic_start(device, 0x4000, 0x03, FALSE);
393   generic_start(device, 0x4000, 0x03, FALSE); // verified by plgdavid
383394}
384395
396static DEVICE_START( ncr7496 )
397{
398   generic_start(device, 0x4000, 0x11, FALSE); // todo: verify; from smspower wiki
399}
400
385401static DEVICE_START( gamegear )
386402{
387   generic_start(device, 0x8000, 0x09, TRUE);
403   generic_start(device, 0x8000, 0x09, FALSE); // todo: verify; from smspower wiki
388404}
389405
390406static DEVICE_START( smsiii )
391407{
392   generic_start(device, 0x8000, 0x09, TRUE);
408   generic_start(device, 0x8000, 0x09, FALSE); // todo: verify; from smspower wiki
393409}
394410
395411
r6400r6401
428444   }
429445}
430446
431DEVICE_GET_INFO( sn94624 )
447DEVICE_GET_INFO( sn76489a )
432448{
433449   switch (state)
434450   {
435      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( sn94624 );      break;
436      case DEVINFO_STR_NAME:                     strcpy(info->s, "SN94624");                  break;
451      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( sn76489a );      break;
452      case DEVINFO_STR_NAME:                     strcpy(info->s, "SN76489A");               break;
437453      default:                               DEVICE_GET_INFO_CALL(sn76496);                  break;
438454   }
439455}
440456
441DEVICE_GET_INFO( sn76489a )
457DEVICE_GET_INFO( sn76494 )
442458{
443459   switch (state)
444460   {
445      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( sn76489a );      break;
446      case DEVINFO_STR_NAME:                     strcpy(info->s, "SN76489A");               break;
461      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( sn76494 );      break;
462      case DEVINFO_STR_NAME:                     strcpy(info->s, "SN76494");                  break;
447463      default:                               DEVICE_GET_INFO_CALL(sn76496);                  break;
448464   }
449465}
450466
451DEVICE_GET_INFO( sn76494 )
467DEVICE_GET_INFO( sn94624 )
452468{
453469   switch (state)
454470   {
455      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( sn76494 );      break;
456      case DEVINFO_STR_NAME:                     strcpy(info->s, "SN76494");                  break;
471      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( sn94624 );      break;
472      case DEVINFO_STR_NAME:                     strcpy(info->s, "SN94624");                  break;
457473      default:                               DEVICE_GET_INFO_CALL(sn76496);                  break;
458474   }
459475}
460476
477DEVICE_GET_INFO( ncr7496 )
478{
479   switch (state)
480   {
481      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( ncr7496 );      break;
482      case DEVINFO_STR_NAME:                     strcpy(info->s, "NCR7496");                  break;
483      default:                               DEVICE_GET_INFO_CALL(sn76496);                  break;
484   }
485}
486
461487DEVICE_GET_INFO( gamegear )
462488{
463489   switch (state)
src/emu/sound/sn76496.h
r6400r6401
1111DEVICE_GET_INFO( sn76489a );
1212DEVICE_GET_INFO( sn76494 );
1313DEVICE_GET_INFO( sn94624 );
14DEVICE_GET_INFO( ncr7496 );
1415DEVICE_GET_INFO( gamegear );
1516DEVICE_GET_INFO( smsiii );
1617
r6400r6401
1920#define SOUND_SN76489A DEVICE_GET_INFO_NAME( sn76489a )
2021#define SOUND_SN76494 DEVICE_GET_INFO_NAME( sn76494 )
2122#define SOUND_SN94624 DEVICE_GET_INFO_NAME( sn94624 )
23#define SOUND_NCR7496 DEVICE_GET_INFO_NAME( ncr7496 )
2224#define SOUND_GAMEGEAR DEVICE_GET_INFO_NAME( gamegear )
2325#define SOUND_SMSIII DEVICE_GET_INFO_NAME( smsiii )
2426
src/mess/drivers/pc.c
r6400r6401
21442144   MDRV_SPEAKER_STANDARD_MONO("mono")
21452145   MDRV_SOUND_ADD("speaker", SPEAKER, 0)
21462146   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
2147   MDRV_SOUND_ADD("sn76496", SN76496, 2386360)
2147   MDRV_SOUND_ADD("sn76496", NCR7496, 2386360)
21482148   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
21492149
21502150   MDRV_NVRAM_HANDLER( tandy1000 )
r6400r6401
21932193   MDRV_SPEAKER_STANDARD_MONO("mono")
21942194   MDRV_SOUND_ADD("speaker", SPEAKER, 0)
21952195   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
2196   MDRV_SOUND_ADD("sn76496", SN76496, 2386360)
2196   MDRV_SOUND_ADD("sn76496", NCR7496, 2386360)
21972197   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
21982198
21992199   MDRV_NVRAM_HANDLER( tandy1000 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team