more notes on purported A1200 keyboard program, add compact mode as a config option

This commit is contained in:
Vas Crabb 2018-08-18 01:24:14 +10:00
parent 8cd2eda2a9
commit b6653c476c
2 changed files with 50 additions and 2 deletions

View File

@ -7,6 +7,40 @@
391508-01 = Rev 0 is MC68HC05C4AFN
391508-02 = Rev 1 is MC68HC05C12FN
The ROMs from the mask-programmed MPUs used by Commodore are not
dumped. The program here is for the UVEPROM MC68HC705C8A. It will
not work on the mask-programmed MPUs used by Commodore, due to
differences in the onboard watchdog hardware.
If /IRQ is tied low, this program supports a Num Lock mode mapping
the numeric keypad over the main keyboard for compact keyboards that
lack a physical numeric keypad. To enable it, hold Ctrl and press
Caps Lock; to disable it, press Caps Lock. The Caps Lock LED will
be lit and blink off every 22 seconds or so while Num Lock mode is
active. The following keys are remapped while Num Lock is active:
* 04 4 -> 5A Keypad (
* 05 5 -> 5B Keypad )
* 06 6 -> 5C Keypad /
* 07 7 -> 3D Keypad 7
* 08 8 -> 3E Keypad 8
* 09 9 -> 3F Keypad 9
* 0A 0 -> 5D Keypad *
* 16 U -> 2D Keypad 4
* 17 I -> 2E Keypad 5
* 18 O -> 2F Keypad 6
* 19 P -> 4A Keypad -
* 26 J -> 1D Keypad 1
* 27 K -> 1E Keypad 2
* 28 L -> 1F Keypad 3
* 29 ; -> 5E Keypad +
* 37 M -> 0F Keypad 0
* 39 . -> 3C Keypad .
* 44 Return -> 43 Keypad Enter
Switching between full size and compact modes is currently
implemented as a configuration option, but it should be split off
as a separate device without the numeric keypad.
***************************************************************************/
#include "emu.h"
@ -46,6 +80,12 @@ INPUT_PORTS_END
INPUT_PORTS_START(a1200_us_keyboard)
PORT_INCLUDE(matrix_us)
PORT_INCLUDE(a1200_mod)
// FIXME: split compact mode into a separate device without the numeric keypad
PORT_START("IRQ")
PORT_CONFNAME(0x01, 0x01, "Layout") PORT_CHANGED_MEMBER(DEVICE_SELF, a1200_kbd_device, layout_changed, 0)
PORT_CONFSETTING(0x01, "Full Size")
PORT_CONFSETTING(0x00, "Compact")
INPUT_PORTS_END
@ -84,6 +124,11 @@ WRITE_LINE_MEMBER(a1200_kbd_device::kdat_w)
}
}
INPUT_CHANGED_MEMBER(a1200_kbd_device::layout_changed)
{
m_mpu->set_input_line(M68HC05_IRQ_LINE, newval ? CLEAR_LINE : ASSERT_LINE);
}
READ8_MEMBER(a1200_kbd_device::mpu_portb_r)
{
u8 result(m_host_kdat ? 0xff : 0xfe);
@ -157,8 +202,9 @@ void a1200_kbd_device::device_start()
m_mpu_kdat = true;
}
void a1200_kbd_device::device_reset()
void a1200_kbd_device::device_reset_after_children()
{
m_mpu->set_input_line(M68HC05_IRQ_LINE, BIT(ioport("IRQ")->read(), 0) ? CLEAR_LINE : ASSERT_LINE);
}
} } } // namespace bus::amiga::keyboard

View File

@ -29,6 +29,8 @@ public:
// from host
virtual DECLARE_WRITE_LINE_MEMBER(kdat_w) override;
DECLARE_INPUT_CHANGED_MEMBER(layout_changed);
protected:
// MPU I/O
DECLARE_READ8_MEMBER(mpu_portb_r);
@ -42,7 +44,7 @@ protected:
virtual ioport_constructor device_input_ports() const override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_reset_after_children() override;
private:
required_ioport_array<15> m_rows;