As I mentioned in my post about my libjpeg port I had also started porting libpng. And now here's the result: http://jiggawatt.org/badc0de/dpng32x.zip
The modified libpng & libz sources: http://jiggawatt.org/badc0de/lpng_lz-32x.zip
To make the libraries, first enter the zlib-1.2.3 directory and do make libz.a. Then enter the lp140b106 directory and do make -f makefile.32x libpng.a.
Again, the heap boundaries for the allocator are hardcoded. I let libpng use 0x0601F000..0x0602EFFF and zlib use 0x0602F000..0x0603EFFF.
PNG decoder
Moderator: BigEvilCorporation
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
I realized that I probably should define PNG_NO_FLOATING_POINT_SUPPORTED and PNG_NO_MNG_FEATURES when building libpng.
Floating point math is only used for stuff like gamma correction which I didn't use in the decoding demo anyway, but getting rid of the floating point emulation code reduced the size of the library by about 10% at least.. And it no longer requires libm or libg.
Here's the new version of the demo + libpng.a: http://jiggawatt.org/badc0de/dpng32x-2.zip
Floating point math is only used for stuff like gamma correction which I didn't use in the decoding demo anyway, but getting rid of the floating point emulation code reduced the size of the library by about 10% at least.. And it no longer requires libm or libg.
Here's the new version of the demo + libpng.a: http://jiggawatt.org/badc0de/dpng32x-2.zip
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Yep. Actually, now it's down to 111 kB (compared to the 166 kB of the first version). The code is ROM though, but 128 kB of RAM are reserved for the heaps that the two libraries can allocate memory from when they are used.
The current libpng/zlib sources can be found here: http://jiggawatt.org/badc0de/lpng_lz-32x_sat.zip. It's now the same for 32X and Saturn, just with different makefiles. And build instructions are included in the files named README_32X_SATURN.TXT.
The current libpng/zlib sources can be found here: http://jiggawatt.org/badc0de/lpng_lz-32x_sat.zip. It's now the same for 32X and Saturn, just with different makefiles. And build instructions are included in the files named README_32X_SATURN.TXT.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm