gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > broken zlib

#82798 - hiddenface - Wed May 10, 2006 3:24 am

Hi,

I recently wanted to load sprites from png files and thus grabbed davr's packaged libpng_ds.zip and compiled it with devkitARM r18.
Everything seemed fine and loading small images is no problem.
But: If i try to load slightly larger pngs (e.g. 96x96) my program fails with an "invalid window size" error.
This message originates in zlib and I have no idea what to do about it.
Strange thing: when I use the precompiled libz.a from thoduv everything works as expected.
I tried several devkitARM revisions back and that didn't change anything.
I'm kinda clueless.
Any ideas?

Thanks
Hiddenface

#82820 - duencil - Wed May 10, 2006 2:14 pm

You could try setting -DMAX_WBITS=15 in the makefile. Your memory requirements for decompression will increase to 32K though, and for compression to 256K.

Not sure why the precompiled lib would work though.

#82848 - josath - Wed May 10, 2006 7:37 pm

yeah, i may have set the window bits lower when i was trying to get it to work. just increase it in the makefile and that should fix it.

the reasone the precompiled one works, is because it was precompiled by someone else.

#82934 - hiddenface - Thu May 11, 2006 7:25 am

Thank you very much, off course that was it, though I could have sworn I tried to tweak every parameter in the Makefile at one point... well back to work :)