Limit max software scaler line limit to a 4k monitor. (relevant for people who use larger scalers)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4316
This commit is contained in:
parent
eb9b86269d
commit
2dec4d0a11
3 changed files with 24 additions and 6 deletions
|
@ -281,6 +281,11 @@ static void RENDER_Reset( void ) {
|
|||
gfx_scalew = 1;
|
||||
gfx_scaleh = 1;
|
||||
}
|
||||
|
||||
/* Don't do software scaler sizes larger than 4k */
|
||||
Bitu maxsize_current_input = SCALER_MAXLINE_WIDTH/width;
|
||||
if (render.scale.size > maxsize_current_input) render.scale.size = maxsize_current_input;
|
||||
|
||||
if ((dblh && dblw) || (render.scale.forced && !dblh && !dblw)) {
|
||||
/* Initialize always working defaults */
|
||||
if (render.scale.size == 2)
|
||||
|
@ -348,6 +353,10 @@ static void RENDER_Reset( void ) {
|
|||
#endif
|
||||
} else if (dblw) {
|
||||
simpleBlock = &ScaleNormalDw;
|
||||
if (width * simpleBlock->xscale > SCALER_MAXLINE_WIDTH) {
|
||||
// This should only happen if you pick really bad values... but might be worth adding selecting a scaler that fits
|
||||
simpleBlock = &ScaleNormal1x;
|
||||
}
|
||||
} else if (dblh) {
|
||||
simpleBlock = &ScaleNormalDh;
|
||||
} else {
|
||||
|
|
|
@ -31,9 +31,9 @@ Bitu Scaler_ChangedLineIndex;
|
|||
|
||||
static union {
|
||||
//The +1 is a at least for the normal scalers not needed. (-1 is enough)
|
||||
Bit32u b32 [SCALER_MAX_MUL_HEIGHT+1][SCALER_MAXWIDTH*SCALER_MAX_MUL_WIDTH];
|
||||
Bit16u b16 [SCALER_MAX_MUL_HEIGHT+1][SCALER_MAXWIDTH*SCALER_MAX_MUL_WIDTH];
|
||||
Bit8u b8 [SCALER_MAX_MUL_HEIGHT+1][SCALER_MAXWIDTH*SCALER_MAX_MUL_WIDTH];
|
||||
Bit32u b32 [SCALER_MAX_MUL_HEIGHT + 1][SCALER_MAXLINE_WIDTH];
|
||||
Bit16u b16 [SCALER_MAX_MUL_HEIGHT + 1][SCALER_MAXLINE_WIDTH];
|
||||
Bit8u b8 [SCALER_MAX_MUL_HEIGHT + 1][SCALER_MAXLINE_WIDTH];
|
||||
} scalerWriteCache;
|
||||
//scalerFrameCache_t scalerFrameCache;
|
||||
scalerSourceCache_t scalerSourceCache;
|
||||
|
|
|
@ -26,16 +26,25 @@
|
|||
#define SCALER_MAX_MUL_HEIGHT 3
|
||||
|
||||
#if RENDER_USE_ADVANCED_SCALERS>0
|
||||
#define SCALER_MAXWIDTH 1280
|
||||
#define SCALER_MAXWIDTH 1280
|
||||
#define SCALER_MAXHEIGHT 1024
|
||||
#define SCALER_MAXX 4096
|
||||
#else
|
||||
// reduced to save some memory
|
||||
#define SCALER_MAXWIDTH 800
|
||||
#define SCALER_MAXWIDTH 800
|
||||
#define SCALER_MAXHEIGHT 600
|
||||
#define SCALER_MAXX 2048
|
||||
#endif
|
||||
|
||||
#if (SCALER_MAX_MUL_WIDTH * SCALER_MAXWIDTH) > SCALER_MAXX
|
||||
#define SCALER_MAXLINE_WIDTH SCALER_MAXX
|
||||
#else
|
||||
#define SCALER_MAXLINE_WIDTH (SCALER_MAX_MUL_WIDTH * SCALER_MAXWIDTH)
|
||||
#endif
|
||||
|
||||
|
||||
#if RENDER_USE_ADVANCED_SCALERS>1
|
||||
#define SCALER_COMPLEXWIDTH 800
|
||||
#define SCALER_COMPLEXWIDTH 800
|
||||
#define SCALER_COMPLEXHEIGHT 600
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue