Homebrew Official [Release] GodMode9 - All Access File Browser for the 3DS

  • Thread starter d0k3
  • Start date
  • Views 305,401
  • Replies 1,143
  • Likes 105
D

Deleted User

Guest
would this be a better battery color and indicator or no?
Code:
void GenerateBatteryBitmap(u8* bitmap, u32 width, u32 height, u32 color_bg) {
    const u32 color_outline = COLOR_ORANGE;
    const u32 color_inline = COLOR_BLACK;
    const u32 color_inside = COLOR_GREY;
   
    if ((width < 8) || (height < 6)) return;
   
    u32 battery;
    bool is_charging;
    CheckBattery(&battery, &is_charging);
   
    u32 color_battery = (is_charging) ? COLOR_BLUE :
        (battery > 75) ? COLOR_GREEN : (battery > 50) ? COLOR_YELLOW : (battery > 25) ? COLOR_ORANGE : COLOR_RED;
 

windows_server_2003

Well-Known Member
Newcomer
Joined
Jul 13, 2017
Messages
84
Trophies
0
Age
44
XP
379
Country
Japan
but what would we use that for?
We can use it for touch keyboard. The linux-3ds's keyboard is useless (sorry but make many mistakes) but it uses only about 2/3 height of that of the bottom screens. The height of the bottom screens is almost same as 5-inches mobile phone. so a touch keyboard on 3ds will be not so useless and fast to input something.
 
D

Deleted User

Guest
We can use it for touch keyboard. The linux-3ds's keyboard is useless (sorry but make many mistakes) but it uses only about 2/3 height of that of the bottom screens. The height of the bottom screens is almost same as 5-inches mobile phone. so a touch keyboard on 3ds will be not so useless and fast to input something.
The linux 3ds keyboard isn't too bad if its a xl
But I would prefer the hexeditor edit function for text editing if it had insert&delete
 

SirNapkin1334

Renound Aritst
Member
Joined
Aug 20, 2017
Messages
1,665
Trophies
1
XP
975
Country
United States
Hey, I have a request for a script. Can someone please make a script that deletes all files on the SD card starting with ._ or . or ._. ? I would make it myself but I don't know the GM9 Language. Someone should make a guide.
 

windows_server_2003

Well-Known Member
Newcomer
Joined
Jul 13, 2017
Messages
84
Trophies
0
Age
44
XP
379
Country
Japan
Hey, I have a request for a script. Can someone please make a script that deletes all files on the SD card starting with ._ or . or ._. ? I would make it myself but I don't know the GM9 Language. Someone should make a guide.
Doing that completely with a script is not possible now. but you can do like this to remove all files starting with "._" from the root of SD cards.

find "0:/._*" $[delfile]
rm -o -s $[delfile]
find "0:/._*" $[delfile]
rm -o -s $[delfile]
... Loop ...

Here is a GodMode9 script collection thread. It's not a guide but may help you...
https://gbatemp.net/threads/release-godmode9-scripts-megathread.482150/

You can learn about GM9 script by looking HelloScript.gm9 in the release archive.

Edit :
Fix bad english
Fix wrong syntax in example script (sorry)
 
Last edited by windows_server_2003,

windows_server_2003

Well-Known Member
Newcomer
Joined
Jul 13, 2017
Messages
84
Trophies
0
Age
44
XP
379
Country
Japan
@d0k3
https://github.com/windows-server-2003/GodMode9/tree/if-goto
I don't make PR now, but question.
Are there any fundamental issues in this code ?
I think the only stuff can be an issue is using too much memoly and the firms' sizes increase too much.
About variable "lbl_his" :
1Byte(char) * (512(MAX_ARG_LEN for label name) + 1) * 256(maximum number of labels) = 128KB
Original firm size (branch "new_make") : 495KB
My branch's one (base branch "master") : 561KB

It can be solved by limitting the number of label's name length to 32 or 64.
I tested and I didn't find any bugs. even I coded, it was not so hard and you also could code and commit but you haven't. so there are some issues ?
 
Last edited by windows_server_2003,

Kazuma77

Well-Known Member
Member
Joined
May 11, 2008
Messages
1,035
Trophies
1
XP
889
Country
United States
Hey, I have a request for a script. Can someone please make a script that deletes all files on the SD card starting with ._ or . or ._. ? I would make it myself but I don't know the GM9 Language. Someone should make a guide.

I could do that easily if the "rm" command had a recurse function and supported wildcards. Maybe @d0k3 can add them, but I think he was avoiding wildcards for security reasons. If "find" had recurse, and we had "goto" I could have it do an endless "find" and "rm" loop that would delete them one by one and ultimately error out when it couldn't find any more files (windows_server_2003 kind of beat me to the punch with his suggestion). If he does add this functionality in the future, I would be more than happy to create such a clean-up script (and add it to my InScripted project, naturally). Maybe even make it an SSR for the extra apps menu.
 
  • Like
Reactions: SirNapkin1334

SirNapkin1334

Renound Aritst
Member
Joined
Aug 20, 2017
Messages
1,665
Trophies
1
XP
975
Country
United States
I could do that easily if the "rm" command had a recurse function and supported wildcards. Maybe @d0k3 can add them, but I think he was avoiding wildcards for security reasons. If "find" had recurse, and we had "goto" I could have it do an endless "find" and "rm" loop that would delete them one by one and ultimately error out when it couldn't find any more files (windows_server_2003 kind of beat me to the punch with his suggestion). If he does add this functionality in the future, I would be more than happy to create such a clean-up script (and add it to my InScripted project, naturally). Maybe even make it an SSR for the extra apps menu.
Well, I'll then be voting for @d0k3 to add them, maybe under an unlock combo or something.
 

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
@d0k3
https://github.com/windows-server-2003/GodMode9/tree/if-goto
I don't make PR now, but question.
Are there any fundamental issues in this code ?
I think the only stuff can be an issue is using too much memoly and the firms' sizes increase too much.
About variable "lbl_his" :
1Byte(char) * (512(MAX_ARG_LEN for label name) + 1) * 256(maximum number of labels) = 128KB
Original firm size (branch "new_make") : 495KB
My branch's one (base branch "master") : 561KB

It can be solved by limitting the number of label's name length to 32 or 64.
I tested and I didn't find any bugs. even I coded, it was not so hard and you also could code and commit but you haven't. so there are some issues ?
I had a quick look. Can you maybe clean up and squash the commit history a bit? Also, make sure to use spaces, not tabs. Mixed makes it badly readable.

Hint: Try this...
Code:
git rebase -i head~6
 
  • Like
Reactions: GilgameshArcher

Kazuma77

Well-Known Member
Member
Joined
May 11, 2008
Messages
1,035
Trophies
1
XP
889
Country
United States

[USER=124863]@Kazuma77

Want to test drive @windows_server_2003's addition and give me your opinion?[/USER]

Sure. I was planning to have a look at it anyway. If it hadn't been announced right when I was putting the finishing touches on a new release of my AIO, I'd have started playing with it sooner.

@windows_server_2003: Does the "goto" command automatically reset the "if" nest? I tried putting an "end" after a "label" to end the "if" after the jump but got an error. But that's good if it's clearing the "if" nest out automatically, because that's how I would want it to work anyway. Any chance you could possibly add a "choice" command while you're at it? You'll see why if you download the attachment (not that "filesel" does a terrible job).

I started off simple. I did the old "Pick A Number" game ;) I tried it first with non-nested "if" commands and "goto" commands to skip an unconditional loop I setup for people that hit the B button (it reloads the selection menu -- you WILL pick a number :evil: ). Then I made a second one using else statements. @d0k3: I know you weren't planning on doing the "else" command, but, even with this simple game, it is clearly more efficient than ending every "if" section with a "goto" command. I've uploaded it in case anyone wants to check it out. The win/lose phrases have a bit of a retro-gaming twist -- they're taken from Contra, Super Ghouls & Ghosts, and SMB (keep in mind I was half awake, they seemed funnier then than now).

I did notice one thing odd. I forgot to put quotes at the end of the echo line for 1 the first time, as I was rushing to get a test example typed up, but I still got the error when I picked 2 and 3. It seems kind-of strange that it would still process a line it's supposed to skip over. Still, nothing that seems like a deal-breaker so far.

EDIT: Since the "if" command is fairly similar to the existing "chk" command parameter-wise, I'd suggest including the -u flag for the same reasons it was included with the "chk" command.
 

Attachments

  • Pick A Number.7z
    201.2 KB · Views: 68
Last edited by Kazuma77,

windows_server_2003

Well-Known Member
Newcomer
Joined
Jul 13, 2017
Messages
84
Trophies
0
Age
44
XP
379
Country
Japan
Sure. I was planning to have a look at it anyway. If it hadn't been announced right when I was putting the finishing touches on a new release of my AIO, I'd have started playing with it sooner.

@windows_server_2003: Does the "goto" command automatically reset the "if" nest? I tried putting an "end" after a "label" to end the "if" after the jump but got an error. But that's good if it's clearing the "if" nest out automatically, because that's how I would want it to work anyway. Any chance you could possibly add a "choice" command while you're at it? You'll see why if you download the attachment (not that "filesel" does a terrible job).

I started off simple. I did the old "Pick A Number" game ;) I tried it first with non-nested "if" commands and "goto" commands to skip an unconditional loop I setup for people that hit the B button (it reloads the selection menu -- you WILL pick a number :evil: ). Then I made a second one using else statements. @d0k3: I know you weren't planning on doing the "else" command, but, even with this simple game, it is clearly more efficient than ending every "if" section with a "goto" command. I've uploaded it in case anyone wants to check it out. The win/lose phrases have a bit of a retro-gaming twist -- they're taken from Contra, Super Ghouls & Ghosts, and SMB (keep in mind I was half awake, they seemed funnier then than now).

I did notice one thing odd. I forgot to put quotes at the end of the echo line for 1 the first time, as I was rushing to get a test example typed up, but I still got the error when I picked 2 and 3. It seems kind-of strange that it would still process a line it's supposed to skip over. Still, nothing that seems like a deal-breaker so far.

EDIT: Since the "if" command is fairly similar to the existing "chk" command parameter-wise, I'd suggest including the -u flag for the same reasons it was included with the "chk" command.

Thank you for bug report.
For some reason, I can't build it by myself now so please try with latest commit and send me the build if you can. I used git on Android because of it.
There are at least two new commits since you built it(at commit "Fix using too many memory and clean up", the FIRM's size decreased more than 100KB and became 4xxKB)
 

zen

New Member
Newbie
Joined
May 2, 2017
Messages
3
Trophies
0
Age
27
XP
48
Country
United States
hey guys,im trying to unlink my nnid using godmode but it doesnt seem to work,every time i check the 10038 folder an extra new 00000 file is created on top of my renamed 10000 one ,im running 11.6 with b9s 1.2 for reference
 

Kazuma77

Well-Known Member
Member
Joined
May 11, 2008
Messages
1,035
Trophies
1
XP
889
Country
United States
hey guys,im trying to unlink my nnid using godmode but it doesnt seem to work,every time i check the 10038 folder an extra new 00000 file is created on top of my renamed 10000 one ,im running 11.6 with b9s 1.2 for reference

Then the file gets created automatically by the system software. There is nothing GM9 can do about that. The system WILL re-create system save files automatically. That's just natural behavior. The same thing happens if you delete your PTM save. A new one will be generated as soon as you boot CFW. That doesn't mean you failed to wipe your existing activity data. The system just created a new file to take the old one's place. The fact that it's creating a new NNID file does not mean that it is re-linking your NNID, it just needs something to be there. Just complete the rest of the steps for the guide you're using and you will probably see that it worked just fine.

Thank you for bug report.
For some reason, I can't build it by myself now so please try with latest commit and send me the build if you can. I used git on Android because of it.
There are at least two new commits since you built it(at commit "Fix using too many memory and clean up", the FIRM's size decreased more than 100KB and became 4xxKB)

Yeah, that definitely made it smaller. Especially with me still using "-flto" in my Makefile (it was only removed to avoid compiling issues on some platforms, after all -- since mine has never had any, and it especially makes compiled SSRs much smaller than a regular GM9 build, I always add that back in). I've not tried building with Android, so, hard to say what it could be. I'm using "Cmder" with Emerge Desktop Windows 7 (the distinction was necessary, given how much better 7 is without Explorer). It avoids the need to install Git for Windows, and the less mess I can have in my Windows registry, the better. Anyway, here's your requested build. I'll test it in a little bit.

EDIT: Looks like you broke the "else" command somehow. It's not working in the script that uses it. Apparently "skip" stays on until the "end" commands are reached. Also, you might want to just forget what I said about clearing the "if" nest with the "goto" command now that I see how these actually work (or at least, I think I do -- keep in mind I don't know any C at all). It will be cleared if I have the correct number of "end" commands anyway. I was thinking an "end" after a "goto" would be completely ignored, but now I see those lines are still being processed, just not acted upon if "skip" is set. The count is still being incremented and decremented even with "skip" on, so, I guess it's all good then.

EDIT2: I found it -- line 906. You forgot the "[0]" that you used in your other "findlabel" checks for the other commands. Basically, "else" wasn't executing because it always thought a label search was going on. Fixed.

EDIT3: I have uploaded the fix so that you can verify it works.

EDIT4: I see you fixed it. I've uploaded the new build with your latest commit.
 

Attachments

  • Godmode9-branching-nokeys-20171110-b.7z
    1.2 MB · Views: 79
Last edited by Kazuma77,

windows_server_2003

Well-Known Member
Newcomer
Joined
Jul 13, 2017
Messages
84
Trophies
0
Age
44
XP
379
Country
Japan
Sure. I was planning to have a look at it anyway. If it hadn't been announced right when I was putting the finishing touches on a new release of my AIO, I'd have started playing with it sooner.

@windows_server_2003: Does the "goto" command automatically reset the "if" nest? I tried putting an "end" after a "label" to end the "if" after the jump but got an error. But that's good if it's clearing the "if" nest out automatically, because that's how I would want it to work anyway. Any chance you could possibly add a "choice" command while you're at it? You'll see why if you download the attachment (not that "filesel" does a terrible job).

I started off simple. I did the old "Pick A Number" game ;) I tried it first with non-nested "if" commands and "goto" commands to skip an unconditional loop I setup for people that hit the B button (it reloads the selection menu -- you WILL pick a number :evil: ). Then I made a second one using else statements. @d0k3: I know you weren't planning on doing the "else" command, but, even with this simple game, it is clearly more efficient than ending every "if" section with a "goto" command. I've uploaded it in case anyone wants to check it out. The win/lose phrases have a bit of a retro-gaming twist -- they're taken from Contra, Super Ghouls & Ghosts, and SMB (keep in mind I was half awake, they seemed funnier then than now).

I did notice one thing odd. I forgot to put quotes at the end of the echo line for 1 the first time, as I was rushing to get a test example typed up, but I still got the error when I picked 2 and 3. It seems kind-of strange that it would still process a line it's supposed to skip over. Still, nothing that seems like a deal-breaker so far.

EDIT: Since the "if" command is fairly similar to the existing "chk" command parameter-wise, I'd suggest including the -u flag for the same reasons it was included with the "chk" command.
You got an unexpected error with that build and script ?
It works fine for me...
if not, please give me a script which shows an error.
Anyway, is it fixed in the latest commit?

-u flag...
We got "else" but it's nice to add "-u" flag optional. I'll add it.

"choice" command
How to pass the list to show to "choice" command ?
I know such selecting method isn't smart.
For now, I'm testing if,else,end,... and make sure there are no bugs there. so I can't add that now, sorry.
 

Kazuma77

Well-Known Member
Member
Joined
May 11, 2008
Messages
1,035
Trophies
1
XP
889
Country
United States
You got an unexpected error with that build and script ?
It works fine for me...
if not, please give me a script which shows an error.
Anyway, is it fixed in the latest commit?

-u flag...
We got "else" but it's nice to add "-u" flag optional. I'll add it.

"choice" command
How to pass the list to show to "choice" command ?
I know such selecting method isn't smart.
For now, I'm testing if,else,end,... and make sure there are no bugs there. so I can't add that now, sorry.

I think I just did not fully understand how the commands worked at the time. Everything seems fine with the current build.

My reason for suggesting including the -u flag was for cases where you only need to do something when there is not a match. Case in point, checking the SHA on the secret sector when restoring a system to retail. You would not need to do anything if the hash checks, but you would need to try to replace it if it does not match. So, I would be following the "if" command with an immediate "else" command.

I understand the "choice" command would be a difficult one to implement since the parameters would necessarily differ in number. Maybe it could get the list from a plain text file or something. I was just thinking it might be a bit cleaner than my current method -- using "filesel" with a folder containing zero byte files. It's OK though. I can place either in the VRAM image for most of my projects, so most people will never know the difference anyway.

EDIT: Maybe a more advanced example is in order to really test this thing properly now. Here's the "Multiple TWLN Manager" I just added to InScripted R9, but as a single compiled SSR app instead of multiple scripts. Just like the original, it will enable you to create as many TWLN backups as you want, so you can simply save and switch when you run out of space for DSiWare. NOTE: I have had this crash once. It gave the error message for the option I selected, rebooted, when I tried to get it to go into GM9 it said there was no essentials backup, and the system shut down whether I told it to create one or not. But after waiting about 15 seconds to reboot the system, it went back to normal. This bug doesn't appear to be anything that will brick a console, just a memory overload or something. Hopefully someone can replicate the issue and figure out why it does it. That said, it only crashed that one time. It's fairly stable. Check it out. As usual, I've included the source in case anyone wants to modify it.
 

Attachments

  • Multiple TWLN Manager.7z
    163.8 KB · Views: 61
Last edited by Kazuma77,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    LeoTCK @ LeoTCK: yes for nearly a month i was officially a wanted fugitive, until yesterday when it ended