I've built a version of libjpeg for the 32X so I thought I should post it here.
Decoding demo ROM plus source code and a prebuilt version of libjpeg.a (tested and works on a real 32X): http://jiggawatt.org/badc0de/djpeg32x.zip
And here are my modified libjpeg sources: http://jiggawatt.org/badc0de/jpeg-7-32x.zip
To build the library just do make -f makefile.unix libjpeg.a
If you're on a non-Windows system you'll have to rebuild ansi2knr first with your regular gcc, i.e:
gcc ansi2knr.c
make -f makefile.unix libjpeg.a
I borrowed the memory allocator from the Wolf32X sources. Since bss_end isn't known at the time when the library is built I just hardcoded the heap address (you can find it in jdapimin.c - look for the call to MSYS_Init). The library should work on the Saturn as well if you modify the heap start/endpoint and rebuild it.
Note that I've removed the compression parts of the library in the makefile since I only considered the decompression routines to be relevant.
JPEG decoder
Moderator: BigEvilCorporation
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
This is pretty cool
it would have been fun if you'd show the decoding process rather than showing black and then the result
it would have been fun if you'd show the decoding process rather than showing black and then the result
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Well, go ahead and modify read_JPEG_file to flip the frame buffer every once in a while if you want to
I decided to start porting libpng as well. I've managed to build libpng (and libz) for the 32X already, as well as a decoding test much like the one I did for JPEG. It's not working properly though, so I'll have to do some debugging.
I decided to start porting libpng as well. I've managed to build libpng (and libz) for the 32X already, as well as a decoding test much like the one I did for JPEG. It's not working properly though, so I'll have to do some debugging.
I've cleaned up the library code a bit so that there's now a single archive for both the 32X and Saturn, with different makefiles depending on your target: http://jiggawatt.org/badc0de/jpeg-7-32x_sat.zip
Use:
make -f makefile.32x libjpeg.a
or
make -f makefile.saturn libjpeg.a
Use:
make -f makefile.32x libjpeg.a
or
make -f makefile.saturn libjpeg.a