Welcome! Log In Create A New Profile

Advanced

A few questions

Posted by nardi11011 
A few questions
July 19, 2009 06:51PM
Is there any way to play multiple MP3 files simultaneously? And playing WAV files, how would I go about doing that?

And for a simpler question: is there a way to get the Wii's memory statistics (total, used, free)?
Re: A few questions
July 19, 2009 07:45PM
Yes there is, mix them yourself, or get libasnd to do it for you (I never got libasnd to work for me). If you look at the code of GuitarsOnFire, there I mix multiple ogg files. And there is also mp3 code in there (but commented out, as I didn't need it)

Don't know about the memory stats.
Re: A few questions
July 20, 2009 12:21AM
Quote
nardi11011
And for a simpler question: is there a way to get the Wii's memory statistics (total, used, free)?

I do not know, if there is a convenient library function or hardware register.
But you have the whole memory of the Wii (minus the IOS-space) all for yourself, so you can count along, if you need to.
Look on Wiibrew.org (memory related links are on the frontpage)
Re: A few questions
July 20, 2009 12:34AM
There is a master memory allocation system for each of the two memory areas, except that it does not support random access deallocation. Most people suballocate the memory using a memory manager library on top of this.
Re: A few questions
July 20, 2009 12:50AM
Quote
henke37
There is a master memory allocation system for each of the two memory areas,
Where can I find infos about that?
Re: A few questions
July 20, 2009 03:34PM
I am not sure, but the apis is fittingly called the AREA and AREA2 apis.
Re: A few questions
July 20, 2009 06:43PM
Quote
henke37
I am not sure, but the apis is fittingly called the AREA and AREA2 apis.
Do you have a link to the APIs?
Re: A few questions
July 21, 2009 12:38AM
The Wii has 2 memory blocks, commonly called MEM1 (24MB) and MEM2 (64MB), and in libogc they are Arena1 and Arena2.

Check out system.h on libogc:

void* SYS_GetArena1Lo();
void SYS_SetArena1Lo(void *newLo);
void* SYS_GetArena1Hi();
void SYS_SetArena1Hi(void *newHi);
u32 SYS_GetArena1Size();

...and the same ones are there for arena2

So to get the amount of Arena1 available: SYS_GetArena1Hi() - SYS_GetArena1Lo()

malloc and such use the Set functions to increase/decrease the amounts available, or you can call those functions yourself too. Also keep in mind chunks of both MEM1 and MEM2 are initialized by libogc and other libraries on bootup of your program.
Re: A few questions
July 21, 2009 09:15AM
Thanks!
Where can I find libogc's source for the functions?
Re: A few questions
July 21, 2009 03:12PM
Just guessing here, but maybe it's in a file called arena.c? failing that, system.c. Besides, why do you want it? It's working just fine and you do not need to mess with it.
Re: A few questions
July 21, 2009 10:17PM
Quote
henke37
Just guessing here, but maybe it's in a file called arena.c? failing that, system.c.
Propably :D

But where do I find libogc's source code files?
In devKitPro and at its site I only find the header files.
A simple Google search didn't turn up anything for me either.

And by the way: where can I find the malloc implementation from devkitPPC?

Quote
henke37
Besides, why do you want it?
To understand it.
To know more about the Wii's MMU and memory management in genral.
Re: A few questions
July 21, 2009 10:37PM
Quote
daniel_c_w
Thanks!
Where can I find libogc's source for the functions?

libOGC Repository: [devkitpro.svn.sourceforge.net]
Re: A few questions
July 21, 2009 11:16PM
Thank you.
Sorry, only registered users may post in this forum.

Click here to login