GP32 Mr.mirkos Sdk Replacement


mr.mirko

Certified Guru
Joined
Nov 24, 2003
Messages
471
Location
Germany
Website
mirkoroller.de
GP32 SDK replacement

This is the GP32 SDK Replacement lib.
You can use it to write Software for the gp32,
without using the gp32 SDK.
It is far from complete, but very usefull to write small Progs.

have fun,

Mirko Roller


FEATURES:
Framebuffer setting
Buttons control
Clockspeed change
Read any Directory from SMC Card ( name + size )
Read Files from SMC Card
Sound Setup ( Ringbuffer 44100 Stereo )

MR.Mirkos SDKReplacement

[Mod - Edited for bad link.]
 
Really Good job.

Smart and Powerfull (the smc part is really good).

:) Congratulation
 
yeah great work, gonna take a look
gamepark's sdk sucks (bugs and dont know what's behind functions calls)

thank u

EDIT
well, after a first look, i noticed that 'start' and 'select' buttons seems to be missing in the control api...
and there isnt any flip() function in the gfx api. a flip() function would be great for double buffering without flikering
EDIT
 
Yes, i update the SDK in a few days, also with more examples ( for sound and smc read )

The Buttons start and select are really missing *oops* i update this also...

Mirko
 
The hole thing is open source, i will mention it in the next release...
Also i try to make the lib as modular as possible, but i think it is now split to 3 big parts.
1 SMC functions (90kb)
2 Sound functions ( 6kb)
3 common functions ( grafik buttons cpu speed ...) (4kb)

it makes no sence to split it more, the gcc linker is so inteligent, that only these parts are linked against your programm, that you are using.

Of couse if someone got some usfull functions i will add them.
On my ToDo list is a:

1.Text system ( display of text, with selectable fonts )
2.Better sound system with a mixer of endless channels. :)
 
well, since you just at the beginning it is not tolate for some coding conventions..

some functions/methods are

A: set_thing, get_stuff ...

or

B: SetVar, GetTreeNode ...

some standards would be great (me likes B)
 
Hy,

i updated the GP32 SDK replacement lib to Version 0.2

- Now i included a 8x8 Font ( very nice, not the gp32 one )
- A Font Example, on how to use it.
- A Sound Example, on how to use Sound.
- Added Start+Select Buttons, shame on me...


ToDoList:
Add SMC write suport
Create a new sound mixersystem...


Mirko



gp32_SDK0.2.tgz
 
i think you should start implementing threading before the sound mixing
because the sound mixer is basically a thread
the way sound is handled now is very unconfortable, you need a thread to handle the sound buffers so the only function we use is PlayPCM(buffer,size) like in GamePark SDK

keep good work

PS: maybe you should take a look at java (java.sun.com) cldc refence implementation there is a full multi threading implementation (but maybe useless for this)

loki
 
i think you should start implementing threading before the sound mixing
because the sound mixer is basically a thread
the way sound is handled now is very unconfortable, you need a thread to handle the sound buffers so the only function we use is PlayPCM(buffer,size) like in GamePark SDK
There are 2 ways to implement Sound,

A Ringbuffer: Usefull for streaming audio, like mp3,mod,ogg,emulator playback.

A Mixersystem: Usefull for Game programmers, playback of 2 and more samples at the same time.

The now used Ringbuffer is irq driven, so the samples are played, and you can do other things in the meantime. I try to expand it to a real mixer system...

Hope to finish something this weekend :)

Mirko
 
Last edited by a moderator:
im not sure i understand the way it work...
from your example
while(1){
gp_playbuffer((unsigned char*)sample16s+pos,4*4096);
pos+=4*4096;
if ( pos>(769848-(4*4096)) ) pos=0;
}

what's the play length of one loop? i mean how much time do i have to perform other tasks before needing to call gp_playbuffer() again?
what if i put a while(100000000>i++) (or something like that) in the loop ???
 
im not sure i understand the way it work...
from your example
while(1){
gp_playbuffer((unsigned char*)sample16s+pos,4*4096);
pos+=4*4096;
if ( pos>(769848-(4*4096)) ) pos=0;
}

what's the play length of one loop? i mean how much time do i have to perform other tasks before needing to call gp_playbuffer() again?
what if i put a while(100000000>i++) (or something like that) in the loop ???
there was a bug this is better :)

while(1){
gp_playbuffer((unsigned char*)sample16s+pos,4*4096);
pos+=4*4096;
if ( pos>769848 ) pos=0;

// You can do whatever you want here. You must recall
// The gp_playbuffer returns emiediatly, and the sound plays
// You must recall the gp_playbuffer function again, before
// the 4*4096 bytes are played. Else the buffer will be repeated.
}

Lets say you got 4*4096 Bytes samples
44.100Khz Stereo 16 Bit playback speed,

thats 4 bytes every 22.6E-6 seconds
or ( *4096 ) = 0.0928 seconds

So you must refill the buffer every 0.0928 seconds, to get a clear sound..

Mirko

Lets say the cpu is running with 133Mhz = ~33.000.000* 0.0928 = 3.000.000

You while with 100.000.000 is mutch to big, try ~3.000.000 instead :)
 
Last edited by a moderator:
why is it
Code:
static unsigned char playbuffer1[playbuffer_size+4096];
???
i mean the "+4096". since only playbuffer_size is played.
doesnt it work properly if you dont add it? or is it another "bug"? ;)
 
breifly, which files/folders go where? and what other files are required to 'make' the example on a Linux/BSD box.

TIA
 
dad posted on Feb 1 2004 at 10:27 AM said:
breifly at which files/folders go where? and what other files are required to 'make' the example on a Linux/BSD box.

TIA
You only need

gnu c compiler
latest here: ftp://ftp.gwdg.de/pub/misc/gcc/snapshots
newlib
binutils

and a build instruction, there was one here in the forum 3 weeks ago...

To build your own programm, you can copy a example, and fill it with you own files.
 
Last edited by a moderator:
Back
Top