DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/gui/render_scalers.cpp
00001 /*
00002  *  Copyright (C) 2002-2015  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 
00020 //TODO:
00021 //Maybe just do the cache checking back into the simple scalers so they can 
00022 //just handle it all in one go, but this seems to work well enough for now
00023 
00024 #include "dosbox.h"
00025 #include "render.h"
00026 #include <string.h>
00027 
00028 Bit8u Scaler_Aspect[SCALER_MAXHEIGHT];
00029 Bit16u Scaler_ChangedLines[SCALER_MAXHEIGHT];
00030 Bitu Scaler_ChangedLineIndex;
00031 
00032 static union {
00033         Bit32u b32 [4][SCALER_MAXWIDTH*3];
00034         Bit16u b16 [4][SCALER_MAXWIDTH*3];
00035         Bit8u b8 [4][SCALER_MAXWIDTH*3];
00036 } scalerWriteCache;
00037 //scalerFrameCache_t scalerFrameCache;
00038 scalerSourceCache_t scalerSourceCache;
00039 #if RENDER_USE_ADVANCED_SCALERS>1
00040 scalerChangeCache_t scalerChangeCache;
00041 #endif
00042 
00043 #define _conc2(A,B) A ## B
00044 #define _conc3(A,B,C) A ## B ## C
00045 #define _conc4(A,B,C,D) A ## B ## C ## D
00046 #define _conc5(A,B,C,D,E) A ## B ## C ## D ## E
00047 #define _conc7(A,B,C,D,E,F,G) A ## B ## C ## D ## E ## F ## G
00048 
00049 #define conc2(A,B) _conc2(A,B)
00050 #define conc3(A,B,C) _conc3(A,B,C)
00051 #define conc4(A,B,C,D) _conc4(A,B,C,D)
00052 #define conc2d(A,B) _conc3(A,_,B)
00053 #define conc3d(A,B,C) _conc5(A,_,B,_,C)
00054 #define conc4d(A,B,C,D) _conc7(A,_,B,_,C,_,D)
00055 
00056 static INLINE void BituMove( void *_dst, const void * _src, Bitu size) {
00057         Bitu * dst=(Bitu *)(_dst);
00058         const Bitu * src=(Bitu *)(_src);
00059         size/=sizeof(Bitu);
00060         for (Bitu x=0; x<size;x++)
00061                 dst[x] = src[x];
00062 }
00063 
00064 static INLINE void ScalerAddLines( Bitu changed, Bitu count ) {
00065         if ((Scaler_ChangedLineIndex & 1) == changed ) {
00066                 Scaler_ChangedLines[Scaler_ChangedLineIndex] += count;
00067         } else {
00068                 Scaler_ChangedLines[++Scaler_ChangedLineIndex] = count;
00069         }
00070         render.scale.outWrite += render.scale.outPitch * count;
00071 }
00072 
00073 
00074 #define BituMove2(_DST,_SRC,_SIZE)                      \
00075 {                                                                                       \
00076         Bitu bsize=(_SIZE)/sizeof(Bitu);                \
00077         Bitu * bdst=(Bitu *)(_DST);                             \
00078         Bitu * bsrc=(Bitu *)(_SRC);                             \
00079         while (bsize--) *bdst++=*bsrc++;                \
00080 }
00081 
00082 #define interp_w2(P0,P1,W0,W1)                                                                                                                  \
00083         ((((P0&redblueMask)*W0+(P1&redblueMask)*W1)/(W0+W1)) & redblueMask) |   \
00084         ((((P0&  greenMask)*W0+(P1&  greenMask)*W1)/(W0+W1)) & greenMask)
00085 #define interp_w3(P0,P1,P2,W0,W1,W2)                                                                                                            \
00086         ((((P0&redblueMask)*W0+(P1&redblueMask)*W1+(P2&redblueMask)*W2)/(W0+W1+W2)) & redblueMask) |    \
00087         ((((P0&  greenMask)*W0+(P1&  greenMask)*W1+(P2&  greenMask)*W2)/(W0+W1+W2)) & greenMask)
00088 #define interp_w4(P0,P1,P2,P3,W0,W1,W2,W3)                                                                                                              \
00089         ((((P0&redblueMask)*W0+(P1&redblueMask)*W1+(P2&redblueMask)*W2+(P3&redblueMask)*W3)/(W0+W1+W2+W3)) & redblueMask) |     \
00090         ((((P0&  greenMask)*W0+(P1&  greenMask)*W1+(P2&  greenMask)*W2+(P3&  greenMask)*W3)/(W0+W1+W2+W3)) & greenMask)
00091 
00092 
00093 #define CC scalerChangeCache
00094 
00095 /* Include the different rendering routines */
00096 #define SBPP 8
00097 #define DBPP 8
00098 #include "render_templates.h"
00099 #undef DBPP
00100 #define DBPP 15
00101 #include "render_templates.h"
00102 #undef DBPP
00103 #define DBPP 16
00104 #include "render_templates.h"
00105 #undef DBPP
00106 #define DBPP 32
00107 #include "render_templates.h"
00108 #undef SBPP
00109 #undef DBPP
00110 
00111 /* SBPP 9 is a special case with palette check support */
00112 #define SBPP 9
00113 #define DBPP 8
00114 #include "render_templates.h"
00115 #undef DBPP
00116 #define DBPP 15
00117 #include "render_templates.h"
00118 #undef DBPP
00119 #define DBPP 16
00120 #include "render_templates.h"
00121 #undef DBPP
00122 #define DBPP 32
00123 #include "render_templates.h"
00124 #undef SBPP
00125 #undef DBPP
00126 
00127 #define SBPP 15
00128 #define DBPP 15
00129 #include "render_templates.h"
00130 #undef DBPP
00131 #define DBPP 16
00132 #include "render_templates.h"
00133 #undef DBPP
00134 #define DBPP 32
00135 #include "render_templates.h"
00136 #undef SBPP
00137 #undef DBPP
00138 
00139 #define SBPP 16
00140 #define DBPP 15
00141 #include "render_templates.h"
00142 #undef DBPP
00143 #define DBPP 16
00144 #include "render_templates.h"
00145 #undef DBPP
00146 #define DBPP 32
00147 #include "render_templates.h"
00148 #undef SBPP
00149 #undef DBPP
00150 
00151 #define SBPP 32
00152 #define DBPP 15
00153 #include "render_templates.h"
00154 #undef DBPP
00155 #define DBPP 16
00156 #include "render_templates.h"
00157 #undef DBPP
00158 #define DBPP 32
00159 #include "render_templates.h"
00160 #undef SBPP
00161 #undef DBPP
00162 
00163 
00164 #if RENDER_USE_ADVANCED_SCALERS>1
00165 ScalerLineBlock_t ScalerCache = {
00166 {       Cache_8_8,      Cache_8_15 ,    Cache_8_16 ,    Cache_8_32 },
00167 {               0,      Cache_15_15,    Cache_15_16,    Cache_15_32},
00168 {               0,      Cache_16_15,    Cache_16_16,    Cache_16_32},
00169 {               0,      Cache_32_15,    Cache_32_16,    Cache_32_32},
00170 {       Cache_8_8,      Cache_9_15 ,    Cache_9_16 ,    Cache_9_32 }
00171 };
00172 #endif
00173 
00174 ScalerSimpleBlock_t ScaleNormal1x = {
00175         "Normal",
00176         GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00177         1,1,{
00178 {       Normal1x_8_8_L,         Normal1x_8_15_L ,       Normal1x_8_16_L ,       Normal1x_8_32_L },
00179 {                    0,         Normal1x_15_15_L,       Normal1x_15_16_L,       Normal1x_15_32_L},
00180 {                    0,         Normal1x_16_15_L,       Normal1x_16_16_L,       Normal1x_16_32_L},
00181 {                    0,         Normal1x_32_15_L,       Normal1x_32_16_L,       Normal1x_32_32_L},
00182 {       Normal1x_8_8_L,         Normal1x_9_15_L ,       Normal1x_9_16_L ,       Normal1x_9_32_L }
00183 },{
00184 {       Normal1x_8_8_R,         Normal1x_8_15_R ,       Normal1x_8_16_R ,       Normal1x_8_32_R },
00185 {                    0,         Normal1x_15_15_R,       Normal1x_15_16_R,       Normal1x_15_32_R},
00186 {                    0,         Normal1x_16_15_R,       Normal1x_16_16_R,       Normal1x_16_32_R},
00187 {                    0,         Normal1x_32_15_R,       Normal1x_32_16_R,       Normal1x_32_32_R},
00188 {       Normal1x_8_8_R,         Normal1x_9_15_R ,       Normal1x_9_16_R ,       Normal1x_9_32_R }
00189 }};
00190 
00191 ScalerSimpleBlock_t ScaleNormalDw = {
00192         "Normal",
00193         GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00194         2,1,{
00195 {       NormalDw_8_8_L,         NormalDw_8_15_L ,       NormalDw_8_16_L ,       NormalDw_8_32_L },
00196 {                    0,         NormalDw_15_15_L,       NormalDw_15_16_L,       NormalDw_15_32_L},
00197 {                    0,         NormalDw_16_15_L,       NormalDw_16_16_L,       NormalDw_16_32_L},
00198 {                    0,         NormalDw_32_15_L,       NormalDw_32_16_L,       NormalDw_32_32_L},
00199 {       NormalDw_8_8_L,         NormalDw_9_15_L ,       NormalDw_9_16_L ,       NormalDw_9_32_L }
00200 },{
00201 {       NormalDw_8_8_R,         NormalDw_8_15_R ,       NormalDw_8_16_R ,       NormalDw_8_32_R },
00202 {                    0,         NormalDw_15_15_R,       NormalDw_15_16_R,       NormalDw_15_32_R},
00203 {                    0,         NormalDw_16_15_R,       NormalDw_16_16_R,       NormalDw_16_32_R},
00204 {                    0,         NormalDw_32_15_R,       NormalDw_32_16_R,       NormalDw_32_32_R},
00205 {       NormalDw_8_8_R,         NormalDw_9_15_R ,       NormalDw_9_16_R ,       NormalDw_9_32_R }
00206 }};
00207 
00208 ScalerSimpleBlock_t ScaleNormalDh = {
00209         "Normal",
00210         GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00211         1,2,{
00212 {       NormalDh_8_8_L,         NormalDh_8_15_L ,       NormalDh_8_16_L ,       NormalDh_8_32_L },
00213 {                    0,         NormalDh_15_15_L,       NormalDh_15_16_L,       NormalDh_15_32_L},
00214 {                    0,         NormalDh_16_15_L,       NormalDh_16_16_L,       NormalDh_16_32_L},
00215 {                    0,         NormalDh_32_15_L,       NormalDh_32_16_L,       NormalDh_32_32_L},
00216 {       NormalDh_8_8_L,         NormalDh_9_15_L ,       NormalDh_9_16_L ,       NormalDh_9_32_L }
00217 },{
00218 {       NormalDh_8_8_R,         NormalDh_8_15_R ,       NormalDh_8_16_R ,       NormalDh_8_32_R },
00219 {                    0,         NormalDh_15_15_R,       NormalDh_15_16_R,       NormalDh_15_32_R},
00220 {                    0,         NormalDh_16_15_R,       NormalDh_16_16_R,       NormalDh_16_32_R},
00221 {                    0,         NormalDh_32_15_R,       NormalDh_32_16_R,       NormalDh_32_32_R},
00222 {       NormalDh_8_8_R,         NormalDh_9_15_R ,       NormalDh_9_16_R ,       NormalDh_9_32_R }
00223 }};
00224 
00225 ScalerSimpleBlock_t ScaleNormal2x = {
00226         "Normal2x",
00227         GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00228         2,2,{
00229 {       Normal2x_8_8_L,         Normal2x_8_15_L,        Normal2x_8_16_L,        Normal2x_8_32_L },
00230 {                    0,         Normal2x_15_15_L,       Normal2x_15_16_L,       Normal2x_15_32_L},
00231 {                    0,         Normal2x_16_15_L,       Normal2x_16_16_L,       Normal2x_16_32_L},
00232 {                    0,         Normal2x_32_15_L,       Normal2x_32_16_L,       Normal2x_32_32_L},
00233 {       Normal2x_8_8_L,         Normal2x_9_15_L ,       Normal2x_9_16_L,        Normal2x_9_32_L }
00234 },{
00235 {       Normal2x_8_8_R,         Normal2x_8_15_R ,       Normal2x_8_16_R,        Normal2x_8_32_R },
00236 {                    0,         Normal2x_15_15_R,       Normal2x_15_16_R,       Normal2x_15_32_R},
00237 {                    0,         Normal2x_16_15_R,       Normal2x_16_16_R,       Normal2x_16_32_R},
00238 {                    0,         Normal2x_32_15_R,       Normal2x_32_16_R,       Normal2x_32_32_R},
00239 {       Normal2x_8_8_R,         Normal2x_9_15_R ,       Normal2x_9_16_R,        Normal2x_9_32_R },
00240 }};
00241 
00242 ScalerSimpleBlock_t ScaleNormal3x = {
00243         "Normal3x",
00244         GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00245         3,3,{
00246 {       Normal3x_8_8_L,         Normal3x_8_15_L ,       Normal3x_8_16_L ,       Normal3x_8_32_L },
00247 {                    0,         Normal3x_15_15_L,       Normal3x_15_16_L,       Normal3x_15_32_L},
00248 {                    0,         Normal3x_16_15_L,       Normal3x_16_16_L,       Normal3x_16_32_L},
00249 {                    0,         Normal3x_32_15_L,       Normal3x_32_16_L,       Normal3x_32_32_L},
00250 {       Normal3x_8_8_L,         Normal3x_9_15_L ,       Normal3x_9_16_L ,       Normal3x_9_32_L }
00251 },{
00252 {       Normal3x_8_8_R,         Normal3x_8_15_R ,       Normal3x_8_16_R ,       Normal3x_8_32_R },
00253 {                    0,         Normal3x_15_15_R,       Normal3x_15_16_R,       Normal3x_15_32_R},
00254 {                    0,         Normal3x_16_15_R,       Normal3x_16_16_R,       Normal3x_16_32_R},
00255 {                    0,         Normal3x_32_15_R,       Normal3x_32_16_R,       Normal3x_32_32_R},
00256 {       Normal3x_8_8_R,         Normal3x_9_15_R ,       Normal3x_9_16_R ,       Normal3x_9_32_R }
00257 }};
00258 
00259 ScalerSimpleBlock_t ScaleNormal4x = {
00260     "Normal4x",
00261     GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00262     4,4,{
00263 {    Normal4x_8_8_L,        Normal4x_8_15_L ,    Normal4x_8_16_L ,    Normal4x_8_32_L },
00264 {                 0,        Normal4x_15_15_L,    Normal4x_15_16_L,    Normal4x_15_32_L},
00265 {                 0,        Normal4x_16_15_L,    Normal4x_16_16_L,    Normal4x_16_32_L},
00266 {                 0,        Normal4x_32_15_L,    Normal4x_32_16_L,    Normal4x_32_32_L},
00267 {    Normal4x_8_8_L,        Normal4x_9_15_L ,    Normal4x_9_16_L ,    Normal4x_9_32_L }
00268 },{
00269 {    Normal4x_8_8_R,        Normal4x_8_15_R ,    Normal4x_8_16_R ,    Normal4x_8_32_R },
00270 {                 0,        Normal4x_15_15_R,    Normal4x_15_16_R,    Normal4x_15_32_R},
00271 {                 0,        Normal4x_16_15_R,    Normal4x_16_16_R,    Normal4x_16_32_R},
00272 {                 0,        Normal4x_32_15_R,    Normal4x_32_16_R,    Normal4x_32_32_R},
00273 {    Normal4x_8_8_R,        Normal4x_9_15_R ,    Normal4x_9_16_R ,    Normal4x_9_32_R }
00274 }};
00275 
00276 ScalerSimpleBlock_t ScaleNormal5x = {
00277     "Normal5x",
00278     GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00279     5,5,{
00280 {    Normal5x_8_8_L,        Normal5x_8_15_L ,    Normal5x_8_16_L ,    Normal5x_8_32_L },
00281 {                 0,        Normal5x_15_15_L,    Normal5x_15_16_L,    Normal5x_15_32_L},
00282 {                 0,        Normal5x_16_15_L,    Normal5x_16_16_L,    Normal5x_16_32_L},
00283 {                 0,        Normal5x_32_15_L,    Normal5x_32_16_L,    Normal5x_32_32_L},
00284 {    Normal5x_8_8_L,        Normal5x_9_15_L ,    Normal5x_9_16_L ,    Normal5x_9_32_L }
00285 },{
00286 {    Normal5x_8_8_R,        Normal5x_8_15_R ,    Normal5x_8_16_R ,    Normal5x_8_32_R },
00287 {                 0,        Normal5x_15_15_R,    Normal5x_15_16_R,    Normal5x_15_32_R},
00288 {                 0,        Normal5x_16_15_R,    Normal5x_16_16_R,    Normal5x_16_32_R},
00289 {                 0,        Normal5x_32_15_R,    Normal5x_32_16_R,    Normal5x_32_32_R},
00290 {    Normal5x_8_8_R,        Normal5x_9_15_R ,    Normal5x_9_16_R ,    Normal5x_9_32_R }
00291 }};
00292 
00293 /*ScalerSimpleBlock_t ScaleNormal6x = {
00294     "Normal6x",
00295     GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00296     6,6,{
00297 {    Normal6x_8_8_L,        Normal6x_8_15_L ,    Normal6x_8_16_L ,    Normal6x_8_32_L },
00298 {                 0,        Normal6x_15_15_L,    Normal6x_15_16_L,    Normal6x_15_32_L},
00299 {                 0,        Normal6x_16_15_L,    Normal6x_16_16_L,    Normal6x_16_32_L},
00300 {                 0,        Normal6x_32_15_L,    Normal6x_32_16_L,    Normal6x_32_32_L},
00301 {    Normal6x_8_8_L,        Normal6x_9_15_L ,    Normal6x_9_16_L ,    Normal6x_9_32_L }
00302 },{
00303 {    Normal6x_8_8_R,        Normal6x_8_15_R ,    Normal6x_8_16_R ,    Normal6x_8_32_R },
00304 {                 0,        Normal6x_15_15_R,    Normal6x_15_16_R,    Normal6x_15_32_R},
00305 {                 0,        Normal6x_16_15_R,    Normal6x_16_16_R,    Normal6x_16_32_R},
00306 {                 0,        Normal6x_32_15_R,    Normal6x_32_16_R,    Normal6x_32_32_R},
00307 {    Normal6x_8_8_R,        Normal6x_9_15_R ,    Normal6x_9_16_R ,    Normal6x_9_32_R }
00308 }};*/
00309 
00310 #if RENDER_USE_ADVANCED_SCALERS>0
00311 ScalerSimpleBlock_t ScaleTV2x = {
00312         "TV2x",
00313         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00314         2,2,{
00315 {       0,              TV2x_8_15_L ,   TV2x_8_16_L ,   TV2x_8_32_L },
00316 {       0,              TV2x_15_15_L,   TV2x_15_16_L,   TV2x_15_32_L},
00317 {       0,              TV2x_16_15_L,   TV2x_16_16_L,   TV2x_16_32_L},
00318 {       0,              TV2x_32_15_L,   TV2x_32_16_L,   TV2x_32_32_L},
00319 {       0,              TV2x_9_15_L ,   TV2x_9_16_L ,   TV2x_9_32_L }
00320 },{
00321 {       0,              TV2x_8_15_R ,   TV2x_8_16_R ,   TV2x_8_32_R },
00322 {       0,              TV2x_15_15_R,   TV2x_15_16_R,   TV2x_15_32_R},
00323 {       0,              TV2x_16_15_R,   TV2x_16_16_R,   TV2x_16_32_R},
00324 {       0,              TV2x_32_15_R,   TV2x_32_16_R,   TV2x_32_32_R},
00325 {       0,              TV2x_9_15_R ,   TV2x_9_16_R ,   TV2x_9_32_R }
00326 }};
00327 
00328 ScalerSimpleBlock_t ScaleTV3x = {
00329         "TV3x",
00330         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00331         3,3,{
00332 {       0,              TV3x_8_15_L ,   TV3x_8_16_L ,   TV3x_8_32_L },
00333 {       0,              TV3x_15_15_L,   TV3x_15_16_L,   TV3x_15_32_L},
00334 {       0,              TV3x_16_15_L,   TV3x_16_16_L,   TV3x_16_32_L},
00335 {       0,              TV3x_32_15_L,   TV3x_32_16_L,   TV3x_32_32_L},
00336 {       0,              TV3x_9_15_L ,   TV3x_9_16_L ,   TV3x_9_32_L }
00337 },{
00338 {       0,              TV3x_8_15_R ,   TV3x_8_16_R ,   TV3x_8_32_R },
00339 {       0,              TV3x_15_15_R,   TV3x_15_16_R,   TV3x_15_32_R},
00340 {       0,              TV3x_16_15_R,   TV3x_16_16_R,   TV3x_16_32_R},
00341 {       0,              TV3x_32_15_R,   TV3x_32_16_R,   TV3x_32_32_R},
00342 {       0,              TV3x_9_15_R ,   TV3x_9_16_R ,   TV3x_9_32_R }
00343 }};
00344 
00345 ScalerSimpleBlock_t ScaleScan2x = {
00346         "Scan2x",
00347         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00348         2,2,{
00349 {       0,              Scan2x_8_15_L , Scan2x_8_16_L , Scan2x_8_32_L },
00350 {       0,              Scan2x_15_15_L, Scan2x_15_16_L, Scan2x_15_32_L},
00351 {       0,              Scan2x_16_15_L, Scan2x_16_16_L, Scan2x_16_32_L},
00352 {       0,              Scan2x_32_15_L, Scan2x_32_16_L, Scan2x_32_32_L},
00353 {       0,              Scan2x_9_15_L , Scan2x_9_16_L , Scan2x_9_32_L }
00354 },{
00355 {       0,              Scan2x_8_15_R , Scan2x_8_16_R , Scan2x_8_32_R },
00356 {       0,              Scan2x_15_15_R, Scan2x_15_16_R, Scan2x_15_32_R},
00357 {       0,              Scan2x_16_15_R, Scan2x_16_16_R, Scan2x_16_32_R},
00358 {       0,              Scan2x_32_15_R, Scan2x_32_16_R, Scan2x_32_32_R},
00359 {       0,              Scan2x_9_15_R , Scan2x_9_16_R , Scan2x_9_32_R }
00360 }};
00361 
00362 ScalerSimpleBlock_t ScaleScan3x = {
00363         "Scan3x",
00364         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00365         3,3,{
00366 {       0,              Scan3x_8_15_L , Scan3x_8_16_L , Scan3x_8_32_L },
00367 {       0,              Scan3x_15_15_L, Scan3x_15_16_L, Scan3x_15_32_L},
00368 {       0,              Scan3x_16_15_L, Scan3x_16_16_L, Scan3x_16_32_L},
00369 {       0,              Scan3x_32_15_L, Scan3x_32_16_L, Scan3x_32_32_L},
00370 {       0,              Scan3x_9_15_L , Scan3x_9_16_L , Scan3x_9_32_L },
00371 },{
00372 {       0,              Scan3x_8_15_R , Scan3x_8_16_R , Scan3x_8_32_R },
00373 {       0,              Scan3x_15_15_R, Scan3x_15_16_R, Scan3x_15_32_R},
00374 {       0,              Scan3x_16_15_R, Scan3x_16_16_R, Scan3x_16_32_R},
00375 {       0,              Scan3x_32_15_R, Scan3x_32_16_R, Scan3x_32_32_R},
00376 {       0,              Scan3x_9_15_R , Scan3x_9_16_R , Scan3x_9_32_R }
00377 }};
00378 
00379 ScalerSimpleBlock_t ScaleRGB2x = {
00380         "RGB2x",
00381         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00382         2,2,{
00383 {       0,              RGB2x_8_15_L ,  RGB2x_8_16_L ,  RGB2x_8_32_L },
00384 {       0,              RGB2x_15_15_L,  RGB2x_15_16_L,  RGB2x_15_32_L},
00385 {       0,              RGB2x_16_15_L,  RGB2x_16_16_L,  RGB2x_16_32_L},
00386 {       0,              RGB2x_32_15_L,  RGB2x_32_16_L,  RGB2x_32_32_L},
00387 {       0,              RGB2x_9_15_L ,  RGB2x_9_16_L ,  RGB2x_9_32_L }
00388 },{
00389 {       0,              RGB2x_8_15_R ,  RGB2x_8_16_R ,  RGB2x_8_32_R },
00390 {       0,              RGB2x_15_15_R,  RGB2x_15_16_R,  RGB2x_15_32_R},
00391 {       0,              RGB2x_16_15_R,  RGB2x_16_16_R,  RGB2x_16_32_R},
00392 {       0,              RGB2x_32_15_R,  RGB2x_32_16_R,  RGB2x_32_32_R},
00393 {       0,              RGB2x_9_15_R ,  RGB2x_9_16_R ,  RGB2x_9_32_R }
00394 }};
00395 
00396 ScalerSimpleBlock_t ScaleRGB3x = {
00397         "RGB3x",
00398         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00399         3,3,{
00400 {       0,              RGB3x_8_15_L ,  RGB3x_8_16_L ,  RGB3x_8_32_L },
00401 {       0,              RGB3x_15_15_L,  RGB3x_15_16_L,  RGB3x_15_32_L},
00402 {       0,              RGB3x_16_15_L,  RGB3x_16_16_L,  RGB3x_16_32_L},
00403 {       0,              RGB3x_32_15_L,  RGB3x_32_16_L,  RGB3x_32_32_L},
00404 {       0,              RGB3x_9_15_L ,  RGB3x_9_16_L ,  RGB3x_9_32_L }
00405 },{
00406 {       0,              RGB3x_8_15_R ,  RGB3x_8_16_R ,  RGB3x_8_32_R },
00407 {       0,              RGB3x_15_15_R,  RGB3x_15_16_R,  RGB3x_15_32_R},
00408 {       0,              RGB3x_16_15_R,  RGB3x_16_16_R,  RGB3x_16_32_R},
00409 {       0,              RGB3x_32_15_R,  RGB3x_32_16_R,  RGB3x_32_32_R},
00410 {       0,              RGB3x_9_15_R ,  RGB3x_9_16_R ,  RGB3x_9_32_R }
00411 }};
00412 #endif
00413 
00414 
00415 /* Complex scalers */
00416 
00417 #if RENDER_USE_ADVANCED_SCALERS>2
00418 ScalerComplexBlock_t ScaleAdvMame2x ={
00419         "AdvMame2x",
00420         GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00421         2,2,
00422 {       AdvMame2x_8_L,AdvMame2x_16_L,AdvMame2x_16_L,AdvMame2x_32_L},
00423 {       AdvMame2x_8_R,AdvMame2x_16_R,AdvMame2x_16_R,AdvMame2x_32_R}
00424 };
00425 
00426 ScalerComplexBlock_t ScaleAdvMame3x = {
00427         "AdvMame3x",
00428         GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
00429         3,3,
00430 {       AdvMame3x_8_L,AdvMame3x_16_L,AdvMame3x_16_L,AdvMame3x_32_L},
00431 {       AdvMame3x_8_R,AdvMame3x_16_R,AdvMame3x_16_R,AdvMame3x_32_R}
00432 };
00433 
00434 /* These need specific 15bpp versions */
00435 ScalerComplexBlock_t ScaleHQ2x ={
00436         "HQ2x",
00437         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00438         2,2,
00439 {       0,HQ2x_16_L,HQ2x_16_L,HQ2x_32_L},
00440 {       0,HQ2x_16_R,HQ2x_16_R,HQ2x_32_R}
00441 };
00442 
00443 ScalerComplexBlock_t ScaleHQ3x ={
00444         "HQ3x",
00445         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00446         3,3,
00447 {       0,HQ3x_16_L,HQ3x_16_L,HQ3x_32_L},
00448 {       0,HQ3x_16_R,HQ3x_16_R,HQ3x_32_R}
00449 };
00450 
00451 ScalerComplexBlock_t ScaleSuper2xSaI ={
00452         "Super2xSaI",
00453         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00454         2,2,
00455 {       0,Super2xSaI_16_L,Super2xSaI_16_L,Super2xSaI_32_L},
00456 {       0,Super2xSaI_16_R,Super2xSaI_16_R,Super2xSaI_32_R}
00457 };
00458 
00459 ScalerComplexBlock_t Scale2xSaI ={
00460         "2xSaI",
00461         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00462         2,2,
00463 {       0,_2xSaI_16_L,_2xSaI_16_L,_2xSaI_32_L},
00464 {       0,_2xSaI_16_R,_2xSaI_16_R,_2xSaI_32_R}
00465 };
00466 
00467 ScalerComplexBlock_t ScaleSuperEagle ={
00468         "SuperEagle",
00469         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00470         2,2,
00471 {       0,SuperEagle_16_L,SuperEagle_16_L,SuperEagle_32_L},
00472 {       0,SuperEagle_16_R,SuperEagle_16_R,SuperEagle_32_R}
00473 };
00474 
00475 ScalerComplexBlock_t ScaleAdvInterp2x = {
00476         "AdvInterp2x",
00477         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00478         2,2,
00479 {       0,AdvInterp2x_15_L,AdvInterp2x_16_L,AdvInterp2x_32_L},
00480 {       0,AdvInterp2x_15_R,AdvInterp2x_16_R,AdvInterp2x_32_R}
00481 };
00482 
00483 ScalerComplexBlock_t ScaleAdvInterp3x = {
00484         "AdvInterp3x",
00485         GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
00486         3,3,
00487 {       0,AdvInterp3x_15_L,AdvInterp3x_16_L,AdvInterp3x_32_L},
00488 {       0,AdvInterp3x_15_R,AdvInterp3x_16_R,AdvInterp3x_32_R}
00489 };
00490 
00491 #endif