Re: [AD] Shutting down Allegro due to signal #8

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hello.  I have new clues and I think I've found the where's the
problem, but I don't know why it's happening and how fix it.

Testing the fixed-point trigonometry function (fixcos, fixsin, etc.) I
get a similar error message ("Shutting down Allegro due to signal
#11") so I think there's a problem with the trigonometry tables.  If I
create my own tables it works. But the tables I can create can't be
used by Allegro's functions to rotate bitmaps and sprites.

But all trigonometry tables are static (I mean, they're created at
compile-time not at run-time) and they aren't changed at run-time, are
they?

Here you have the Pascal code:
______________

PROGRAM test;
{$MODE FPC}

TYPE
  TBLptr = ^LONGINT;
VAR
{ This links with the _cos_tbl. Change the "liballeg-4..." by the DLL
on Winindows. }
  _cos_tbl: TBLptr; EXTERNAL 'liballeg-4.3.10.so';

{ My fixcos function. }

  function tabla(Base: TBLptr; Offset: Integer): LONGINT;
  begin
    inc(Base,Offset);
    tabla := Base^;
  end;

  FUNCTION al_fixcos (x: LONGINT): LONGINT;
  BEGIN
    al_fixcos := tabla (_cos_tbl, ((x + $4000) SHR 15) AND $1FF);
  END;

{ And here we go. }
VAR
  Num: LONGINT;
BEGIN
  Num := al_fixcos (0);
END.
________________________

It compiles and links but fails when it runs. Using Allegro 4.2 on
Windows that code worked (you can see it downloading Allegro.pas).

Anybody has an idea?




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/