Hacking Unofficial Luma build discussion

MarioKartFan

Well-Known Member
Member
Joined
Aug 27, 2019
Messages
569
Trophies
0
XP
2,013
Country
Algeria
@Nutez Hi! Would you consider adding an ability for the screen filters to be tied to a certain time range? For example I use the blue light filter at night. It would be great if it kicked in automatically after 9:00 PM? Would be great for those of us who try to sneak in a session before sleeping.
 
  • Like
Reactions: Nutez

Nutez

Assimilator of Lumas
OP
Member
Joined
Jan 2, 2018
Messages
165
Trophies
0
Location
The other side of paradise.
XP
1,646
Country
United Kingdom
New Update:
Widescreen Quick-Switcher

You can disable volume slider by setting min to FF and max to 00. I documented this behavior on 3dbrew as well (see regs 58h and 59h).
Thanks, I decided just to mute/disable when you enter the interface. Maybe not the best solution so I'm still open to improvement ideas.

@Nutez Hi! Would you consider adding an ability for the screen filters to be tied to a certain time range? For example I use the blue light filter at night. It would be great if it kicked in automatically after 9:00 PM? Would be great for those of us who try to sneak in a session before sleeping.
Cool idea. I would very much consider it, I'm just not sure how to actually deal with time on the 3DS... Anyone aware of any existing apps or PoCs that use a timer or time triggers?
 

EvilFear

Member
Newcomer
Joined
Jun 11, 2021
Messages
17
Trophies
0
Age
35
XP
46
Country
Canada
I was testing the software volume feature out again and the volume adjustment is actually maintained through sleep mode already (on o3DS and n3DS). So could you maybe explain in more detail if you are experiencing different behaviour? The only issue I noticed was that in order to set 0 volume you need to adjust the volume up first, then back down. I should probably fix that by having the starting volume the same as the current though.


oh boy.. I'm sorry I totally forgot to answer . _.!
 
  • Like
Reactions: Nutez

omniacet

New Member
Newbie
Joined
Jul 24, 2021
Messages
4
Trophies
0
Age
42
XP
24
Country
Russia
Hi @Nutez and @Sono ! I've got a strange no sound issue on my 2ds (11.14.0-46j) that I'm struggling with last few years. I saw the recent Luma3DS firmware release and decided to ask experts :)

Console mostly doesn't have sounds with the only exception of shutter sound in the camera app. First, I thought that volume slider is broken, but I've disassembled the console and volume slider looks ok, at least its resistance is changing when I move the slider. The headphones don't have sound at all, as shutter sound plays only from speakers.

I've tried Luma3DS firmware with software volume control on working 3ds, and it works there. This 2ds writes control values, nonetheless it has no sound :(

Now I think most likely reason of failure is the dead headphone port, if its dead while console perceives it as connected headphones, it might produce all of these symptoms.

I'd like to try adding headphones status output into rosalina, as far as I understand two ways are possible to check headphones status -
high-level 3dbrew.org -> DSP_Services has GetHeadphoneStatus with additional bonus of ForceHeadphonesOut (tbh, I'm not sure whether services could be accessed from arm9/used in rosalina)
low-level 3dbrew.org -> GPIO_Registers with two (registers and/or irq?) inserted/half inserted.

I couldn't find any documentation on how to write actual code to access ports (that's how services should be accessed, aren't they?) and gpio registers seem to be accessible only through services as well. What piece of documentation am I missing?:)
 
  • Like
Reactions: Nutez

Sono

cripple piss
Developer
Joined
Oct 16, 2015
Messages
2,514
Trophies
2
Location
rehabilitation center
XP
6,278
Country
Hungary

Did you try if headphone output works?

If it works, then yeah, the headphone out switch might be broken, and I do have a patch which I could reverse, so instead of forcing headphone-only output, I could force speaker-only output.

Although it has to be the headphone port, because the speaker amp clearly works if you get the shutter sound.

Are you on latest firmware (11.4 or above)? If yes, tell me new3DS or old3DS, and I'll dig up my patch, and reverse them so it forces output to speaker.

This could be easily incorporated into this fork (given UI space and @Nutez free time), but until we can't figure out how to patch processes from Rosalina, we can't implement it yet.

Also, ForceHeadphoneOut is bugged or broken, so a patch has to be used sadly.
 
  • Like
Reactions: Nutez

omniacet

New Member
Newbie
Joined
Jul 24, 2021
Messages
4
Trophies
0
Age
42
XP
24
Country
Russia
>Did you try if headphone output works?
What's strange is that it does not work at all, even with software volume control. Still, it's the only idea I still have :)

>Are you on latest firmware (11.4 or above)? If yes, tell me new3DS or old3DS, and I'll dig up my patch, and reverse them so it forces output to speaker.
That would be great! I'm on the latest firmware (11.14.0-46j), system is new2ds.

>This could be easily incorporated into this fork (given UI space and @Nutez free time), but until we can't figure out how to patch processes from Rosalina, we can't implement it yet.
Is it a dsp process binary patch? It might be easier to apply it in the loader submodule:
github (sorry can't post actual links yet) /DullPointer/Luma3DS/blob/master/sysmodules/loader/source/patcher.c
On line 846 there is a code that searches for a string inside a dsp process and replaces it with other string, is it what you were talking about?

>Also, ForceHeadphoneOut is bugged or broken, so a patch has to be used sadly.
I wonder what is being used in the camera app, I tried to launch it in Citra to capture IPC messages, but app crashes before I can make a photo. Also tried to disassemble it in Ghidra, that didn't help much without any symbol tables.
 
  • Like
Reactions: Nutez

Sono

cripple piss
Developer
Joined
Oct 16, 2015
Messages
2,514
Trophies
2
Location
rehabilitation center
XP
6,278
Country
Hungary
>Did you try if headphone output works?
What's strange is that it does not work at all, even with software volume control. Still, it's the only idea I still have :)

>Are you on latest firmware (11.4 or above)? If yes, tell me new3DS or old3DS, and I'll dig up my patch, and reverse them so it forces output to speaker.
That would be great! I'm on the latest firmware (11.14.0-46j), system is new2ds.

>This could be easily incorporated into this fork (given UI space and @Nutez free time), but until we can't figure out how to patch processes from Rosalina, we can't implement it yet.
Is it a dsp process binary patch? It might be easier to apply it in the loader submodule:
github (sorry can't post actual links yet) /DullPointer/Luma3DS/blob/master/sysmodules/loader/source/patcher.c
On line 846 there is a code that searches for a string inside a dsp process and replaces it with other string, is it what you were talking about?

>Also, ForceHeadphoneOut is bugged or broken, so a patch has to be used sadly.
I wonder what is being used in the camera app, I tried to launch it in Citra to capture IPC messages, but app crashes before I can make a photo. Also tried to disassemble it in Ghidra, that didn't help much without any symbol tables.

It's weird that neither headphone nor speaker works. In that case my patch might not do anything, or the headphone connector is just extremely broken.

I'll be making an IPS patch which you'll have to put into a very specific folder on your SD.
That'll be probably in a few days though, as currently I'm unable to do anything, even though it would take at most ~5mins to edit my already existing patch.

I don't remember exactly, but I think the camera shutter completely bypasses the standard sound mixing, and is mixed directly into the speaker output I2S line, and that's why it's always so loud at max volume.
I may be completely wrong though, but that's what I remember from a few years ago.
 
  • Like
Reactions: Nutez

Nutez

Assimilator of Lumas
OP
Member
Joined
Jan 2, 2018
Messages
165
Trophies
0
Location
The other side of paradise.
XP
1,646
Country
United Kingdom
Hi @Nutez and @Sono ! I've got a strange no sound issue on my 2ds (11.14.0-46j) that I'm struggling with last few years. I saw the recent Luma3DS firmware release and decided to ask experts :)
Thanks, but I'm not sure there is much I can add to this discussion :lol:. Sono is definitely your man for all things hardware. I'm happy to do any test builds if we do have ideas for patching via Rosalina though.

This could be easily incorporated into this fork (given UI space and @Nutez free time), but until we can't figure out how to patch processes from Rosalina, we can't implement it yet.
I'll be making an IPS patch which you'll have to put into a very specific folder on your SD.
That'll be probably in a few days though, as currently I'm unable to do anything, even though it would take at most ~5mins to edit my already existing patch.
I guess it also depends on how configurable the solution needs to be. If it's an "always on" type of thing with no need for on-the-fly adjustments then your IPS patch might already be the best choice? Though it would still be useful for experimenting with patching processes via Rosalina.
 

Sono

cripple piss
Developer
Joined
Oct 16, 2015
Messages
2,514
Trophies
2
Location
rehabilitation center
XP
6,278
Country
Hungary
I guess it also depends on how configurable the solution needs to be. If it's an "always on" type of thing with no need for on-the-fly adjustments then your IPS patch might already be the best choice? Though it would still be useful for experimenting with patching processes via Rosalina.

Sadly it's difficult to adjust on the fly without having a mechanism to "unpatch" the process first. Slightly different patch has to be patched at an entirely different place due to how the code is made by Nintendo.

Also not really, because IPS patches only work on a certain system version only, and we'd want to support muiltiple modes on both old3DS and new3DS.
 
  • Like
Reactions: Nutez

omniacet

New Member
Newbie
Joined
Jul 24, 2021
Messages
4
Trophies
0
Age
42
XP
24
Country
Russia
I'll be making an IPS patch which you'll have to put into a very specific folder on your SD.
That'll be probably in a few days though, as currently I'm unable to do anything, even though it would take at most ~5mins to edit my already existing patch.
Thank you!

I don't remember exactly, but I think the camera shutter completely bypasses the standard sound mixing, and is mixed directly into the speaker output I2S line, and that's why it's always so loud at max volume.
I may be completely wrong though, but that's what I remember from a few years ago.
Hm, so DSP and the MCU are both connected to audio line?

Thanks, but I'm not sure there is much I can add to this discussion :lol:. Sono is definitely your man for all things hardware. I'm happy to do any test builds if we do have ideas for patching via Rosalina though.
I guess it also depends on how configurable the solution needs to be. If it's an "always on" type of thing with no need for on-the-fly adjustments then your IPS patch might already be the best choice? Though it would still be useful for experimenting with patching processes via Rosalina.
As for me, even zero configurability at max volume will be infinitely better than no sound at all :D
 
  • Like
Reactions: Nutez

Ryu_Okami

Member
Newcomer
Joined
Apr 19, 2021
Messages
19
Trophies
0
Age
26
XP
59
Country
United States
Just an idea, would it be possible to have a sort of "sleep mode controller"?

The idea is that you could disable sleep mode altogether or force it to enter sleep mode while the console is open.

(Being able to disable it would likely be the more useful of the two; however I am curious if there would be a way to tell the system to exit sleepmode if the buttons are disabled...)
 
Last edited by Ryu_Okami,

BETA215

Unknown Member
Member
Joined
Dec 30, 2014
Messages
256
Trophies
0
Location
they/them | 0xDEAD brain
XP
890
Country
Argentina
Just an idea, would it be possible to have a sort of "sleep mode controller"?

The idea is that you could disable sleep mode altogether or force it to enter sleep mode while the console is open.

(Being able to disable it would likely be the more useful of the two; however I am curious if there would be a way to tell the system to exit sleepmode if the buttons are disabled...)
Yeah, I love that on the 2DS. Putting foldable consoles in sleep mode without closing them would be cool, I think it'll put less stress on the hardware and make it last longer.
 

MarioKartFan

Well-Known Member
Member
Joined
Aug 27, 2019
Messages
569
Trophies
0
XP
2,013
Country
Algeria
I’m also interested in whether there is a “true sleep” opportunity. Right now if I put it to sleep while WiFi is enabled my battery is dead within a day. If I disable WiFi before putting it to sleep my battery is alive for another two or three days.
 

jeffyTheHomebrewer

Neato Burrito!
Member
Joined
Aug 24, 2018
Messages
959
Trophies
1
Location
his house!
Website
jeffy25.wixsite.com
XP
1,517
Country
United States
Just an idea, would it be possible to have a sort of "sleep mode controller"?

The idea is that you could disable sleep mode altogether or force it to enter sleep mode while the console is open.

(Being able to disable it would likely be the more useful of the two; however I am curious if there would be a way to tell the system to exit sleepmode if the buttons are disabled...)
The way sleep mode is turned on/off is by using a magnet switch somewhere around the ABXY buttons. When you close your 3DS, the speaker gets close enough to the magnetic switch and activates it, turning on sleep mode.
 
  • Like
Reactions: Nutez

Sono

cripple piss
Developer
Joined
Oct 16, 2015
Messages
2,514
Trophies
2
Location
rehabilitation center
XP
6,278
Country
Hungary

I don't think that would be possible to integrate it into this fork, considering that it's handled by the mcu sysmodule.

Although it might be possible to do the same thing as what legacy mode software does (the whole DS(i)/GBA mode software stack), and set some buttons to wake the system up by using the exact same mechanism as the mcu sysmodule.

Pretty sure it would be a lot of work to do despite being easy to implement in just a few minutes, purely just because you'd have to do a LOT of state bookkeeping and having to listen to system notifications, and act accordingly.
Sending wrong notifications will hang the system, so that's why it's so phinicky.


As for disabling sleep mode, and/or disabling WiFi, don't even think about it. Unless we want to drive poor @Nutez to insanity, implementing it would be very annoying without breaking the currently running game, or the currently running game breaking our state management.
 

Nutez

Assimilator of Lumas
OP
Member
Joined
Jan 2, 2018
Messages
165
Trophies
0
Location
The other side of paradise.
XP
1,646
Country
United Kingdom
I’m also interested in whether there is a “true sleep” opportunity. Right now if I put it to sleep while WiFi is enabled my battery is dead within a day. If I disable WiFi before putting it to sleep my battery is alive for another two or three days.
I don't think that would be possible to integrate it into this fork, considering that it's handled by the mcu sysmodule.

Although it might be possible to do the same thing as what legacy mode software does (the whole DS(i)/GBA mode software stack), and set some buttons to wake the system up by using the exact same mechanism as the mcu sysmodule.

Pretty sure it would be a lot of work to do despite being easy to implement in just a few minutes, purely just because you'd have to do a LOT of state bookkeeping and having to listen to system notifications, and act accordingly.
Sending wrong notifications will hang the system, so that's why it's so phinicky.


As for disabling sleep mode, and/or disabling WiFi, don't even think about it. Unless we want to drive poor @Nutez to insanity, implementing it would be very annoying without breaking the currently running game, or the currently running game breaking our state management.
It does actually seem to possible to cut the Wifi before sleep mode, because Luma already looks for shell open/close notifications. I added this in for PoC:
Code:
u8 wireless = (*(vu8 *)((0x10140000 | (1u << 31)) + 0x180));

        if (isServiceUsable("nwm::EXT") && wireless)
        {
            nwmExtInit();
            NWMEXT_ControlWirelessEnabled(false);
            nwmExtExit();
        }
I've tested it on o3DS, but I don't believe it would work on o2DS since there are no shell notifications? I'm also not sure if there are actually good reasons for other people to want to keep the Wifi on in sleep mode. Can you continue downloads while in sleep mode? Or is it just Spot Pass that uses the Wifi? I'm a bit hesitant to add a feature that could have a negative impact on some users. This might be the feature that forces me to deal with the Luma config file, which I am not sure I have the will or time to try right now :P .
 

jeffyTheHomebrewer

Neato Burrito!
Member
Joined
Aug 24, 2018
Messages
959
Trophies
1
Location
his house!
Website
jeffy25.wixsite.com
XP
1,517
Country
United States
It does actually seem to possible to cut the Wifi before sleep mode, because Luma already looks for shell open/close notifications. I added this in for PoC:
Code:
u8 wireless = (*(vu8 *)((0x10140000 | (1u << 31)) + 0x180));

        if (isServiceUsable("nwm::EXT") && wireless)
        {
            nwmExtInit();
            NWMEXT_ControlWirelessEnabled(false);
            nwmExtExit();
        }
I've tested it on o3DS, but I don't believe it would work on o2DS since there are no shell notifications? I'm also not sure if there are actually good reasons for other people to want to keep the Wifi on in sleep mode. Can you continue downloads while in sleep mode? Or is it just Spot Pass that uses the Wifi? I'm a bit hesitant to add a feature that could have a negative impact on some users. This might be the feature that forces me to deal with the Luma config file, which I am not sure I have the will or time to try right now :P .
You can continue eshop downloads in sleep mode. the wifi is also used for spotpass (downloading new notes in swapdoodle for example) and streetpass (kinda obvious what that's for)

To download software via sleep mode, select the "download later option while/before downloading
 
Last edited by jeffyTheHomebrewer,
  • Like
Reactions: Nutez

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,013
Trophies
1
Age
34
XP
4,370
Country
United States
It does actually seem to possible to cut the Wifi before sleep mode, because Luma already looks for shell open/close notifications. I added this in for PoC:
Code:
u8 wireless = (*(vu8 *)((0x10140000 | (1u << 31)) + 0x180));

        if (isServiceUsable("nwm::EXT") && wireless)
        {
            nwmExtInit();
            NWMEXT_ControlWirelessEnabled(false);
            nwmExtExit();
        }
I've tested it on o3DS, but I don't believe it would work on o2DS since there are no shell notifications? I'm also not sure if there are actually good reasons for other people to want to keep the Wifi on in sleep mode. Can you continue downloads while in sleep mode? Or is it just Spot Pass that uses the Wifi? I'm a bit hesitant to add a feature that could have a negative impact on some users. This might be the feature that forces me to deal with the Luma config file, which I am not sure I have the will or time to try right now :P .
Yes, sleep mode is the only way to activate streetpass. Having this be an always on thing would make streetpass completely unusable, so it would need to be toggle-able.

On a separate note, would you consider integrating the pending pull requests for Luma related to the cheat engine? Right now there's still a lot of broken cheat functionality and I've grown tired of waiting for the requests to be merged (unless their fixes were already implemented and the pull never closed).

Lastly, is there a list of other home menu mods like the battery colors one? They seem very hard to find among the results of custom themes, badges and such that many refer to as "mods".
 
  • Like
Reactions: jeffyTheHomebrewer

Nutez

Assimilator of Lumas
OP
Member
Joined
Jan 2, 2018
Messages
165
Trophies
0
Location
The other side of paradise.
XP
1,646
Country
United Kingdom
Yes, sleep mode is the only way to activate streetpass. Having this be an always on thing would make streetpass completely unusable, so it would need to be toggle-able.
Fair enough, I'll just leave that potential feature out for now then. However, I'll add in a quick Wifi toggle by pressing START in menus as a consolation prize.
On a separate note, would you consider integrating the pending pull requests for Luma related to the cheat engine? Right now there's still a lot of broken cheat functionality and I've grown tired of waiting for the requests to be merged (unless their fixes were already implemented and the pull never closed).
I accidentally overlooked that cheats engine pull request so good suggestion. I'll merge it in for the next release.
Lastly, is there a list of other home menu mods like the battery colors one? They seem very hard to find among the results of custom themes, badges and such that many refer to as "mods".
Unfortunately, I don't know of any other home menu mod files that have been shared. Probably because people were advised to DIY to avoid potential soft-bricks from the old CIA rebuild process. I plan to share some creations when I get the time to experiment with customisation again. For example, replacing or colour editing the loading splash looks interesting. For now though, maybe you could trawl through some of the old tutorial threads for uploaded files? At least there are a lot of creative examples in there to draw inspiration from.
Side note: I'm sure quite a few people would be interested in simple mods like removing the big connection bar, so if anyone wants to practice editing please feel free to share :) .

Edit: I made a few versions for changes to the hud and an alternate, red internet icon. Note that the default hud view will still be seen in System Settings app.
 

Attachments

  • MinorHomeMenuEdits.zip
    154.7 KB · Views: 68
Last edited by Nutez,
  • Like
Reactions: MarioKartFan
General chit-chat
Help Users
  • No one is chatting at the moment.
    KenniesNewName @ KenniesNewName: Need a psu and Wii mote those still run $20