Advertisement
Guest User

Untitled

a guest
Feb 27th, 2011
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 14.08 KB | None | 0 0
  1. diff -urN dosbox-0.73/src/dosbox.cpp dosbox-0.73/src/dosbox.cpp
  2. --- dosbox-0.73/src/dosbox.cpp  2009-05-25 20:44:46.000000000 +0200
  3. +++ dosbox-0.73/src/dosbox.cpp  2010-01-19 11:56:25.387344693 +0100
  4. @@ -378,9 +378,9 @@
  5.     Pstring = Pmulti->GetSection()->Add_string("type",Property::Changeable::Always,"normal2x");
  6.  
  7.     const char *scalers[] = {
  8. -       "none", "normal2x", "normal3x",
  9. +       "none", "normal2x", "normal3x", "normal4x",
  10.  #if RENDER_USE_ADVANCED_SCALERS>2
  11. -       "advmame2x", "advmame3x", "advinterp2x", "advinterp3x", "hq2x", "hq3x", "2xsai", "super2xsai", "supereagle",
  12. +       "advmame2x", "advmame3x", "advmame4x", "advinterp2x", "advinterp3x", "advinterp4x", "hq2x", "hq3x", "2xsai", "super2xsai", "supereagle",
  13.  #endif
  14.  #if RENDER_USE_ADVANCED_SCALERS>0
  15.         "tv2x", "tv3x", "rgb2x", "rgb3x", "scan2x", "scan3x",
  16. diff -urN dosbox-0.73/src/gui/render.cpp dosbox-0.73/src/gui/render.cpp
  17. --- dosbox-0.73/src/gui/render.cpp  2009-05-25 20:44:46.000000000 +0200
  18. +++ dosbox-0.73/src/gui/render.cpp  2010-01-19 11:58:59.469013482 +0100
  19. @@ -288,6 +288,8 @@
  20.             simpleBlock = &ScaleNormal2x;
  21.         else if (render.scale.size == 3)
  22.             simpleBlock = &ScaleNormal3x;
  23. +       else if (render.scale.size == 4)
  24. +           simpleBlock = &ScaleNormal4x;
  25.         else
  26.             simpleBlock = &ScaleNormal1x;
  27.         /* Maybe override them */
  28. @@ -299,12 +301,16 @@
  29.                 complexBlock = &ScaleAdvInterp2x;
  30.             else if (render.scale.size == 3)
  31.                 complexBlock = &ScaleAdvInterp3x;
  32. +           else if (render.scale.size == 4)
  33. +               complexBlock = &ScaleAdvInterp4x;
  34.             break;
  35.         case scalerOpAdvMame:
  36.             if (render.scale.size == 2)
  37.                 complexBlock = &ScaleAdvMame2x;
  38.             else if (render.scale.size == 3)
  39.                 complexBlock = &ScaleAdvMame3x;
  40. +           else if (render.scale.size == 4)
  41. +               complexBlock = &ScaleAdvMame4x;
  42.             break;
  43.         case scalerOpHQ:
  44.             if (render.scale.size == 2)
  45. @@ -597,11 +603,14 @@
  46.     if (scaler == "none") { render.scale.op = scalerOpNormal;render.scale.size = 1; }
  47.     else if (scaler == "normal2x") { render.scale.op = scalerOpNormal;render.scale.size = 2; }
  48.     else if (scaler == "normal3x") { render.scale.op = scalerOpNormal;render.scale.size = 3; }
  49. +   else if (scaler == "normal4x") { render.scale.op = scalerOpNormal;render.scale.size = 4; }
  50.  #if RENDER_USE_ADVANCED_SCALERS>2
  51.     else if (scaler == "advmame2x") { render.scale.op = scalerOpAdvMame;render.scale.size = 2; }
  52.     else if (scaler == "advmame3x") { render.scale.op = scalerOpAdvMame;render.scale.size = 3; }
  53. +   else if (scaler == "advmame4x") { render.scale.op = scalerOpAdvMame;render.scale.size = 4; }
  54.     else if (scaler == "advinterp2x") { render.scale.op = scalerOpAdvInterp;render.scale.size = 2; }
  55.     else if (scaler == "advinterp3x") { render.scale.op = scalerOpAdvInterp;render.scale.size = 3; }
  56. +   else if (scaler == "advinterp4x") { render.scale.op = scalerOpAdvInterp;render.scale.size = 4; }
  57.     else if (scaler == "hq2x") { render.scale.op = scalerOpHQ;render.scale.size = 2; }
  58.     else if (scaler == "hq3x") { render.scale.op = scalerOpHQ;render.scale.size = 3; }
  59.     else if (scaler == "2xsai") { render.scale.op = scalerOpSaI;render.scale.size = 2; }
  60. diff -urN dosbox-0.73/src/gui/render_loops.h dosbox-0.73/src/gui/render_loops.h
  61. --- dosbox-0.73/src/gui/render_loops.h  2009-05-25 20:44:46.000000000 +0200
  62. +++ dosbox-0.73/src/gui/render_loops.h  2010-01-19 11:55:13.982380988 +0100
  63. @@ -51,6 +51,9 @@
  64.  #if (SCALERHEIGHT > 2)
  65.         PTYPE * line2;
  66.  #endif
  67. +#if (SCALERHEIGHT > 3)
  68. +       PTYPE * line3;
  69. +#endif
  70.         /* Clear this block being dirty marker */
  71.         const Bitu changeType = changed[b];
  72.         changed[b] = 0;
  73. @@ -66,6 +69,9 @@
  74.  #if (SCALERHEIGHT > 2)
  75.             line2 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 2);
  76.  #endif
  77. +#if (SCALERHEIGHT > 3)
  78. +           line3 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 3);
  79. +#endif
  80.             SCALERFUNC;
  81.             line0 += SCALERWIDTH * SCALER_BLOCKSIZE;
  82.             fc += SCALER_BLOCKSIZE;
  83. @@ -77,6 +83,9 @@
  84.  #if (SCALERHEIGHT > 2)
  85.             line2 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 2);
  86.  #endif
  87. +#if (SCALERHEIGHT > 3)
  88. +           line3 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 3);
  89. +#endif
  90.             SCALERFUNC;
  91.         case SCALE_RIGHT:
  92.  #if (SCALERHEIGHT > 1)            
  93. @@ -85,6 +94,9 @@
  94.  #if (SCALERHEIGHT > 2)
  95.             line2 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 2);
  96.  #endif
  97. +#if (SCALERHEIGHT > 3)
  98. +           line3 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 3);
  99. +#endif
  100.             line0 += SCALERWIDTH * (SCALER_BLOCKSIZE -1);
  101.  #if (SCALERHEIGHT > 1)
  102.             line1 += SCALERWIDTH * (SCALER_BLOCKSIZE -1);
  103. @@ -92,6 +104,9 @@
  104.  #if (SCALERHEIGHT > 2)
  105.             line2 += SCALERWIDTH * (SCALER_BLOCKSIZE -1);
  106.  #endif
  107. +#if (SCALERHEIGHT > 3)
  108. +           line3 += SCALERWIDTH * (SCALER_BLOCKSIZE -1);
  109. +#endif
  110.             fc += SCALER_BLOCKSIZE -1;
  111.             SCALERFUNC;
  112.             line0 += SCALERWIDTH;
  113. @@ -105,6 +120,9 @@
  114.  #if (SCALERHEIGHT > 2)
  115.             line2 = WC[1];
  116.  #endif
  117. +#if (SCALERHEIGHT > 3)
  118. +           line3 = WC[2];
  119. +#endif
  120.  #else
  121.  #if (SCALERHEIGHT > 1)
  122.             line1 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch);
  123. @@ -112,6 +130,9 @@
  124.  #if (SCALERHEIGHT > 2)
  125.             line2 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 2);
  126.  #endif
  127. +#if (SCALERHEIGHT > 3)
  128. +           line3 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 3);
  129. +#endif
  130.  #endif //defined(SCALERLINEAR)
  131.             for (Bitu i = 0; i<SCALER_BLOCKSIZE;i++) {
  132.                 SCALERFUNC;
  133. @@ -122,6 +143,9 @@
  134.  #if (SCALERHEIGHT > 2)
  135.                 line2 += SCALERWIDTH;
  136.  #endif
  137. +#if (SCALERHEIGHT > 3)
  138. +               line3 += SCALERWIDTH;
  139. +#endif
  140.                 fc++;
  141.             }
  142.  #if defined(SCALERLINEAR)
  143. @@ -131,6 +155,9 @@
  144.  #if (SCALERHEIGHT > 2)
  145.             BituMove((Bit8u*)(&line0[-SCALER_BLOCKSIZE*SCALERWIDTH])+render.scale.outPitch*2,WC[1], SCALER_BLOCKSIZE *SCALERWIDTH*PSIZE);
  146.  #endif
  147. +#if (SCALERHEIGHT > 3)
  148. +           BituMove((Bit8u*)(&line0[-SCALER_BLOCKSIZE*SCALERWIDTH])+render.scale.outPitch*3,WC[2], SCALER_BLOCKSIZE *SCALERWIDTH*PSIZE);
  149. +#endif
  150.  #endif //defined(SCALERLINEAR)
  151.             break;
  152.         }
  153. diff -urN dosbox-0.73/src/gui/render_scalers.cpp dosbox-0.73/src/gui/render_scalers.cpp
  154. --- dosbox-0.73/src/gui/render_scalers.cpp  2009-05-25 20:44:46.000000000 +0200
  155. +++ dosbox-0.73/src/gui/render_scalers.cpp  2010-01-19 12:02:29.860881690 +0100
  156. @@ -256,6 +256,23 @@
  157.  {  Normal3x_8_8_R,     Normal3x_9_15_R ,   Normal3x_9_16_R ,   Normal3x_9_32_R }
  158.  }};
  159.  
  160. + ScalerSimpleBlock_t ScaleNormal4x = {
  161. +   "Normal4x",
  162. +   GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
  163. +   4,4,{
  164. +{   Normal4x_8_8_L,      Normal4x_8_15_L ,   Normal4x_8_16_L ,   Normal4x_8_32_L },
  165. +{                0,      Normal4x_15_15_L,   Normal4x_15_16_L,   Normal4x_15_32_L},
  166. +{                0,      Normal4x_16_15_L,   Normal4x_16_16_L,   Normal4x_16_32_L},
  167. +{                0,      Normal4x_32_15_L,   Normal4x_32_16_L,   Normal4x_32_32_L},
  168. +{   Normal4x_8_8_L,      Normal4x_9_15_L ,   Normal4x_9_16_L ,   Normal4x_9_32_L }
  169. +},{
  170. +{   Normal4x_8_8_R,      Normal4x_8_15_R ,   Normal4x_8_16_R ,   Normal4x_8_32_R },
  171. +{                0,      Normal4x_15_15_R,   Normal4x_15_16_R,   Normal4x_15_32_R},
  172. +{                0,      Normal4x_16_15_R,   Normal4x_16_16_R,   Normal4x_16_32_R},
  173. +{                0,      Normal4x_32_15_R,   Normal4x_32_16_R,   Normal4x_32_32_R},
  174. +{   Normal4x_8_8_R,      Normal4x_9_15_R ,   Normal4x_9_16_R ,   Normal4x_9_32_R }
  175. +}};
  176. +
  177.  #if RENDER_USE_ADVANCED_SCALERS>0
  178.  ScalerSimpleBlock_t ScaleTV2x = {
  179.     "TV2x",
  180. @@ -380,6 +397,14 @@
  181.  {  AdvMame3x_8_R,AdvMame3x_16_R,AdvMame3x_16_R,AdvMame3x_32_R}
  182.  };
  183.  
  184. +ScalerComplexBlock_t ScaleAdvMame4x = {
  185. +   "AdvMame4x",
  186. +   GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32,
  187. +   4,4,
  188. +{  AdvMame4x_8_L,AdvMame4x_16_L,AdvMame4x_16_L,AdvMame4x_32_L},
  189. +{  AdvMame4x_8_R,AdvMame4x_16_R,AdvMame4x_16_R,AdvMame4x_32_R}
  190. +};
  191. +
  192.  /* These need specific 15bpp versions */
  193.  ScalerComplexBlock_t ScaleHQ2x ={
  194.     "HQ2x",
  195. @@ -437,4 +462,12 @@
  196.  {  0,AdvInterp3x_15_R,AdvInterp3x_16_R,AdvInterp3x_32_R}
  197.  };
  198.  
  199. +ScalerComplexBlock_t ScaleAdvInterp4x = {
  200. +   "AdvInterp4x",
  201. +   GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY,
  202. +   4,4,
  203. +{  0,AdvInterp4x_15_L,AdvInterp4x_16_L,AdvInterp4x_32_L},
  204. +{  0,AdvInterp4x_15_R,AdvInterp4x_16_R,AdvInterp4x_32_R}
  205. +};
  206. +
  207.  #endif
  208. diff -urN dosbox-0.73/src/gui/render_scalers.h dosbox-0.73/src/gui/render_scalers.h
  209. --- dosbox-0.73/src/gui/render_scalers.h    2009-05-25 20:44:46.000000000 +0200
  210. +++ dosbox-0.73/src/gui/render_scalers.h    2010-01-19 12:03:28.170822333 +0100
  211. @@ -113,6 +113,7 @@
  212.  extern ScalerSimpleBlock_t ScaleNormalDh;
  213.  extern ScalerSimpleBlock_t ScaleNormal2x;
  214.  extern ScalerSimpleBlock_t ScaleNormal3x;
  215. +extern ScalerSimpleBlock_t ScaleNormal4x;
  216.  #if RENDER_USE_ADVANCED_SCALERS>0
  217.  extern ScalerSimpleBlock_t ScaleTV2x;
  218.  extern ScalerSimpleBlock_t ScaleTV3x;
  219. @@ -130,8 +131,10 @@
  220.  extern ScalerComplexBlock_t ScaleSuperEagle;
  221.  extern ScalerComplexBlock_t ScaleAdvMame2x;
  222.  extern ScalerComplexBlock_t ScaleAdvMame3x;
  223. +extern ScalerComplexBlock_t ScaleAdvMame4x;
  224.  extern ScalerComplexBlock_t ScaleAdvInterp2x;
  225.  extern ScalerComplexBlock_t ScaleAdvInterp3x;
  226. +extern ScalerComplexBlock_t ScaleAdvInterp4x;
  227.  #endif
  228.  #if RENDER_USE_ADVANCED_SCALERS>1
  229.  extern ScalerLineBlock_t ScalerCache;
  230. diff -urN dosbox-0.73/src/gui/render_simple.h dosbox-0.73/src/gui/render_simple.h
  231. --- dosbox-0.73/src/gui/render_simple.h 2009-05-27 11:15:41.000000000 +0200
  232. +++ dosbox-0.73/src/gui/render_simple.h 2010-01-19 11:55:13.982380988 +0100
  233. @@ -68,6 +68,9 @@
  234.  #if (SCALERHEIGHT > 2)
  235.             PTYPE *line2 = WC[1];
  236.  #endif
  237. +#if (SCALERHEIGHT > 3)
  238. +           PTYPE *line3 = WC[2];
  239. +#endif
  240.  #else
  241.  #if (SCALERHEIGHT > 1)
  242.         PTYPE *line1 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch);
  243. @@ -75,6 +78,9 @@
  244.  #if (SCALERHEIGHT > 2)
  245.         PTYPE *line2 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 2);
  246.  #endif
  247. +#if (SCALERHEIGHT > 3)
  248. +       PTYPE *line3 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 3);
  249. +#endif
  250.  #endif //defined(SCALERLINEAR)
  251.             hadChange = 1;
  252.             for (Bitu i = x > 32 ? 32 : x;i>0;i--,x--) {
  253. @@ -90,6 +96,9 @@
  254.  #if (SCALERHEIGHT > 2)
  255.                 line2 += SCALERWIDTH;
  256.  #endif
  257. +#if (SCALERHEIGHT > 3)
  258. +               line3 += SCALERWIDTH;
  259. +#endif
  260.             }
  261.  #if defined(SCALERLINEAR)
  262.  #if (SCALERHEIGHT > 1)
  263. @@ -99,6 +108,9 @@
  264.  #if (SCALERHEIGHT > 2)
  265.             BituMove(((Bit8u*)line0)-copyLen+render.scale.outPitch*2,WC[1], copyLen );
  266.  #endif
  267. +#if (SCALERHEIGHT > 3)
  268. +           BituMove(((Bit8u*)line0)-copyLen+render.scale.outPitch*3,WC[2], copyLen );
  269. +#endif
  270.  #endif //defined(SCALERLINEAR)
  271.         }
  272.     }
  273. diff -urN dosbox-0.73/src/gui/render_templates.h dosbox-0.73/src/gui/render_templates.h
  274. --- dosbox-0.73/src/gui/render_templates.h  2009-05-25 20:44:46.000000000 +0200
  275. +++ dosbox-0.73/src/gui/render_templates.h  2010-01-19 13:52:18.048640601 +0100
  276. @@ -257,6 +257,32 @@
  277.  #undef SCALERHEIGHT
  278.  #undef SCALERFUNC
  279.  
  280. +#define SCALERNAME     Normal4x
  281. +#define SCALERWIDTH        4
  282. +#define SCALERHEIGHT   4
  283. +#define SCALERFUNC                             \
  284. +   line0[0] = P;                               \
  285. +   line0[1] = P;                               \
  286. +   line0[2] = P;                               \
  287. +   line0[3] = P;                               \
  288. +   line1[0] = P;                               \
  289. +   line1[1] = P;                               \
  290. +   line1[2] = P;                               \
  291. +   line1[3] = P;                               \
  292. +   line2[0] = P;                               \
  293. +   line2[1] = P;                               \
  294. +   line2[2] = P;                               \
  295. +   line2[3] = P;                               \
  296. +   line3[0] = P;                               \
  297. +   line3[1] = P;                               \
  298. +   line3[2] = P;                               \
  299. +   line3[3] = P;
  300. +#include "render_simple.h"
  301. +#undef SCALERNAME
  302. +#undef SCALERWIDTH
  303. +#undef SCALERHEIGHT
  304. +#undef SCALERFUNC
  305. +
  306.  #define SCALERNAME     NormalDw
  307.  #define SCALERWIDTH        2
  308.  #define SCALERHEIGHT   1
  309. @@ -508,6 +534,44 @@
  310.  #undef SCALERHEIGHT
  311.  #undef SCALERFUNC
  312.  
  313. +#define SCALERNAME     AdvInterp4x
  314. +#define SCALERWIDTH        4
  315. +#define SCALERHEIGHT   4
  316. +#define SCALERFUNC                                                                 \
  317. +   if ((C1 != C7) && (C3 != C5)) {                                             \
  318. +       line0[0] = C3 == C1 ? interp_w2(C3,C4,5U,3U) : C4;                      \
  319. +       line0[3] = C1 == C5 ? interp_w2(C5,C4,5U,3U) : C4;                      \
  320. +       line1[1] = C4;                                                          \
  321. +       line1[2] = C4;                                                          \
  322. +       line2[1] = C4;                                                          \
  323. +       line2[2] = C4;                                                          \
  324. +       line3[0] = C3 == C7 ? interp_w2(C3,C4,5U,3U) : C4;                      \
  325. +       line3[3] = C7 == C5 ? interp_w2(C5,C4,5U,3U) : C4;                      \
  326. +       line0[1] = line0[0];                                                    \
  327. +       line0[2] = line0[3];                                                    \
  328. +       line1[0] = line0[0];                                                    \
  329. +       line1[3] = line0[3];                                                    \
  330. +       line2[0] = line3[0];                                                    \
  331. +       line2[3] = line3[3];                                                    \
  332. +       line3[1] = line3[0];                                                    \
  333. +       line3[2] = line3[3];                                                    \
  334. +       if (line0[0] != C4){line0[0] = interp_w2(C3,line0[0],5U,3U);}           \
  335. +       if (line0[3] != C4){line0[3] = interp_w2(C5,line0[3],5U,3U);}           \
  336. +       if (line3[0] != C4){line3[0] = interp_w2(C3,line3[0],5U,3U);}           \
  337. +       if (line3[3] != C4){line3[3] = interp_w2(C5,line3[3],5U,3U);}           \
  338. +   } else {                                                                    \
  339. +       line0[0] = line0[1] = line0[2] = line0[3] = C4;                         \
  340. +       line1[0] = line1[1] = line1[2] = line1[3] = C4;                         \
  341. +       line2[0] = line2[1] = line2[2] = line2[3] = C4;                         \
  342. +       line3[0] = line3[1] = line3[2] = line3[3] = C4;                         \
  343. +   }
  344. +
  345. +#include "render_loops.h"
  346. +#undef SCALERNAME
  347. +#undef SCALERWIDTH
  348. +#undef SCALERHEIGHT
  349. +#undef SCALERFUNC
  350. +
  351.  #endif // #if (DBPP > 8)
  352.  
  353.  #define SCALERNAME     AdvMame2x
  354. @@ -555,6 +619,39 @@
  355.  #undef SCALERHEIGHT
  356.  #undef SCALERFUNC
  357.  
  358. +#define SCALERNAME     AdvMame4x
  359. +#define SCALERWIDTH        4
  360. +#define SCALERHEIGHT   4
  361. +#define SCALERFUNC                                             \
  362. +   if ((C1 != C7) && (C3 != C5)) {                             \
  363. +       line0[0] = C3 == C1 ?  C3 : C4;                         \
  364. +       line0[3] = C5 == C1 ?  C5 : C4;                         \
  365. +       line1[1] = C4;                                          \
  366. +       line1[2] = C4;                                          \
  367. +       line2[1] = C4;                                          \
  368. +       line2[2] = C4;                                          \
  369. +       line3[0] = C3 == C7 ?  C3 : C4;                         \
  370. +       line3[3] = C5 == C7 ?  C5 : C4;                         \
  371. +       line0[1] = line0[0];                                    \
  372. +       line0[2] = line0[3];                                    \
  373. +       line1[0] = line0[0];                                    \
  374. +       line1[3] = line0[3];                                    \
  375. +       line2[0] = line3[0];                                    \
  376. +       line2[3] = line3[3];                                    \
  377. +       line3[1] = line3[0];                                    \
  378. +       line3[2] = line3[3];                                    \
  379. +   } else {                                                    \
  380. +       line0[0] = line0[1] = line0[2] = line0[3] = C4;         \
  381. +       line1[0] = line1[1] = line1[2] = line1[3] = C4;         \
  382. +       line2[0] = line2[1] = line2[2] = line2[3] = C4;         \
  383. +       line3[0] = line3[1] = line3[2] = line3[3] = C4;         \
  384. +   }
  385. +
  386. +#include "render_loops.h"
  387. +#undef SCALERNAME
  388. +#undef SCALERWIDTH
  389. +#undef SCALERHEIGHT
  390. +#undef SCALERFUNC
  391.  
  392.  #endif // (SBPP == DBPP) && !defined (CACHEWITHPAL)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement