summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorneonloop2021-04-09 20:28:57 +0000
committerneonloop2021-04-09 20:28:57 +0000
commit6dcf2d4e43b8951183025dc0b2f12b1568e62d62 (patch)
treed02eaa1eb22fe6cec67453246aca7bb89d435b94 /frontend
parentc6d6e8c60dcbdf977597f6df89511b4ac4fa0a38 (diff)
downloadpicogpsp-6dcf2d4e43b8951183025dc0b2f12b1568e62d62.tar.gz
picogpsp-6dcf2d4e43b8951183025dc0b2f12b1568e62d62.tar.bz2
picogpsp-6dcf2d4e43b8951183025dc0b2f12b1568e62d62.zip
Include eggs' smoothness edits to drowsnug's upscaler
Diffstat (limited to 'frontend')
-rw-r--r--frontend/scale.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/frontend/scale.c b/frontend/scale.c
index 3f471b7..3998f9f 100644
--- a/frontend/scale.c
+++ b/frontend/scale.c
@@ -334,9 +334,9 @@ static inline void gba_nofilter_noscale(uint16_t *dst, uint32_t dst_h, uint32_t
}
}
-/* drowsnug's nofilter upscaler */
+/* drowsnug's nofilter upscaler, edited by eggs for smoothness */
#define AVERAGE16(c1, c2) (((c1) + (c2) + (((c1) ^ (c2)) & 0x0821))>>1) //More accurate
-static inline void gba_nofilter_upscale(uint16_t *dst, uint16_t *src, int h)
+static inline void gba_smooth_upscale(uint16_t *dst, uint16_t *src, int h)
{
int Eh = 0;
int dh = 0;
@@ -364,8 +364,8 @@ static inline void gba_nofilter_upscale(uint16_t *dst, uint16_t *src, int h)
}
*dst++ = a;
- *dst++ = (AVERAGE16(a,b) & 0b0000000000011111) | (b & 0b1111111111100000);
- *dst++ = (b & 0b0000011111111111) | (AVERAGE16(b,c) & 0b1111100000000000);
+ *dst++ = AVERAGE16(AVERAGE16(a,b),b);
+ *dst++ = AVERAGE16(b,AVERAGE16(b,c));
*dst++ = c;
source+=3;
@@ -450,16 +450,16 @@ void video_scale(uint16_t *dst, uint32_t h, uint32_t pitch) {
switch (scaling_mode)
{
case SCALING_ASPECT_SHARP:
- gba_nofilter_upscale(dst, gba_screen_pixels_buf, 214);
+ gba_smooth_subpx_upscale(dst, gba_screen_pixels_buf, 214);
break;
case SCALING_ASPECT_SMOOTH:
- gba_smooth_subpx_upscale(dst, gba_screen_pixels_buf, 214);
+ gba_smooth_upscale(dst, gba_screen_pixels_buf, 214);
break;
case SCALING_FULL_SHARP:
- gba_nofilter_upscale(dst, gba_screen_pixels_buf, 240);
+ gba_smooth_subpx_upscale(dst, gba_screen_pixels_buf, 240);
break;
case SCALING_FULL_SMOOTH:
- gba_smooth_subpx_upscale(dst, gba_screen_pixels_buf, 240);
+ gba_smooth_upscale(dst, gba_screen_pixels_buf, 240);
break;
default:
gba_nofilter_noscale(dst, h, pitch, gba_screen_pixels_buf);