Speeding up ntsc shader on integrated graphics Golden Child 02/22/24 05:02 PM
Hi all,

I got interested in trying out the ntsc shader again and wondered if I could make it go a bit faster on my system's integrated graphics (an old core i5-3570)

So if I change some of the settings in bgfx/chains/hlsl.json to use the "guest" resolution instead of "native" resolution it goes a whole lot faster.


Code
                // mode (required): The mode of the target. Can be used for different implicit and explicit sizing options.
                // values:
                //     "guest": Use the size of the emulated screen that is being processed (e.g. 256x256 when running "targ")
                //     "native": Use the size of the displayed screen inside the window that is being displayed (the same size as the window size, for single-screen games with no artwork)
                //     "custom": Use a custom size.
                //
                // bilinear (optional): Whether or not to apply bilinear filtering to this render target.
                // values: true, false
                // default: true
                //
                // doublebuffer (optional): Whether or not this render target will be needed as a source texture. If you don't know what this means, omit it or set it to true.
                // values: true, false
                // default: true
                //
                // scale (optional): Multiply the internal size of this render target by this amount. Certain effects benefit from operating at a higher internal resolution. If you're not sure, omit it.
                // values: Any integer value
                // default: 1
                {
                        "name": "ntsc",
                        "mode": "guest",
                        "scale":1.0,
                        "doublebuffer": true
                },
                {
                        "name": "guest",
                        "mode": "guest",
                        "scale":1.0,
                        "bilinear": false,
                        "doublebuffer": true
                },
                {       "name": "internal",
                        "mode": "guest",
                        "bilinear": false,
                        "scale": 1.0,
                        "doublebuffer": true
                },
                {       "name": "previous",
                        "mode": "guest",
                        "scale": 1.0,
                        "doublebuffer": true
                }
        ],



Also, I got tired of selecting "white" as the shadow mask, so I changed src/osd/modules/lib/osdobj_common.cpp:

// { OSDOPTION_BGFX_SHADOW_MASK, "slot-mask.png", core_options::option_type::STRING, "shadow mask texture name" },
{ OSDOPTION_BGFX_SHADOW_MASK, "white.png", core_options::option_type::STRING, "shadow mask texture name" },

the other shadow masks make it look dimmer, I prefer the brightest possible.


and I changed it for the apple II, ntsc a and b set to 0, and scanline duration 39.11, (Y bandwidth to 4.38 removes much of the banding)
Code
                { "type": "float",   "name": "a_value",         "text": "NTSC A Value",                          "default":  0.0,    "max":   1.00,    "min": 0.00,    "step": 0.01,    "format": "%1.2f", "screen": "raster" },
                { "type": "float",   "name": "b_value",         "text": "NTSC B Value",                          "default":  0.0,    "max":   1.00,    "min": 0.00,    "step": 0.01,    "format": "%1.2f", "screen": "raster" },
                { "type": "float",   "name": "cc_value",        "text": "NTSC Color Carrier (MHz)",              "default": 3.5795455,"max":   3.67954, "min": 3.47954, "step": 0.000001, "format": "%1.7f", "screen": "raster" },
                { "type": "float",   "name": "o_value",         "text": "NTSC Outgoing Phase Offset (radians)",  "default":  0.00,    "max":   3.14,    "min":-3.14,    "step": 0.01,    "format": "%1.2f", "screen": "raster" },
                { "type": "float",   "name": "p_value",         "text": "NTSC Incoming Phase Pixel Clock Scale", "default":  1.00,    "max":   2.00,    "min": 0.00,    "step": 0.01,    "format": "%1.2f", "screen": "raster" },
                { "type": "float",   "name": "scan_time",       "text": "NTSC Scanline Duration (uSec)",         "default": 39.11,    "max": 150.00,    "min": 1.00,    "step": 0.01,     "format": "%3.2f", "screen": "raster" },

                { "type": "float",   "name": "notch_width",     "text": "NTSC Color Notch Filter Width (MHz)",   "default":  2.00,    "max":   4.00,    "min": 1.00,    "step": 0.01,    "format": "%1.2f", "screen": "raster" },
                { "type": "float",   "name": "y_freq_response", "text": "NTSC Y Signal Bandwidth (MHz)",         "default":  4.40,    "max":  21.00,    "min": 0.00,    "step": 0.01,    "format": "%2.2f", "screen": "raster" },

Another thing I did was to set the resolution of the window to 560x384 which makes it run at 77%. Full screen 1920x1080 drops down to around 40%.

./mame -numscreens 1 -nofilter apple2e -gameio joy -sl4 "" -snapsize 560x384 -video bgfx -numscreens 1 choplftr -bgfx_screen_chains hlsl -window -resolution0 560x384


Also I noticed the apple2e driver now has a new configuration option for monochrome (B&W for NTSC shader) which is awesome!


[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]
0 29 Read More