[quote="dmantione"]
What I can see from the executables is that the FPC executable contains RTTI, which most propably means the FPC executable was compiled without smart]
Yes, that's true. BTW, do this mean that smartlinking now works fine in FPC?
Here the code I have used for freepascal:
[pascal]
program fillscreen_fpc;
type
// Unsigned types
u8 = byte;
u16 = word;
u32 = cardinal;
// Signed types
s8 = shortint;
s16 = smallint;
s32 = longint;
var
VideoBuffer : ^u16 = pointer($6000000); (* Display Memory (the screen) *)
DISPCNT : ^u16 = pointer($4000000); (* Initialization register *)
i,j : integer;
begin
DISPCNT^ := $403;
for i:=0 to 159 do
for j:=0 to 239 do
VideoBuffer[j + 240 * i] := i * j mod 31;
end.
[/pascal]
and here the code used for gpc:
[pascal]
program fillscreen_gpc;
{$X+}
type
u8 = byte;
u16 = ShortWord;
u32 = cardinal;
s8 = ByteInt;
s16 = ShortInt;
s32 = integer;
const
fb = $6000000;
var
VideoBuffer : array [0..0] of u16 absolute fb; (* Display Memory (the screen) *)
DISPCNT : ^u16 = pointer($4000000); (* Initialization register *)
i, j : integer;
begin
DISPCNT^ := $403;
for i:=0 to 159 do
for j:=0 to 239 do
VideoBuffer[j + 240 * i] := i * j mod 31;
end.
[/pascal]
The only big difference is that in fpc I can't figure a suitabe way to declare 'absolute' VideoBuffer.
Bookmarks