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

  • Thread starter Sono
  • Start date
  • Views 753,176
  • Replies 2,428
  • Likes 101

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 .

Raylight

Paranoid Temper
Member
Joined
May 10, 2014
Messages
1,178
Trophies
0
Age
34
Location
Who wants to know?
Website
sites.google.com
XP
2,843
Country
United States
Technically DS can also benefit from it if you're playing in widescreen. Similar to the GBA, you can do a non-matching 3x by 1.25y scale.

Horizontal: 3*256 = 768
Vertical: 1.25*192 = 240

768*240 is, remembering that the pixels are half as wide as normal square pixels, a 16:10 aspect ratio, identical to how DS widescreen support operates on 3DS currently. This means, at least for games with widescreen support, you'd be able to get a clean triple-resolution scale on the horizontal axis, which should look a lot crisper. On the vertical, you are still stuck with the awkward 1.25 times scale.

If you don't mind that it's an awful idea, you could do a 3x by 1y scale, 768*192, for a 2:1 aspect ratio image with black borders on all sides.
I dont really use the widescreen much i still use the sharp filter since its the closest i can get to being as sharp as it is on DSI XL
 

MarioKartFan

Well-Known Member
Member
Joined
Aug 27, 2019
Messages
596
Trophies
0
XP
2,319
Country
Algeria
@Sono Do you think 800px mode will be successfully implemented or is it just not possible to get it working correctly? I’ve seen your comments on glitches etc. but cannot tell whether the obstacles are fatal or not. Thanks.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,344
Country
Hungary
@Sono Do you think 800px mode will be successfully implemented or is it just not possible to get it working correctly? I’ve seen your comments on glitches etc. but cannot tell whether the obstacles are fatal or not. Thanks.

tl;dr: Yesn't

Longer response: It's already implemented, but half the screen is cut off. I once managed to enable 800px mode with the screen EXTREMELY stretched, but that was my best result, and I haven't been able to reproduce it since. Considering that I have fixed some bugs, it was probably a false result, and I was just stretching an already filtered image.

The video is still coming.
 

KaduPSE

Revolution and cake
Member
Joined
Dec 26, 2015
Messages
260
Trophies
0
XP
408
Country
Brazil
For GBA, kinda yes. Sadly this is only true for GBA width, not GBA height, but instead of 1.5 x 1.5 upscaling, with mode 800 it's possible to get 3 x 1.5 upscaling, which still looks much better than without the patch.
If I´m not mistaken, enabling this mode but doing no scaling at all (pixel perfect) should make every individual pixel building the image look smaller too, right? Instead of the duplicated squares.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,344
Country
Hungary
If I´m not mistaken, enabling this mode but doing no scaling at all (pixel perfect) should make every individual pixel building the image look smaller too, right? Instead of the duplicated squares.

Enabling mode800 actually just disables line doubling, so we can use the 2x1 rectangle pixels turned into a square again as a rectangle. So disabling line doubling while being unscaled would squish the hell out of the image. So mode800 is only useful if you're doing 3 x 1.5 scalng of GBA.
 
  • Like
Reactions: RocketRobz

Rahkeesh

Well-Known Member
Member
Joined
Apr 3, 2018
Messages
2,178
Trophies
1
Age
42
XP
3,261
Country
United States
Wait, does this mean you got something useful out of 800 px GBA mode that wasn't all the garbling you are seeing on the DS side?

I guess a use for 800px in "non-scaled" mode is if you blanked every other pixel as you went across horizontally instead of duplicating, that would bring back more of a true "grid" handheld feel that would line up with the original pixels.
 
  • Like
Reactions: RocketRobz

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,623
Trophies
3
Age
24
XP
21,040
Country
United States
Wait, does this mean you got something useful out of 800 px GBA mode that wasn't all the garbling you are seeing on the DS side?

I guess a use for 800px in "non-scaled" mode is if you blanked every other pixel as you went across horizontally instead of duplicating, that would bring back more of a true "grid" handheld feel that would line up with the original pixels.
Indeed. On my side, I just make the other pixels half-black to simulate the in-between dark vertical lines of the top screen. :P
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,344
Country
Hungary
Wait, does this mean you got something useful out of 800 px GBA mode that wasn't all the garbling you are seeing on the DS side?

I guess a use for 800px in "non-scaled" mode is if you blanked every other pixel as you went across horizontally instead of duplicating, that would bring back more of a true "grid" handheld feel that would line up with the original pixels.

I have absolutely no idea what you mean.
 

Rahkeesh

Well-Known Member
Member
Joined
Apr 3, 2018
Messages
2,178
Trophies
1
Age
42
XP
3,261
Country
United States
Both Retroarch and Bubble2006k's emulators let you turn on the parallax barrier with the 3D slider for a similar effect in 3D. (Same image is sent to both eyes, but the barrier is on regardless, meaning each side is only half the pixels.) This would just be kind of emulating that in 2D. Or like Rob is doing, just do the effect half-way by dimming them.
 
  • Like
Reactions: RocketRobz

KaduPSE

Revolution and cake
Member
Joined
Dec 26, 2015
Messages
260
Trophies
0
XP
408
Country
Brazil
Both Retroarch and Bubble2006k's emulators let you turn on the parallax barrier with the 3D slider for a similar effect in 3D. (Same image is sent to both eyes, but the barrier is on regardless, meaning each side is only half the pixels.) This would just be kind of emulating that in 2D. Or like Rob is doing, just do the effect half-way by dimming them.
Yep, the end goal is just somehow improving a little bit the weird pixel shape and matrix used by the 3DS, as it doesn´t go so well with traditional sprite-based games.
 
  • Like
Reactions: RocketRobz

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,344
Country
Hungary
Wait, does this mean you got something useful out of 800 px GBA mode that wasn't all the garbling you are seeing on the DS side?

I guess a use for 800px in "non-scaled" mode is if you blanked every other pixel as you went across horizontally instead of duplicating, that would bring back more of a true "grid" handheld feel that would line up with the original pixels.
he means having blank spaces between each pixel making it look like bad scanlines

If this is what you meant then I don't know of a way to do this

Both Retroarch and Bubble2006k's emulators let you turn on the parallax barrier with the 3D slider for a similar effect in 3D. (Same image is sent to both eyes, but the barrier is on regardless, meaning each side is only half the pixels.) This would just be kind of emulating that in 2D. Or like Rob is doing, just do the effect half-way by dimming them.

Actually, "3D" mode is just interlacing without line doubling. So if I would point the display controller to a blank area then I could interlace 400px texture with 400px of black.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,344
Country
Hungary
Remember the time when I reinstalled exception handling using rtcom?
Now I have finally added kernel patching to TWPatcher!

What does this mean for almost everyone?
Probably nothing... yet

What does this mean for me, other devs, and researchers?
A whole lot of new unlocked possibilities, since we can patch every single bit of code*, including Process9.
* Sadly TwlBg still takes millions of years to compress as it's a requirement for multiple reasons, mostly artificial limitations which are hard to patch.

Why not just reimplement TWL_FIRM?
Actually, it might be possible to reuse some existing code and reimplement the rest. In fact, it might be better in the long run, considering how bloated and limited TWL_FIRM is. Now that we can patch the kernel for our needs, I'd say this is a setup where it should be easy to remake TwlBg without having to struggle with baremetal things. Nintendo already made the baremetal stuff for us, it's better to reuse it and patch in additional features when we need them.

A new patcher version won't come until I fix the lag caused by the MTX emulator. The new patcher will include a kernel patcher, and will probably soon default to the kernel patcher instead of the TwlBg patcher.
 
Last edited by Sono, , Reason: actually fix typo

DSoryu

GBA/NDS Maniac
Member
Joined
May 5, 2010
Messages
2,370
Trophies
2
Location
In my house
XP
4,805
Country
Mexico
Remember the time when I reinstalled exception handling using rtcom?
Now I have finally added kernel patching to TWPatcher!

What does this mean for almost everyone?
Probably nothing... yet

What does this mean for me, other devs, and researchers?
A whole lot of new unlocked possibilities, since we can patch every single bit of code*, including Process9.
* Sadly TwlBg still takes millions of years to compress as it's a requirement for multiple reasons, mostly artificial limitations which are hard to patch.

Why not just reimplement TWL_FIRM?
Actually, it might be possible to reuse some existing code and reimplement the rest. In fact, it might be better in the long run, considering how bloated and limited TWL_FIRM is. Now that we can patch the kernel for our needs, I'd say this is a setup where it should be easy to remake TwlBg without having to struggle with baremetal things. Nintendo already made the baremetal stuff for us, it's better to reuse it and patch in additional features when we need them.

A new patcher version won't come until I fix the lag caused by the MTX emulator. The new patcher will include a kernel patcher, and will probably soon default to the kernel patcher instead of the TwlBg patcher.

Ok, gonna ask the experts on this matter since I'm only guessing. @Robz8 could this increase the funtionallity and fix the long-standing compatibility issues that are still present in nds-bootstrap?
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,344
Country
Hungary
Ok, gonna ask the experts on this matter since I'm only guessing. @Robz8 could this increase the funtionallity and fix the long-standing compatibility issues that are still present in nds-bootstrap?

I don't know what you're thinking of, but most likely I can already tell: no.

This only patches 3DS-side stuff.
You can't patch anything DS-side or GBA-side, because TWL mode is a real DSi with some emulation layers around it (most notably Powerman and SIO RTC), and GBA mode is an afterthought where FCRAM is repurposed as cartridge ROM via a built-in cartridge adapter.
What doesn't work properly on the 3DS in legacy mode will not work properly after any patching of the 3DS-side.
The only exception to the above statement is if we patch 3DS-side in a way where the DSi-side code can make use of the patches. Sadly currently the only known way to achieve this is via rtcom, which abuses the emulation layer (in this case the dummy SIO RTC) to allow the two "worlds" to communicate with eachother at an extremely low bandwidth.
 

MrLuigix64

Well-Known Member
Newcomer
Joined
Mar 4, 2013
Messages
72
Trophies
0
Age
30
Location
In your heart
XP
378
Country
Mexico
Excuse me, I cant figure out how to enable the widescreen, I use the patcher, pres X+Start to get the .cxi, but still not working, do I have to select a Specific filter?, in the TWLight Menu guide it saids to HOLD Y, then B, but nothing happens.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,825
Trophies
2
Location
home
XP
9,344
Country
Hungary
Excuse me, I cant figure out how to enable the widescreen, I use the patcher, pres X+Start to get the .cxi, but still not working, do I have to select a Specific filter?, in the TWLight Menu guide it saids to HOLD Y, then B, but nothing happens.

I still haven't updated the link in the first post. Go back a few pages and search for the puu.sh download link.
 
  • Like
Reactions: MrLuigix64

MrLuigix64

Well-Known Member
Newcomer
Joined
Mar 4, 2013
Messages
72
Trophies
0
Age
30
Location
In your heart
XP
378
Country
Mexico
I still haven't updated the link in the first post. Go back a few pages and search for the puu.sh download link.
Ok, found the TWPatch, and got the .cxi, copied to the TwlBg, renamed, and reLaunched, just START. And got a red screen on the bottom, with lots of codes, Guru Exception. Its an O3DS, Launched Mario Kart via ndsbootstrap. Tried 2 more games, and always says "Failed to backup TwlBg"
 

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,623
Trophies
3
Age
24
XP
21,040
Country
United States
Ok, found the TWPatch, and got the .cxi, copied to the TwlBg, renamed, and reLaunched, just START. And got a red screen on the bottom, with lots of codes, Guru Exception. Its an O3DS, Launched Mario Kart via ndsbootstrap. Tried 2 more games, and always says "Failed to backup TwlBg"
Make sure "Slot-1 microSD access" is turned off in TWLMenu++ Settings.
If that doesn't fix the Guru error, idk what'll fix it.
 
Last edited by RocketRobz,
  • Like
Reactions: MrLuigix64

MrLuigix64

Well-Known Member
Newcomer
Joined
Mar 4, 2013
Messages
72
Trophies
0
Age
30
Location
In your heart
XP
378
Country
Mexico
Make sure "Slot-1 microSD access" is turned off in TWLMenu++ Settings.
If that doesn't fix the Guru error, idk what'll fix it.

Thanks, it worker...
Well, the Error Message no longer appears, deleted the widescreen and twlbg.cxi, and started the process again.
HOLD Y then B, select GPU Scale test (2 other options are already selected rtcom - anti-wear), then B.
X+Start, moved the .cxi and rename it
relaunched TWPatcher, just start on Linear Sharpening
And no widescreen, but a glitched image with I think the last 10px of the bottom of the image duplicated. Still 4:3 Aspect ratio, with extended bottom.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://a.co/d/8tRQnqT