Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Thread: GP2X/FPC Issues

  1. #11

    GP2X/FPC Issues

    Hi KidPaddle,
    I am interested in using gdb to debug my GP2X programs using freepascal, can you tell me how to do this?

    cheers,
    Paul.

  2. #12

    GP2X/FPC Issues

    I have download the debugger for gp2x from this site:

    http://archive.gp2x.de/cgi-bin/cfile...,0,0,0,14,1655

    Put both, debugger and program, into same directory and connect to gp2x with telnet, switch to program directory and call:

    ./dbg program.gpe

    That alls, nothing special. Only you have to remove "-s" option from linker, cause it strip all debug symbols.

    Cheers
    Thomas

  3. #13

    GP2X/FPC Issues

    Thanks for the info KidPaddle! :-)

    BTW, I have built myself a new crosscompiler using the new freepascal 2.2.0 sources, etc. and have had less issues. After more testing I will upload the new cross-compiler to the fpc4gp2x site.

    I have also 'updated' my devkitGP2X sdl libraries from here (http://archive.gp2x.de/cgi-bin/cfile...,0,0,0,19,1875). This includes SDL_mixer 1.2.6 compiled to use libmad and tremor which don't use floating point at all which is much better.

    I need to try some sdl mixer stuff to see if that works now :-)

    I will keep you posted.

    PS according to Eugene Proshkin who helped me get stated with the GP2X programming, you don't need softfloat when building the cross-compiler.

    cheers,
    Paul.

  4. #14

    GP2X/FPC Issues

    Attention linker "experts":

    I have tried compiling a pascal program using the freepascal 2.2.0 cross-compiler I made and using some updated SDL libraries, including an updated SDL_Mixer that uses libmad and trembor? for no floating-point usage.

    At the linking stage I get these errors:

    Code:
    C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_openFileRW':
    mp3_mad.c:(.text+0x1c): undefined reference to `mad_stream_init'
    mp3_mad.c:(.text+0x24): undefined reference to `mad_frame_init'
    mp3_mad.c:(.text+0x30): undefined reference to `mad_synth_init'
    mp3_mad.c:(.text+0xa0): undefined reference to `mad_timer_zero'
    C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_closeFile':
    mp3_mad.c:(.text+0xc4): undefined reference to `mad_stream_finish'
    mp3_mad.c:(.text+0xcc): undefined reference to `mad_frame_finish'
    C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `read_next_frame':
    mp3_mad.c:(.text+0x150): undefined reference to `mad_frame_decode'
    mp3_mad.c:(.text+0x17c): undefined reference to `mad_stream_errorstr'
    mp3_mad.c:(.text+0x24c): undefined reference to `mad_stream_buffer'
    mp3_mad.c:(.text+0x260): undefined reference to `mad_frame_decode'
    mp3_mad.c:(.text+0x28c): undefined reference to `mad_timer_add'
    mp3_mad.c:(.text+0x2f8): undefined reference to `mad_stream_buffer'
    C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_seek':
    mp3_mad.c:(.text+0x384): undefined reference to `mad_timer_set'
    mp3_mad.c:(.text+0x390): undefined reference to `mad_timer_compare'
    mp3_mad.c:(.text+0x3f4): undefined reference to `mad_timer_compare'
    mp3_mad.c:(.text+0x444): undefined reference to `mad_timer_zero'
    C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_getSamples':
    mp3_mad.c:(.text+0x5a8): undefined reference to `mad_synth_frame'
    C:\devkitGP2X\lib\\libSDL_mixer.a(mp3_mad.o): In function `mad_openFile':
    mp3_mad.c:(.text+0x820): undefined reference to `mad_stream_init'
    mp3_mad.c:(.text+0x828): undefined reference to `mad_frame_init'
    mp3_mad.c:(.text+0x834): undefined reference to `mad_synth_init'
    mp3_mad.c:(.text+0x8a8): undefined reference to `mad_timer_zero'
    Does this mean I have something in the wrong order in the linking process?

    My linking line in the batch file:

    Code:
    arm-linux-ld.exe  -static --no-warn-mismatch --reduce-memory-overheads --gc-sections -s -L. -o%1.gpe link.res -lpng -lm -lstdc++ -lgcc_eh -lpthread -lvorbisidec -lmikmod -lpng12 -lz -lSDL -ljpeg -lfreetype -lc -lgcc
    cheers,
    Paul.

  5. #15

    GP2X/FPC Issues

    Hi Paul,

    Great news!

    @libmad
    There is a missing library libmad, so add -lmad to your linking line.

    @SoftFloat
    The default DevKit is compiled with hard float, the linker accept this. But Open2x DevKit is compiled with soft float, in this case, i need soft float units. Soft Float is much faster, cause no raised exception, by using floating point opcode, has to be catched by the system, which needs a lot of cpu cycles.

    Cheers,
    Thomas

    Sorry for my bad language, hope you understand what i'm meaning.

  6. #16

    GP2X/FPC Issues

    [quote="KidPaddle"]Hi Paul,

    Great news!

    @libmad
    There is a missing library libmad, so add -lmad to your ]

    @libmad
    Thanks, at least it now compiles!
    It does crash though (need to debug)

    @softfloat
    ok, that makes sense.

    Your english is very good BTW

    cheers,
    Paul.

  7. #17

    GP2X/FPC Issues

    Hi KidPaddle, I finally got the gdb working. It gives me this result

    Code:
    Program received signal SIGSEGV, Segmentation fault.
    0x0006e70c in __pthread_initialize_manager () at ../MPEGerror.h:34
    34      ../MPEGerror.h: No such file or directory.
            in ../MPEGerror.h
    Does this mean anything to you? :-)
    cheers,
    Paul

  8. #18

    GP2X/FPC Issues

    Hi Paul,

    it coud be, that i have seen this error in my life before, but ... i'm not sure.

    Cheers,
    Thomas

  9. #19

    GP2X/FPC Issues

    Ok, it has nothing to do with sdl_mixer. It happens, when a timer must be initialized.

    Code:
    program sdlfpc;
    {$IFNDEF FPC}
      {$APPTYPE CONSOLE}
    {$ENDIF}
    
    uses SDL;
    
    begin
      WriteLn('Init Timer');
      if &#40;SDL_Init&#40;SDL_INIT_TIMER&#41; < 0&#41; then begin
        WriteLn&#40;SDL_GetError&#40;&#41;&#41;;
      end;
        
      WriteLn&#40;'SDL_INIT_TIMER Done'&#41;;
      SDL_QUIT;
    end.
    This code crashed too.

    Cheers,
    Thomas

  10. #20

    GP2X/FPC Issues

    Ok, next step on the "try and error" way.

    Code:
    uses SDL;
     
    var 	
      thread&#58; PSDL_Thread;
      returnValue&#58; Integer;
     
    function thread_func&#40;&#41;&#58; Integer;
    begin
      // do threading here
      WriteLn&#40;'Start Thread'&#41;;
      SDL_Delay&#40;5000&#41;;
      WriteLn&#40;'End Thread'&#41;;
     
      result &#58;= 1; // thread leaves and return this value
    end;
     
    begin
      returnValue &#58;= 0;
      thread &#58;= SDL_CreateThread&#40;@thread_func, NIL&#41;;
     
      SDL_WaitThread&#40;thread, returnValue&#41;;
      WriteLn&#40;'Thread returns code ',returnValue&#41;;
      SDL_Quit;
      WriteLn&#40;'ByeBye ;&#41;'&#41;;
    end.
    Crashed too, there is something wrong with thread management.

    Thomas

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •