?
  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. Robz8

    Robz8 Coolest of TWL
    Developer

    Joined:
    Oct 1, 2010
    Messages:
    13,690
    Country:
    United States
    Update to v10.0.1.
     
  2. Kolieder

    Kolieder Member
    Newcomer

    Joined:
    Aug 24, 2019
    Messages:
    10
    Country:
    United States
    I updated and now opening twilight menu shows "An external firm module is invalid or corrupted"
     
  3. Robz8

    Robz8 Coolest of TWL
    Developer

    Joined:
    Oct 1, 2010
    Messages:
    13,690
    Country:
    United States
    Delete "TwlBg.cxi" at "sd:/luma/sysmodules/", then follow the widescreen steps for TWiLight Menu++ again.
     
  4. Kolieder

    Kolieder Member
    Newcomer

    Joined:
    Aug 24, 2019
    Messages:
    10
    Country:
    United States
    Updating made twilight menu show an external firm module is invalid or corrupted
     
  5. lordkaos

    lordkaos GBAtemp Advanced Fan
    Member

    Joined:
    Mar 13, 2009
    Messages:
    597
    Country:
    United States
    can i ask you something?, is it normal for the 3DS to return to the home menu when I press the L+R+Select+Start or L+R+Down+B button combination while playing a DS game using twilightmenu?, I read you could return to the twilightmenu homescreen pressing one of those combinations but it has never worked for me, I'm on the latest version.
     
  6. Robz8

    Robz8 Coolest of TWL
    Developer

    Joined:
    Oct 1, 2010
    Messages:
    13,690
    Country:
    United States
    It doesn't work on O3DS.
    On N3DS, it only fails to work sometimes.
     
  7. lordkaos

    lordkaos GBAtemp Advanced Fan
    Member

    Joined:
    Mar 13, 2009
    Messages:
    597
    Country:
    United States
    so that's why, thank you, would it be possible to make it work on o3ds or is it because of hardware limitation?
     
  8. ghjfdtg

    ghjfdtg GBAtemp Advanced Fan
    Member

    Joined:
    Jul 13, 2014
    Messages:
    670
    Country:
    Exactly. It uses the same resolution but stretched up which means there is quite a loss in quality. I don't understand how someone can do that to their eyes.
     
  9. Robz8

    Robz8 Coolest of TWL
    Developer

    Joined:
    Oct 1, 2010
    Messages:
    13,690
    Country:
    United States
    I'd have to own an O3DS to even try to get it working.
     
  10. Kolieder

    Kolieder Member
    Newcomer

    Joined:
    Aug 24, 2019
    Messages:
    10
    Country:
    United States
    I got twilight menu AND widescreen working. Thank you!
     
    Robz8 likes this.
  11. Vague Rant

    Vague Rant Deceptively cute
    Member

    Joined:
    Aug 7, 2008
    Messages:
    2,299
    Country:
    Sorry to batch quote you all here, but I think the majority of what you're objecting to is probably the filtering (or lack thereof) that's currently applied by the patched TwlBg when stretching games to widescreen. I don't understand the technical details whatsoever, but part of what the currently-available widescreen patch is doing is disabling all filtering on the horizontal axis, so you're seeing the bare, unfiltered, non-integer scaled pixels. The simple fact of this is that it's not going to look great, especially at the extremely low resolutions of the DS/3DS screens.

    Of course it's more than just that, and it's true that stretching the same number of pixels over a wider area is reducing the overall picture quality, but including some smoothing filter/s on the vertical and horizontal (which I believe Sono has said is possible) will go a long way to mitigate the visual artifacts of scaling up by another 20% from the default. I agree that right now the picture quality is not all that it could be, but--without intending to put any additional pressure on Sono, sorry--I do believe it's partly just the nature of a feature that's in its infancy and can/will be improved upon with (considerable) time and effort.

    EDIT: I went back and found Sono's post on widescreen and filtering:
     
    Last edited by Vague Rant, Sep 1, 2019
    Ars92, Robz8, Raylight and 2 others like this.
  12. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,253
    Country:
    Hungary
    Exactly.

    The main reason I clear the scaling on the X axis is because I didn't have enough time to do patches which patch the X and Y matrixes individually (because the scale ratio isn't equal on both axises).
    The reason I write an identity scale matrix is because the ratio count (stretch / contract) doesn't match both axes, so I'd have to store X and Y matrixes individually, for which I didn't make a patch yet because I have yet to find enough space to fit it, and I'd have to write my own matrix uploader code into a very small space, so I didn't do it yet.

    Let's say we want to upscale the image by 5/3 (widescreen GBA). Here 5 is the "stretch" (k) amount, and 3 is the "contract" (j) amount. If you multiply the GBA screen width with that ratio, you get the 3DS's top screen width of 400 (= 240 * (5 / 3))

    Here's how the scale matrix works (on an understandable level, in hardware it's entirely different, and not even I can understand it fully):
    - there are k matrixes, which output k pixels from j pixels (this is how upscaling works)
    - j is actually not a number, but a k long list of yes/no which tell if we should check the next source pixel or not (j as a number is just the amount of "yes" in the list, which is 3 in this example)
    - we take a j block of pixels and store it somewhere, along with its position on the source image, so we can still find the neighboring pixels
    - currently the source index (the center of a single scale matrix) is the first pixel of the j block of pixels
    - for each k matrix entry in the matrix list
    - put the pixel at the source index into the middle number
    - put neighboring pixels also into the matrix
    - do a weighted pixel average into the center of the scale matrix (weighted averaging means that you take for example 25% of the pixel on the left, 25% on the right, 50% of the current pixel, and add them together (this is also how blurring works))
    - write the resulting pixel into the output
    - if the current index into j says "yes" then move to the next pixel in the "j" block into the center of the matrix (so you just push the entire image to the left so it'll be in the center), otherwise the current source index stays as-is

    (if you didn't understand anything I said, just search for how 1D image matrix filtering works)

    The problem is that both k and j are limited to being anywhere between 1 and 8 (inclusive), and that's a harware limitation, and I can't get around it.

    So, because the scale matrix can only step integer amounts of pixels (can't read only half pixels for example), you have to mathematically recalculate each matrix entry in a whole scale matrix, otherwise the pixels will be off. And also the j list has to be also matching, otherwise you can "delaminate" the screen, which can cause major headaches for people because it looks like double vision ghosting.
    tl;dr: I have to clear the filtering on the X axis because it would look even worse without clearing it because you have to "reprogram" the matrix hardware for each scaling ratio to look right, and that requires mathematically recalculating it again, which I can't do due to the lack of my mathematical knowledge.

    I can't enable X scaling until I can make the GUI be aware of it, and offer you to choose unique scale matrixes for both X and Y axis. I also have to develop a patch which can upload the X and Y axis individually (which is simple, but I have space problems, so it'll take a while to develop).
     
    Last edited by Sono, Sep 1, 2019
    Robz8, Raylight, YuseiFD and 3 others like this.
  13. Rahkeesh

    Rahkeesh GBAtemp Advanced Maniac
    Member

    Joined:
    Apr 3, 2018
    Messages:
    1,736
    Country:
    United States
    That sounds like a ton of work. Way more than applying the prior non-widescreen twl patcher to agb. Wonder what kind of bribe that would take. :P
     
  14. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,253
    Country:
    Hungary
    Nah, it's really simple, I just can't find a time in my nonexistant "schedule" where I'm not currently dying from the heat and not sleeping.
    And also, I need to learn maths, so I can autogenerate the filters regardless of the scaling ratio.

    The real work would be getting widescreen AND screen swap working. That IS a lot of work, because patching DMPGL (3DS' OpenGL driver) is nearly impossible, and most of the times I don't have enough code space and have to get very creative.
     
    Robz8, Raylight and Rahkeesh like this.
  15. Rahkeesh

    Rahkeesh GBAtemp Advanced Maniac
    Member

    Joined:
    Apr 3, 2018
    Messages:
    1,736
    Country:
    United States
    Well its not that hot here but I'm still too dumb. I located the active image matrix in AGB_FIRM and have been able to change it and pack back into agbbg.xci. Most changes result in black screen unless I have the start button held to skip scaling, that includes the one Sono suggested way back on page 3 when he probably knew less about this process, as well as trying to import any matrix from twlbg.xci. But one time I swapped the location of the hex 20s and 40s in the matrix and got it to run with a pointillistic effect (black pixel boxes surrounding light pixels), so I know I'm in the right area at least. I just don't know what makes an acceptable matrix, especially for something like (bi?)linear interpolation.

    I'm guessing I should read these matricies as octal instead of hexidecimal, but I still have a hard time matching them up to your explanation. But it seems like it has to be more than just weighting how much of pixel X goes into the color of pixel Y if its so crash prone with the wrong values.
     
  16. Sono

    OP Sono 3DS cash, rival of nocash
    Developer

    Joined:
    Oct 16, 2015
    Messages:
    2,253
    Country:
    Hungary
    What do you mean you "located" the "active" image matrix? I never put patching instructions for AgbBg in the first post :wacko:

    Also, the values are in hex, fixed-point. 4000 is 1.0, 2000 is 0.5, E000 is -0.5, C000 is -1.0
     
  17. Rahkeesh

    Rahkeesh GBAtemp Advanced Maniac
    Member

    Joined:
    Apr 3, 2018
    Messages:
    1,736
    Country:
    United States
    I meant the pattern

    Code:
    0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000
    0000 0020 0040 0000 0020 0040
    0040 0020 0000 0040 0020 0000
    0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000
    
    I find this around x4A190 in my code.bin extracted from my agbbg.xci. You suggested looking for this back on the 2nd or 3rd page.

    Its "active" in the sense that I can see changes in game when I make small changes to the values, so it seems to be the right area. Someone else on 3rd page suggested instead editing what looks like an unused matrix right above this one, it avoided crashes but doesn't seem to do anything. (Guessing that is unused 1.25x scaling?)

    Thanks for the obvious tip about treating these as fixed point decimals, makes these almost readable, maybe I will figure it out eventually.
     
    Last edited by Rahkeesh, Sep 2, 2019
  18. AkitoUF

    AkitoUF GBAtemp Regular
    Member

    Joined:
    Jan 5, 2016
    Messages:
    227
    Country:
    Chile
    I just wanted to thank you guys for this achievement.
    Which is your preferred filter to play with?
     
  19. Raylight

    Raylight Paranoid Temper
    Member

    Joined:
    May 10, 2014
    Messages:
    1,139
    Country:
    United States
    Liner flter
     
  20. VMM

    VMM Hamon > Stand
    Member

    Joined:
    Jul 1, 2010
    Messages:
    3,126
    Country:
    Brazil
    Duuuude... how many nights have you stayed awake since you started this project?
    I think I can speak in behalf of all community in this:

    We love the progress you're making, it's rather impressive and something good for the community,
    but you should always prioritize your health.

    This lack of sleeping will cause fatigue, can drive you sick and will hinder you as a developer.
    I can't remember how many times that as a developer, I made stupid coding mistakes because I was tired from not sleeping.
    Linters help a lot, but there is always something, calling a function with the wrong name,
    some wrong math, you know things that would be simple if I had rested properly.

    I see someone posted it before, but Sono actually is sleep in portuguese haha
    So do yourself a favor and get some sleep :)

    Also thank you very much for your work, been playing Heartgold again and your filter brought new life to it.
     
Draft saved Draft deleted
Loading...

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