Homebrew Homebrew Development

MRJPGames

Pretty great guy
Member
Joined
Aug 17, 2013
Messages
1,199
Trophies
1
Location
The Netherlands
Website
fizazy.com
XP
1,674
Country
Netherlands
any way to play brstm/bcstm files other than vgmstream? vgmstream plays them but the playback has horrible quality for some reason
Wrong place, but as far as I know there is no other way on PC to play these files. Strange though that vgmstream doesn't give good quality audio for you. A while back I was also playing with these files (from one of the Professor Layton games for 3DS) and the audio quality was the same as on 3DS (though it sounded better with proper PC speakers).
 

erman1337

Well-Known Member
Member
Joined
Sep 27, 2015
Messages
1,211
Trophies
0
Location
Brussels
XP
983
Country
Belgium
Wrong place, but as far as I know there is no other way on PC to play these files. Strange though that vgmstream doesn't give good quality audio for you. A while back I was also playing with these files (from one of the Professor Layton games for 3DS) and the audio quality was the same as on 3DS (though it sounded better with proper PC speakers).
no i meant playing bcstms on my homebrew
 

MRJPGames

Pretty great guy
Member
Joined
Aug 17, 2013
Messages
1,199
Trophies
1
Location
The Netherlands
Website
fizazy.com
XP
1,674
Country
Netherlands
no i meant playing bcstms on my homebrew
Ah, didn't even know there was a vgmstream for 3DS, just looked it up, pretty cool. But then I don't know. Currently I just use WAVs for my audio, and that seems to be the most common way. You could do that (though it does use quite a bit of memory for longer clips).

Also vgmstream seems to also have mpeg support and such, which might be worth a try, and is also easier to work with on PC that bcstms. But looking at the code I don't see any reason why bcstm wouldn't sound good or why mpeg would work better, but personally I would just prefer working with mpeg files. Or is there some reason you want to use bcstm files?
 

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
I'm not sure how to handle text rendering using a VBO...
I would like to be able to draw text on both screens but it only works properly on one.

pseudocode:
Code:
void RenderMainScreen( void ) {
   SetRenderTarget( main );

   AddText( 0, 0, "okay" );
   CallList( OurVBO );
}

void RenderSubScreen( void ) {
   SetRenderTarget( sub );

   AddText( 20, 20, "lol" );
   CallList( OurVBO );
}

The 3DS doesn't like this and both screens end up with weird text, or maybe just the upper one I don't remember since I tried 2 days ago.
What is the proper way to handle having different text on each screen?

Text/Font code starts here: https://github.com/TaraHoleInIt/minivmac-3ds/blob/master/src/3DSGLU.c#L519
 
  • Like
Reactions: YugamiSekai

catlover007

Developer
Developer
Joined
Oct 23, 2015
Messages
715
Trophies
1
XP
3,865
Country
Germany
I'm not sure how to handle text rendering using a VBO...
I would like to be able to draw text on both screens but it only works properly on one.

pseudocode:
void RenderMainScreen( void ) {
SetRenderTarget( main );

AddText( 0, 0, "okay" );
CallList( OurVBO );
}

void RenderSubScreen( void ) {
SetRenderTarget( sub );

AddText( 20, 20, "lol" );
CallList( OurVBO );
}
The 3DS doesn't like this and both screens end up with weird text, or maybe just the upper one I don't remember since I tried 2 days ago.
What is the proper way to handle having different text on each screen?

Text/Font code starts here: https://github.com/TaraHoleInIt/minivmac-3ds/blob/master/src/3DSGLU.c#L519
I think you'r problem is that GPUs work asynchronous.
You just give it a command list and the GPU process it. So if you give it a command that it should render VBO x then later change the content of VBO x and say it should render it again, then you might render either the last or a mix of both contents of the VBO. Because the GPU starts renderering after you gave it the commands(so after the C3D_FrameEnd call).
 
Last edited by catlover007,

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
That's what I figured, what is the best way to go about having different text on both screens?
I looked into having 2 vertex buffers but didn't see how you would tell the GPU to use a different one.
 

catlover007

Developer
Developer
Joined
Oct 23, 2015
Messages
715
Trophies
1
XP
3,865
Country
Germany
That's what I figured, what is the best way to go about having different text on both screens?
I looked into having 2 vertex buffers but didn't see how you would tell the GPU to use a different one.
well, the simplest thing would imagine, would be to not restart the vertex counter when drawing on the second screen and inserting the amount of vertices drawn on the other screen as an offset(the second parameter) in C3D_DrawArrays.
 
  • Like
Reactions: TarableCode

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
Is there a hard limit on the number of vertices?
I'm not much for 3D lol, I did the first few NeHe tutorials like 10 years ago and only somehow bumbled my way into having what I have now.
 

catlover007

Developer
Developer
Joined
Oct 23, 2015
Messages
715
Trophies
1
XP
3,865
Country
Germany
Is there a hard limit on the number of vertices?
I'm not much for 3D lol, I did the first few NeHe tutorials like 10 years ago and only somehow bumbled my way into having what I have now.
As far as I know, there isn't a hard limit(like on the DS where it's 2048 verts) by definition. There is probably a hard limit(somewhere in the hardware or software), but I think before you get even close to it, your game will run at such a rubbish performance, that "scratching" it, isn't something you want to do.
 
  • Like
Reactions: TarableCode

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
I was just trying to think of a worst case scenario where both screens are filled with text.
8x16 Font where each glyph requires 6 vertices plus 6 for the background color, most likely won't overflow the buffer but sometimes I worry.
 

catlover007

Developer
Developer
Joined
Oct 23, 2015
Messages
715
Trophies
1
XP
3,865
Country
Germany
I was just trying to think of a worst case scenario where both screens are filled with text.
8x16 Font where each glyph requires 6 vertices plus 6 for the background color, most likely won't overflow the buffer but sometimes I worry.
Let's do some math:
If the whole top screen is filled with characters, there will to be 9000 verts drawn((400/8)*(240/16)*(6+6)).
9000 vertices are possible on the 3DS. E.g. a Pokemon model in X, Y, S and M has about 3000 vertices and in a tripple battle six Pokemon are drawn(although the performance isn't too great) + there are shaded and animated.

I don't think you will have serious performance trouble. And if you have performance trouble you can still try funky stuff like, geometry shaders etc.
I saw in your source code that you already use a single quad, if when drawing background colored string(which cuts the amount of vertices in half).
But one thing I have noticed in your code, is that you're using absolutely ineffecient vertex structures for 2d drawing. I don't think a full four byte float is needed to store each color component. Instead use unsigned bytes and multiply the color values in the shader by the reciproke of 255. And for the position, shorts should suit your need (aslong you stick to round pixel coordinates), multiply them by the reciproke of 2^15. For the UV coordinates shorts should be sufficient too. And don't forget, the size of the vertex input format has to be a multiple of four. These optimizations should reduce your vertex buffer size, which allows you to allocate larger buffers.
 
Last edited by catlover007,
  • Like
Reactions: TarableCode

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
Thanks :)
I just started getting this going and after a bit of fiddling it looks good so far. (started with colour for now)
 

catlover007

Developer
Developer
Joined
Oct 23, 2015
Messages
715
Trophies
1
XP
3,865
Country
Germany
That's what I figured, what is the best way to go about having different text on both screens?
I looked into having 2 vertex buffers but didn't see how you would tell the GPU to use a different one.
It's easy, you have all the code already(https://github.com/TaraHoleInIt/minivmac-3ds/blob/master/src/3DSGLU.c#L722)
You simply need multiple C3D_BufInfo objects(it doesn't matter where you store it, a global variable or the stack is perfectly fine). Then simply switch the buffer using C3D_SetBufInfo(bufPtr)
You can also change the current buffer between your draw calls:
Code:
C3D_BufInfo* buf = C3D_GetBufInfo();
BufInfo_Init(buf);
BufInfo_Add(your data);
C3D_DrawArrays(...);
C3D_GetBufInfo(); // needs to be called once more so that C3d knows that that the buffer content was changed
BufInfo_Init(buf);
BufInfo_Add(your data);
C3D_DrawArrays(...);
 
  • Like
Reactions: TarableCode

Gizametalman

Banned!
Banned
Joined
Dec 18, 2015
Messages
974
Trophies
0
Age
30
Location
D.F. - Zona Cero.
XP
730
Country
Mexico
QUESTION:
Are the tools provided in their latest version/build?

About 3 months ago, I decided to give it a try to some NDS related libraries, and non of them worked on my laptop. So, of course gave up on those...
 

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
Hello everybody.
I've a really weird problem that I hope someone can help me fix. (And explain because I still don't get why it's crashing..)

This is the method that is crashing. I've ommited here method declaration since is not related at all:
Code:
    ReadJson rj; //ReadJson is an struct
    for(u32 i = 0; i < json->u.object.length; i++) {

        char* name = val->u.object.values[i].name;
        u32 nameLen = val->u.object.values[i].name_length;
        json_value* subVal = val->u.object.values[i].value;
        LogFM("Name:", name);
        LogFM("Value:", subVal->u.string.ptr);

        if(subVal->type == json_string) {
            // Unrelated. Do something with values.
        }
    }// <--- CRASH IN THIS LINE
    LogFM("DEBUG","THIS LINE NEVER GET PRINTED");
    return rj;

As you can see, it's crashing after working. How I know that? Because LogFM is a method that writes a log (really?) in a log file. And this is it value:
(LogFM primitive is: LogFM(<FROM>, <MESSAGE>) )
Code:
Method: <Name:> :
        Message:<blablabla>
Method: <Value:> :
        Message:<data>
Method: <Name:> :
        Message:<blablabla>
Method: <Value:> :
        Message:<data>
Method: <Name:> :
        Message:<blablabla>
Method: <Value:> :
        Message:<data>
Method: <Name:> :
        Message:<blablabla>
Method: <Value:> :
        Message:<data>
Again I've ommited "blablabla" and "data" values since those are not related. I mean, them are correctly read so..
anyone know why it's crashing??

Thanks

Edit: Incredible. After an hour I decided to ask you to help me. 5 minutes later, I've solved it myself xD
PS: The answer is "- 1" ;)
 
Last edited by umbjolt,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/@legolambs