summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/imagedev/midiin.c
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2013-01-15 14:45:36 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2013-01-15 14:45:36 +0000
commit9c0f4e6683fca1c971d2cc047ffec09d8ac46bcd (patch)
tree93c4d1afaccf63176bfd08b303d062389ca7289c /src/emu/imagedev/midiin.c
parent4efc1f7b053ca2503da6ba3b27f91ee0d68d6c3e (diff)
MIDI: Fixed several bugs and bumped the input buffer sizes [R. Belmont]
Diffstat (limited to 'src/emu/imagedev/midiin.c')
-rw-r--r--src/emu/imagedev/midiin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/emu/imagedev/midiin.c b/src/emu/imagedev/midiin.c
index 8e335b48da3..6ad6126e42e 100644
--- a/src/emu/imagedev/midiin.c
+++ b/src/emu/imagedev/midiin.c
@@ -34,6 +34,7 @@ void midiin_device::device_start()
{
m_input_func.resolve(m_input_callback, *this);
m_timer = timer_alloc(0);
+ m_midi = NULL;
}
void midiin_device::device_reset()
@@ -71,10 +72,10 @@ void midiin_device::device_config_complete(void)
void midiin_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- UINT8 buf[256];
+ UINT8 buf[8192*4];
int bytesRead;
- if (osd_poll_midi_channel(m_midi))
+ while (osd_poll_midi_channel(m_midi))
{
bytesRead = osd_read_midi_channel(m_midi, buf);
@@ -112,7 +113,10 @@ bool midiin_device::call_load(void)
void midiin_device::call_unload(void)
{
- osd_close_midi_channel(m_midi);
+ if (m_midi)
+ {
+ osd_close_midi_channel(m_midi);
+ }
}
void midiin_device::tra_complete()