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

  • Thread starter Sono
  • Start date
  • Views 760,643
  • Replies 2,430
  • 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 .

Shadow_The_Hedgehog82

Well-Known Member
Member
Joined
Jul 22, 2018
Messages
282
Trophies
0
Age
42
XP
949
Country
Australia
Hi i think i installed this ages ago, i remember having to patch some file like gbfirm or something and then running a homebrew to set the filter type. how do i get the ds stuff back into a stock state?
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,829
Trophies
2
Location
home
XP
9,422
Country
Hungary
Hi i think i installed this ages ago, i remember having to patch some file like gbfirm or something and then running a homebrew to set the filter type. how do i get the ds stuff back into a stock state?

Delete /luma/sysmodules/TwlBg.cxi and /luma/sysmodules/AgbBg.cxi.
If you have never manually copied these files, then also delete /luma/twl.firm and /luma/agb.firm
 

lyva

New Member
Newbie
Joined
Dec 6, 2022
Messages
4
Trophies
0
Age
26
XP
34
Country
Sweden
How do you fix the issue with using the widescreen patch for ROM hacks? Official Pokemon games launched through TWiLightMenu work just fine, but as soon as any patch is applied to the NDS file, it just stretches the image artificially, which looks really bad:
 

emcintosh

On the internet, everyone knows I'm a cat
Member
Joined
Dec 4, 2016
Messages
460
Trophies
0
XP
2,377
Country
United Kingdom
How do you fix the issue with using the widescreen patch for ROM hacks? Official Pokemon games launched through TWiLightMenu work just fine, but as soon as any patch is applied to the NDS file, it just stretches the image artificially, which looks really bad:

I suspect this is an issue with the patches you are applying to the game, not with TWLpatch. The widescreen effect comes from 2 things:
• game squashes everything horizontally to fit more of the world into the 256x192 DS view.
• Sono's improved scaling stretches this to 384x240 on the 3DS screen.

Forcing the game to show this squished wider view needs us to know where the instruction for the viewport is stored. If you use a ROM hack, this location can be altered, so the widescreen patch/cheat code will not increase the field of view. So the scaling will stretch out the original view.

You could try applying the widescreen patch before the other one?
 

lyva

New Member
Newbie
Joined
Dec 6, 2022
Messages
4
Trophies
0
Age
26
XP
34
Country
Sweden
I suspect this is an issue with the patches you are applying to the game, not with TWLpatch. The widescreen effect comes from 2 things:
• game squashes everything horizontally to fit more of the world into the 256x192 DS view.
• Sono's improved scaling stretches this to 384x240 on the 3DS screen.

Forcing the game to show this squished wider view needs us to know where the instruction for the viewport is stored. If you use a ROM hack, this location can be altered, so the widescreen patch/cheat code will not increase the field of view. So the scaling will stretch out the original view.

You could try applying the widescreen patch before the other one?
Thank you for the technical explanation of the issue. I have tried two different ROM hacks of two different Pokemon games so far and both seem to have the same problem.

How would I go about applying the widescreen patch first though, since that one doesn’t get applied to the game directly but just added to the “sd:/_nds/TWiLightMenu/TwlBg/” folder to be used universally for all games as mentioned in the gamebrew guide? (I’m not allowed to link it apparently)
 

emcintosh

On the internet, everyone knows I'm a cat
Member
Joined
Dec 4, 2016
Messages
460
Trophies
0
XP
2,377
Country
United Kingdom
Thank you for the technical explanation of the issue. I have tried two different ROM hacks of two different Pokemon games so far and both seem to have the same problem.

How would I go about applying the widescreen patch first though, since that one doesn’t get applied to the game directly but just added to the “sd:/_nds/TWiLightMenu/TwlBg/” folder to be used universally for all games as mentioned in the gamebrew guide? (I’m not allowed to link it apparently)
Aha! Your problem here is that the initial squash is being done by a cheat code rather than applied beforehand as a patch. TWLmenu can only apply cheat codes to the game they are intended for. ROM hacks change the ID code that is used to recognise a game. You will find that no cheats are available for your ROM hack (you can check this by pressing Y then X in TWLmenu when the game is highlighted).
You will need to open usrcheat.dat from sd:/_nds/TWiLightMenu/extras/ using R4CCE. Find the entry for the original game you patched and click the '…' button. Find the patched ROM and select it. This should overwrite the original game ID with the one for your patched game. Alternatively you could 'Add Game' to the database and select your patched ROM. Then you would need to add the widescreen code to this entry. You can also copy any other cheats you want from the original game's entry. Once you have done either of these, save your usrcheat.dat.
Hopefully this will let widescreen work. But as I say, patching ROMS can change the location where the aspect ratio is stored, so it may break widescreen and other cheats. For example, I've never got all the patches to SoulSilver I wanted working at once (StormSilver + Kris as player character + ??).
Let me know how you get on, and if you're still struggling I can try taking screenshots of the process.
 

brtatu

Well-Known Member
Member
Joined
Apr 19, 2014
Messages
116
Trophies
1
XP
678
Country
Brazil
Hey, I'm trying to change filter's type and it keeps installing linear sharpening. What should i do?

EDIT: Solved xD
 
Last edited by brtatu,

Gsqa

Member
Newcomer
Joined
Aug 28, 2019
Messages
10
Trophies
0
Age
26
XP
95
Country
United States
Is there any way to have other images in TWPatcher to compare the filters besides just the Mario 64 one? Like images from RPGs with lots of text on screen and the sort. The Mario 64 picture gives you a good idea of what each filter does to big models but each game is different.
 

PrincessLillie

(Future) VTuber
Member
Joined
Nov 28, 2013
Messages
2,921
Trophies
3
Age
21
Location
Virtual Earth
Website
lillie2523.carrd.co
XP
4,824
Country
United States
For what it's worth: New Luma version uses a new method for applying upscaling filters, and my TwlBg.cxi started causing DS(i) games and apps to not boot at all. TWPatcher will probably need an update to support the new method.
 
  • Wow
Reactions: ber71

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,829
Trophies
2
Location
home
XP
9,422
Country
Hungary
For what it's worth: New Luma version uses a new method for applying upscaling filters, and my TwlBg.cxi started causing DS(i) games and apps to not boot at all. TWPatcher will probably need an update to support the new method.

I'm sorry, but if a Luma update broke the patched TwlBg.cxi, especially if it has worked before, that's a regression in Luma, and not a problem with TWPatcher, I'm afraid.

Edit: revert post, see this post instead.
 
Last edited by Sono,

PrincessLillie

(Future) VTuber
Member
Joined
Nov 28, 2013
Messages
2,921
Trophies
3
Age
21
Location
Virtual Earth
Website
lillie2523.carrd.co
XP
4,824
Country
United States
I'm sorry, but if a Luma update broke the patched TwlBg.cxi, especially if it has worked before, that's a regression in Luma, and not a problem with TWPatcher, I'm afraid.
You misunderstand. Luma has a completely new system for screen filters, I'm pretty sure using TwlBg.cxi for that purpose is deprecated.
 
  • Like
Reactions: Raylight

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,829
Trophies
2
Location
home
XP
9,422
Country
Hungary
You misunderstand. Luma has a completely new system for screen filters, I'm pretty sure using TwlBg.cxi for that purpose is deprecated.

Ah, I see.

I would say I have a website which can generate scale matrixes, but I lost access, so I can't give a link.

I guess someone could make a separate homebrew which does nothing but manage these matrixes, and possibly even let you edit them from your 3DS, while seeing the changes in real time.

I also don't get why there is still not yet a DSi-side homebrew for this, as rtcom could be used to upload a new matrix *without rebooting*, directly from the DSi-side. Perhaps a 3DS-side homebrew is pointless, and just make a DSi homebrew which can directly write this file to the SD, while also being able to change it on the fly.

Although this would interfere with the widescreen and GPU patches, but pretty sure barely anyone uses those, as they are too blurry, and widescreen doesn't work on 2D engines.
 
  • Like
Reactions: Raylight

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    @K3Nv2, RIP Felix does great videos on the PS3 yellow-light-of-death.
  • Jayro @ Jayro:
    Eventhough the New 3DS XL is more powerful, I still feel like the DS Lite was a more polished system. It's a real shame that it never got an XL variant keeping the GBA slot. You'd have to go on AliExpress and buy an ML shell to give a DS phat the unofficial "DS Lite" treatment, and that's the best we'll ever get I'm afraid.
    +1
  • Jayro @ Jayro:
    The phat model had amazingly loud speakers tho.
    +1
  • SylverReZ @ SylverReZ:
    @Jayro, I don't see whats so special about the DS ML, its just a DS lite in a phat shell. At least the phat model had louder speakers, whereas the lite has a much better screen.
    +1
  • SylverReZ @ SylverReZ:
    They probably said "Hey, why not we combine the two together and make a 'new' DS to sell".
  • Veho @ Veho:
    It's a DS Lite in a slightly bigger DS Lite shell.
    +1
  • Veho @ Veho:
    It's not a Nintendo / iQue official product, it's a 3rd party custom.
    +1
  • Veho @ Veho:
    Nothing special about it other than it's more comfortable than the Lite
    for people with beefy hands.
    +1
  • Jayro @ Jayro:
    I have yaoi anime hands, very lorge but slender.
  • Jayro @ Jayro:
    I'm Slenderman.
  • Veho @ Veho:
    I have hands.
  • BakerMan @ BakerMan:
    imagine not having hands, cringe
    +1
  • AncientBoi @ AncientBoi:
    ESPECIALLY for things I do to myself :sad:.. :tpi::rofl2: Or others :shy::blush::evil:
    +1
  • The Real Jdbye @ The Real Jdbye:
    @SylverReZ if you could find a v5 DS ML you would have the best of both worlds since the v5 units had the same backlight brightness levels as the DS Lite unlockable with flashme
  • The Real Jdbye @ The Real Jdbye:
    but that's a long shot
  • The Real Jdbye @ The Real Jdbye:
    i think only the red mario kart edition phat was v5
  • BigOnYa @ BigOnYa:
    A woman with no arms and no legs was sitting on a beach. A man comes along and the woman says, "I've never been hugged before." So the man feels bad and hugs her. She says "Well i've also never been kissed before." So he gives her a kiss on the cheek. She says "Well I've also never been fucked before." So the man picks her up, and throws her in the ocean and says "Now you're fucked."
    +1
  • BakerMan @ BakerMan:
    lmao
  • BakerMan @ BakerMan:
    anyways, we need to re-normalize physical media

    if i didn't want my games to be permanent, then i'd rent them
    +1
  • BigOnYa @ BigOnYa:
    Agreed, that why I try to buy all my games on disc, Xbox anyways. Switch games (which I pirate tbh) don't matter much, I stay offline 24/7 anyways.
  • AncientBoi @ AncientBoi:
    I don't pirate them, I Use Them :mellow:. Like I do @BigOnYa 's couch :tpi::evil::rofl2:
    +1
    AncientBoi @ AncientBoi: I don't pirate them, I Use Them :mellow:. Like I do @BigOnYa 's couch :tpi::evil::rofl2: +1