Previous 15994 Revisions Next

r7182 Wednesday 27th January, 2010 at 06:13:20 UTC by Jonathan Gevaryahu
s14001a: updated comments; got rid of the squealing noise (hidden behind a #define now, code is still there) until some other issues can be resolved.
[src/emu/sound]s14001a.c

src/emu/sound/s14001a.c
r7181r7182
11/*
22
3 TSI S14001A emulator v1.31c
3 TSI S14001A emulator v1.32
44 By Jonathan Gevaryahu ("Lord Nightmare") with help from Kevin Horton ("kevtris")
55 MAME conversion and integration by R. Belmont
66 Clock Frequency control updated by Zsolt Vasvari
r7181r7182
2323 1.31a Add chip pinout and other notes - LN (0.128u4)
2424 1.31b slight update to notes to clarify input bus stuff, mostly finish the state map in the comments - LN
2525 1.31c remove usage of deprecat.h - AtariAce (0.128u5)
26 1.32 fix the squealing noise using a define; it isn't accurate to the chip exactly, but there are other issues which need to be fixed too. see TODO. - LN (0.136u2)
2627
2728 TODO:
2829 * increase accuracy of internal S14001A 'filter' for both driven and undriven cycles (its not terribly inaccurate for undriven cycles, but the dc sliding of driven cycles is not emulated)
2930 * add option for and attach Frank P.'s emulation of the Analog external filter from the vsu-1000 using the discrete core. (with the direction of independent sound core and analog stuff, this should actually be attached in the main berzerk/frenzy driver and not here)
31 * fix the local and global silence stuff to not force the dac to a specific level, but cease doing deltas (i.e. force all deltas to 0) after the last sample; this should fix the clipping in p
3032*/
3133
3234/* Chip Pinout:
r7181r7182
229231 *   if mirrored mode is OFF, increment oddphone. if not, don't touch it here. if oddphone was 1 before the increment, increment phoneaddress and set oddphone to 0
230232 *
231233 */
234 
235#undef ACCURATE_SQUEAL
232236
233237#include "emu.h"
234238#include "streams.h"
r7181r7182
291295   {  1,  1,  3,  3  },
292296};
293297
298#ifdef ACCURATE_SQUEAL
294299static INT16 audiofilter(S14001AChip *chip) /* rewrite me to better match the real filter! */
295300{
296301   UINT8 temp1;
r7181r7182
309314      chip->filtervals[temp1] = chip->filtervals[(temp1 - 1)];
310315   }
311316   chip->filtervals[0] = inputvalue;
312
313317}
318#endif
314319
315320static void PostPhoneme(S14001AChip *chip) /* figure out what the heck to do after playing a phoneme */
316321{
r7181r7182
411416   chip->oddeven = !(chip->oddeven); // invert the clock
412417   if (chip->oddeven == 0) // even clock
413418   {
419#ifdef ACCURATE_SQUEAL
414420      chip->audioout = ALTFLAG; // flag to the renderer that this output should be the average of the last 8
415      // DIGITAL INPUT on the test pins occurs on this cycle used for output
421#endif
422      // DIGITAL INPUT *MIGHT* occur on the test pins occurs on this cycle?
416423   }
417424   else // odd clock
418425   {
419426      // fix dac output between samples. theoretically this might be unnecessary but it would require some messy logic in state 5 on the first sample load.
427      // Note: this behavior is NOT accurate, and needs to be fixed. see TODO.
420428      if (chip->GlobalSilenceState || LOCALSILENCESTATE)
421429      {
422430         chip->DACOutput = SILENCE;
423431         chip->OldDelta = 2;
424432      }
425433      chip->audioout = (chip->GlobalSilenceState || LOCALSILENCESTATE) ? SILENCE : chip->DACOutput; // when either silence state is 1, output silence.
426      // DIGITAL OUTPUT is driven onto the test pins on this cycle
434      // DIGITAL OUTPUT *might* be driven onto the test pins on this cycle?
427435      switch(chip->machineState) // HUUUUUGE switch statement
428436      {
429437      case 0: // idle state
r7181r7182
554562   for (i = 0; i < samples; i++)
555563   {
556564      s14001a_clock(chip);
565#ifdef ACCURATE_SQUEAL
557566      if (chip->audioout == ALTFLAG) // input from test pins -> output
558567      {
559568         shiftIntoFilter(chip, audiofilter(chip)); // shift over the previous outputs and stick in audioout.
r7181r7182
562571      else // normal, dac-driven output
563572      {
564573         shiftIntoFilter(chip, ((((INT16)chip->audioout)-8)<<9)); // shift over the previous outputs and stick in audioout 4 times. note <<9 instead of <<10, to prevent clipping, and to simulate that the filtered output normally has a somewhat lower amplitude than the driven one.
574#endif
565575         outputs[0][i] = ((((INT16)chip->audioout)-8)<<10)*chip->VSU1000_amp;
576#ifdef ACCURATE_SQUEAL
566577      }
578#endif
567579   }
568580}
569581
r7181r7182
638650      /* --- the following bits of info are returned as NULL-terminated strings --- */
639651      case DEVINFO_STR_NAME:                  strcpy(info->s, "S14001A");                  break;
640652      case DEVINFO_STR_FAMILY:            strcpy(info->s, "TSI S14001A");               break;
641      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.31");                  break;
653      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.32");                  break;
642654      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                  break;
643655      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Jonathan Gevaryahu"); break;
644656   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team