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

  • Thread starter Sono
  • Start date
  • Views 734,304
  • Replies 2,420
  • Likes 100

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 .

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,800
Trophies
2
Location
home
XP
9,221
Country
Hungary
Can i make patch without pc? From phone on Android?

If you can compile 3dstool and ctrtool on Android then nothing stops you from doing this in a Terminal Emulator.

...or you can just wait a few days until I release a patcher which includes setting a custom scale filter.
 
  • Like
Reactions: Mythical

Vulpes-Vulpeos

Well-Known Member
Member
Joined
Feb 1, 2018
Messages
188
Trophies
1
XP
2,472
Country
Ukraine
Just to be sure. I need to change this two selected numbers(they are already changed in screenshot)?
 

Attachments

  • Снимок экрана 2019-07-06 в 16.12.22.png
    Снимок экрана 2019-07-06 в 16.12.22.png
    175.3 KB · Views: 215

Poluson

Member
Newcomer
Joined
Jul 6, 2019
Messages
5
Trophies
0
Age
40
XP
55
Country
Russia
If you can compile 3dstool and ctrtool on Android then nothing stops you from doing this in a Terminal Emulator.

...or you can just wait a few days until I release a patcher which includes setting a custom scale filter.
Ughh.. Thanks a lot!
 

Rahkeesh

Well-Known Member
Member
Joined
Apr 3, 2018
Messages
2,178
Trophies
1
Age
42
XP
3,248
Country
United States
Sadly AGB_FIRM is already as crisp as it can be, however it's possible to do a full-on linear interpolation by searching for the pattern
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 40 00 00 00 20 00 40 00 40 00 20 00 00 00 40 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
and replacing it with
00000000000000000000000000000000000000000000000000005615AA2A00000000AA2A0040AA2A56150040561556150000000000000000AA2A0000000000000000000000000000

I didn't test this, but hopefully this shouldn't hardlock the matrix unit, and should have an even linear interpolation.

Thanks for the info, I'll look into doing this manually if you aren't interesting in patching it.

I'm a big confused/concerned how an AGB_FIRM patch would interact with whatever has to be done to get VC injects to work, doesn't Luma already patch AGB_FIRM somehow? If so, how would the patches "stack"?

I have similar concerns about combining the TWL_FIRM modifications here with TWilight menu.
 

DSoryu

GBA/NDS Maniac
Member
Joined
May 5, 2010
Messages
2,348
Trophies
2
Location
In my house
XP
4,710
Country
Mexico
TWilightMenu++ stopped working for me. Just white screens and nothing happens. Tried to reinstall it, as something similar happened before, but no luck.

Did you apply the patch? If so, try loading TWilightMenu++ with the sysmodule patching in luma disabled. If it loads, then that means that you applied the patch wrongly and DS(i) mode is hardlocking.
 

DSoryu

GBA/NDS Maniac
Member
Joined
May 5, 2010
Messages
2,348
Trophies
2
Location
In my house
XP
4,710
Country
Mexico
I have DSiware installed and flashcard - both of them work with this patch. If TWLmenu works in your case, that mean that problem is on my side and I need to do clean reinstall.

I see, I don't know what the problem could be, TWiLightMenu++ works for me without problems. Once it stopped to work for me, so I redownloaded it with TWiLight Updater
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,800
Trophies
2
Location
home
XP
9,221
Country
Hungary
Thanks for the info, I'll look into doing this manually if you aren't interesting in patching it.

I am working on an automatic patcher, please be patient, I'm very busy.

If it loads, then that means that you applied the patch wrongly and DS(i) mode is hardlocking.
Just white screens and nothing happens

So it didn't hardlock. A hardlock means that the hardware locks up completely, and you have to do an "emergency" MCU poweroff by holding the power button until the power is cut. If the patch goes bad then the 3DS hardlocks on a black screen with the backlight still turned off.
 
D

Deleted User

Guest
It's not a typo :P I copied it directly out of my build.bat, and I did name it nccheader.bin manually.
actually... he's pointing out this

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.


While intensely digging everything TWL_FIRM, I also noticed some inaccessible code (no condition makes it ever jump to the code without patches) which looked to be a scrapped 1.5x upscale mode. And sure enough, hacking the code to always load this secret mode, it does indeed work... sort of. Other than the wonky touchscreen and the weird offsetting, this unused mode seems to be fully functional.


I can't babysit you thru' this process, so use some Google/Bing/DuckDuckGo to find the resources you need to do this.

  1. mount TWL_FIRM using Godmode9 (SYSNAND CTRNAND /title/00040138/?0000102/content/????????.app (select the one with the biggest number))
  2. go back to the main menu, browse to NCCH GAME IAMGE /exefs/.firm, select it, and copy it to /gm9/out/
  3. copy /gm9/out/.firm to your PC, and rename it to TWL.firm
  4. get firmtool, and unpack the FIRM with firmtool extract TWL.firm
  5. extract section0.bin (it's a cxi)
  6. open exefs/code.bin in a hex editor, and set two bytes at 0xC44 to 02 21
  7. repack exefs.bin with 3dstool -czvtf exefs exefs.bin --exefs-dir exefs --header exefsheader.bin
  8. repack TwlBg.cxi with 3dstool -cvtf cxi TwlBg.cxi --header nccheader.bin --exh exheader.bin --exefs exefs.bin --not-encrypt
  9. put TwlBg.cxi to /luma/sysmodules/TwlBg.cxi
  10. enable game patching and module loading in Luma settings
  11. ??? profit ???
there's a missing h in ncchheader and that's for every time it's referenced in your guide. As in the produced file from extracting section0.bin is named ncchheader.bin while the guide itself states it's named nccheader.bin. Which causes a bit of a headache since the end user has to catch that (until a patch comes out)
 
Last edited by ,

botik

Well-Known Member
Member
Joined
Sep 22, 2017
Messages
138
Trophies
0
XP
2,171
Country
Russia
I changed the AGB firms and checked the game on the GBA. It starts ONLY with the START key pressed else black screen
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,800
Trophies
2
Location
home
XP
9,221
Country
Hungary
I changed the AGB firms and checked the game on the GBA. It starts ONLY with the START key pressed else black screen

That means that you patched it wrong, and the matrix hardware hardlocks when it encounters an invald matrix.
 

botik

Well-Known Member
Member
Joined
Sep 22, 2017
Messages
138
Trophies
0
XP
2,171
Country
Russia
You need to change AGB the same as for TWL. We find it in the unpacked code.bin

4E001D01E301C1010000A5FCD0F89DF673F80000470D351E082F6F3B00406F3B082F351E470D000073F89DF6D0F8A5FC0000C101E3011D014E

and change to

000000000000000000000000000000000000000000000000000000200040004000400040002000000000000000000000000000000000000000

Removes blur.Does not change scale(Default)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BigOnYa @ BigOnYa: 3 hours on a riding lawn mower, my butt is numb and my whole body is still vibrating. Gonna be a...