mirror of
https://github.com/holub/mame
synced 2025-10-04 08:28:39 +03:00
agat: Nippel Clock slot device (#5425)
This commit is contained in:
parent
2499d14991
commit
5936b650b6
@ -2125,6 +2125,8 @@ if (BUSES["A2BUS"]~=null) then
|
|||||||
MAME_DIR .. "src/devices/bus/a2bus/agat840k_hle.h",
|
MAME_DIR .. "src/devices/bus/a2bus/agat840k_hle.h",
|
||||||
MAME_DIR .. "src/devices/bus/a2bus/agat_fdc.cpp",
|
MAME_DIR .. "src/devices/bus/a2bus/agat_fdc.cpp",
|
||||||
MAME_DIR .. "src/devices/bus/a2bus/agat_fdc.h",
|
MAME_DIR .. "src/devices/bus/a2bus/agat_fdc.h",
|
||||||
|
MAME_DIR .. "src/devices/bus/a2bus/nippelclock.cpp",
|
||||||
|
MAME_DIR .. "src/devices/bus/a2bus/nippelclock.h",
|
||||||
MAME_DIR .. "src/devices/bus/a2bus/ssprite.cpp",
|
MAME_DIR .. "src/devices/bus/a2bus/ssprite.cpp",
|
||||||
MAME_DIR .. "src/devices/bus/a2bus/ssprite.h",
|
MAME_DIR .. "src/devices/bus/a2bus/ssprite.h",
|
||||||
MAME_DIR .. "src/devices/bus/a2bus/ssbapple.cpp",
|
MAME_DIR .. "src/devices/bus/a2bus/ssbapple.cpp",
|
||||||
|
112
src/devices/bus/a2bus/nippelclock.cpp
Normal file
112
src/devices/bus/a2bus/nippelclock.cpp
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Sergey Svishchev
|
||||||
|
/*********************************************************************
|
||||||
|
|
||||||
|
nippelclock.c
|
||||||
|
|
||||||
|
Implementation of the Nippel Clock card for Agat.
|
||||||
|
|
||||||
|
https://archive.org/details/Nippel_Clock_Agat
|
||||||
|
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
#include "emu.h"
|
||||||
|
#include "nippelclock.h"
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
PARAMETERS
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// GLOBAL VARIABLES
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
DEFINE_DEVICE_TYPE(A2BUS_NIPPELCLOCK, a2bus_nippelclock_device, "nclock", "Nippel Clock")
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
FUNCTION PROTOTYPES
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// device_add_mconfig - add device configuration
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
void a2bus_nippelclock_device::device_add_mconfig(machine_config &config)
|
||||||
|
{
|
||||||
|
MC146818(config, m_rtc, 32.768_kHz_XTAL);
|
||||||
|
m_rtc->irq().set(FUNC(a2bus_nippelclock_device::irq_w));
|
||||||
|
m_rtc->set_24hrs(true);
|
||||||
|
m_rtc->set_binary(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(a2bus_nippelclock_device::irq_w)
|
||||||
|
{
|
||||||
|
if (state == ASSERT_LINE)
|
||||||
|
{
|
||||||
|
raise_slot_irq();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lower_slot_irq();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// LIVE DEVICE
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
a2bus_nippelclock_device::a2bus_nippelclock_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||||
|
: device_t(mconfig, type, tag, owner, clock)
|
||||||
|
, device_a2bus_card_interface(mconfig, *this)
|
||||||
|
, m_rtc(*this, "rtc")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
a2bus_nippelclock_device::a2bus_nippelclock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||||
|
a2bus_nippelclock_device(mconfig, A2BUS_NIPPELCLOCK, tag, owner, clock)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// device_start - device-specific startup
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
void a2bus_nippelclock_device::device_start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void a2bus_nippelclock_device::device_reset()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*-------------------------------------------------
|
||||||
|
read_c0nx - called for reads from this card's c0nx space
|
||||||
|
-------------------------------------------------*/
|
||||||
|
|
||||||
|
uint8_t a2bus_nippelclock_device::read_c0nx(uint8_t offset)
|
||||||
|
{
|
||||||
|
switch (offset)
|
||||||
|
{
|
||||||
|
case 6: case 7:
|
||||||
|
return m_rtc->read(offset - 6);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*-------------------------------------------------
|
||||||
|
write_c0nx - called for writes to this card's c0nx space
|
||||||
|
-------------------------------------------------*/
|
||||||
|
|
||||||
|
void a2bus_nippelclock_device::write_c0nx(uint8_t offset, uint8_t data)
|
||||||
|
{
|
||||||
|
switch (offset)
|
||||||
|
{
|
||||||
|
case 6: case 7:
|
||||||
|
m_rtc->write(offset - 6, data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
51
src/devices/bus/a2bus/nippelclock.h
Normal file
51
src/devices/bus/a2bus/nippelclock.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Sergey Svishchev
|
||||||
|
/*********************************************************************
|
||||||
|
|
||||||
|
nippelclock.h
|
||||||
|
|
||||||
|
Implementation of the Nippel Clock card for Agat.
|
||||||
|
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
#ifndef MAME_BUS_A2BUS_A2NIPPELCLOCK_H
|
||||||
|
#define MAME_BUS_A2BUS_A2NIPPELCLOCK_H
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "a2bus.h"
|
||||||
|
#include "machine/mc146818.h"
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// TYPE DEFINITIONS
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
class a2bus_nippelclock_device:
|
||||||
|
public device_t,
|
||||||
|
public device_a2bus_card_interface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// construction/destruction
|
||||||
|
a2bus_nippelclock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
a2bus_nippelclock_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
|
virtual void device_start() override;
|
||||||
|
virtual void device_reset() override;
|
||||||
|
virtual void device_add_mconfig(machine_config &config) override;
|
||||||
|
|
||||||
|
// overrides of standard a2bus slot functions
|
||||||
|
virtual uint8_t read_c0nx(uint8_t offset) override;
|
||||||
|
virtual void write_c0nx(uint8_t offset, uint8_t data) override;
|
||||||
|
|
||||||
|
required_device<mc146818_device> m_rtc;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(irq_w);
|
||||||
|
};
|
||||||
|
|
||||||
|
// device type definition
|
||||||
|
DECLARE_DEVICE_TYPE(A2BUS_NIPPELCLOCK, a2bus_nippelclock_device)
|
||||||
|
|
||||||
|
#endif // MAME_BUS_A2BUS_A2NIPPELCLOCK_H
|
@ -88,6 +88,7 @@
|
|||||||
#include "bus/a2bus/agat7ram.h"
|
#include "bus/a2bus/agat7ram.h"
|
||||||
#include "bus/a2bus/agat840k_hle.h"
|
#include "bus/a2bus/agat840k_hle.h"
|
||||||
#include "bus/a2bus/agat_fdc.h"
|
#include "bus/a2bus/agat_fdc.h"
|
||||||
|
#include "bus/a2bus/nippelclock.h"
|
||||||
#include "cpu/m6502/r65c02.h"
|
#include "cpu/m6502/r65c02.h"
|
||||||
|
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
@ -1477,6 +1478,7 @@ static void agat9_cards(device_slot_interface &device)
|
|||||||
device.option_add("a9fdc140", A2BUS_AGAT9_FDC); // Disk II clone -- decimal 3.089.173 (reworked for agat9)
|
device.option_add("a9fdc140", A2BUS_AGAT9_FDC); // Disk II clone -- decimal 3.089.173 (reworked for agat9)
|
||||||
device.option_add("a9fdchle", A2BUS_AGAT840K_HLE); // 840K floppy controller -- decimal 7.104.351 or 3.089.023?
|
device.option_add("a9fdchle", A2BUS_AGAT840K_HLE); // 840K floppy controller -- decimal 7.104.351 or 3.089.023?
|
||||||
device.option_add("a9fdc", A2BUS_AGAT_FDC); // 840K floppy controller LLE
|
device.option_add("a9fdc", A2BUS_AGAT_FDC); // 840K floppy controller LLE
|
||||||
|
device.option_add("a9nclock", A2BUS_NIPPELCLOCK); // Nippel Clock (mc146818)
|
||||||
}
|
}
|
||||||
|
|
||||||
void agat7_state::agat7(machine_config &config)
|
void agat7_state::agat7(machine_config &config)
|
||||||
|
Loading…
Reference in New Issue
Block a user