mirror of
https://github.com/holub/mame
synced 2025-06-30 07:58:56 +03:00
yamaha/ymdx9.cpp: Resolved issues with incoming MIDI. (#10702)
* Added divider on 500 kHz midi serial clock. * Added missing MIDI data read handler.
This commit is contained in:
parent
dbb71a0180
commit
21f7f35c19
@ -159,6 +159,14 @@ private:
|
|||||||
* @return uint8_t The value read from the port.
|
* @return uint8_t The value read from the port.
|
||||||
*/
|
*/
|
||||||
uint8_t p1_r(offs_t offset);
|
uint8_t p1_r(offs_t offset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Handle a read from the synth's IO Port 2.
|
||||||
|
* This function is used to handle incoming serial data.
|
||||||
|
* @param offset The offset into the memory mapped region being read.
|
||||||
|
* @return uint8_t The value read from the port.
|
||||||
|
*/
|
||||||
|
uint8_t p2_r(offs_t offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -242,6 +250,7 @@ void yamaha_dx9_state::dx9(machine_config &config)
|
|||||||
// Unlike the DX7 only IO port 1 is used.
|
// Unlike the DX7 only IO port 1 is used.
|
||||||
// The direction flags of other ports are set, however they are never read, or written.
|
// The direction flags of other ports are set, however they are never read, or written.
|
||||||
m_maincpu->in_p1_cb().set(FUNC(yamaha_dx9_state::p1_r));
|
m_maincpu->in_p1_cb().set(FUNC(yamaha_dx9_state::p1_r));
|
||||||
|
m_maincpu->in_p2_cb().set(FUNC(yamaha_dx9_state::p2_r));
|
||||||
m_maincpu->out_p1_cb().set(FUNC(yamaha_dx9_state::p1_w));
|
m_maincpu->out_p1_cb().set(FUNC(yamaha_dx9_state::p1_w));
|
||||||
|
|
||||||
NVRAM(config, "ram1", nvram_device::DEFAULT_ALL_0);
|
NVRAM(config, "ram1", nvram_device::DEFAULT_ALL_0);
|
||||||
@ -255,7 +264,7 @@ void yamaha_dx9_state::dx9(machine_config &config)
|
|||||||
m_adc->in_callback<4>().set_constant(0x80);
|
m_adc->in_callback<4>().set_constant(0x80);
|
||||||
|
|
||||||
// Configure MIDI.
|
// Configure MIDI.
|
||||||
auto &midiclock(CLOCK(config, "midiclock", 500_kHz_XTAL));
|
auto &midiclock(CLOCK(config, "midiclock", 500_kHz_XTAL / 2));
|
||||||
midiclock.signal_handler().set(FUNC(yamaha_dx9_state::midiclock_w));
|
midiclock.signal_handler().set(FUNC(yamaha_dx9_state::midiclock_w));
|
||||||
|
|
||||||
MIDI_PORT(config, "mdin", midiin_slot, "midiin").rxd_handler().set(FUNC(yamaha_dx9_state::midi_r));
|
MIDI_PORT(config, "mdin", midiin_slot, "midiin").rxd_handler().set(FUNC(yamaha_dx9_state::midi_r));
|
||||||
@ -323,7 +332,16 @@ uint8_t yamaha_dx9_state::p1_r(offs_t offset)
|
|||||||
return m_adc->eoc_r() << 4;
|
return m_adc->eoc_r() << 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* yamaha_dx9_state::p2_r
|
||||||
|
*/
|
||||||
|
uint8_t yamaha_dx9_state::p2_r(offs_t offset)
|
||||||
|
{
|
||||||
|
return m_rx_data << 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* yamaha_dx9_state::p1_w
|
* yamaha_dx9_state::p1_w
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user