GP32 Mr.mirkos Sdk Replacement

Discussion in 'General Discussions' started by mr.mirko, Jan 27, 2004.

  1. mr.mirko

    mr.mirko Certified Guru

    Joined:
    Nov 24, 2003
    Messages:
    471
    Location:
    Germany
    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.]
     
    Tags:
  2. ThunderZ

    ThunderZ Certified Guru

    Joined:
    Feb 14, 2003
    Messages:
    95
    Really Good job.

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

    :) Congratulation
     
  3. Arda

    Arda Member

    Joined:
    Jul 16, 2003
    Messages:
    142
    Location:
    istanbul
    wov! a new sdk with "thunderZ approved" mark :)
    thanks mr.mirko!
     
  4. don

    don AWSMOE!

    Joined:
    Dec 23, 2003
    Messages:
    635
    Location:
    $$$GERMONEY$$$
    Yay. Gonna have a look at it tomorrow.
    Really waited for something like this.
     
  5. Don Miguel

    Don Miguel Certified Guru

    Joined:
    Aug 13, 2002
    Messages:
    322
    Location:
    South Urals
    Nice!

    and it's pretty clear now 8))
     
  6. loki666

    loki666 rtems gp32 bsp maintainer

    Joined:
    Dec 27, 2003
    Messages:
    288
    Location:
    Belgium
    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
     
  7. mr.mirko

    mr.mirko Certified Guru

    Joined:
    Nov 24, 2003
    Messages:
    471
    Location:
    Germany
    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
     
  8. nigelibrown

    nigelibrown Member

    Joined:
    Jan 7, 2004
    Messages:
    149
    Location:
    Bristol, England
    Great idea! have had a brief look. A couple of questions, Will this be / remain open source? If so what about people contributing functions? Then you may truly have an amazing library. Also what about making it modular so you only have to include the parts youe need?
     
  9. mr.mirko

    mr.mirko Certified Guru

    Joined:
    Nov 24, 2003
    Messages:
    471
    Location:
    Germany
    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. :)
     
  10. papapopalung

    papapopalung Member

    Joined:
    Aug 14, 2003
    Messages:
    600
    Location:
    north-east UK
    this sounds great :)
     
  11. synkro

    synkro 0xdeadbeef

    Joined:
    Aug 26, 2003
    Messages:
    779
    Location:
    Germany
    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)
     
  12. mr.mirko

    mr.mirko Certified Guru

    Joined:
    Nov 24, 2003
    Messages:
    471
    Location:
    Germany
    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
     
  13. loki666

    loki666 rtems gp32 bsp maintainer

    Joined:
    Dec 27, 2003
    Messages:
    288
    Location:
    Belgium
    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
     
  14. mr.mirko

    mr.mirko Certified Guru

    Joined:
    Nov 24, 2003
    Messages:
    471
    Location:
    Germany
    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: Dec 17, 2015
  15. loki666

    loki666 rtems gp32 bsp maintainer

    Joined:
    Dec 27, 2003
    Messages:
    288
    Location:
    Belgium
    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 ???
     
  16. mr.mirko

    mr.mirko Certified Guru

    Joined:
    Nov 24, 2003
    Messages:
    471
    Location:
    Germany
    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: Dec 17, 2015
  17. Saotome

    Saotome Still Fresh

    Joined:
    Oct 1, 2003
    Messages:
    29
    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"? ;)
     
  18. mr.mirko

    mr.mirko Certified Guru

    Joined:
    Nov 24, 2003
    Messages:
    471
    Location:
    Germany
    yeah, the +4096 can be removed :)

    thanx for the hint ...

    Mirko
     
    Last edited by a moderator: Dec 17, 2015
  19. dad

    dad Still Fresh

    Joined:
    May 2, 2003
    Messages:
    73
    Location:
    Oz
    breifly, which files/folders go where? and what other files are required to 'make' the example on a Linux/BSD box.

    TIA
     
  20. mr.mirko

    mr.mirko Certified Guru

    Joined:
    Nov 24, 2003
    Messages:
    471
    Location:
    Germany
    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: Feb 2, 2016

Share This Page

Loading...