Results 1 to 8 of 8

Thread: DoomToFreepascal 2.1.4

  1. #1

    DoomToFreepascal 2.1.4

    Hello!

    I compiled the famous DOOM game with FPC 2.1.4 and it works better now. Had to make minor syntax
    modifications to compile it with 2.1.4.
    http://z505.com/cgi-bin/qkcont/qkcon...-To-Freepascal
    http://z505.com/pascal/games/doom2fpc-2.1.4.zip

    Basically much better than the last doomtofreepascal.zip download.
    Remember in the last zip file offered years ago, the graphics were distorted? In this latest zip, they are almost crystal clear all the time.

    Does anyone have any explanation as to why this game is better with 2.1.4? What bug could have been fixed do you think?

    Lars
    http://z505.com

  2. #2

    DoomToFreepascal 2.1.4

    Hi Lars,

    I've recently downloaded FPC 2.1.4 and I 've managed to compile the
    source.
    About the walls/bricks problem it seems to be located in subtraction
    operations between LongWord types. I didn't manage to locate
    where exactly the problem appears (maybe because I'm not experienced with FPC), but during simultaneous debuging
    with Delphi and FPC some calculations with the same numbers give different results!
    Example:
    in r_segs.pas locate the line:

    offsetangle := abs(rw_normalangle - rw_angle1);

    replace this with

    offsetangle := abs(rw_normalangle - rw_angle1);
    {$IFDEF FPC}
    PInteger(@offsetangle)^ := abs(PInteger(@offsetangle)^);
    {$ENDIF}

    Then compile the source with FPC.

    Some The rendering problems seems to be corrected!

    If you don't use {$IFDEF FPC} / {$ENDIF} directive and
    compile the same source with Delphi, the the Delphi EXE runs with rendering problems! Why this happens? Do you have any idea?

    Is there a switch option in FPC for overflow checking/behavious in such calculations [i.e. function abs() or subtraction]?
    Last edited by Jimmy Valavanis; 30-03-2012 at 05:08 PM.

  3. #3

    DoomToFreepascal 2.1.4

    You can use the -Cr and -Ci checks (eg: fpc -Cir program.pas) for overflow and range checks.

    There are other checks available in the -C switches too.

    The difference might be that fpc and delphi do some different thing when different types are operated on. Eg: "int := int + dword"; might behave differently when it overflows for some reason etc.

    I know that recently some Delphi behaviors have been "fixed" in {$mode delphi} to be more delphi compatible. The only sure way to find the difference out is to test it on various values. The -Cir should report if an overflow or range error happens (it quits the program, and if you compiled with -gl it will write the code/line number of the error-causing code)
    Feel the power of Open Source.
    <br />Feel the power of Free Pascal.

  4. #4

    DoomToFreepascal 2.1.4

    I won't be able to look into it for a while since I'm behind on a few projects. However this is exactly what I hoped would happen with FPC - we would improve the FPC compiler by compiling real world large applications.

    BEGIN RANT
    This is a real world program rather than silly programs on The Shootout contest pages. I can't believe Jimmy and I are the only ones who've tried compiling Doom and I can't believe how many people haven't played around with the Quake 2 source. FPC will improve only if people compile real world, large, huge source bases - not tiny little unit tests or shootout contests, thank you very much.
    END RANT
    http://z505.com

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    DoomToFreepascal 2.1.4

    Uh... shootout contests? :scratch:
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6

    DoomToFreepascal 2.1.4

    Hi,

    I've just uploaded the newest version 0.5.232 witch corrects all rendering problems with Free Pascal Compiler!

    The problems corrected by changing some lines of code in subtraction operations between LongWord type and calls to the abs() function!

    Enjoy!

    Download version 0.5.232 (Execurables and source code - ~835KB) (http://w13.easy-share.com/1164447.html)
    Download version 0.5.232 (Executables, sources and demo file from shareware version ~2536KB) (http://w13.easy-share.com/1164480.html)
    Last edited by Jimmy Valavanis; 30-03-2012 at 05:09 PM.

  7. #7

    DoomToFreepascal 2.1.4

    Hi there.

    Nice projects!

    Well, this a bug report or whatever.

    L505: Your version seems to start fine but in-game there are still distortions. It seems as if the textures are gliding along the walls when moving. Often there are additional bugs where walls seem partly to disappear and so on. Don't know if you knew about this behaviour.

    Jimmy Valavanis: On starting your binary I get the following error messege: "I_Error: W_InitMultipleFiles(): no files found". Same for both, Delphi and FPC version.

    Didn't get the time to try compiling it myself yet.

  8. #8

    DoomToFreepascal 2.1.4

    You must have in the current directory a valid WAD file (Doom's data file).
    You can download the shareware version of Doom using the following link ftp://ftp.ntua.gr/pub/vendors/idgame...om/doom19s.zip

    or

    http://www.doomworld.com/classicdoom/info/shareware.php

    After installation copy the DOOM1.WAD file to the same folder as Doom32.exe (Delphi version) or doom32f.exe (Free Pascal version), or
    specify the full pathname using for example
    -mainwad c:\downloads\doom1\doom1.wad
    command line parameter.


    You can also download the executables, the source code and the data file
    of shareware version here (~2536KB) (http://w13.easy-share.com/1164480.html).
    Last edited by Jimmy Valavanis; 30-03-2012 at 05:10 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
  •