static DISCRETE_RESET( skyraid_missle_custom_charge ) { struct skyraid_missle_custom_charge_context *context = (struct skyraid_missle_custom_charge_context *)node->context; /* everything is based on the input to the O.C. inverter */ /* the charging voltage across the cap */ context->v_charge[0] = 0; context->v_charge[1] = SKYRAID_MISSLE_CHARGE_PLUS * RES_VOLTAGE_DIVIDER(SKYRAID_MISSLE_CUSTOM_R1 + SKYRAID_MISSLE_CUSTOM_R2, SKYRAID_MISSLE_CUSTOM_R3); context->v_charge[1] = SKYRAID_MISSLE_CHARGE_PLUS - context->v_charge[1]; context->v_cap = 0; /* precalculate charging exponents */ /* discharge cap */ context->exp[0] = RC_CHARGE_EXP(SKYRAID_MISSLE_CUSTOM_R2 * SKYRAID_MISSLE_CUSTOM_C); /* charge cap */ context->exp[1] = RC_CHARGE_EXP(RES_2_PARALLEL(SKYRAID_MISSLE_CUSTOM_R1 + SKYRAID_MISSLE_CUSTOM_R2, SKYRAID_MISSLE_CUSTOM_R3) * SKYRAID_MISSLE_CUSTOM_C); /* starts at full voltage until cap starts charging */ node->output[0] = SKYRAID_MISSLE_CHARGE_PLUS; }
{ DISC_555_OUT_COUNT_F_X, 5, DEFAULT_555_VALUES }; static const discrete_555_desc sprint8_motor_555m_desc = { DISC_555_OUT_ENERGY | DISC_555_TRIGGER_IS_COUNT, 5, DEFAULT_555_VALUES }; static const discrete_op_amp_filt_info sprint8_motor_filter = { SPRINT8_R27, 0, SPRINT8_R28 + RES_2_PARALLEL(SPRINT8_R19, SPRINT8_R20), 0, SPRINT8_R29, /* r1, r2, r3, r4, rF, */ SPRINT8_C18, SPRINT8_C19, 0, /* c1, c2, c3, */ 5.0 * RES_VOLTAGE_DIVIDER(SPRINT8_R19, SPRINT8_R20), 5, 0 /* vRef, vP, vN */ }; static const discrete_mixer_desc sprint8_crash_screech_mixer = { DISC_MIXER_IS_RESISTOR, {SPRINT8_R149, SPRINT8_R91}, {0, NODE_80}, /* R93 switched in/out of circuit */ {0}, 0, 0, SPRINT8_C64, 0, 0, 1 /* c, rI, rF, cF, cAmp, vRef, gain */ }; static const discrete_mixer_desc sprint8_mixer = { DISC_MIXER_IS_RESISTOR, {SPRINT8_R1 + SPRINT8_R100, SPRINT8_R3, SPRINT8_R4}, {0}, {0}, 0, 0, 0, SPRINT8_C8, 0, 1 /* r_nodes, c, rI, rF, cF, cAmp, vRef, gain */
STARSHP1_C34, 5, -10, NODE_41, /* VPOS,VNEG,VCHARGE */ DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) DISCRETE_SWITCH(NODE_43, 1, /* ENAB */ STARSHP1_MOLVL, /* SWITCH */ STARSHP1_R59 + RES_2_PARALLEL(STARSHP1_R58, STARSHP1_R60 + STARSHP1_R76), STARSHP1_R59 + STARSHP1_R60 + STARSHP1_R76) DISCRETE_CRFILTER(NODE_44, NODE_42, /* IN0 */ NODE_43, /* RVAL*/ STARSHP1_C36) DISCRETE_SWITCH(NODE_45, /* gain affect of voltage divider */ 1, /* ENAB */ STARSHP1_MOLVL, /* SWITCH */ RES_VOLTAGE_DIVIDER(STARSHP1_R59, STARSHP1_R58), 1) DISCRETE_MULTIPLY( STARSHP1_MOTOR_SND, NODE_44, NODE_45) /************************************************ * SL1, SL2 ************************************************/ DISCRETE_MIXER2( NODE_50, /* voltage at R65 & R71 junction */ 1, /* ENAB */ STARSHP1_TONE_PITCH, /* IC E10, pin 12 */ 10, /* 10V to R71 */ &starshp1_555_b10_mix_r) DISCRETE_555_ASTABLE(NODE_51, /* IC B10, pin 3 */ 1, /* RESET */ RES_2_PARALLEL(STARSHP1_R65, STARSHP1_R71),
{ DISC_555_OUT_SQW, 5, DEFAULT_555_VALUES }; static const discrete_555_desc copsnrob_motor23_555_2 = { DISC_555_OUT_ENERGY | DISC_555_TRIGGER_IS_VOLTAGE, 5, DEFAULT_555_VALUES }; static const discrete_op_amp_filt_info copsnrob_motor23_filter = { COPSNROB_R28, 0, COPSNROB_R87, 0, COPSNROB_R86, /* r1, r2, r3, r4, rF */ COPSNROB_C42, COPSNROB_C43, 0, /* c1, c2, c3 */ 5.0 * RES_VOLTAGE_DIVIDER(COPSNROB_R88, COPSNROB_R89), 5, 0 /* vRef, vP, vN */ }; static const discrete_dac_r1_ladder copsnrob_crash_dac = { 4, /* ladderLength */ {COPSNROB_R81, COPSNROB_R82, COPSNROB_R79, COPSNROB_R80}, 0, 0, 0, COPSNROB_C58 /* vBias, rBias, rGnd, cFilter */ }; static const discrete_mixer_desc copsnrob_final_mixer01 = { DISC_MIXER_IS_RESISTOR, {COPSNROB_R21, COPSNROB_R25, COPSNROB_R33, COPSNROB_R70, COPSNROB_R71}, {0}, {0}, 0, COPSNROB_R35, 0, COPSNROB_C59, /* r_node{}, c{}, rI, rF, cF, cAmp */ 0, 1 /* vRef, gain */
node->output[0] = SKYRAID_MISSLE_CHARGE_PLUS; } static const discrete_custom_info skyraid_missle_custom_charge = { DISCRETE_CUSTOM_MODULE( skyraid_missle_custom_charge, struct skyraid_missle_custom_charge_context), NULL }; DISCRETE_SOUND_START( skyraid ) /************************************************ * Input register mapping ************************************************/ /* convert the PLANE_SWEEP line to voltage*/ DISCRETE_INPUTX_LOGIC(SKYRAID_PLANE_SWEEP_EN, DEFAULT_TTL_V_LOGIC_1 * RES_VOLTAGE_DIVIDER(SKYRAID_R25, SKYRAID_R24), 0, 0) DISCRETE_INPUT_LOGIC(SKYRAID_MISSILE_EN) DISCRETE_INPUT_LOGIC(SKYRAID_EXPLOSION_EN) /* convert PLANE_ON into 4066 Ron value of 270 ohms @ 5V */ DISCRETE_INPUTX_LOGIC(SKYRAID_PLANE_ON__IC_E8, 270, 0, 0) DISCRETE_INPUT_LOGIC(SKYRAID_ATTRACT_EN) /************************************************ * Noise Generator, Explosion sound ************************************************/ /* Note: the noise reset is not emulated 100% accurate */ /* According to the schematics, Attract only clears the lower 8 bits. */ /* I may modify the noise module in the future to properly emulate this, */ /* but you will never hear the difference. */ /* It only wrong for 8 cycles of the 555 while no sound is being generated. */ DISCRETE_LFSR_NOISE(SKYRAID_NOISE, /* IC F7, pin 13 */
static MACHINE_CONFIG_DERIVED_CLASS( laserbat, laserbat_base, laserbat_state ) // video hardware MCFG_PALETTE_ADD("palette", 256) MCFG_PALETTE_INIT_OWNER(laserbat_state, laserbat) // sound board devices MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("csg", SN76477, 0) // audio output not used MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(270), CAP_P(1000)) // R21, switchable R30/R23/R24/R25/R29/R28/R27/R26, C21 MCFG_SN76477_DECAY_RES(RES_INF) // NC MCFG_SN76477_ATTACK_PARAMS(0, RES_INF) // NC, NC MCFG_SN76477_AMP_RES(RES_K(47)) // R26 47k MCFG_SN76477_FEEDBACK_RES(RES_INF) // NC MCFG_SN76477_VCO_PARAMS(5.0 * RES_VOLTAGE_DIVIDER(RES_K(4.7), RES_K(2.2)), 0, RES_K(47)) // R22/R19, NC, switchable R47/R40/R41/R42/R46/R45/R44/R43 MCFG_SN76477_PITCH_VOLTAGE(5.0) // tied to Vreg MCFG_SN76477_SLF_PARAMS(CAP_U(4.7), RES_INF) // C24, switchable NC/R54/R53/R52/R51 MCFG_SN76477_ONESHOT_PARAMS(0, RES_INF) // NC, NC MCFG_SN76477_VCO_MODE(1) // BIT15 MCFG_SN76477_MIXER_PARAMS(0, 0, 0) // GND, VCO/NOISE, GND MCFG_SN76477_ENVELOPE_PARAMS(0, 1) // GND, Vreg MCFG_SN76477_ENABLE(0) // AB SOUND MCFG_TMS3615_ADD("synth_low", XTAL_4MHz/16/2) // from the other one's /2 clock output MCFG_SOUND_ROUTE(TMS3615_FOOTAGE_8, "mono", 1.0) MCFG_TMS3615_ADD("synth_high", XTAL_4MHz/16) // 4MHz divided down with a 74LS161 MCFG_SOUND_ROUTE(TMS3615_FOOTAGE_8, "mono", 1.0) MACHINE_CONFIG_END
M79AMB_R26, /* Q8 on */ M79AMB_C15) /* controls amplitude */ DISCRETE_NOISE(M79AMB_SHOT_SND, 1, /* ENAB */ 1000, /* FREQ - Guess*/ NODE_41, /* AMP */ 0) /* BIAS - fake AC is fine*/ /************************************************ * MC ************************************************/ /* not the best implementation of the pin 5 charge circuit, but it is within tolerance */ DISCRETE_RCDISC2(NODE_50, M79AMB_MC_REV_EN, /* R35 can be ignored on discharge */ RES_VOLTAGE_DIVIDER(M79AMB_R36 + M79AMB_R37, M79AMB_R38) * 12, /* Q12 on */ RES_2_PARALLEL(M79AMB_R36 + M79AMB_R37, M79AMB_R38), /* Q12 on */ 12.0 * RES_VOLTAGE_DIVIDER(M79AMB_R36, M79AMB_R35), /* Q12 off */ RES_2_PARALLEL(M79AMB_R36, M79AMB_R35) + M79AMB_R37, /* Q12 off */ M79AMB_C20) /* cap charge to B+ ratio changes voltage on pin 5 */ /* (iR36 + iR35 + iR37) * R36||R35||R37 where iR35 = 0/R35 = 0 */ DISCRETE_TRANSFORM4(NODE_51, 12.0 / M79AMB_R36, NODE_50, M79AMB_R37, RES_3_PARALLEL(M79AMB_R36, M79AMB_R35, M79AMB_R37), "012/+3*") DISCRETE_566(NODE_52, /* IC U3, pin 4 */ NODE_51, /* IC U3, pin 5 */ M79AMB_R39, M79AMB_C21, 12, 0, 12, /* VPOS,VNEG,VCHARGE */ DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) DISCRETE_CRFILTER(NODE_53, NODE_52, M79AMB_R41 + M79AMB_R42 + M79AMB_R43, M79AMB_C22) DISCRETE_MULTIPLY(NODE_54, NODE_53, M79AMB_MC_CONTROL_EN)