Previous 15994 Revisions Next

r1720 Sunday 24th February, 2008 at 13:05:08 UTC by Nathan Woods
Fix for screenless systems from Mamedev
[src/emu]cpuexec.c devintrf.c

src/emu/devintrf.c
r1719r1720
285285{
286286   const device_config *curdev;
287287
288   assert(listhead != NULL);
289
290288   /* find the device in the list */
291289   for (curdev = listhead; curdev != NULL; curdev = curdev->next)
292290      if (device_matches_type(curdev, type) && index-- == 0)
src/emu/cpuexec.c
r1719r1720
163163
164164void cpuexec_init(running_machine *machine)
165165{
166   int numscreens = video_screen_count(machine->config);
166167   int cpunum;
167168
168169   /* if there has been no VBLANK time specified in the MACHINE_DRIVER, compute it now
169170       from the visible area */
170   if (machine->screen[0].vblank == 0 && !machine->screen[0].oldstyle_vblank_supplied)
171   if (numscreens > 0 && machine->screen[0].vblank == 0 && !machine->screen[0].oldstyle_vblank_supplied)
171172      machine->screen[0].vblank = (machine->screen[0].refresh / machine->screen[0].height) * (machine->screen[0].height - (machine->screen[0].visarea.max_y + 1 - machine->screen[0].visarea.min_y));
172173
173174   /* allocate vblank and refresh timers, and compute the initial timing */
r1719r1720
866867
867868void cpu_compute_vblank_timing(running_machine *machine)
868869{
869   refresh_period = attotime_make(0, machine->screen[0].refresh);
870   int numscreens = video_screen_count(machine->config);
871   attoseconds_t refresh_attosecs;
870872
873   refresh_attosecs = (numscreens == 0) ? HZ_TO_ATTOSECONDS(60) : machine->screen[0].refresh;
874   refresh_period = attotime_make(0, refresh_attosecs);
875
871876   /* recompute the vblank period */
872   vblank_period = attotime_make(0, machine->screen[0].refresh / (vblank_multiplier ? vblank_multiplier : 1));
877   vblank_period = attotime_make(0, refresh_attosecs / (vblank_multiplier ? vblank_multiplier : 1));
873878   if (vblank_timer != NULL && timer_enable(vblank_timer, FALSE))
874879   {
875880      attotime remaining = timer_timeleft(vblank_timer);
r1719r1720
11611166
11621167static void cpu_inittimers(running_machine *machine)
11631168{
1169   int numscreens = video_screen_count(machine->config);
1170   attoseconds_t refresh_attosecs;
11641171   attotime first_time;
11651172   int cpunum, max, ipf;
11661173
r1719r1720
11711178   ipf = machine->config->cpu_slices_per_frame;
11721179   if (ipf <= 0)
11731180      ipf = 1;
1174   timeslice_period = attotime_make(0, machine->screen[0].refresh / ipf);
1181   refresh_attosecs = (numscreens == 0) ? HZ_TO_ATTOSECONDS(60) : machine->screen[0].refresh;
1182   timeslice_period = attotime_make(0, refresh_attosecs / ipf);
11751183   timeslice_timer = timer_alloc(cpu_timeslicecallback, NULL);
11761184   timer_adjust_periodic(timeslice_timer, timeslice_period, 0, timeslice_period);
11771185
r1719r1720
12201228   }
12211229
12221230   /* allocate a vblank timer at the frame rate * the LCD number of interrupts per frame */
1223   vblank_period = attotime_make(0, machine->screen[0].refresh / vblank_multiplier);
1231   vblank_period = attotime_make(0, refresh_attosecs / vblank_multiplier);
12241232   vblank_countdown = vblank_multiplier;
12251233
12261234   /* allocate an update timer that will be used to time the actual screen updates */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team