mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
Add A1200 keyboard skeleton device (needs MC68HC05Cx support)
This commit is contained in:
parent
41e4bb5797
commit
aea2c5e14a
4 changed files with 209 additions and 4 deletions
|
@ -1328,6 +1328,8 @@ createMESSProjects(_target, _subtarget, "amiga")
|
|||
files {
|
||||
MAME_DIR .. "src/mame/drivers/amiga.cpp",
|
||||
MAME_DIR .. "src/mame/includes/amiga.h",
|
||||
MAME_DIR .. "src/mame/machine/a1200kbd.cpp",
|
||||
MAME_DIR .. "src/mame/machine/a1200kbd.h",
|
||||
MAME_DIR .. "src/mame/machine/amigakbd.cpp",
|
||||
MAME_DIR .. "src/mame/machine/amigakbd.h",
|
||||
}
|
||||
|
|
|
@ -20,11 +20,13 @@
|
|||
#include "machine/nvram.h"
|
||||
#include "machine/i2cmem.h"
|
||||
#include "machine/amigafdc.h"
|
||||
#include "machine/a1200kbd.h"
|
||||
#include "machine/amigakbd.h"
|
||||
#include "machine/cr511b.h"
|
||||
#include "machine/rp5c01.h"
|
||||
#include "softlist.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -1694,6 +1696,18 @@ static MACHINE_CONFIG_DERIVED_CLASS( a1200, amiga_base, a1200_state )
|
|||
MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, false)
|
||||
MCFG_ATA_INTERFACE_IRQ_HANDLER(DEVWRITELINE("gayle", gayle_device, ide_interrupt_w))
|
||||
|
||||
// keyboard
|
||||
#if 0
|
||||
MCFG_DEVICE_REMOVE("kbd")
|
||||
MCFG_DEVICE_ADD("kbd", A1200KBD, 0)
|
||||
MCFG_A1200_KEYBOARD_KCLK_CALLBACK(DEVWRITELINE("cia_0", mos8520_device, cnt_w))
|
||||
MCFG_A1200_KEYBOARD_KDAT_CALLBACK(DEVWRITELINE("cia_0", mos8520_device, sp_w))
|
||||
MCFG_A1200_KEYBOARD_KRST_CALLBACK(WRITELINE(amiga_state, kbreset_w))
|
||||
|
||||
MCFG_DEVICE_MODIFY("cia_0")
|
||||
MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE("kbd", a1200kbd_device, kdat_w))
|
||||
#endif
|
||||
|
||||
// todo: pcmcia
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -2064,10 +2078,6 @@ ROM_START( a1200 )
|
|||
ROM_SYSTEM_BIOS(2, "logica2", "Logica Diagnostic 2.0")
|
||||
ROMX_LOAD("logica2.u6a", 0x00000, 0x40000, CRC(566bc3f9) SHA1(891d3b7892843517d800d24593168b1d8f1646ca), ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2) | ROM_BIOS(3))
|
||||
ROMX_LOAD("logica2.u6b", 0x00002, 0x40000, CRC(aac94759) SHA1(da8a4f9ae1aa84f5e2a5dcc5c9d7e4378a9698b7), ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2) | ROM_BIOS(3))
|
||||
|
||||
ROM_REGION(0x4000, "keyboard", 0)
|
||||
ROM_LOAD("391508-01.u13", 0x0000, 0x1040, NO_DUMP) // COMMODORE | 391508-01 REV0 | KEYBOARD MPU (MC68HC05C4AFN)
|
||||
ROM_LOAD("391508-02.u13", 0x0000, 0x2f40, NO_DUMP) // Amiga Tech REV1 Keyboard MPU (MC68HC05C12FN)
|
||||
ROM_END
|
||||
|
||||
#define rom_a1200n rom_a1200
|
||||
|
|
117
src/mame/machine/a1200kbd.cpp
Normal file
117
src/mame/machine/a1200kbd.cpp
Normal file
|
@ -0,0 +1,117 @@
|
|||
// license: BSD-3-Clause
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
Amiga 1200 Keyboard
|
||||
|
||||
Skeleton device, needs MC68HC05Cx device support
|
||||
|
||||
391508-01 = Rev 0 is MC68HC05C4AFN
|
||||
391508-02 = Rev 1 is MC68HC05C12FN
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "a1200kbd.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
const device_type A1200KBD = &device_creator<a1200kbd_device>;
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
static ADDRESS_MAP_START( mc68hc05c12_map, AS_PROGRAM, 8, a1200kbd_device )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0x1fff)
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("mpu", 0)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static MACHINE_CONFIG_FRAGMENT( a1200kbd_rev1 )
|
||||
// should be MC68HC05C12
|
||||
MCFG_CPU_ADD("mpu", M6805, XTAL_3MHz)
|
||||
MCFG_CPU_PROGRAM_MAP(mc68hc05c12_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
machine_config_constructor a1200kbd_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( a1200kbd_rev1 );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( a1200kbd_rev1 )
|
||||
ROM_REGION(0x2000, "mpu", 0)
|
||||
// should be 0x3000, i assume it was hacked to allow it to be written to a 68hc705c8
|
||||
// it was labeled "rev b", so it's probably the rev 1 (a rev 0 is in our queue to be decapped)
|
||||
ROM_LOAD("391508-02.bin", 0x0000, 0x2000, BAD_DUMP CRC(2a77eec4) SHA1(301ec6a69404457d912c89e3fc54095eda9f0e93))
|
||||
ROM_END
|
||||
|
||||
const tiny_rom_entry *a1200kbd_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( a1200kbd_rev1 );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// input_ports - device-specific input ports
|
||||
//-------------------------------------------------
|
||||
|
||||
static INPUT_PORTS_START( a1200_us_keyboard )
|
||||
INPUT_PORTS_END
|
||||
|
||||
ioport_constructor a1200kbd_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( a1200_us_keyboard );
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// a1200kbd_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
a1200kbd_device::a1200kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, A1200KBD, "Amiga 1200 Keyboard Rev 1", tag, owner, clock, "a1200kbd_r1", __FILE__),
|
||||
m_write_kclk(*this),
|
||||
m_write_kdat(*this),
|
||||
m_write_krst(*this),
|
||||
m_mpu(*this, "mpu")
|
||||
{}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void a1200kbd_device::device_start()
|
||||
{
|
||||
// resolve callbacks
|
||||
m_write_kclk.resolve_safe();
|
||||
m_write_kdat.resolve_safe();
|
||||
m_write_krst.resolve_safe();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void a1200kbd_device::device_reset()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE
|
||||
//**************************************************************************
|
||||
|
||||
WRITE_LINE_MEMBER( a1200kbd_device::kdat_w )
|
||||
{
|
||||
}
|
76
src/mame/machine/a1200kbd.h
Normal file
76
src/mame/machine/a1200kbd.h
Normal file
|
@ -0,0 +1,76 @@
|
|||
// license: BSD-3-Clause
|
||||
// copyright-holders: Dirk Best
|
||||
/***************************************************************************
|
||||
|
||||
Amiga 1200 Keyboard
|
||||
|
||||
Skeleton device, needs MC68HC05Cx device support
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MAME_MACHINE_A1200KBD_H
|
||||
#define MAME_MACHINE_A1200KBD_H
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m6805/m6805.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_A1200_KEYBOARD_KCLK_CALLBACK(_write) \
|
||||
devcb = &a1200kbd_device::set_kclk_wr_callback(*device, DEVCB_##_write);
|
||||
|
||||
#define MCFG_A1200_KEYBOARD_KDAT_CALLBACK(_write) \
|
||||
devcb = &a1200kbd_device::set_kdat_wr_callback(*device, DEVCB_##_write);
|
||||
|
||||
#define MCFG_A1200_KEYBOARD_KRST_CALLBACK(_write) \
|
||||
devcb = &a1200kbd_device::set_krst_wr_callback(*device, DEVCB_##_write);
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> a1200kbd_device
|
||||
|
||||
class a1200kbd_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
a1200kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
template<class _Object> static devcb_base &set_kclk_wr_callback(device_t &device, _Object object)
|
||||
{ return downcast<a1200kbd_device &>(device).m_write_kclk.set_callback(object); }
|
||||
|
||||
template<class _Object> static devcb_base &set_kdat_wr_callback(device_t &device, _Object object)
|
||||
{ return downcast<a1200kbd_device &>(device).m_write_kdat.set_callback(object); }
|
||||
|
||||
template<class _Object> static devcb_base &set_krst_wr_callback(device_t &device, _Object object)
|
||||
{ return downcast<a1200kbd_device &>(device).m_write_krst.set_callback(object); }
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( kdat_w );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual machine_config_constructor device_mconfig_additions() const override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
devcb_write_line m_write_kclk;
|
||||
devcb_write_line m_write_kdat;
|
||||
devcb_write_line m_write_krst;
|
||||
|
||||
required_device<m6805_device> m_mpu;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
extern const device_type A1200KBD;
|
||||
|
||||
#endif // MAME_MACHINE_A1200KBD_H
|
Loading…
Reference in a new issue