Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to index page
Thread view  Board view
leisureBamboo

Homepage E-mail

24.09.2020, 03:59
 

pnglib (Announce)

pnglib 1.0, is a free library to read and display PNG images, and is a creation of Thomas Bleeker.
The original code is x86-asm. She(the code) can be link without Zlib.
With the author's permission, Leisure bamboo translate her to c, in the website http://pnglib.sourceforge.net

She(the code) can be compile by turbo c 2.0, and run in pure dos or dosbox.
We can see her in https://sourceforge.net/projects/pnglib/files/pnglib.c/sample.tc2/

She can decompress apng(Animated PNG) now,
There are some demo file 01.png, 04.png ... 32.png in her root folder.
And we show them by her demo LD_FILE.EXE(27k for tc2, 16bit code)
Here is a screen capture(268k).

---
interest in Turbo c, and another traditional program.

Rugxulo

Homepage

Usono,
01.10.2020, 01:13

@ leisureBamboo
 

pnglib

Nice work! I want to look closer at this but haven't found the time.

Why prefer TC 2.01 over newer TC++ 1.01? Both are freeware, but the newer has less bugs.

Yes, this is good to have a 16-bit PNG viewer, most (all?) others are 386+. Do you only support VGA (presumably simpler to do) so far?

leisureBamboo

Homepage E-mail

01.10.2020, 04:57

@ Rugxulo
 

pnglib

> Nice work! I want to look closer at this but haven't found the time.
Thank you.
---------------------

> Why prefer TC 2.01 over newer TC++ 1.01? Both are freeware, but the newer
> has less bugs.
The original x86-asm32 code is written by Thomas, only for masm32.
I translate her(the code) into c version.
Now, she can be compile by borland c 4.5, visual c 6.0,
keil c51 7.5, arm-linux-gcc, or others.
And she can run in dos(dosbox),window, c51's uv2 simulator,arm9 singlechip now.

Turbo c 2.0 is one of above compilers.
---------------------

> Yes, this is good to have a 16-bit PNG viewer, most (all?) others are 386+.
> Do you only support VGA (presumably simpler to do) so far?
In sample.tc2\ld_file.c\int show_bmp_fail(void),
I use vesa(sorry for my poor code):
> if(biBitCount==1)/* mono */
> {grahy_mode(0x105);/* 1024 x768 x 256 */
> pallete(palete,2);
> sub_show(8,1024);
> }
>
> else if(biBitCount==4)/* 16 color */
> {grahy_mode(0x105);/* 1024 x768 x 256 */
> pallete(palete,16);
> sub_show(8,1024);
> }
>
> else if(biBitCount==8)/* 256 color */
> {grahy_mode(0x105);/* 1024 x768 x 256 */
> pallete(palete,256);
> sub_show(8,1024);
> }
>
> else if(biBitCount==16)/* 64K color */
> {grahy_mode(0x117);/* 1024 x 768 x RGB565 */
> sub_show(16,2048);
> }
>
> else if(biBitCount==24)/* 16M color */
> {grahy_mode(0x117);/* 1024 x 768 x RGB565 */
> sub_show(16,2048);
> }
>
> else if(biBitCount==32)/* 4G color */
> {grahy_mode(0x117);/* 1024 x 768 x RGB565 */
> sub_show(16,2048);
> }
>
> else {puts("unknown bmp format\0\$");
> return(1);
> }
Rewrite these code, we can support another screen mode.

---
interest in Turbo c, and another traditional program.

Back to index page
Thread view  Board view
22632 Postings in 2109 Threads, 402 registered users, 392 users online (0 registered, 392 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum