graphics32 icon indicating copy to clipboard operation
graphics32 copied to clipboard

Raspberry Pi (ARM) does not compile

Open artelogic-com opened this issue 3 years ago • 9 comments

in Blend_MMX line 745: procedure EMMS_MMX; {$IFDEF FPC} assembler; nostackframe; {$ENDIF} asm EMMS <--- should be conditional end;

in Blend_SSE2 line 1272 the comment is not accepted, has to be in (* ... *) asm { This is an implementation of the merge formula, as described in a paper by Bruce Wallace in 1981. Merging is associative, that is, A over (B over C) = (A over B) over C. The formula is,

  Ra = Fa + Ba * (1 - Fa)
  Rc = (Fa * (Fc - Bc * Ba) + Bc * Ba) / Ra

where

  Rc is the resultant color,
  Ra is the resultant alpha,
  Fc is the foreground color,
  Fa is the foreground alpha,
  Bc is the background color,
  Ba is the background alpha.

Implementation:

  Ra := 1 - (1 - Fa) * (1 - Ba);
  Wa := Fa / Ra;
  Rc := Bc + Wa * (Fc - Bc);

  (1 - Fa) * (1 - Ba) = 1 - Fa - Ba + Fa * Ba = (1 - Ra)

}

artelogic-com avatar Jun 04 '22 18:06 artelogic-com

Even here this part is strange... :/

artelogic-com avatar Jun 04 '22 18:06 artelogic-com

The GR32_BlendMMX unit shouldn't be compiled on ARM. Haven't you got the PUREPASCAL symbol defined?

The following from GR32_Compiler.inc should ensure that PUREPASCAL is defined:

{$IFDEF COMPILERFPC}

  {$MODE Delphi}
  {$DEFINE PLATFORM_INDEPENDENT}
  {$DEFINE FPC_HAS_CONSTREF}
  {$DEFINE HAS_NATIVEINT}
  {$DEFINE NATIVE_SINCOS}
  {$DEFINE USESTACKALLOC}
  {$DEFINE RGBA_FORMAT}

  {$IF DEFINED(CPUx86_64)}
    {$DEFINE PUREPASCAL}
  {$ELSEIF DEFINED(CPUi386)}
  {$ELSE}
    {$DEFINE PUREPASCAL}
  {$IFEND}

{$ENDIF COMPILERFPC}

andersmelander avatar Jun 05 '22 21:06 andersmelander

Yes, it is defined. I think, then those units have to be switched off in the package. Otherwise they get compiled regardless of they are really used or not. Are there other units for which this could be true (except for the three obvious BlendXYZ)?

artelogic-com avatar Jun 06 '22 07:06 artelogic-com

Are there other units for which this could be true (except for the three obvious BlendXYZ)?

Not that I know of.

andersmelander avatar Jun 06 '22 14:06 andersmelander

Then this should solve it: GR32_Lazarus.lpk.zip

artelogic-com avatar Jun 06 '22 14:06 artelogic-com

Thanks. Any reason why you can't make a pull request with it?

andersmelander avatar Jun 06 '22 14:06 andersmelander

I thought, you just meant it for the code (color things) I typed in here. But I am going to try to do it. For the backend as well?

artelogic-com avatar Jun 06 '22 15:06 artelogic-com

Anders, I am not really familar with GitHub. Do I need my own repo to create a pull request? Or what would be the easiest way for somebody, who has nothing but an account here?

artelogic-com avatar Jun 06 '22 15:06 artelogic-com

It's relatively easy:

  1. Start by creating a fork of the Graphics32 repository: billede This copies the Graphics32 repository to a new repository under your own account.
  2. Once that has been created you can clone your copy to your local PC using whatever Git tool you're using now (I'm assuming you're not just downloading the zip file. If that's wrong let me know).
  3. Apply your changes to a branch in your local clone and push them to your own repo.
  4. At your local repo create a pull request: billede
  5. Verify that the base repo (the Graphics32 repo) and the head repo and branch (your repo and your branch) is correct and then create the pull request. billede

That's it. Your pull request will show up at the Graphics32 repo and I can review, comment and merge there.

andersmelander avatar Jun 06 '22 15:06 andersmelander

Closing due to inactivity

andersmelander avatar Feb 17 '24 16:02 andersmelander