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

  • Thread starter Sono
  • Start date
  • Views 749,637
  • 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 .

jetlego

Member
Newcomer
Joined
Sep 25, 2017
Messages
14
Trophies
0
XP
735
Country
United States
This is not a release build, don't use any patch other than rtcom.

Added experimental 4grid filters, I need some feedback.

It definitely needs tweaking, but I need to know how it looks to others as well, and if someone very well versed in emulator filters could chime in to help me tweak it so it doesn't look so off.
I tested this out just now on my New 3ds (non-xl) and I have a few observations. Firstly, in the "Bilinear+4grid" above, there appear to be exactly 4 pixels in each "box" of the grid, which is not the case in the experimental 4grid, which by my counting contains either 9 or 16 pixels (eyesight willing...).

Secondly, the experimental grid appears to use nearest neighbor below the grid, which on the darker grid settings has a probability to completely wipe out certain details that don't extend out from under the grid. This is most noticable on text in pixel art games, such as 7th dragon.

Finally, considering that we are scaling ds 1.25x, we would want 1/5 (20%) of the pixels on screen to be taken up by grid. We don't want any more than that, or we're throwing away good information. This amounts to about an 7x7 or 8x8 box size, but mocking this up in gimp... does not look good. I'm not sure if it is possible to make a grid look good.

Edit:
Maybe some sort of "stipple" pattern of black over every nearest neighbor interpolated pixel? I can't seem to guess the right pattern since I don't know exactly how the 3ds does nearest neighbor scaling, but I've attached an image that gets at what I'm thinking of.
 

Attachments

  • Untitled.png
    Untitled.png
    111.6 KB · Views: 28
  • Stipple test.png
    Stipple test.png
    77.8 KB · Views: 28
Last edited by jetlego,

selcuk

Well-Known Member
Newcomer
Joined
Oct 3, 2015
Messages
83
Trophies
0
Age
33
XP
257
Country
Try using the link above your post, that should contain it.

--------------------- MERGED ---------------------------



MTX supports only up to 512px wide output, so without a proper GPU scaling patch it won't be possible to utilize this feature :/
can 800px mode be implemented now that we have gpu scaling?
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
can 800px mode be implemented now that we have gpu scaling?

No. I would've already done it if it was possible.
In the sea of the pages in this thread, I did mention a few times that it's just an impossible task.

It *is* doable, just not in Nintendo's own code.
 
  • Like
Reactions: selcuk

Foxegory5

Member
Newcomer
Joined
Jan 31, 2022
Messages
6
Trophies
0
Age
24
XP
33
Country
United States
Hey, does TWPatcher's widescreen mode support ROM hacks of certain DS games, or am I only able to use the vanilla ROMs? Because I tried to use the widescreen patch on Pokémon Renegade Platinum but it didn't work, and I double-checked to make sure Platinum was supported (and it is). I regenerated the patch at least twice after that and got the same result each time.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
Hey, does TWPatcher's widescreen mode support ROM hacks of certain DS games, or am I only able to use the vanilla ROMs? Because I tried to use the widescreen patch on Pokémon Renegade Platinum but it didn't work, and I double-checked to make sure Platinum was supported (and it is). I regenerated the patch at least twice after that and got the same result each time.

The widescreen patch literally does nothing other than stretch the output of the DS(i)/GBA on the 3DS' display.

Games need to be patched to squish the graphics, and let them be widened again by the 3DS-side (this is called anamorphic widescreen), and it doesn't quite work in 2D games due to the limitations of the 2D engines.
In 3D games, usually only the aspect ratio value needs to be patched (afaik it's 0x5AAA or something like that), but some games need extra patches on top of that.
 

Foxegory5

Member
Newcomer
Joined
Jan 31, 2022
Messages
6
Trophies
0
Age
24
XP
33
Country
United States
The widescreen patch literally does nothing other than stretch the output of the DS(i)/GBA on the 3DS' display.

Games need to be patched to squish the graphics, and let them be widened again by the 3DS-side (this is called anamorphic widescreen), and it doesn't quite work in 2D games due to the limitations of the 2D engines.
In 3D games, usually only the aspect ratio value needs to be patched (afaik it's 0x5AAA or something like that), but some games need extra patches on top of that.
Then why is it compatible with the normal ROM but not the hack? Because I also have the unpatched ROM on my 3DS, and doing the exact same thing with my vanilla Platinum ROM works just fine. The ROM hack is the only one that is experiencing the issue, so while vanilla Pokémon Platinum is widescreen-ified just fine, the Renegade Platinum ROM hack, as you put it, "literally does nothing".
 

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,598
Trophies
3
Age
24
XP
21,000
Country
United States
Then why is it compatible with the normal ROM but not the hack? Because I also have the unpatched ROM on my 3DS, and doing the exact same thing with my vanilla Platinum ROM works just fine. The ROM hack is the only one that is experiencing the issue, so while vanilla Pokémon Platinum is widescreen-ified just fine, the Renegade Platinum ROM hack, as you put it, "literally does nothing".
The widescreen cheat codes are not implemented for ROM hacks, due to the possibility of value offsets differing from the original.
You could try adding support for the ROM hack by downloading the cheat from here, to "sd:/_nds/TWiLightMenu/extras/widescreen/", and renaming the .bin file to the ROM's full filename with only the addition of ".bin" at the end with no changes to the existing extension.
The first 4 letters represent the title ID, which can be found in TWLMenu++ by pressing the Y button for the selected ROM.
 

Foxegory5

Member
Newcomer
Joined
Jan 31, 2022
Messages
6
Trophies
0
Age
24
XP
33
Country
United States
The widescreen cheat codes are not implemented for ROM hacks, due to the possibility of value offsets differing from the original.
You could try adding support for the ROM hack by downloading the cheat from here, to "sd:/_nds/TWiLightMenu/extras/widescreen/", and renaming the .bin file to the ROM's full filename with only the addition of ".bin" at the end with no changes to the existing extension.
The first 4 letters represent the title ID, which can be found in TWLMenu++ by pressing the Y button for the selected ROM.
I was about to ask what the last four letters mean, but then I saw that you were referring to them as cheat codes - it's not cheats that I'm having problems with, it's the widescreen itself not appearing. Unless I need the BIN file to force-enable the widescreen, in which case there are three BIN files where the first four characters are exactly the same and I have no idea which one to use.

Edit: I tried to download all three BIN files, but it didn't work when I renamed any of them - though now that I think about it, was I supposed to rename them to the original name of the vanilla ROM or the name of the modified ROM I want to use the cheats for? Because I did the latter and none of the three seemed to work.

Edit 2: Turns out I was supposed to include the file extension as well, not just the name of the ROM. Thankfully I didn't delete the files, and now it works perfectly fine.
 
Last edited by Foxegory5,
  • Like
Reactions: RocketRobz

Nikitoz

New Member
Newbie
Joined
Jan 19, 2024
Messages
1
Trophies
0
Age
32
XP
15
Country
United States
Hello everyone,

I’m facing an ongoing issue with my Nintendo New 3DS XL related to the D-Pad. This problem started after I used TWPatch multiple times to apply a widescreen patch. The D-Pad began to move the cursor on its own, without any input from me.

In an attempt to resolve this, I’ve tried the following:

1. Repeatedly reapplying the patch in TWPatch, hoping the problem would disappear. I experimented with different settings within the patching process. Sometimes this didn’t help, and other times, the issue seemed to be fixed for about 10 minutes before returning again.
2. I’ve noticed that this issue only occurs in the standard console interface and while playing games. There are no problems with the D-Pad in the TWPatch menu itself or in any homebrew applications.

I’m curious if anyone else has faced similar issues after using TWPatch for widescreen modifications. This problem seems quite specific and I haven’t been able to find a permanent fix.
Is there perhaps an option to reset everything back to its original state before the widescreen patches were applied?
Any insights, advice, or suggestions from those who might have experienced something similar would be very helpful.

Thank you for any assistance you can provide!
 
Last edited by Nikitoz,

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
Hello everyone,

I’m facing an ongoing issue with my Nintendo New 3DS XL related to the D-Pad. This problem started after I used TWPatch multiple times to apply a widescreen patch. The D-Pad began to move the cursor on its own, without any input from me.

In an attempt to resolve this, I’ve tried the following:

1. Repeatedly reapplying the patch in TWPatch, hoping the problem would disappear. I experimented with different settings within the patching process. Sometimes this didn’t help, and other times, the issue seemed to be fixed for about 10 minutes before returning again.
2. I’ve noticed that this issue only occurs in the standard console interface and while playing games. There are no problems with the D-Pad in the TWPatch menu itself or in any homebrew applications.

I’m curious if anyone else has faced similar issues after using TWPatch for widescreen modifications. This problem seems quite specific and I haven’t been able to find a permanent fix.
Is there perhaps an option to reset everything back to its original state before the widescreen patches were applied?
Any insights, advice, or suggestions from those who might have experienced something similar would be very helpful.

Thank you for any assistance you can provide!

Just out of curiosity, try disabling all patches (try disabling the DPAD patch in particular) to see if it still happens.

Perhaps you could try deleting /luma/sysmodules/TwlBg.cxi in particular to see if this is even a TWPatch issue or not.
 

Gameboy Color

Well-Known Member
Newcomer
Joined
Dec 27, 2012
Messages
86
Trophies
1
Age
54
XP
361
Country
United States
Have you considered filters like xBRZ or a CRT scanline filter? I'd be willing to pay you decent sum of money for either of those.

Also maybe a 2x option that crops the sides but keeps pixel perfect?
 

ghjfdtg

Well-Known Member
Member
Joined
Jul 13, 2014
Messages
1,362
Trophies
1
XP
3,286
Country
xBRZ and CRT filtering requires fragment shaders the PICA200 doesn't have. The CPU is not fast enough to do this intense processing. An approximation maybe with a lot of hand written assembly or GPU dark magic.
 
  • Like
Reactions: Sono

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
Have you considered filters like xBRZ or a CRT scanline filter? I'd be willing to pay you decent sum of money for either of those.

Also maybe a 2x option that crops the sides but keeps pixel perfect?

Sadly no money can do the impossible on an unmodified thing.

There is not enough CPU power (just as a comparison, the DSi outputs a single pixel every 48x ARM11 cycles!), not enough RAM (FCRAM is mapped to DSi, or to the GBA cartridge adapter depending on the mode), and even if I had enough RAM, it would be awfully slow.

Combine that with Nintendo's bloated code, this is just actually impossible to do on Nintendo's own code. I'd have to actually fix LgyBg (my own reimpl of TwlBg and AgbBg) to even *attempt* this.

Actually, I'd have to fully rewrite LgyBg, as LgyKernel11 is limited only to a single ARM11 core :')

CRT scanline filter might be possible, but I don't know why it would make things look good for someone, so I can't attempt to make look good if I don't understand it.
If you can link to a website or code which you think looks good to you, I could do an attempt, but can't guarantee anything. No animations allowed (other than interlace emulation).

But the xBRZ thing is out of the question, even with a new3DS (except if I were to remake LgyBg from scratch, it *might* be possible, but it will introduce like 2frames of latency).

As for 2x upscaling, I don't think there is enough RAM for that. I have done it accidentally before, but it uh... didn't end well. 3/4 of the screen was corrupted, of which 2/4 were flickering in a migraine-inducing way. Oh, and wide Yoshi.

Edit: NEVERMIND THE SCANLINE FILTER! I don't think you want VERTICAL scanlines :rofl2:
 
Last edited by Sono,

GaricST

New Member
Newbie
Joined
Jan 6, 2024
Messages
3
Trophies
0
Age
33
XP
25
Country
United States
This is not a release build, don't use any patch other than rtcom.

Added experimental 4grid filters, I need some feedback.

It definitely needs tweaking, but I need to know how it looks to others as well, and if someone very well versed in emulator filters could chime in to help me tweak it so it doesn't look so off.
Can i in TWL Patch calibrate witch Redshift only TOP screen, not both?
 

GaricST

New Member
Newbie
Joined
Jan 6, 2024
Messages
3
Trophies
0
Age
33
XP
25
Country
United States
Sadly no, there is not enough memory to store curves for both screens.

What do you need it for? There might be a different way.
In 3Ds mode i use Luma filter and as a result have two identity color brigtness screen. In DS mode upper screen too much blueish for me. Distracts)
 
Last edited by GaricST,
  • Like
Reactions: Sono

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
In 3Ds mode i use Luma filter and as a result have two identity color brigtness screen. In DS mode upper screen too much blueish for me. Distracts)

Is it okay if I make it so that you can select which screen you want to apply the redshift to? So top/bottom/both?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BunnyPinkie @ BunnyPinkie: Yeah