Snes9x with xBRZ scaler support
Snes9x with xBRZ scaler support
Hi,
just as the title says, this is Snes9x with support for the xBRZ software scaler.
xBRZ is intended as a replacement for HQx and was added as a new scaler for selection in Snes9x's display settings.
For a short comparison between xBRZ and other software scalers, see here:
http://www.vogons.org/viewtopic.php?t=34125
The source is also included, so if there's interest to add xBRZ to the official Snes9x release, the code is here for study.
Binary:
http://www.file-upload.net/download-893 ... Z.zip.html
Source:
http://www.file-upload.net/download-893 ... e.zip.html
Best regards, Zenju
just as the title says, this is Snes9x with support for the xBRZ software scaler.
xBRZ is intended as a replacement for HQx and was added as a new scaler for selection in Snes9x's display settings.
For a short comparison between xBRZ and other software scalers, see here:
http://www.vogons.org/viewtopic.php?t=34125
The source is also included, so if there's interest to add xBRZ to the official Snes9x release, the code is here for study.
Binary:
http://www.file-upload.net/download-893 ... Z.zip.html
Source:
http://www.file-upload.net/download-893 ... e.zip.html
Best regards, Zenju
Re: Snes9x with xBRZ scaler support
Moved your topic to what I feel is a more appropriate forum for this type of thing.
Re: Snes9x with xBRZ scaler support
Hi Zenju,
thank you for taking the time to add this to snes9x. However I can only include it in the official releases (if there ever is another ) if you allow an exception for s9x, since its license is not compatible with the GPL.
I'm not a huge fan of adding the TBB dependency, but I could add it as optional behind a define.
thank you for taking the time to add this to snes9x. However I can only include it in the official releases (if there ever is another ) if you allow an exception for s9x, since its license is not compatible with the GPL.
I'm not a huge fan of adding the TBB dependency, but I could add it as optional behind a define.
Re: Snes9x with xBRZ scaler support
Sure, no problem Just let me know when time to implement draws near, and I'll add it to the official sources just like for HqMAME.allow an exception for s9x
Code: Select all
if there ever is another
Code: Select all
not a huge fan of adding the TBB dependency
Re: Snes9x with xBRZ scaler support
Hi,
Thank you for adding 4xbrz, best filter available in snes9x at the moment! Do you plan to add 2xbr (my favorite) and 3xbrz too?
Thanks again,
Psychic5
Thank you for adding 4xbrz, best filter available in snes9x at the moment! Do you plan to add 2xbr (my favorite) and 3xbrz too?
Thanks again,
Psychic5
-
- Snes9x White Belt
- Posts: 32
- Joined: Thu May 02, 2013 2:33 pm
Re: Snes9x with xBRZ scaler support
I am a tad late to the party...but I have been extensively testing the XBRZ filter...So far...I have not detected any grey lines other filters have made with DKC2 and the lines that even XBR leaves behind are gone....While this filter might not make it into the next version...I'd love to start experimenting on mixing XBRZ with different shaders via .cgp files.....So that being said...do you think you could possibly turn the filter into a .cg shader file as a shader and share the code on this thread?
Re: Snes9x with xBRZ scaler support
I don't have experience programming cg shaders, but I guess it would be quite a challenge. xBRZ has been written from scratch in C++ and takes advantage of a lot of C++ features which don't have a direct representation in the shader language. That's unlike xBR which AFAIK was written in shader language first and then ported to C.WalMartCartPusher wrote:do you think you could possibly turn the filter into a .cg shader file as a shader and share the code on this thread?
Re: Snes9x with xBRZ scaler support
I just created an account to say... Thank you so much for this! I've been waiting for months for someone to add xBRZ to ANY snes emulator. If I knew how to code I would have added it myself when I discovered xBRZ months ago.
I do have a problem though. I can't use it! I have a 2.5ghz dual core processor that's not quite fast enough to run 4xBRZ. I don't know how difficult it would be to add 2xBRZ and 3xBRZ, but I;m sure a lot of others, including myself, would greatly appreciate it. I think I might be able to use 3xBRZ smoothly, but not sure.
If you could do this for the emulator community. It would be greatly appreciated.
If I wasn't dirt poor. I'd even pay you some money to do it.
I do have a problem though. I can't use it! I have a 2.5ghz dual core processor that's not quite fast enough to run 4xBRZ. I don't know how difficult it would be to add 2xBRZ and 3xBRZ, but I;m sure a lot of others, including myself, would greatly appreciate it. I think I might be able to use 3xBRZ smoothly, but not sure.
If you could do this for the emulator community. It would be greatly appreciated.
If I wasn't dirt poor. I'd even pay you some money to do it.
Re: Snes9x with xBRZ scaler support
Actually, easy I've added 2xBRZ and 3xBRZ:Aaron6537 wrote:how difficult it would be to add 2xBRZ and 3xBRZ
Snes9x-1.53-xBRZ-2014-06-05.zip
Snes9x-1.53-xBRZ-2014-06-05-source.zip
Re: Snes9x with xBRZ scaler support
Thank you!
I really appreciate!
I really appreciate!
Re: Snes9x with xBRZ scaler support
Oh my god! Thank you! Thank you! Thank you so much! Your awesome. I'm testing it right now. Not having very good results unfortunately.
Not sure what to do. Except for frame skipping. Automatic skipping one frame jumps the FPS from 42 up to 60.
It works perfectly for me with Kega Fusion 3.63 and xBRZ plugins made by milo1012. Maybe Snes9x uses more CPU than Kega Fusion.
Here's his plugins and source if your interested in checking it out. Look at the comments for his xBRZ url.
http://www.emucr.com/2013/04/kega-fusio ... 30427.html
Latest xBRZ plugins and source from his comment.
http://en.file-upload.net/download-8825 ... 1.zip.html
Not sure how you do it but maybe milo1012's version is much faster than the version you added. Maybe you can use his source to create faster and multithreaded versions.
Just trying to help you improve it to run on older computers. Thanks for letting me see what DKC and Mario looked like.
Not sure what to do. Except for frame skipping. Automatic skipping one frame jumps the FPS from 42 up to 60.
It works perfectly for me with Kega Fusion 3.63 and xBRZ plugins made by milo1012. Maybe Snes9x uses more CPU than Kega Fusion.
Here's his plugins and source if your interested in checking it out. Look at the comments for his xBRZ url.
http://www.emucr.com/2013/04/kega-fusio ... 30427.html
Latest xBRZ plugins and source from his comment.
http://en.file-upload.net/download-8825 ... 1.zip.html
Not sure how you do it but maybe milo1012's version is much faster than the version you added. Maybe you can use his source to create faster and multithreaded versions.
Just trying to help you improve it to run on older computers. Thanks for letting me see what DKC and Mario looked like.
Re: Snes9x with xBRZ scaler support
The kega version of xBRZ claims to be 2-8 % faster than the original code, so it's probably the differences between kega and snes9x that explain perf. Technically the kega xBRZ code does pretty much the same thing, except for needlessly giving up on encapsulation by undoing function calls that the compiler inlines easily, littering the code with magic numbers and removing some dead code that was never used anyway. Reading a book on modern C++ programming principles would not have hurt here [/end of rant]
Re: Snes9x with xBRZ scaler support
Ummm..... Lol. I only have a vague idea of what your talking about there but what I can say is I just updated my Kega xBRZ plugin and can now use the 3xBRZ multithreaded version instead of the 2xBRZ multithreaded version. The Snes9x xBRZ I can't even use 2xBRZ without adding 1 frame skip to it.
Maybe there is something to this Kega xBRZ plugin or do you reallly think Kega and Snes9x itself is what makes the speed difference?
By the way, I think my brain draws the line when it comes to coding. It's never gonna happen. Tried C# video tutorials once. Watched about 10 training videos. My brain stopped right after learning a little bit about operations, iterations, expressions, arrays, and statements.
Maybe there is something to this Kega xBRZ plugin or do you reallly think Kega and Snes9x itself is what makes the speed difference?
By the way, I think my brain draws the line when it comes to coding. It's never gonna happen. Tried C# video tutorials once. Watched about 10 training videos. My brain stopped right after learning a little bit about operations, iterations, expressions, arrays, and statements.
Re: Snes9x with xBRZ scaler support
I've finally had time last weekend and added xbrz: snes9x_testbuild_24062014.zip
I rolled my on threaded implementation to remove the TBB dependency and also had to make some small modifications to the xbrz code to keep VS2008 compatibility. Hope that's ok (commit).
I rolled my on threaded implementation to remove the TBB dependency and also had to make some small modifications to the xbrz code to keep VS2008 compatibility. Hope that's ok (commit).
Re: Snes9x with xBRZ scaler support
It's looking good! I've done a very quick review of the code and have two remarks:OV2 wrote:I've finally had time last weekend and added xBRZ.
Code: Select all
num_xbrz_threads = sysinfo.dwNumberOfProcessors * 2;
Code: Select all
stretchImage32To16
Re: Snes9x with xBRZ scaler support
Can you add 2xbrz and 3xbrz too, as they are missing in your compile?OV2 wrote:I've finally had time last weekend and added xbrz: snes9x_testbuild_24062014.zip
I rolled my on threaded implementation to remove the TBB dependency and also had to make some small modifications to the xbrz code to keep VS2008 compatibility. Hope that's ok (commit).
You can find Zenju's source with 2xbrz and 3xbrz above.
Thanks!
Re: Snes9x with xBRZ scaler support
Here is a version with 2x/3x: snes9x_testbuild_25062014.zip
I think I did that to get closer to your task granularity, but I guess you're right since this is CPU-bound.Zenju wrote:I think the "*2" should be removed. On my machine this creates 8 threads, but I only have 4 CPU cores with no hyperthreading capability. But even with hyperthreading this seems like oversubscription.
Usually there should be no streching, only the 32to16 conversion, unless it's a high res game. It would be nice to simply switch to 32bit textures for xbrz, but the current design doesn't support that.Zenju wrote:Ideally this scaling should be executed as a bilinear filter on the graphics card. This would get rid of additional artifacts that are introduced by the simple nearest neighbor stretching algorithm. But I don't know if this is already possible in Snes9x.Code: Select all
stretchImage32To16
Re: Snes9x with xBRZ scaler support
The best multithreaded solution would be of course to have a task scheduler (like Intel TBB - hopefully this will be a standard C++ library maybe with C++17) and chop everything into tiny little pieces. In the absence of that using twice the number of threads than cores could be seen as a compromise. Anyway, I did a quick performance comparison between 4 and 8 threads on my 4 core machine and couldn't find any noticible perf difference.I think I did that to get closer to your task granularity, but I guess you're right since this is CPU-bound.
Okay, it seems there is a second nearest neighbor stretching happening when "Display Settings -> General ->Stretch Image" is checked. It would be great if this step could be done as biliinear filter: at least for xBRZ this introduces quite a number of artifacts. Compare stretched vs unstretched 4xBRZ:Usually there should be no streching, only the 32to16 conversion
Re: Snes9x with xBRZ scaler support
That's what the "Bilinear Filtering" option in display settings should do.
Re: Snes9x with xBRZ scaler support
lol, for some reason I didn't expect a user option for "bilinear filtering", and so didn't look for one. TILOV2 wrote:That's what the "Bilinear Filtering" option in display settings should do.