From e763499ac7f9af92641329b069781d53cbf6a37e Mon Sep 17 00:00:00 2001 From: cracyc Date: Mon, 21 Sep 2015 12:17:06 -0500 Subject: [PATCH] mc146818: 24/12 default setting (nw) --- src/devices/machine/mc146818.c | 8 ++++++-- src/devices/machine/mc146818.h | 6 +++++- src/mess/drivers/pcd.c | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/devices/machine/mc146818.c b/src/devices/machine/mc146818.c index 5b74badcea5..1509e7586e9 100644 --- a/src/devices/machine/mc146818.c +++ b/src/devices/machine/mc146818.c @@ -39,7 +39,8 @@ mc146818_device::mc146818_device(const machine_config &mconfig, const char *tag, m_century_index(-1), m_epoch(0), m_use_utc(false), - m_binary(false) + m_binary(false), + m_hour(false) { } @@ -52,7 +53,8 @@ mc146818_device::mc146818_device(const machine_config &mconfig, device_type type m_century_index(-1), m_epoch(0), m_use_utc(false), - m_binary(false) + m_binary(false), + m_hour(false) { } @@ -205,6 +207,8 @@ void mc146818_device::nvram_default() if(m_binary) m_data[0x0b] |= REG_B_DM; + if(m_hour) + m_data[0x0b] |= REG_B_24_12; set_base_datetime(); update_timer(); diff --git a/src/devices/machine/mc146818.h b/src/devices/machine/mc146818.h index daee386d000..1793402fb64 100644 --- a/src/devices/machine/mc146818.h +++ b/src/devices/machine/mc146818.h @@ -37,6 +37,9 @@ #define MCFG_MC146818_BINARY(_bin) \ downcast(device)->set_binary(_bin); +#define MCFG_MC146818_24_12(_hour) \ + downcast(device)->set_hour(_hour); + #define MCFG_MC146818_EPOCH(_epoch) \ downcast(device)->set_epoch(_epoch); @@ -59,6 +62,7 @@ public: void set_century_index(int century_index) { m_century_index = century_index; } void set_use_utc(bool use_utc) { m_use_utc = use_utc; } void set_binary(bool binary) { m_binary = binary; } + void set_hour(bool hour) { m_hour = hour; } void set_epoch(int epoch) { m_epoch = epoch; } // read/write access @@ -174,7 +178,7 @@ private: devcb_write_line m_write_irq; int m_century_index, m_epoch; - bool m_use_utc, m_binary; + bool m_use_utc, m_binary, m_hour; }; diff --git a/src/mess/drivers/pcd.c b/src/mess/drivers/pcd.c index 1db99512ebf..727efdb102a 100644 --- a/src/mess/drivers/pcd.c +++ b/src/mess/drivers/pcd.c @@ -539,6 +539,7 @@ static MACHINE_CONFIG_START( pcd, pcd_state ) MCFG_MC146818_IRQ_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir7_w)) MCFG_MC146818_BINARY(true) MCFG_MC146818_EPOCH(1900) + MCFG_MC146818_24_12(true) MCFG_DEVICE_ADD("keyboard", PCD_KEYBOARD, 0) MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(DEVWRITELINE("usart2", mc2661_device, rx_w))