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

  • Thread starter Sono
  • Start date
  • Views 767,462
  • Replies 2,436
  • 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 .

placebo_yue

Well-Known Member
Member
Joined
Aug 7, 2019
Messages
739
Trophies
0
Age
33
XP
1,264
Country
Argentina
This is a pretty shallow request, but could you on the next iteration create a cleaner installation screen, like a green bar going from 0 to 100% or something? the debug messages that look like they could go on forever freak me out a little. Even if i know it works allright because i've been using it for a while.
Anyways, i'm waiting to test GPU+widescreen and see the difference! Thanks for the update

edit: Widescreen+linear interpolation1 looks great!
 
Last edited by placebo_yue,

PrincessLillie

(Future) VTuber
Member
Joined
Nov 28, 2013
Messages
2,922
Trophies
3
Age
21
Location
Virtual Earth
Website
lillie2523.carrd.co
XP
4,840
Country
United States
Sorry for the long wait, but I have my "hands tied", so I couldn't work on anything personal.

Because mode800 requires additional work, I have removed it from the code, and I have to start again. Because of this, GPU + widescreen finally work together again!
And to add to the surprise of this build, I included a HUGE performance boost for the UI, so it's WAAAAAY snappier, even on old3DS :D

This is also FINALLY a stable build, so no more screwing around with unstable junk :P

Updated link is in the first post :)





It's actually really difficult in legacy mode, because brightness adjustment works much different from 3DS mode. Sorry.
Since I know people are gonna ask about it, QR Code:
upload_2020-12-26_17-0-44.png

Thanks for the surprise update, Sono!
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,832
Trophies
2
Location
home
XP
9,447
Country
Hungary
This is a pretty shallow request, but could you on the next iteration create a cleaner installation screen, like a green bar going from 0 to 100% or something? the debug messages that look like they could go on forever freak me out a little. Even if i know it works allright because i've been using it for a while.
Anyways, i'm waiting to test GPU+widescreen and see the difference! Thanks for the update

edit: Widescreen+linear interpolation1 looks great!

Is the current visual too scary? It's so janky because it has to complete itself during your lifetime on an old3DS, and a reasonable time on new3DS.
 

placebo_yue

Well-Known Member
Member
Joined
Aug 7, 2019
Messages
739
Trophies
0
Age
33
XP
1,264
Country
Argentina
Is the current visual too scary?
The general UI with the preview images and such is fine! a bit more information on the extra options (like the one that turns your screen warmer and such) wouldn't hurt. I didn't quite get what some of those do.

What is a bit "scary" is the console/debug like messages that show up when you start the installation, compiling, compressing or whatever. At least for someone like me who barely knows how to code in java and C#, and uses the windows console only to check "ipconfig" you know?

Just cosmetic changes that would make the app look more polished and user friendly. I'd understand if that's not your priority, and to be honest if it takes too much time it'd be better spent on something else.

Anyways, again thanks for your work, i'm really digging the new look
 
  • Like
Reactions: Sono

wanderindirk

Active Member
Newcomer
Joined
Aug 29, 2014
Messages
43
Trophies
0
Age
31
XP
173
Country
Vietnam
Just feel like popping in and say the stable build’s working great! I’ve finally figured out the way to fully manipulate the different scalings for different kinds of games (widescreen-compatible or 4:3, 2D or 3D) by altering the combination of the two .cxi files put in TwilightMenu’s “Twlbg” and Luma’s “sysmodule” folder. Personally I use gpu scaling for widescreen games, linear sharpen 1 for 2D games, and a mix of linear sharpen 1 and sharpen test 1 for 3D 4:3 games.

Now a question: I haven’t updated TwilightMenu for quite a while now, I’m still on a certain pre-Labor Day version because since the Labor Day version the widescreen feature has been kinda broken (stretched 4:3 all over the place, whereas I prefer that the app goes widescreen only when booting widescreen-compatible games and automatically goes back to 4:3 when in menu or in 4:3 only games). So now I’m curious about whether updating TwilightMenu now is safe since we already have a stable TWPatcher.
 
  • Like
Reactions: RetroGen

AkiFire

New Member
Newbie
Joined
Jul 11, 2020
Messages
4
Trophies
0
Age
22
XP
80
Country
Germany
Hey, I want to use TWPatcher on my N2DSXL but have some questions: This is an app that only modifies things for TWiLight Menu which means that these scaling methods are not used for example for GBA VC injection or emulators on a 3DS (meaning, some other app). They will only work inside TwiLight Menu, correct?
And my second question, how would I be able to uninstall this? Shouldn't I first make a backup (of some file) before proceeding to patch with this app? If my assumption for my first question is correct, I should be able to do a clean reinstall of TWiLight Menu and be safe if something goes wrong, right?
Thanks in Advance!
 

ccfman2004

Well-Known Member
Member
Joined
Mar 5, 2008
Messages
2,861
Trophies
2
XP
3,290
Country
United States
Hey, I want to use TWPatcher on my N2DSXL but have some questions: This is an app that only modifies things for TWiLight Menu which means that these scaling methods are not used for example for GBA VC injection or emulators on a 3DS (meaning, some other app). They will only work inside TwiLight Menu, correct?
And my second question, how would I be able to uninstall this? Shouldn't I first make a backup (of some file) before proceeding to patch with this app? If my assumption for my first question is correct, I should be able to do a clean reinstall of TWiLight Menu and be safe if something goes wrong, right?
Thanks in Advance!
The patch file should affect any thing run in DS Mode.

To remove patch, delete the patch file or turn off use external FIRM patch in Luma3DS settings. All modifications are done in RAM only and do not actually modify any files on the 3DS or the SD card.
 
Last edited by ccfman2004,
  • Like
Reactions: fmkid

gaga941021

Well-Known Member
Member
Joined
Apr 16, 2016
Messages
646
Trophies
0
Age
29
XP
2,445
Country
Hungary
The patch file should affect any thing run in DS Mode.

To remove patch, delete the patch file or turn off use external FIRM patch in Luma3DS settings. All modifications are done in RAM only and do not actually modify any files on the 3DS or the SD card.

Do I have to start the patcher every time I turn off the console?
 
D

Deleted User

Guest
Do I have to start the patcher every time I turn off the console?

I'm not sure what you mean by turning off the console, but if you're asking whether you need to start the patcher every time to get widescreen, then the answer is that you need to only run it once for it to create the Patch file.

If you haven't changed the Luma settings from using external FIRM Patches, then you don't need to do anything more for it to always start.
 

gaga941021

Well-Known Member
Member
Joined
Apr 16, 2016
Messages
646
Trophies
0
Age
29
XP
2,445
Country
Hungary
I'm not sure what you mean by turning off the console, but if you're asking whether you need to start the patcher every time to get widescreen, then the answer is that you need to only run it once for it to create the Patch file.

If you haven't changed the Luma settings from using external FIRM Patches, then you don't need to do anything more for it to always start.
Cool, thanks!
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,832
Trophies
2
Location
home
XP
9,447
Country
Hungary
Sorry for the late response, I got hit by the forum software notification bug again...

Just feel like popping in and say the stable build’s working great! I’ve finally figured out the way to fully manipulate the different scalings for different kinds of games (widescreen-compatible or 4:3, 2D or 3D) by altering the combination of the two .cxi files put in TwilightMenu’s “Twlbg” and Luma’s “sysmodule” folder. Personally I use gpu scaling for widescreen games, linear sharpen 1 for 2D games, and a mix of linear sharpen 1 and sharpen test 1 for 3D 4:3 games.

Now a question: I haven’t updated TwilightMenu for quite a while now, I’m still on a certain pre-Labor Day version because since the Labor Day version the widescreen feature has been kinda broken (stretched 4:3 all over the place, whereas I prefer that the app goes widescreen only when booting widescreen-compatible games and automatically goes back to 4:3 when in menu or in 4:3 only games). So now I’m curious about whether updating TwilightMenu now is safe since we already have a stable TWPatcher.

To my knowledge the automatic widescreen feature was removed due to how broken it was.
You need to manually manage TwlBg.cxi yourself. But other than that, the top screen UI should correct itself if TwlBg.cxi is detected, so it's not stretched 4:3.

Hey, I want to use TWPatcher on my N2DSXL but have some questions: This is an app that only modifies things for TWiLight Menu which means that these scaling methods are not used for example for GBA VC injection or emulators on a 3DS (meaning, some other app). They will only work inside TwiLight Menu, correct?
And my second question, how would I be able to uninstall this? Shouldn't I first make a backup (of some file) before proceeding to patch with this app? If my assumption for my first question is correct, I should be able to do a clean reinstall of TWiLight Menu and be safe if something goes wrong, right?
Thanks in Advance!

TWPatch doesn't touch TWiLightMenu++, it only modifies the copy of the DS and/or GBA-mode firmware.

TWPatcher only touches 4 files:
- /luma/sysmodules/TwlBg.cxi
- /luma/sysmodules/AgbBg.cxi
- /luma/twl.firm
- /luma/agb.firm

If you want to delete TWPatcher's modifications, just delete and/or restore these files as they were on your SDCard.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,832
Trophies
2
Location
home
XP
9,447
Country
Hungary
Okay so... I've been experimenting with both GBA and DS mode lately, and while making my own capture card driver, I found some bugs in the capture card hardware itself.

Remember how some people (post and post) have complained of repeating blocks appearing on the bottom of the screen?
Well, it turns out it's a hardware quirk of the capture card hardware, and nearly impossible to detect from software :P

Edit: forgot to tell, but the reason closing and reopening the lid fixes the issue is because that does a FULL reset on the capture card state, effectively re-aligning the hardware with eachother.

If the capture card and the DS/GBA hardware misalign, it glitches out the capture card, and the capture card tells the driver that it has glitched out. But due to a bug in the capture card, it always cries that it has glitched out, so I have to ignore this cry.

Because I'm ignoring this cry, the capture card makes a fuss about it, and stops working properly, repeatedly duplicating the last 8px lines over and over again.

So the reason it duplicates the last 8px eventually is due to getting JUST enough lag to make the capture card misalign with the DS.
When the DS keeps repeatedly switching video modes, it also causes some lag, which also glitches out the capture card.

As for the 32k sector size SD theory, it could very well be that the different load times cause the ARM9 and ARM11 misalign so slightly just enough to eventually lead to this issue more frequently.

Truly fascinating what hardware can do...
If something happens to the capture card during pixel FIFO DMA transfer, I get a "FIFO overflow" error. But due to a bug in the capture card hardware, this error keeps getting set, so I had to ignore it.

Due to ignoring this, I can't detect anymore if the pixels I'm getting are the proper image, or duplicated garbage.

Trying Nintendo's code, it also handles this incorrectly, and doesn't accomodate properly for timing changes.

There is also a bug in the MTX hardware where the IRQ gets fired before the actual reason flags are not fully set in the interrupt flags register. Re-reading with some delay fixed some of the problems related to receiving junk interrupts, hence my driver is now better than Nintendo's, and my code actually fixes itself overtime.

I have no new TWPatch version to show; just finally giving an explaination many years later...
 
Last edited by Sono,

saeros

Member
Newcomer
Joined
Jan 3, 2021
Messages
8
Trophies
0
Age
28
XP
65
Country
Argentina
To install the update do i need to delete the twl that i have, and then install the update? Or i just need to download and install the update? What are the changes? I install it a month ago but i have curiosity about the “stable" part of the new version of the patch. Thanks and sorry if my english is hard to umderstand.

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

To install the update do i need to delete the twl that i have and then install the update? Or i just need to download and install the update? What are the changes? I installed it a month ago but i have curiosity about the “stable" part of the new version of the patch. Thanks and sorry if my english is hard to understand

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

sorry, I copied the post before creating the account to avoid having to write everything again (I'm from my phone) and I didn't realize that I pasted the post twice.
 

ccfman2004

Well-Known Member
Member
Joined
Mar 5, 2008
Messages
2,861
Trophies
2
XP
3,290
Country
United States
To install the update do i need to delete the twl that i have, and then install the update? Or i just need to download and install the update? What are the changes? I install it a month ago but i have curiosity about the “stable" part of the new version of the patch. Thanks and sorry if my english is hard to umderstand.

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

To install the update do i need to delete the twl that i have and then install the update? Or i just need to download and install the update? What are the changes? I installed it a month ago but i have curiosity about the “stable" part of the new version of the patch. Thanks and sorry if my english is hard to understand

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

sorry, I copied the post before creating the account to avoid having to write everything again (I'm from my phone) and I didn't realize that I pasted the post twice.
Delete the patch file in the Luma folder. Install the new CIA. Then run the new patch app and copy the new patch file to the proper folder.
 
  • Like
Reactions: saeros

PrincessLillie

(Future) VTuber
Member
Joined
Nov 28, 2013
Messages
2,922
Trophies
3
Age
21
Location
Virtual Earth
Website
lillie2523.carrd.co
XP
4,840
Country
United States
Okay so... I've been experimenting with both GBA and DS mode lately, and while making my own capture card driver, I found some bugs in the capture card hardware itself.

Remember how some people (post and post) have complained of repeating blocks appearing on the bottom of the screen?
Well, it turns out it's a hardware quirk of the capture card hardware, and nearly impossible to detect from software :P

Edit: forgot to tell, but the reason closing and reopening the lid fixes the issue is because that does a FULL reset on the capture card state, effectively re-aligning the hardware with eachother.

If the capture card and the DS/GBA hardware misalign, it glitches out the capture card, and the capture card tells the driver that it has glitched out. But due to a bug in the capture card, it always cries that it has glitched out, so I have to ignore this cry.

Because I'm ignoring this cry, the capture card makes a fuss about it, and stops working properly, repeatedly duplicating the last 8px lines over and over again.

So the reason it duplicates the last 8px eventually is due to getting JUST enough lag to make the capture card misalign with the DS.
When the DS keeps repeatedly switching video modes, it also causes some lag, which also glitches out the capture card.

As for the 32k sector size SD theory, it could very well be that the different load times cause the ARM9 and ARM11 misalign so slightly just enough to eventually lead to this issue more frequently.

Truly fascinating what hardware can do...
If something happens to the capture card during pixel FIFO DMA transfer, I get a "FIFO overflow" error. But due to a bug in the capture card hardware, this error keeps getting set, so I had to ignore it.

Due to ignoring this, I can't detect anymore if the pixels I'm getting are the proper image, or duplicated garbage.

Trying Nintendo's code, it also handles this incorrectly, and doesn't accomodate properly for timing changes.

There is also a bug in the MTX hardware where the IRQ gets fired before the actual reason flags are not fully set in the interrupt flags register. Re-reading with some delay fixed some of the problems related to receiving junk interrupts, hence my driver is now better than Nintendo's, and my code actually fixes itself overtime.

I have no new TWPatch version to show; just finally giving an explaination many years later...
My thought is, why would this capture card issue affect someone if they don't use a capture card in the first place? I've had this same repeating blocks issue before in TWLMenu, and I'm pretty sure my New3DSXL doesn't have a capture card in it.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,832
Trophies
2
Location
home
XP
9,447
Country
Hungary
To install the update do i need to delete the twl that i have and then install the update? Or i just need to download and install the update? What are the changes? I installed it a month ago but i have curiosity about the “stable" part of the new version of the patch. Thanks and sorry if my english is hard to understand
Delete the patch file in the Luma folder. Install the new CIA. Then run the new patch app and copy the new patch file to the proper folder.

You can actually just install the cia, it'll overwrite the old one. As for the patched files, TWPatcher overwrites the files (without asking), so no need to delete if you're not "uninstalling" the patches.

My thought is, why would this capture card issue affect someone if they don't use a capture card in the first place? I've had this same repeating blocks issue before in TWLMenu, and I'm pretty sure my New3DSXL doesn't have a capture card in it.

I meant the capture card INSIDE the SoC. The thing I call MTX, which is used to "record" (and upscale) the DS/GBA screen to be displayed on 3DS LCD.
 

PrincessLillie

(Future) VTuber
Member
Joined
Nov 28, 2013
Messages
2,922
Trophies
3
Age
21
Location
Virtual Earth
Website
lillie2523.carrd.co
XP
4,840
Country
United States
I meant the capture card INSIDE the SoC. The thing I call MTX, which is used to "record" (and upscale) the DS/GBA screen to be displayed on 3DS LCD.
Ah, now that makes significantly more sense. Thanks.
 
  • Like
Reactions: Sono

dhh

New Member
Newbie
Joined
Jan 7, 2021
Messages
3
Trophies
0
Age
28
XP
43
Country
United States
Is there documentation for configuring which patches are applied? The quality of the top screen isn't that great (IMO) when I am playing Pokemon Black 2, so I'd like to play around with it and see which filters will work best.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=_PiiXM51oBo