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

  • Thread starter Sono
  • Start date
  • Views 749,420
  • 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 .
Important notice regarding Luma v13

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
Everyone, please stop spreading misinformation!

With the release of Luma v13, a lot of people are complaining about a black screen when launching anything in DS(i) mode.
If you think about it, if your patched TwlBg.cxi has worked in previous Luma versions, but the latest one breaks it, then it must be a regression in Luma's code, not in mine.

I'm able to pull the "this is not my fault" card here, as I've been doing these patches in a way where it should also work on a sigpatch-only stock system, so it should really not be my fault:
TWPatcher decompresses TwlBg.cxi, patches the .code section, then re-compresses it in a way, where if the original .firm had its sysmodule section replaced with a TwlBg.cxi patched by TWPatch, then you'd only need signature patches to make it work, meaning that TWPatcher is already as compliant as possible, and always has been.

So please don't spread stuff like "TWPatch uses the old method" or "TWPatch is not compatible with the new method", as there is no such thing as "old method" and "new method". Luma should only patch some things in the kernel and Process9 (sigpatches mostly), and should just load the patched and compressed TwlBg.cxi from the SDCard unharmed. There isn't much other way of doing it without doing some heavy-duty patches to 3 sections out of 4.

If you do find an actual mistake in TWPatch which you think might cause these issues, please ping me in this thread, and I'll look into fixing it, and I'll add a clarification into this post in form of an edit if such thing really ends up happening.

Edit: v13.0.1 fixes the regression, please update to fix the black screen issue!
 
Last edited by Sono,

The Catboy

GBAtemp Official Catboy™: Boywife
Member
Joined
Sep 13, 2009
Messages
27,950
Trophies
4
Location
Making a non-binary fuss
XP
39,346
Country
Antarctica
Everyone, please stop spreading misinformation!

With the release of Luma v13, a lot of people are complaining about a black screen when launching anything in DS(i) mode.
If you think about it, if your patched TwlBg.cxi has worked in previous Luma versions, but the latest one breaks it, then it must be a regression in Luma's code, not in mine.

I'm able to pull the "this is not my fault" card here, as I've been doing these patches in a way where it should also work on a sigpatch-only stock system, so it should really not be my fault:
TWPatcher decompresses TwlBg.cxi, patches the .code section, then re-compresses it in a way, where if the original .firm had its sysmodule section replaced with a TwlBg.cxi patched by TWPatch, then you'd only need signature patches to make it work, meaning that TWPatcher is already as compliant as possible, and always has been.

So please don't spread stuff like "TWPatch uses the old method" or "TWPatch is not compatible with the new method", as there is no such thing as "old method" and "new method". Luma should only patch some things in the kernel and Process9 (sigpatches mostly), and should just load the patched and compressed TwlBg.cxi from the SDCard unharmed. There isn't much other way of doing it without doing some heavy-duty patches to 3 sections out of 4.

If you do find an actual mistake in TWPatch which you think might cause these issues, please ping me in this thread, and I'll look into fixing it, and I'll add a clarification into this post in form of an edit if such thing really ends up happening.
Should really update OP with this and suggestion of keeping with lower builds to keep using these patches, at least until something changes
 
  • Like
Reactions: Sono

Marax

Well-Known Member
Newcomer
Joined
May 19, 2017
Messages
92
Trophies
0
Age
34
XP
659
Country
Gambia, The
I updated to 13.01 but now everything is Widescreen like the normal Cartridges and Twilightmenu which normally isnt.
 

Maeson

Well-Known Member
Member
Joined
Apr 3, 2013
Messages
1,180
Trophies
1
XP
3,389
Country
Spain
I updated Luma and TWLPatch. I created a new TwlBg.cxi with Interpolation 1 because it seemed to look better than the default one, and revert START+SELECT, put it in the correct place for Twilight Menu with the correct name and such...

...But now when I boot certain games like Super Mario 64 DS, I see some corrupted graphics and glitchy upper screen for a few seconds. Is this normal, I am missing something, or something is wrong with Interpolation 1?

Edit: Okay, nope, it also happens with the default one. I wish I did a backup of my old Widescreen.cxi...

Edit: I fortunately found that the previous, 2022 version was here and tried. The cxi file created with that older version does not show any glitch.

I hope this helps somehow to find what could be the issue.
 
Last edited by Maeson,

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
I updated Luma and TWLPatch. I created a new TwlBg.cxi with Interpolation 1 because it seemed to look better than the default one, and revert START+SELECT, put it in the correct place for Twilight Menu with the correct name and such...

...But now when I boot certain games like Super Mario 64 DS, I see some corrupted graphics and glitchy upper screen for a few seconds. Is this normal, I am missing something, or something is wrong with Interpolation 1?

Edit: Okay, nope, it also happens with the default one. I wish I did a backup of my old Widescreen.cxi...

Edit: I fortunately found that the previous, 2022 version was here and tried. The cxi file created with that older version does not show any glitch.

I hope this helps somehow to find what could be the issue.

OH, I FORGOT TO DISABLE THE RASTER BARS!

I'll disable them next update, my bad!

would there be a way to change the Gamma in dsi mode its really washed out in comparison to the screen comparision in TWLPatcher

Use Redshift patch.

Enable Redshift from the patch menu (Y+B), press Y+B again, press X to reset the settings, and increase gamma for all 3 colors.
 

DyCerBR

Active Member
Newcomer
Joined
Sep 29, 2013
Messages
43
Trophies
1
Age
30
XP
250
Country
Brazil
Everyone, please stop spreading misinformation!

With the release of Luma v13, a lot of people are complaining about a black screen when launching anything in DS(i) mode.
If you think about it, if your patched TwlBg.cxi has worked in previous Luma versions, but the latest one breaks it, then it must be a regression in Luma's code, not in mine.

I'm able to pull the "this is not my fault" card here, as I've been doing these patches in a way where it should also work on a sigpatch-only stock system, so it should really not be my fault:
TWPatcher decompresses TwlBg.cxi, patches the .code section, then re-compresses it in a way, where if the original .firm had its sysmodule section replaced with a TwlBg.cxi patched by TWPatch, then you'd only need signature patches to make it work, meaning that TWPatcher is already as compliant as possible, and always has been.

So please don't spread stuff like "TWPatch uses the old method" or "TWPatch is not compatible with the new method", as there is no such thing as "old method" and "new method". Luma should only patch some things in the kernel and Process9 (sigpatches mostly), and should just load the patched and compressed TwlBg.cxi from the SDCard unharmed. There isn't much other way of doing it without doing some heavy-duty patches to 3 sections out of 4.

If you do find an actual mistake in TWPatch which you think might cause these issues, please ping me in this thread, and I'll look into fixing it, and I'll add a clarification into this post in form of an edit if such thing really ends up happening.

Edit: v13.0.1 fixes the regression, please update to fix the black screen issue!
I remember there being issues with enabling a lot of patches or some simultaneously due to not having enough space. Can this be solved with the new Luma version that supposedly allows arbitrarily sized TWL_FIRM?
 
  • Like
Reactions: verypedro

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
I remember there being issues with enabling a lot of patches or some simultaneously due to not having enough space. Can this be solved with the new Luma version that supposedly allows arbitrarily sized TWL_FIRM?

No.

For more space to be had, I'd have to
  • patch virtual memory allocation both in the Kernel11 loader and in Kernel11 itself
  • patch various hardcoded addresses scattered around everywhere
  • patch TwlBg/AgbBg to not touch certain addresses, as they'd overlap with the extended size of the virtual memory
  • make parts of VRAM not destroyed in sleep mode

It's simply so much work that it's easier to just rewrite TwlBg/AgbBg itself...
Which I already did, but touch doesn't work, and audio is weird, otherwise it's very well usable.
 

rxwaan

Member
Newcomer
Joined
Jul 29, 2023
Messages
6
Trophies
0
XP
120
Country
United States
OH, I FORGOT TO DISABLE THE RASTER BARS!

I'll disable them next update, my bad!



Use Redshift patch.

Enable Redshift from the patch menu (Y+B), press Y+B again, press X to reset the settings, and increase gamma for all 3 colors.
I have been looking online and have read through several dozen pages of this thread to no avail.

I am using Redshift to increase the gamma for DS games in addition to the widescreen patch and am running into the same issue using both TWLMenu and NDS forwarded games on the homescreen. If shut off the screen by closing the lid it seems that the Redshift screen settings will disappear and the gamma values will be back to the stock DS default colors. It will still retain the widescreen patch setting just not the gamma values. It will only retain the values as long as I have the screen open and the only way to bring back the patched Redshift settings is by closing the game completely and relaunching.

In case it's worth noting, I am using the version of Luma with built-in Redshift configuration and on native 3DS games it seems to be retaining the settings just fine so this seems to only be an issue when running in DS mode. Have I set up something incorrectly?
 

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,595
Trophies
3
Age
24
XP
20,998
Country
United States
I have been looking online and have read through several dozen pages of this thread to no avail.

I am using Redshift to increase the gamma for DS games in addition to the widescreen patch and am running into the same issue using both TWLMenu and NDS forwarded games on the homescreen. If shut off the screen by closing the lid it seems that the Redshift screen settings will disappear and the gamma values will be back to the stock DS default colors. It will still retain the widescreen patch setting just not the gamma values. It will only retain the values as long as I have the screen open and the only way to bring back the patched Redshift settings is by closing the game completely and relaunching.

In case it's worth noting, I am using the version of Luma with built-in Redshift configuration and on native 3DS games it seems to be retaining the settings just fine so this seems to only be an issue when running in DS mode. Have I set up something incorrectly?
It's most likely an overlooked bug during the TwlBg patching process and/or no code space left to retain the Redshift settings.
 
  • Like
Reactions: rxwaan

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,821
Trophies
2
Location
home
XP
9,322
Country
Hungary
I have been looking online and have read through several dozen pages of this thread to no avail.

I am using Redshift to increase the gamma for DS games in addition to the widescreen patch and am running into the same issue using both TWLMenu and NDS forwarded games on the homescreen. If shut off the screen by closing the lid it seems that the Redshift screen settings will disappear and the gamma values will be back to the stock DS default colors. It will still retain the widescreen patch setting just not the gamma values. It will only retain the values as long as I have the screen open and the only way to bring back the patched Redshift settings is by closing the game completely and relaunching.

In case it's worth noting, I am using the version of Luma with built-in Redshift configuration and on native 3DS games it seems to be retaining the settings just fine so this seems to only be an issue when running in DS mode. Have I set up something incorrectly?
It's most likely an overlooked bug during the TwlBg patching process and/or no code space left to retain the Redshift settings.

It's the latter. Redshift code runs once before that section of memory is completely unmapped and mapped to the DS/GBA side.

The more surprising thing is that it doesn't crash when waking up from sleep mode, as sleep mode always crashes for me...
 
  • Like
Reactions: rxwaan

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    S @ salazarcosplay: @BakerMan can one play cod from hen ps3?