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,033
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,033
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,033
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,033
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,033
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
  • BakerMan @ BakerMan:
    i said i was sleeping...
  • BakerMan @ BakerMan:
    sleeping with uremum
  • K3Nv2 @ K3Nv2:
    Even my mum slept on that uremum
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
  • Karma177 @ Karma177:
    do y'all think having an sd card that has a write speed of 700kb/s is a bad idea?
    trying to restore emunand rn but it's taking ages... (also when I finished the first time hekate decided to delete all my fucking files :wacko:)
  • The Real Jdbye @ The Real Jdbye:
    @Karma177 that sd card is 100% faulty so yes, its a bad idea
  • The Real Jdbye @ The Real Jdbye:
    even the slowest non-sdhc sd cards are a few MB/s
  • Karma177 @ Karma177:
    @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really think it's faulty (pasted 40/50gb+ folders and no write errors)
  • DinohScene @ DinohScene:
    run h2testw on it
  • DinohScene @ DinohScene:
    when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying
    DinohScene @ DinohScene: when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying