Previous 199869 Revisions Next

r22921 Sunday 19th May, 2013 at 13:19:17 UTC by Fabio Priuli
sorry for the missing file
[src/mess/audio]lynx.h*

trunk/src/mess/audio/lynx.h
r0r22921
1#ifndef __LYNXSOUND_H__
2#define __LYNXSOUND_H__
3
4struct LYNX_AUDIO {
5   struct {
6      INT8 volume;
7      UINT8 feedback;
8      INT8 output;
9      UINT8 shifter;
10      UINT8 bakup;
11      UINT8 control1;
12      UINT8 counter;
13      UINT8 control2;
14   } reg;
15   UINT8 attenuation;
16   UINT16 mask; // 12-bit
17   UINT16 shifter; // 12-bit
18   float ticks;
19   int count;
20};
21
22typedef device_delegate<void (void)> lynx_sound_timer_delegate;
23
24
25class lynx_sound_device : public device_t,
26                           public device_sound_interface
27{
28public:
29   lynx_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
30   lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
31
32   DECLARE_READ8_MEMBER(read);
33   DECLARE_WRITE8_MEMBER(write);
34   void count_down(int nr);
35   static void set_timer_delegate(device_t &device, lynx_sound_timer_delegate cb);
36
37protected:
38   // device-level overrides
39   virtual void device_config_complete();
40   virtual void device_start();
41
42   virtual void device_reset();
43
44   // sound stream update overrides
45   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
46
47   void reset_channel(LYNX_AUDIO *channel);
48   void shift(int chan_nr);
49   void execute(int chan_nr);
50   void init();
51   void register_save();
52
53   sound_stream *m_mixer_channel;
54   lynx_sound_timer_delegate   m_timer_delegate;   // this calls lynx_timer_count_down from the driver state
55
56   float m_usec_per_sample;
57   int *m_shift_mask;
58   int *m_shift_xor;
59   UINT8 m_attenuation_enable;
60   UINT8 m_master_enable;
61   LYNX_AUDIO m_audio[4];
62};
63
64
65class lynx2_sound_device : public lynx_sound_device
66{
67public:
68   lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
69   
70protected:
71   // device-level overrides
72   virtual void device_start();
73   
74   // sound stream update overrides
75   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
76};
77
78
79extern const device_type LYNX_SND;
80extern const device_type LYNX2_SND;
81
82
83#define MCFG_LYNX_SND_SET_TIMER( _class, _method) \
84   lynx_sound_device::set_timer_delegate(*device, lynx_sound_timer_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0));
85
86
87#endif
Property changes on: trunk/src/mess/audio/lynx.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Previous 199869 Revisions Next


© 1997-2024 The MAME Team