Yes, I do, but no resultsOriginally Posted by noeska
I tried by declaring:
without results also. :cry:Code:var mypointer: ^cardinal absolute $4000000
Well for simplicity, here are the contents of these two files. They are located in the source's path 'source\compiler\systems\' Now, these are not the GameBoyAdvanced files you would have these are the Linux port that you'd have to duplicate and rename to t_gba.pas and i_gba.pas within the same folder.
[size=24px]t_linux.pas[/size]
[pascal]clip[/pascal]
[size=24px]i_linux.pas[/size]
[pascal]clip[/pascal]
Ok maybe that was a bit over-zealous :roll:
I have made a rough version of the i_gba.pas and t_gba.pas files... using the 1.9.6 (Jan 1st, 2005) source release.
The settings within i_gba.pas are not correct by a longshot, but I take it FPK or Synopsis can help me out with that one. I have also tracked down the GNU tools for ARM binutils for win32 aswell.
http://www.gnuarm.org/
It seems like the initial support for GBA will be heavily relied upon GNU tools until this rumored assembler/linker they are working on comes to bare. :lol: Thats ok though it gets the job done.
Here are the sources I created, the go right into the same folder as the rest of the i and t files (source\compiler\systems):
[size=24px]i_gba.pas[/size]
[pascal]{ This unit implements support information structures for gba. }
unit i_gba;
interface
uses
systems;
const
system_arm_gba_info : tsysteminfo =
(
system : target_arm_GBA;
name : 'GameBoy Advance';
shortname : 'GBA';
flags : [tf_use_8_3]; // ?
cpu : cpu_arm;
short_name : 'GBA'; // ?
unit_env : ''; // ?
extradefines : ''; // ?
sharedlibext : '.dll'; // ?
staticlibext : '.a'; // ?
sourceext : '.pp'; // ?
pasext : '.pas'; // ?
exeext : '.tpp'; // ?
defext : ''; // ?
scriptext : ''; // ?
smartext : '.sl'; // ?
unitext : '.ppu'; // ?
unitlibext : '.ppl'; // ?
asmext : '.s'; // ?
objext : '.o'; // ?
resext : '.res'; // ?
resobjext : '.or'; // ?
staticlibprefix : ''; // ?
sharedlibprefix : ''; // ?
Cprefix : '_'; // ?
newline : #10; // ?
dirsep : '/'; // ?
files_case_relevent : true; // ?
assem : as_gas; // ?
assemextern : as_gas; // ?
link : ld_m68k_atari; // ?
linkextern : ld_m68k_atari; // ?
ar : ar_m68k_ar; // ?
res : res_none; // ?
script : script_unix; // ?
endian : endian_big; // ?
stackalignment : 2; // ?
maxCrecordalignment : 4; // ?
stacksize : 8192; // ?
DllScanSupported:false; // ?
use_function_relative_addresses : false // ?
);
implementation
initialization
{$ifdef arm}
{$ifdef gba}
set_source_info(system_arm_gba_info);
{$endif gba}
{$endif arm}
end.
[/pascal]
[size=24px]t_gba.pas[/size]
[pascal]unit t_gba;
{$i fpcdefs.inc}
interface
implementation
uses
link,
cutils,cclasses,
globtype,globals,systems,verbose,script,fmodule,i_ gba;
{************************************************* ****************************
Initialize
************************************************** ***************************}
initialization
RegisterTarget(system_arm_gba_info);
end.[/pascal]
Ok, I left out the GNU GPL stuff to keep it smallfor here, it's still there. Don't shoot! :shock:
as for the other files that FPK mentioned earlier...
source\compiler\arm\cputarg.pas now looks like this:
[pascal]unit cputarg;
{$i fpcdefs.inc}
interface
implementation
uses
systems { prevent a syntax error when nothing is included }
{**************************************
Targets
**************************************}
{$ifndef NOTARGETLINUX}
,t_linux
{$endif}
{$ifndef NOTARGETGBA}
,t_gba
{$endif}
{**************************************
Assemblers
**************************************}
{$ifndef NOAGARMGAS}
,agarmgas
{$endif}
;
end.[/pascal]
and source\compiler\compiler.pas required me to stick in[pascal]{$ifdef gba}
,i_gba
{$endif gba}[/pascal]just before[pascal]
{$ifdef amiga}
,i_amiga
{$endif amiga}
{$ifdef atari}
,i_atari
{$endif atari}
{$ifdef beos}
,i_beos
{$endif beos}
etc...[/pascal]
Next is to set the parameters for GBA properly and get the ARM assembler and linker stuck in there. from there we can work on the crt0 issue after that... then on to the THUMB stuff, but that'll be on FPK
noeska, Legolas you guys following how this is coming together?
Because lack of spare time I suspended the work with gpc sources. At this time a new alpha version of gpc is out (it compiles with gcc 3.4.3), but I'm waiting for a more stable beta version. Incidentally, a new fpc rc is out... Now I'm downloading it to do some tries.
Forgot to mention that I updated the i_gba.pas to better match the system_arm_linux_info within i_linux.pas for accuracy's sake.
system_arm_gba_info in i_gba.pas looks like this now:
[pascal] system_arm_gba_info : tsysteminfo =
(
system : system_arm_gba;
name : 'GameBoy Advance';
shortname : 'GBA';
flags : [tf_needs_symbol_size];
cpu : cpu_arm;
unit_env : 'LINUXUNITS';
extradefines : 'UNIX;HASUNIX';
sourceext : '.pp';
pasext : '.pas';
exeext : '';
defext : '.def';
scriptext : '.sh';
smartext : '.sl';
unitext : '.ppu';
unitlibext : '.ppl';
asmext : '.s';
objext : '.o';
resext : '.res';
resobjext : '.or';
sharedlibext : '.so';
staticlibext : '.a';
staticlibprefix : 'libp';
sharedlibprefix : 'lib';
sharedClibext : '.so';
staticClibext : '.a';
staticClibprefix : 'lib';
sharedClibprefix : 'lib';
Cprefix : '';
newline : #10;
dirsep : '/';
files_case_relevent : true;
assem : as_gas;
assemextern : as_gas;
link : nil;
linkextern : nil;
ar : ar_gnu_ar;
res : res_none;
script : script_unix;
endian : endian_little;
alignment :
(
procalign : 4;
loopalign : 4;
jumpalign : 0;
constalignmin : 0;
constalignmax : 4;
varalignmin : 0;
varalignmax : 4;
localalignmin : 4;
localalignmax : 8;
recordalignmin : 0;
recordalignmax : 4;
maxCrecordalign : 4
);
first_parm_offset : 8;
stacksize : 262144;
DllScanSupported:false;
use_function_relative_addresses : true;
abi : abi_default
);[/pascal]
Also, I had to modify source\compiler\systems.pas to include the new system_arm_gba_info so it'll actually compile.
Here is that change:
[pascal] tsystem =
(
system_none, { 0 }
obsolete_system_i386_GO32V1,{ 1 }
system_i386_GO32V2, { 2 }
system_i386_linux, { 3 }
system_i386_OS2, { 4 }
system_i386_Win32, { 5 }
system_i386_freebsd, { 6 }
system_m68k_Amiga, { 7 }
system_m68k_Atari, { 8 }
system_m68k_Mac, { 9 }
system_m68k_linux, { 10 }
system_m68k_PalmOS, { 11 }
system_alpha_linux, { 12 }
system_powerpc_linux, { 13 }
system_powerpc_macos, { 14 }
system_i386_sunos, { 15 }
system_i386_beos, { 16 }
system_i386_netbsd, { 17 }
system_m68k_netbsd, { 18 }
system_i386_Netware, { 19 }
system_i386_qnx, { 20 }
system_i386_wdosx, { 21 }
system_sparc_sunos, { 22 }
system_sparc_linux, { 23 }
system_i386_openbsd, { 24 }
system_m68k_openbsd, { 25 }
system_x86_64_linux, { 26 }
system_powerpc_darwin, { 27 }
system_i386_EMX, { 28 }
system_powerpc_netbsd, { 29 }
system_powerpc_openbsd, { 30 }
system_arm_linux, { 31 }
system_i386_watcom, { 32 }
system_powerpc_MorphOS, { 33 }
system_x86_64_freebsd, { 34 }
system_i386_netwlibc, { 35 }
system_arm_gba { 36 }
);[/pascal]
Notice the { 36 } in the set? Thats our new GBA target for ARM.
So how do we get the rest incorporated into this bad boy?
I'm thinking:
:arrow: including the GNUARM binutils for win32[size=9px](and any other platfor we wish to develop GBA in)[/size]
:arrow: get a good clean version of the crt0.s
:arrow: and getting FPC to use the binutils to assemble compiled ARM sources into ARM machinecode for both the program being developed and the crt0.s and take the resulting machinecode and linking them all together to make the resulting GBA ROM file.
:arrow: AFTER, ARM7(THUMB) instructions will need to eventually be included
:arrow: and units for development of aspects of the GameBoy Advance's hardware needs to be created, but I imagine that others will be headlong into this as soon as it is possible.
Am I missing anything?
Uhm... yes, I already modified source\compiler\systems.pas in this way and tried to make some small changes to i_gba.pas. Anyway the compilation failed, because it doesn't recognise arm-gba like a valid target. I think we need to make some changes to utils\fpcm\fpcmake.ini... :?:
Well it compiled for me. Maybe you missed a step or I forgot to list something I did. :/ Note I used the 1.9.6 release not the new one if that matters much for this here.
I added the system_arm_gba to the tsystem set type thats how it allowed it to recodnize my new specification inside of i_gba.pas. Then it compiled fine. Double check your work you may have missed something.
I'm an unlucky man...
I triple checked my steps and all seems to be ok. At this point I think I do some errors in making process. I do:
where /opt/GbaDevKit/bin is my cross-binutils directory and arm-agb-elf- is the prefix of cross-binutils.Code:make all OS_TARGET=gba CPU_TARGET=arm CROSSBINDIR=/opt/GbaDevKit/bin BINUTILSPREFIX=arm-agb-elf-
But, sadly: :cry:
Any suggestions?Code:Makefile:172: *** The Makefile doesn't support target arm-gba, please run fpcmake first. Stop.
I'm guessing you are under linux?
Unfortunately I don't know too much about make files. Rather than trying to modify them I'd trying to simply modify the ppcarm(.exe) compiler to include a GameBoy target so that you can have all the benifits of new updates to the compiler it's self rather than a different branch of the same project.
All I did was type "make PPC_TARGET=arm" and I got what I needed done. Of course I first had to kmake sure that I was using GNU make. If this doesn't work I don't know what to tell you. I'm running WinXP.
Bookmarks