Homebrew Homebrew Development

NicknameGoesHere

RIP my sanity: 2018-2018
Member
Joined
Jul 11, 2017
Messages
243
Trophies
0
XP
230
Country
United States
There is the obvious reason - you don’t have one. Or it could be something simple like your makefile does not see your source file where main is defined. Or perhaps you do not have the signature for main specified correctly.
Ok, I do have the main function, and the program compiled just fine, before trying to add pp2d.
 

NicknameGoesHere

RIP my sanity: 2018-2018
Member
Joined
Jul 11, 2017
Messages
243
Trophies
0
XP
230
Country
United States
I think this can also happen if you are using an old makefile and specify the wrong float model.
On a separate note - did you trying cleaning the project first?
Yes, I did, but it didn't work.
What do you mean by old makefile?

--------------------- MERGED ---------------------------

ok, looks like i just spelled source wrong in the makefile :wacko:

--------------------- MERGED ---------------------------

Yes, I did, but it didn't work.
What do you mean by old makefile?

--------------------- MERGED ---------------------------

ok, looks like i just spelled source wrong in the makefile :wacko:
Now it can't seem to find citro3d, even though it is installed correctly.
 
Last edited by NicknameGoesHere,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
Yes, I did, but it didn't work.
What do you mean by old makefile?

--------------------- MERGED ---------------------------

ok, looks like i just spelled source wrong in the makefile :wacko:

--------------------- MERGED ---------------------------


Now it can't seem to find citro3d, even though it is installed correctly.
You either don’t have citro3d installed correctly or you didn’t add it correctly to your library reference in the makefile. Hard to tell with no specifics.
 

NicknameGoesHere

RIP my sanity: 2018-2018
Member
Joined
Jul 11, 2017
Messages
243
Trophies
0
XP
230
Country
United States
You either don’t have citro3d installed correctly or you didn’t add it correctly to your library reference in the makefile. Hard to tell with no specifics.
The citro3d files appear in the libctru folder in the Devkitpro folder, so I don't see where the problem is.
Also, it gives me errors saying "undefined reference to" And then a citro3d command
 
Last edited by NicknameGoesHere,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
The citro3d files appear in the libctru folder in the Devkitpro folder, so I don't see where the problem is.
Also, it gives me errors saying "undefined reference to" And then a citro3d command
Is pp2d compiled as a library? If so make sure that appears before citro3d in your library list as it depends on citro3d.
It could also be that pp2d relies on an older or a newer version of citro3d. It is hard to help in a meaningful way when you do not include error messages.
 

NicknameGoesHere

RIP my sanity: 2018-2018
Member
Joined
Jul 11, 2017
Messages
243
Trophies
0
XP
230
Country
United States
Is pp2d compiled as a library? If so make sure that appears before citro3d in your library list as it depends on citro3d.
It could also be that pp2d relies on an older or a newer version of citro3d. It is hard to help in a meaningful way when you do not include error messages.
Sorry, I was away from my computer, I couldn't give an error at that time. But now, it works just fine, with no changes for some reason...
 
Last edited by NicknameGoesHere,

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
How do I add SFX to my game? I'm not a very advanced coder so if I ask what certain things are or mean bear with me. I tried using some of the code from Smealums Portal3DS but it seems to be outdated for the current ctrulib and I can't figure it out for some reason.
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
How do I add SFX to my game? I'm not a very advanced coder so if I ask what certain things are or mean bear with me. I tried using some of the code from Smealums Portal3DS but it seems to be outdated for the current ctrulib and I can't figure it out for some reason.
Use the examples that are installed in the devkitpro directory. The 3ds audio examples should be enough to get you started.
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
The examples just play flat tones. I want to be able to use my own wav/mp3 files.
The examples show how to use the 3ds hardware to play audio samples and the streaming example shows how to continuously fill an audio buffer in discreet chunks. For mp3 decoding you will need a library to do the decode - there is one in portlibs. Or you could just search for ctrmus.
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
The examples show how to use the 3ds hardware to play audio samples and the streaming example shows how to continuously fill an audio buffer in discreet chunks. For mp3 decoding you will need a library to do the decode - there is one in portlibs. Or you could just search for ctrmus.
Okay so it looks like an audio buffer is like a keyboard buffer, in the sense that the instructions are fed to it, and it reads them when it's ready, so it can have a lot in the buffer, or nothing in the buffer. And a chunk is just a block of data. I still don't understand what's going on in the streaming example, there's a lot going on. Do at least have any way to section it out or a way for me to find out what each thing does in the code?

EDIT:
So this is on line 77:
fill_buffer(audioBuffer,stream_offset, SAMPLESPERBUF * 2, notefreq[note]);
I'm going to assume I need to replace notefreq with something to play a wav file correct?
If so, how would I do that?
 
Last edited by Magicrafter13,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,030
Country
United States
Okay so it looks like an audio buffer is like a keyboard buffer, in the sense that the instructions are fed to it, and it reads them when it's ready, so it can have a lot in the buffer, or nothing in the buffer. And a chunk is just a block of data. I still don't understand what's going on in the streaming example, there's a lot going on. Do at least have any way to section it out or a way for me to find out what each thing does in the code?

EDIT:
So this is on line 77:
fill_buffer(audioBuffer,stream_offset, SAMPLESPERBUF * 2, notefreq[note]);
I'm going to assume I need to replace notefreq with something to play a wav file correct?
If so, how would I do that?
You are getting closer - you need to build a replacement function for fill_buffer that will load wav samples from a wav file to fill the audioBuffer. And before you do that you need to parse the wav file to read the audio format (rate, channels, sample size) and find the start of the sample data and the number of samples.
There are probably a lot of example for how to do this if you search for it. You could even search for the example I already told you about :)
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
You are getting closer - you need to build a replacement function for fill_buffer that will load wav samples from a wav file to fill the audioBuffer. And before you do that you need to parse the wav file to read the audio format (rate, channels, sample size) and find the start of the sample data and the number of samples.
There are probably a lot of example for how to do this if you search for it. You could even search for the example I already told you about :)
So a while after I posted that I looked into someone else's code (OpenSyobon3DS) for how they handled audio (they technically got the code from Smealums Portal3DS, the difference being that theirs actually worked as I imagine Smealum hasn't worked on that in a while), which I had previously been looking at but to no avail. But after messing around for a while and really just putting a bunch of debug code everywhere to see what was and wasn't happening I did get it to work.
So although in the end I didn't use your suggestion, I still thank you for your help and hope I didn't waste any valuable time ;p .
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Sonic Angel Knight @ Sonic Angel Knight: :ninja: