mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
mw8080bw.cpp: move clowns/spacwalk into their own class - all the games should run at this point (nw)
This commit is contained in:
parent
b33785affb
commit
3e58602c22
@ -563,6 +563,7 @@ DEFINE_DEVICE_TYPE(DESERTGU_AUDIO, desertgu_audio_device, "desertgu_audio", "Mid
|
||||
DEFINE_DEVICE_TYPE(GMISSILE_AUDIO, gmissile_audio_device, "gmissile_audio", "Midway Guided Missile Audio")
|
||||
DEFINE_DEVICE_TYPE(M4_AUDIO, m4_audio_device, "m4_audio", "Midway M-4 Audio")
|
||||
DEFINE_DEVICE_TYPE(CLOWNS_AUDIO, clowns_audio_device, "clowns_audio", "Midway Clowns Audio")
|
||||
DEFINE_DEVICE_TYPE(SPACWALK_AUDIO, spacwalk_audio_device, "spacwalk_audio", "Midway Space Walk Audio")
|
||||
DEFINE_DEVICE_TYPE(SPCENCTR_AUDIO, spcenctr_audio_device, "spcenctr_audio", "Midway Space Encounters Audio")
|
||||
DEFINE_DEVICE_TYPE(PHANTOM2_AUDIO, phantom2_audio_device, "phantom2_audio", "Midway Phantom 2 Audio")
|
||||
DEFINE_DEVICE_TYPE(INVADERS_AUDIO, invaders_audio_device, "invaders_audio", "Taito Space Invaders Audio")
|
||||
@ -999,6 +1000,7 @@ void desertgu_audio_device::p2_w(u8 data)
|
||||
void desertgu_audio_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
DISCRETE(config, m_discrete, desertgu_discrete);
|
||||
m_discrete->add_route(ALL_OUTPUTS, "mono", 0.8);
|
||||
}
|
||||
@ -1453,6 +1455,388 @@ void clowns_audio_device::device_start()
|
||||
}
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Space Walk
|
||||
*
|
||||
* Discrete sound emulation: Oct 2009, D.R.
|
||||
*
|
||||
*************************************/
|
||||
|
||||
// Discrete Sound Input Nodes
|
||||
#define SPACWALK_TARGET_HIT_BOTTOM_EN NODE_01
|
||||
#define SPACWALK_TARGET_HIT_MIDDLE_EN NODE_02
|
||||
#define SPACWALK_TARGET_HIT_TOP_EN NODE_03
|
||||
#define SPACWALK_SPRINGBOARD_HIT1_EN NODE_04
|
||||
#define SPACWALK_SPRINGBOARD_HIT2_EN NODE_05
|
||||
#define SPACWALK_SPRINGBOARD_MISS_EN NODE_06
|
||||
#define SPACWALK_SPACE_SHIP_EN NODE_07
|
||||
|
||||
// Discrete Sound Output Nodes
|
||||
#define SPACWALK_NOISE NODE_10
|
||||
#define SPACWALK_TARGET_HIT_SND NODE_11
|
||||
#define SPACWALK_SPRINGBOARD_HIT1_SND NODE_12
|
||||
#define SPACWALK_SPRINGBOARD_HIT2_SND NODE_13
|
||||
#define SPACWALK_SPRINGBOARD_MISS_SND NODE_14
|
||||
#define SPACWALK_SPACE_SHIP_SND NODE_15
|
||||
|
||||
// Adjusters
|
||||
#define SPACWALK_R507_POT NODE_19
|
||||
|
||||
// Parts List - Resistors
|
||||
#define SPACWALK_R200 RES_K(820)
|
||||
#define SPACWALK_R201 RES_K(150)
|
||||
#define SPACWALK_R202 RES_M(1)
|
||||
#define SPACWALK_R203 RES_K(82)
|
||||
#define SPACWALK_R204 RES_K(240)
|
||||
#define SPACWALK_R205 RES_K(220)
|
||||
#define SPACWALK_R206 RES_K(120)
|
||||
#define SPACWALK_R207 RES_M(1)
|
||||
#define SPACWALK_R208 RES_K(300)
|
||||
#define SPACWALK_R210 RES_K(56)
|
||||
#define SPACWALK_R211 RES_K(100)
|
||||
#define SPACWALK_R213 RES_K(300)
|
||||
#define SPACWALK_R214 RES_K(27)
|
||||
#define SPACWALK_R215 RES_K(51)
|
||||
#define SPACWALK_R216 RES_K(30)
|
||||
#define SPACWALK_R300 RES_K(270)
|
||||
#define SPACWALK_R301 RES_K(300)
|
||||
#define SPACWALK_R302 RES_K(330)
|
||||
#define SPACWALK_R303 RES_K(680)
|
||||
#define SPACWALK_R304 RES_M(1)
|
||||
#define SPACWALK_R305 RES_K(3680)
|
||||
#define SPACWALK_R307 RES_K(20)
|
||||
#define SPACWALK_R308 RES_K(20) // not labeled but it's beside R307
|
||||
#define SPACWALK_R400 RES_K(1)
|
||||
#define SPACWALK_R401 RES_K(200)
|
||||
#define SPACWALK_R403 RES_K(51)
|
||||
#define SPACWALK_R404 RES_K(220)
|
||||
#define SPACWALK_R406 RES_M(1)
|
||||
#define SPACWALK_R407 RES_K(820)
|
||||
#define SPACWALK_R410 RES_K(47)
|
||||
#define SPACWALK_R411 RES_K(300)
|
||||
#define SPACWALK_R412 RES_K(330)
|
||||
#define SPACWALK_R413 RES_M(1)
|
||||
#define SPACWALK_R414 RES_M(1)
|
||||
#define SPACWALK_R416 RES_M(4.7)
|
||||
#define SPACWALK_R417 RES_K(10)
|
||||
#define SPACWALK_R418 RES_K(100)
|
||||
#define SPACWALK_R419 RES_K(2.7)
|
||||
#define SPACWALK_R420 RES_K(20)
|
||||
#define SPACWALK_R421 RES_K(11)
|
||||
#define SPACWALK_R422 RES_K(75)
|
||||
#define SPACWALK_R507 RES_M(1)
|
||||
#define SPACWALK_RJ3 RES_K(1)
|
||||
|
||||
// Parts List - Capacitors
|
||||
#define SPACWALK_C200 CAP_U(0.0022)
|
||||
#define SPACWALK_C201 CAP_U(3.3)
|
||||
#define SPACWALK_C203 CAP_U(0.0033)
|
||||
#define SPACWALK_C204 CAP_U(0.0033)
|
||||
#define SPACWALK_C300 CAP_U(2.2)
|
||||
#define SPACWALK_C301 CAP_U(2.2)
|
||||
#define SPACWALK_C302 CAP_U(2.2)
|
||||
#define SPACWALK_C303 CAP_U(0.0047)
|
||||
#define SPACWALK_C304 CAP_U(0.0047) // not labeled but it's beside C303
|
||||
#define SPACWALK_C401 CAP_U(1)
|
||||
#define SPACWALK_C402 CAP_U(0.68)
|
||||
#define SPACWALK_C403 CAP_U(0.0022)
|
||||
#define SPACWALK_C451 CAP_U(0.001)
|
||||
#define SPACWALK_C452 CAP_U(0.001)
|
||||
#define SPACWALK_C453 CAP_U(0.001)
|
||||
#define SPACWALK_C602 CAP_U(1)
|
||||
|
||||
static discrete_op_amp_tvca_info const spacwalk_hit_tvca_info =
|
||||
{
|
||||
SPACWALK_R304, SPACWALK_R303, 0, SPACWALK_R305, // r1, r2, r3, r4
|
||||
SPACWALK_RJ3, 0, SPACWALK_R300, // r5, r6, r7
|
||||
SPACWALK_RJ3, SPACWALK_R301, // r8, r9
|
||||
SPACWALK_RJ3, SPACWALK_R302, // r10, r11
|
||||
SPACWALK_C300, SPACWALK_C301, SPACWALK_C302, 0, // c1, c2, c3, c4
|
||||
5, 5, 5, 12, // v1, v2, v3, vP
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_TRG0,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_TRG1,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_TRG2
|
||||
};
|
||||
|
||||
static discrete_op_amp_osc_info const spacwalk_sb_hit_vco =
|
||||
{
|
||||
DISC_OP_AMP_OSCILLATOR_VCO_3 | DISC_OP_AMP_IS_NORTON,
|
||||
RES_K(330 + 150 + 30), SPACWALK_R203, SPACWALK_R201, SPACWALK_R204, // r1, r2, r3, r4
|
||||
SPACWALK_R202, 0, SPACWALK_R200, 0, // r5, r6, r7, r8
|
||||
SPACWALK_C200, 12 // c, vP
|
||||
};
|
||||
|
||||
static discrete_op_amp_tvca_info const spacwalk_sb_hit_tvca_info =
|
||||
{
|
||||
SPACWALK_R207, SPACWALK_R205, 0, SPACWALK_R208, // r1, r2, r3, r4
|
||||
SPACWALK_RJ3, 0, SPACWALK_R206, // r5, r6, r7
|
||||
0, 0, 0, 0 , // r8, r9, r10, r11
|
||||
SPACWALK_C201, 0, 0, 0, // c1, c2, c3, c4
|
||||
5, 0, 0, 12, // v1, v2, v3, vP
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_TRG0,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE
|
||||
};
|
||||
|
||||
static discrete_integrate_info const spacwalk_sb_miss_integrate =
|
||||
{
|
||||
DISC_INTEGRATE_OP_AMP_1 | DISC_OP_AMP_IS_NORTON,
|
||||
SPACWALK_R406, SPACWALK_R401, 0, SPACWALK_C402, // r1, r2, r3, c
|
||||
12, 12, // v1, vP
|
||||
0, 0, 0 // f0, f1, f2
|
||||
};
|
||||
|
||||
static discrete_op_amp_osc_info const spacwalk_sb_miss_vco =
|
||||
{
|
||||
DISC_OP_AMP_OSCILLATOR_VCO_3 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_SQW,
|
||||
SPACWALK_R407, SPACWALK_R412, SPACWALK_R410, SPACWALK_R411, SPACWALK_R413, 0, 0, 0, // r1, r2, r3, r4, r5, r6, r7, r8
|
||||
SPACWALK_C403, 12 // c, vP
|
||||
};
|
||||
|
||||
static discrete_op_amp_filt_info const spacwalk_sb_miss_filter =
|
||||
{
|
||||
// we use r1, not r2 because vref is taken into acount by the CRFILTER
|
||||
SPACWALK_R417, 0, SPACWALK_R414, 0, SPACWALK_R416, // r1, r2, r3, r4, rF
|
||||
SPACWALK_C451, SPACWALK_C452, 0, // c1, c2, c3
|
||||
0, 12, 0 // vRef, vP, vN
|
||||
};
|
||||
|
||||
static discrete_op_amp_info const spacwalk_sb_miss_amp =
|
||||
{
|
||||
DISC_OP_AMP_IS_NORTON,
|
||||
SPACWALK_R418, SPACWALK_R404, 0, SPACWALK_R403, /* r1, r2, r3, r4 */
|
||||
0, /* c */
|
||||
0, 12, /* vN, vP */
|
||||
};
|
||||
|
||||
static discrete_op_amp_osc_info const spacwalk_spaceship_osc =
|
||||
{
|
||||
DISC_OP_AMP_OSCILLATOR_2 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP,
|
||||
RES_K(75), RES_M(1), RES_M(6.8), RES_M(2.4), 0, 0, 0, 0, // r1, r2, r3, r4, r5, r6, r7, r8
|
||||
CAP_U(2.2), 12 // c, vP
|
||||
};
|
||||
|
||||
static discrete_op_amp_osc_info const spacwalk_spaceship_vco =
|
||||
{
|
||||
DISC_OP_AMP_OSCILLATOR_VCO_1 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP,
|
||||
RES_K(680), RES_K(300), RES_K(100), RES_K(150), RES_K(120), 0, 0, 0, // r1, r2, r3, r4, r5, r6, r7, r8
|
||||
CAP_U(0.0012), 12 // c, vP
|
||||
};
|
||||
|
||||
static discrete_mixer_desc const spacwalk_mixer =
|
||||
{
|
||||
DISC_MIXER_IS_RESISTOR,
|
||||
{SPACWALK_R422, SPACWALK_R422, RES_K(39 + 10 + 1), SPACWALK_R421, SPACWALK_R420, SPACWALK_R419},
|
||||
{0, 0, 0, 0, 0, SPACWALK_R507_POT}, // r_nodes
|
||||
{0}, 0, 0, 0, SPACWALK_C602, 0, 1 // c, rI, rF, cF, cAmp, vRef, gain
|
||||
};
|
||||
|
||||
|
||||
/************************************************
|
||||
* Springboard Hit Circuit 1 or 2
|
||||
************************************************/
|
||||
#define SPACWALK_SPRINGBOARD_HIT_CIRCUIT(_num) \
|
||||
DISCRETE_RCFILTER(NODE_RELATIVE(NODE_29, _num), \
|
||||
SPACWALK_NOISE, /* IN0 */ \
|
||||
RES_K(330), CAP_U(.1)) \
|
||||
DISCRETE_RCFILTER(NODE_RELATIVE(NODE_31, _num), \
|
||||
NODE_RELATIVE(NODE_29, _num), /* IN0 */ \
|
||||
RES_K(330) + RES_K(150), CAP_U(.1)) \
|
||||
DISCRETE_OP_AMP_VCO1(NODE_RELATIVE(NODE_33, _num), /* IC M2-3, pin 5 */ \
|
||||
1, /* ENAB */ \
|
||||
NODE_RELATIVE(NODE_31, _num), /* VMOD1 */ \
|
||||
&spacwalk_sb_hit_vco) \
|
||||
DISCRETE_OP_AMP_TRIG_VCA(NODE_RELATIVE(NODE_35, _num), /* IC M2-3, pin 9 */ \
|
||||
NODE_RELATIVE(SPACWALK_SPRINGBOARD_HIT1_EN, _num - 1), 0, 0, /* TRG0, TRG1, TRG2 */ \
|
||||
NODE_RELATIVE(NODE_33, _num), 0, /* IN0, IN1 */ \
|
||||
&spacwalk_sb_hit_tvca_info) \
|
||||
/* Wrong values. Untested */ \
|
||||
/* The rest of the circuit is a filter. */ \
|
||||
DISCRETE_FILTER2(NODE_RELATIVE(NODE_37, _num), \
|
||||
1, /* ENAB */ \
|
||||
NODE_RELATIVE(NODE_35, _num), /* INP0 */ \
|
||||
2000.0 - _num * 500, 1.0/.8, /* FREQ, DAMP */ \
|
||||
DISC_FILTER_LOWPASS) \
|
||||
/* The filter has a gain of 0.5 */ \
|
||||
DISCRETE_GAIN(NODE_RELATIVE(SPACWALK_SPRINGBOARD_HIT1_SND, _num - 1), \
|
||||
NODE_RELATIVE(NODE_37, _num), 0.5)
|
||||
|
||||
static DISCRETE_SOUND_START(spacwalk_discrete)
|
||||
|
||||
/************************************************
|
||||
* Input register mapping
|
||||
************************************************/
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_TARGET_HIT_BOTTOM_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_TARGET_HIT_MIDDLE_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_TARGET_HIT_TOP_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_SPRINGBOARD_HIT1_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_SPRINGBOARD_HIT2_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_SPRINGBOARD_MISS_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_SPACE_SHIP_EN)
|
||||
|
||||
// The low value of the pot is set to 7000. A real 1M pot will never go to 0 anyways.
|
||||
// This will give the control more apparent volume range.
|
||||
// The music way overpowers the rest of the sounds anyways.
|
||||
DISCRETE_ADJUSTMENT(SPACWALK_R507_POT, SPACWALK_R507, 7000, DISC_LOGADJ, "R507")
|
||||
|
||||
/************************************************
|
||||
* Tone generator
|
||||
************************************************/
|
||||
MIDWAY_TONE_GENERATOR(midway_music_tvca_info)
|
||||
|
||||
/************************************************
|
||||
* Target hit sounds
|
||||
* The LFSR is the same as boothill
|
||||
************************************************/
|
||||
// Noise clock was breadboarded and measured at 7700Hz
|
||||
DISCRETE_LFSR_NOISE(SPACWALK_NOISE, // IC L4, pin 10
|
||||
1, 1, // ENAB, RESET
|
||||
7700, 12.0, 0, 12.0/2, &midway_lfsr) // CLK,AMPL,FEED,BIAS,LFSRTB
|
||||
|
||||
DISCRETE_OP_AMP_TRIG_VCA(NODE_20, // IC K3, pin 9
|
||||
SPACWALK_TARGET_HIT_TOP_EN, SPACWALK_TARGET_HIT_MIDDLE_EN, SPACWALK_TARGET_HIT_BOTTOM_EN,
|
||||
SPACWALK_NOISE, 0, // IN0, IN1
|
||||
&spacwalk_hit_tvca_info)
|
||||
DISCRETE_RCFILTER(NODE_21,
|
||||
NODE_20, // IN0
|
||||
SPACWALK_R307, SPACWALK_C303)
|
||||
DISCRETE_RCFILTER(SPACWALK_TARGET_HIT_SND,
|
||||
NODE_21, // IN0
|
||||
SPACWALK_R307 + SPACWALK_R308, SPACWALK_C304)
|
||||
|
||||
/************************************************
|
||||
* Springboard hit sounds
|
||||
************************************************/
|
||||
/* Nodes 30 - 40 */
|
||||
SPACWALK_SPRINGBOARD_HIT_CIRCUIT(1)
|
||||
SPACWALK_SPRINGBOARD_HIT_CIRCUIT(2)
|
||||
|
||||
/************************************************
|
||||
* Springboard miss sound
|
||||
************************************************/
|
||||
DISCRETE_RCDISC2(NODE_50, // voltage on C401
|
||||
SPACWALK_SPRINGBOARD_MISS_EN, // SWITCH
|
||||
OP_AMP_NORTON_VBE, RES_2_PARALLEL(SPACWALK_R401, SPACWALK_R407), // INP0,RVAL0
|
||||
12.0 - .5, SPACWALK_R400, // INP1,RVAL1
|
||||
SPACWALK_C401)
|
||||
DISCRETE_INTEGRATE(NODE_51, // IC K4, pin 9
|
||||
NODE_50, 0, // TRG0,TRG1
|
||||
&spacwalk_sb_miss_integrate)
|
||||
DISCRETE_OP_AMP_VCO1(NODE_52, // IC K4, pin 5
|
||||
1, // ENAB
|
||||
NODE_50, // VMOD1
|
||||
&spacwalk_sb_miss_vco)
|
||||
DISCRETE_CRFILTER(NODE_53,
|
||||
NODE_52, // IN0
|
||||
SPACWALK_R417, SPACWALK_C453)
|
||||
// this filter type probably does not work right. I need to test it.
|
||||
DISCRETE_OP_AMP_FILTER(NODE_54, // IC K3, pin 5
|
||||
1, // ENAB
|
||||
NODE_53, 0, // INP0,INP1
|
||||
DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON, &spacwalk_sb_miss_filter)
|
||||
DISCRETE_OP_AMP(SPACWALK_SPRINGBOARD_MISS_SND, // IC K4, pin 10
|
||||
1, // ENAB
|
||||
NODE_54, NODE_51, // IN0,IN1
|
||||
&spacwalk_sb_miss_amp)
|
||||
|
||||
/************************************************
|
||||
* Space ship sound
|
||||
************************************************/
|
||||
DISCRETE_OP_AMP_OSCILLATOR(NODE_60, // voltage on 2.2uF cap near IC JK-2
|
||||
1, // ENAB
|
||||
&spacwalk_spaceship_osc)
|
||||
DISCRETE_OP_AMP_VCO1(NODE_61, // IC JK-2, pin 5
|
||||
SPACWALK_SPACE_SHIP_EN, // ENAB
|
||||
NODE_60, // VMOD1
|
||||
&spacwalk_spaceship_vco)
|
||||
DISCRETE_RCFILTER(NODE_62,
|
||||
NODE_61, // IN0
|
||||
RES_K(1), CAP_U(0.15))
|
||||
DISCRETE_RCFILTER(SPACWALK_SPACE_SHIP_SND,
|
||||
NODE_62, // IN0
|
||||
RES_K(1) + RES_K(10), CAP_U(0.015))
|
||||
|
||||
/************************************************
|
||||
* Combine all sound sources.
|
||||
************************************************/
|
||||
DISCRETE_MIXER6(NODE_90,
|
||||
1, // ENAB
|
||||
SPACWALK_SPRINGBOARD_HIT1_SND,
|
||||
SPACWALK_SPRINGBOARD_HIT2_SND,
|
||||
SPACWALK_SPACE_SHIP_SND,
|
||||
SPACWALK_SPRINGBOARD_MISS_SND,
|
||||
SPACWALK_TARGET_HIT_SND,
|
||||
MIDWAY_TONE_SND,
|
||||
&spacwalk_mixer)
|
||||
DISCRETE_OUTPUT(NODE_90, 11000)
|
||||
DISCRETE_SOUND_END
|
||||
|
||||
static INPUT_PORTS_START(spacwalk_audio)
|
||||
PORT_START("R507")
|
||||
PORT_ADJUSTER( 40, "R507 - Music Volume" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
spacwalk_audio_device::spacwalk_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
midway_tone_generator_device_base(mconfig, SPACWALK_AUDIO, tag, owner, clock),
|
||||
m_ctrl_sel_out(*this),
|
||||
m_p1(0U)
|
||||
{
|
||||
}
|
||||
|
||||
void spacwalk_audio_device::p1_w(u8 data)
|
||||
{
|
||||
u8 const changed(data ^ m_p1);
|
||||
m_p1 = data;
|
||||
|
||||
machine().bookkeeping().coin_counter_w(0, BIT(data, 0));
|
||||
|
||||
if (BIT(changed, 1)) m_ctrl_sel_out(BIT(data, 1));
|
||||
|
||||
machine().sound().system_enable(BIT(data, 2));
|
||||
|
||||
m_discrete->write(SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
|
||||
}
|
||||
|
||||
void spacwalk_audio_device::p2_w(u8 data)
|
||||
{
|
||||
m_discrete->write(SPACWALK_TARGET_HIT_BOTTOM_EN, (data >> 0) & 0x01);
|
||||
m_discrete->write(SPACWALK_TARGET_HIT_MIDDLE_EN, (data >> 1) & 0x01);
|
||||
m_discrete->write(SPACWALK_TARGET_HIT_TOP_EN, (data >> 2) & 0x01);
|
||||
m_discrete->write(SPACWALK_SPRINGBOARD_HIT1_EN, (data >> 3) & 0x01);
|
||||
m_discrete->write(SPACWALK_SPRINGBOARD_HIT2_EN, (data >> 4) & 0x01);
|
||||
m_discrete->write(SPACWALK_SPRINGBOARD_MISS_EN, (data >> 5) & 0x01);
|
||||
}
|
||||
|
||||
void spacwalk_audio_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
DISCRETE(config, m_discrete, spacwalk_discrete);
|
||||
m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0);
|
||||
}
|
||||
|
||||
ioport_constructor spacwalk_audio_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME(spacwalk_audio);
|
||||
}
|
||||
|
||||
void spacwalk_audio_device::device_start()
|
||||
{
|
||||
m_ctrl_sel_out.resolve();
|
||||
|
||||
m_p1 = 0U;
|
||||
|
||||
save_item(NAME(m_p1));
|
||||
}
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Space Encounters
|
||||
@ -3504,366 +3888,6 @@ WRITE8_MEMBER(mw8080bw_state::dplay_audio_w)
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Space Walk
|
||||
*
|
||||
* Discrete sound emulation: Oct 2009, D.R.
|
||||
*
|
||||
*************************************/
|
||||
|
||||
/* Discrete Sound Input Nodes */
|
||||
#define SPACWALK_TARGET_HIT_BOTTOM_EN NODE_01
|
||||
#define SPACWALK_TARGET_HIT_MIDDLE_EN NODE_02
|
||||
#define SPACWALK_TARGET_HIT_TOP_EN NODE_03
|
||||
#define SPACWALK_SPRINGBOARD_HIT1_EN NODE_04
|
||||
#define SPACWALK_SPRINGBOARD_HIT2_EN NODE_05
|
||||
#define SPACWALK_SPRINGBOARD_MISS_EN NODE_06
|
||||
#define SPACWALK_SPACE_SHIP_EN NODE_07
|
||||
|
||||
/* Discrete Sound Output Nodes */
|
||||
#define SPACWALK_NOISE NODE_10
|
||||
#define SPACWALK_TARGET_HIT_SND NODE_11
|
||||
#define SPACWALK_SPRINGBOARD_HIT1_SND NODE_12
|
||||
#define SPACWALK_SPRINGBOARD_HIT2_SND NODE_13
|
||||
#define SPACWALK_SPRINGBOARD_MISS_SND NODE_14
|
||||
#define SPACWALK_SPACE_SHIP_SND NODE_15
|
||||
|
||||
/* Adjusters */
|
||||
#define SPACWALK_R507_POT NODE_19
|
||||
|
||||
/* Parts List - Resistors */
|
||||
#define SPACWALK_R200 RES_K(820)
|
||||
#define SPACWALK_R201 RES_K(150)
|
||||
#define SPACWALK_R202 RES_M(1)
|
||||
#define SPACWALK_R203 RES_K(82)
|
||||
#define SPACWALK_R204 RES_K(240)
|
||||
#define SPACWALK_R205 RES_K(220)
|
||||
#define SPACWALK_R206 RES_K(120)
|
||||
#define SPACWALK_R207 RES_M(1)
|
||||
#define SPACWALK_R208 RES_K(300)
|
||||
#define SPACWALK_R210 RES_K(56)
|
||||
#define SPACWALK_R211 RES_K(100)
|
||||
#define SPACWALK_R213 RES_K(300)
|
||||
#define SPACWALK_R214 RES_K(27)
|
||||
#define SPACWALK_R215 RES_K(51)
|
||||
#define SPACWALK_R216 RES_K(30)
|
||||
#define SPACWALK_R300 RES_K(270)
|
||||
#define SPACWALK_R301 RES_K(300)
|
||||
#define SPACWALK_R302 RES_K(330)
|
||||
#define SPACWALK_R303 RES_K(680)
|
||||
#define SPACWALK_R304 RES_M(1)
|
||||
#define SPACWALK_R305 RES_K(3680)
|
||||
#define SPACWALK_R307 RES_K(20)
|
||||
#define SPACWALK_R308 RES_K(20) /* not labeled but it's beside R307 */
|
||||
#define SPACWALK_R400 RES_K(1)
|
||||
#define SPACWALK_R401 RES_K(200)
|
||||
#define SPACWALK_R403 RES_K(51)
|
||||
#define SPACWALK_R404 RES_K(220)
|
||||
#define SPACWALK_R406 RES_M(1)
|
||||
#define SPACWALK_R407 RES_K(820)
|
||||
#define SPACWALK_R410 RES_K(47)
|
||||
#define SPACWALK_R411 RES_K(300)
|
||||
#define SPACWALK_R412 RES_K(330)
|
||||
#define SPACWALK_R413 RES_M(1)
|
||||
#define SPACWALK_R414 RES_M(1)
|
||||
#define SPACWALK_R416 RES_M(4.7)
|
||||
#define SPACWALK_R417 RES_K(10)
|
||||
#define SPACWALK_R418 RES_K(100)
|
||||
#define SPACWALK_R419 RES_K(2.7)
|
||||
#define SPACWALK_R420 RES_K(20)
|
||||
#define SPACWALK_R421 RES_K(11)
|
||||
#define SPACWALK_R422 RES_K(75)
|
||||
#define SPACWALK_R507 RES_M(1)
|
||||
#define SPACWALK_RJ3 RES_K(1)
|
||||
|
||||
/* Parts List - Capacitors */
|
||||
#define SPACWALK_C200 CAP_U(0.0022)
|
||||
#define SPACWALK_C201 CAP_U(3.3)
|
||||
#define SPACWALK_C203 CAP_U(0.0033)
|
||||
#define SPACWALK_C204 CAP_U(0.0033)
|
||||
#define SPACWALK_C300 CAP_U(2.2)
|
||||
#define SPACWALK_C301 CAP_U(2.2)
|
||||
#define SPACWALK_C302 CAP_U(2.2)
|
||||
#define SPACWALK_C303 CAP_U(0.0047)
|
||||
#define SPACWALK_C304 CAP_U(0.0047) /* not labeled but it's beside C303 */
|
||||
#define SPACWALK_C401 CAP_U(1)
|
||||
#define SPACWALK_C402 CAP_U(0.68)
|
||||
#define SPACWALK_C403 CAP_U(0.0022)
|
||||
#define SPACWALK_C451 CAP_U(0.001)
|
||||
#define SPACWALK_C452 CAP_U(0.001)
|
||||
#define SPACWALK_C453 CAP_U(0.001)
|
||||
#define SPACWALK_C602 CAP_U(1)
|
||||
|
||||
|
||||
static const discrete_op_amp_tvca_info spacwalk_hit_tvca_info =
|
||||
{
|
||||
SPACWALK_R304, SPACWALK_R303, 0, SPACWALK_R305, /* r1, r2, r3, r4 */
|
||||
SPACWALK_RJ3, 0, SPACWALK_R300, /* r5, r6, r7 */
|
||||
SPACWALK_RJ3, SPACWALK_R301, /* r8, r9 */
|
||||
SPACWALK_RJ3, SPACWALK_R302, /* r10, r11 */
|
||||
SPACWALK_C300, SPACWALK_C301, SPACWALK_C302, 0, /* c1, c2, c3, c4 */
|
||||
5, 5, 5, 12, /* v1, v2, v3, vP */
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_TRG0,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_TRG1,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_TRG2
|
||||
};
|
||||
|
||||
static const discrete_op_amp_osc_info spacwalk_sb_hit_vco =
|
||||
{
|
||||
DISC_OP_AMP_OSCILLATOR_VCO_3 | DISC_OP_AMP_IS_NORTON,
|
||||
RES_K(330 + 150 + 30), SPACWALK_R203, SPACWALK_R201, SPACWALK_R204, /* r1, r2, r3, r4 */
|
||||
SPACWALK_R202, 0, SPACWALK_R200, 0, /* r5, r6, r7, r8*/
|
||||
SPACWALK_C200, 12 /* c, vP*/
|
||||
};
|
||||
|
||||
static const discrete_op_amp_tvca_info spacwalk_sb_hit_tvca_info =
|
||||
{
|
||||
SPACWALK_R207, SPACWALK_R205, 0, SPACWALK_R208, /* r1, r2, r3, r4 */
|
||||
SPACWALK_RJ3, 0, SPACWALK_R206, /* r5, r6, r7 */
|
||||
0, 0, 0, 0 , /* r8, r9, r10, r11 */
|
||||
SPACWALK_C201, 0, 0, 0, /* c1, c2, c3, c4 */
|
||||
5, 0, 0, 12, /* v1, v2, v3, vP */
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_TRG0,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
|
||||
DISC_OP_AMP_TRIGGER_FUNCTION_NONE
|
||||
};
|
||||
|
||||
static const discrete_integrate_info spacwalk_sb_miss_integrate =
|
||||
{
|
||||
DISC_INTEGRATE_OP_AMP_1 | DISC_OP_AMP_IS_NORTON,
|
||||
SPACWALK_R406, SPACWALK_R401, 0, SPACWALK_C402, /* r1, r2, r3, c */
|
||||
12, 12, /* v1, vP */
|
||||
0, 0, 0 /* f0, f1, f2 */
|
||||
};
|
||||
|
||||
static const discrete_op_amp_osc_info spacwalk_sb_miss_vco =
|
||||
{
|
||||
DISC_OP_AMP_OSCILLATOR_VCO_3 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_SQW,
|
||||
SPACWALK_R407, SPACWALK_R412, SPACWALK_R410, SPACWALK_R411, SPACWALK_R413, 0, 0, 0, /* r1, r2, r3, r4, r5, r6, r7, r8 */
|
||||
SPACWALK_C403, 12 /* c, vP */
|
||||
};
|
||||
|
||||
static const discrete_op_amp_filt_info spacwalk_sb_miss_filter =
|
||||
{
|
||||
/* we use r1, not r2 because vref is taken into acount by the CRFILTER */
|
||||
SPACWALK_R417, 0, SPACWALK_R414, 0, SPACWALK_R416, /* r1, r2, r3, r4, rF */
|
||||
SPACWALK_C451, SPACWALK_C452, 0, /* c1, c2, c3 */
|
||||
0, 12, 0 /* vRef, vP, vN */
|
||||
};
|
||||
|
||||
static const discrete_op_amp_info spacwalk_sb_miss_amp =
|
||||
{
|
||||
DISC_OP_AMP_IS_NORTON,
|
||||
SPACWALK_R418, SPACWALK_R404, 0, SPACWALK_R403, /* r1, r2, r3, r4 */
|
||||
0, /* c */
|
||||
0, 12, /* vN, vP */
|
||||
};
|
||||
|
||||
static const discrete_op_amp_osc_info spacwalk_spaceship_osc =
|
||||
{
|
||||
DISC_OP_AMP_OSCILLATOR_2 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP,
|
||||
RES_K(75), RES_M(1), RES_M(6.8), RES_M(2.4), 0, 0, 0, 0, /* r1, r2, r3, r4, r5, r6, r7, r8 */
|
||||
CAP_U(2.2), 12 /* c, vP */
|
||||
};
|
||||
|
||||
static const discrete_op_amp_osc_info spacwalk_spaceship_vco =
|
||||
{
|
||||
DISC_OP_AMP_OSCILLATOR_VCO_1 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP,
|
||||
RES_K(680), RES_K(300), RES_K(100), RES_K(150), RES_K(120), 0, 0, 0, /* r1, r2, r3, r4, r5, r6, r7, r8 */
|
||||
CAP_U(0.0012), 12 /* c, vP */
|
||||
};
|
||||
|
||||
static const discrete_mixer_desc spacwalk_mixer =
|
||||
{
|
||||
DISC_MIXER_IS_RESISTOR,
|
||||
{SPACWALK_R422, SPACWALK_R422, RES_K(39 + 10 + 1), SPACWALK_R421, SPACWALK_R420, SPACWALK_R419},
|
||||
{0, 0, 0, 0, 0, SPACWALK_R507_POT}, /* r_nodes */
|
||||
{0}, 0, 0, 0, SPACWALK_C602, 0, 1 /* c, rI, rF, cF, cAmp, vRef, gain */
|
||||
};
|
||||
|
||||
|
||||
/************************************************
|
||||
* Springboard Hit Circuit 1 or 2
|
||||
************************************************/
|
||||
#define SPACWALK_SPRINGBOARD_HIT_CIRCUIT(_num) \
|
||||
DISCRETE_RCFILTER(NODE_RELATIVE(NODE_29, _num), \
|
||||
SPACWALK_NOISE, /* IN0 */ \
|
||||
RES_K(330), CAP_U(.1)) \
|
||||
DISCRETE_RCFILTER(NODE_RELATIVE(NODE_31, _num), \
|
||||
NODE_RELATIVE(NODE_29, _num), /* IN0 */ \
|
||||
RES_K(330) + RES_K(150), CAP_U(.1)) \
|
||||
DISCRETE_OP_AMP_VCO1(NODE_RELATIVE(NODE_33, _num), /* IC M2-3, pin 5 */ \
|
||||
1, /* ENAB */ \
|
||||
NODE_RELATIVE(NODE_31, _num), /* VMOD1 */ \
|
||||
&spacwalk_sb_hit_vco) \
|
||||
DISCRETE_OP_AMP_TRIG_VCA(NODE_RELATIVE(NODE_35, _num), /* IC M2-3, pin 9 */ \
|
||||
NODE_RELATIVE(SPACWALK_SPRINGBOARD_HIT1_EN, _num - 1), 0, 0, /* TRG0, TRG1, TRG2 */ \
|
||||
NODE_RELATIVE(NODE_33, _num), 0, /* IN0, IN1 */ \
|
||||
&spacwalk_sb_hit_tvca_info) \
|
||||
/* Wrong values. Untested */ \
|
||||
/* The rest of the circuit is a filter. */ \
|
||||
DISCRETE_FILTER2(NODE_RELATIVE(NODE_37, _num), \
|
||||
1, /* ENAB */ \
|
||||
NODE_RELATIVE(NODE_35, _num), /* INP0 */ \
|
||||
2000.0 - _num * 500, 1.0/.8, /* FREQ, DAMP */ \
|
||||
DISC_FILTER_LOWPASS) \
|
||||
/* The filter has a gain of 0.5 */ \
|
||||
DISCRETE_GAIN(NODE_RELATIVE(SPACWALK_SPRINGBOARD_HIT1_SND, _num - 1), \
|
||||
NODE_RELATIVE(NODE_37, _num), 0.5)
|
||||
|
||||
static DISCRETE_SOUND_START(spacwalk_discrete)
|
||||
|
||||
/************************************************
|
||||
* Input register mapping
|
||||
************************************************/
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_TARGET_HIT_BOTTOM_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_TARGET_HIT_MIDDLE_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_TARGET_HIT_TOP_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_SPRINGBOARD_HIT1_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_SPRINGBOARD_HIT2_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_SPRINGBOARD_MISS_EN)
|
||||
DISCRETE_INPUT_LOGIC(SPACWALK_SPACE_SHIP_EN)
|
||||
|
||||
/* The low value of the pot is set to 7000. A real 1M pot will never go to 0 anyways. */
|
||||
/* This will give the control more apparent volume range. */
|
||||
/* The music way overpowers the rest of the sounds anyways. */
|
||||
DISCRETE_ADJUSTMENT(SPACWALK_R507_POT, SPACWALK_R507, 7000, DISC_LOGADJ, "R507")
|
||||
|
||||
/************************************************
|
||||
* Tone generator
|
||||
************************************************/
|
||||
MIDWAY_TONE_GENERATOR(midway_music_tvca_info)
|
||||
|
||||
/************************************************
|
||||
* Target hit sounds
|
||||
* The LFSR is the same as boothill
|
||||
************************************************/
|
||||
/* Noise clock was breadboarded and measured at 7700Hz */
|
||||
DISCRETE_LFSR_NOISE(SPACWALK_NOISE, /* IC L4, pin 10 */
|
||||
1, 1, /* ENAB, RESET */
|
||||
7700, 12.0, 0, 12.0/2, &midway_lfsr) /* CLK,AMPL,FEED,BIAS,LFSRTB */
|
||||
|
||||
DISCRETE_OP_AMP_TRIG_VCA(NODE_20, /* IC K3, pin 9 */
|
||||
SPACWALK_TARGET_HIT_TOP_EN, SPACWALK_TARGET_HIT_MIDDLE_EN, SPACWALK_TARGET_HIT_BOTTOM_EN,
|
||||
SPACWALK_NOISE, 0, /* IN0, IN1 */
|
||||
&spacwalk_hit_tvca_info)
|
||||
DISCRETE_RCFILTER(NODE_21,
|
||||
NODE_20, /* IN0 */
|
||||
SPACWALK_R307, SPACWALK_C303)
|
||||
DISCRETE_RCFILTER(SPACWALK_TARGET_HIT_SND,
|
||||
NODE_21, /* IN0 */
|
||||
SPACWALK_R307 + SPACWALK_R308, SPACWALK_C304)
|
||||
|
||||
/************************************************
|
||||
* Springboard hit sounds
|
||||
************************************************/
|
||||
/* Nodes 30 - 40 */
|
||||
SPACWALK_SPRINGBOARD_HIT_CIRCUIT(1)
|
||||
SPACWALK_SPRINGBOARD_HIT_CIRCUIT(2)
|
||||
|
||||
/************************************************
|
||||
* Springboard miss sound
|
||||
************************************************/
|
||||
DISCRETE_RCDISC2(NODE_50, /* voltage on C401 */
|
||||
SPACWALK_SPRINGBOARD_MISS_EN, /* SWITCH */
|
||||
OP_AMP_NORTON_VBE, RES_2_PARALLEL(SPACWALK_R401, SPACWALK_R407), /* INP0,RVAL0 */
|
||||
12.0 - .5, SPACWALK_R400, /* INP1,RVAL1 */
|
||||
SPACWALK_C401)
|
||||
DISCRETE_INTEGRATE(NODE_51, /* IC K4, pin 9 */
|
||||
NODE_50, 0, /* TRG0,TRG1*/
|
||||
&spacwalk_sb_miss_integrate)
|
||||
DISCRETE_OP_AMP_VCO1(NODE_52, /* IC K4, pin 5 */
|
||||
1, /* ENAB */
|
||||
NODE_50, /* VMOD1 */
|
||||
&spacwalk_sb_miss_vco)
|
||||
DISCRETE_CRFILTER(NODE_53,
|
||||
NODE_52, /* IN0 */
|
||||
SPACWALK_R417, SPACWALK_C453)
|
||||
/* this filter type probably does not work right. I need to test it. */
|
||||
DISCRETE_OP_AMP_FILTER(NODE_54, /* IC K3, pin 5 */
|
||||
1, /* ENAB */
|
||||
NODE_53, 0, /* INP0,INP1 */
|
||||
DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON, &spacwalk_sb_miss_filter)
|
||||
DISCRETE_OP_AMP(SPACWALK_SPRINGBOARD_MISS_SND, /* IC K4, pin 10 */
|
||||
1, /* ENAB */
|
||||
NODE_54, NODE_51, /* IN0,IN1 */
|
||||
&spacwalk_sb_miss_amp)
|
||||
|
||||
/************************************************
|
||||
* Space ship sound
|
||||
************************************************/
|
||||
DISCRETE_OP_AMP_OSCILLATOR(NODE_60, /* voltage on 2.2uF cap near IC JK-2 */
|
||||
1, /* ENAB */
|
||||
&spacwalk_spaceship_osc)
|
||||
DISCRETE_OP_AMP_VCO1(NODE_61, /* IC JK-2, pin 5 */
|
||||
SPACWALK_SPACE_SHIP_EN, /* ENAB */
|
||||
NODE_60, /* VMOD1*/
|
||||
&spacwalk_spaceship_vco)
|
||||
DISCRETE_RCFILTER(NODE_62,
|
||||
NODE_61, /* IN0 */
|
||||
RES_K(1), CAP_U(0.15))
|
||||
DISCRETE_RCFILTER(SPACWALK_SPACE_SHIP_SND,
|
||||
NODE_62, /* IN0 */
|
||||
RES_K(1) + RES_K(10), CAP_U(0.015))
|
||||
|
||||
/************************************************
|
||||
* Combine all sound sources.
|
||||
************************************************/
|
||||
DISCRETE_MIXER6(NODE_90,
|
||||
1, /* ENAB */
|
||||
SPACWALK_SPRINGBOARD_HIT1_SND,
|
||||
SPACWALK_SPRINGBOARD_HIT2_SND,
|
||||
SPACWALK_SPACE_SHIP_SND,
|
||||
SPACWALK_SPRINGBOARD_MISS_SND,
|
||||
SPACWALK_TARGET_HIT_SND,
|
||||
MIDWAY_TONE_SND,
|
||||
&spacwalk_mixer)
|
||||
DISCRETE_OUTPUT(NODE_90, 11000)
|
||||
DISCRETE_SOUND_END
|
||||
|
||||
void mw8080bw_state::spacwalk_audio(machine_config &config)
|
||||
{
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
DISCRETE(config, m_discrete, spacwalk_discrete);
|
||||
m_discrete->add_route(ALL_OUTPUTS, "mono", 1.0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mw8080bw_state::spacwalk_audio_1_w)
|
||||
{
|
||||
machine().bookkeeping().coin_counter_w(0, (data >> 0) & 0x01);
|
||||
|
||||
m_clowns_controller_select = (data >> 1) & 0x01;
|
||||
|
||||
machine().sound().system_enable((data >> 2) & 0x01);
|
||||
|
||||
m_discrete->write(SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mw8080bw_state::spacwalk_audio_2_w)
|
||||
{
|
||||
m_discrete->write(SPACWALK_TARGET_HIT_BOTTOM_EN, (data >> 0) & 0x01);
|
||||
|
||||
m_discrete->write(SPACWALK_TARGET_HIT_MIDDLE_EN, (data >> 1) & 0x01);
|
||||
|
||||
m_discrete->write(SPACWALK_TARGET_HIT_TOP_EN, (data >> 2) & 0x01);
|
||||
|
||||
m_discrete->write(SPACWALK_SPRINGBOARD_HIT1_EN, (data >> 3) & 0x01);
|
||||
|
||||
m_discrete->write(SPACWALK_SPRINGBOARD_HIT2_EN, (data >> 4) & 0x01);
|
||||
|
||||
m_discrete->write(SPACWALK_SPRINGBOARD_MISS_EN, (data >> 5) & 0x01);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Shuffleboard
|
||||
|
@ -147,6 +147,27 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class spacwalk_audio_device : public midway_tone_generator_device_base
|
||||
{
|
||||
public:
|
||||
auto ctrl_sel_out() { return m_ctrl_sel_out.bind(); }
|
||||
|
||||
spacwalk_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
void p1_w(u8 data);
|
||||
void p2_w(u8 data);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
devcb_write_line m_ctrl_sel_out;
|
||||
u8 m_p1;
|
||||
};
|
||||
|
||||
|
||||
class spcenctr_audio_device : public device_t
|
||||
{
|
||||
public:
|
||||
@ -240,6 +261,7 @@ DECLARE_DEVICE_TYPE(DESERTGU_AUDIO, desertgu_audio_device)
|
||||
DECLARE_DEVICE_TYPE(GMISSILE_AUDIO, gmissile_audio_device)
|
||||
DECLARE_DEVICE_TYPE(M4_AUDIO, m4_audio_device)
|
||||
DECLARE_DEVICE_TYPE(CLOWNS_AUDIO, clowns_audio_device)
|
||||
DECLARE_DEVICE_TYPE(SPACWALK_AUDIO, spacwalk_audio_device)
|
||||
DECLARE_DEVICE_TYPE(SPCENCTR_AUDIO, spcenctr_audio_device)
|
||||
DECLARE_DEVICE_TYPE(PHANTOM2_AUDIO, phantom2_audio_device)
|
||||
DECLARE_DEVICE_TYPE(INVADERS_AUDIO, invaders_audio_device)
|
||||
|
@ -1685,29 +1685,23 @@ void mw8080bw_state::m4(machine_config &config)
|
||||
#define CLOWNS_CONTROLLER_P2_TAG ("CONTP2")
|
||||
|
||||
|
||||
MACHINE_START_MEMBER(mw8080bw_state,clowns)
|
||||
void clowns_state::machine_start()
|
||||
{
|
||||
mw8080bw_state::machine_start();
|
||||
|
||||
/* setup for save states */
|
||||
save_item(NAME(m_clowns_controller_select));
|
||||
m_controller_select = 0U;
|
||||
|
||||
save_item(NAME(m_controller_select));
|
||||
}
|
||||
|
||||
|
||||
CUSTOM_INPUT_MEMBER(mw8080bw_state::clowns_controller_r)
|
||||
CUSTOM_INPUT_MEMBER(clowns_state::controller_r)
|
||||
{
|
||||
uint32_t ret;
|
||||
|
||||
if (m_clowns_controller_select)
|
||||
ret = ioport(CLOWNS_CONTROLLER_P2_TAG)->read();
|
||||
else
|
||||
ret = ioport(CLOWNS_CONTROLLER_P1_TAG)->read();
|
||||
|
||||
return ret;
|
||||
return m_controllers[m_controller_select]->read();
|
||||
}
|
||||
|
||||
|
||||
void mw8080bw_state::clowns_io_map(address_map &map)
|
||||
void clowns_state::clowns_io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0x7);
|
||||
map(0x00, 0x00).mirror(0x04).portr("IN0");
|
||||
@ -1727,17 +1721,17 @@ void mw8080bw_state::clowns_io_map(address_map &map)
|
||||
|
||||
static INPUT_PORTS_START( clowns )
|
||||
PORT_START("IN0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, clowns_controller_r)
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(clowns_state, controller_r)
|
||||
|
||||
PORT_START("IN1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) // not connected
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // not connected
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) // not connected
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) // not connected
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) // not connected
|
||||
|
||||
PORT_START("IN2")
|
||||
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
|
||||
@ -1759,10 +1753,10 @@ static INPUT_PORTS_START( clowns )
|
||||
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:7")
|
||||
PORT_DIPSETTING( 0x00, "3" )
|
||||
PORT_DIPSETTING( 0x40, "4" )
|
||||
/* test mode - press coin button for input test */
|
||||
// test mode - press coin button for input test
|
||||
PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW:8" )
|
||||
|
||||
/* fake ports for two analog controls multiplexed */
|
||||
// fake ports for two analog controls multiplexed
|
||||
PORT_START(CLOWNS_CONTROLLER_P1_TAG)
|
||||
PORT_BIT( 0xff, 0x7f, IPT_PADDLE ) PORT_MINMAX(0x01,0xfe) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_PLAYER(1)
|
||||
|
||||
@ -1773,7 +1767,7 @@ INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( clowns1 )
|
||||
PORT_START("IN0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, clowns_controller_r)
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(clowns_state, controller_r)
|
||||
|
||||
PORT_START("IN1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
@ -1815,22 +1809,20 @@ static INPUT_PORTS_START( clowns1 )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
void mw8080bw_state::clowns(machine_config &config)
|
||||
void clowns_state::clowns(machine_config &config)
|
||||
{
|
||||
mw8080bw_root(config);
|
||||
|
||||
/* basic machine hardware */
|
||||
m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::clowns_io_map);
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,clowns)
|
||||
// basic machine hardware
|
||||
m_maincpu->set_addrmap(AS_IO, &clowns_state::clowns_io_map);
|
||||
|
||||
WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ));
|
||||
|
||||
/* add shifter */
|
||||
// add shifter
|
||||
MB14241(config, m_mb14241);
|
||||
|
||||
/* audio hardware */
|
||||
CLOWNS_AUDIO(config, "soundboard").ctrl_sel_out().set([this] (int state) { m_clowns_controller_select = state ? 1 : 0; });
|
||||
// audio hardware
|
||||
CLOWNS_AUDIO(config, "soundboard").ctrl_sel_out().set([this] (int state) { m_controller_select = state ? 1U : 0U; });
|
||||
}
|
||||
|
||||
|
||||
@ -1841,7 +1833,7 @@ void mw8080bw_state::clowns(machine_config &config)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void mw8080bw_state::spacwalk_io_map(address_map &map)
|
||||
void clowns_state::spacwalk_io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0x7);
|
||||
|
||||
@ -1852,16 +1844,16 @@ void mw8080bw_state::spacwalk_io_map(address_map &map)
|
||||
|
||||
map(0x01, 0x01).w(m_mb14241, FUNC(mb14241_device::shift_count_w));
|
||||
map(0x02, 0x02).w(m_mb14241, FUNC(mb14241_device::shift_data_w));
|
||||
map(0x03, 0x03).w(FUNC(mw8080bw_state::spacwalk_audio_1_w));
|
||||
map(0x03, 0x03).w("soundboard", FUNC(spacwalk_audio_device::p1_w));
|
||||
map(0x04, 0x04).w(m_watchdog, FUNC(watchdog_timer_device::reset_w));
|
||||
map(0x05, 0x05).w(FUNC(mw8080bw_state::midway_tone_generator_lo_w));
|
||||
map(0x06, 0x06).w(FUNC(mw8080bw_state::midway_tone_generator_hi_w));
|
||||
map(0x07, 0x07).w(FUNC(mw8080bw_state::spacwalk_audio_2_w));
|
||||
map(0x05, 0x05).w("soundboard", FUNC(spacwalk_audio_device::tone_generator_lo_w));
|
||||
map(0x06, 0x06).w("soundboard", FUNC(spacwalk_audio_device::tone_generator_hi_w));
|
||||
map(0x07, 0x07).w("soundboard", FUNC(spacwalk_audio_device::p2_w));
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( spacwalk )
|
||||
PORT_START("IN0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mw8080bw_state, clowns_controller_r)
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(clowns_state, controller_r)
|
||||
|
||||
PORT_START("IN1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
@ -1873,7 +1865,7 @@ static INPUT_PORTS_START( spacwalk )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
/* 8 pin DIP Switch on location C2 on PCB A084-90700-D640 */
|
||||
// 8 pin DIP Switch on location C2 on PCB A084-90700-D640
|
||||
/* PCB picture also shows a 2nd DIP Switch on location B2, supposedly for language selection,
|
||||
but ROM contents suggests it's not connected (no different languages or unmapped reads) */
|
||||
PORT_START("IN2")
|
||||
@ -1901,33 +1893,28 @@ static INPUT_PORTS_START( spacwalk )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
|
||||
PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_HIGH, "C2:8" ) // RAM-ROM Test
|
||||
|
||||
/* fake ports for two analog controls multiplexed */
|
||||
// fake ports for two analog controls multiplexed
|
||||
PORT_START(CLOWNS_CONTROLLER_P1_TAG)
|
||||
PORT_BIT( 0xff, 0x7f, IPT_PADDLE ) PORT_MINMAX(0x01,0xfe) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_PLAYER(1)
|
||||
|
||||
PORT_START(CLOWNS_CONTROLLER_P2_TAG)
|
||||
PORT_BIT( 0xff, 0x7f, IPT_PADDLE ) PORT_MINMAX(0x01,0xfe) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("R507")
|
||||
PORT_ADJUSTER( 40, "R507 - Music Volume" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
void mw8080bw_state::spacwalk(machine_config &config)
|
||||
void clowns_state::spacwalk(machine_config &config)
|
||||
{
|
||||
mw8080bw_root(config);
|
||||
|
||||
/* basic machine hardware */
|
||||
m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::spacwalk_io_map);
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,clowns)
|
||||
// basic machine hardware
|
||||
m_maincpu->set_addrmap(AS_IO, &clowns_state::spacwalk_io_map);
|
||||
|
||||
WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ));
|
||||
|
||||
/* add shifter */
|
||||
// add shifter
|
||||
MB14241(config, m_mb14241);
|
||||
|
||||
/* audio hardware */
|
||||
spacwalk_audio(config);
|
||||
// audio hardware
|
||||
SPACWALK_AUDIO(config, "soundboard").ctrl_sel_out().set([this] (int state) { m_controller_select = state ? 1U : 0U; });
|
||||
}
|
||||
|
||||
|
||||
@ -3149,9 +3136,9 @@ ROM_END
|
||||
/* 622 */ GAMEL( 1977, lagunar, 0, zzzap, lagunar, mw8080bw_state, empty_init, ROT90, "Midway", "Laguna Racer", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE, layout_lagunar )
|
||||
/* 623 */ GAME( 1977, gmissile, 0, gmissile, gmissile, mw8080bw_state, empty_init, ROT0, "Midway", "Guided Missile", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
/* 626 */ GAME( 1977, m4, 0, m4, m4, mw8080bw_state, empty_init, ROT0, "Midway", "M-4", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
/* 630 */ GAMEL( 1978, clowns, 0, clowns, clowns, mw8080bw_state, empty_init, ROT0, "Midway", "Clowns (rev. 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_clowns )
|
||||
/* 630 */ GAMEL( 1978, clowns1, clowns, clowns, clowns1, mw8080bw_state, empty_init, ROT0, "Midway", "Clowns (rev. 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_clowns )
|
||||
/* 640 */ GAMEL( 1978, spacwalk, 0, spacwalk, spacwalk, mw8080bw_state, empty_init, ROT0, "Midway", "Space Walk", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_spacwalk )
|
||||
/* 630 */ GAMEL( 1978, clowns, 0, clowns, clowns, clowns_state, empty_init, ROT0, "Midway", "Clowns (rev. 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_clowns )
|
||||
/* 630 */ GAMEL( 1978, clowns1, clowns, clowns, clowns1, clowns_state, empty_init, ROT0, "Midway", "Clowns (rev. 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_clowns )
|
||||
/* 640 */ GAMEL( 1978, spacwalk, 0, spacwalk, spacwalk, clowns_state, empty_init, ROT0, "Midway", "Space Walk", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_spacwalk )
|
||||
/* 642 */ GAME( 1978, einning, 0, dplay, einning, mw8080bw_state, empty_init, ROT0, "Midway / Taito", "Extra Inning / Ball Park II", MACHINE_SUPPORTS_SAVE )
|
||||
/* 643 */ GAME( 1978, shuffle, 0, shuffle, shuffle, mw8080bw_state, empty_init, ROT90, "Midway", "Shuffleboard", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
/* 644 */ GAME( 1977, dogpatch, 0, dogpatch, dogpatch, mw8080bw_state, empty_init, ROT0, "Midway", "Dog Patch", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
|
@ -61,7 +61,6 @@ public:
|
||||
void boothill(machine_config &config);
|
||||
void bowler(machine_config &config);
|
||||
void checkmat(machine_config &config);
|
||||
void clowns(machine_config &config);
|
||||
void dogpatch(machine_config &config);
|
||||
void dplay(machine_config &config);
|
||||
void gmissile(machine_config &config);
|
||||
@ -72,7 +71,6 @@ public:
|
||||
void mw8080bw_root(machine_config &config);
|
||||
void phantom2(machine_config &config);
|
||||
void shuffle(machine_config &config);
|
||||
void spacwalk(machine_config &config);
|
||||
void tornbase(machine_config &config);
|
||||
void zzzap(machine_config &config);
|
||||
|
||||
@ -85,7 +83,6 @@ public:
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(tornbase_score_input_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(dplay_pitch_left_input_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(dplay_pitch_right_input_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(clowns_controller_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(blueshrk_coin_input_r);
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(invaders_sw6_sw7_r);
|
||||
@ -127,7 +124,6 @@ private:
|
||||
uint16_t m_phantom2_cloud_counter;
|
||||
uint8_t m_rev_shift_res;
|
||||
uint8_t m_maze_tone_timing_state; // output of IC C1, pin 5
|
||||
uint8_t m_clowns_controller_select;
|
||||
|
||||
// timers
|
||||
emu_timer *m_interrupt_timer;
|
||||
@ -155,7 +151,6 @@ private:
|
||||
DECLARE_MACHINE_START(boothill);
|
||||
DECLARE_MACHINE_START(gmissile);
|
||||
DECLARE_MACHINE_START(m4);
|
||||
DECLARE_MACHINE_START(clowns);
|
||||
DECLARE_MACHINE_START(phantom2);
|
||||
DECLARE_MACHINE_START(invaders);
|
||||
uint32_t screen_update_phantom2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
@ -168,8 +163,6 @@ private:
|
||||
DECLARE_WRITE8_MEMBER(boothill_audio_w);
|
||||
DECLARE_WRITE8_MEMBER(checkmat_audio_w);
|
||||
DECLARE_WRITE8_MEMBER(dplay_audio_w);
|
||||
DECLARE_WRITE8_MEMBER(spacwalk_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(spacwalk_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(shuffle_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(shuffle_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(dogpatch_audio_w);
|
||||
@ -191,7 +184,6 @@ private:
|
||||
void dplay_audio(machine_config &config);
|
||||
void maze_audio(machine_config &config);
|
||||
void shuffle_audio(machine_config &config);
|
||||
void spacwalk_audio(machine_config &config);
|
||||
void tornbase_audio(machine_config &config);
|
||||
void zzzap_audio(machine_config &config);
|
||||
|
||||
@ -199,7 +191,6 @@ private:
|
||||
void boothill_io_map(address_map &map);
|
||||
void bowler_io_map(address_map &map);
|
||||
void checkmat_io_map(address_map &map);
|
||||
void clowns_io_map(address_map &map);
|
||||
void dogpatch_io_map(address_map &map);
|
||||
void dplay_io_map(address_map &map);
|
||||
void gmissile_io_map(address_map &map);
|
||||
@ -210,7 +201,6 @@ private:
|
||||
void maze_io_map(address_map &map);
|
||||
void phantom2_io_map(address_map &map);
|
||||
void shuffle_io_map(address_map &map);
|
||||
void spacwalk_io_map(address_map &map);
|
||||
void tornbase_io_map(address_map &map);
|
||||
void zzzap_io_map(address_map &map);
|
||||
};
|
||||
@ -308,6 +298,32 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class clowns_state : public mw8080bw_state
|
||||
{
|
||||
public:
|
||||
clowns_state(machine_config const &mconfig, device_type type, char const *tag) :
|
||||
mw8080bw_state(mconfig, type, tag),
|
||||
m_controllers(*this, "CONTP%u", 1U)
|
||||
{
|
||||
}
|
||||
|
||||
void clowns(machine_config &config);
|
||||
void spacwalk(machine_config &config);
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(controller_r);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
|
||||
private:
|
||||
void clowns_io_map(address_map &map);
|
||||
void spacwalk_io_map(address_map &map);
|
||||
|
||||
required_ioport_array<2> m_controllers;
|
||||
u8 m_controller_select;
|
||||
};
|
||||
|
||||
|
||||
class spcenctr_state : public mw8080bw_state
|
||||
{
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user