add VGA "porch" behaviour emulation (#811)

This commit is contained in:
Fabian Greffrath 2022-11-21 20:28:14 +01:00 committed by GitHub
parent e5d9de2cf3
commit 3f6a03263c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -884,6 +884,7 @@ static int actualheight;
int uncapped; // [FG] uncapped rendering frame rate
int integer_scaling; // [FG] force integer scales
int vga_porch_flash; // emulate VGA "porch" behaviour
int fps; // [FG] FPS counter widget
int widescreen; // widescreen mode
@ -1111,6 +1112,15 @@ void I_SetPalette(byte *palette)
}
SDL_SetPaletteColors(sdlscreen->format->palette, colors, 0, 256);
if (vga_porch_flash)
{
// "flash" the pillars/letterboxes with palette changes,
// emulating VGA "porch" behaviour
SDL_SetRenderDrawColor(renderer,
colors[0].r, colors[0].g, colors[0].b,
SDL_ALPHA_OPAQUE);
}
}
// Taken from Chocolate Doom chocolate-doom/src/i_video.c:L841-867

View File

@ -81,6 +81,7 @@ extern int hires; // killough 11/98
extern int useaspect;
extern int uncapped; // [FG] uncapped rendering frame rate
extern int integer_scaling; // [FG] force integer scales
extern int vga_porch_flash; // emulate VGA "porch" behaviour
extern int widescreen; // widescreen mode
extern int video_display; // display index
extern int window_width, window_height;

View File

@ -2344,6 +2344,13 @@ default_t defaults[] = {
"1 to force integer scales"
},
{
"vga_porch_flash",
(config_t *) &vga_porch_flash, NULL,
{0}, {0, 1}, number, ss_none, wad_no,
"1 to emulate VGA \"porch\" behaviour"
},
// widescreen mode
{
"widescreen",