Tuesday, March 27, 2007

Let's use libraries!

Quite enough time passed since function #68.19 was introduced, but no one has used it yet AFAIK. I decided to break the wall and make one. Well, two. These are libraries to work with files, ordinary and INI. Below is what currently implemented:

  • libio
    • file.size
    • file.open
    • file.read
    • file.write
    • file.seek
    • file.tell
    • file.eof?
    • file.seteof
    • file.close
  • libini
    • ini.get_str
    • ini.get_int
    • ini.set_str
    • ini.set_int
Files are open-source, use them as you like. Code for DLL loading has been originally written by diamond. You can download them from my MeOS/KoOS-dedicated site, http://mikedld.com/

Wednesday, March 7, 2007

Just a bit of poetry

Sorry, it's in Russian...

Я заболел, когда тебя увидел
Как шум грозы я сердце услыхал
И сразу же себя возненавидел
И чувства все поглубже запихал

Я в голове мешал любовь и ярость
Крепил сознанье, нежность затая
Молил, чтоб никуда не потерялось
То чудо, образ твой, что видел я

К несчастью, память подвела безумца
Лишь символы мне дороги теперь
Теряю разум, не могу проснуться
Тебя люблю, люблю тебя, поверь

Sunday, March 4, 2007

Performance: 'gfx' vs. 'trunk'

Today I decided to make some tests add see if gfx kernel better. Good old MGB was the first and the last program I thought about, so I tried it and understood that it doesn't satisfy my needs. I disassembled (there's no source code, may MGB author forgive me) and changed it a bit.
Here're the results (1024x768@32bpp, numbers are primitives count drawn in one second):


Gfx is on the left, and trunk is on the right. As you can see, results aren't bad at all. I just need to optimize some things (I already know about them, e.g. check if bank switch needed and not call it for every pixel). Filled rectangle drawing, for example, was slower by almost a half, and after small modification it's better by 300 primitives.

About so-called 'gfx kernel'

OK, as many people were asking me recently, what's the difference between 'trunk' and 'gfx' kernels, here's a brief explanation (now I can send you there instead of saying same words once again).
So, gfx kernel ...

  • ... allows you to select any video mode (resolution and bits per pixel) obtained with VESA interface any system supports;
  • ... allows you to drag windows outside the screen and use negative coordinates anywhere you want;
  • ... loads '/rd/1/drivers/vmode.mdr' file on system boot and calls its 'init' function, which substitutes graphics functions pointers with its own; standard 'vmode.mdr' allows you to only change resolution on the fly (and not all monitors support this VGA registers mangling);
  • ... has separate functions for each BPP mode optimizing graphics performance this way even better;
  • ... allows you to write your own driver and replace 'vmode.mdr' with it; this means, you could make (or find) driver which uses you graphics card acceleration capabilities.