Previous 199869 Revisions Next

r19651 Tuesday 18th December, 2012 at 10:42:31 UTC by O. Galibert
mt32: Add the sample clock, now it's waiting for an irq from the la32 [O. Galibert]
[src/mess/drivers]rmt32.c

trunk/src/mess/drivers/rmt32.c
r19650r19651
207207   DECLARE_READ8_MEMBER(lcd_ctrl_r);
208208   DECLARE_WRITE8_MEMBER(lcd_ctrl_w);
209209   DECLARE_WRITE8_MEMBER(lcd_data_w);
210   DECLARE_READ16_MEMBER(port0_r);
210211 
211212   TIMER_DEVICE_CALLBACK_MEMBER(midi_timer_cb);
213   TIMER_DEVICE_CALLBACK_MEMBER(samples_timer_cb);
212214 
213215private:
214216   UINT8 lcd_data_buffer[256];
215217   int lcd_data_buffer_pos;
216218   UINT8 midi;
217219   int midi_pos;
220   UINT8 port0;
218221};
219222 
220223mt32_state::mt32_state(const machine_config &mconfig, device_type type, const char *tag) :
r19650r19651
253256{
254257   midi_timer->adjust(attotime::from_hz(1));
255258   midi_pos = 0;
259   port0 = 0;
256260}
257261 
258262WRITE8_MEMBER(mt32_state::lcd_ctrl_w)
r19650r19651
286290 
287291TIMER_DEVICE_CALLBACK_MEMBER(mt32_state::midi_timer_cb)
288292{
289   const static UINT8 midi_data[3] = { 0x91, 0x40, 0x40 };
293   const static UINT8 midi_data[3] = { 0x91, 0x40, 0x7f };
290294   midi = midi_data[midi_pos++];
291295   logerror("midi_in %02x\n", midi);
292296   cpu->serial_w(midi);
r19650r19651
294298      midi_timer->adjust(attotime::from_hz(1250));
295299}
296300 
301READ16_MEMBER(mt32_state::port0_r)
302{
303   return port0;
304}
305 
306TIMER_DEVICE_CALLBACK_MEMBER(mt32_state::samples_timer_cb)
307{
308   port0 ^= 0x10;
309}
310 
297311WRITE8_MEMBER(mt32_state::so_w)
298312{
299313   // bit 0   = led
r19650r19651
326340static ADDRESS_MAP_START( mt32_io, AS_IO, 16, mt32_state )
327341   AM_RANGE(i8x9x_device::A7,     i8x9x_device::A7)     AM_READ_PORT("A7")
328342   AM_RANGE(i8x9x_device::SERIAL, i8x9x_device::SERIAL) AM_WRITE(midi_w)
343   AM_RANGE(i8x9x_device::P0,     i8x9x_device::P0)     AM_READ(port0_r)
329344ADDRESS_MAP_END
330345 
331346static MACHINE_CONFIG_START( mt32, mt32_state )
r19650r19651
347362   MCFG_SED1200D0A_ADD( "lcd" )
348363 
349364   MCFG_TIMER_DRIVER_ADD( "midi_timer", mt32_state, midi_timer_cb )
365 
366   MCFG_TIMER_DRIVER_ADD_PERIODIC( "samples_timer", mt32_state, samples_timer_cb, attotime::from_hz(32000*2) )
350367MACHINE_CONFIG_END
351368 
352369ROM_START( mt32 )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team