static const render_primitive_list *drawgdi_window_get_primitives(win_window_info *window) { RECT client; GetClientRect(window->hwnd, &client); render_target_set_bounds(window->target, rect_width(&client), rect_height(&client), winvideo_monitor_get_aspect(window->monitor)); return render_target_get_primitives(window->target); }
void osd_update(running_machine *machine, int skip_redraw){ nitroinput_update(); const render_primitive_list *primlist; int minwidth, minheight; // get the minimum width/height for the current layout render_target_get_minimum_size(our_target, &minwidth, &minheight); if(our_target){ // make that the size of our target render_target_set_bounds(our_target, minwidth, minheight, 0); // get the list of primitives for the target at the current size primlist = render_target_get_primitives(our_target); // lock them, and then render them osd_lock_acquire(primlist->lock); // do the drawing here osd_lock_release(primlist->lock); } // after 5 seconds, exit if (attotime_compare(timer_get_time(machine), attotime_make(5, 0)) > 0) mame_schedule_exit(machine); }
static const render_primitive_list *drawdd_window_get_primitives(win_window_info *window) { dd_info *dd = window->drawdata; compute_blit_surface_size(window); render_target_set_bounds(window->target, dd->blitwidth, dd->blitheight, 0); return render_target_get_primitives(window->target); }
void droid_video_render(render_target *our_target) { int minwidth, minheight; pthread_mutex_lock( &cond_mutex ); if(currlist==NULL) { // get the minimum width/height for the current layout render_target_get_minimum_size(our_target, &minwidth, &minheight); if(minwidth%2!=0)minwidth++; // make that the size of our target render_target_set_bounds(our_target, minwidth, minheight, 0); currlist = render_target_get_primitives(our_target); curr_screen_width = minwidth; curr_screen_height = minheight; pthread_cond_signal( &condition_var ); } pthread_mutex_unlock( &cond_mutex ); }
static const render_primitive_list *drawdd_window_get_primitives(win_window_info *window) { dd_info *dd = window->drawdata; compute_blit_surface_size(window); render_target_set_bounds(window->target, dd->blitwidth, dd->blitheight, 0); render_target_set_max_update_rate(window->target, (dd->refresh == 0) ? dd->origmode.dwRefreshRate : dd->refresh); return render_target_get_primitives(window->target); }
static const render_primitive_list *drawgx_window_get_primitives(sdl_window_info *window) { sdl_info *sdl = window->dxdata; if ((!window->fullscreen) || (video_config.switchres)) { sdlwindow_blit_surface_size(window, window->width, window->height); } else { sdlwindow_blit_surface_size(window, window->monitor->center_width, window->monitor->center_height); } if (!sdl->scale_mode->is_scale) render_target_set_bounds(window->target, window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor)); else render_target_set_bounds(window->target, sdl->hw_scale_width, sdl->hw_scale_height, 0); return render_target_get_primitives(window->target); }
static void save_frame_with(mame_file *fp, int scrnum, png_error (*write_handler)(mame_file *, mame_bitmap *)) { const render_primitive_list *primlist; INT32 width, height; int error; assert(scrnum >= 0 && scrnum < MAX_SCREENS); /* if no screens, do nothing */ if (snap_target == NULL) return; /* select the appropriate view in our dummy target */ render_target_set_view(snap_target, scrnum); /* get the minimum width/height and set it on the target */ render_target_get_minimum_size(snap_target, &width, &height); render_target_set_bounds(snap_target, width, height, 0); /* if we don't have a bitmap, or if it's not the right size, allocate a new one */ if (snap_bitmap == NULL || width != snap_bitmap->width || height != snap_bitmap->height) { if (snap_bitmap != NULL) bitmap_free(snap_bitmap); snap_bitmap = bitmap_alloc_format(width, height, BITMAP_FORMAT_RGB32); assert(snap_bitmap != NULL); } /* render the screen there */ primlist = render_target_get_primitives(snap_target); osd_lock_acquire(primlist->lock); rgb888_draw_primitives(primlist->head, snap_bitmap->base, width, height, snap_bitmap->rowpixels); osd_lock_release(primlist->lock); /* now do the actual work */ error = (*write_handler)(fp, snap_bitmap); }
void droid_ios_video_render(render_target *our_target) { int width, height; int minwidth, minheight; int viswidth, visheight; int aspect; if(myosd_video_threaded) pthread_mutex_lock( &cond_mutex ); if(currlist==NULL) { if(!myosd_inGame) { width = viswidth = myosd_res_width; height = visheight = myosd_res_height; aspect = 0; } else if(myosd_force_pxaspect == 1) { render_target_get_minimum_size(our_target, &minwidth, &minheight); width = minwidth; height = minheight; viswidth = minwidth; visheight = minheight; aspect = 0; } else if(myosd_force_pxaspect==2) { render_target_get_minimum_size(our_target, &minwidth, &minheight); width = minwidth; height = minheight; viswidth = minwidth; visheight = minheight; int w,h; render_target_compute_visible_area(our_target,minwidth,minheight,1,render_target_get_orientation(our_target),&w, &h); if(visheight > h && abs((float)w/(float)h - 4.0f/3.0f) < 0.001)// 4/3 minimum { viswidth = w; visheight = h; } if(viswidth > h * 16.0f/9.0f && abs((float)w/(float)h - 4.0f/3.0f) < 0.001)// 16/9 maximun { viswidth = h * 16.0f/9.0f; visheight = h; } if(viswidth < w && abs((float)w/(float)h - 3.0f/4.0f) < 0.001)// 3/4 minimum { viswidth = w; visheight = h; } if(visheight > h && abs((float)w/(float)h - 3.0f/4.0f) < 0.001)// 3/4 maximun { viswidth = w ; visheight = h; } aspect = 0; #ifdef ANDROID // __android_log_print(ANDROID_LOG_DEBUG, "VIS","FIN %d, %d",viswidth,visheight); #endif } else //MAME standard { if(myosd_auto_res==1) { render_target_get_minimum_size(our_target, &width, &height); if(width > 640) { if(myosd_res_width > 640) width = myosd_res_width; else width = 640; } if(height > 480) { if(myosd_res_height > 480) height = myosd_res_height; else height = 480; } //calculate vis area to pass to GPU scaler instead MAME scaler. Performace and accurate! render_target_compute_visible_area(our_target,width,height,1,render_target_get_orientation(our_target),&viswidth, &visheight); aspect = 0; } else { width = myosd_res_width; height = myosd_res_height; viswidth = width ; visheight = height; aspect = width / height; } } if(width%2!=0)width++; // make that the size of our target render_target_set_bounds(our_target, width, height, aspect); currlist = render_target_get_primitives(our_target); curr_screen_width = width; curr_screen_height = height; curr_vis_area_screen_width = viswidth; curr_vis_area_screen_height = visheight; if(myosd_video_threaded) pthread_cond_signal( &condition_var ); else droid_ios_video_draw(); } if(myosd_video_threaded) pthread_mutex_unlock( &cond_mutex ); }
int osd_update(mame_time emutime) { int i; double time_limit; double current_time; int cpunum; render_target_get_primitives(target); /* is this the first update? if so, eat it */ if (!seen_first_update) { seen_first_update = TRUE; goto done; } /* if we have already aborted or completed, our work is done */ if ((state == STATE_ABORTED) || (state == STATE_DONE)) { mame_schedule_exit(Machine); goto done; } /* have we hit the time limit? */ current_time = timer_get_time(); time_limit = (current_testcase.time_limit != 0.0) ? current_testcase.time_limit : TIME_IN_SEC(600); if (current_time > time_limit) { state = STATE_ABORTED; report_message(MSG_FAILURE, "Time limit of %.2f seconds exceeded", time_limit); goto done; } /* update the runtime hash */ if (0) { for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { runtime_hash *= 57; runtime_hash ^= cpunum_get_reg(cpunum, REG_PC); /* TODO - Add more registers? */ } } for (i = 0; i < sizeof(commands) / sizeof(commands[i]); i++) { if (current_command->command_type == commands[i].command_type) { commands[i].proc(); break; } } /* if we are ready for the next command, advance to it */ if (state == STATE_READY) { /* if we are at the end, and we are dumping screenshots, and we didn't * just dump a screenshot, dump one now */ if ((test_flags & MESSTEST_ALWAYS_DUMP_SCREENSHOT) && (current_command[0].command_type != MESSTEST_COMMAND_SCREENSHOT) && (current_command[1].command_type == MESSTEST_COMMAND_END)) { dump_screenshot(TRUE); } current_command++; } done: return FALSE; }