Skip to content

Commit 344090f

Browse files
authored
sinclair/glukrs.cpp: Added expected clock value validation (#13944)
1 parent e3317d9 commit 344090f

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

src/mame/sinclair/glukrs.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,24 @@
1111
****************************************************************************/
1212

1313
#include "emu.h"
14+
#include "osdcore.h"
1415
#include "glukrs.h"
1516

1617
glukrs_device::glukrs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
17-
: mc146818_device(mconfig, GLUKRS, tag, owner, 32'768)
18+
: mc146818_device(mconfig, GLUKRS, tag, owner, clock)
1819
{
1920
m_tuc = 1984;
2021
set_24hrs(true);
2122
}
2223

24+
void glukrs_device::device_validity_check(validity_checker &valid) const
25+
{
26+
mc146818_device::device_validity_check(valid);
27+
28+
if (clock() != 32'768)
29+
osd_printf_warning("Clock %u is different from expected 32'768\n", clock());
30+
}
31+
2332
void glukrs_device::device_start()
2433
{
2534
mc146818_device::device_start();

src/mame/sinclair/glukrs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class glukrs_device : public mc146818_device
1313
{
1414
public:
15-
glukrs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
15+
glukrs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 32'768);
1616

1717
void enable() { m_glukrs_active = true; }
1818
void disable() { m_glukrs_active = false; }
@@ -24,6 +24,7 @@ class glukrs_device : public mc146818_device
2424
virtual void data_w(u8 data) override { if (m_glukrs_active) { mc146818_device::data_w(data); } }
2525

2626
protected:
27+
virtual void device_validity_check(validity_checker &valid) const override;
2728
void device_start() override ATTR_COLD;
2829
void device_reset() override ATTR_COLD;
2930

src/mame/sinclair/pentevo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ void pentevo_state::pentevo(machine_config &config)
728728
m_ram->set_default_size("4M");
729729
RAM(config, m_char_ram).set_default_size("2048").set_default_value(0);
730730

731-
GLUKRS(config, m_glukrs);
731+
GLUKRS(config, m_glukrs, 32.768_kHz_XTAL);
732732
SPI_SDCARD(config, m_sdcard, 0);
733733
m_sdcard->set_prefer_sdhc();
734734
m_sdcard->spi_miso_callback().set(FUNC(pentevo_state::spi_miso_w));

src/mame/sinclair/tsconf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ void tsconf_state::tsconf(machine_config &config)
296296

297297
m_ram->set_default_size("4096K").set_default_value(0x00); // must be random but 0x00 behaves better than 0xff in tested software
298298

299-
GLUKRS(config, m_glukrs);
299+
GLUKRS(config, m_glukrs, 32.768_kHz_XTAL);
300300

301301
TSCONF_DMA(config, m_dma, 28_MHz_XTAL);
302302
m_dma->in_mreq_callback().set(FUNC(tsconf_state::ram_read16));

0 commit comments

Comments
 (0)