mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
fidel_clockdiv: remove unneeded code
This commit is contained in:
parent
b9f94fe239
commit
81a4d2953b
@ -18,29 +18,14 @@ TODO:
|
||||
#include "machine/fidel_clockdiv.h"
|
||||
|
||||
|
||||
// machine start/reset
|
||||
// machine start
|
||||
|
||||
void fidel_clockdiv_state::machine_start()
|
||||
{
|
||||
// zerofill
|
||||
m_div_config = 0;
|
||||
m_read_tap = nullptr;
|
||||
m_write_tap = nullptr;
|
||||
|
||||
// register for savestates
|
||||
save_item(NAME(m_div_status));
|
||||
save_item(NAME(m_div_config));
|
||||
save_item(NAME(m_div_scale));
|
||||
|
||||
// dummy timer for cpu divider
|
||||
m_div_timer = machine().scheduler().timer_alloc(timer_expired_delegate(), this);
|
||||
}
|
||||
|
||||
void fidel_clockdiv_state::machine_reset()
|
||||
{
|
||||
div_refresh();
|
||||
}
|
||||
|
||||
|
||||
// input ports
|
||||
|
||||
@ -89,8 +74,7 @@ void fidel_clockdiv_state::div_refresh(ioport_value val)
|
||||
|
||||
m_maincpu->set_clock_scale(1.0);
|
||||
m_div_status = ~0;
|
||||
m_div_config = val;
|
||||
m_div_scale = (m_div_config & 1) ? 0.25 : 0.5;
|
||||
m_div_scale = (val & 1) ? 0.25 : 0.5;
|
||||
|
||||
// stop high frequency background timer if cpu divider is disabled
|
||||
attotime period = (val) ? attotime::from_hz(m_maincpu->clock()) : attotime::never;
|
||||
@ -105,7 +89,7 @@ void fidel_clockdiv_state::div_refresh(ioport_value val)
|
||||
m_write_tap = nullptr;
|
||||
}
|
||||
|
||||
if (m_div_config)
|
||||
if (val)
|
||||
{
|
||||
address_space &program = m_maincpu->space(AS_PROGRAM);
|
||||
|
||||
|
@ -24,7 +24,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void machine_reset() override { div_refresh(); }
|
||||
virtual void device_post_load() override { div_refresh(); }
|
||||
|
||||
// devices/pointers
|
||||
required_device<cpu_device> m_maincpu;
|
||||
@ -35,11 +36,10 @@ protected:
|
||||
private:
|
||||
inline void div_set_cpu_freq(offs_t offset);
|
||||
|
||||
memory_passthrough_handler *m_read_tap;
|
||||
memory_passthrough_handler *m_write_tap;
|
||||
memory_passthrough_handler *m_read_tap = nullptr;
|
||||
memory_passthrough_handler *m_write_tap = nullptr;
|
||||
|
||||
u16 m_div_status;
|
||||
ioport_value m_div_config;
|
||||
double m_div_scale;
|
||||
emu_timer *m_div_timer;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user