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

« back to all changes in this revision

Viewing changes to src/mame/audio/gorf.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:
20
20
#include "emu.h"
21
21
#include "cpu/z80/z80.h"
22
22
#include "sound/samples.h"
 
23
#include "sound/votrax.h"
23
24
#include "includes/astrocde.h"
24
25
 
25
26
 
111
112
 
112
113
READ8_HANDLER( gorf_speech_r )
113
114
{
 
115
        UINT8 data = offset >> 8;
 
116
#if USE_FAKE_VOTRAX
114
117
        astrocde_state *state = space->machine().driver_data<astrocde_state>();
115
 
        device_t *samples = space->machine().device("samples");
 
118
        samples_device *samples = space->machine().device<samples_device>("samples");
116
119
        int Phoneme, Intonation;
117
120
        int i = 0;
118
 
        UINT8 data = offset >> 8;
119
121
        offset &= 0xff;
120
122
 
121
123
        state->m_totalword_ptr = state->m_totalword;
126
128
        logerror("Date : %d Speech : %s at intonation %d\n",Phoneme, PhonemeTable[Phoneme],Intonation);
127
129
 
128
130
        if(Phoneme==63) {
129
 
                sample_stop(samples, 0);
 
131
                samples->stop(0);
130
132
                if (strlen(state->m_totalword)>2) logerror("Clearing sample %s\n",state->m_totalword);
131
133
                state->m_totalword[0] = 0;                                 /* Clear the total word stack */
132
134
                return data;
139
141
                if (state->m_plural != 0) {
140
142
                        logerror("found a possible plural at %d\n",state->m_plural-1);
141
143
                        if (!strcmp("S",state->m_totalword)) {             /* Plural check */
142
 
                                sample_start(samples, 0, num_samples-2, 0);        /* play the sample at position of word */
143
 
                                sample_set_freq(samples, 0, 11025);    /* play at correct rate */
 
144
                                samples->start(0, num_samples-2);          /* play the sample at position of word */
 
145
                                samples->set_frequency(0, 11025);    /* play at correct rate */
144
146
                                state->m_totalword[0] = 0;                                 /* Clear the total word stack */
145
147
                                state->m_oldword[0] = 0;                                   /* Clear the total word stack */
146
148
                                return data;
162
164
                        } else {
163
165
                                state->m_plural=0;
164
166
                        }
165
 
                        sample_start(samples, 0, i, 0);                    /* play the sample at position of word */
166
 
                        sample_set_freq(samples, 0, 11025);       /* play at correct rate */
 
167
                        samples->start(0, i);                      /* play the sample at position of word */
 
168
                        samples->set_frequency(0, 11025);       /* play at correct rate */
167
169
                        logerror("Playing sample %d",i);
168
170
                        state->m_totalword[0] = 0;                                 /* Clear the total word stack */
169
171
                        return data;
170
172
                }
171
173
        }
 
174
#else
 
175
        votrax_sc01_device *votrax = space->machine().device<votrax_sc01_device>("votrax");
 
176
        votrax->inflection_w(*space, 0, data >> 6);
 
177
        votrax->write(*space, 0, data);
 
178
#endif
172
179
 
173
180
        /* Note : We should really also use volume in this as well as frequency */
174
181
        return data;                                               /* Return nicely */
177
184
 
178
185
CUSTOM_INPUT( gorf_speech_status_r )
179
186
{
180
 
        device_t *samples = field.machine().device("samples");
181
 
        return !sample_playing(samples, 0);
 
187
#if USE_FAKE_VOTRAX
 
188
        samples_device *samples = field.machine().device<samples_device>("samples");
 
189
        return !samples->playing(0);
 
190
#else
 
191
        votrax_sc01_device *votrax = field.machine().device<votrax_sc01_device>("votrax");
 
192
        return votrax->request();
 
193
#endif
182
194
}