Recent

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

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
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 »
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
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?
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

circular

  • Hero Member
  • *****
  • Posts: 4217
    • 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: 844
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)
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

Josh

  • Hero Member
  • *****
  • Posts: 1273
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 »
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
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.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

Josh

  • Hero Member
  • *****
  • Posts: 1273
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 »
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
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.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

julkas

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

 

TinyPortal © 2005-2018