Esempio n. 1
0
        //NETLIST_START(gunfight)
        public static void netlist_gunfight(netlist.nlparse_t setup)
        {
            netlist.helper h = new netlist.helper();

            h.NETLIST_START(setup);

            h.SOLVER("Solver", 48000);
            h.PARAM("Solver.SORT_TYPE", "ASCENDING");
            // For this netlist, ASCENDING turns out to be slightly faster than
            // the default sort type of PREFER_IDENTITY_TOP_LEFT, but the
            // difference when using static solvers is very small.

            h.LOCAL_SOURCE("gunfight_schematics", netlist_gunfight_schematics);

            h.INCLUDE("gunfight_schematics");

            // The amplifying transistors all get 16-volt power. The raw AC power
            // input from the main power supply to the game logic board is 16.5
            // volts, but this is rectified and regulated to about 16 volts via
            // TIP-31 power transistor Q301 and BZX61-C16 16-volt Zener diode
            // D304.
            h.ANALOG_INPUT("I_V16", 16); // 16-volt power for sound amplifiers
            h.ANALOG_INPUT("I_V5", 5);   // 5-volt power for logic input devices

            h.LOGIC_INPUT("I_LEFT_SHOT", 0, "74XX");
            h.LOGIC_INPUT("I_RIGHT_SHOT", 0, "74XX");
            h.LOGIC_INPUT("I_LEFT_HIT", 0, "74XX");
            h.LOGIC_INPUT("I_RIGHT_HIT", 0, "74XX");

            // Power and ground connections for logic input devices:
            h.NET_C("I_V5.Q",
                    "I_LEFT_SHOT.VCC", "I_RIGHT_SHOT.VCC",
                    "I_LEFT_HIT.VCC", "I_RIGHT_HIT.VCC");
            h.NET_C("GND",
                    "I_LEFT_SHOT.GND", "I_RIGHT_SHOT.GND",
                    "I_LEFT_HIT.GND", "I_RIGHT_HIT.GND");

            h.ALIAS("IN_LS", "I_LEFT_SHOT.Q");
            h.ALIAS("IN_RS", "I_RIGHT_SHOT.Q");
            h.ALIAS("IN_LH", "I_LEFT_HIT.Q");
            h.ALIAS("IN_RH", "I_RIGHT_HIT.Q");

#if USE_FRONTIERS
            // These frontiers keep the mostly independant halves of the circuit
            // (left channel and right channel) from affecting each other and the
            // noise generator, which speeds up processing substantially while
            // making no audible change in the output. These seem to be the only
            // frontiers which improve performance; I haven't been able to find
            // any additional beneficial ones from examining the circuit and
            // experimenting.
            h.OPTIMIZE_FRONTIER("C303.1", RES_M(1), 50);
            h.OPTIMIZE_FRONTIER("C306.1", RES_M(1), 50);
            h.OPTIMIZE_FRONTIER("C304.1", RES_M(1), 50);
            h.OPTIMIZE_FRONTIER("C305.1", RES_M(1), 50);
#endif

            h.NETLIST_END();
        }