diff -ru base/src/artwork.c base_crop/src/artwork.c --- base/src/artwork.c Wed Nov 20 22:11:00 2002 +++ base_crop/src/artwork.c Fri Apr 11 09:28:00 2003 @@ -414,7 +414,9 @@ static UINT8 global_artwork_enable; static const struct overlay_piece *overlay_list; +int rotation = 0; +extern float win_screen_aspect; /*************************************************************************** @@ -603,6 +605,8 @@ double min_x, min_y, max_x, max_y; UINT32 rgb32_components[3]; struct artwork_piece *piece; + double temp, delta; + int tempx; /* reset UI */ uioverlay = NULL; @@ -626,6 +630,7 @@ min_x = min_y = 0.0; max_x = max_y = 1.0; if (!options.artwork_crop) + { for (piece = artwork_list; piece; piece = piece->next) { /* compute the outermost bounds */ @@ -633,13 +638,43 @@ if (piece->right > max_x) max_x = piece->right; if (piece->top < min_y) min_y = piece->top; if (piece->bottom > max_y) max_y = piece->bottom; + params->aspect_x = (int)((double)params->aspect_x * (max_x - min_x)); + params->aspect_y = (int)((double)params->aspect_y * (max_y - min_y)); } + } + else + { + //Do we want leave artwork in edge space + if (options.artwork_fb) + { + for (piece = artwork_list; piece; piece = piece->next) + { + if((!rotation && (Machine->gamedrv->flags & ORIENTATION_SWAP_XY)) || + (rotation && !(Machine->gamedrv->flags & ORIENTATION_SWAP_XY))) + { + temp = (win_screen_aspect) * original_width; + delta = (temp - original_height) / 2.0; + max_y = 1.0 + (delta / original_height); + min_y = 0.0 - (delta / original_height); + + /* aspect ratio needs to be switched. example of why, + say you run pacman, it normally is a 3:4 displayed + in 4:3 and you get the black edges. Filling in the edges + with artwork you are filling the entire screen, + need to then display 4:3 on a 4:3 */ + tempx = params->aspect_x; + params->aspect_x = params->aspect_y; + params->aspect_y = tempx; + } + } + } + } /* now compute the altered width/height and the new aspect ratio */ params->width = (int)((max_x - min_x) * (double)(original_width * gamescale) + 0.5); params->height = (int)((max_y - min_y) * (double)(original_height * gamescale) + 0.5); - params->aspect_x = (int)((double)params->aspect_x * 100. * (max_x - min_x)); - params->aspect_y = (int)((double)params->aspect_y * 100. * (max_y - min_y)); + params->aspect_x = (int)((double)params->aspect_x * 100);//. * (max_x - min_x)); + params->aspect_y = (int)((double)params->aspect_y * 100);//. * (max_y - min_y)); /* vector games need to fit inside the original bounds, so scale back down */ if (params->video_attributes & VIDEO_TYPE_VECTOR) diff -ru base/src/mame.h base_crop/src/mame.h --- base/src/mame.h Mon Feb 10 22:20:36 2003 +++ base_crop/src/mame.h Fri Apr 11 01:10:04 2003 @@ -196,6 +196,7 @@ int use_artwork; /* bitfield indicating which artwork pieces to use */ int artwork_res; /* 1 for 1x game scaling, 2 for 2x */ int artwork_crop; /* 1 to crop artwork to the game screen */ + int artwork_fb; /* 1 to crop artwork to the game screen */ char savegame; /* character representing a savegame to load */ diff -ru base/src/windows/config.c base_crop/src/windows/config.c --- base/src/windows/config.c Wed Mar 12 15:17:42 2003 +++ base_crop/src/windows/config.c Fri Apr 11 01:20:32 2003 @@ -85,6 +85,7 @@ static int video_rol = 0; static int video_autoror = 0; static int video_autorol = 0; +extern int rotation; static char *win_basename(char *filename); @@ -204,6 +205,7 @@ { "use_overlays", "overlay", rc_bool, &use_overlays, "1", 0, 0, NULL, "use overlay artwork" }, { "use_bezels", "bezel", rc_bool, &use_bezels, "1", 0, 0, NULL, "use bezel artwork" }, { "artwork_crop", "artcrop", rc_bool, &options.artwork_crop, "0", 0, 0, NULL, "crop artwork to game screen only" }, + { "artwork_filledges", "cropfe", rc_bool, &options.artwork_fb, "0", 0, 0, NULL, "use with artcrop, fills edges with art" }, { "artwork_resolution", "artres", rc_int, &options.artwork_res, "0", 0, 0, NULL, "artwork resolution (0 for auto)" }, { "cheat", "c", rc_bool, &options.cheat, "0", 0, 0, NULL, "enable/disable cheat subsystem" }, { "debug", "d", rc_bool, &options.mame_debug, "0", 0, 0, NULL, "enable/disable debugger (only if available)" }, @@ -654,7 +656,10 @@ /* override if no rotation requested */ if (video_norotate) + { orientation = options.ui_orientation = ROT0; + rotation = 0; + } /* rotate right */ if (video_ror) @@ -665,6 +670,7 @@ orientation ^= ROT180; orientation ^= ROT90; + rotation = 1; } /* rotate left */ @@ -676,6 +682,7 @@ orientation ^= ROT180; orientation ^= ROT270; + rotation = 1; } /* auto-rotate right (e.g. for rotating lcds), based on original orientation */ @@ -687,6 +694,7 @@ orientation ^= ROT180; orientation ^= ROT90; + rotation = 1; } /* auto-rotate left (e.g. for rotating lcds), based on original orientation */ @@ -698,6 +706,7 @@ orientation ^= ROT180; orientation ^= ROT270; + rotation = 1; } /* flip X/Y */