1 // license:CC0
2 // copyright-holders:Aaron Giles
3 
4 //
5 // Netlist for Sega Speech board
6 //
7 // Derived from the schematics in the Sega G-80 manual.
8 //
9 // Known problems/issues:
10 //
11 //    * Mostly works. Not 100% sure about using a current source
12 //       for input.
13 //
14 
15 #include "netlist/devices/net_lib.h"
16 #include "nl_segaspeech.h"
17 
18 //
19 // Optimizations
20 //
21 
22 
23 
24 
25 //
26 // Main netlist
27 //
28 
29 NETLIST_START(segaspeech)
30 
31 	SOLVER(Solver, 1000)
32 	PARAM(Solver.DYNAMIC_TS, 1)
33 	PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 2e-5)
34 
35 	TTL_INPUT(I_SP0250, 0)
36 	PARAM(I_SP0250.MODEL, "74XXOC")
37 	NET_C(I_SP0250.GND, GND)
38 	NET_C(I_SP0250.VCC, I_V5)
39 	ALIAS(I_SPEECH, I_SP0250.Q)
40 
41 	ANALOG_INPUT(I_V5, 5)
42 	ANALOG_INPUT(I_VM5, -5)
43 
44 	//
45 	// There are two schematic drawings of the speech board
46 	// that show fairly different outputs from the SP0250.
47 	// Both have their problems.
48 	//
49 	// The simpler one is included in the Astro Blaster and
50 	// Space Fury manuals. This is largely correct, except
51 	// that it is believed (not verified) that R20 should be
52 	// 4.7K instead of 470 Ohms. This schematic does not show
53 	// the CD4053 mixer.
54 	//
55 	// The more complex schematic is included in the G-80
56 	// schematics package, and in the Star Trek and Zektor
57 	// manuals. It has several significant errors (all verified
58 	// from a working PCB):
59 	//
60 	//    1. U8 pins 2 and 3 are swapped
61 	//    2. The connection from R20 to GND should be removed
62 	//        (this also disconnected C50 and R21 from GND)
63 	//    3. R13 should be 220k, not 22k
64 	//
65 	// With the fixes above, the output sections of the two
66 	// schematics line up, minus the mixing section, which is
67 	// only shown on the more complex schematic.
68 	//
69 	// The mixing section is trivial, with 3 bits from a control
70 	// port controlling three switches in the CD4053. Bit 3
71 	// enables/disables speech. Bit 4 enables/disables an
72 	// unconnected source. And bit 5 enables/disables incoming
73 	// external sound. The incoming sound is also routed through
74 	// a pot to enable control over the relative volume.
75 	//
76 	// For purposes of this netlist, and since it runs at high
77 	// speeds, we tap the speech output before it hits the
78 	// CD4053 and manually manage the speech output.
79 	//
80 	// Since we use MAME to manage the mixing, the control bits
81 	// are managed directly there, rather than in this netlist.
82 	//
83 
84 	//
85 	// This represents the schematic drawing from Astro Blaster
86 	// and Space Fury; there is no control register and it
87 	// works.
88 	//
89 	RES(R17, RES_K(10))
90 	RES(R18, RES_K(22))
91 	RES(R19, RES_K(250))
92 	RES(R20, RES_K(4.7))    // schematic shows 470Ohm, but a real PCB had 4.7k here
93 	RES(R21, RES_K(10))
94 
95 	CAP(C9, CAP_U(0.1))
96 	CAP(C10, CAP_U(0.047))
97 	CAP(C50, CAP_U(0.003))
98 
99 	TL081_DIP(U8)           // Op. Amp.
100 	NET_C(U8.7, I_V5)
101 	NET_C(U8.4, I_VM5)
102 
103 	NET_C(I_SPEECH, R17.1, C9.1)
104 	NET_C(R17.2, I_V5)
105 	NET_C(C9.2, R18.1)
106 	NET_C(R18.2, C10.1, R19.2, U8.3)
107 	NET_C(R19.1, C10.2, GND)
108 	NET_C(R20.1, GND)
109 	NET_C(R20.2, U8.2, R21.2, C50.2)
110 	NET_C(U8.6, R21.1, C50.1)
111 	ALIAS(OUTPUT, U8.6)
112 
113 	//
114 	// In the more complex case, this would feed into a
115 	// CD4053 for switching. We rely on this being managed
116 	// at the driver level.
117 	//
118 
119 NETLIST_END()
120