mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
psi98: Add HLE ASCII keyboard and make it default
Keyboard input now works
This commit is contained in:
parent
b48961385d
commit
75734b41f8
@ -3148,5 +3148,7 @@ if (BUSES["PSI_KEYBOARD"]~=null) then
|
|||||||
MAME_DIR .. "src/devices/bus/psi_kbd/psi_kbd.h",
|
MAME_DIR .. "src/devices/bus/psi_kbd/psi_kbd.h",
|
||||||
MAME_DIR .. "src/devices/bus/psi_kbd/ergoline.cpp",
|
MAME_DIR .. "src/devices/bus/psi_kbd/ergoline.cpp",
|
||||||
MAME_DIR .. "src/devices/bus/psi_kbd/ergoline.h",
|
MAME_DIR .. "src/devices/bus/psi_kbd/ergoline.h",
|
||||||
|
MAME_DIR .. "src/devices/bus/psi_kbd/hle.cpp",
|
||||||
|
MAME_DIR .. "src/devices/bus/psi_kbd/hle.h",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
59
src/devices/bus/psi_kbd/hle.cpp
Normal file
59
src/devices/bus/psi_kbd/hle.cpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
// license: GPL-2.0+
|
||||||
|
// copyright-holders: Dirk Best
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
PSI HLE Keyboard
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "emu.h"
|
||||||
|
#include "hle.h"
|
||||||
|
#include "machine/keyboard.h"
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// DEVICE DEFINITIONS
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
DEFINE_DEVICE_TYPE(PSI_HLE_KEYBOARD, psi_hle_keyboard_device, "psi_hle_kbd", "PSI HLE Keyboard")
|
||||||
|
|
||||||
|
|
||||||
|
MACHINE_CONFIG_MEMBER( psi_hle_keyboard_device::device_add_mconfig )
|
||||||
|
MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
|
||||||
|
MCFG_GENERIC_KEYBOARD_CB(PUT(psi_hle_keyboard_device, kbd_put))
|
||||||
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// LIVE DEVICE
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// psi_hle_keyboard_device - constructor
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
psi_hle_keyboard_device::psi_hle_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||||
|
device_t(mconfig, PSI_HLE_KEYBOARD, tag, owner, clock),
|
||||||
|
device_psi_keyboard_interface(mconfig, *this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// device_start - device-specific startup
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
void psi_hle_keyboard_device::device_start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// INTERFACE
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
void psi_hle_keyboard_device::kbd_put(uint8_t data)
|
||||||
|
{
|
||||||
|
m_host->key_data_w(machine().dummy_space(), 0, data);
|
||||||
|
m_host->key_strobe_w(1);
|
||||||
|
m_host->key_strobe_w(0);
|
||||||
|
}
|
43
src/devices/bus/psi_kbd/hle.h
Normal file
43
src/devices/bus/psi_kbd/hle.h
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// license: GPL-2.0+
|
||||||
|
// copyright-holders: Dirk Best
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
PSI HLE ASCII Keyboard
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef MAME_BUS_PSI_KBD_HLE_H
|
||||||
|
#define MAME_BUS_PSI_KBD_HLE_H
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "psi_kbd.h"
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// TYPE DEFINITIONS
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
// ======================> psi_hle_keyboard_device
|
||||||
|
|
||||||
|
class psi_hle_keyboard_device : public device_t, public device_psi_keyboard_interface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// construction/destruction
|
||||||
|
psi_hle_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// device_t overrides
|
||||||
|
virtual void device_add_mconfig(machine_config &config) override;
|
||||||
|
virtual void device_start() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void kbd_put(uint8_t data);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// device type definition
|
||||||
|
DECLARE_DEVICE_TYPE(PSI_HLE_KEYBOARD, psi_hle_keyboard_device)
|
||||||
|
|
||||||
|
|
||||||
|
#endif // MAME_BUS_PSI_KBD_HLE_H
|
@ -9,6 +9,7 @@
|
|||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "psi_kbd.h"
|
#include "psi_kbd.h"
|
||||||
#include "ergoline.h"
|
#include "ergoline.h"
|
||||||
|
#include "hle.h"
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -107,4 +108,5 @@ device_psi_keyboard_interface::~device_psi_keyboard_interface()
|
|||||||
|
|
||||||
SLOT_INTERFACE_START( psi_keyboard_devices )
|
SLOT_INTERFACE_START( psi_keyboard_devices )
|
||||||
SLOT_INTERFACE("ergoline", ERGOLINE_KEYBOARD)
|
SLOT_INTERFACE("ergoline", ERGOLINE_KEYBOARD)
|
||||||
|
SLOT_INTERFACE("hle", PSI_HLE_KEYBOARD)
|
||||||
SLOT_INTERFACE_END
|
SLOT_INTERFACE_END
|
||||||
|
@ -520,7 +520,7 @@ static MACHINE_CONFIG_START( psi98 )
|
|||||||
MCFG_FLOPPY_DRIVE_ADD("fdc:0", kdt6_floppies, "525qd", floppy_image_device::default_floppy_formats)
|
MCFG_FLOPPY_DRIVE_ADD("fdc:0", kdt6_floppies, "525qd", floppy_image_device::default_floppy_formats)
|
||||||
MCFG_FLOPPY_DRIVE_ADD("fdc:1", kdt6_floppies, "525qd", floppy_image_device::default_floppy_formats)
|
MCFG_FLOPPY_DRIVE_ADD("fdc:1", kdt6_floppies, "525qd", floppy_image_device::default_floppy_formats)
|
||||||
|
|
||||||
MCFG_PSI_KEYBOARD_INTERFACE_ADD("kbd", "ergoline")
|
MCFG_PSI_KEYBOARD_INTERFACE_ADD("kbd", "hle")
|
||||||
MCFG_PSI_KEYBOARD_RX_HANDLER(DEVWRITELINE("sio", z80sio_device, rxb_w))
|
MCFG_PSI_KEYBOARD_RX_HANDLER(DEVWRITELINE("sio", z80sio_device, rxb_w))
|
||||||
MCFG_PSI_KEYBOARD_KEY_STROBE_HANDLER(DEVWRITELINE("ctc2", z80ctc_device, trg1))
|
MCFG_PSI_KEYBOARD_KEY_STROBE_HANDLER(DEVWRITELINE("ctc2", z80ctc_device, trg1))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user