Homebrew TWPatcher - DS(i) mode screen filters and patches

  • Thread starter Sono
  • Start date
  • Views 755,704
  • Replies 2,428
  • Likes 102

Are you interested in a complete replacement of TwlBg which includes all patches?

  • Yes, I don't care how broken it will be!

    Votes: 188 79.3%
  • No, I don't want to use even more broken stuff

    Votes: 20 8.4%
  • Yes, but only in GBA mode, because I play DSi exclusives

    Votes: 12 5.1%
  • No, because I only use DS and DSi mode

    Votes: 17 7.2%

  • Total voters
    237
  • Poll closed .

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,375
Country
Hungary
With this would it be possible to do a full screen mode on the upper screen?

It's not possible to do full image stretching AT ALL (due to the matrix hardware only having 8 steps max, and a full stretching would require 25/12 division) and partial stretching requires extensive patching (albeit doable, and exactly 2x on the X axis due to 24/12 fitting into the matrix hardware's range because it can be simplified to 8/4).

On the other hand, if I understood correctly: when using this patch x1.25, which is the same original size, applying it removes the blurring effect and weird color that comes in stock?

It does correct some color problems caused by the original awful matrix, but the color will be mostly the same.

As for the blurriness, the manual patch removes most of it, except there is a grid-like pattern of blurring in it to make it just ever so slightly less an eyesore due to the 5/4 upscaling ratio.
 

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,464
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,316
Country
It's not possible to do full image stretching AT ALL (due to the matrix hardware only having 8 steps max, and a full stretching would require 25/12 division) and partial stretching requires extensive patching (albeit doable, and exactly 2x on the X axis due to 24/12 fitting into the matrix hardware's range because it can be simplified to 8/4).



It does correct some color problems caused by the original awful matrix, but the color will be mostly the same.

As for the blurriness, the manual patch removes most of it, except there is a grid-like pattern of blurring in it to make it just ever so slightly less an eyesore due to the 5/4 upscaling ratio.
I don't fully understand the math as you're explaining it, but would it be possible to scale on the x-axis by 3/2 (aka 6/4 or 12/8)? Then the y-axis would stick to 5/4. You'd end up with the image stretched to 384*240, which is extremely close to full screen.

The bottom screen would obviously not fit at all unless somebody figured out independent top/bottom screen scaling, but anything that's played primarily on the top screen would probably be workable.

EDIT: Assuming that math checks out, the resulting aspect ratio would be 8:5, aka 16:10. In theory, people could use the various widescreen cheats for DS games unchanged, but they'd look slightly off since they're targeting 16:9. Using the formula in that thread to suit 384/240, we'd need 0x1999 (nice and memorable) to get the correct aspect to match this scaling setting.
 
Last edited by Vague Rant,

Jayro

MediCat USB Dev
Developer
Joined
Jul 23, 2012
Messages
13,015
Trophies
4
Location
WA State
Website
ko-fi.com
XP
17,131
Country
United States
Could there possibly be some kind of "sharp bilinear filtering" trade-off? The default 1.25 is too soft in my opinion, and I love my 1:1 pixels personally... But 1.25 with a tiny bit less filtering would be nice.
 

Reynardine

Fuchsly
Member
Joined
Aug 14, 2018
Messages
520
Trophies
1
Location
Negativland
XP
1,296
Country
Germany
Here's a comparison I took of the Chrono Trigger menu screen on a New 3ds XL:

1.25x sharp mode:
16a7d76.jpg

Original blurry mode:
29vcxo0.jpg


It makes a huge difference. I wonder why Nintendo didn't make such a setting useable by default.
Opinions may differ, but for me the blurriness was the reason why I couldn't enjoy DS games on a 3DS.

Testing this made me realize that the 3DS analog nub makes games like Super Mario 64 quite a bit more enjoyable, by the way! ;)
 
Last edited by Reynardine,

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,375
Country
Hungary
I don't fully understand the math as you're explaining it, but would it be possible to scale on the x-axis by 3/2 (aka 6/4 or 12/8)? Then the y-axis would stick to 5/4. You'd end up with the image stretched to 384*240, which is extremely close to full screen.

The bottom screen would obviously not fit at all unless somebody figured out independent top/bottom screen scaling, but anything that's played primarily on the top screen would probably be workable.

EDIT: Assuming that math checks out, the resulting aspect ratio would be 8:5, aka 16:10. In theory, people could use the various widescreen cheats for DS games unchanged, but they'd look slightly off since they're targeting 16:9. Using the formula in that thread to suit 384/240, we'd need 0x1999 (nice and memorable) to get the correct aspect to match this scaling setting.

I thought that by widescreen patch people meant trying to stretch the screen to the edge as much as possible, so I tried to do that, and it turns out that the biggest stretch I can do is 24/12, because it can be simplified to 8/4, which the matrix hardware can process.

By "the matrix hardware supports 8 max", I meant that the divisor and divider can only be between 1 and 8 (and that's a hardware limitation), so I have to math out all the possible combos from that.

Also, when upscaling, we don't care about the 3DS screen resolution, the matrix hardware always gets the 256x192 in 8 line chunks, so we work from there.

so this is the X1.25 sharp filter added to DSi mode patch?

It does contain a 1.25x patch (albeit I personally didn't test it yet) if you want to patch it manually.
Or if you can wait a little longer, I'm working on a push-button automatic patcher which runs on the 3DS, and does everything for you.

Could there possibly be some kind of "sharp bilinear filtering" trade-off? The default 1.25 is too soft in my opinion, and I love my 1:1 pixels personally... But 1.25 with a tiny bit less filtering would be nice.

Yes, the patcher comes with some alternative matrixes for those who don't like the pseudosharp or double pixel pattern arrangement.
In a future version (hopefully only a few days after the initial release) there will be a matrix editor which will let you define your own custom patterns.
 

Waygeek

Well-Known Member
Member
Joined
May 14, 2013
Messages
426
Trophies
0
Age
39
Location
Seoul, Korea
XP
470
Yeah gonna be finishing 64 on a nub hopefully. Praise op.

Guess I'm ok to list my cfw DSi for sale now? Is there gonna be an automated process for this soonish? Not savvy enough to be tinkering with hexes etc.

Are we gonna be able to move the image into the centre of the screen vertically with this? That's one thing that annoys me about the X1 official solution...
 
Last edited by Waygeek,

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,375
Country
Hungary
Guess I'm ok to list my cfw DSi for sale now? Is there gonna be an automated process for this soonish? Not savvy enough to be tinkering with hexes etc.

I don't think you should sell your DSi if you're really serious about image quality. Some games look awful regardless of what filter I apply, so if you don't want to use your 3DS in 1x mode for those games then you should still keep your DSi.

Also yes, the automatic patcher should've come out a few days ago, but I'm battling crusading against my sleep deprevation, so that's what's holding me up now.
 

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,464
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,316
Country
I thought that by widescreen patch people meant trying to stretch the screen to the edge as much as possible, so I tried to do that, and it turns out that the biggest stretch I can do is 24/12, because it can be simplified to 8/4, which the matrix hardware can process.

By "the matrix hardware supports 8 max", I meant that the divisor and divider can only be between 1 and 8 (and that's a hardware limitation), so I have to math out all the possible combos from that.

Also, when upscaling, we don't care about the 3DS screen resolution, the matrix hardware always gets the 256x192 in 8 line chunks, so we work from there.
Right, sorry, I understand that the TWL firmware doesn't "care" about the 3DS resolution as such, but for the sake of the end-user it seems helpful to understand that a 3/2 x-scale and 5/4 y-scale would end up filling 384 by 240 pixels (out of 400 by 240, so very nearly full screen). Again, that's irrelevant to the TWL firmware, but it's useful for calculating the aspect ratio when using those widescreen cheats.

All of those divisors and dividers are between 2 and 5, so hopefully that would work out. Phrased in decimal, that'd be 1.5x scale horizontally and 1.25x scale vertically.
 

PRAGMA

Well-Known Member
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,039
Country
Ireland
Huge request:
Can you make a stretch screen filter, Where it resizes to fill the entire top screen?
(Please dont reply saying bla bla bad quality bla bla why would you want this)
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,375
Country
Hungary
Right, sorry, I understand that the TWL firmware doesn't "care" about the 3DS resolution as such, but for the sake of the end-user it seems helpful to understand that a 3/2 x-scale and 5/4 y-scale would end up filling 384 by 240 pixels (out of 400 by 240, so very nearly full screen). Again, that's irrelevant to the TWL firmware, but it's useful for calculating the aspect ratio when using those widescreen cheats.

All of those divisors and dividers are between 2 and 5, so hopefully that would work out. Phrased in decimal, that'd be 1.5x scale horizontally and 1.25x scale vertically.

Funnily enough you can derive the aspect ratio from the DS' original resolution too, because it has the same aspect ratio :P Also, I said matrix hardware, not TwlBg. Of course the software has to care, because it's using OpenGL to draw the image. But since the matrix unit it just a very clever image stretcher, we can ignore the resolution entirely because the aspect ratio remains the same.

But yeah, I get your point.

Huge request:
Can you make a stretch screen filter, Where it resizes to fill the entire top screen?
(Please dont reply saying bla bla bad quality bla bla why would you want this)

Nope. Unless you are okay with partial stretch (instead of 400 wide, which is 25/12 stretching, you get 384, which is 24/12, which can be simplified to 8/4 for the matrix hardware). This is not something I control, this is hardware limitation, and it is NOT possible to get around this without extensive patching and great performance deficit.

Edit: have you tried running HzMod on old3DS and loading a game without temporarily stopping the streaming? Yeah, I know it's a slight overexaggeration, but that's how it would affect the DS hardware. Yes, it would slow down the DS hardware due to the GPU stealing memory bandwidth.
 
Last edited by Sono,

PRAGMA

Well-Known Member
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,039
Country
Ireland
Funnily enough you can derive the aspect ratio from the DS' original resolution too, because it has the same aspect ratio :P Also, I said matrix hardware, not TwlBg. Of course the software has to care, because it's using OpenGL to draw the image. But since the matrix unit it just a very clever image stretcher, we can ignore the resolution entirely because the aspect ratio remains the same.

But yeah, I get your point.



Nope. Unless you are okay with partial stretch (instead of 400 wide, which is 25/12 stretching, you get 384, which is 24/12, which can be simplified to 8/4 for the matrix hardware). This is not something I control, this is hardware limitation, and it is NOT possible to get around this without extensive patching and great performance deficit.

Edit: have you tried running HzMod on old3DS and loading a game without temporarily stopping the streaming? Yeah, I know it's a slight overexaggeration, but that's how it would affect the DS hardware. Yes, it would slow down the DS hardware due to the GPU stealing memory bandwidth.
I see, that sucks, but 384x: would be cool too :D
 
  • Like
Reactions: RocketRobz and Sono

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,375
Country
Hungary
@Sono Please don't forget to update the first post when you release the patcher. I'm very excited to try this out!

I won't put the first few versions in the first post because due to my sleep deprevation I'm already DAYS late, so I'm trying to get the most shittiest but functional patcher out as soon as possible, and slowly add everything mentioned in this thread.
 

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,637
Trophies
3
Age
24
XP
21,093
Country
United States
Just took a top screenshot of the 3DS HOME Menu, and resized it to 384x240.
A little bit distorted, but not bad.

Original (400x240):
top_0000.png


Resized (384x240):
top_0000 (384x240).png
 
Last edited by RocketRobz,

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,375
Country
Hungary
  • Like
Reactions: RocketRobz

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,637
Trophies
3
Age
24
XP
21,093
Country
United States
But that's not fair because the source image is already matching the pixel ratio of the screen :P
Try upscaling the M64DS Yoshi image for comparison :tpi:
Done. :P

sm64ds yoshi in castle (top).png
sm64ds yoshi in castle (top, 3DS res).png

Original (256x192)<-->3DS resolution (320x240)

From a (16:9) widescreen patched version:

sm64ds yoshi in castle (top, squished wide).png
sm64ds yoshi in castle (top, 3DS res, wide).png

Original (256x192)<-->3DS resolution (sorta :P 426x240)

sm64ds yoshi in castle (top, 3DS res (384x240), wide).png

384x240 crop​
 
Last edited by RocketRobz,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=IkwLviMVR9E