PDA

View Full Version : FPC 4 GBA: a step ahead



Legolas
05-11-2005, 03:37 PM
Last night was sleepless, so I have decided to work a bit on freepascal porting for gba. I have carried out a couple of ideas I had some times ago, I have recompiled and - surprise! - now it works without those uncomfortable tricks (removing things from asm generated file and so on).

Now I'm doing some tests in order to make a better documentation to release... Maybe tonight I'll release new version
:toocool:

MikeS
05-11-2005, 03:44 PM
Sounds Great!!

Keep us posted.

8)

Legolas
06-11-2005, 02:11 AM
Ok, if someone is interested, I have updated my page with the new fpc4gba release. :D
You can find it here (http://itaprogaming.free.fr/)! I hope that someone other would help me and WILL in this project... :P We need testing, translating libs, examples, ideas, coding, debugging, sleeping, food, money and women (ok, I'm joking... money and women should be enough...) :joker: :mrgreen: :mrgreen:

K4Z
07-11-2005, 03:13 AM
Hi Legolas,
I took a quick look at your compiler, and it's pretty impressive so far. However, I was not able to compile the source. I followed your little tutorial on how to compile, but Heh, I'm stuck at the 'make PPC_TARGET=arm' part :? . Do I use the MakeFile in the fpcmake directory? When I do, make.exe doesn't generate 'ppcarm.exe'.

Any ideas? I'm still fairly new to using FPC. :P


I'm pretty interested in this project of yours, but I think most people are still pretty scared of it at this stage :P
Keep up the good work, hopefully it'll start to draw more people in soon :)

Sly
07-11-2005, 03:27 AM
In the FPC source, enter the compiler directory and type "make PPC_TARGET=arm". I've been having fun trying to make the FPC compiler from source as well. I found that I had to make the ppc386 compiler first, then make ppcarm.

I noticed that the page said that ARM9 support was still yet to arrive. Damn! That means I won't be able to use FPC to create GP2X applications because it has dual ARM9 processors.

JSoftware
07-11-2005, 05:56 AM
legolas, i would like to help with anything. :D

Get me on mail/msn if you think i could be used for something: jeppesoftware@hotmail.com

Legolas
07-11-2005, 11:11 AM
Sly: You don't need to recompile ppc386 too. Should be enough to install fpc binaries and use it :wink:

K4Z: in 99% of cases, if you can't obtain ppcarm.exe is because you have problems with path :) Be sure that (eg.) "c:\fpc\bin\i386-Win32" is the first string in your search path. You should send me (or post here) the message error you get. :)

JSoftware: You have a new msn contact :D

Legolas
07-11-2005, 11:31 AM
I'm pretty interested in this project of yours, but I think most people are still pretty scared of it at this stage :P


I know... recompiling all fpc could scare people. :(
Maybe I could put binaries on my web page, but I don't know if fpc licence allows it... :?:

K4Z
07-11-2005, 12:50 PM
The path is correct, as far as I can see :lol: , and it's the first on the list.

Following the tutorial exactly, when I run make PPC_TARGET=arm, it returns the error:
'make: *** No targets specified and no makefile found. Stop.'

Heh heh, I'm doing something wrong I know it :lol:


I don't think the license has a problem with posting the binary's... :?:

Legolas
07-11-2005, 01:21 PM
The path is correct, as far as I can see :lol: , and it's the first on the list.

Following the tutorial exactly, when I run make PPC_TARGET=arm, it returns the error:
'make: *** No targets specified and no makefile found. Stop.'

Heh heh, I'm doing something wrong I know it :lol:


:shock:
Ok, your path is correct. How many files do you have in your source/compiler directory? Do you have downloaded and installed fpc sources (ftp://ftp.freepascal.org/pub/fpc/dist/source-2.0.0/fpc-2.0.0.source.zip) too?

K4Z
08-11-2005, 12:47 PM
ok, I updated my FPC sources to the newer 2.0.0 version, and that got it working :)
However, now it's having problems finding all those .inc files, heh :? .

Legolas
08-11-2005, 02:05 PM
ok, I updated my FPC sources to the newer 2.0.0 version, and that got it working :)
However, now it's having problems finding all those .inc files, heh :? .

Define "problems", plz :) Do you get an error message?

JSoftware
08-11-2005, 02:09 PM
osdefs.inc? :P

that was the one i missed yesterday

K4Z
08-11-2005, 02:51 PM
Problems being that it cannot find the .inc files.
are there more paths I need to set?

If I simply copy/paste 'osdefs.inc' to the rtl directory it finds it ok, but then there's hundreds :P of other .inc files it needs, and I can't copy paste them all :? . heh.

Legolas
08-11-2005, 04:03 PM
Erm... Ok. Now I'm trying to recompile all on a clean pc. Maybe I have missed a step :( :oops:

Legolas
08-11-2005, 04:40 PM
Erm... Ok. Now I'm trying to recompile all on a clean pc. Maybe I have missed a step :( :oops:

My friends, I'm coming to recompile all from scratch on a W98 SE pc and all went fine...
Downloading latest release (2.0.0, not 2.1.X) binaries and sources and following step-by-step my doc, I can't find errors :(

The only thing I could guess is that something goes wrong when you are making the new gba directory.
Fist of all, you need to add c:\fpc\bin\arm-gba to your path (so you should have PATH=c:\fpc\bin\arm-gba;c:\fpc\bin\i386-win32;...;...). You should make a copy of fpc/source/rtl/linux directory (comprising all files inside it, of course) and remove only the files specified in my doc. After that you can add the files provided in the rtl directory of my package.
In order to recompile the rtl you should go in source/rtl, do a 'fpcmake -Tall -r -w', do a 'make distclean', and 'make CPU_TARGET=arm OS_TARGET=gba PP=ppcarm OPT="-Tgba"'. If you want, we could do a "recompiling-fpc4gba irc session" so if you have doubts I could help in real time :mrgreen:

Now my question is: except me, someone other has been able to recompile all? :?: :mrgreen:

JSoftware
08-11-2005, 06:39 PM
i've recompiled it once more now following your guide down to each simple step. Now i get it to compile however it just throws out a lot of assembler code and tells me that most of the instructions are unknown

Legolas
08-11-2005, 07:18 PM
i've recompiled it once more now following your guide down to each simple step. Now i get it to compile however it just throws out a lot of assembler code and tells me that most of the instructions are unknown
Maybe because it calls wrong binutils. You should copy in bin/arm-gba all files in binutils directory of my package, then make a copy of these files and rename it, by placing arm-gba- before the name (eg. arm-gba-ld.exe). So, at the end of the story, your bin/arm-gba should contain these files:
as.exe
ld.exe
objcopy.exe
ppcarm.exe
cygwin1.dll
arm-gba-as.exe
arm-gba-ld.exe
arm-gba-objcopy.exe
You should try to call "arm-gba-ld -V" from c:\. You should get


GNU ld version 2.15
Supported emulations:
armelf

JSoftware
08-11-2005, 07:25 PM
oh it works now! :D i thought that the files with normal filenames should be renamed and not exist in their old names :oops:

Legolas
08-11-2005, 07:49 PM
oh it works now! :D i thought that the files with normal filenames should be renamed and not exist in their old names :oops:
I'm happy to hear that :D
Maybe that part of my tutorial is a little cryptic... :D

Now I'm working on smartlinking, in order to reduce file size. :wink:

K4Z
09-11-2005, 08:16 AM
Ok, I fully removed fpc from my system, and started again from scratch.

But make.exe is still giving me the error:
System.pp(31,2) Fatal: Can't open include file "osdefs.inc".

I won't have much time in the next few weeks to keep trying this, I have exams comming.

Could you possibly email a compiled .exe to me? I'd still like to check out what the compiler can do, and try out the examples :o

kas6666 (AT) gmail (DOT) com :P