Homebrew Homebrew Development

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
Userland homebrew entrypoints, for example Menuhax, browserhax, and the such, cannot brick your 3ds (aka destroy it). Most homebrew won't (and shouldn't) mess up your save data for games unless you use a save manager intentionally.

Messing with kernel and CFW stuff has a chance of hard-bricking, but i'm guessing you aren't very interested in that.
They can do both, if the creator intended to do that or if it messes with things it isn't supposed to mess with.
Edit: ignore this, the answer above is way better.

There's at least one way to brick from userland, but the people with the know-how would more than likely not write a malicious homebrew like that. In general though, yeah, typical homebrew from userland can't brick.
 
  • Like
Reactions: thatbooisaspy

Spaqin

Well-Known Member
Member
Joined
Feb 17, 2015
Messages
123
Trophies
0
Age
29
XP
199
Country
Poland
You can find a little dsp service sample here: https://github.com/CurryGuy/ndsp-example/blob/master/source/main.cpp

Anyway, that's the basic way on how to stream an audio. You can check another solution in my lua interpreter: https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/luaSound.cpp#L1069-L1148

What it does is simply to create two wavebuf and put them in a non-loop dsp playback. Then when one is finished to play, it clears the finished ones, append a new piece of the audiobuffer to be reproduced and then re-insert it in the dsp queue.

Silly question - do you free the buffers and ndspWavBuff somewhere? Are they freed by ndsp? I can see that you do when the playback is stopped, but during normal playback?
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
Silly question - do you free the buffers and ndspWavBuff somewhere? Are they freed by ndsp? I can see that you do when the playback is stopped, but during normal playback?
They are not freed by ndsp. That is up to you - you can either free them or reuse them.
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Silly question - do you free the buffers and ndspWavBuff somewhere? Are they freed by ndsp? I can see that you do when the playback is stopped, but during normal playback?

In reality my code is a bit shitty for how manages wavebufs cause they get purged only when sound is unloaded (so if you play a loop music, you'll have a constant increase of required memory).
Anyway they get purged here: https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/luaSound.cpp#L1766-L1804
 

Spaqin

Well-Known Member
Member
Joined
Feb 17, 2015
Messages
123
Trophies
0
Age
29
XP
199
Country
Poland
So, I tried.
I even copied the example (and modified it a little bit, so it won't load the file):
http://pastebin.com/bmCQtkqF

And still, after execution of this function, ndspChnIsPlaying(1) returns 0 and no sound comes on.
...does it even work with *hax 2.5?
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
So, I tried.
I even copied the example (and modified it a little bit, so it won't load the file):
http://pastebin.com/bmCQtkqF

And still, after execution of this function, ndspChnIsPlaying(1) returns 0 and no sound comes on.
...does it even work with *hax 2.5?

Try to check if all your functions are returning errors or not (expecially for ndspInit)
 
Last edited by Rinnegatamante,
D

Deleted User

Guest
I just got my first basic app running :) It spams the touch screen with the button you're pressing as well as the circle position.

With that being said. No one happens to know how I can go about just having the screen print text when the touch screen is being used do they? I've tried a few things but it almost always results in a matrix of text going down my screen lol

This is quite the fun journey
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
I just got my first basic app running :) It spams the touch screen with the button you're pressing as well as the circle position.

With that being said. No one happens to know how I can go about just having the screen print text when the touch screen is being used do they? I've tried a few things but it almost always results in a matrix of text going down my screen lol

This is quite the fun journey

Instead of using printf with a newline, you could just have it print to specific row and column coordinates.

https://github.com/devkitPro/3ds-examples/blob/master/input/read-controls/source/main.c#L41

This bit here:
Code:
[0;0H

That controls your row and column.
 
D

Deleted User

Guest

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
How would that affect the bottom screen text when I enter a specific key?

I appreciate the help but I figured that bit out :P If I worded my original question poorly please let me know

It wouldn't. It was a solution for your text spamming problem. :P

If you want to show text only when the touchscreen is being used, it'd be something like:

Code:
// Assuming you want a blank screen every frame, you can clear the console
consoleClear();
hidScanInput();

touchPosition touch;
//Read the touch screen coordinates
hidTouchRead(&touch);

// You can change these to whatever you want, or keep a second touchPosition which contains the old frame's touch data, so you can then easily see if the touchscreen was used at all
if(touch.px != 0 && touch.py != 0)
//Print the touch screen coordinates at specific rows/columns, this won't spam scroll downward
    printf("\x1b[2;0H%03d; %03d", touch.px, touch.py);
 
D

Deleted User

Guest
It wouldn't. It was a solution for your text spamming problem. :P

If you want to show text only when the touchscreen is being used, it'd be something like:

Code:
// Assuming you want a blank screen every frame, you can clear the console
consoleClear();
hidScanInput();

touchPosition touch;
//Read the touch screen coordinates
hidTouchRead(&touch);

// You can change these to whatever you want, or keep a second touchPosition which contains the old frame's touch data, so you can then easily see if the touchscreen was used at all
if(touch.px != 0 && touch.py != 0)
//Print the touch screen coordinates at specific rows/columns, this won't spam scroll downward
    printf("\x1b[2;0H%03d; %03d", touch.px, touch.py);
Ah :P

Ill look at the touch screen you mentioned thanks :)

I wish I learned this sooner this is so cool seeing something you made show up on screen and working
 

Spaqin

Well-Known Member
Member
Joined
Feb 17, 2015
Messages
123
Trophies
0
Age
29
XP
199
Country
Poland
Try to check if all your functions are returning errors or not (expecially for ndspInit)
Welp, ndspInit returns -662657030 and dsp_flushdatacache -656406537 (I guess because ndspInit fails). On both hbl and emuNAND as CIA.

I guess then it's not my fault? It's not like I should init something before that?
 
Last edited by Spaqin,

Spaqin

Well-Known Member
Member
Joined
Feb 17, 2015
Messages
123
Trophies
0
Age
29
XP
199
Country
Poland
Oh.
I updated the payload (I mean, launched from hbl cia, so it got a new one) and it worked.

Though shouldn't it work in a CIA too?
What do I have to do to extract the ndsp binary?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BigOnYa @ BigOnYa:
    Biomutant looks cool tho, may have to try that
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
    K3Nv2 @ K3Nv2: @BigOnYa...