From 2228a8de1391bc648f3f65541c5c68458838f223 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 21 Jul 2009 02:32:55 +0000 Subject: [PATCH] win32: tone down the default intensity of the scanline filter a bit, and add commandline args to control the intensity, in the vain hopes that someone will give me feedback on what their favourite values are --- desmume/src/commandline.cpp | 4 ++++ desmume/src/windows/filter/scanline.cpp | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/desmume/src/commandline.cpp b/desmume/src/commandline.cpp index ca734374a..2a7ed7735 100644 --- a/desmume/src/commandline.cpp +++ b/desmume/src/commandline.cpp @@ -29,6 +29,8 @@ #include "movie.h" #include "addons.h" +int scanline_filter_a = 2, scanline_filter_b = 4; + CommandLine::CommandLine() : error(NULL) , ctx(g_option_context_new ("")) @@ -66,6 +68,8 @@ void CommandLine::loadCommonOptions() { "cflash-path", 0, 0, G_OPTION_ARG_FILENAME, &_cflash_path, "Requests cflash in gbaslot with filesystem rooted at this path", "CFLASH_PATH"}, #ifdef _MSC_VER { "single-core", 0, 0, G_OPTION_ARG_NONE, &single_core, "Limit execution to use approximately only one core", "NUM_CORES"}, + { "scanline-filter-a", 0, 0, G_OPTION_ARG_INT, &scanline_filter_a, "Intensity of fadeout for scanlines filter (edge) (default 2)", "SCANLINE_FILTER_A"}, + { "scanline-filter-b", 0, 0, G_OPTION_ARG_INT, &scanline_filter_b, "Intensity of fadeout for scanlines filter (corner) (default 4)", "SCANLINE_FILTER_B"}, #endif #ifdef GDB_STUB { "arm9gdb", 0, 0, G_OPTION_ARG_INT, &arm9_gdb_port, "Enable the ARM9 GDB stub on the given port", "PORT_NUM"}, diff --git a/desmume/src/windows/filter/scanline.cpp b/desmume/src/windows/filter/scanline.cpp index cd6e66ea4..96ffdd5fb 100644 --- a/desmume/src/windows/filter/scanline.cpp +++ b/desmume/src/windows/filter/scanline.cpp @@ -6,19 +6,21 @@ typedef u64 uint64; extern CACHE_ALIGN u16 fadeOutColors[17][0x8000]; + +extern int scanline_filter_a, scanline_filter_b; // stretches a single line inline void DoubleLine16( uint16 *lpDst, uint16 *lpSrc, unsigned int Width){ while(Width--){ *lpDst++ = *lpSrc; - *lpDst++ = fadeOutColors[3][(*lpSrc++)]; + *lpDst++ = fadeOutColors[scanline_filter_a][(*lpSrc++)]; } } inline void DoubleLine16_2( uint16 *lpDst, uint16 *lpSrc, unsigned int Width){ while(Width--){ - *lpDst++ = fadeOutColors[3][(*lpSrc)]; - *lpDst++ = fadeOutColors[6][(*lpSrc++)]; + *lpDst++ = fadeOutColors[scanline_filter_a][(*lpSrc)]; + *lpDst++ = fadeOutColors[scanline_filter_b][(*lpSrc++)]; } }