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

  • Thread starter Sono
  • Start date
  • Views 621,485
  • Replies 2,276
  • Likes 96

Are you interested in a complete replacement of TwlBg which includes all patches?

  • Yes, I don't care how broken it will be!

    Votes: 159 77.6%
  • No, I don't want to use even more broken stuff

    Votes: 20 9.8%
  • Yes, but only in GBA mode, because I play DSi exclusives

    Votes: 11 5.4%
  • No, because I only use DS and DSi mode

    Votes: 15 7.3%

  • Total voters
    205

TuxSH

Well-Known Member
Member
Joined
Oct 19, 2015
Messages
614
Trophies
1
Age
25
XP
1,284
Country
France
Maybe I could hotpatch twlbg in luma for the filters, already did that kind of stuff once or twice.

Btw I did some of your research at some point, patched some bytes (possibly the same as those described here), but did not see any apparent change. Thank you so much for properly finishing this research.
 

Goloki

Proud TX Suporter... LOL!
Member
Joined
Nov 24, 2006
Messages
458
Trophies
0
XP
849
Country
United States
@ahezard has implemented the deblur patch into his twl_firm_patcher.

Hmmmm. I'm getting an error trying to run this.

error.png


I'm pretty sure the file is correctly named (firmware_twl.bin), has the right size (1.64MB) and in the correct folder (input). I got it with GodMode9, following a short tutorial posted in this thread.

Any ideas?
 

MuperMumpjanSario

Well-Known Member
Newcomer
Joined
Jan 12, 2017
Messages
56
Trophies
0
Age
22
Location
Perth, Western Australia
XP
1,754
Country
Australia
Hmmmm. I'm getting an error trying to run this.

error.png


I'm pretty sure the file is correctly named (firmware_twl.bin), has the right size (1.64MB) and in the correct folder (input). I got it with GodMode9, following a short tutorial posted in this thread.

Any ideas?
Someone didn't read the README
BkxKBYM.png
 

BOBdotEXE

Well-Known Member
Member
Joined
Mar 25, 2011
Messages
198
Trophies
1
Location
The Internet
XP
844
Country
United States
Based on the 3 filters (1x (START+SELECT), 1.25x (default), and 1.5x (used only in GBA mode)) found inside TWL_FIRM, I reverse engineered most of the image matrix processor hardware, and made my own filters to show that sharp upscaling can be done.
-snip-
If it hardlocks then you didn't find the right pattern, or your TwlBg version is not good.
[/spoiler]


WOW, this is AWESOME, chrono trigger DS keeps getting better in better!
First, DSi mode speed, then higher FREQ sound, now better scaling!

I made a SBS comparison video, you can find that here:


(Zoomed in comparisons:)


Edit: CRAP! I forgot to mute the audio :P
 
Last edited by BOBdotEXE,

BOBdotEXE

Well-Known Member
Member
Joined
Mar 25, 2011
Messages
198
Trophies
1
Location
The Internet
XP
844
Country
United States
Now I see why some people are against this patch. Yeah, I can still see room for improvement on these matrixes. But some areas look undoubtedly infinitely better with the simple 1.25x matrix.

I have yet to try the 1.5 patch, but even if the 1.5 is a bit worse, it's still nice to have the option.

Thanks for working on this!
 
  • Like
Reactions: Sono

PokeNas

Well-Known Member
Member
Joined
Jul 31, 2012
Messages
168
Trophies
1
Location
Best place on Earth
XP
1,657
Country
Saudi Arabia
I appreciate the effort, OP, but your guide is kind of a mess...

So I tried making a script to automize the extracting and rebuilding process as much as possible.

Script: https://mega.nz/#!1mYgHYRL!7YZZy_MabrmLq2hZw4IP2GKFshuk8jfMe1hUPfh3lLM
Filename: Run.bat
MD5: a064ebbb78cf22fc327b5dbb660a6e89

If you're (understandably) wary of running random scripts off of a tech forum, you're more than free to open the script in a text editor and judge its legitimacy for yourself. I've tried making using it as foolproof as possible.


Prerequisites (you will need the following):

  • Access to GodMode9
  • A PC and a way of moving files between it and the SD card (eg. directly or via FTP)
  • A hex-editor for PC (HxD is a good one), and basic knowledge on how to use the program
  • FirmTool (must be installed via Python)
  • 3DSTool (must either be in script directory or system PATH)
  1. Boot into GodMode9 on your system.
  2. Once loaded, go through [SYSNAND CTRNAND > title > 00040138 > *0000102 > content > ********.app] and mount the .app file.
    • The "*" is a wildcard, it can fit any alphanumerical sign.
    • Select the .app file with the highest number.
  3. Once you're inside the mounted .app, enter the [exefs] folder, select the .firm file there, and copy it to [0:/gm9/out].
  4. Turn off your system, remove the SD card from it and connect it to your PC (or use FTP to wirelessly transfer files, it's up to you).
  5. Travel to [SD:\gm9\out\] on your PC, and copy the .firm file somewhere onto your PC (preferably in own folder).
  6. Move the 'Run.bat' script (download at the top of my post) into the same directory as the .firm.
  7. Rename the .firm file to "TWL.firm" and run the script.
    • If you encounter this message while trying to run the script, please make sure you have both FirmTool and 3DSTool installed and findable by the script.
    • rqfb2Pd.png
  8. Please read the script output, follow it carefully, and press the Y key to continue after doing so:
    • W2XzEdu.png
  9. Wait until you get this wall of text:
    • XJI9VFt.png
  10. Open the code.bin that appeared in the script directory in your hex-editor, apply and save the patches of your choice (as stated above), and press the number key stated to continue with the script.
  11. Wait until you receive this message:
    • l2nEY8D.png
  12. Check your script's directory. There should now be a "TwlBg.cxi" inside it. Copy TwiBg.cxi onto your SD (again, either directly or via FTP) under [SD:\luma\sysmodules\].
  13. Reinsert the SD card into the system (or reboot it if you used FTP) and power it on while holding SELECT to enter Luma's configuration menu.
  14. Ensure that these two options are ticked:
    • "Enable game patching"
    • "Enable loading external FIRMs and modules"
  15. Press START to save your settings.
And that should be it.

So should we go ahead and use this patcher or wait for OPs version? Also, when running DS games after the patch, would I need to hold any buttons for it to take effect?
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,654
Trophies
2
Location
rehabilitation center
XP
8,219
Country
Hungary
So should we go ahead and use this patcher or wait for OPs version?

Yes please, wait for my patcher, I found and fixed the bug, so it'll be done in the upcoming few hours if I don't break something else.

Also, when running DS games after the patch, would I need to hold any buttons for it to take effect?

No, these are code patches, they are automatically applied from the /luma/sysmodules/ directory.
 

Reynardine

Fuchsly
Member
Joined
Aug 14, 2018
Messages
519
Trophies
1
Location
Negativland
XP
1,275
Country
Germany
I'm just a newbie here, I stumbled upon your guide by accident.
Anyways, I can't thank you enough for sharing this, Sono.

I've just tried the sharp 1.25x scaling for the first time and it looks so much better.
This is just wonderful, finally I can enjoy my old ds games again.
I couldn't stand the blurriness...

I've also tried the 1.5x mode, it works, but it seems rather pointless when part of the screen area is missing.

The offsets were quite a bit further down in my code.bin, by the way.
Maybe its because I've updated to firmware 11.10.0-43E recently.

Here's the 1.5x scaling offset in my code.bin:
2ns5bhz.jpg

At 0xC9A.

And here's the 1.25x scaling offset:
2vdk9vr.jpg

At 0x4B094.
 
  • Like
Reactions: Sono

goncalodoom

Well-Known Member
Member
Joined
Sep 12, 2009
Messages
420
Trophies
1
Age
31
Location
portugal
XP
914
Country
Portugal
I'm just a newbie here, I stumbled upon your guide by accident.
Anyways, I can't thank you enough for sharing this, Sono.

I've just tried the sharp 1.25x scaling for the first time and it looks so much better.
This is just wonderful, finally I can enjoy my old ds games again.
I couldn't stand the blurriness...


I applied the 1.25x patch and it looks even blurrier than stock. How do you make it look sharp? I'm using a new 3ds XL
 

MrLuigix64

Well-Known Member
Newcomer
Joined
Mar 4, 2013
Messages
72
Trophies
0
Age
29
Location
In your heart
XP
368
Country
Mexico
Noice work on the filter. I wanted to apply it on my O3DS, but im not sure, what version to use, can I use the x1.5 on my small O3DS? o only the x1.25 can be used?, its unique on every 3DS?
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,654
Trophies
2
Location
rehabilitation center
XP
8,219
Country
Hungary
Noice work on the filter. I wanted to apply it on my O3DS, but im not sure, what version to use, can I use the x1.5 on my small O3DS? o only the x1.25 can be used?, its unique on every 3DS?

It's the same resolution on any 3DS, so 1.5x will always have its right and bottom sides missing, and 1.25x is always the default.

I think you should use 1.25x, because 1.5x is very hard to play with if it uses the touchscreen.
 

RacsoSakuraba

Well-Known Member
Member
Joined
Mar 13, 2016
Messages
267
Trophies
0
XP
530
Country
Venezuela
With this would it be possible to do a full screen mode on the upper screen?

EDIT: On the other hand, if I understood correctly: when using this patch x1.25, which is the same original size, applying it removes the blurring effect and weird color that comes in stock?

Edit: I can however move the screens up-down-left-right when in 1x mode

EDIT2: Oh god, this is great.
 
Last edited by RacsoSakuraba,
  • Like
Reactions: Sono
General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
  • K3N1 @ K3N1:
    Your favorite activity
  • BentlyMods @ BentlyMods:
    My fav actvity is:

    mario-dancing.gif
  • Psionic Roshambo @ Psionic Roshambo:
    Do the Mario lol
  • K3N1 @ K3N1:
    🍑
  • K3N1 @ K3N1:
    Whoever developed Bramble was smoking that good shit fucking gnomes
    K3N1 @ K3N1: Whoever developed Bramble was smoking that good shit fucking gnomes