diff options
author | Nathan Woods <npwoods@mess.org> | 2017-03-19 11:32:15 -0400 |
---|---|---|
committer | Nathan Woods <npwoods@mess.org> | 2017-03-19 11:32:15 -0400 |
commit | af846ce015eff22f99765ab0b4b223fbc3346b73 (patch) | |
tree | c40e0d13e058661ce99136485ad2603d39574807 /src/devices/bus/coco/cococart.cpp | |
parent | c91a6b84f4a6a62c7bdf5371b566c4197d98d7f9 (diff) |
[CoCo] Further cleanups in CoCo cartridge slot signal handling
This is an attempt to make how the various signals on the CoCo cartridge slot (CART, NMI, HALT) a bit more standardized and less ad hoc, especially with the practice of Program Paks tying the CART line to Q. This should fix some outstanding bugs in how these signals were passed around when using the CoCo Multi-Pak interface.
Diffstat (limited to 'src/devices/bus/coco/cococart.cpp')
-rw-r--r-- | src/devices/bus/coco/cococart.cpp | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/src/devices/bus/coco/cococart.cpp b/src/devices/bus/coco/cococart.cpp index 082ce971149..154b930e881 100644 --- a/src/devices/bus/coco/cococart.cpp +++ b/src/devices/bus/coco/cococart.cpp @@ -239,8 +239,8 @@ void cococart_slot_device::twiddle_line_if_q(coco_cartridge_line &line) //------------------------------------------------- -// coco_cartridge_twiddle_q_lines - hack to -// support twiddling the Q line +// twiddle_q_lines - hack to support twiddling the +// Q line //------------------------------------------------- void cococart_slot_device::twiddle_q_lines() @@ -252,34 +252,63 @@ void cococart_slot_device::twiddle_q_lines() //------------------------------------------------- -// coco_cartridge_set_line +// set_line_value //------------------------------------------------- -void cococart_slot_device::cart_set_line(cococart_slot_device::line which, cococart_slot_device::line_value value) +void cococart_slot_device::set_line_value(cococart_slot_device::line which, cococart_slot_device::line_value value) { switch (which) { - case line::CART: - set_line_timer(m_cart_line, value); - break; + case cococart_slot_device::line::CART: + set_line_timer(m_cart_line, value); + break; + + case cococart_slot_device::line::NMI: + set_line_timer(m_nmi_line, value); + break; + + case cococart_slot_device::line::HALT: + set_line_timer(m_halt_line, value); + break; + + case cococart_slot_device::line::SOUND_ENABLE: + if (m_cart) + m_cart->set_sound_enable(value != cococart_slot_device::line_value::CLEAR); + break; + } +} - case line::NMI: - set_line_timer(m_nmi_line, value); - break; - case line::HALT: - set_line_timer(m_halt_line, value); - break; - case line::SOUND_ENABLE: - if (m_cart) - m_cart->set_sound_enable(value != cococart_slot_device::line_value::CLEAR); - break; +//------------------------------------------------- +// get_line_value +//------------------------------------------------- + +cococart_slot_device::line_value cococart_slot_device::get_line_value(cococart_slot_device::line which) const +{ + line_value result; + switch (which) + { + case cococart_slot_device::line::CART: + result = m_cart_line.value; + break; + + case cococart_slot_device::line::NMI: + result = m_nmi_line.value; + break; + + case cococart_slot_device::line::HALT: + result = m_halt_line.value; + break; + + default: + result = line_value::CLEAR; + break; } + return result; } - //------------------------------------------------- // get_cart_base //------------------------------------------------- |