diff options
| author | 2011-12-14 21:03:40 +0000 | |
|---|---|---|
| committer | 2011-12-14 21:03:40 +0000 | |
| commit | f1103768b5b338d12e5c0e4605ef4cc40a73820b (patch) | |
| tree | 027c00e8cfd083fd8f549e686ee2fd60c5f50833 | |
| parent | 926f8ddfed7522dc8988fa4c6adfbb91611fc88e (diff) | |
Removed partial frame hack from the core
| -rw-r--r-- | src/emu/cpu/hd61700/hd61700.c | 2 | ||||
| -rw-r--r-- | src/emu/devcpu.c | 2 | ||||
| -rw-r--r-- | src/emu/diexec.c | 67 | ||||
| -rw-r--r-- | src/emu/diexec.h | 12 |
4 files changed, 2 insertions, 81 deletions
diff --git a/src/emu/cpu/hd61700/hd61700.c b/src/emu/cpu/hd61700/hd61700.c index 7d7e7da92ab..ff3fa1fb5fc 100644 --- a/src/emu/cpu/hd61700/hd61700.c +++ b/src/emu/cpu/hd61700/hd61700.c @@ -103,7 +103,7 @@ hd61700_cpu_device::hd61700_cpu_device(const machine_config &mconfig, const char : cpu_device(mconfig, HD61700, "HD61700", tag, owner, clock), m_program_config("program", ENDIANNESS_BIG, 16, 18, -1) { - memset(&m_partial_frame_period, 0, sizeof(m_partial_frame_period)); +// memset(&m_partial_frame_period, 0, sizeof(m_partial_frame_period)); } diff --git a/src/emu/devcpu.c b/src/emu/devcpu.c index f5316297f1d..9551ff03d72 100644 --- a/src/emu/devcpu.c +++ b/src/emu/devcpu.c @@ -114,8 +114,6 @@ legacy_cpu_device::legacy_cpu_device(const machine_config &mconfig, device_type m_shortname = get_legacy_string(DEVINFO_STR_SHORTNAME); m_searchpath = m_shortname; - memset(&m_partial_frame_period, 0, sizeof(m_partial_frame_period)); - int tokenbytes = get_legacy_int(CPUINFO_INT_CONTEXT_SIZE); if (tokenbytes == 0) throw emu_fatalerror("Device %s specifies a 0 context size!\n", tag); diff --git a/src/emu/diexec.c b/src/emu/diexec.c index ec905110803..417ed67aea4 100644 --- a/src/emu/diexec.c +++ b/src/emu/diexec.c @@ -76,7 +76,6 @@ device_execute_interface::device_execute_interface(const machine_config &mconfig // m_cothread(cothread_entry_delegate(FUNC(device_execute_interface::run_thread_wrapper), this)), m_disabled(false), m_vblank_interrupt(NULL), - m_vblank_interrupts_per_frame(0), m_vblank_interrupt_screen(NULL), m_timed_interrupt(NULL), m_timed_interrupt_period(attotime::zero), @@ -84,8 +83,6 @@ device_execute_interface::device_execute_interface(const machine_config &mconfig m_nextexec(NULL), m_driver_irq(0), m_timedint_timer(NULL), - m_iloops(0), - m_partial_frame_timer(NULL), m_profiler(PROFILER_IDLE), m_icountptr(NULL), m_cycles_running(0), @@ -143,7 +140,6 @@ void device_execute_interface::static_set_vblank_int(device_t &device, device_in if (!device.interface(exec)) throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT called on device '%s' with no execute interface", device.tag()); exec->m_vblank_interrupt = function; - exec->m_vblank_interrupts_per_frame = rate; exec->m_vblank_interrupt_screen = tag; } @@ -500,26 +496,11 @@ bool device_execute_interface::interface_validity_check(emu_options &options, co mame_printf_error("%s: %s device '%s' has a VBLANK interrupt, but the driver is screenless!\n", driver.source_file, driver.name, device().tag()); error = true; } - else if (m_vblank_interrupt_screen != NULL && m_vblank_interrupts_per_frame != 0) - { - mame_printf_error("%s: %s device '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver.source_file, driver.name, device().tag()); - error = true; - } else if (m_vblank_interrupt_screen != NULL && device().mconfig().devicelist().find(m_vblank_interrupt_screen) == NULL) { mame_printf_error("%s: %s device '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver.source_file, driver.name, device().tag(), m_vblank_interrupt_screen); error = true; } - else if (m_vblank_interrupt_screen == NULL && m_vblank_interrupts_per_frame == 0) - { - mame_printf_error("%s: %s device '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver.source_file, driver.name, device().tag()); - error = true; - } - } - else if (m_vblank_interrupts_per_frame != 0) - { - mame_printf_error("%s: %s device '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver.source_file, driver.name, device().tag()); - error = true; } if (m_timed_interrupt != NULL && m_timed_interrupt_period == attotime::zero) @@ -555,8 +536,6 @@ void device_execute_interface::interface_pre_start() m_input[line].start(this, line); // allocate timers if we need them - if (m_vblank_interrupts_per_frame > 1) - m_partial_frame_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this); if (m_timed_interrupt_period != attotime::zero) m_timedint_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this); @@ -568,7 +547,6 @@ void device_execute_interface::interface_pre_start() m_device.save_item(NAME(m_trigger)); m_device.save_item(NAME(m_totalcycles)); m_device.save_item(NAME(m_localtime)); - m_device.save_item(NAME(m_iloops)); } @@ -614,7 +592,7 @@ void device_execute_interface::interface_post_reset() m_input[line].reset(); // reconfingure VBLANK interrupts - if (m_vblank_interrupts_per_frame > 0 || m_vblank_interrupt_screen != NULL) + if (m_vblank_interrupt_screen != NULL) { // get the screen that will trigger the VBLANK @@ -734,54 +712,11 @@ void device_execute_interface::on_vblank(screen_device &screen, bool vblank_stat if (!vblank_state) return; - // start the interrupt counter - if (!suspended(SUSPEND_REASON_DISABLE)) - m_iloops = 0; - else - m_iloops = -1; - // generate the interrupt callback if (!suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) (*m_vblank_interrupt)(&m_device); - - // if we have more than one interrupt per frame, start the timer now to trigger the rest of them - if (m_vblank_interrupts_per_frame > 1 && !suspended(SUSPEND_REASON_DISABLE)) - { - m_partial_frame_period = device().machine().primary_screen->frame_period() / m_vblank_interrupts_per_frame; - m_partial_frame_timer->adjust(m_partial_frame_period); - } -} - - -//------------------------------------------------- -// static_trigger_partial_frame_interrupt - -// called to trigger a partial frame interrupt -//------------------------------------------------- - -TIMER_CALLBACK( device_execute_interface::static_trigger_partial_frame_interrupt ) -{ - reinterpret_cast<device_execute_interface *>(ptr)->trigger_partial_frame_interrupt(); -} - -void device_execute_interface::trigger_partial_frame_interrupt() -{ - // when we hit 0, reset to the total count - if (m_iloops == 0) - m_iloops = m_vblank_interrupts_per_frame; - - // count one more "iloop" - m_iloops--; - - // call the interrupt handler if we're not suspended - if (!suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) - (*m_vblank_interrupt)(&m_device); - - // set up to retrigger if there's more interrupts to generate - if (m_iloops > 1) - m_partial_frame_timer->adjust(m_partial_frame_period); } - //------------------------------------------------- // static_trigger_periodic_interrupt - timer // callback for timed interrupts diff --git a/src/emu/diexec.h b/src/emu/diexec.h index 5bc1a29f770..80adaa68743 100644 --- a/src/emu/diexec.h +++ b/src/emu/diexec.h @@ -181,9 +181,6 @@ public: int input_state(int linenum) { return m_input[linenum].m_curstate; } void set_irq_callback(device_irq_callback callback); - // deprecated, but still needed for older drivers - int iloops() const { return m_iloops; } - // suspend/resume void suspend(UINT32 reason, bool eatcycles); void resume(UINT32 reason); @@ -277,7 +274,6 @@ protected: // configuration bool m_disabled; // disabled from executing? device_interrupt_func m_vblank_interrupt; // for interrupts tied to VBLANK - int m_vblank_interrupts_per_frame; // usually 1 const char * m_vblank_interrupt_screen; // the screen that causes the VBLANK interrupt device_interrupt_func m_timed_interrupt; // for interrupts not tied to VBLANK attotime m_timed_interrupt_period; // period for periodic interrupts @@ -291,11 +287,6 @@ protected: device_input m_input[MAX_INPUT_LINES]; // data about inputs emu_timer * m_timedint_timer; // reference to this device's periodic interrupt timer - // these below are hacks to support multiple interrupts per frame - INT32 m_iloops; // number of interrupts remaining this frame - emu_timer * m_partial_frame_timer; // the timer that triggers partial frame interrupts - attotime m_partial_frame_period; // the length of one partial frame for interrupt purposes - // cycle counting and executing profile_type m_profiler; // profiler tag int * m_icountptr; // pointer to the icount @@ -324,9 +315,6 @@ private: void on_vblank(screen_device &screen, bool vblank_state); - static void static_trigger_partial_frame_interrupt(running_machine &machine, void *ptr, int param); - void trigger_partial_frame_interrupt(); - static void static_trigger_periodic_interrupt(running_machine &machine, void *ptr, int param); void trigger_periodic_interrupt(); |
