CTR_Redshift - hardware-based blue light filter for old3DS and 2DS

Discussion in '3DS - Homebrew Development and Emulators' started by Sono, Jan 9, 2018.

  1. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
    Nope, this is a boot.firm, just replace your already existing boot.firm :P

    Oh I think I know the problem... you're releasing A too slow, and this is an oversight, my bad :P Let me fix it real fast...

    EDIT: done https://puu.sh/AxWVU/a6635739b3.firm
     
    Last edited by Sono, Jun 2, 2018
    Nutez likes this.
  2. silver_raid

    silver_raid Newbie

    Newcomer
    3
    Jun 1, 2018
    United Kingdom
    Yep that fixed it! Thanks!
     
    Sono likes this.
  3. Nutez

    Nutez Advanced Member

    Newcomer
    4
    Jan 2, 2018
    United Kingdom
    The other side of paradise.
    My favourite bit of homebrew along with your LED toggle :wub: . So nice to be able to play in the dark without burning your eyes out. Hypothetically, would it be possible to apply the screen brightness settings at startup with a button press? I'm imaging the dream scenario where you can "Hold X for night mode" and it applies screen dim/redshift/LED toggle and maybe even loads a selected nighttime theme. And/or is this something that could be done via GodMode9 script? Thanks for the great work and entertaining my naive questions haha.
     
    Sono likes this.
  4. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
    I guess I could try looking into a boot-time alternative a few days later, but it will have a slight chance of failing miserably and thus either softlocking the entire system or having a totally black screen due to the color table being all zero. I'll see what I can do :P

    Also, I don't get these GM9 scripts, why would a GM9 script be able to solve everything? I seriously don't know :wacko:
     
    CheatFreak47 likes this.
  5. Nutez

    Nutez Advanced Member

    Newcomer
    4
    Jan 2, 2018
    United Kingdom
    The other side of paradise.
    Black screen would use less power and I could play by sounds alone :P . Any experimentation would be greatly appreciated though, thanks :D .
    I thought there was a GM9 script for changing theme at least.
     
  6. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
    Sadly a blank screen wouldn't use that much less power to be noticable. I'd also have to turn off the backlight for that, but sadly that requires a gsp patch, which is still in the works.
     
  7. Nutez

    Nutez Advanced Member

    Newcomer
    4
    Jan 2, 2018
    United Kingdom
    The other side of paradise.
    So the GSP module has a service for using the LCD (https://www.3dbrew.org/wiki/GSP_Services). What does GSP actually stand for though? It's bugging me and google just gives junk about GPS...
     
  8. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
    I have absolutely no ida what gsp stands for, but my guess would be "graphics service-protocol".

    Also, gsp::Lcd is useless, you could do that yourself by poking some memory addresses.
     
  9. trecko1234

    trecko1234 GBAtemp Regular

    Member
    3
    Aug 10, 2013
    United States
    fwiw, this might be of some help for you to see how NTR altered the backlight brightness in the past.

    https://github.com/44670/NTR/issues/9

    I've been able to frankenfirmware my 3DS in order to get the NTR backlight brightness function to work correctly, but that was back in January so I don't remember which CIAs I installed and what changed for it to work.
     
    Sono likes this.
  10. seren3

    seren3 GBAtemp Regular

    Member
    3
    Jul 16, 2018
    United States
    I love the hell out of your custom redshift Luma! This should be a permanent part of Luma 10.
     
  11. seren3

    seren3 GBAtemp Regular

    Member
    3
    Jul 16, 2018
    United States
    Hey MarcusD, do you think you could compile your redshift build with the latest Luma 9.1?
     
  12. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
    Sorry, I don't maintain this "plugin", I only gave a Luma build because so many people asked. It was much harder than I expected to add this into Luma, so I'd rather not go through that hell, sorry.
     
  13. trecko1234

    trecko1234 GBAtemp Regular

    Member
    3
    Aug 10, 2013
    United States
    Why not just publish the source then? This implementation of brightness control/blue light filters is a lot better than the current pull request already submitted to luma.
     
  14. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
    That was just "stolen" from me, but with colorramp.(c|h) included, lol

    ...seriously, just compare mine to this:
    - https://gist.github.com/SonoSooS/f39a50f4fd56d1c4df7f647622a76c8c#file-redshift-c-L100
    - https://github.com/AuroraWright/Lum...a24c#diff-36a23845aae97f06398e865add61646fR61

    Edit: lol, just noticed they finally added me into the credits
     
  15. Itzumi

    Itzumi homebrew does what nintendont

    Member
    4
    Jun 27, 2018
    United States
    USA
    Wait, what about Luma and this now? something about a plugin for luma?
     
  16. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
    Due to "popular" demand I posted a build with CTR_Redshift included in a very old Luma build (7.1 or 8.0, I can't check now), but it was so difficult to do (it never booted into the Home Menu due to the color table taking up too much size) that I'd rather not try to do it again.

    There is a pull request which I linked a post ago, but that doesn't let you finetune the values like my version can.
     
  17. Itzumi

    Itzumi homebrew does what nintendont

    Member
    4
    Jun 27, 2018
    United States
    USA
    Cant really try old luma builds anyway cause I did a dumb and now im on 11.8 lol
     
  18. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
  19. Nutez

    Nutez Advanced Member

    Newcomer
    4
    Jan 2, 2018
    United Kingdom
    The other side of paradise.
    So I've finally got my lazy ass around to trying to hack together an implementation of this for the new Luma. However, I'm having problems with coloramp.c:


    make[1]: Entering directory '/c/Nintendo3DS/Source/Luma3DS/sysmodules/rosalina'
    arm-none-eabi-gcc -Wall -Wextra -MMD -MP -marm -g -mcpu=mpcore -mfloat-abi=hard -mtp=soft -fno-builtin -std=c11 -O2 -ffast-math -mword-relocations -fomit-frame-pointer -ffunction-sections -fdata-sections -I/opt/devkitpro/libctru/include -Iinclude -DARM11 -D_3DS -c -o build/redshift/colorramp.o source/redshift/colorramp.c
    source/redshift/colorramp.c: In function 'RosalinaMenu_Redshift':
    source/redshift/colorramp.c:30:20: error: storage class specified for parameter 'blackbody_color'
    static const float blackbody_color[] = {
    ^~~~~~~~~~~~~~~
    source/redshift/colorramp.c:30:1: error: parameter 'blackbody_color' is initialized
    static const float blackbody_color[] = {
    ^~~~~~
    source/redshift/colorramp.c:31:2: error: incompatible types when initializing type 'const float *' using type 'double'
    1.00000000, 0.18172716, 0.00000000, /* 1000K */


    And


    source/redshift/colorramp.c:278:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    {
    ^
    source/redshift/colorramp.c:291:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    {
    ^
    source/redshift/colorramp.c:312:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    {
    ^
    source/redshift/colorramp.c:30:20: error: declaration for parameter 'blackbody_color' but no such parameter
    static const float blackbody_color[] = {
    ^~~~~~~~~~~~~~~
    source/redshift/colorramp.c:328: error: expected '{' at end of input


    I'm using pretty much the exact same coloramp.c from that old screen filter implementation (https://github.com/AuroraWright/Lum...a24c#diff-36a23845aae97f06398e865add61646fR61) and I have everything up-to-date for building Luma. Am I missing something obvious that will compile this properly or do I need to actually make type changes? You can probably tell that I'm very much a rookie so any advice would be appreciated, thanks!
     
  20. Sono
    OP

    Sono Modern slave

    Member
    13
    Oct 16, 2015
    Hungary
    Austro-Hungarian Monarchy
    I have absolutely no idea anymore how I did it, sorry. Try using my sources instead of someone else's, that might work better.
     
Quick Reply
Draft saved Draft deleted
Loading...