dirtc: Devirtualize set_current_time, cleaning up misuse

* midway/atlantis.cpp: Remove unused leftover
This commit is contained in:
AJR 2024-10-25 17:54:10 -04:00
parent f9b482b09c
commit d66d88b1ab
5 changed files with 7 additions and 17 deletions

View file

@ -25,9 +25,6 @@ public:
void s_w(int state); // S button
void power_w(int state);
// set_current_time is unused here (only using dirtc for the counters)
virtual void set_current_time(const system_time &systime) override { ; }
protected:
// device_t implementation
virtual void device_start() override ATTR_COLD;
@ -39,6 +36,7 @@ protected:
virtual bool nvram_write(util::write_stream &file) override;
virtual void rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) override { ; } // unused
virtual bool rtc_battery_backed() const override { return false; } // only using dirtc for the counters
private:
enum mode : u8

View file

@ -109,15 +109,6 @@ enum
DEFINE_DEVICE_TYPE(RP5C15, rp5c15_device, "rp5c15", "Ricoh RP5C15 RTC")
// x68k wants an epoch base (1980-2079) on init, mz2500 do not ("print date$" under basicv2)
// megast_* tbd
void rp5c15_device::set_current_time(const system_time &systime)
{
const system_time::full_time &time = m_use_utc ? systime.utc_time : systime.local_time;
set_time(true, time.year + m_year_offset, time.month + 1, time.mday, time.weekday + 1,
time.hour, time.minute, time.second);
}
//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@ -286,8 +277,12 @@ TIMER_CALLBACK_MEMBER(rp5c15_device::advance_output_clock)
void rp5c15_device::rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second)
{
// x68k wants an epoch base (1980-2079) on init, mz2500 do not ("print date$" under basicv2)
// megast_* tbd
year += m_year_offset;
m_reg[MODE01][REGISTER_LEAP_YEAR] = year % 4;
write_counter(REGISTER_1_YEAR, year);
write_counter(REGISTER_1_YEAR, year % 100);
write_counter(REGISTER_1_MONTH, month);
write_counter(REGISTER_1_DAY, day);
m_reg[MODE00][REGISTER_DAY_OF_THE_WEEK] = day_of_week;

View file

@ -39,8 +39,6 @@ public:
uint8_t read(offs_t offset);
void write(offs_t offset, uint8_t data);
virtual void set_current_time(const system_time &systime) override;
protected:
// device-level overrides
virtual void device_start() override ATTR_COLD;

View file

@ -51,7 +51,7 @@ public:
void set_use_utc(bool use_utc) { m_use_utc = use_utc; }
void set_time(bool update, int year, int month, int day, int day_of_week, int hour, int minute, int second);
virtual void set_current_time(const system_time &systime);
void set_current_time(const system_time &systime);
bool has_battery() const { return rtc_battery_backed(); }

View file

@ -363,7 +363,6 @@ uint8_t atlantis_state::cmos_r(offs_t offset)
void atlantis_state::cmos_w(offs_t offset, uint8_t data, uint8_t mem_mask)
{
system_time systime;
// User I/O 0 = Allow write to cmos[0]. Serial Write Enable?
if (offset == 0 && (m_user_io_state & 0x1)) {
// Data written is shifted by 1 bit each time. Maybe a serial line output?