Recent

Author Topic: How to speedup the crt unit with cmd.exe or alternative library for a game  (Read 260 times)

d-_-b

  • New Member
  • *
  • Posts: 24
Hi,

I recently have been following the python roguelike tutorial in an attempt to implement my engine in freepascal as a TUI application.

But I ran into problems were the crt unit flushing stdout to the console on each write and that was unbearable slow.

I then tried to compile pdcurses and use h2pas to create a unit for myself to use instead of holding onto my pipe dream of a TUI game and instead make progress with my engine, but there i also failed.

Only to stumble upon BearLibTerminal that is a cpp lib that uses SDL to draw a terminal for you and it has a nice pascal binding that works.

But as mentioned now im not writing a true native tui application, which was kind of one of the goals for me.

So I wonder can anyone recommend an alternative library to assist with speeding up crt drawing?

I'm also not exclusively focusing on cmd.exe/windows but would like a cross platform solution.

Thanks,
Code: Pascal  [Select]
  1. mov     ax,0013h
  2. int     10h
Denthor thanks for the vga programming tutorials | Download all tutorials

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7431
Video?

d-_-b

  • New Member
  • *
  • Posts: 24
Video?

Thanks for mentioning the video unit I will look into it.

I assume it is also what freevision is using.
Code: Pascal  [Select]
  1. mov     ax,0013h
  2. int     10h
Denthor thanks for the vga programming tutorials | Download all tutorials

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7431
Video?

Thanks for mentioning the video unit I will look into it.

I assume it is also what freevision is using.

Yes. It is not really a crt unit as it has gotoxy etc, more a double buffer for the video screen, that is then blitted fairly efficiently.