Tuesday, April 12, 2005

lovely windows API

Here we go... after winning a bit of laziness I implemented a windows' version of my mandelbrot zoomer. It's 20K (about 30 times bigger than then DOS version) and does more or less the same thing.... ok... I'm a bit unfair to windows; this new version has a better palette and a better image quality and also it was written in a C/asm mix because I'm way too lazy to write under windows in pure assembler.

NEWS: I've to eat my words about how fat windows executables must be; it turned out that it's the standard C initialization code inserted by default by VC++ that is fat. Removing that initialization code the program size went down to a 16Kb that UPX is able to shrink into less than 5Kb.

2 comments:

Davide Pasca said...

Much nicer !
If there is one thing that didn't improve on PC's since the beginning of the times, it's it's ability to blur large pixels 8)
As for the size. I think that 20K is pretty reasonable ! It may me 30 times as much, but that's, of course, just 20K of basic stuff that gets included only once.

6502 said...

Big news... reading a diskmag about how to write intros for windows I discovered that the extra code is just initialization code (command line parsing and things like that) that can be removed setting properly VC++ options if you don't use the standard C library. Playing some small extra trick and calling UPX on the result the code size for the windows version is now down to 4608 bytes. To get smaller one must got to a .COM file (com files have no headers) playing very bad tricks (like creating a .exe on the fly, calling it and then deleting it)