mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
remove legacy calls (nw)
This commit is contained in:
parent
c51af01720
commit
90e4e205d4
@ -375,41 +375,6 @@ INTERRUPT_GEN_MEMBER( driver_device::irq7_line_hold ) { device.execute().set_i
|
||||
INTERRUPT_GEN_MEMBER( driver_device::irq7_line_pulse ) { generic_pulse_irq_line(device.execute(), 7, 1); }
|
||||
INTERRUPT_GEN_MEMBER( driver_device::irq7_line_assert ) { device.execute().set_input_line(7, ASSERT_LINE); }
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// WATCHDOG READ/WRITE HELPERS
|
||||
//**************************************************************************
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
|
||||
//-------------------------------------------------
|
||||
// 8-bit reset read/write handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER( driver_device::watchdog_reset_w ) { machine().watchdog_reset(); }
|
||||
READ8_MEMBER( driver_device::watchdog_reset_r ) { machine().watchdog_reset(); return space.unmap(); }
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// 16-bit reset read/write handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE16_MEMBER( driver_device::watchdog_reset16_w ) { machine().watchdog_reset(); }
|
||||
READ16_MEMBER( driver_device::watchdog_reset16_r ) { machine().watchdog_reset(); return space.unmap(); }
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// 32-bit reset read/write handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE32_MEMBER( driver_device::watchdog_reset32_w ) { machine().watchdog_reset(); }
|
||||
READ32_MEMBER( driver_device::watchdog_reset32_r ) { machine().watchdog_reset(); return space.unmap(); }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GENERIC SOUND COMMAND LATCHING
|
||||
//**************************************************************************
|
||||
|
@ -179,16 +179,6 @@ public:
|
||||
INTERRUPT_GEN_MEMBER( irq7_line_pulse );
|
||||
INTERRUPT_GEN_MEMBER( irq7_line_assert );
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
// watchdog read/write handlers
|
||||
DECLARE_WRITE8_MEMBER( watchdog_reset_w );
|
||||
DECLARE_READ8_MEMBER( watchdog_reset_r );
|
||||
DECLARE_WRITE16_MEMBER( watchdog_reset16_w );
|
||||
DECLARE_READ16_MEMBER( watchdog_reset16_r );
|
||||
DECLARE_WRITE32_MEMBER( watchdog_reset32_w );
|
||||
DECLARE_READ32_MEMBER( watchdog_reset32_r );
|
||||
#endif
|
||||
|
||||
// generic audio
|
||||
void soundlatch_setclearedvalue(UINT16 value) { m_latch_clear_value = value; }
|
||||
|
||||
|
@ -230,16 +230,6 @@ void running_machine::start()
|
||||
m_rom_load = make_unique_clear<rom_load_manager>(*this);
|
||||
m_memory.initialize();
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
// initialize the watchdog
|
||||
m_watchdog_counter = 0;
|
||||
m_watchdog_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::watchdog_fired), this));
|
||||
if (config().m_watchdog_vblank_count != 0 && primary_screen != nullptr)
|
||||
primary_screen->register_vblank_callback(vblank_state_delegate(FUNC(running_machine::watchdog_vblank), this));
|
||||
save().save_item(NAME(m_watchdog_enabled));
|
||||
save().save_item(NAME(m_watchdog_counter));
|
||||
#endif
|
||||
|
||||
// save the random seed or save states might be broken in drivers that use the rand() method
|
||||
save().save_item(NAME(m_rand_seed));
|
||||
|
||||
@ -879,13 +869,6 @@ void running_machine::soft_reset(void *ptr, INT32 param)
|
||||
// temporarily in the reset phase
|
||||
m_current_phase = MACHINE_PHASE_RESET;
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
// set up the watchdog timer; only start off enabled if explicitly configured
|
||||
m_watchdog_enabled = (config().m_watchdog_vblank_count != 0 || config().m_watchdog_time != attotime::zero);
|
||||
watchdog_reset();
|
||||
m_watchdog_enabled = true;
|
||||
#endif
|
||||
|
||||
// call all registered reset callbacks
|
||||
call_notifiers(MACHINE_NOTIFY_RESET);
|
||||
|
||||
@ -894,90 +877,6 @@ void running_machine::soft_reset(void *ptr, INT32 param)
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// watchdog_reset - reset the watchdog timer
|
||||
//-------------------------------------------------
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
void running_machine::watchdog_reset()
|
||||
{
|
||||
// if we're not enabled, skip it
|
||||
if (!m_watchdog_enabled)
|
||||
m_watchdog_timer->adjust(attotime::never);
|
||||
|
||||
// VBLANK-based watchdog?
|
||||
else if (config().m_watchdog_vblank_count != 0)
|
||||
m_watchdog_counter = config().m_watchdog_vblank_count;
|
||||
|
||||
// timer-based watchdog?
|
||||
else if (config().m_watchdog_time != attotime::zero)
|
||||
m_watchdog_timer->adjust(config().m_watchdog_time);
|
||||
|
||||
// default to an obscene amount of time (3 seconds)
|
||||
else
|
||||
m_watchdog_timer->adjust(attotime::from_seconds(3));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// watchdog_enable - reset the watchdog timer
|
||||
//-------------------------------------------------
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
void running_machine::watchdog_enable(bool enable)
|
||||
{
|
||||
// when re-enabled, we reset our state
|
||||
if (m_watchdog_enabled != enable)
|
||||
{
|
||||
m_watchdog_enabled = enable;
|
||||
watchdog_reset();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// watchdog_fired - watchdog timer callback
|
||||
//-------------------------------------------------
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
void running_machine::watchdog_fired(void *ptr, INT32 param)
|
||||
{
|
||||
logerror("Reset caused by the watchdog!!!\n");
|
||||
|
||||
bool verbose = options().verbose();
|
||||
#ifdef MAME_DEBUG
|
||||
verbose = true;
|
||||
#endif
|
||||
if (verbose)
|
||||
popmessage("Reset caused by the watchdog!!!\n");
|
||||
|
||||
schedule_soft_reset();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// watchdog_vblank - VBLANK state callback for
|
||||
// watchdog timers
|
||||
//-------------------------------------------------
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
void running_machine::watchdog_vblank(screen_device &screen, bool vblank_state)
|
||||
{
|
||||
// VBLANK starting
|
||||
if (vblank_state && m_watchdog_enabled)
|
||||
{
|
||||
// check the watchdog
|
||||
if (config().m_watchdog_vblank_count != 0)
|
||||
if (--m_watchdog_counter == 0)
|
||||
watchdog_fired();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// logfile_callback - callback for logging to
|
||||
// logfile
|
||||
|
@ -227,13 +227,6 @@ public:
|
||||
void base_datetime(system_time &systime);
|
||||
void current_datetime(system_time &systime);
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
// watchdog control
|
||||
void watchdog_reset();
|
||||
void watchdog_enable(bool enable = true);
|
||||
INT32 get_vblank_watchdog_counter() const { return m_watchdog_counter; }
|
||||
#endif
|
||||
|
||||
// misc
|
||||
void popmessage() const { popmessage(static_cast<char const *>(nullptr)); }
|
||||
template <typename Format, typename... Params> void popmessage(Format &&fmt, Params &&... args) const;
|
||||
@ -264,10 +257,6 @@ private:
|
||||
std::string get_statename(const char *statename_opt) const;
|
||||
void handle_saveload();
|
||||
void soft_reset(void *ptr = nullptr, INT32 param = 0);
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
void watchdog_fired(void *ptr = nullptr, INT32 param = 0);
|
||||
void watchdog_vblank(screen_device &screen, bool vblank_state);
|
||||
#endif
|
||||
std::string nvram_filename(device_t &device) const;
|
||||
void nvram_load();
|
||||
void nvram_save();
|
||||
@ -313,13 +302,6 @@ private:
|
||||
bool m_exit_pending; // is an exit pending?
|
||||
emu_timer * m_soft_reset_timer; // timer used to schedule a soft reset
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
// watchdog state
|
||||
bool m_watchdog_enabled; // is the watchdog enabled?
|
||||
INT32 m_watchdog_counter; // counter for watchdog tracking
|
||||
emu_timer * m_watchdog_timer; // timer for watchdog tracking
|
||||
#endif
|
||||
|
||||
// misc state
|
||||
UINT32 m_rand_seed; // current random number seed
|
||||
bool m_ui_active; // ui active or not (useful for games / systems with keyboard inputs)
|
||||
|
@ -23,10 +23,6 @@
|
||||
|
||||
machine_config::machine_config(const game_driver &gamedrv, emu_options &options)
|
||||
: m_minimum_quantum(attotime::zero),
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
m_watchdog_vblank_count(0),
|
||||
m_watchdog_time(attotime::zero),
|
||||
#endif
|
||||
m_default_layout(nullptr),
|
||||
m_gamedrv(gamedrv),
|
||||
m_options(options)
|
||||
|
@ -68,10 +68,6 @@ public:
|
||||
// public state
|
||||
attotime m_minimum_quantum; // minimum scheduling quantum
|
||||
std::string m_perfect_cpu_quantum; // tag of CPU to use for "perfect" scheduling
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
INT32 m_watchdog_vblank_count; // number of VBLANKs until the watchdog kills us
|
||||
attotime m_watchdog_time; // length of time until the watchdog kills us
|
||||
#endif
|
||||
|
||||
// other parameters
|
||||
const internal_layout * m_default_layout; // default layout for this machine
|
||||
@ -201,14 +197,6 @@ References an external machine config.
|
||||
#define MCFG_QUANTUM_PERFECT_CPU(_cputag) \
|
||||
config.m_perfect_cpu_quantum = owner->subtag(_cputag);
|
||||
|
||||
#ifdef LEGACY_WATCHDOG
|
||||
// watchdog configuration
|
||||
#define MCFG_WATCHDOG_VBLANK_INIT(_count) \
|
||||
config.m_watchdog_vblank_count = _count;
|
||||
#define MCFG_WATCHDOG_TIME_INIT(_time) \
|
||||
config.m_watchdog_time = _time;
|
||||
#endif
|
||||
|
||||
// core video parameters
|
||||
#define MCFG_DEFAULT_LAYOUT(_layout) \
|
||||
config.m_default_layout = &(_layout);
|
||||
|
Loading…
Reference in New Issue
Block a user