I haven't tried it. I haven't tried making FPC for ARM since my last attempt almost a year ago when it was failing to build the runtime libraries due to an internal error.
I haven't tried it. I haven't tried making FPC for ARM since my last attempt almost a year ago when it was failing to build the runtime libraries due to an internal error.
Hi savage, I was quite busy but I am back to testing the libc.getenv right now...I will let you know how it goes.Originally Posted by savage
cheers,
Paul
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
I didn't have any luck with the libc.getenv but I have gotten it working using fpgetenv!!!
in SDL.pas around line 261 (I can't recall if this differs from your new version)
[pascal]{$IFDEF UNIX}
{$IFDEF FPC}
{$IFDEF Ver1_0}
linux,
{$ELSE}
pthreads,
baseunix,
{$IFNDEF gp2x}
unix,
{$ELSE}
unix;
{$ENDIF}
{$ENDIF}
{$IFNDEF gp2x}
x,
Xlib;
{$ENDIF}
{$ELSE}
Types,
Libc,
Xlib;
{$ENDIF}
{$ENDIF}[/pascal]
Now the SDL_getenv function:
[pascal]function SDL_getenv(const name: PChar): PChar;
begin
{$IFDEF WIN32}
{$IFDEF __GPC__}
Result := getenv( string( name ) );
{$ELSE}
Result := getenv( name );
{$ENDIF}
{$ELSE}
{$IFDEF UNIX}
{$IFDEF FPC}
Result := fpgetenv(name);
{$ELSE}
Result := libc.getenv(name);
{$ENDIF}
{$ENDIF}
{$ENDIF}
end;[/pascal]
All I had to do was use that, and add the units\arm-linux\rtl folder to my path in my compiler batch file and it now works.
I can get the path environment variable, write it to a file, and look at it using the gp2x E-Book program
WooHoo!!
cheers,
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
That's great news Paul! It looks like adding units\arm-linux\rtl folder to your path is what did the trick.
The difference between your IFDEF and mine is that mine removes support for v1.x of FPC. Only v2.x of FPC is supported now.
Could you follow the following link...
http://jedi-sdl.cvs.sourceforge.net/...?revision=1.27
and save this file as sdl.pas and use this one just to confirm 100% that it is the added path is all that is needed for v1.0 of JEDI-SDL to work with GP2X.
Hi,Originally Posted by savage
I got the version of sdl.pas from above and tried it under Delphi/freepascal/lazarus.
It compiled but when running it it first complained:
The procedure entry point SDL_GetKeyRepeat could not be located in the dynamic link library SDL.dll.
does this mean I have the wrong version of the sdl.dll?
EDIT: I downloaded the new dll and fixed this issue.
Also when compiling it under freepascal arm-linux it had these errors:
I think this one may have something to do with HAS_TYPES...is this defined automatically, or do I have to pass this to the compiler?Code:SDL.pas(2183,12) Error: Forward type not resolved "PPoint" SDL.pas(2198,11) Error: Forward type not resolved "PRect" SDL.pas(3949,1) Fatal: There were 2 errors compiling module, stopping SDL.pas(3949,1) Fatal: Compilation aborted
cheers,
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
hehe :-)Originally Posted by WILL
Once I have this 'final' issue resolved and the new sdl.pas is working (I am currently building the fpcbuild 2.1.x version of the source code to see if that works better), I will make a web page, tutorials, and downloads
cheers,
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
Just curious, what are you thinking of writing? :-)Originally Posted by WILL
cheers,
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
This: http://wiki.freepascal.org/GP2X
If you make an account at freepascal.org, you can add information on the GP2X platform yourself.
Bookmarks