libn3ds icon indicating copy to clipboard operation
libn3ds copied to clipboard

About compatibility with libctru.

Open sn76496 opened this issue 5 months ago • 4 comments

Hello, I am very interested in libn3ds, to make a baremetal port of an app.

I am currently using libctru.

Is it possible to use both libraries at the same time?

sn76496 avatar Aug 06 '25 21:08 sn76496

To some degree yes, however a lot of functionality is missing or a bit different. For normal apps/games i would recommend staying with libctru. If you need to run code close to the metal then libn3ds is an option.

profi200 avatar Aug 08 '25 10:08 profi200

The app in question is rockbox. And originally, rockbox was intended to be used as a "firmware" replacement.

I did a quick review of the features implemented in libn3ds and the ones required by rockbox and I can say the only thing missing to do a preliminary firm port would be some audio pcm functions.

Basically some way to send an audio buffer to the hardware to play it.

sn76496 avatar Aug 08 '25 12:08 sn76496

There is audio. Not the DSP but good enough for basic PCM playback.

https://github.com/profi200/libn3ds/blob/master/include/arm11/drivers/csnd.h

profi200 avatar Aug 09 '25 13:08 profi200

Oh. Very interesting.

Rockbox implements it's own dsp functions so it should be enough with basic pcm playback.

Could you please post an example of pcm playback?

Mmm, ia there a way to know when I should feed more audio data for pcm streaming?

sn76496 avatar Aug 09 '25 21:08 sn76496