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

  • Thread starter Thread starter Sono
  • Start date Start date
  • Views Views 983,742
  • Replies Replies 2,626
  • Likes Likes 107

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 .
Okay. First of all, we "break" the ds-gpu and force it to make an encoded image instead of rendering the image. And then the 3ds gpu decodes this image and renders it. And of course, we force the ds-cpu to process the image in a higher resolution. For example: ds-cpu tells ds-gpu to paint 20; 60 in blue, and instead gpu will paint 15; 10 in red. What will it mean for the arm11 gpu to "Paint blue at 20; 60" (this is in short). This is not the final option and we will need sono's help to do it. This will be a huge step forward in backward compatibility of ds on 3ds.

Yeah, that sadly doesn't work. The image generation system (2D, 3D, capture, etc.) in the DS is fixed-function, and there is no way to control the resolution, it's always fixed at 256x192. In fact, capture is even worse, since that reduces the bit depth from 6bit to 5bit, and it's still 256x192 :/

Edit: even if this was possible, you'd still have uneven scaling. Not only that, since games are not designed to use more of the screen, you'd have a bunch of garbage tiles outside of where the real DS screen ends.

As for intercepting "draw command" stuff, that's a MASSIVE patching project for each game, and is not possible with Nintendo's default code on the 3DS-side. Need tight integration between the DS and 3DS side.
This one *is* doable, but need lots of skilled people doing lots of hours patching every last instance of VRAM/IO/3D writes, and sending it to the ARM11. Very unlikely to happen, but the possibility is there.
 
  • Like
Reactions: RocketRobz
Yeah, that sadly doesn't work. The image generation system (2D, 3D, capture, etc.) in the DS is fixed-function, and there is no way to control the resolution, it's always fixed at 256x192. In fact, capture is even worse, since that reduces the bit depth from 6bit to 5bit, and it's still 256x192 :/

Edit: even if this was possible, you'd still have uneven scaling. Not only that, since games are not designed to use more of the screen, you'd have a bunch of garbage tiles outside of where the real DS screen ends.

As for intercepting "draw command" stuff, that's a MASSIVE patching project for each game, and is not possible with Nintendo's default code on the 3DS-side. Need tight integration between the DS and 3DS side.
This one *is* doable, but need lots of skilled people doing lots of hours patching every last instance of VRAM/IO/3D writes, and sending it to the ARM11. Very unlikely to happen, but the possibility is there.
Soooooo... can we just try and see what will happened? I sure it will be a useful experience. And even more so, it is impossible to move progress without experimentation
 
Last edited by V22,
Soooooo... can we just try and see what will happened? I sure it will be a useful experience. And even more so, it is impossible to move progress without experimentation

There is nothing to experiment in this case. There is no feature in the hardware, no debug ports, nothing. Like... you can't unlock a door with a key with no keyhole.
 
  • Like
Reactions: Raylight
Just curious, is there a possible way to add borders to play DS games in original resolution?
Post automatically merged:

Just curious, is there a possible way to add borders to play DS games in original resolution?
 
Just curious, is there a possible way to add borders to play DS games in original resolution?
Post automatically merged:

Just curious, is there a possible way to add borders to play DS games in original resolution?

Ignoring the fact that I don't have enough space to store an image, and can't load an image due to missing filesystem commands, I'm not sure how difficult that would be, but I assume extremely difficult, considering that I still couldn't get 800px mode working.

And yes, the same patches that are needed to get 800px mode working are needed to get a border to stay put.
 
  • Like
Reactions: tsw
So after years of not using my 3DS because it got broken, I might finally get it back to life soon enough and I have a lot to catch up to (I last used it in 2018). I found out about this project and it sounds awesome, but filtering out information from 120+ pages is... yeah lol.

Pardon me for asking but how would this process look like? My goal is to have an image that's basically the same as the default non 1:1 mode but have slight blurring (linear interpolation basically, like the sharp-bilinear shader from some emulators), other than that I'm not interested in other tweaks. Thanks in advance for reading!
 
So after years of not using my 3DS because it got broken, I might finally get it back to life soon enough and I have a lot to catch up to (I last used it in 2018). I found out about this project and it sounds awesome, but filtering out information from 120+ pages is... yeah lol.

Pardon me for asking but how would this process look like? My goal is to have an image that's basically the same as the default non 1:1 mode but have slight blurring (linear interpolation basically, like the sharp-bilinear shader from some emulators), other than that I'm not interested in other tweaks. Thanks in advance for reading!

I just checked, the image in the first post showing off the scale filters still works. Look at the textbox instead of the 3D, although there are test images in TWPatch itself for preview.

I have disabled almost all patches due to popular demand, so you'll only have to disable the last few that remain. If you do disable those, you'll gain back sleep functionality.

Patching is easy, you just select the scale filter with the DPAD, hold and release X to preview between the selected and Nintendo filter, and hold START to patch.
To disable default patches, press Y+B, enable the option to disable default patches, and uncheck everything else, then press B to go back.

Patching takes a few minutes to do, so only press START once you're really ready.

To remove the patches, just remove /luma/sysmodules/TwlBg.cxi (and /luma/sysmodules/AgbBg.cxi if you also patched GBA mode).
 
I'll keep all of this in mind, I don't have the console fixed yet and since this came out after my 3DS broke I don't have any previous versions to remove or leftovers to remove, it will be completely fresh. Thanks for the advice, really appreciate it. I have a lot to catch up with (I originally used Sudokuhax via system transfer to hack the console, that's how far back it goes)
 
  • Like
Reactions: Sono
Could the color temperature be changed individually for each screen, like Luma's screen filters in 3DS mode? Is it possible?

I know it's an unusual request, but would it also be possible to stretch only one screen, while keeping the other 1:1?

I apppreciate the work put into this.
 
Questions and observations

1.) when I use the GPU scaling option it ruins any game I play in pixel perfect mode. Is this just an unavoidable consequence or am I doing something wrong

2.) I’m sure this has been asked (and maybe even by me) but gpu scaling CAN’T be sharpened, correct?
 
Could someone with a New 3DS XL chime in and say which filter looks the best to them after the latest TWL Patch update? I'm really having trouble telling which is better and I just want the best DS experience possible. Sorry for redundant question; thanks in advance.
 
Could someone with a New 3DS XL chime in and say which filter looks the best to them after the latest TWL Patch update? I'm really having trouble telling which is better and I just want the best DS experience possible. Sorry for redundant question; thanks in advance.
The Default one looks best other wise you get shifting pixels that dont look good on text.
 
Could the color temperature be changed individually for each screen, like Luma's screen filters in 3DS mode? Is it possible?

I know it's an unusual request, but would it also be possible to stretch only one screen, while keeping the other 1:1?

I apppreciate the work put into this.

Edit: can't change it like in Luma, that will never be possible in Nintendo's code. I meant adding split top/bottom filter to Redshift patch.

It's in the works.

Well, more precisely, it IS working (split top/bottom filters), but I sometimes keep getting crashes, and I'm not releasing that feature until I hunt down why I get these crashes.

Questions and observations

1.) when I use the GPU scaling option it ruins any game I play in pixel perfect mode. Is this just an unavoidable consequence or am I doing something wrong

2.) I’m sure this has been asked (and maybe even by me) but gpu scaling CAN’T be sharpened, correct?

1) It's how GPU scaling works.
Nintendo did intend to add GPU scaling themselves, but they never finished it, so there is no existing code to patch, and so the only way I could hack it back is to sacrifice 1:1 functionality.
I could technically make it not do this, but it's unviable to patch hundreds of constants scattered around, encoded into both constant pools (numbers as bytes) and instructions (numbers completely mangled into the instruction encoding itself), just for this minor error.
I'm sorry, it's too much work for too little gain. It's effort better spent on the reimplementation, which I'm still not ready to release an alpha test for, as touch still doesn't work for unknown reasons.

2) Yup, can't be sharpened. It's upscaled from the 1:1 image (which is why 1:1 mode doesn't work, as a resolution mismatch happens in Nintendo's overcomplicated graphics stack, which causes garbled interpretation of certain framebuffers), and the GPU can only do buggy point sampling, or multisampled linear.
As the GPU can only touch the image after the capture card, and only the capture card can do sharpening (in hardware), only the 2nd CPU could do that pegged to 100%, but that has its own challenges...
So, no sharpening... not yet, at least.

Could someone with a New 3DS XL chime in and say which filter looks the best to them after the latest TWL Patch update? I'm really having trouble telling which is better and I just want the best DS experience possible. Sorry for redundant question; thanks in advance.

You can test with X. Navigate to a filter, and hold X to preview Nintendo's default filter, and release to see the filter you have navigated to. X+DPAD to switch the preview image.

If you already have a filter you use, use that. Last time I changed filter data (without changing its name) was before I even moved TWPatch to its current TitleID (which was 4+yrs ago), so you don't have to worry about updates changing existing filters.

But yeah, the tweaked crisp is probably the best bet for most games (even though it's horrible in terms of consistency, just look at the settings icon in SM64DS main menu), and if even that is bad, just use the default Nintendo one, or use the very first "linear sharpen" option (verify by the SM64DS wrench icon for consistency, only the very first "linear sharpen" is consistent, the others will have jagged edges).
 
That's awesome to hear that the redshift split is in the works and functional! Do you happen upon crashes more with top only or bottom only, or a general mix of the two?
I'd sure love to test the top-only feature, mostly due to my 3DS needing it for the top screen in 3DS mode due to a discolored screen. Either way, can't wait for the release!
 
Theory question, if I DON’T care about widescreen at all could I take a DIFFERENT TwlBg.cxi and rename THAT one to widescreen.cxi and have it work with those settings instead. For example, if I want some games to run with the cpu scaling could I just pretend THAT setting is the widescreen one?
 
Theory question, if I DON’T care about widescreen at all could I take a DIFFERENT TwlBg.cxi and rename THAT one to widescreen.cxi and have it work with those settings instead. For example, if I want some games to run with the cpu scaling could I just pretend THAT setting is the widescreen one?
Using widescreen mode with a non-widescreen .cxi file will result in the widescreen image being squished to 4:3 and not the original 4:3 image being shown.
 
  • Like
Reactions: LexDG
Hi, would it be possible to use TwPatch interpolation filters (such as Sono sharp and the other ones) with open agb firm?
 

Site & Scene News

Popular threads in this forum