diff --git a/.gitattributes b/.gitattributes index 205ea9fc2aa..8512e72fae9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1702,7 +1702,6 @@ src/emu/sound/tms5110r.c svneol=native#text/plain src/emu/sound/tms5220.c svneol=native#text/plain src/emu/sound/tms5220.h svneol=native#text/plain src/emu/sound/tms5220.txt svneol=native#text/plain -src/emu/sound/tms5220r.c svneol=native#text/plain src/emu/sound/upd7759.c svneol=native#text/plain src/emu/sound/upd7759.h svneol=native#text/plain src/emu/sound/vlm5030.c svneol=native#text/plain diff --git a/src/emu/sound/sound.mak b/src/emu/sound/sound.mak index 4c7919eb9bb..9eec4f491c8 100644 --- a/src/emu/sound/sound.mak +++ b/src/emu/sound/sound.mak @@ -629,19 +629,25 @@ endif #------------------------------------------------- -# Texas Instruments TMS5110 speech synthesizers +# Texas Instruments TMS5100-series speech synthesizers #------------------------------------------------- ifneq ($(filter TMS5110,$(SOUNDS)),) SOUNDOBJS += $(SOUNDOBJ)/tms5110.o endif +$(SOUNDOBJ)/tms5110.o: $(SOUNDSRC)/tms5110r.c + + + +#------------------------------------------------- +# Texas Instruments TMS5200-series speech synthesizers +#------------------------------------------------- ifneq ($(filter TMS5220,$(SOUNDS)),) SOUNDOBJS += $(SOUNDOBJ)/tms5220.o endif -$(SOUNDOBJ)/tms5110.o: $(SOUNDSRC)/tms5110r.c -$(SOUNDOBJ)/tms5220.o: $(SOUNDSRC)/tms5220r.c +$(SOUNDOBJ)/tms5220.o: $(SOUNDSRC)/tms5110r.c @@ -673,6 +679,8 @@ ifneq ($(filter VLM5030,$(SOUNDS)),) SOUNDOBJS += $(SOUNDOBJ)/vlm5030.o endif +$(SOUNDOBJ)/vlm5030.o: $(SOUNDSRC)/tms5110r.c + #------------------------------------------------- diff --git a/src/emu/sound/tms5110r.c b/src/emu/sound/tms5110r.c index 9e9f6d00f87..e74c02be714 100644 --- a/src/emu/sound/tms5110r.c +++ b/src/emu/sound/tms5110r.c @@ -325,7 +325,9 @@ static const struct tms5100_coeffs pat4335277_coeff = { 3, 3, 3, 2, 2, 1, 1, 0 } }; -/* The following TMS5200/TMC0285 coefficients were directly read from an actual TMS5200 chip by Lord Nightmare using the PROMOUT pin, and can be regarded as established fact. However, the chirp table and the interpolation coefficients still come from the patents as there doesn't seem to be an easy way to read those out from the chip without decapping it. +/* The following TMS5200/TMC0285 coefficients were directly read from an actual TMS5200 chip by Lord Nightmare using the PROMOUT pin, and can be regarded as established fact. +The chirp table contents were read from a decap done by digshadow in March 2013 +The interpolation coefficients still come from the patents pending verification of the interpolation counter circuit from the chip decap image vs the patent. Note that the K coefficients are VERY different from the coefficients given in the US 4,335,277 patent, which may have been for some sort of prototype or otherwise intentionally scrambled. The energy and pitch tables, however, are identical to the patent. Also note, that the K coefficients are ALMOST identical to the coefficients from the CD2802, above. */ static const struct tms5100_coeffs tms5200_coeff = @@ -390,9 +392,9 @@ static const struct tms5100_coeffs tms5200_coeff = -19,-17, -9,-10, -6, 0, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },*/ - { 0,127,127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + { 0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50, + 0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13, + 0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -467,9 +469,9 @@ static const struct tms5100_coeffs tms5220_coeff = -19,-17, -9,-10, -6, 0, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },*/ - { 0,127,127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + { 0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50, + 0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13, + 0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -548,9 +550,9 @@ static const struct tms5100_coeffs tms5220c_coeff = -19,-17, -9,-10, -6, 0, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },*/ - { 0,127,127, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + { 0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50, + 0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13, + 0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -606,7 +608,7 @@ static const struct tms5100_coeffs vlm5030_coeff = /* K2 */ { 0, 50, 100, 149, 196, 241, 284, 325, 362, 396, 426, 452, 473, 490, 502, 510, - 0,-510,-502,-490,-473,-452,-426,-396, /* entry 16(0x10) has some special function, purpose unknown */ + 0,-510,-502,-490,-473,-452,-426,-396, /* entry 16(0x10) either has some special function, purpose unknown, or is a manufacturing error and should have been -512 */ -362,-325,-284,-241,-196,-149,-100, -50 }, /* K3 */ /*{ 0, 100, 196, 284, 362, 426, 473, 502, diff --git a/src/emu/sound/tms5220r.c b/src/emu/sound/tms5220r.c deleted file mode 100644 index ba56a3fe352..00000000000 --- a/src/emu/sound/tms5220r.c +++ /dev/null @@ -1,106 +0,0 @@ -/* TMS5220 ROM Tables */ - -/* This is the energy lookup table (4-bits -> 10-bits) */ - -static const unsigned short energytable[0x10]={ -0x0000,0x00C0,0x0140,0x01C0,0x0280,0x0380,0x0500,0x0740, -0x0A00,0x0E40,0x1440,0x1C80,0x2840,0x38C0,0x5040,0x7FC0}; - -/* This is the pitch lookup table (6-bits -> 8-bits) */ - -static const unsigned short pitchtable [0x40]={ -0x0000,0x1000,0x1100,0x1200,0x1300,0x1400,0x1500,0x1600, -0x1700,0x1800,0x1900,0x1A00,0x1B00,0x1C00,0x1D00,0x1E00, -0x1F00,0x2000,0x2100,0x2200,0x2300,0x2400,0x2500,0x2600, -0x2700,0x2800,0x2900,0x2A00,0x2B00,0x2D00,0x2F00,0x3100, -0x3300,0x3500,0x3600,0x3900,0x3B00,0x3D00,0x3F00,0x4200, -0x4500,0x4700,0x4900,0x4D00,0x4F00,0x5100,0x5500,0x5700, -0x5C00,0x5F00,0x6300,0x6600,0x6A00,0x6E00,0x7300,0x7700, -0x7B00,0x8000,0x8500,0x8A00,0x8F00,0x9500,0x9A00,0xA000}; - -/* These are the reflection coefficient lookup tables */ - -/* K1 is (5-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k1table [0x20]={ -(short)0x82C0,(short)0x8380,(short)0x83C0,(short)0x8440,(short)0x84C0,(short)0x8540,(short)0x8600,(short)0x8780, -(short)0x8880,(short)0x8980,(short)0x8AC0,(short)0x8C00,(short)0x8D40,(short)0x8F00,(short)0x90C0,(short)0x92C0, -(short)0x9900,(short)0xA140,(short)0xAB80,(short)0xB840,(short)0xC740,(short)0xD8C0,(short)0xEBC0,0x0000, -0x1440,0x2740,0x38C0,0x47C0,0x5480,0x5EC0,0x6700,0x6D40}; - -/* K2 is (5-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k2table [0x20]={ -(short)0xAE00,(short)0xB480,(short)0xBB80,(short)0xC340,(short)0xCB80,(short)0xD440,(short)0xDDC0,(short)0xE780, -(short)0xF180,(short)0xFBC0,0x0600,0x1040,0x1A40,0x2400,0x2D40,0x3600, -0x3E40,0x45C0,0x4CC0,0x5300,0x5880,0x5DC0,0x6240,0x6640, -0x69C0,0x6CC0,0x6F80,0x71C0,0x73C0,0x7580,0x7700,0x7E80}; - -/* K3 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k3table [0x10]={ -(short)0x9200,(short)0x9F00,(short)0xAD00,(short)0xBA00,(short)0xC800,(short)0xD500,(short)0xE300,(short)0xF000, -(short)0xFE00,0x0B00,0x1900,0x2600,0x3400,0x4100,0x4F00,0x5C00}; - -/* K4 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k4table [0x10]={ -(short)0xAE00,(short)0xBC00,(short)0xCA00,(short)0xD800,(short)0xE600,(short)0xF400,0x0100,0x0F00, -0x1D00,0x2B00,0x3900,0x4700,0x5500,0x6300,0x7100,0x7E00}; - -/* K5 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k5table [0x10]={ -(short)0xAE00,(short)0xBA00,(short)0xC500,(short)0xD100,(short)0xDD00,(short)0xE800,(short)0xF400,(short)0xFF00, -0x0B00,0x1700,0x2200,0x2E00,0x3900,0x4500,0x5100,0x5C00}; - -/* K6 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k6table [0x10]={ -(short)0xC000,(short)0xCB00,(short)0xD600,(short)0xE100,(short)0xEC00,(short)0xF700,0x0300,0x0E00, -0x1900,0x2400,0x2F00,0x3A00,0x4500,0x5000,0x5B00,0x6600}; - -/* K7 is (4-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k7table [0x10]={ -(short)0xB300,(short)0xBF00,(short)0xCB00,(short)0xD700,(short)0xE300,(short)0xEF00,(short)0xFB00,0x0700, -0x1300,0x1F00,0x2B00,0x3700,0x4300,0x4F00,0x5A00,0x6600}; - -/* K8 is (3-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k8table [0x08]={ -(short)0xC000,(short)0xD800,(short)0xF000,0x0700,0x1F00,0x3700,0x4F00,0x6600}; - -/* K9 is (3-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k9table [0x08]={ -(short)0xC000,(short)0xD400,(short)0xE800,(short)0xFC00,0x1000,0x2500,0x3900,0x4D00}; - -/* K10 is (3-bits -> 9 bits+sign, 2's comp. fractional (-1 < x < 1) */ - -static const short k10table [0x08]={ -(short)0xCD00,(short)0xDF00,(short)0xF100,0x0400,0x1600,0x2000,0x3B00,0x4D00}; - -/* chirp table */ - -static const char chirptable[51]={ -0x00, 0x2a, (char)0xd4, 0x32, -(char)0xb2, 0x12, 0x25, 0x14, -0x02, (char)0xe1, (char)0xc5, 0x02, -0x5f, 0x5a, 0x05, 0x0f, -0x26, (char)0xfc, (char)0xa5, (char)0xa5, -(char)0xd6, (char)0xdd, (char)0xdc, (char)0xfc, -0x25, 0x2b, 0x22, 0x21, -0x0f, (char)0xff, (char)0xf8, (char)0xee, -(char)0xed, (char)0xef, (char)0xf7, (char)0xf6, -(char)0xfa, 0x00, 0x03, 0x02, -0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00 -}; - -/* interpolation coefficients (in rightshifts, as in actual chip) */ - -static const char interp_coeff[8] = { -3, 3, 3, 2, 2, 1, 1, 0 -};