Results 1 to 10 of 43

Thread: Library recommendation?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Quote Originally Posted by Akira13 View Post
    It's way, way harder to update an old Delphi app to a new version of Delphi than it is to update it to Lazarus, for what it's worth. I'm willing to bet there are most likely non-assembly alternatives to what Wiering is trying to do nowadays, though. Hard to say without seeing the code.

    Here is a little example: I stored most of my data as assembly (example: parameters for a level background):

    Code:
      
    procedure BackGrParP1b; assembler;
    asm
      db      1    { StaticBackGrObj }
      db       52, 77, 24, 20;  dd SUNB01
    
      db      9    { BackDraw }
      db      100, $C9;  dw PKD;  dd BIGPLANTpck;  db $CD
      db       30, $86 + $10; dw PKD;  dd PALMBACKPK0;  db 0
      db       42, $86 + 32 + $10{, 16, 58;} dw PKD;  dd PALMBACKPK1;  db 0
      db      100, $90 + $10; dw PKD;  dd PALMBACKPK0;  db 0
      db      112, $90 + 32 + $10{, 16, 48;} dw PKD;  dd PALMBACKPK1;  db 0
      db       40, $D0;  dw PKD;  dd BIGPLANTpck;  db $CD
      db      100, $D8;  dw PKD;  dd BIGPLANTpck;  db $CC
      db      200, $C0;  dw PKD;  dd BIGPLANTpck;  db $CD
      db       40, $D4;  dw PKD;  dd BIGPLANTpck;  db $CD
    
      db      0    { FromPalTo }
    
      db      4    { RandomPixels }
      dw       1;  db    0, $0F,   0,   1,  $F1
      dw       2;  db    0, $1F,   0,   1,  $F0
      dw       1;  db    0, $2F,   0,   1,  $F1
      dw       2;  db    0, $3F,   0,   1,  $F0
      ...
    end;
    That was ideal, because that way you don't have to define any data structure for it and you can easily have variable sized sections and not waste any bytes.

    Also all sprites were saved like that, but I could easily convert those into arrays of bytes.

    When I try to use this in Lazarus, I get a SIGSEGV exception, probably because this is all compiled into the code segment and I'm trying to use it as data.
    (I thought of using the Delphi version to save all of these things as data, but it wouldn't work for the Pointer values).

    Also, I have many thousands of lines of assembly code, all drawing stuff that needed to be fast. And I haven't found any good documentation of how the Lazarus assembly works.

    Actually I did get the game to work somewhat in Lazarus by commenting out everything that requires assembly or these data structures and by rewriting one sprite drawing function to Pascal code (you only see a black screen and a few sprites and it is already terribly slow).
    Last edited by Wiering; 07-01-2018 at 08:21 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •