~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "emu.h"
22
22
#include "cpu/z80/z80.h"
23
23
#include "sound/samples.h"
 
24
#include "sound/votrax.h"
24
25
#include "includes/astrocde.h"
25
26
 
26
27
 
102
103
 
103
104
READ8_HANDLER( wow_speech_r )
104
105
{
 
106
        UINT8 data = offset >> 8;
 
107
#if USE_FAKE_VOTRAX
105
108
        astrocde_state *state = space->machine().driver_data<astrocde_state>();
106
 
        device_t *samples = space->machine().device("samples");
 
109
        samples_device *samples = space->machine().device<samples_device>("samples");
107
110
        int Phoneme/*, Intonation*/;
108
111
        int i = 0;
109
 
        UINT8 data = offset >> 8;
110
112
        offset &= 0xff;
111
113
 
112
114
        state->m_totalword_ptr = state->m_totalword;
117
119
        //logerror("Data : %d Speech : %s at intonation %d\n",Phoneme, PhonemeTable[Phoneme],Intonation);
118
120
 
119
121
        if(Phoneme==63) {
120
 
                sample_stop(samples, 0);
 
122
                samples->stop(0);
121
123
                //logerror("Clearing sample %s\n",state->m_totalword);
122
124
                state->m_totalword[0] = 0;                                 /* Clear the total word stack */
123
125
                return data;
132
134
                if (state->m_plural != 0) {
133
135
                        //logerror("found a possible plural at %d\n",state->m_plural-1);
134
136
                        if (!strcmp("S",state->m_totalword)) {             /* Plural check */
135
 
                                sample_start(samples, 0, num_samples-2, 0);        /* play the sample at position of word */
136
 
                                sample_set_freq(samples, 0, 11025);    /* play at correct rate */
 
137
                                samples->start(0, num_samples-2);          /* play the sample at position of word */
 
138
                                samples->set_frequency(0, 11025);    /* play at correct rate */
137
139
                                state->m_totalword[0] = 0;                                 /* Clear the total word stack */
138
140
                                state->m_oldword[0] = 0;                                   /* Clear the total word stack */
139
141
                                return data;
156
158
                        } else {
157
159
                                state->m_plural=0;
158
160
                        }
159
 
                        sample_start(samples, 0, i, 0);                    /* play the sample at position of word */
160
 
                        sample_set_freq(samples, 0, 11025);         /* play at correct rate */
 
161
                        samples->start(0, i);                      /* play the sample at position of word */
 
162
                        samples->set_frequency(0, 11025);         /* play at correct rate */
161
163
                        //logerror("Playing sample %d\n",i);
162
164
                        state->m_totalword[0] = 0;                                 /* Clear the total word stack */
163
165
                        return data;
164
166
                }
165
167
        }
 
168
#else
 
169
        votrax_sc01_device *votrax = space->machine().device<votrax_sc01_device>("votrax");
 
170
        votrax->inflection_w(*space, 0, data >> 6);
 
171
        votrax->write(*space, 0, data);
 
172
#endif
166
173
 
167
174
        /* Note : We should really also use volume in this as well as frequency */
168
175
        return data;                                               /* Return nicely */
171
178
 
172
179
CUSTOM_INPUT( wow_speech_status_r )
173
180
{
174
 
        device_t *samples = field.machine().device("samples");
175
 
        return !sample_playing(samples, 0);
 
181
#if USE_FAKE_VOTRAX
 
182
        samples_device *samples = field.machine().device<samples_device>("samples");
 
183
        return !samples->playing(0);
 
184
#else
 
185
        votrax_sc01_device *votrax = field.machine().device<votrax_sc01_device>("votrax");
 
186
        return votrax->request();
 
187
#endif
176
188
}