11
11
#include "includes/spacefb.h"
15
static UINT8 spacefb_sound_latch;
19
14
READ8_HANDLER( spacefb_audio_p2_r )
21
return (spacefb_sound_latch & 0x18) << 1;
16
spacefb_state *state = space->machine().driver_data<spacefb_state>();
17
return (state->m_sound_latch & 0x18) << 1;
25
21
READ8_HANDLER( spacefb_audio_t0_r )
27
return spacefb_sound_latch & 0x20;
23
spacefb_state *state = space->machine().driver_data<spacefb_state>();
24
return state->m_sound_latch & 0x20;
31
28
READ8_HANDLER( spacefb_audio_t1_r )
33
return spacefb_sound_latch & 0x04;
30
spacefb_state *state = space->machine().driver_data<spacefb_state>();
31
return state->m_sound_latch & 0x04;
37
35
WRITE8_HANDLER( spacefb_port_1_w )
39
device_t *samples = space->machine->device("samples");
37
spacefb_state *state = space->machine().driver_data<spacefb_state>();
38
device_t *samples = space->machine().device("samples");
41
cputag_set_input_line(space->machine, "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
40
cputag_set_input_line(space->machine(), "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
44
if (!(data & 0x01) && (spacefb_sound_latch & 0x01)) sample_start(samples, 0,0,0);
43
if (!(data & 0x01) && (state->m_sound_latch & 0x01)) sample_start(samples, 0,0,0);
47
if (!(data & 0x40) && (spacefb_sound_latch & 0x40)) sample_start(samples, 1,1,0);
46
if (!(data & 0x40) && (state->m_sound_latch & 0x40)) sample_start(samples, 1,1,0);
54
53
* Fortunately it seems like the recorded sample of the spaceship death is the longest the sample plays for.
55
54
* We loop it just in case it runs out
57
if ((data & 0x80) != (spacefb_sound_latch & 0x80))
56
if ((data & 0x80) != (state->m_sound_latch & 0x80))
60
59
/* play decaying noise */