Recent

Author Topic: Port "voxel" DOS demo to Lazarus  (Read 3997 times)

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 577
Re: Port "voxel" DOS demo to Lazarus
« Reply #60 on: August 14, 2020, 06:38:30 pm »
I guess you're not getting it. TImage rendering is drawn in another event, so the actual drawing on the screen in not taken into account. Hence you get a lower time, but it does not count everything.
I understand it. I've already said, that TImage does one bitmap copy internally, that my program doesn't count. And TPanel would require this step to be done manually anyway, so using DIB section is pointless, except may be it has more optimal internal implementation, than pure DIB. I just tried to say, that overall one bitmap copy is faster than two in case of TImage.
« Last Edit: August 14, 2020, 06:41:07 pm by Mr.Madguy »
DynamicData 3.0 is released!
Since now development is frozen - only optimization passes will be made at some point.
Lack of multiple inheritance turns it into abomination.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 577
Re: Port "voxel" DOS demo to Lazarus
« Reply #61 on: August 14, 2020, 07:12:55 pm »
I've managed to merge Windows and DOS demos into one project! Internal errors have been caused by debug info. But I have only one problem to solve. How can I add LCL and BRGABitmap packages only to specific build modes? Is there some simple way to do it or I will have to use some crutch solution, like manually adding search paths?
DynamicData 3.0 is released!
Since now development is frozen - only optimization passes will be made at some point.
Lack of multiple inheritance turns it into abomination.

circular

  • Hero Member
  • *****
  • Posts: 3505
    • Personal webpage
Re: Port "voxel" DOS demo to Lazarus
« Reply #62 on: August 14, 2020, 07:41:09 pm »
That's a good question. I suppose dependencies do not depend on the build mode either.
Conscience is the debugger of the mind

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 577
Re: Port "voxel" DOS demo to Lazarus
« Reply #63 on: August 14, 2020, 08:02:35 pm »
That's a good question. I suppose dependencies do not depend on the build mode either.
I don't know, how to do it. Hardcoding search paths isn't good idea. And there is no easy way to do it, as for example add "-PLCL -PBGRABitmap" options to build mode. So here it is. With little optimization for ModeY - DosMemPut should be faster. There is even faster way - to access memory directly. But it requires asm code, I guess, as it's the only way to deal with selector in 32bit mode.

In order to compile DOS version you need to install cross compiler, extract units from here and choose Dos build mode. Problem is - you need to manually remove packages, cuz they won't compile in this mode. Program requires DOSBox or other DOS emulator to run. Or FreeDOS installed on real machine. Not sure, but CWSDPMI may be required.

CODE1 - initial Mode13 with lazy software double buffering
CODE2 - ModeY (320x200) with direct rendering and hardware double buffering (feels slower, than it should be, but fixing it would overcomplicate things)
DynamicData 3.0 is released!
Since now development is frozen - only optimization passes will be made at some point.
Lack of multiple inheritance turns it into abomination.

josh

  • Hero Member
  • *****
  • Posts: 789
Re: Port "voxel" DOS demo to Lazarus
« Reply #64 on: August 14, 2020, 08:03:43 pm »
You could try
Code: [Select]
{$ifdef lcl}{$endif}
use it in your uses definition to bring in things like forms and bgrabitmap ie.

Code: [Select]
Uses Classes, SysUtils{$ifdef lcl}, Forms, BgraBitmap, Controls, Graphics, Dialogs{$endif};

I have not tested but it may help
« Last Edit: August 14, 2020, 08:05:22 pm by josh »
Development Installation Lazarus 1.3, FPC 2.7.1,Windows 7/8 32/64, OSX, *nix

Test Environment Lazarus & FPC Trunk on Windows and OSX (Cocoa Mainly on OSX). Testing also Crosscompile windows to OSX.. 
Any posts made from 2015 will be based on Lazarus Trunk.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 577
Re: Port "voxel" DOS demo to Lazarus
« Reply #65 on: August 14, 2020, 08:08:34 pm »
You could try
Code: [Select]
{$ifdef lcl}{$endif}
use it in your uses definition to bring in things like forms and bgrabitmap ie.

Code: [Select]
Uses Classes, SysUtils{$ifdef lcl}, Forms, BgraBitmap, Controls, Graphics, Dialogs{$endif};

I have not tested but it may help
I use {$IFDEF go32v2} and it completely removes whole Windows code. Problem is - it's IDE packages, that refuse to compile.
DynamicData 3.0 is released!
Since now development is frozen - only optimization passes will be made at some point.
Lack of multiple inheritance turns it into abomination.

josh

  • Hero Member
  • *****
  • Posts: 789
Re: Port "voxel" DOS demo to Lazarus
« Reply #66 on: August 14, 2020, 08:14:51 pm »
You could also add custom defines to each build mode.
Project->Options->Custom Options
You can then create custom defines for each build mode, and turn on/off which custom define per each build.

ie
{$ifdef VOX_USE_BGRABITMAP} add your stuff {$endif}


Added Just read your above post, was not aware that it was a package issue. Apologies
« Last Edit: August 14, 2020, 08:17:14 pm by josh »
Development Installation Lazarus 1.3, FPC 2.7.1,Windows 7/8 32/64, OSX, *nix

Test Environment Lazarus & FPC Trunk on Windows and OSX (Cocoa Mainly on OSX). Testing also Crosscompile windows to OSX.. 
Any posts made from 2015 will be based on Lazarus Trunk.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 577
Re: Port "voxel" DOS demo to Lazarus
« Reply #67 on: August 14, 2020, 09:22:23 pm »
Ahhhhh. I've found out, that Crt was missing (this should have been wrong!), because DOSBox, I used to install Go32v2 version of FPC, didn't have LFN support. Forced installation of Crt and now manual ReadKey implementation is no longer needed again.
DynamicData 3.0 is released!
Since now development is frozen - only optimization passes will be made at some point.
Lack of multiple inheritance turns it into abomination.

julkas

  • Guest
Re: Port "voxel" DOS demo to Lazarus
« Reply #68 on: August 16, 2020, 01:55:26 pm »
DosBox & TP7

 

TinyPortal © 2005-2018