Make scalerwritecache sizes depend on the maximum scaler size.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4311
This commit is contained in:
parent
80c7bb7cc1
commit
ec8b59ab06
3 changed files with 28 additions and 4 deletions
|
@ -29,10 +29,11 @@ Bit8u Scaler_Aspect[SCALER_MAXHEIGHT];
|
|||
Bit16u Scaler_ChangedLines[SCALER_MAXHEIGHT];
|
||||
Bitu Scaler_ChangedLineIndex;
|
||||
|
||||
static union {
|
||||
Bit32u b32 [4][SCALER_MAXWIDTH*3];
|
||||
Bit16u b16 [4][SCALER_MAXWIDTH*3];
|
||||
Bit8u b8 [4][SCALER_MAXWIDTH*3];
|
||||
static struct {
|
||||
//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];
|
||||
} scalerWriteCache;
|
||||
//scalerFrameCache_t scalerFrameCache;
|
||||
scalerSourceCache_t scalerSourceCache;
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
|
||||
//#include "render.h"
|
||||
#include "video.h"
|
||||
|
||||
#define SCALER_MAX_MUL_WIDTH 3
|
||||
#define SCALER_MAX_MUL_HEIGHT 3
|
||||
|
||||
#if RENDER_USE_ADVANCED_SCALERS>0
|
||||
#define SCALER_MAXWIDTH 1280
|
||||
#define SCALER_MAXHEIGHT 1024
|
||||
|
|
|
@ -16,6 +16,13 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#if SCALER_MAX_MUL_HEIGHT < SCALERHEIGHT
|
||||
#error "Scaler goes too high"
|
||||
#endif
|
||||
|
||||
#if SCALER_MAX_MUL_WIDTH < SCALERWIDTH
|
||||
#error "Scaler goes too wide"
|
||||
#endif
|
||||
|
||||
#if defined (SCALERLINEAR)
|
||||
static void conc4d(SCALERNAME,SBPP,DBPP,L)(const void *s) {
|
||||
|
@ -67,6 +74,9 @@ static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) {
|
|||
#if (SCALERHEIGHT > 2)
|
||||
PTYPE *line2 = WC[1];
|
||||
#endif
|
||||
#if (SCALERHEIGHT > 3)
|
||||
PTYPE *line3 = WC[2];
|
||||
#endif
|
||||
#else
|
||||
#if (SCALERHEIGHT > 1)
|
||||
PTYPE *line1 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch);
|
||||
|
@ -74,6 +84,9 @@ static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) {
|
|||
#if (SCALERHEIGHT > 2)
|
||||
PTYPE *line2 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 2);
|
||||
#endif
|
||||
#if (SCALERHEIGHT > 3)
|
||||
PTYPE *line3 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 3);
|
||||
#endif
|
||||
#endif //defined(SCALERLINEAR)
|
||||
hadChange = 1;
|
||||
for (Bitu i = x > 32 ? 32 : x;i>0;i--,x--) {
|
||||
|
@ -88,6 +101,9 @@ static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) {
|
|||
#endif
|
||||
#if (SCALERHEIGHT > 2)
|
||||
line2 += SCALERWIDTH;
|
||||
#endif
|
||||
#if (SCALERHEIGHT > 3)
|
||||
line3 += SCALERWIDTH;
|
||||
#endif
|
||||
}
|
||||
#if defined(SCALERLINEAR)
|
||||
|
@ -98,6 +114,9 @@ static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) {
|
|||
#if (SCALERHEIGHT > 2)
|
||||
BituMove(((Bit8u*)line0)-copyLen+render.scale.outPitch*2,WC[1], copyLen );
|
||||
#endif
|
||||
#if (SCALERHEIGHT > 3)
|
||||
BituMove(((Bit8u*)line0)-copyLen+render.scale.outPitch*3,WC[2], copyLen );
|
||||
#endif
|
||||
#endif //defined(SCALERLINEAR)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue