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,035
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,035
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,035
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,035
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,035
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.
  • RedColoredStars @ RedColoredStars:
    Guy doesnt know wtf hes talking about half the time
  • realtimesave @ realtimesave:
    @SylverReZ that reminds me that my friend sells CRTs he gets cheap or free for hundreds of dollars. people are dumb
    +1
  • RedColoredStars @ RedColoredStars:
    And is incredibly annoying.
  • realtimesave @ realtimesave:
    man I just washed my shoes and they look exactly the same as before I washed them :|
  • realtimesave @ realtimesave:
    luckily they didn't fall apart
  • RedColoredStars @ RedColoredStars:
    Some CRTs are very much worth the price
  • RedColoredStars @ RedColoredStars:
    i used to go out to the recycling center every couple weeks and look at the crts and other electronics people would drop off. Usually screens were broken or severely scratched from being tossed around. Did find a good one here and there, but never anything like a 1080i widescreen crt.
  • RedColoredStars @ RedColoredStars:
    Or a good contition 40" Sony Trini that weighs 300 lbs. lol
  • RedColoredStars @ RedColoredStars:
    Literally 300 lbs. lolol
  • BigOnYa @ BigOnYa:
    I have a few of those boat anchors in my basement I tried giving away but no one wanted them, So anyone close to Columbus, Ohio area that wants them, (26", 2x 19") please come get, for free.
  • RedColoredStars @ RedColoredStars:
    Dont know anyone wants those smaller ones. Most are after larger sizes and the kinda top of the line models
  • RedColoredStars @ RedColoredStars:
    Motion handling and input lag on those things destroy plasmas, led, oled
  • realtimesave @ realtimesave:
    I had some really nice CRTs I should've kept
  • realtimesave @ realtimesave:
    now I have all lcd
  • realtimesave @ realtimesave:
    one in particular I regret getting rid of oh well :|
  • realtimesave @ realtimesave:
    the Sonys and stuff I don't care about
  • realtimesave @ realtimesave:
    and used LCD are hard to sell I can imagine.. not worth much
  • realtimesave @ realtimesave:
    @SylverReZ where do u lurk
  • a_username_that_isnt_cool @ a_username_that_isnt_cool:
    Is it piracy if it was released for free? Not in my opinion, but I also think it's not piracy if buying it isn't owning it, and it's not piracy if you can't buy it from the original creators anymore.
  • K3Nv2 @ K3Nv2:
    Free release can have loopholes where they still make money through ads
    +1
  • Xdqwerty @ Xdqwerty:
    sigh
  • Xdqwerty @ Xdqwerty:
    @a_username_that_isnt_cool, could you change your username?
  • Xdqwerty @ Xdqwerty:
    i guess not...
    Xdqwerty @ Xdqwerty: i guess not...