/* Create a display screen, or window, of the given dimensions (or larger). Attributes are the ones defined in driver.h. Returns 0 on success. */ int osd_create_display(int width,int height,int depth,int fps,int attributes,int orientation) { logerror("width %d, height %d\n", width,height); video_depth = depth; video_fps = fps; brightness = 100; brightness_paused_adjust = 1.0; dirty_bright = 1; if (frameskip < 0) frameskip = 0; if (frameskip >= FRAMESKIP_LEVELS) frameskip = FRAMESKIP_LEVELS-1; #ifdef GP2X { extern int gp2x_pal_50hz; if ((gp2x_pal_50hz) && (video_fps>50) && (frameskip<2)) frameskip=2; } #endif /* Look if this is a vector game */ if (attributes & VIDEO_TYPE_VECTOR) vector_game = 1; else vector_game = 0; if (use_dirty == -1) /* dirty=auto in mame.cfg? */ { /* Is the game using a dirty system? */ if ((attributes & VIDEO_SUPPORTS_DIRTY) || vector_game) use_dirty = 1; else use_dirty = 0; } select_display_mode(width,height,depth,attributes,orientation); if (!osd_set_display(width,height,depth,attributes,orientation)) return 1; /* set visible area to nothing just to initialize it - it will be set by the core */ osd_set_visible_area(0,0,0,0); return 0; }
void set_visible_area(int min_x,int max_x,int min_y,int max_y) { Machine->visible_area.min_x = min_x; Machine->visible_area.max_x = max_x; Machine->visible_area.min_y = min_y; Machine->visible_area.max_y = max_y; /* vector games always use the whole bitmap */ if (Machine->drv->video_attributes & VIDEO_TYPE_VECTOR) { min_x = 0; max_x = Machine->scrbitmap->width - 1; min_y = 0; max_y = Machine->scrbitmap->height - 1; } else { int temp; if (Machine->orientation & ORIENTATION_SWAP_XY) { temp = min_x; min_x = min_y; min_y = temp; temp = max_x; max_x = max_y; max_y = temp; } if (Machine->orientation & ORIENTATION_FLIP_X) { temp = Machine->scrbitmap->width - min_x - 1; min_x = Machine->scrbitmap->width - max_x - 1; max_x = temp; } if (Machine->orientation & ORIENTATION_FLIP_Y) { temp = Machine->scrbitmap->height - min_y - 1; min_y = Machine->scrbitmap->height - max_y - 1; max_y = temp; } } osd_set_visible_area(min_x,max_x,min_y,max_y); }