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,033
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.
    ZeroT21 @ ZeroT21: :lol: