1 // license:CC0
2 // copyright-holders:Aaron Giles
3 
4 //
5 // Netlist for Boxing Bugs
6 //
7 // Derived from the schematics in the Boxing Bugs manual.
8 //
9 // Known problems/issues:
10 //
11 //    * WIP.
12 //
13 
14 #include "netlist/devices/net_lib.h"
15 #include "nl_cinemat_common.h"
16 
17 //
18 // Hacks/workarounds
19 //
20 
21 #define HACK_SIMPLIFY_INPUTS (1)
22 #define HACK_VOLTAGE_SWITCH (1)
23 
24 
25 
26 //
27 // Optimizations
28 //
29 
30 #define HLE_SFX_CLOCK (1)
31 #define HLE_MUSIC_CLOCK (1)
32 #define HLE_CHIRPING_VCO (1)
33 #define HLE_DYING_BUG_VCO (1)
34 #define HLE_CRACKING_VCO (1)
35 #define HLE_BEETLE_VCO (1)
36 #define HLE_BOUNCE_VCO (1)
37 #define HLE_CANNON_VCO (1)
38 #define ENABLE_FRONTIERS (1)
39 
40 
41 
42 //
43 // Main netlist
44 //
45 
46 NETLIST_START(boxingb)
47 
48 	SOLVER(Solver, 1000)
49 	PARAM(Solver.DYNAMIC_TS, 1)
50 	PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 2e-5)
51 
52 	TTL_INPUT(I_OUT_0, 0)               // active high
53 	TTL_INPUT(I_OUT_1, 0)               // active high
54 	TTL_INPUT(I_OUT_2, 0)               // active high
55 	TTL_INPUT(I_OUT_3, 0)               // active high
56 	TTL_INPUT(I_OUT_4, 0)               // active high
57 	TTL_INPUT(I_OUT_7, 0)               // active high
58 
59 	NET_C(GND, I_OUT_0.GND, I_OUT_1.GND, I_OUT_2.GND, I_OUT_3.GND, I_OUT_4.GND, I_OUT_7.GND)
60 	NET_C(I_V5, I_OUT_0.VCC, I_OUT_1.VCC, I_OUT_2.VCC, I_OUT_3.VCC, I_OUT_4.VCC, I_OUT_7.VCC)
61 
62 	CINEMAT_LOCAL_MODELS
63 
64 	ANALOG_INPUT(I_V2_2, 2.2)
65 	ANALOG_INPUT(I_V5, 5)
66 	ANALOG_INPUT(I_V15, 15)
67 	ANALOG_INPUT(I_VM15, -15)
68 
69 //  RES(R4, 620)             -- part of voltage converter (not emulated)
70 //  RES(R5, 620)             -- part of voltage converter (not emulated)
71 //  RES(R6, 430)             -- part of 2.2V voltage converter (not emulated)
72 //  RES(R7, 560)             -- part of 2.2V voltage converter (not emulated)
73 //  RES(R8, RES_K(3.3))      -- part of 2.2V voltage converter (not emulated)
74 	RES(R9, RES_K(1))
75 	RES(R10, RES_K(4.7))
76 	RES(R11, RES_K(1))
77 	RES(R12, RES_K(39))
78 	RES(R13, RES_K(12))
79 	RES(R14, RES_K(1))
80 	RES(R15, RES_K(4.7))
81 	RES(R16, RES_K(75))
82 	RES(R17, RES_K(75))
83 	RES(R18, 200)
84 	RES(R19, 200)
85 	RES(R20, RES_K(200))
86 	RES(R21, RES_K(4.7))
87 	RES(R22, RES_K(4.7))
88 	RES(R23, RES_K(2.7))
89 	RES(R24, RES_K(4.7))
90 	RES(R25, RES_K(39))
91 	RES(R26, RES_K(12))
92 	RES(R27, RES_K(2.4))
93 	RES(R28, RES_K(51))
94 	RES(R29, RES_K(270))
95 	RES(R30, RES_M(1))
96 	RES(R31, RES_K(16))
97 	RES(R32, RES_K(10))
98 	RES(R33, RES_K(1))
99 	RES(R34, RES_K(4.7))
100 	RES(R35, RES_K(2.7))
101 	RES(R36, RES_K(4.7))
102 	RES(R37, RES_K(39))
103 	RES(R38, RES_K(12))
104 	RES(R39, RES_K(2.4))
105 	RES(R40, RES_K(51))
106 	RES(R41, RES_K(270))
107 	RES(R42, RES_M(1))
108 	RES(R43, RES_K(11))
109 	RES(R44, RES_K(10))
110 	RES(R45, RES_K(1))
111 	RES(R46, RES_K(2))
112 	RES(R47, RES_K(1))
113 	RES(R48, RES_K(12))
114 	RES(R49, RES_K(1))
115 	RES(R50, RES_K(20))
116 	RES(R51, RES_K(20))
117 	RES(R52, RES_K(20))
118 	RES(R53, RES_K(20))
119 	RES(R54, RES_K(2))
120 	RES(R55, RES_K(4.7))
121 	RES(R56, RES_K(2.7))
122 	RES(R57, RES_K(4.7))
123 	RES(R58, RES_K(39))
124 	RES(R59, RES_K(12))
125 	RES(R60, RES_K(2.4))
126 	RES(R61, RES_K(51))
127 	RES(R62, RES_K(270))
128 	RES(R63, RES_M(1))
129 	RES(R64, RES_K(6.2))
130 	RES(R65, RES_K(10))
131 	RES(R66, RES_K(1))
132 	RES(R67, RES_K(2))
133 	RES(R68, RES_K(22))
134 	RES(R69, RES_K(39))
135 	RES(R70, RES_K(47))
136 	RES(R71, RES_K(1))
137 	RES(R72, RES_K(10))
138 	RES(R73, RES_K(2))
139 	RES(R74, RES_K(910))
140 	RES(R75, 390)
141 #if (HACK_VOLTAGE_SWITCH)
142 	RES(R76, 100)
143 #else
144 	RES(R76, RES_K(4.7))
145 #endif
146 	RES(R77, RES_K(2.7))
147 	RES(R78, RES_K(4.7))
148 	RES(R79, RES_K(39))
149 	RES(R80, RES_K(12))
150 	RES(R81, RES_K(2.4))
151 	RES(R82, RES_K(51))
152 	RES(R83, RES_K(270))
153 	RES(R84, RES_M(1))
154 	RES(R85, RES_K(12))
155 	RES(R86, RES_K(10))
156 	RES(R87, RES_K(1))
157 	RES(R88, RES_K(2))
158 	RES(R89, RES_K(20))
159 	RES(R90, RES_K(2))
160 	RES(R91, RES_K(20))
161 #if (HACK_VOLTAGE_SWITCH)
162 	RES(R92, 100)
163 #else
164 	RES(R92, RES_K(4.7))
165 #endif
166 	RES(R93, RES_K(2.7))
167 	RES(R94, RES_K(4.7))
168 	RES(R95, RES_K(39))
169 	RES(R96, RES_K(12))
170 	RES(R97, RES_K(2.4))
171 	RES(R98, RES_K(51))
172 	RES(R99, RES_K(330))
173 	RES(R100, RES_K(1))
174 	RES(R101, RES_M(1))
175 	RES(R102, 47)
176 	RES(R103, RES_K(4.7))
177 	RES(R104, RES_K(1))
178 	RES(R105, RES_K(39))
179 	RES(R106, RES_K(12))
180 	RES(R107, RES_K(1))
181 	RES(R108, RES_K(6.8))
182 	RES(R109, RES_K(100))
183 	RES(R110, RES_K(270))
184 	RES(R111, 100)
185 	RES(R112, 100)
186 	RES(R113, RES_K(4.7))
187 	RES(R114, RES_K(1))
188 	RES(R115, RES_K(39))
189 	RES(R116, RES_K(12))
190 	RES(R117, RES_K(2.4))
191 	RES(R118, RES_K(51))
192 	RES(R119, RES_K(270))
193 	RES(R120, RES_M(1))
194 	RES(R121, RES_K(10))
195 	RES(R122, RES_K(10))
196 	RES(R123, RES_K(1))
197 	RES(R124, RES_K(2))
198 	RES(R125, RES_K(20))
199 	RES(R126, RES_K(2))
200 	RES(R127, RES_K(3.9))
201 	RES(R128, 10)
202 	RES(R129, RES_M(1))
203 	RES(R130, RES_K(6.8))
204 	RES(R131, RES_K(18))
205 	RES(R132, RES_K(47))
206 	RES(R133, 390)
207 	RES(R134, 390)
208 	RES(R135, RES_K(4.7))
209 	RES(R136, RES_K(2.7))
210 	RES(R137, RES_K(4.7))
211 	RES(R138, RES_K(39))
212 	RES(R139, RES_K(12))
213 	RES(R140, RES_K(1))
214 	RES(R141, RES_K(75))
215 	RES(R142, RES_K(4.7))
216 	RES(R143, RES_K(2.7))
217 	RES(R144, RES_K(4.7))
218 	RES(R145, RES_K(39))
219 	RES(R146, RES_K(12))
220 	RES(R147, RES_K(1))
221 	RES(R148, RES_K(240))
222 	RES(R149, RES_K(300))
223 	RES(R150, RES_K(300))
224 //  RES(R151, RES_K(15))    -- part of final amp (not emulated)
225 //  RES(R152, 150)          -- part of final amp (not emulated)
226 //  RES(R153, 150)          -- part of final amp (not emulated)
227 //  RES(R154, RES_K(22))    -- part of final amp (not emulated)
228 //  RES(R155, RES_K(390))   -- part of final amp (not emulated)
229 //  RES(R156, 0.51)         -- part of final amp (not emulated)
230 //  RES(R157, 0.51)         -- part of final amp (not emulated)
231 //  RES(R158, RES_K(390))   -- part of final amp (not emulated)
232 	RES(R159, RES_K(30))
233 	RES(R160, RES_K(8.2))
234 	RES(R161, RES_K(20))
235 //  RES(R162, RES_K(10))    -- part of shaft encoder (not emulated)
236 //  RES(R163, RES_K(100))   -- part of shaft encoder (not emulated)
237 //  RES(R164, RES_M(1.8))   -- part of shaft encoder (not emulated)
238 //  RES(R165, RES_K(10))    -- part of shaft encoder (not emulated)
239 //  RES(R166, RES_K(2.4))   -- part of shaft encoder (not emulated)
240 //  RES(R167, RES_K(1))     -- part of shaft encoder (not emulated)
241 //  RES(R168, RES_K(470))   -- part of shaft encoder (not emulated)
242 //  RES(R169, RES_K(10))    -- part of shaft encoder (not emulated)
243 //  RES(R170, RES_K(470))   -- part of shaft encoder (not emulated)
244 //  RES(R171, RES_K(100))   -- part of shaft encoder (not emulated)
245 //  RES(R172, RES_M(1.8))   -- part of shaft encoder (not emulated)
246 //  RES(R173, RES_K(10))    -- part of shaft encoder (not emulated)
247 //  RES(R174, RES_K(2.4))   -- part of shaft encoder (not emulated)
248 //  RES(R175, RES_K(1))     -- part of shaft encoder (not emulated)
249 //  RES(R176, RES_K(1))     -- part of shaft encoder (not emulated)
250 	RES(R177, RES_K(1))
251 	RES(R178, 330)
252 	RES(R179, 330)
253 	RES(R180, RES_K(1))
254 	RES(R181, RES_K(1))
255 	RES(R182, RES_K(1))
256 	RES(R183, RES_K(4.7))
257 	RES(R184, RES_K(510))
258 	RES(R185, 470)
259 	RES(R186, 470)
260 	RES(R187, RES_K(4.7))
261 	RES(R188, RES_K(2.7))
262 	RES(R189, RES_K(4.7))
263 	RES(R190, RES_K(39))
264 	RES(R191, RES_K(12))
265 	RES(R192, RES_K(1))
266 	RES(R193, RES_K(24))
267 	RES(R194, RES_K(100))
268 	RES(R195, RES_K(4.7))
269 	RES(R196, RES_K(2.7))
270 	RES(R197, RES_K(4.7))
271 	RES(R198, RES_K(39))
272 	RES(R199, RES_K(12))
273 	RES(R200, RES_K(1))
274 	RES(R201, RES_K(51))
275 	RES(R202, RES_K(36))
276 	RES(R203, RES_K(1))
277 	RES(R204, RES_K(1))
278 	RES(R205, RES_K(2))
279 	RES(R206, RES_K(1))
280 	RES(R207, RES_K(1))
281 	RES(R208, RES_K(1))
282 	RES(R209, RES_K(1))
283 
284 //  CAP(C1, CAP_U(0.1))     -- part of voltage converter (not emulated)
285 //  CAP(C2, CAP_U(0.1))     -- part of voltage converter (not emulated)
286 //  CAP(C3, CAP_U(22))      -- part of voltage converter (not emulated)
287 //  CAP(C4, CAP_U(22))      -- part of voltage converter (not emulated)
288 //  CAP(C5, CAP_U(22))      -- part of voltage converter (not emulated)
289 //  CAP(C6, CAP_U(22))      -- part of voltage converter (not emulated)
290 //  CAP(C7, CAP_U(22))      -- part of voltage converter (not emulated)
291 //  CAP(C8, CAP_U(0.1))     -- part of voltage converter (not emulated)
292 //  CAP(C9, CAP_U(0.1))     -- part of voltage converter (not emulated)
293 //  CAP(C10, CAP_U(0.1))    -- part of 2.2V voltage converter (not emulated)
294 	CAP(C11, CAP_U(0.1))
295 	CAP(C12, CAP_U(0.1))
296 	CAP(C13, CAP_U(1))
297 	CAP(C14, CAP_U(2.2))
298 	CAP(C15, CAP_U(0.001))
299 	CAP(C16, CAP_U(0.001))
300 	CAP(C17, CAP_U(0.1))
301 	CAP(C18, CAP_U(2.2))
302 	CAP(C19, CAP_U(0.001))
303 	CAP(C20, CAP_U(0.001))
304 	CAP(C21, CAP_U(0.1))
305 	CAP(C22, CAP_U(0.01))
306 	CAP(C23, CAP_U(0.1))
307 	CAP(C24, CAP_U(0.68))
308 	CAP(C25, CAP_U(0.001))
309 	CAP(C26, CAP_U(0.0022))
310 	CAP(C27, CAP_U(0.1))
311 	CAP(C28, CAP_U(0.1))
312 	CAP(C29, CAP_U(0.1))
313 	CAP(C30, CAP_U(0.01))
314 	CAP(C31, CAP_U(4.7))
315 	CAP(C32, CAP_U(0.001))
316 	CAP(C33, CAP_U(0.01))
317 	CAP(C34, CAP_U(0.1))
318 	CAP(C35, CAP_U(0.1))
319 	CAP(C36, CAP_U(2.2))
320 	CAP(C37, CAP_U(0.1))
321 	CAP(C38, CAP_U(0.01))
322 	CAP(C39, CAP_U(0.001))
323 	CAP(C40, CAP_U(0.47))
324 	CAP(C41, CAP_U(1))
325 	CAP(C42, CAP_U(0.1))
326 	CAP(C43, CAP_U(0.47))
327 	CAP(C44, CAP_U(0.001))
328 	CAP(C45, CAP_U(0.1))
329 	CAP(C46, CAP_U(0.1))
330 	CAP(C47, CAP_U(100))
331 	CAP(C48, CAP_U(0.1))
332 	CAP(C49, CAP_U(0.1))
333 	CAP(C50, CAP_U(0.01))
334 	CAP(C51, CAP_U(4.7))
335 	CAP(C52, CAP_U(0.47))
336 	CAP(C53, CAP_U(0.1))
337 	CAP(C54, CAP_U(0.1))
338 //  CAP(C55, CAP_U(0.68))
339 //  CAP(C56, CAP_U(0.005))  -- part of final amp (not emulated)
340 //  CAP(C57, CAP_P(470))    -- part of final amp (not emulated)
341 //  CAP(C58, CAP_P(470))    -- part of final amp (not emulated)
342 //  CAP(C59, CAP_P(470))    -- part of final amp (not emulated)
343 	CAP(C60, CAP_U(0.33))
344 	CAP(C61, CAP_P(330))
345 //  CAP(C62, CAP_U(0.1))    -- part of shaft encoder (not emulated)
346 //  CAP(C63, CAP_P(330))    -- part of shaft encoder (not emulated)
347 //  CAP(C64, CAP_P(330))    -- part of shaft encoder (not emulated)
348 //  CAP(C65, CAP_P(330))    -- part of shaft encoder (not emulated)
349 //  CAP(C66, CAP_P(330))    -- part of shaft encoder (not emulated)
350 	CAP(C67, CAP_U(0.001))
351 	CAP(C68, CAP_P(680))
352 	CAP(C69, CAP_U(0.001))
353 	CAP(C70, CAP_U(0.001))
354 	CAP(C71, CAP_U(0.68))
355 	CAP(C72, CAP_U(0.22))
356 	CAP(C73, CAP_U(0.1))
357 	CAP(C74, CAP_U(0.1))
358 	CAP(C75, CAP_U(0.01))
359 
360 //  Q_2N3904(Q1)            // NPN -- part of 2.2V voltage converter (not emulated)
361 	Q_2N3906(Q2)            // PNP
362 	Q_2N3906(Q3)            // PNP
363 	Q_2N3906(Q4)            // PNP
364 	Q_2N3904(Q5)            // NPN
365 #if !(HLE_CHIRPING_VCO)
366 	Q_2N3904(Q6)            // NPN
367 #endif
368 	Q_2N3906(Q7)            // PNP
369 	Q_2N3904(Q8)            // NPN
370 #if !(HLE_DYING_BUG_VCO)
371 	Q_2N3904(Q9)            // NPN
372 #endif
373 	Q_2N3906(Q10)           // PNP
374 	Q_2N3904(Q11)           // NPN
375 #if !(HLE_CRACKING_VCO)
376 	Q_2N3904(Q12)           // NPN
377 #endif
378 	Q_2N3906(Q13)           // PNP
379 	Q_2N3904(Q14)           // NPN
380 #if !(HLE_BEETLE_VCO)
381 	Q_2N3904(Q15)           // NPN
382 #endif
383 	Q_2N3906(Q16)           // PNP
384 	Q_2N3904(Q17)           // NPN
385 	Q_2N3906(Q18)           // PNP
386 	Q_2N3906(Q19)           // PNP
387 	Q_2N3906(Q20)           // PNP
388 	Q_2N3904(Q21)           // NPN
389 #if !(HLE_CANNON_VCO)
390 	Q_2N3904(Q22)           // NPN
391 #endif
392 	Q_2N3906(Q23)           // PNP
393 	Q_2N3906(Q24)           // PNP
394 	Q_2N3906(Q25)           // PNP
395 	Q_2N3906(Q26)           // PNP
396 //  Q_2N6292(Q27)           // PNP -- part of final amp (not emulated)
397 //  Q_2N6107(Q28)           // NPN -- part of final amp (not emulated)
398 //  Q_2N5210(Q29)           // NPN -- not used
399 //  Q_2N5210(Q30)           // NPN -- not used
400 	Q_2N3906(Q31)           // PNP
401 	Q_2N3906(Q32)           // PNP
402 	Q_2N3906(Q33)           // PNP
403 	Q_2N3906(Q34)           // PNP
404 
405 //  D_1N4003(D1)            -- part of voltage converter (not emulated)
406 //  D_1N4003(D2)            -- part of voltage converter (not emulated)
407 //  D_1N4003(D3)            -- part of voltage converter (not emulated)
408 //  D_1N4003(D4)            -- part of voltage converter (not emulated)
409 //  D_1N914(D5)             -- part of voltage converter (not emulated)
410 //  D_1N914(D6)             -- part of voltage converter (not emulated)
411 //  D_1N5236(D7)            -- part of voltage converter (not emulated)
412 //  D_1N5236(D8)            -- part of voltage converter (not emulated)
413 //  D_1N5236(D9)            -- part of voltage converter (not emulated)
414 //  D_1N5236(D10)           -- part of voltage converter (not emulated)
415 //  D_1N914(D11)            -- part of voltage converter (not emulated)
416 //  D_1N914(D12)            -- part of voltage converter (not emulated)
417 	D_1N914(D13)
418 	D_1N914(D14)
419 	D_1N914(D15)
420 	D_1N914(D16)
421 	D_1N914(D17)
422 	D_1N914(D18)
423 	D_1N914(D19)
424 	D_1N914(D20)
425 	D_1N914(D21)
426 	D_1N914(D22)
427 //  D_1N4003(D23)           -- part of final amp (not emulated)
428 //  D_1N4003(D24)           -- part of final amp (not emulated)
429 	D_1N914(D25)
430 	D_1N914(D26)
431 	D_1N914(D27)
432 	D_1N914(D28)
433 	D_1N914(D29)
434 	D_1N914(D30)
435 
436 #if (!HLE_MUSIC_CLOCK)
437 	CLOCK(Y1, 20000000)
438 	NET_C(Y1.GND, GND)
439 	NET_C(Y1.VCC, I_V5)
440 #endif
441 
442 	TTL_74LS393_DIP(U1)     // Dual 4-Stage Binary Counter
443 	NET_C(U1.7, GND)
444 	NET_C(U1.14, I_V5)
445 
446 	TTL_74S04_DIP(U2)       // Hex Inverting Gates
447 	NET_C(U2.7, GND)
448 	NET_C(U2.14, I_V5)
449 
450 //  TTL_74LS74_DIP(U7)      // Dual D Flip Flop -- part of shaft encoder (not emulated)
451 //  NET_C(U7.7, GND)
452 //  NET_C(U7.14, I_V5)
453 
454 //  TTL_74LS74_DIP(U8)      // Dual D Flip Flop -- part of shaft encoder (not emulated)
455 //  NET_C(U8.7, GND)
456 //  NET_C(U8.14, I_V5)
457 
458 	TTL_74LS107_DIP(U9)     // DUAL J-K FLIP-FLOPS WITH CLEAR
459 	NET_C(U9.7, GND)
460 	NET_C(U9.14, I_V5)
461 
462 //  TTL_74LS74_DIP(U10)     // Dual D Flip Flop -- part of shaft encoder (not emulated)
463 //  NET_C(U10.7, GND)
464 //  NET_C(U10.14, I_V5)
465 
466 	TTL_74LS164_DIP(U11)    // 8-bit Shift Reg.
467 	NET_C(U11.7, GND)
468 	NET_C(U11.14, I_V5)
469 
470 	TTL_74LS86_DIP(U12)     // Quad 2-Input XOR Gates
471 	NET_C(U12.7, GND)
472 	NET_C(U12.14, I_V5)
473 
474 	TTL_74LS393_DIP(U13)    // Dual 4-Stage Binary Counter
475 	NET_C(U13.7, GND)
476 	NET_C(U13.14, I_V5)
477 
478 	TTL_74LS393_DIP(U15)    // Dual 4-Stage Binary Counter
479 	NET_C(U15.7, GND)
480 	NET_C(U15.14, I_V5)
481 
482 //  TTL_74LS191_DIP(U16)    // Presettable 4-bit Binary Up/Down Counter -- part of shaft encoder (not emulated)
483 //  NET_C(U16.8, GND)
484 //  NET_C(U16.16, I_V5)
485 
486 //  TTL_74LS191_DIP(U17)    // Presettable 4-bit Binary Up/Down Counter -- part of shaft encoder (not emulated)
487 //  NET_C(U17.8, GND)
488 //  NET_C(U17.16, I_V5)
489 
490 //  TTL_74LS157_DIP(U18)    // Quad 2-Input Multiplexor -- part of shaft encoder (not emulated)
491 //  NET_C(U18.8, GND)
492 //  NET_C(U18.16, I_V5)
493 
494 	LM555_DIP(U19)
495 
496 	TTL_7414_DIP(U20)       // Hex Inverter
497 	NET_C(U20.7, GND)
498 	NET_C(U20.14, I_V5)
499 
500 	TTL_74LS393_DIP(U21)    // Dual 4-Stage Binary Counter
501 	NET_C(U21.7, GND)
502 	NET_C(U21.14, I_V5)
503 
504 	TTL_74LS393_DIP(U22)    // Dual 4-Stage Binary Counter
505 	NET_C(U22.7, GND)
506 	NET_C(U22.14, I_V5)
507 
508 	TTL_74S113_DIP(U23)     // Dual JK Negative Edge-Trigged Flip Flop
509 	NET_C(U23.7, GND)
510 	NET_C(U23.14, I_V5)
511 
512 	TTL_74LS74_DIP(U24)     // Dual D Flip Flop
513 	NET_C(U24.7, GND)
514 	NET_C(U24.14, I_V5)
515 
516 	TTL_74LS74_DIP(U25)     // Dual D Flip Flop
517 	NET_C(U25.7, GND)
518 	NET_C(U25.14, I_V5)
519 
520 	TTL_74LS393_DIP(U26)    // Dual 4-Stage Binary Counter
521 	NET_C(U26.7, GND)
522 	NET_C(U26.14, I_V5)
523 
524 	TTL_74LS163_DIP(U27)    // Binary Counter
525 	NET_C(U27.8, GND)
526 	NET_C(U27.16, I_V5)
527 
528 	TTL_74LS163_DIP(U28)    // Binary Counter
529 	NET_C(U28.8, GND)
530 	NET_C(U28.16, I_V5)
531 
532 	TTL_74LS74_DIP(U29)     // Dual D Flip Flop
533 	NET_C(U29.7, GND)
534 	NET_C(U29.14, I_V5)
535 
536 	TTL_7414_DIP(U30)       // Hex Inverter
537 	NET_C(U30.7, GND)
538 	NET_C(U30.14, I_V5)
539 
540 	TTL_74LS04_DIP(U31)     // Hex Inverting Gates
541 	NET_C(U31.7, GND)
542 	NET_C(U31.14, I_V5)
543 
544 	TTL_74LS393_DIP(U32)    // Dual 4-Stage Binary Counter
545 	NET_C(U32.7, GND)
546 	NET_C(U32.14, I_V5)
547 
548 	TTL_74LS107_DIP(U33)    // DUAL J-K FLIP-FLOPS WITH CLEAR
549 	NET_C(U33.7, GND)
550 	NET_C(U33.14, I_V5)
551 
552 	TTL_74LS107_DIP(U34)    // DUAL J-K FLIP-FLOPS WITH CLEAR
553 	NET_C(U34.7, GND)
554 	NET_C(U34.14, I_V5)
555 
556 	TTL_74LS02_DIP(U35)     // Quad 2-input Nor Gate
557 	NET_C(U35.7, GND)
558 	NET_C(U35.14, I_V5)
559 
560 	TTL_74LS163_DIP(U36)    // Binary Counter
561 	NET_C(U36.8, GND)
562 	NET_C(U36.16, I_V5)
563 
564 	TTL_74LS163_DIP(U37)    // Binary Counter
565 	NET_C(U37.8, GND)
566 	NET_C(U37.16, I_V5)
567 
568 	TTL_74LS377_DIP(U38)    // Octal D Flip Flop
569 	NET_C(U38.10, GND)
570 	NET_C(U38.20, I_V5)
571 
572 	TTL_74LS164_DIP(U39)    // 8-bit Shift Reg.
573 	NET_C(U39.7, GND)
574 	NET_C(U39.14, I_V5)
575 
576 	TTL_7406_DIP(U40)       // Hex inverter -- currently using a clone of 7416, no open collector behavior
577 	NET_C(U40.7, GND)
578 	NET_C(U40.14, I_V5)
579 
580 	TTL_74LS393_DIP(U41)    // Dual 4-Stage Binary Counter
581 	NET_C(U41.7, GND)
582 	NET_C(U41.14, I_V5)
583 
584 	TTL_74LS393_DIP(U42)    // Dual 4-Stage Binary Counter
585 	NET_C(U42.7, GND)
586 	NET_C(U42.14, I_V5)
587 
588 	TTL_74LS163_DIP(U43)    // Binary Counter
589 	NET_C(U43.8, GND)
590 	NET_C(U43.16, I_V5)
591 
592 	TTL_74LS74_DIP(U44)     // Dual D Flip Flop
593 	NET_C(U44.7, GND)
594 	NET_C(U44.14, I_V5)
595 
596 	TTL_74LS74_DIP(U45)     // Dual D Flip Flop
597 	NET_C(U45.7, GND)
598 	NET_C(U45.14, I_V5)
599 
600 	TTL_74LS163_DIP(U46)    // Binary Counter
601 	NET_C(U46.8, GND)
602 	NET_C(U46.16, I_V5)
603 
604 	TTL_74LS377_DIP(U47)    // Octal D Flip Flop
605 	NET_C(U47.10, GND)
606 	NET_C(U47.20, I_V5)
607 
608 	TTL_74LS377_DIP(U48)    // Octal D Flip Flop
609 	NET_C(U48.10, GND)
610 	NET_C(U48.20, I_V5)
611 
612 	TTL_74LS164_DIP(U49)    // 8-bit Shift Reg.
613 	NET_C(U49.7, GND)
614 	NET_C(U49.14, I_V5)
615 
616 	TTL_7414_DIP(U50)       // Hex Inverter
617 	NET_C(U50.7, GND)
618 	NET_C(U50.14, I_V5)
619 
620 #if (!HLE_CHIRPING_VCO)
621 	LM566_DIP(U51)          // 566 VCO
622 #endif
623 
624 #if (!HLE_DYING_BUG_VCO)
625 	LM566_DIP(U52)          // 566 VCO
626 #endif
627 
628 #if (!HLE_CRACKING_VCO)
629 	LM566_DIP(U53)          // 566 VCO
630 #endif
631 
632 	TL081_DIP(U54)          // Op. Amp.
633 	NET_C(U54.7, I_V15)
634 	NET_C(U54.4, I_VM15)
635 
636 	TL081_DIP(U55)          // Op. Amp.
637 	NET_C(U55.7, I_V15)
638 	NET_C(U55.4, I_VM15)
639 
640 #if (!HLE_BEETLE_VCO)
641 	LM566_DIP(U56)          // 566 VCO
642 #endif
643 
644 #if (!HLE_BOUNCE_VCO)
645 	LM566_DIP(U57)          // 566 VCO
646 #endif
647 
648 	LM555_DIP(U58)
649 
650 	CA3080_DIP(U59)         // Op. Amp.
651 	NET_C(U59.4, I_VM15)
652 	NET_C(U59.7, I_V15)
653 
654 #if (!HLE_CANNON_VCO)
655 	LM566_DIP(U60)          // 566 VCO
656 #endif
657 
658 	CA3080_DIP(U61)         // Op. Amp.
659 	NET_C(U61.4, I_VM15)
660 	NET_C(U61.7, I_V15)
661 
662 	AMI_S2688(U62)          // Noise generator
663 
664 	TL081_DIP(U63)          // Op. Amp.
665 	NET_C(U63.7, I_V15)
666 	NET_C(U63.4, I_VM15)
667 
668 	CA3080_DIP(U64)         // Op. Amp.
669 	NET_C(U64.4, I_VM15)
670 	NET_C(U64.7, I_V15)
671 
672 //  TL081_DIP(U65)          // Op. Amp. -- part of shaft encoder (not emulated)
673 //  NET_C(U65.7, I_V15)
674 //  NET_C(U65.4, I_VM15)
675 
676 //  TL081_DIP(U66)          // Op. Amp. -- part of shaft encoder (not emulated)
677 //  NET_C(U66.7, I_V15)
678 //  NET_C(U66.4, I_VM15)
679 
680 	CA3080_DIP(U67)         // Op. Amp.
681 	NET_C(U67.4, I_VM15)
682 	NET_C(U67.7, I_V15)
683 
684 //  TTL_7815_DIP(U68)       // +15V Regulator -- part of voltage converter (not emulated)
685 //  TTL_7915_DIP(U69)       // -15V Regulator -- part of voltage converter (not emulated)
686 
687 //  TL081_DIP(U70)          // Op. Amp. --  part of final amp (not emulated)
688 //  NET_C(U70.7, I_V15)
689 //  NET_C(U70.4, I_VM15)
690 
691 	//
692 	// Page 1, top right
693 	//
694 
695 	ALIAS(HIB_P, U27.6)
696 	NET_C(HIB_P, U27.5, U27.4, U27.1, U27.7)
697 	NET_C(GND, U27.3)
698 	ALIAS(BLOAD_M, U27.9)
699 	ALIAS(BCLK_P, U27.2)
700 	NET_C(U27.2, U26.1)
701 	NET_C(U27.10, U28.15)
702 	NET_C(U27.15, U24.12)
703 	HINT(U27.11, NC)
704 	HINT(U27.12, NC)
705 	HINT(U27.13, NC)
706 	HINT(U27.14, NC)
707 
708 	NET_C(HIB_P, U28.6, U28.3, U28.1, U28.7, U28.10)
709 	NET_C(GND, U28.4, U28.5)
710 	NET_C(BLOAD_M, U28.9)
711 	ALIAS(ACLK_M, U28.2)
712 	HINT(U28.11, NC)
713 	HINT(U28.12, NC)
714 	HINT(U28.13, NC)
715 	HINT(U28.14, NC)
716 
717 	ALIAS(HIA_P, U24.10)
718 	ALIAS(BCLK_M, U24.11)
719 	NET_C(U24.13, R9.2)
720 	NET_C(R9.1, I_V5)
721 	NET_C(U24.9, U34.12)
722 	NET_C(BLOAD_M, U24.8)
723 
724 	NET_C(HIA_P, U34.1, U34.4, U34.13)
725 	NET_C(U34.3, R21.1, C11.1)
726 	ALIAS(_588USEC_P, U34.3)
727 	NET_C(R21.2, I_V5)
728 	HINT(U34.2, NC)
729 
730 	NET_C(U26.2, GND)
731 	NET_C(U26.6, U26.13)
732 	HINT(U26.5, NC)
733 	HINT(U26.4, NC)
734 	HINT(U26.3, NC)
735 	NET_C(U26.12, GND)
736 	ALIAS(_327USEC_P, U26.8)
737 	HINT(U26.9, NC)
738 	HINT(U26.10, NC)
739 	NET_C(U26.11, R15.1, C12.2)
740 	NET_C(R15.2, I_V5)
741 	NET_C(C12.1, R16.1)
742 	NET_C(R16.2, R17.1, R18.2, U61.2)
743 	NET_C(R17.2, C11.2)
744 	NET_C(R18.1, GND)
745 
746 	NET_C(U61.3, R19.2)
747 	NET_C(R19.1, GND)
748 
749 	ALIAS(BELL_EN_M, R10.1)
750 	NET_C(R10.1, R11.1)
751 	NET_C(R10.2, I_V5)
752 	NET_C(R11.2, Q2.B)
753 	NET_C(Q2.E, I_V2_2)
754 	NET_C(Q2.C, R12.2, R13.2, Q3.E)
755 	NET_C(R12.1, I_VM15)
756 	NET_C(R13.1, GND)
757 	NET_C(Q3.B, R14.2)
758 	NET_C(R14.1, GND)
759 	NET_C(Q3.C, C13.1, R20.1)
760 	NET_C(C13.2, I_VM15)
761 	NET_C(R20.2, U61.5)
762 	ALIAS(CS, U61.6)
763 
764 	//
765 	// Page 1, bottom-right
766 	//
767 
768 #if (HLE_SFX_CLOCK)
769 	//
770 	// A 20MHz crystal (Y1) is divided by 4 by a pair of
771 	// JK flip flops (U23) to 5MHz. This is fed to a
772 	// 74LS393 counter (U13) and the divide-by-16 output
773 	// is divided again by a JK flip flop (U9) into a
774 	// 156250Hz counter. Skip the work of dividing this
775 	// manually and just create a clock directly.
776 	//
777 	CLOCK(SFXCLOCK, 156250)
778 	NET_C(SFXCLOCK.GND, GND)
779 	NET_C(SFXCLOCK.VCC, I_V5)
780 	NET_C(SFXCLOCK.Q, U29.3, U2.5)
781 	NET_C(U2.6, U29.11)
782 	NET_C(GND, U13.12, U13.13)
783 	NET_C(GND, U9.9, U9.10, U9.11)
784 #else
785 	NET_C(U25.5, GND)   // unused inverter borrowed
786 	HINT(U2.6, NC)      // for HLE SFX clock
787 
788 	ALIAS(_5MHZ_M, U13.13)
789 	NET_C(U13.12, GND)
790 	NET_C(U13.8, U9.9)
791 	HINT(U13.9, NC)
792 	HINT(U13.10, NC)
793 	HINT(U13.11, NC)
794 
795 	NET_C(U9.8, U9.10, U9.11)
796 	NET_C(U9.5, U29.3)
797 	NET_C(U9.6, U29.11)
798 #endif
799 	ALIAS(HID_P, U9.8)
800 
801 	NET_C(U29.2, BCLK_M)
802 	NET_C(HIB_P, U29.4, U29.1)
803 	NET_C(U29.5, U29.12)
804 	ALIAS(ACLK_P, U29.5)
805 	NET_C(ACLK_M, U29.6)
806 
807 	NET_C(HIB_P, U29.10, U29.13)
808 	NET_C(BCLK_P, U29.9)
809 	NET_C(BCLK_M, U29.8)
810 
811 	//
812 	// Page 2, top (noise generator)
813 	//
814 
815 	NET_C(_588USEC_P, U1.1)
816 	NET_C(U1.2, GND)
817 	NET_C(U1.6, U1.13)
818 	HINT(U1.5, NC)
819 	HINT(U1.4, NC)
820 	HINT(U1.3, NC)
821 	NET_C(U1.12, GND)
822 	HINT(U1.8, NC)
823 	HINT(U1.9, NC)
824 	NET_C(U1.10, U11.8, U32.1)
825 	HINT(U1.11, NC)
826 
827 	NET_C(U11.9, U35.1)
828 	NET_C(U11.1, U11.2, U12.8)
829 	NET_C(U11.13, U12.1)
830 	ALIAS(RANDOM_NOISE_P, U11.13)
831 	HINT(U11.12, NC)
832 	HINT(U11.11, NC)
833 	HINT(U11.10, NC)
834 	NET_C(U11.6, U12.2)
835 	NET_C(U11.5, U12.5)
836 	NET_C(U11.4, U12.4)
837 	HINT(U11.3, NC)
838 
839 	NET_C(U12.3, U12.13)
840 	NET_C(U12.6, U12.12)
841 	NET_C(U12.11, U32.2, U12.9)
842 	NET_C(U12.10, HID_P)
843 	ALIAS(IN_M, U12.8)
844 
845 	NET_C(U32.6, U35.2, U35.3)
846 	HINT(U32.5, NC)
847 	HINT(U32.4, NC)
848 	HINT(U32.3, NC)
849 	ALIAS(ERRCLR_M, U35.1)
850 
851 	//
852 	// Page 2, middle (Chirping Birds)
853 	//
854 
855 	NET_C(RANDOM_NOISE_P, U31.5)
856 	NET_C(U31.6, R22.1, R23.1)
857 	NET_C(R22.2, I_V5, R24.2, Q4.E)
858 	NET_C(R23.2, R24.1, Q4.B)
859 	NET_C(Q4.C, R25.2, R26.2, R27.1)
860 	NET_C(R25.1, I_VM15)
861 	NET_C(R26.1, GND)
862 	NET_C(R27.2, Q5.B)
863 	NET_C(Q5.E, GND)
864 	NET_C(Q5.C, R29.1)
865 	NET_C(R29.2, R28.1, C14.1, R30.2, C15.2)
866 	NET_C(R28.2, I_V15)
867 	NET_C(C14.2, GND)
868 	NET_C(R30.1, GND)
869 	NET_C(C15.1, R31.1)
870 	NET_C(R31.2, I_V15)
871 
872 #if (HLE_CHIRPING_VCO)
873 	//
874 	// Standard mapping:
875 	//    R2 = 0.91650: HP = (0.0000123028*A0) - 0.000136645
876 	//    R2 = 0.98600: HP = (0.00000750231*A0*A0) - (0.000183288*A0) + 0.00113698
877 	//    R2 = 0.99008: HP = (0.00000414207*A0*A0*A0) - (0.000154885*A0*A0) + (0.00193729*A0) - 0.0080873
878 	//    R2 = 0.98800: HP = (0.00000603082*A0*A0*A0*A0) - (0.000311647*A0*A0*A0) + (0.00604258*A0*A0) - (0.0520898*A0) + 0.168437
879 	//    R2 = 0.98586: HP = (0.000000081416*A0*A0*A0*A0*A0) - (0.00000284650*A0*A0*A0*A0) + (0.0000136226*A0*A0*A0) + (0.000571759*A0*A0) - (0.0083734*A0) + 0.0333905
880 	//
881 	VARCLOCK(CHIRPCLK, 1, "max(0.000001,min(0.1,(0.000000081416*A0*A0*A0*A0*A0) - (0.00000284650*A0*A0*A0*A0) + (0.0000136226*A0*A0*A0) + (0.000571759*A0*A0) - (0.0083734*A0) + 0.0333905))")
882 	NET_C(CHIRPCLK.GND, GND)
883 	NET_C(CHIRPCLK.VCC, I_V5)
884 	NET_C(CHIRPCLK.A0, C15.2)
885 	NET_C(CHIRPCLK.Q, U41.1)
886 	NET_C(GND, R32.1, R32.2, R33.1, R33.2, R205.1, R205.2, C16.1, C16.2, C17.1, C17.2, D13.A, D13.K, D14.A, D14.K)
887 #else
888 	NET_C(R29.2, U51.5)
889 	NET_C(C15.1, U51.6)
890 	NET_C(R31.2, U51.8)
891 	NET_C(U51.7, C16.1)
892 	NET_C(C16.2, GND)
893 	NET_C(U51.1, GND)
894 	HINT(U51.4, NC)
895 	NET_C(U51.3, C17.2)
896 	NET_C(C17.1, D13.K, R32.1)
897 	NET_C(D13.A, GND)
898 	NET_C(R32.2, Q6.B)
899 	NET_C(Q6.E, R205.2, D14.K)
900 	NET_C(R205.1, I_VM15)
901 	NET_C(D14.A, GND)
902 	NET_C(Q6.C, R33.1, U41.1)
903 	NET_C(R33.2, I_V5)
904 #endif
905 
906 	NET_C(U41.2, RANDOM_NOISE_P)
907 	HINT(U41.6, NC)
908 	HINT(U41.5, NC)
909 	HINT(U41.4, NC)
910 	NET_C(U41.3, U41.13)
911 
912 	ALIAS(CHIRPING_BIRDS_M, U41.12)
913 	HINT(U41.8, NC)
914 	HINT(U41.9, NC)
915 	NET_C(U41.10, R47.1, R48.1)
916 	HINT(U41.11, NC)
917 	NET_C(R47.2, I_V5)
918 	NET_C(R48.2, R49.2, C22.2)
919 	NET_C(R49.1, GND)
920 	ALIAS(SJ, C22.1)
921 
922 	//
923 	// Page 2, bottom (Dying Bug)
924 	//
925 
926 	ALIAS(BUG_DYING_M, U31.3)
927 	NET_C(U31.4, R34.1, R35.1)
928 	NET_C(R34.2, I_V5, R36.2, Q7.E)
929 	NET_C(R35.2, R36.1, Q7.B)
930 	NET_C(Q7.C, R37.2, R38.2, R39.1)
931 	NET_C(R37.1, I_VM15)
932 	NET_C(R38.1, GND)
933 	NET_C(R39.2, Q8.B)
934 	NET_C(Q8.E, GND)
935 	NET_C(Q8.C, R41.1)
936 	NET_C(R41.2, R40.1, C18.1, R42.2, C19.2)
937 	NET_C(R40.2, I_V15)
938 	NET_C(C18.2, GND)
939 	NET_C(R42.1, GND)
940 	NET_C(R43.2, I_V15)
941 	NET_C(C19.1, R43.1)
942 
943 #if (HLE_DYING_BUG_VCO)
944 	//
945 	// Standard mapping:
946 	//    R2 = 0.94234: HP = (0.0000126953*A0) - 0.000142795
947 	//    R2 = 0.99216: HP = (0.0000085544*A0*A0) - (0.000211995*A0) + 0.00132411
948 	//    R2 = 0.99610: HP = (0.00000512381*A0*A0*A0) - (0.000194224*A0*A0) + (0.00245729*A0) - 0.0103626
949 	//    R2 = 0.99646: HP = (0.00000347185*A0*A0*A0*A0) - (0.000178231*A0*A0*A0) + (0.00343236*A0*A0) - (0.0293814*A0) + 0.094321
950 	//    R2 = 0.99644: HP = (0.000000064673*A0*A0*A0*A0*A0) - (0.00000153002*A0*A0*A0*A0) - (0.0000269128*A0*A0*A0) + (0.00118283*A0*A0) - (0.0128917*A0) + 0.0465240
951 	//
952 	VARCLOCK(DYINGCLK, 1, "max(0.000001,min(0.1,(0.000000064673*A0*A0*A0*A0*A0) - (0.00000153002*A0*A0*A0*A0) - (0.0000269128*A0*A0*A0) + (0.00118283*A0*A0) - (0.0128917*A0) + 0.0465240))")
953 	NET_C(DYINGCLK.GND, GND)
954 	NET_C(DYINGCLK.VCC, I_V5)
955 	NET_C(DYINGCLK.A0, C19.2)
956 	NET_C(DYINGCLK.Q, U42.1)
957 	NET_C(GND, R44.1, R44.2, R45.1, R45.2, R46.1, R46.2, C20.1, C20.2, C21.1, C21.2, D15.A, D15.K, D16.A, D16.K)
958 #else
959 	NET_C(C19.2, U52.5)
960 	NET_C(C19.1, U52.6)
961 	NET_C(R43.2, U52.8)
962 	NET_C(U52.7, C20.1)
963 	NET_C(C20.2, GND)
964 	NET_C(U52.1, GND)
965 	HINT(U52.4, NC)
966 	NET_C(U52.3, C21.2)
967 	NET_C(C21.1, D15.K, R44.1)
968 	NET_C(D15.A, GND)
969 	NET_C(R44.2, Q9.B)
970 	NET_C(Q9.E, R46.2, D16.K)
971 	NET_C(R46.1, I_VM15)
972 	NET_C(D16.A, GND)
973 	NET_C(Q9.C, R45.1, U42.1)
974 	NET_C(R45.2, I_V5)
975 #endif
976 
977 	NET_C(_327USEC_P, U32.13)
978 	NET_C(U32.12, GND)
979 	ALIAS(_5232USEC_P, U32.8)
980 	ALIAS(_2616USEC_P, U32.9)
981 	NET_C(U32.9, U42.2)
982 	HINT(U32.10, NC)
983 	HINT(U32.11, NC)
984 
985 	HINT(U42.6, NC)
986 	HINT(U42.5, NC)
987 	HINT(U42.4, NC)
988 	NET_C(U42.3, U42.13)
989 	NET_C(U42.12, BUG_DYING_M)
990 	NET_C(U42.8, R51.1)
991 	NET_C(U42.9, R52.1)
992 	NET_C(U42.10, R53.1)
993 	HINT(U42.11, NC)
994 	NET_C(R54.2, R53.2, R52.2, R51.2, R50.1)
995 	NET_C(R54.1, GND)
996 	NET_C(R50.2, C23.2)
997 	NET_C(C23.1, SJ)
998 
999 	//
1000 	// Page 3, top (Egg Cracking)
1001 	//
1002 
1003 	ALIAS(EGG_CRACKING_M, U31.13)
1004 	NET_C(U31.12, R55.1, R56.1)
1005 	NET_C(R55.2, I_V5, R57.2, Q10.E)
1006 	NET_C(R56.2, R57.1, Q10.B)
1007 	NET_C(Q10.C, R58.2, R59.2, R60.1)
1008 	NET_C(R58.1, I_VM15)
1009 	NET_C(R59.1, GND)
1010 	NET_C(Q11.E, GND)
1011 	NET_C(R60.2, Q11.B)
1012 	NET_C(Q11.C, R62.1)
1013 	NET_C(R62.2, R61.1, C24.1, R63.2, C25.2)
1014 	NET_C(C24.2, GND)
1015 	NET_C(R63.1, GND)
1016 	NET_C(R61.2, R64.2, I_V15)
1017 	NET_C(C25.1, R64.1)
1018 
1019 #if (HLE_CRACKING_VCO)
1020 	//
1021 	// Standard mapping:
1022 	//    R2 = 0.89585: HP = (0.0000175988*A0) - 0.000207278
1023 	//    R2 = 0.98810: HP = (0.0000104596*A0*A0) - (0.000261248*A0) + 0.00164623
1024 	//    R2 = 0.99788: HP = (0.00000629669*A0*A0*A0) - (0.000240194*A0*A0) + (0.00305980*A0) - 0.0129994
1025 	//    R2 = 0.99873: HP = (0.00000350292*A0*A0*A0*A0) - (0.000179267*A0*A0*A0) + (0.00344234*A0*A0) - (0.0293869*A0) + 0.094097
1026 	//    R2 = 0.99653: HP = (0.000000075716*A0*A0*A0*A0*A0) - (0.00000154725*A0*A0*A0*A0) - (0.0000446414*A0*A0*A0) + (0.00164941*A0*A0) - (0.0174578*A0) + 0.0623765
1027 	//
1028 	VARCLOCK(CRACKINGCLK, 1, "max(0.000001,min(0.1,(0.000000064673*A0*A0*A0*A0*A0) - (0.00000153002*A0*A0*A0*A0) - (0.0000269128*A0*A0*A0) + (0.00118283*A0*A0) - (0.0128917*A0) + 0.0465240))")
1029 	NET_C(CRACKINGCLK.GND, GND)
1030 	NET_C(CRACKINGCLK.VCC, I_V5)
1031 	NET_C(CRACKINGCLK.A0, C25.2)
1032 	NET_C(CRACKINGCLK.Q, U22.13)
1033 	NET_C(GND, R65.1, R65.2, R66.1, R66.2, R67.1, R67.2, C26.1, C26.2, C27.1, C27.2, D17.A, D17.K, D18.A, D18.K)
1034 #else
1035 	NET_C(R61.2, U53.8)
1036 	NET_C(C25.1, U53.6)
1037 	NET_C(R62.2, U53.5)
1038 	NET_C(U53.7, C26.1)
1039 	NET_C(C26.2, GND)
1040 	NET_C(U53.1, GND)
1041 	HINT(U53.4, NC)
1042 	NET_C(U53.3, C27.2)
1043 	NET_C(C27.1, D17.K, R65.1)
1044 	NET_C(D17.A, GND)
1045 	NET_C(R65.2, Q12.B)
1046 	NET_C(Q12.E, R67.2, D18.K)
1047 	NET_C(R67.1, I_VM15)
1048 	NET_C(D18.A, GND)
1049 	NET_C(Q12.C, R66.1, U22.13)
1050 	NET_C(R66.2, I_V5)
1051 #endif
1052 
1053 	NET_C(EGG_CRACKING_M, U22.12)
1054 	NET_C(U22.8, R68.1)
1055 	NET_C(U22.9, R69.1)
1056 	NET_C(U22.10, R70.1)
1057 	HINT(U22.11, NC)
1058 	NET_C(R68.2, R69.2, R70.2, R71.2, R72.1)
1059 	NET_C(R71.1, GND)
1060 	NET_C(R72.2, C28.2)
1061 	NET_C(C28.1, SJ)
1062 
1063 	//
1064 	// Page 3, middle (Beetle on screen)
1065 	//
1066 
1067 	ALIAS(BEETLE_ON_SCREEN_M, U31.1)
1068 	NET_C(U31.2, U19.4)
1069 	NET_C(U19.8, R73.2, I_V5)
1070 	NET_C(R73.1, U19.7, R74.2)
1071 	NET_C(R74.1, U19.6, U19.2, C29.1)
1072 	NET_C(C29.2, GND)
1073 	NET_C(U19.1, GND)
1074 	NET_C(U19.5, C30.1)
1075 	NET_C(C30.2, GND)
1076 	NET_C(U19.3, R75.2, U20.1)
1077 	NET_C(R75.1, GND)
1078 
1079 	NET_C(U20.2, R77.1, R76.1)
1080 	NET_C(R76.2, I_V5, R78.2, Q13.E)
1081 	NET_C(R77.2, R78.1, Q13.B)
1082 	NET_C(Q13.C, R79.2, R80.2, R81.1)
1083 	NET_C(R79.1, I_VM15)
1084 	NET_C(R80.1, GND)
1085 	NET_C(R81.2, Q14.B)
1086 	NET_C(Q14.E, GND)
1087 	NET_C(Q14.C, R83.1)
1088 	NET_C(R83.2, R82.1, C31.1, R84.2, C32.2)
1089 	NET_C(C31.2, GND)
1090 	NET_C(R84.1, GND)
1091 	NET_C(R82.2, I_V15, R85.2)
1092 	NET_C(R85.1, C32.1)
1093 
1094 #if (HLE_BEETLE_VCO)
1095 	//
1096 	// Standard mapping:
1097 	//    R2 = 0.92906: HP = (0.000127227*A0) - 0.00149583
1098 	//    R2 = 0.97372: HP = (0.000086592*A0*A0) - (0.00218553*A0) + 0.0139420
1099 	//    R2 = 0.97589: HP = (0.000063925*A0*A0*A0) - (0.00248748*A0*A0) + (0.0323532*A0) - 0.140489
1100 	//    R2 = 0.97153: HP = (-0.00000615887*A0*A0*A0*A0) + (0.000395273*A0*A0*A0) - (0.0091707*A0*A0) + (0.092250*A0) - 0.341743
1101 	//    R2 = 0.96812: HP = (0.00000145563*A0*A0*A0*A0*A0) - (0.0000505655*A0*A0*A0*A0) + (0.000151855*A0*A0*A0) + (0.0134189*A0*A0) - (0.189302*A0) + 0.763397
1102 	//
1103 	VARCLOCK(BEETLECLK, 1, "max(0.000001,min(0.1,(0.00000145563*A0*A0*A0*A0*A0) - (0.0000505655*A0*A0*A0*A0) + (0.000151855*A0*A0*A0) + (0.0134189*A0*A0) - (0.189302*A0) + 0.763397))")
1104 	NET_C(BEETLECLK.GND, GND)
1105 	NET_C(BEETLECLK.VCC, I_V5)
1106 	NET_C(BEETLECLK.A0, C32.2)
1107 	NET_C(BEETLECLK.Q, U22.1)
1108 	NET_C(GND, R86.1, R86.2, R87.1, R87.2, R88.1, R88.2, C33.1, C33.2, C34.1, C34.2, D19.A, D19.K, D20.A, D20.K)
1109 #else
1110 	NET_C(R83.2, U56.5)
1111 	NET_C(R82.2, U56.8)
1112 	NET_C(R85.1, U56.6)
1113 	NET_C(U56.7, C33.1)
1114 	NET_C(C33.2, GND)
1115 	NET_C(U56.1, GND)
1116 	HINT(U56.4, NC)
1117 	NET_C(U56.3, C34.2)
1118 	NET_C(C34.1, D19.K, R86.1)
1119 	NET_C(D19.A, GND)
1120 	NET_C(R86.2, Q15.B)
1121 	NET_C(Q15.E, R88.2, D20.K)
1122 	NET_C(R88.1, I_VM15)
1123 	NET_C(D20.A, GND)
1124 	NET_C(Q15.C, R87.1, U22.1)
1125 	NET_C(R87.2, I_V5)
1126 #endif
1127 
1128 	NET_C(BEETLE_ON_SCREEN_M, U22.2)
1129 	HINT(U22.6, NC)
1130 	HINT(U22.5, NC)
1131 	NET_C(U22.4, R89.1)
1132 	HINT(U22.3, NC)
1133 	NET_C(R89.2, R90.2, R91.1)
1134 	NET_C(R90.1, GND)
1135 	NET_C(R91.2, C35.2)
1136 	NET_C(C35.1, SJ)
1137 
1138 	//
1139 	// Page 3, bottom (BOUNCE)
1140 	//
1141 
1142 	ALIAS(BOUNCE_EN_P, R93.1)
1143 	NET_C(R93.1, R92.1)
1144 	NET_C(R92.2, R94.2, I_V5, Q16.E)
1145 	NET_C(R93.2, R94.1, Q16.B)
1146 	NET_C(Q16.C, R95.2, R96.2, R97.1)
1147 	NET_C(R95.1, I_VM15)
1148 	NET_C(R96.1, GND)
1149 	NET_C(R97.2, Q17.B)
1150 	NET_C(Q17.E, GND)
1151 	NET_C(Q17.C, R99.1)
1152 	NET_C(R99.2, R98.1, C36.1, R101.2, C39.2, R102.2)
1153 	NET_C(R98.2, I_V15)
1154 	NET_C(C36.2, GND)
1155 	NET_C(R101.1, GND)
1156 
1157 	NET_C(_5232USEC_P, R100.1, U58.6, U58.2)
1158 	NET_C(R100.2, I_V5)
1159 	NET_C(U58.7, GND)   // not connected
1160 	NET_C(U58.4, U58.8, I_V5)
1161 	NET_C(U58.1, GND)
1162 	NET_C(U58.5, C38.1)
1163 	NET_C(C38.2, GND)
1164 	NET_C(U58.3, C37.2)
1165 	NET_C(C37.1, R102.1)
1166 
1167 	NET_C(C39.1, R108.1)
1168 	NET_C(R108.2, I_V15)
1169 #if (HLE_BOUNCE_VCO)
1170 	//
1171 	// Unlike all the other VCOs, this one doesn't go directly into a
1172 	// TTL device. The actual square wave is tapered from the top and
1173 	// slightly modulated with the frequency, but it makes little
1174 	// practical difference, so we just scale the output square wave
1175 	// to +/-5V as input to R109.
1176 	//
1177 	// Standard mapping:
1178 	//    R2 = 0.89933: HP = (0.00476268*A0) - 0.0576442
1179 	//    R2 = 0.97773: HP = (0.00311005*A0*A0) - (0.079281*A0) + 0.509096
1180 	//    R2 = 0.97985: HP = (0.00115078*A0*A0*A0) - (0.0435380*A0*A0) + (0.550407*A0) - 2.321385
1181 	//    R2 = 0.97985: HP = (0.0000369937*A0*A0*A0*A0) - (0.000849582*A0*A0*A0) - (0.00300315*A0*A0) + (0.185593*A0) - 1.090973
1182 	//    R2 = 0.24613: HP = (-0.000199982*A0*A0*A0*A0*A0) + (0.0134882*A0*A0*A0*A0) - (0.362557*A0*A0*A0) + (4.857498*A0*A0) - (32.45284*A0) + 86.5278
1183 	//
1184 	VARCLOCK(BOUNCECLK, 1, "max(0.000001,min(0.1,((0.00115078*A0*A0*A0) - (0.0435380*A0*A0) + (0.550407*A0) - 2.321385)))")
1185 	NET_C(BOUNCECLK.GND, GND)
1186 	NET_C(BOUNCECLK.VCC, I_V5)
1187 	NET_C(BOUNCECLK.A0, C39.2)
1188 	NET_C(BOUNCECLK.Q, BOUNCEENV.A0)
1189 	AFUNC(BOUNCEENV, 1, "if(A0>2.5,5,-5)")
1190 	NET_C(BOUNCEENV, R109.1)
1191 	NET_C(GND, C40.1, C40.2)
1192 	NET_C(GND, C42.1, C42.2)
1193 #else
1194 	NET_C(C39.1, U57.6)
1195 	NET_C(R108.2, U57.8)
1196 	NET_C(R99.2, U57.5)
1197 	NET_C(C39.1, U57.6, R108.1)
1198 	NET_C(R108.2, I_V15, U57.8)
1199 	NET_C(U57.7, C40.1)
1200 	NET_C(C40.2, GND)
1201 	NET_C(U57.1, GND)
1202 	HINT(U57.4, NC)
1203 	NET_C(U57.3, C42.2)
1204 	NET_C(C42.1, R109.1)
1205 #endif
1206 
1207 	NET_C(R109.2, R111.2, U59.2)
1208 	NET_C(R111.1, GND)
1209 	NET_C(U59.3, R112.2)
1210 	NET_C(R112.1, GND)
1211 
1212 	ALIAS(BOUNCE_EN_M, R104.1)
1213 	NET_C(R104.1, R103.1)
1214 	NET_C(R103.2, I_V5)
1215 	NET_C(R104.2, Q18.B)
1216 	NET_C(Q18.E, I_V2_2)
1217 	NET_C(Q18.C, R105.2, R106.2, Q19.E)
1218 	NET_C(R105.1, I_VM15)
1219 	NET_C(R106.1, GND)
1220 	NET_C(Q19.B, R107.2)
1221 	NET_C(R107.1, GND)
1222 	NET_C(Q19.C, C41.1, R110.1)
1223 	NET_C(C41.2, I_VM15)
1224 	NET_C(R110.2, U59.5)
1225 	NET_C(U59.6, CS)
1226 
1227 	//
1228 	// Page 4, top (Cannon)
1229 	//
1230 
1231 	ALIAS(CANNON_M, R114.1)
1232 	NET_C(R114.1, R113.1)
1233 	NET_C(R113.2, I_V5)
1234 	NET_C(R114.2, Q20.B)
1235 	NET_C(Q20.E, I_V2_2)
1236 	NET_C(Q20.C, R115.2, R116.2, R117.1)
1237 	NET_C(R115.1, I_VM15)
1238 	NET_C(R116.1, GND)
1239 	NET_C(R117.2, Q21.B)
1240 	NET_C(Q21.E, GND)
1241 	NET_C(Q21.C, R119.1)
1242 	NET_C(R119.2, R118.1, C43.1, R120.2, C44.2)
1243 	NET_C(R118.2, I_V15, R121.2)
1244 	NET_C(C43.2, GND)
1245 	NET_C(R120.1, GND)
1246 	NET_C(C44.1, R121.1)
1247 
1248 #if (HLE_CANNON_VCO)
1249 	//
1250 	// Standard mapping:
1251 	//    R2 = 0.96910: HP = (0.000125667*A0) - 0.00142938
1252 	//    R2 = 0.99026: HP = (0.000076462*A0*A0) - (0.00189006*A0) + 0.0117720
1253 	//    R2 = 0.99181: HP = (0.0000429163*A0*A0*A0) - (0.00161661*A0*A0) + (0.0203246*A0) - 0.085173
1254 	//    R2 = 0.99203: HP = (0.0000167801*A0*A0*A0*A0) - (0.000839548*A0*A0*A0) + (0.0157634*A0*A0) - (0.131604*A0) + 0.412204
1255 	//    R2 = 0.99209: HP = (0.00000283657*A0*A0*A0*A0*A0) - (0.000141443*A0*A0*A0*A0) + (0.00257240*A0*A0*A0) - (0.0192167*A0*A0) + (0.0334224*A0) + 0.148265
1256 	//
1257 	VARCLOCK(CANNONCLK, 1, "max(0.000001,min(0.1,(0.00000283657*A0*A0*A0*A0*A0) - (0.000141443*A0*A0*A0*A0) + (0.00257240*A0*A0*A0) - (0.0192167*A0*A0) + (0.0334224*A0) + 0.148265))")
1258 	NET_C(CANNONCLK.GND, GND)
1259 	NET_C(CANNONCLK.VCC, I_V5)
1260 	NET_C(CANNONCLK.A0, C44.2)
1261 	NET_C(CANNONCLK.Q, U13.1)
1262 	NET_C(GND, R122.1, R122.2, R123.1, R123.2, R124.1, R124.2, C75.1, C75.2, C45.1, C45.2, D21.A, D21.K, D22.A, D22.K)
1263 #else
1264 	NET_C(R119.2, U60.5)
1265 	NET_C(R118.2, U60.8)
1266 	NET_C(C44.1, U60.6)
1267 	NET_C(U60.7, C75.1)
1268 	NET_C(C75.2, GND)
1269 	NET_C(U60.1, GND)
1270 	HINT(U60.4, NC)
1271 	NET_C(U60.3, C45.2)
1272 	NET_C(C45.1, D21.K, R122.1)
1273 	NET_C(D21.A, GND)
1274 	NET_C(R122.2, Q22.B)
1275 	NET_C(Q22.E, R124.2, D22.K)
1276 	NET_C(R124.1, I_VM15)
1277 	NET_C(D22.A, GND)
1278 	NET_C(Q22.C, R123.1, U13.1)
1279 	NET_C(R123.2, I_V5)
1280 #endif
1281 
1282 	NET_C(CANNON_M, U13.2)
1283 	HINT(U13.6, NC)
1284 	HINT(U13.5, NC)
1285 	NET_C(U13.4, R125.1)
1286 	HINT(U13.3, NC)
1287 	NET_C(R125.2, R126.1, R127.2)
1288 	NET_C(R126.2, GND)
1289 	NET_C(R127.1, C46.2)
1290 	NET_C(C46.1, SJ)
1291 
1292 	//
1293 	// Page 4, bottom-left (explosions)
1294 	//
1295 
1296 	NET_C(U62.2, GND)
1297 	NET_C(U62.1, GND)
1298 	NET_C(U62.4, R128.1, C47.1, C74.1)
1299 	NET_C(R128.2, I_V15)
1300 	NET_C(C47.2, GND)
1301 	NET_C(C74.2, GND)
1302 	NET_C(U62.3, C48.2)
1303 	NET_C(C48.1, R129.2, U63.3)
1304 	NET_C(R129.1, GND)
1305 	NET_C(U63.2, U63.6, R130.1)
1306 	NET_C(R130.2, C49.1, R131.1)
1307 	NET_C(C49.2, GND)
1308 	NET_C(R131.2, C50.1, R132.1)
1309 	NET_C(C50.2, GND)
1310 	NET_C(R132.2, R133.2, U64.2)
1311 	NET_C(R133.1, GND)
1312 	NET_C(U64.3, R134.2)
1313 	NET_C(R134.1, GND)
1314 	NET_C(U64.6, CS)
1315 
1316 	ALIAS(LOUD_EXPL_M, R136.1)
1317 	NET_C(R136.1, R135.1)
1318 	NET_C(R135.2, I_V5, R137.2, Q23.E)
1319 	NET_C(R136.2, R137.1, Q23.B)
1320 	NET_C(Q23.C, R138.2, R139.2, Q24.E)
1321 	NET_C(R138.1, I_VM15)
1322 	NET_C(R139.1, GND)
1323 	NET_C(Q24.B, R140.2)
1324 	NET_C(R140.1, GND)
1325 	NET_C(Q24.C, C51.1, R141.1)
1326 	NET_C(C51.2, I_VM15)
1327 	NET_C(R141.2, R148.2, U64.5)
1328 
1329 	ALIAS(SOFT_EXPL_M, R143.1)
1330 	NET_C(R143.1, R142.1)
1331 	NET_C(R142.2, I_V5, R144.2, Q25.E)
1332 	NET_C(R143.2, R144.1, Q25.B)
1333 	NET_C(Q25.C, R145.2, R146.2, Q26.E)
1334 	NET_C(R145.1, I_VM15)
1335 	NET_C(R146.1, GND)
1336 	NET_C(Q26.B, R147.2)
1337 	NET_C(R147.1, GND)
1338 	NET_C(Q26.C, C52.1, R148.1)
1339 	NET_C(C52.2, I_VM15)
1340 
1341 	//
1342 	// Page 4, bottom-right (bug pushing and final mix)
1343 	//
1344 
1345 	ALIAS(BUG_PUSHING_A_P, U31.9)
1346 	NET_C(U31.8, U21.2)
1347 	NET_C(_588USEC_P, U21.1)
1348 	HINT(U21.6, NC)
1349 	NET_C(U21.5, R149.1)
1350 	HINT(U21.4, NC)
1351 	HINT(U21.3, NC)
1352 	NET_C(R149.2, C53.1)
1353 
1354 	ALIAS(BUG_PUSHING_B_P, U31.11)
1355 	NET_C(U31.10, U21.12)
1356 	NET_C(_588USEC_P, U21.13)
1357 	NET_C(U21.8, R150.1)
1358 	HINT(U21.9, NC)
1359 	HINT(U21.10, NC)
1360 	HINT(U21.11, NC)
1361 	NET_C(R150.2, C54.2)
1362 
1363 	NET_C(C53.2, C54.1, SJ, U54.2, R160.2, R161.1, C61.1)
1364 	NET_C(C61.2, R161.2)
1365 	ALIAS(OUTPUT, R161.2)
1366 	NET_C(R161.2, U54.6)
1367 	NET_C(U54.3, GND)
1368 	NET_C(CS, U55.3, R159.2)
1369 	NET_C(R159.1, GND)
1370 	NET_C(U55.2, U55.6, C60.2)
1371 	NET_C(C60.1, R160.1)
1372 
1373 	//
1374 	// Page 5, shaft encoder -- not emulated
1375 	//
1376 
1377 	//
1378 	// Page 6, top left
1379 	//
1380 
1381 	NET_C(I_V5, R206.1, R207.1, R208.1, R209.1)
1382 	NET_C(R206.2, HIA_P)
1383 	NET_C(R207.2, HIB_P)
1384 	ALIAS(HIC_P, R208.2)
1385 	NET_C(R209.2, HID_P)
1386 
1387 	NET_C(I_OUT_7, D25.K, U50.9)
1388 	NET_C(D25.A, GND)
1389 	NET_C(U50.8, U50.1)
1390 	NET_C(U50.2, U49.1)
1391 	ALIAS(DATA_P, U50.2)
1392 
1393 #if (HACK_SIMPLIFY_INPUTS)
1394 	//
1395 	// Several of the inputs go through several rounds of inverters
1396 	// diodes and pullups, and eventually something goes wrong.
1397 	// Bypassing these extra devices helps make the inputs reliable.
1398 	//
1399 	NET_C(I_OUT_4, U30.13)
1400 	NET_C(GND, D26.A, D26.K, U50.13, U50.12, U40.9, R177.1, R177.2, C67.1, C67.2)
1401 #else
1402 	NET_C(I_OUT_4, D26.K, U50.13)
1403 	NET_C(D26.A, GND)
1404 	NET_C(U50.12, U40.9)
1405 	NET_C(U40.8, C67.2, R177.1, U30.13)
1406 	NET_C(C67.1, GND)
1407 	NET_C(R177.2, I_V5)
1408 #endif
1409 	NET_C(U30.12, U30.1)
1410 	NET_C(U30.2, U49.8, U39.8)
1411 
1412 	NET_C(U49.2, U49.9, U39.2, U39.9, HIA_P)
1413 	NET_C(U49.3, U48.3, U47.3)
1414 	NET_C(U49.4, U48.4, U47.4)
1415 	NET_C(U49.5, U48.7, U47.7)
1416 	NET_C(U49.6, U48.8, U47.8)
1417 	NET_C(U49.10, U48.13, U47.13)
1418 	NET_C(U49.11, U48.14, U47.14)
1419 	NET_C(U49.12, U48.17, U47.17)
1420 	NET_C(U49.13, U48.18, U47.18, U39.1)
1421 
1422 	NET_C(U39.3, U38.3)
1423 	NET_C(U39.4, U38.4)
1424 	NET_C(U39.5, U38.7)
1425 	NET_C(U39.6, U38.8)
1426 	NET_C(U39.10, U38.13)
1427 	NET_C(U39.11, U38.14)
1428 	NET_C(U39.12, U38.17)
1429 	NET_C(U39.13, U38.18)
1430 
1431 	ALIAS(MEN_P, U48.2)
1432 	NET_C(CANNON_M, U48.5)
1433 	ALIAS(AS1_M, U48.6)
1434 	ALIAS(AS0_M, U48.9)
1435 	ALIAS(FS11_P, U48.12)
1436 	ALIAS(FS10_P, U48.15)
1437 	ALIAS(FS09_P, U48.16)
1438 	ALIAS(FS08_P, U48.19)
1439 	NET_C(U48.1, GND)
1440 	ALIAS(MLATCH_P, U48.11)
1441 
1442 	ALIAS(FS07_P, U38.2)
1443 	ALIAS(FS06_P, U38.5)
1444 	ALIAS(FS05_P, U38.6)
1445 	ALIAS(FS04_P, U38.9)
1446 	ALIAS(FS03_P, U38.12)
1447 	ALIAS(FS02_P, U38.15)
1448 	ALIAS(FS01_P, U38.16)
1449 	ALIAS(FS00_P, U38.19)
1450 	NET_C(U38.1, GND)
1451 	NET_C(MLATCH_P, U38.11)
1452 
1453 	NET_C(SOFT_EXPL_M, U47.2)
1454 	NET_C(LOUD_EXPL_M, U47.5)
1455 	NET_C(CHIRPING_BIRDS_M, U47.6)
1456 	NET_C(EGG_CRACKING_M, U47.9)
1457 	NET_C(BUG_PUSHING_A_P, U47.12)
1458 	NET_C(BUG_PUSHING_B_P, U47.15)
1459 	NET_C(BUG_DYING_M, U47.16)
1460 	NET_C(BEETLE_ON_SCREEN_M, U47.19)
1461 	NET_C(U47.11, U30.6)
1462 	NET_C(U47.1, GND)
1463 
1464 	//
1465 	// Page 6, middle-left
1466 	//
1467 
1468 #if (HLE_MUSIC_CLOCK)
1469 	//
1470 	// The 20MHz clock (Y1) is divided by 4 via a pair
1471 	// of JK flip-flops (U23) to 5MHz. That signal is
1472 	// used to clock a 74LS163 counter (U43) that divides
1473 	// the clock by 9 via a preset value. It then goes
1474 	// through another JK flip-flop (U33) for another
1475 	// divide by 2, ending up at 277778Hz. No sense in
1476 	// running all this manually.
1477 	//
1478 	CLOCK(MUSICCLK, 277778)
1479 	NET_C(MUSICCLK.VCC, I_V5)
1480 	NET_C(MUSICCLK.GND, GND)
1481 	ALIAS(_227KC_P, MUSICCLK.Q)
1482 	NET_C(MUSICCLK.Q, U2.13)
1483 	ALIAS(_227KC_M, U2.12)
1484 	NET_C(GND, R178.1, R178.2, R179.1, R179.2, R204.1, R204.2, C68.1, C68.2)
1485 	NET_C(GND, U2.1, U2.3)
1486 	NET_C(GND, U23.1, U23.2, U23.3, U23.4, U23.10, U23.11, U23.12, U23.13)
1487 #else
1488 	//
1489 	// This is just here for documentation; the crystal is
1490 	// not modelled for this circuit.
1491 	//
1492 	NET_C(U2.3, R178.1, C68.1)
1493 	NET_C(R178.2, U2.4, Y1.1)
1494 	NET_C(Y1.2, R179.1, U2.1)
1495 	NET_C(R179.2, U2.2, U2.13, C68.2)
1496 	NET_C(U2.12, U23.1)
1497 	NET_C(HIC_P, U23.3, U23.2, U23.4, U23.11, U23.12, U23.10)
1498 	NET_C(U23.5, U23.13)
1499 	HINT(U23.6, NC)
1500 	ALIAS(_5MHZ_P, U23.9)
1501 	NET_C(_5MHZ_M, U23.8)
1502 #endif
1503 
1504 	//
1505 	// Page 6, bottom-left
1506 	//
1507 
1508 #if (HACK_SIMPLIFY_INPUTS)
1509 	NET_C(I_OUT_1, U30.9)
1510 	NET_C(GND, D27.A, D27.K, U50.3, U50.4, U40.13, R180.1, R180.2, C69.1, C69.2)
1511 #else
1512 	NET_C(I_OUT_1, U50.3, D27.K)
1513 	NET_C(D27.A, GND)
1514 	NET_C(U50.4, U40.13)
1515 	NET_C(U40.12, R180.1, C69.2, U30.9)
1516 	NET_C(R180.2, I_V5)
1517 	NET_C(C69.1, GND)
1518 #endif
1519 	NET_C(U30.8, U30.5)
1520 	ALIAS(SLATCH_P, U30.6)
1521 
1522 #if (HACK_SIMPLIFY_INPUTS)
1523 	NET_C(I_OUT_0, U30.11)
1524 	NET_C(GND, D28.A, D28.K, U50.11, U50.10, U40.11, R181.1, R181.2, C70.1, C70.2)
1525 #else
1526 	NET_C(I_OUT_0, U50.11, D28.K)
1527 	NET_C(D28.A, GND)
1528 	NET_C(U50.10, U40.11)
1529 	NET_C(U40.10, R181.1, C70.2, U30.11)
1530 	NET_C(R181.2, I_V5)
1531 	NET_C(C70.1, GND)
1532 #endif
1533 	NET_C(U30.10, U30.3)
1534 	ALIAS(LATCH_CLK_P, U30.4)
1535 
1536 	NET_C(I_OUT_2, U50.5, BOUNCE_EN_M, D29.K)
1537 	NET_C(D29.A, GND)
1538 	NET_C(U50.6, BOUNCE_EN_P)
1539 
1540 	NET_C(I_OUT_3, D30.K, BELL_EN_M)
1541 	NET_C(D30.A, GND)
1542 
1543 	//
1544 	// Page 6, bottom-middle
1545 	//
1546 
1547 #if (HLE_MUSIC_CLOCK)
1548 	NET_C(_227KC_P, U44.3)
1549 	NET_C(_227KC_M, U44.11)
1550 	NET_C(GND, U24.1, U24.2, U24.3, U24.4)
1551 	NET_C(GND, U33.1, U33.4, U33.12)
1552 	NET_C(GND, U43.1, U43.2, U43.3, U43.4, U43.5, U43.6, U43.7, U43.9, U43.10)
1553 	NET_C(HIC_P, U33.13)
1554 #else
1555 	NET_C(HIC_P, U43.5, U43.3, U43.1, U43.10, U43.7)
1556 	NET_C(GND, U43.6, U43.4)
1557 	NET_C(_5MHZ_P, U43.2)
1558 	NET_C(U43.9, U33.12, U24.6)
1559 	HINT(U43.11, NC)
1560 	HINT(U43.12, NC)
1561 	HINT(U43.13, NC)
1562 	HINT(U43.14, NC)
1563 	NET_C(U43.15, U24.2)
1564 
1565 	NET_C(U24.4, HIC_P)
1566 	HINT(U24.5, NC)
1567 	NET_C(U24.3, _5MHZ_M)
1568 	NET_C(U24.1, R204.2)
1569 	NET_C(R204.1, I_V5)
1570 
1571 	NET_C(HIC_P, U33.1, U33.4, U33.13)
1572 	NET_C(U33.3, U44.3)
1573 	ALIAS(_227KC_P, U33.3)
1574 	NET_C(U33.2, U44.11)
1575 	ALIAS(_227KC_M, U33.2)
1576 #endif
1577 
1578 	NET_C(HIA_P, U44.4, U44.1, U44.10, U44.13)
1579 	ALIAS(MACLK_M, U44.2)
1580 	NET_C(U44.5, U44.12)
1581 	ALIAS(MBCLK_P, U44.5)
1582 	ALIAS(MBCLK_M, U44.6)
1583 	ALIAS(MACLK_P, U44.9)
1584 	NET_C(MACLK_M, U44.8, U25.11)
1585 
1586 	ALIAS(MCARRY_P, U25.12)
1587 	NET_C(U25.13, R182.2)
1588 	NET_C(R182.1, I_V5)
1589 	ALIAS(MLOAD_M, U25.8)
1590 	NET_C(U25.9, U35.8, U34.9)
1591 	ALIAS(MLOAD_P, U25.9)
1592 	NET_C(HIA_P, U25.10)
1593 
1594 	NET_C(HIA_P, U34.8, U34.11, U34.10)
1595 	ALIAS(DMUSIC_P, U34.5)
1596 	HINT(U34.6, NC)
1597 
1598 	NET_C(HIA_P, U25.2, U25.4)
1599 	NET_C(LATCH_CLK_P, U25.3)
1600 	NET_C(U25.1, U45.6)
1601 	HINT(U25.5, NC)
1602 	NET_C(U25.6, U35.9, U15.12)
1603 
1604 	NET_C(MBCLK_M, U15.13)
1605 	HINT(U15.8, NC)
1606 	NET_C(U15.9, U35.11, U35.12)
1607 	HINT(U15.10, NC)
1608 	HINT(U15.11, NC)
1609 
1610 	NET_C(U35.13, U45.10)
1611 	NET_C(U35.10, U45.12)
1612 	NET_C(MBCLK_P, U45.11)
1613 	NET_C(HIA_P, U45.13)
1614 	HINT(U45.8, NC)
1615 	NET_C(U45.9, MLATCH_P, U45.2)
1616 	NET_C(HIA_P, U45.4)
1617 	HINT(U45.5, NC)
1618 	NET_C(U45.1, R203.2)
1619 	NET_C(R203.1, I_V5)
1620 	NET_C(MACLK_P, U45.3)
1621 
1622 	//
1623 	// Page 6, right (music generator)
1624 	//
1625 
1626 	NET_C(FS11_P, U46.6)
1627 	NET_C(FS10_P, U46.5)
1628 	NET_C(FS09_P, U46.4)
1629 	NET_C(FS08_P, U46.3)
1630 	NET_C(HIA_P, U46.1)
1631 	NET_C(MEN_P, U46.7)
1632 	NET_C(MLOAD_M, U46.9)
1633 	NET_C(MBCLK_P, U46.2)
1634 	NET_C(U46.15, MCARRY_P)
1635 	NET_C(U46.10, U36.15)
1636 	HINT(U46.11, NC)
1637 	HINT(U46.12, NC)
1638 	HINT(U46.13, NC)
1639 	HINT(U46.14, NC)
1640 
1641 	NET_C(FS07_P, U36.6)
1642 	NET_C(FS06_P, U36.5)
1643 	NET_C(FS05_P, U36.4)
1644 	NET_C(FS04_P, U36.3)
1645 	NET_C(HIA_P, U36.1)
1646 	NET_C(MEN_P, U36.7)
1647 	NET_C(MLOAD_M, U36.9)   // schems say MLOAD_P, but solarq says MLOAD_M
1648 	NET_C(MACLK_P, U36.2)
1649 	NET_C(U36.10, U37.15)
1650 	HINT(U36.11, NC)
1651 	HINT(U36.12, NC)
1652 	HINT(U36.13, NC)
1653 	HINT(U36.14, NC)
1654 
1655 	NET_C(FS03_P, U37.6)
1656 	NET_C(FS02_P, U37.5)
1657 	NET_C(FS01_P, U37.4)
1658 	NET_C(FS00_P, U37.3)
1659 	NET_C(HIA_P, U37.1)
1660 	NET_C(MEN_P, U37.7, U37.10)
1661 	NET_C(MLOAD_M, U37.9)
1662 	NET_C(MBCLK_M, U37.2)
1663 	HINT(U37.11, NC)
1664 	HINT(U37.12, NC)
1665 	HINT(U37.13, NC)
1666 	HINT(U37.14, NC)
1667 
1668 	NET_C(DMUSIC_P, R183.1, R184.1)
1669 	NET_C(R183.2, I_V5)
1670 	NET_C(R184.2, C71.1)
1671 	NET_C(C71.2, R185.1, U67.2)
1672 	NET_C(R185.2, R186.1, GND)
1673 	NET_C(R186.2, U67.3)
1674 	NET_C(U67.6, CS)
1675 
1676 	NET_C(AS1_M, R187.1, R188.1)
1677 	NET_C(R187.2, I_V5, R189.2, Q31.E)
1678 	NET_C(R188.2, R189.1, Q31.B)
1679 	NET_C(Q31.C, R190.2, R191.1, Q32.E)
1680 	NET_C(R190.1, I_VM15)
1681 	NET_C(R191.2, R192.1, GND)
1682 	NET_C(R192.2, Q32.B)
1683 	NET_C(Q32.C, R193.1)
1684 	NET_C(R193.2, C72.2, R194.1)
1685 	NET_C(C72.1, I_VM15)
1686 	NET_C(R194.2, U67.5, R202.2)
1687 
1688 	NET_C(AS0_M, R195.1, R196.1)
1689 	NET_C(R195.2, I_V5, R197.2, Q33.E)
1690 	NET_C(R196.2, R197.1, Q33.B)
1691 	NET_C(Q33.C, R198.2, R199.1, Q34.E)
1692 	NET_C(R198.1, I_VM15)
1693 	NET_C(R199.2, R200.1, GND)
1694 	NET_C(R200.2, Q34.B)
1695 	NET_C(Q34.C, R201.1)
1696 	NET_C(R201.2, C73.2, R202.1)
1697 	NET_C(C73.1, I_VM15)
1698 
1699 	//
1700 	// Unconnected inputs
1701 	//
1702 
1703 	NET_C(U2.9, U2.11, U9.1, U9.4, U9.12, U9.13, U15.1, U15.2, U20.4, U20.6, U20.8, U20.10, U20.12, U33.8, U33.9, U33.10, U33.11, U35.5, U35.6, U40.1, U40.3, U40.5)
1704 
1705 	//
1706 	// Unconnected outputs
1707 	//
1708 
1709 	HINT(U2.8, NC)
1710 	HINT(U2.10, NC)
1711 	HINT(U40.2, NC)
1712 	HINT(U40.4, NC)
1713 	HINT(U40.6, NC)
1714 
1715 //    HINT(U2.9, NC)
1716 //    HINT(U2.11, NC)
1717 //    HINT(U24.4, NC)
1718 
1719 #if (ENABLE_FRONTIERS)
1720 	//
1721 	// Isolate the CS sounds from the rest of the mixer
1722 	//
1723 	OPTIMIZE_FRONTIER(U55.3, RES_M(1), 50)
1724 #endif
1725 
1726 NETLIST_END()
1727