mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
schedule/timer: be more consistent with s32 param
This commit is contained in:
parent
05e69b43e9
commit
c401273bda
@ -157,7 +157,7 @@ TIMER_CALLBACK_MEMBER(ata_hle_device_base::empty_tick)
|
||||
fill_buffer();
|
||||
}
|
||||
|
||||
void ata_hle_device_base::finished_busy(int param)
|
||||
void ata_hle_device_base::finished_busy(int32_t param)
|
||||
{
|
||||
switch (param)
|
||||
{
|
||||
@ -406,7 +406,7 @@ void ata_hle_device_base::update_irq()
|
||||
set_irq_out(CLEAR_LINE);
|
||||
}
|
||||
|
||||
void ata_hle_device_base::start_busy(const attotime &time, int param)
|
||||
void ata_hle_device_base::start_busy(const attotime &time, int32_t param)
|
||||
{
|
||||
m_status |= IDE_STATUS_BSY;
|
||||
m_busy_timer->adjust(time, param);
|
||||
|
@ -72,7 +72,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void start_busy(const attotime &time, int param);
|
||||
void start_busy(const attotime &time, int32_t param);
|
||||
void stop_busy();
|
||||
|
||||
int dev() { return (m_device_head & IDE_DEVICE_HEAD_DRV) >> 4; }
|
||||
@ -239,7 +239,7 @@ private:
|
||||
void write_buffer_full();
|
||||
void start_diagnostic();
|
||||
void finished_diagnostic();
|
||||
void finished_busy(int param);
|
||||
void finished_busy(int32_t param);
|
||||
bool set_dma_mode(int word);
|
||||
|
||||
int m_csel;
|
||||
|
@ -73,7 +73,7 @@ void chessmachine_device::device_start()
|
||||
// external handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
void chessmachine_device::data0_w_sync(int param)
|
||||
void chessmachine_device::data0_w_sync(s32 param)
|
||||
{
|
||||
if ((m_latch[0] & 1) != param)
|
||||
{
|
||||
@ -87,7 +87,7 @@ void chessmachine_device::data0_w(int state)
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(chessmachine_device::data0_w_sync), this), state ? 1 : 0);
|
||||
}
|
||||
|
||||
void chessmachine_device::data1_w_sync(int param)
|
||||
void chessmachine_device::data1_w_sync(s32 param)
|
||||
{
|
||||
if ((m_latch[0] & 0x80) != param)
|
||||
{
|
||||
@ -104,7 +104,7 @@ void chessmachine_device::data1_w(int state)
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(chessmachine_device::data1_w_sync), this), state ? 0x80 : 0);
|
||||
}
|
||||
|
||||
void chessmachine_device::reset_w_sync(int param)
|
||||
void chessmachine_device::reset_w_sync(s32 param)
|
||||
{
|
||||
m_maincpu->set_input_line(INPUT_LINE_RESET, param ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
|
@ -49,9 +49,9 @@ private:
|
||||
u8 m_latch[2];
|
||||
bool m_bootrom_enabled;
|
||||
|
||||
void data0_w_sync(int param);
|
||||
void data1_w_sync(int param);
|
||||
void reset_w_sync(int param);
|
||||
void data0_w_sync(s32 param);
|
||||
void data1_w_sync(s32 param);
|
||||
void reset_w_sync(s32 param);
|
||||
|
||||
void install_bootrom(bool enable);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(disable_bootrom) { install_bootrom(false); }
|
||||
|
@ -253,7 +253,7 @@ void seeq8003_device::tx_command_w(u8 data)
|
||||
m_tx_command = data;
|
||||
}
|
||||
|
||||
void seeq8003_device::transmit(int param)
|
||||
void seeq8003_device::transmit(s32 param)
|
||||
{
|
||||
if (m_tx_fifo.queue_length())
|
||||
{
|
||||
@ -328,7 +328,7 @@ int seeq8003_device::receive(u8 *buf, int length)
|
||||
return length;
|
||||
}
|
||||
|
||||
void seeq8003_device::interrupt(int param)
|
||||
void seeq8003_device::interrupt(s32 param)
|
||||
{
|
||||
int const state =
|
||||
(!(m_tx_status & TXS_O) && (m_tx_status & m_tx_command & TXS_M)) ||
|
||||
|
@ -56,9 +56,9 @@ protected:
|
||||
virtual void tx_command_w(u8 data);
|
||||
|
||||
// helpers
|
||||
void transmit(int param);
|
||||
void transmit(s32 param);
|
||||
int receive(u8 *buf, int length);
|
||||
void interrupt(int param = 0);
|
||||
void interrupt(s32 param = 0);
|
||||
virtual bool address_filter(u8 *address);
|
||||
void dump_bytes(u8 *buf, int length);
|
||||
|
||||
|
@ -77,14 +77,14 @@ public:
|
||||
template <typename... T> void set_callback(T &&... args) { m_callback.set(std::forward<T>(args)...); }
|
||||
|
||||
void set_start_delay(const attotime &delay) { m_start_delay = delay; }
|
||||
void config_param(int param) { m_param = param; }
|
||||
void config_param(s32 param) { m_param = param; }
|
||||
|
||||
// property getters
|
||||
int param() const { return m_timer->param(); }
|
||||
s32 param() const { return m_timer->param(); }
|
||||
bool enabled() const { return m_timer->enabled(); }
|
||||
|
||||
// property setters
|
||||
void set_param(int param) const { if(m_type != TIMER_TYPE_GENERIC) fatalerror("Cannot change parameter on a non-generic timer.\n"); m_timer->set_param(param); }
|
||||
void set_param(s32 param) const { if(m_type != TIMER_TYPE_GENERIC) fatalerror("Cannot change parameter on a non-generic timer.\n"); m_timer->set_param(param); }
|
||||
void enable(bool enable = true) const { m_timer->enable(enable); }
|
||||
|
||||
// adjustments
|
||||
|
@ -144,9 +144,9 @@ protected:
|
||||
}
|
||||
|
||||
// timer callbacks
|
||||
void fm_mode_write(int param) { m_engine->engine_mode_write(param); }
|
||||
void fm_check_interrupts(int param) { m_engine->engine_check_interrupts(); }
|
||||
void fm_timer_handler(int param) { m_engine->engine_timer_expired(param); }
|
||||
void fm_mode_write(s32 param) { m_engine->engine_mode_write(param); }
|
||||
void fm_check_interrupts(s32 param) { m_engine->engine_check_interrupts(); }
|
||||
void fm_timer_handler(s32 param) { m_engine->engine_timer_expired(param); }
|
||||
|
||||
// internal state
|
||||
attotime m_busy_end; // busy end time
|
||||
|
@ -76,7 +76,7 @@ inline emu_timer &emu_timer::init(
|
||||
running_machine &machine,
|
||||
timer_expired_delegate &&callback,
|
||||
attotime start_delay,
|
||||
int param,
|
||||
s32 param,
|
||||
bool temporary)
|
||||
{
|
||||
// ensure the entire timer state is clean
|
||||
@ -613,7 +613,7 @@ emu_timer *device_scheduler::timer_alloc(timer_expired_delegate callback)
|
||||
// amount of time
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_scheduler::timer_set(const attotime &duration, timer_expired_delegate callback, int param)
|
||||
void device_scheduler::timer_set(const attotime &duration, timer_expired_delegate callback, s32 param)
|
||||
{
|
||||
[[maybe_unused]] emu_timer &timer = m_timer_allocator.alloc()->init(
|
||||
machine(),
|
||||
@ -630,7 +630,7 @@ void device_scheduler::timer_set(const attotime &duration, timer_expired_delegat
|
||||
// timer and set it to go off as soon as possible
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_scheduler::synchronize(timer_expired_delegate callback, int param)
|
||||
void device_scheduler::synchronize(timer_expired_delegate callback, s32 param)
|
||||
{
|
||||
m_timer_allocator.alloc()->init(
|
||||
machine(),
|
||||
|
@ -39,11 +39,11 @@ class emu_timer
|
||||
public:
|
||||
// getters
|
||||
bool enabled() const noexcept { return m_enabled; }
|
||||
int param() const noexcept { return m_param; }
|
||||
s32 param() const noexcept { return m_param; }
|
||||
|
||||
// setters
|
||||
bool enable(bool enable = true) noexcept;
|
||||
void set_param(int param) noexcept { m_param = param; }
|
||||
void set_param(s32 param) noexcept { m_param = param; }
|
||||
|
||||
// control
|
||||
void reset(const attotime &duration = attotime::never) noexcept { adjust(duration, m_param, m_period); }
|
||||
@ -66,7 +66,7 @@ private:
|
||||
running_machine &machine,
|
||||
timer_expired_delegate &&callback,
|
||||
attotime start_delay,
|
||||
int param,
|
||||
s32 param,
|
||||
bool temporary);
|
||||
|
||||
// internal helpers
|
||||
@ -121,9 +121,9 @@ public:
|
||||
|
||||
// timers, specified by callback/name
|
||||
emu_timer *timer_alloc(timer_expired_delegate callback);
|
||||
[[deprecated("timer_set is deprecated; please avoid anonymous timers. Use TIMER_CALLBACK_MEMBER and an allocated emu_timer instead.")]]
|
||||
void timer_set(const attotime &duration, timer_expired_delegate callback, int param = 0);
|
||||
void synchronize(timer_expired_delegate callback = timer_expired_delegate(), int param = 0);
|
||||
[[deprecated("timer_set is deprecated; please avoid anonymous timers. Use an allocated emu_timer instead.")]]
|
||||
void timer_set(const attotime &duration, timer_expired_delegate callback, s32 param = 0);
|
||||
void synchronize(timer_expired_delegate callback = timer_expired_delegate(), s32 param = 0);
|
||||
|
||||
// debugging
|
||||
void dump_timers() const;
|
||||
|
@ -1508,7 +1508,7 @@ stream_buffer::sample_t sound_manager::adjust_toward_compressor_scale(stream_buf
|
||||
// and send it to the OSD layer
|
||||
//-------------------------------------------------
|
||||
|
||||
void sound_manager::update(int param)
|
||||
void sound_manager::update(s32 param)
|
||||
{
|
||||
LOG("sound_update\n");
|
||||
|
||||
|
@ -518,7 +518,7 @@ void video_manager::exit()
|
||||
// when there are no screens to drive it
|
||||
//-------------------------------------------------
|
||||
|
||||
void video_manager::screenless_update_callback(int param)
|
||||
void video_manager::screenless_update_callback(s32 param)
|
||||
{
|
||||
// force an update
|
||||
frame_update(false);
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
private:
|
||||
// internal helpers
|
||||
void exit();
|
||||
void screenless_update_callback(int param);
|
||||
void screenless_update_callback(s32 param);
|
||||
void postload();
|
||||
|
||||
// effective value helpers
|
||||
|
@ -298,19 +298,19 @@ void killcom_state::coin_w(int state)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void killcom_state::audio_cmd_w_sync(int param)
|
||||
void killcom_state::audio_cmd_w_sync(int32_t param)
|
||||
{
|
||||
m_riot->pa_w(0, param, 0x7f);
|
||||
}
|
||||
|
||||
|
||||
void killcom_state::audio_trigger_w_sync(int param)
|
||||
void killcom_state::audio_trigger_w_sync(int32_t param)
|
||||
{
|
||||
m_riot->pa_bit_w<7>(param);
|
||||
}
|
||||
|
||||
|
||||
void killcom_state::audio_reset_w_sync(int param)
|
||||
void killcom_state::audio_reset_w_sync(int32_t param)
|
||||
{
|
||||
if (param && !m_audio_reset)
|
||||
{
|
||||
|
@ -75,9 +75,9 @@ private:
|
||||
void io_select_w(uint8_t data);
|
||||
uint8_t io_port_r();
|
||||
|
||||
void audio_cmd_w_sync(int param);
|
||||
void audio_trigger_w_sync(int param);
|
||||
void audio_reset_w_sync(int param);
|
||||
void audio_cmd_w_sync(int32_t param);
|
||||
void audio_trigger_w_sync(int32_t param);
|
||||
void audio_reset_w_sync(int32_t param);
|
||||
void audio_cmd_w(uint8_t data) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(killcom_state::audio_cmd_w_sync), this), data); }
|
||||
void audio_trigger_w(int state) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(killcom_state::audio_trigger_w_sync), this), state); }
|
||||
void audio_reset_w(int state) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(killcom_state::audio_reset_w_sync), this), state); }
|
||||
|
@ -493,7 +493,7 @@ void leland_80186_sound_device::command_hi_w(u8 data)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void leland_80186_sound_device::delayed_response_r(int param)
|
||||
void leland_80186_sound_device::delayed_response_r(s32 param)
|
||||
{
|
||||
int checkpc = param;
|
||||
int pc = m_master->pc();
|
||||
|
@ -71,7 +71,7 @@ protected:
|
||||
void leland_80186_map_program(address_map &map);
|
||||
|
||||
private:
|
||||
void delayed_response_r(int param);
|
||||
void delayed_response_r(s32 param);
|
||||
void set_clock_line(int which, int state) { m_clock_active = state ? (m_clock_active | (1<<which)) : (m_clock_active & ~(1<<which)); }
|
||||
|
||||
// internal state
|
||||
|
@ -78,7 +78,7 @@ protected:
|
||||
// address maps
|
||||
void cpu_map(address_map &map);
|
||||
|
||||
void pit_timer(int param) { LOG("pit_timer<%d> expired\n", param); }
|
||||
void pit_timer(s32 param) { LOG("pit_timer<%d> expired\n", param); }
|
||||
|
||||
template <unsigned N> u32 pit_cnt_r() { return m_pit[N]->enabled() ? m_pit[N]->elapsed().as_ticks(m_cpu->clock()) : 0; }
|
||||
template <unsigned N> u32 pit_sts_r() { return m_pit_cmd[N]; }
|
||||
|
@ -1071,7 +1071,7 @@ void hpc3_device::eeprom_w(uint32_t data)
|
||||
m_eeprom_clk_cb(BIT(data, 2));
|
||||
}
|
||||
|
||||
void hpc3_device::enet_transmit(int param)
|
||||
void hpc3_device::enet_transmit(int32_t param)
|
||||
{
|
||||
// save the first transmit buffer descriptor pointer
|
||||
// TODO: not sure how cpfbdp and ppfbdp work, perhaps round-robin?
|
||||
|
@ -117,7 +117,7 @@ protected:
|
||||
void scsi_drq(bool state, int channel);
|
||||
//void scsi_dma(int channel);
|
||||
|
||||
void enet_transmit(int param = 0);
|
||||
void enet_transmit(int32_t param = 0);
|
||||
void enet_misc_w(u32 data);
|
||||
bool enet_rx_bc_dec(unsigned const count = 1);
|
||||
|
||||
|
@ -67,7 +67,7 @@ gottlieb_sound_p2_device::gottlieb_sound_p2_device(const machine_config &mconfig
|
||||
// write - handle an external command write
|
||||
//-------------------------------------------------
|
||||
|
||||
void gottlieb_sound_p2_device::write_sync(int param)
|
||||
void gottlieb_sound_p2_device::write_sync(s32 param)
|
||||
{
|
||||
// write the command data to bits 0-3 (also bit 6 used in system1 pinballs)
|
||||
u8 pb0_3 = ~param & 0x4f; // U7
|
||||
@ -176,7 +176,7 @@ gottlieb_sound_p3_device::gottlieb_sound_p3_device(const machine_config &mconfig
|
||||
// write - handle an external command write
|
||||
//-------------------------------------------------
|
||||
|
||||
void gottlieb_sound_p3_device::write_sync(int param)
|
||||
void gottlieb_sound_p3_device::write_sync(s32 param)
|
||||
{
|
||||
// low 4 bits NORed together, triggers IRQ on falling edge
|
||||
bool irqclock = (~param & 0xf) == 0;
|
||||
@ -286,7 +286,7 @@ gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig
|
||||
// write - handle an external command write
|
||||
//-------------------------------------------------
|
||||
|
||||
void gottlieb_sound_r1_device::write_sync(int param)
|
||||
void gottlieb_sound_r1_device::write_sync(s32 param)
|
||||
{
|
||||
// write the command data to the low 6 bits, the low 4 bits are also NANDed together and go to PA7
|
||||
u8 pa0_5 = ~param & 0x3f;
|
||||
@ -742,7 +742,7 @@ gottlieb_sound_p4_device::gottlieb_sound_p4_device(const machine_config &mconfig
|
||||
// write - handle an external command write
|
||||
//-------------------------------------------------
|
||||
|
||||
void gottlieb_sound_p4_device::write_sync(int param)
|
||||
void gottlieb_sound_p4_device::write_sync(s32 param)
|
||||
{
|
||||
// when data is not 0xff, the transparent latch at A3 allows it to pass through unmolested
|
||||
if (param != 0xff)
|
||||
|
@ -59,7 +59,7 @@ protected:
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
|
||||
virtual void write_sync(int param);
|
||||
virtual void write_sync(s32 param);
|
||||
void p2_map(address_map &map);
|
||||
|
||||
// devices
|
||||
@ -85,7 +85,7 @@ protected:
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
|
||||
virtual void write_sync(int param) override;
|
||||
virtual void write_sync(s32 param) override;
|
||||
|
||||
private:
|
||||
void r6530b_w(u8 data);
|
||||
@ -116,7 +116,7 @@ protected:
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
|
||||
void write_sync(int param);
|
||||
void write_sync(s32 param);
|
||||
|
||||
virtual void r1_map(address_map &map);
|
||||
|
||||
@ -196,7 +196,7 @@ protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
void write_sync(int param);
|
||||
void write_sync(s32 param);
|
||||
TIMER_CALLBACK_MEMBER(set_nmi);
|
||||
TIMER_CALLBACK_MEMBER(clear_nmi);
|
||||
|
||||
|
@ -130,7 +130,7 @@ void seibu_sound_device::device_reset()
|
||||
update_irq_lines(VECTOR_INIT);
|
||||
}
|
||||
|
||||
void seibu_sound_device::update_irq_lines(int param)
|
||||
void seibu_sound_device::update_irq_lines(s32 param)
|
||||
{
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(seibu_sound_device::update_irq_synced), this), param);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ protected:
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
void update_irq_lines(int param);
|
||||
void update_irq_lines(s32 param);
|
||||
TIMER_CALLBACK_MEMBER(update_irq_synced);
|
||||
|
||||
// device callbacks
|
||||
|
@ -222,7 +222,7 @@ void ohci_usb_controller::write(offs_t offset, uint32_t data)
|
||||
ohcist.hc_regs[offset] = data;
|
||||
}
|
||||
|
||||
void ohci_usb_controller::timer(int param)
|
||||
void ohci_usb_controller::timer(s32 param)
|
||||
{
|
||||
uint32_t plh;
|
||||
int changed = 0;
|
||||
|
@ -362,7 +362,7 @@ public:
|
||||
|
||||
void start();
|
||||
void reset();
|
||||
void timer(int param);
|
||||
void timer(s32 param);
|
||||
|
||||
uint32_t read(offs_t offset);
|
||||
void write(offs_t offset, uint32_t data);
|
||||
|
@ -64,7 +64,7 @@ int osd_netdev::send(uint8_t *buf, int len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void osd_netdev::recv(int param)
|
||||
void osd_netdev::recv(int32_t param)
|
||||
{
|
||||
uint8_t *buf;
|
||||
int len;
|
||||
|
@ -44,7 +44,7 @@ protected:
|
||||
virtual int recv_dev(uint8_t **buf);
|
||||
|
||||
private:
|
||||
void recv(int param);
|
||||
void recv(int32_t param);
|
||||
|
||||
class device_network_interface *m_dev;
|
||||
emu_timer *m_timer;
|
||||
|
Loading…
Reference in New Issue
Block a user