You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server
We have an anniversary Game Jam! Click here for more info.

Custom Bitmap Format

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0
b/PC, Mac & Vintage Computers publicado por u/rowan_futurerave November 16, 2018, 08:46:55 AM
Hi all. Am thinking of creating a custom bitmap format due to awkwardness I am experiencing with a lib (glaux.lib) which has been deprecated.

What would anyone else add to a custom bitmap format?

Not RLE. Possibly encryption. What else??

>:D

*edit - one idea - strangely ordered scanlines
Last Edit: November 16, 2018, 09:13:39 AM by rowan_futurerave
Inicia sesión o crea una cuenta para dejar un comentario
u/gameblabla November 16, 2018, 01:39:14 PM
You could use a raw format (RGB565, RGB8, RGB555 etc...) then compress it with an algorithm known to decompress pretty fast such as lz4.If your compiler is somewhat modern, then the best choice would probably be zStandard. It has higher compression rates than lz4 while being much faster than its other alternatives. (although lz4 is still faster)
If your platform is using a Motorola 68000 cpu, stef made a fast decompressor called lz4w for that CPU family. It can be found in assembly form here :https://github.com/Stephane-D/SGDK/blob/e8d6e7e6668579e1299e19f1c024dd8dc16d430e/src/tools_a.s
Function call in C is as such :u16 lz4w_unpack(const u8 *src, u8 *dest);
On the same platform, aplib is also another good alternative but it's a fair amount slower.
As for encryption, well it's just easier to do it outside out of the file format because that would require more work (separate the actual image data from the header then compare it to a hash etc...).
Make sure the file format meets your needs only. On the Atari falcon, space was of no concern so i simply made a raw RGB565 format except flipped for Big endian cpus. Of course on little endian machines, this is not a concern and you can go for compression for example.
u/rowan_futurerave November 16, 2018, 11:29:58 PM
Nice thoughts gameblabla you have inspired me, I now have decided on the file spec. Woot  (-_(//));
Start a Discussion

b/PC, Mac & Vintage Computers

Computer programming discussion and project showcase

134
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal