From c401273bdabb933622ac16b8effb69a420e57b86 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 11 Dec 2023 12:15:09 +0100 Subject: schedule/timer: be more consistent with s32 param --- src/devices/machine/atahle.cpp | 4 ++-- src/devices/machine/atahle.h | 4 ++-- src/devices/machine/chessmachine.cpp | 6 +++--- src/devices/machine/chessmachine.h | 6 +++--- src/devices/machine/edlc.cpp | 4 ++-- src/devices/machine/edlc.h | 4 ++-- src/devices/machine/timer.h | 6 +++--- src/devices/sound/ymfm_mame.h | 6 +++--- src/emu/schedule.cpp | 6 +++--- src/emu/schedule.h | 12 ++++++------ src/emu/sound.cpp | 2 +- src/emu/video.cpp | 2 +- src/emu/video.h | 2 +- src/mame/alliedleisure/killcom.cpp | 6 +++--- src/mame/alliedleisure/killcom.h | 6 +++--- src/mame/cinematronics/leland_a.cpp | 2 +- src/mame/cinematronics/leland_a.h | 2 +- src/mame/dg/aviion88k.cpp | 2 +- src/mame/sgi/hpc3.cpp | 2 +- src/mame/sgi/hpc3.h | 2 +- src/mame/shared/gottlieb_a.cpp | 8 ++++---- src/mame/shared/gottlieb_a.h | 8 ++++---- src/mame/shared/seibusound.cpp | 2 +- src/mame/shared/seibusound.h | 2 +- src/mame/shared/xbox_usb.cpp | 2 +- src/mame/shared/xbox_usb.h | 2 +- src/osd/osdnet.cpp | 2 +- src/osd/osdnet.h | 2 +- 28 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/devices/machine/atahle.cpp b/src/devices/machine/atahle.cpp index 1e5ca3ce289..6decde4cb9f 100644 --- a/src/devices/machine/atahle.cpp +++ b/src/devices/machine/atahle.cpp @@ -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); diff --git a/src/devices/machine/atahle.h b/src/devices/machine/atahle.h index 68ec21e2ecd..63a176c51ed 100644 --- a/src/devices/machine/atahle.h +++ b/src/devices/machine/atahle.h @@ -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; diff --git a/src/devices/machine/chessmachine.cpp b/src/devices/machine/chessmachine.cpp index 2515de8e801..b833ccc6108 100644 --- a/src/devices/machine/chessmachine.cpp +++ b/src/devices/machine/chessmachine.cpp @@ -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); diff --git a/src/devices/machine/chessmachine.h b/src/devices/machine/chessmachine.h index 345cbcafa3e..d07ac764e5b 100644 --- a/src/devices/machine/chessmachine.h +++ b/src/devices/machine/chessmachine.h @@ -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); } diff --git a/src/devices/machine/edlc.cpp b/src/devices/machine/edlc.cpp index 5a76d5fd96f..28b33a807b8 100644 --- a/src/devices/machine/edlc.cpp +++ b/src/devices/machine/edlc.cpp @@ -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)) || diff --git a/src/devices/machine/edlc.h b/src/devices/machine/edlc.h index 8023c92030c..a450bcba9cd 100644 --- a/src/devices/machine/edlc.h +++ b/src/devices/machine/edlc.h @@ -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); diff --git a/src/devices/machine/timer.h b/src/devices/machine/timer.h index dbd7e0763f6..965235c7b6f 100644 --- a/src/devices/machine/timer.h +++ b/src/devices/machine/timer.h @@ -77,14 +77,14 @@ public: template void set_callback(T &&... args) { m_callback.set(std::forward(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 diff --git a/src/devices/sound/ymfm_mame.h b/src/devices/sound/ymfm_mame.h index 479abdf038b..e6400e76d6c 100644 --- a/src/devices/sound/ymfm_mame.h +++ b/src/devices/sound/ymfm_mame.h @@ -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 diff --git a/src/emu/schedule.cpp b/src/emu/schedule.cpp index aa1f3df50c0..acc596d6798 100644 --- a/src/emu/schedule.cpp +++ b/src/emu/schedule.cpp @@ -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(), diff --git a/src/emu/schedule.h b/src/emu/schedule.h index 338560594d9..e13fc18d573 100644 --- a/src/emu/schedule.h +++ b/src/emu/schedule.h @@ -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; diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index 129112ddb9a..c9626855197 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -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"); diff --git a/src/emu/video.cpp b/src/emu/video.cpp index 3c4a39ee862..06a16b76cda 100644 --- a/src/emu/video.cpp +++ b/src/emu/video.cpp @@ -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); diff --git a/src/emu/video.h b/src/emu/video.h index da57d6b8a98..efc819ae793 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -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 diff --git a/src/mame/alliedleisure/killcom.cpp b/src/mame/alliedleisure/killcom.cpp index 0901d5ca840..c8dc7701127 100644 --- a/src/mame/alliedleisure/killcom.cpp +++ b/src/mame/alliedleisure/killcom.cpp @@ -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) { diff --git a/src/mame/alliedleisure/killcom.h b/src/mame/alliedleisure/killcom.h index 8e037a0fe4b..5e1bd2ae8df 100644 --- a/src/mame/alliedleisure/killcom.h +++ b/src/mame/alliedleisure/killcom.h @@ -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); } diff --git a/src/mame/cinematronics/leland_a.cpp b/src/mame/cinematronics/leland_a.cpp index f49f83b8915..53940f6f19e 100644 --- a/src/mame/cinematronics/leland_a.cpp +++ b/src/mame/cinematronics/leland_a.cpp @@ -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(); diff --git a/src/mame/cinematronics/leland_a.h b/src/mame/cinematronics/leland_a.h index 724d27a297e..7d23bb779d8 100644 --- a/src/mame/cinematronics/leland_a.h +++ b/src/mame/cinematronics/leland_a.h @@ -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< expired\n", param); } + void pit_timer(s32 param) { LOG("pit_timer<%d> expired\n", param); } template u32 pit_cnt_r() { return m_pit[N]->enabled() ? m_pit[N]->elapsed().as_ticks(m_cpu->clock()) : 0; } template u32 pit_sts_r() { return m_pit_cmd[N]; } diff --git a/src/mame/sgi/hpc3.cpp b/src/mame/sgi/hpc3.cpp index a72ea9603ef..84f46bba4c6 100644 --- a/src/mame/sgi/hpc3.cpp +++ b/src/mame/sgi/hpc3.cpp @@ -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? diff --git a/src/mame/sgi/hpc3.h b/src/mame/sgi/hpc3.h index a0fac1cb4f8..c06ba7f9d91 100644 --- a/src/mame/sgi/hpc3.h +++ b/src/mame/sgi/hpc3.h @@ -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); diff --git a/src/mame/shared/gottlieb_a.cpp b/src/mame/shared/gottlieb_a.cpp index cb6813a71a7..38e7506ae71 100644 --- a/src/mame/shared/gottlieb_a.cpp +++ b/src/mame/shared/gottlieb_a.cpp @@ -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) diff --git a/src/mame/shared/gottlieb_a.h b/src/mame/shared/gottlieb_a.h index 43a1adf2703..46e6433ce1b 100644 --- a/src/mame/shared/gottlieb_a.h +++ b/src/mame/shared/gottlieb_a.h @@ -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); diff --git a/src/mame/shared/seibusound.cpp b/src/mame/shared/seibusound.cpp index 7a70a019cf9..00b8a1bcd01 100644 --- a/src/mame/shared/seibusound.cpp +++ b/src/mame/shared/seibusound.cpp @@ -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); } diff --git a/src/mame/shared/seibusound.h b/src/mame/shared/seibusound.h index 9e309779d4d..81dfb52edbc 100644 --- a/src/mame/shared/seibusound.h +++ b/src/mame/shared/seibusound.h @@ -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 diff --git a/src/mame/shared/xbox_usb.cpp b/src/mame/shared/xbox_usb.cpp index 751ca3455ef..a1981380208 100644 --- a/src/mame/shared/xbox_usb.cpp +++ b/src/mame/shared/xbox_usb.cpp @@ -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; diff --git a/src/mame/shared/xbox_usb.h b/src/mame/shared/xbox_usb.h index ca65121243e..5e772ea101c 100644 --- a/src/mame/shared/xbox_usb.h +++ b/src/mame/shared/xbox_usb.h @@ -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); diff --git a/src/osd/osdnet.cpp b/src/osd/osdnet.cpp index 0281bed9c1c..aded09bcaff 100644 --- a/src/osd/osdnet.cpp +++ b/src/osd/osdnet.cpp @@ -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; diff --git a/src/osd/osdnet.h b/src/osd/osdnet.h index 0c78f0a1fad..05276e7e149 100644 --- a/src/osd/osdnet.h +++ b/src/osd/osdnet.h @@ -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; -- cgit v1.2.3