~ubuntu-branches/debian/wheezy/mame/wheezy

« back to all changes in this revision

Viewing changes to src/mame/audio/spacefb.c

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Emmanuel Kasper, Félix Arreola Rodríguez, Jordi Mallach
  • Date: 2011-05-11 21:06:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511210650-jizvh8a6x117y9hr
Tags: 0.142-1
[ Emmanuel Kasper ]
* New upstream release
* Set NOWERROR=1 to allow compiling with gcc-4.6
* Remove fix_powerpc_build.patch, as upstream has taken it in this release
* Add gnome-video-arcade front end as a suggested package

[ Félix Arreola Rodríguez ]
* Add kfreebsd-build.patch to quilt series, to fix build on kfreebsd

[ Jordi Mallach ]
* Remove unneeded and bogus addition of --with-quilt to the dh invocation.
* Add Cesare Falco (long time Ubuntu maintainer) to Uploaders, and wrap
  them into multiple lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include "includes/spacefb.h"
12
12
 
13
13
 
14
 
 
15
 
static UINT8 spacefb_sound_latch;
16
 
 
17
 
 
18
 
 
19
14
READ8_HANDLER( spacefb_audio_p2_r )
20
15
{
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;
22
18
}
23
19
 
24
20
 
25
21
READ8_HANDLER( spacefb_audio_t0_r )
26
22
{
27
 
        return spacefb_sound_latch & 0x20;
 
23
        spacefb_state *state = space->machine().driver_data<spacefb_state>();
 
24
        return state->m_sound_latch & 0x20;
28
25
}
29
26
 
30
27
 
31
28
READ8_HANDLER( spacefb_audio_t1_r )
32
29
{
33
 
        return spacefb_sound_latch & 0x04;
 
30
        spacefb_state *state = space->machine().driver_data<spacefb_state>();
 
31
        return state->m_sound_latch & 0x04;
34
32
}
35
33
 
36
34
 
37
35
WRITE8_HANDLER( spacefb_port_1_w )
38
36
{
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");
40
39
 
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);
42
41
 
43
42
        /* enemy killed */
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);
45
44
 
46
45
        /* ship fire */
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);
48
47
 
49
48
        /*
50
49
     *  Explosion Noise
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
56
55
     */
57
 
        if ((data & 0x80) != (spacefb_sound_latch & 0x80))
 
56
        if ((data & 0x80) != (state->m_sound_latch & 0x80))
58
57
        {
59
58
                if (data & 0x80)
60
59
                        /* play decaying noise */
64
63
                        sample_start(samples, 2,2,1);
65
64
        }
66
65
 
67
 
        spacefb_sound_latch = data;
 
66
        state->m_sound_latch = data;
68
67
}
69
68
 
70
69