Previous 199869 Revisions Next

r25448 Saturday 28th September, 2013 at 03:52:54 UTC by R. Belmont
(MESS) apogee: sound support [shattered]
[src/mess/drivers]apogee.c

trunk/src/mess/drivers/apogee.c
r25447r25448
1010#include "emu.h"
1111#include "cpu/i8085/i8085.h"
1212#include "sound/wave.h"
13#include "sound/speaker.h"
1314#include "machine/i8255.h"
1415#include "machine/8257dma.h"
16#include "machine/pit8253.h"
1517#include "video/i8275.h"
1618#include "imagedev/cassette.h"
1719#include "formats/rk_cas.h"
r25447r25448
2224{
2325public:
2426   apogee_state(const machine_config &mconfig, device_type type, const char *tag)
25      : radio86_state(mconfig, type, tag) { }
27      : radio86_state(mconfig, type, tag),
28      m_speaker(*this, "speaker") { }
29
30   UINT8 m_out0;
31   UINT8 m_out1;
32   UINT8 m_out2;
33   DECLARE_WRITE_LINE_MEMBER(pit8253_out0_changed);
34   DECLARE_WRITE_LINE_MEMBER(pit8253_out1_changed);
35   DECLARE_WRITE_LINE_MEMBER(pit8253_out2_changed);
36
37   required_device<speaker_sound_device> m_speaker;
2638};
2739
2840
r25447r25448
3042static ADDRESS_MAP_START(apogee_mem, AS_PROGRAM, 8, apogee_state )
3143   AM_RANGE( 0x0000, 0x0fff ) AM_RAMBANK("bank1") // First bank
3244   AM_RANGE( 0x1000, 0xebff ) AM_RAM  // RAM
33   //AM_RANGE( 0xec00, 0xecff ) AM_RAM  // Timer
45   AM_RANGE( 0xec00, 0xec03 ) AM_DEVREADWRITE("pit8253", pit8253_device, read, write) AM_MIRROR(0x00fc)
3446   AM_RANGE( 0xed00, 0xed03 ) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) AM_MIRROR(0x00fc)
3547   //AM_RANGE( 0xee00, 0xee03 ) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write) AM_MIRROR(0x00fc)
3648   AM_RANGE( 0xef00, 0xef01 ) AM_DEVREADWRITE("i8275", i8275_device, read, write) AM_MIRROR(0x00fe) // video
r25447r25448
140152   NULL
141153};
142154
155static const INT16 speaker_levels[] = {-32767, -10922, 10922, 32767};
143156
157static const speaker_interface apogee_speaker_interface =
158{
159   4,
160   speaker_levels
161};
162
163WRITE_LINE_MEMBER(apogee_state::pit8253_out0_changed)
164{
165   m_out0 = state;
166   m_speaker->level_w(m_out0+m_out1+m_out2);
167}
168
169WRITE_LINE_MEMBER(apogee_state::pit8253_out1_changed)
170{
171   m_out1 = state;
172   m_speaker->level_w(m_out0+m_out1+m_out2);
173}
174
175WRITE_LINE_MEMBER(apogee_state::pit8253_out2_changed)
176{
177   m_out2 = state;
178   m_speaker->level_w(m_out0+m_out1+m_out2);
179}
180
181const struct pit8253_interface apogee_pit8253_config =
182{
183   {
184      {
185         XTAL_16MHz/9,
186         DEVCB_NULL,
187         DEVCB_DRIVER_LINE_MEMBER(apogee_state,pit8253_out0_changed)
188      }, {
189         XTAL_16MHz/9,
190         DEVCB_NULL,
191         DEVCB_DRIVER_LINE_MEMBER(apogee_state,pit8253_out1_changed)
192      }, {
193         XTAL_16MHz/9,
194         DEVCB_NULL,
195         DEVCB_DRIVER_LINE_MEMBER(apogee_state,pit8253_out2_changed)
196      }
197   }
198};
199
200
144201/* F4 Character Displayer */
145202static const gfx_layout apogee_charlayout =
146203{
r25447r25448
167224   MCFG_CPU_PROGRAM_MAP(apogee_mem)
168225   MCFG_MACHINE_RESET_OVERRIDE(apogee_state, radio86 )
169226
227   MCFG_PIT8253_ADD( "pit8253", apogee_pit8253_config )
228
170229   MCFG_I8255_ADD( "ppi8255_1", radio86_ppi8255_interface_1 )
171230
172231   //MCFG_I8255_ADD( "ppi8255_2", apogee_ppi8255_interface_2 )
r25447r25448
187246   MCFG_SPEAKER_STANDARD_MONO("mono")
188247   MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
189248   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
249   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
250   MCFG_SOUND_CONFIG(apogee_speaker_interface)
251   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
190252
191253   MCFG_I8257_ADD("dma8257", XTAL_16MHz / 9, radio86_dma)
192254

Previous 199869 Revisions Next


© 1997-2024 The MAME Team