?
  1. Just finish it already!

    41.7%
  2. Keep redshift and rtcom only, rest goes to DS side

    8.3%
  3. Just make the exe patcher work on the 3DS, the rest is fine DS-side

    50.0%
  4. 12 voter(s)
  1. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    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 capture card's image processor (used to capture DS and GBA screens), and made my own filters to show that sharp upscaling can be done.

    But that's not all! Since the initial patcher (which was only able to change the upscaling filter), a lot of work has been done:
    • Remove the DPAD input filter, so you can press LEFT+RIGHT and UP+DOWN without it being blocked, so you can enjoy glitches exclusive to this gameplay mechanic ;)
    • Blue light filtering thanks to CTR_Redshift
    • Screen swap for DS mode (the GBA only has a single screen, so it's not swappable)
    • Widescreen patching for both DS (4:3 --> 16:10) and GBA (15:10 --> 15:9) mode
    • ARM11 <--> ARM7 communication with rtcom (discovered by @Gericom)
      • Currently only GBARunner2 utilizes this for gyroscope emulation when playing WarioWare Twisted!, but any developer and romhacker can use this for anything which needs 3DS hardware access
    • Use GPU for upscaling
      • It looks much better than the default upscaling, but it's too blurry for some people
      • It can also pose a health hazard for people with nervous system problems who get weird spazms and epilleptic effects, so use with care!
    With a lot of help, love, and support from the community, there are useful use cases for the above patches:
    • TWiLightMenu++ lets you play games which have widescreen patches... in widescreen!
      • It's also possible thanks to everyone who are actively making those patches!
    • GBARunner2 uses rtcom to enable us to be able to play WarioWare Twisted! utilizing the gyroscope built into the 3DS
    There are also a few patches for developers too:
    • Possible to patch Process9, Kernel11Loader, and Kernel11
    • Includes a Kernel11 patch which reinstalls exception handlers, so you can debug your payloads easier


    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    If you want to see all scale matrixes, @Halvorsen has used a capture card to capture how it looks like on real hardware.
    [​IMG]

    [Download experimental] 2020/09/03
    [Download stable] Outdated!

     
    Last edited by Sono, Sep 3, 2020
  2. Dartz150

    Dartz150 Yet another Onii-chan
    Member

    Joined:
    May 5, 2010
    Messages:
    2,159
    Country:
    Mexico
    What makes this different that the current scale method? Does it look better than the blurry and washed out filter that TWL_FIRM normally applies?
     
  3. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    As you can see, the bottom-right of the screen is cut off, because 384x288 is bigger than 320x240. But since that resolution is double of the DS, the image doesn't look blurry.

    Upon closer inspection, there is sadly still interpolation, but because the scaling is integer, the image looks REALLY crisp.
     
    Dartz150 likes this.
  4. Dartz150

    Dartz150 Yet another Onii-chan
    Member

    Joined:
    May 5, 2010
    Messages:
    2,159
    Country:
    Mexico
    I see, and yeah, the main reason behind the blurriness in the standard scaling method is because the scale is not integer and is difficult to get accurate pixel draw with that setup alone.

    The thing is that this opens the possibility of (maybe) implementation or different scaling methods, I remember back in 2015 that someone asked if it was possible to hack different filtering methods and custom frames for native resolution to TWL_FIRM or something like that. Do you think it could be possible?
     
  5. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    I think it should be possible if my observations are correct.

    But even if I could get the scaling removed, the scaling would look absolutely horrible due to how the PICA upscales textures.
     
    Dartz150 likes this.
  6. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    It turns out that LgyFb is actually a matrix unit for scaling images. I found the 3 kernels associated with each upscale mode (1x, 1.25x (default), and 1.5x)

    [​IMG]

    Just by looking at the image, I think you can already see why 1.25x scaling (the default scaling without pressing START+SELECT) looks so horrible. I have no idea what these matrixes are, but it's pretty clear that the 1.25x scaling matrix is doing something weird.
     
  7. Rahkeesh

    Rahkeesh GBAtemp Advanced Maniac
    Member

    Joined:
    Apr 3, 2018
    Messages:
    1,718
    Country:
    United States
    Isn't 1.5x used by AGB_FIRM?

    Awesome that you are digging this stuff up. :yay:
     
    StrayGuitarist and Sono like this.
  8. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    Yeah, I heard that 1.5x is used by AGB_FIRM, but I didn't find any mention of GBA in the binary.
     
  9. SomeGamer

    SomeGamer GBAtemp Guru
    Member

    Joined:
    Dec 19, 2014
    Messages:
    6,816
    Country:
    Hungary
    No idea why anyone would use this (and why Nintendo left the code in) but can't deny it looks much better than the original.
     
    Sono likes this.
  10. IC_

    IC_ GBAtemp Maniac
    Member

    Joined:
    Aug 24, 2017
    Messages:
    1,146
    Country:
    Poland
    is this the secret project?
     
  11. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    According to almost everyone, it might be indeed a leftover from AGB_FIRM. But it's weird, because 3dbrew said somewhere that TwlBg is the same on both TWL_FIRM and AGB_FIRM :/

    Nope, this is "the experiment". The secret project is very far away.
     
    Tarmfot, Dartz150 and SomeGamer like this.
  12. Robz8

    Robz8 Coolest of TWL
    Developer

    Joined:
    Oct 1, 2010
    Messages:
    13,550
    Country:
    United States
    To users following the guide for 1.5x upscaling:
    Depending on what code.bin you have, the original 2 bytes' offset is either 0xC44 or 0xC46.
    The original bytes are "01 29".
     
    Last edited by Robz8, Jul 6, 2019
    Tarmfot, BOBdotEXE, zfreeman and 2 others like this.
  13. Dartz150

    Dartz150 Yet another Onii-chan
    Member

    Joined:
    May 5, 2010
    Messages:
    2,159
    Country:
    Mexico
    Thank you for you explanation, looking forward to your research and what advantages/improvements flourish from it. I Wonder what that secret project may be. I suppose is big, hence it being secret :ninja:
     
    Sono likes this.
  14. LoganK93

    LoganK93 GBAtemp Advanced Fan
    Member

    Joined:
    Dec 5, 2012
    Messages:
    670
    Country:
    United States
    I'm an idiot. Could this ever lead to widescreen on 3DS with DS games? Even if stretched I'd love to finally kill those black bars.
     
  15. Rahkeesh

    Rahkeesh GBAtemp Advanced Maniac
    Member

    Joined:
    Apr 3, 2018
    Messages:
    1,718
    Country:
    United States
    At a minimum I'd guess you could swap which is the default and which start/select activates? For people who would prefer the default to be no scaling, for instance.
     
  16. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    Sadly not yet, because the aspect ratio has to match. Once I reverse engineer the image matrix hardware more, it might be possible, but it would require extreme patching due to space limitations, and for that I would have to disable the other scaling modes.

    I'm pretty sure that's a simple one or two byte patch. I'll look into it later.
     
    Robz8, ahezard and zfreeman like this.
  17. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    Aaaaaaaaaaaaaand, I did it! Crispy upscale filter :D

    [​IMG]
    [​IMG]

    It turns out that I was an idiot, and was writing invalid filters into the file which hardlocked everything. That's what I get for manually entering the bytes into a hex editor without a tool autogenerating them for me ¯\_(ツ)_/¯
     
    KoalaBoy, Pickle_Rick, Seriel and 8 others like this.
  18. SomeGamer

    SomeGamer GBAtemp Guru
    Member

    Joined:
    Dec 19, 2014
    Messages:
    6,816
    Country:
    Hungary
    Nice! You can finally go and actually play the thing... right?
     
  19. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,234
    Country:
    Hungary
    Yeah uh... I would release the patch, but there is a small problem: TwlBg contains copyrighted material, and it's impossible to patch compressed code without unpacking and repacking it completely.

    My idea is to include a patcher homebrew which dumps TwlBg, unpacks it, patches it, then places it in /luma/sysmodules/TwlBg.cxi, and that way you can even specify your own filters.
    You can do gaussian filters and double vision with this image processing matrix hardware :blink:
     
  20. SomeGamer

    SomeGamer GBAtemp Guru
    Member

    Joined:
    Dec 19, 2014
    Messages:
    6,816
    Country:
    Hungary
    That'd be the most user-friendly way. IMO you could release some manual patching instructions in the meantime if it isn't a ton of values but it's your call ultimately.
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - TWPatcher, filters, patches