Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #1213

Announcing: Hacking it In And UnPacking It Out - Portable HackBytes in C

From "Bill Buckels" <bbuckels@mts.net>
Newsgroups comp.sys.apple2.programmer
Subject Announcing: Hacking it In And UnPacking It Out - Portable HackBytes in C
Date 2014-05-07 01:36 -0500
Organization Aioe.org NNTP Server
Message-ID <lkck8o$dq9$1@speranza.aioe.org> (permalink)

Show all headers | View raw


Read about it here:
http://www.appleoldies.ca/graphics/shr/PortableHackBytesMay2014.pdf

Download it here:
http://www.appleoldies.ca/graphics/shr/P2P.zip

Complete with MinGW (gcc) Win32 executable, source, test images and 
documentation. Open Source. See licence for details.

This article provides a working program called "p2p" as a practical and 
portable C language programming example of using Apple IIgs "PackBytes" 
Run-Length Encoding (RLE).

Also provided in this article is a relatively detailed description of 
Portable HackBytes. This is the PackBytes encoder that I have written, and 
that I demonstrate in the p2p program and explain in this document.

Portable HackBytes achieves slightly better compression than Apple Computer's 
PackBytes encoder by using a simple list processor and simple logic. Future 
optimizations have been identified but have not been implemented for the 
first release (this bundle). Whether or not I take this further as a command 
line utility will depend largely on the degree of interest in more efficient 
PackBytes data compression.

HackBytes and Apple Computer's less robust PackBytes encoded SHR images both 
unpack the same way. But not all encoders are created equal. Besides the 
smaller encoded size provided by HackBytes it is certainly much faster to 
pack or unpack SHR images on a modern computer.

The RLE list processor included in this release is adaptable to other RLE 
schemes of the same vintage as well.

P2P(C) Version 1.0 Copyright Bill Buckels 2014
All Rights Reserved.
Portable HackBytes(C) Copyright Bill Buckels 2014
All Rights Reserved.
UnPackBytes(c) Copyright (c) 2007, FaddenSoft, LLC
All rights reserved.
Raw format to Portable HackBytes Encoded format:
Default:
Usage: "p2p file.shr" or "p2p file.sh3"
Output: file.pnt
Option -p (Packed Screen)
"p2p file.shr -p" or "p2p file.sh3 -p"
Output: file.pak or file.pa3
Option -u (UnPack)
PackBytes Encoded format to Raw format:
Usage: "p2p file.pnt -u" or "p2p file.pak -u"
Output: file.shr
"p2p file.pnt -u" or "p2p file.pa3 -u"
Output: file.sh3
Option -t (CiderPress File Attribute Preservation Tags)
Option -s (-s1 to -s4 Singleton Thresholds)
Option -q disable HackQuads (for demo purposes only)
See Source Code and Documentation for More Information!

Anything you read on PackBytes would probably lead you to believe that 4 
different StereoTypes of mutually exclusive encoding exist. Common sense and 
HackBytes say that PackBytes has only two types of encoding  and not 4!

"Classic" run length encoding schemes are somewhat simpler than PackBytes 
encoding but the idea is still the same; encode Singletons and Repeats 
separately.

I am also very pleased to retract my initial thoughts of some less robust 
PackBytes encoder that I had originally written. This is all covered in my 
article.

Unfortunately I am forced to withdraw my first wish to release this under 
Creative Commons. That just isn't possible in its present form and I am 
inclined to leave this part as is since my own purposes are not affected.

I realize this is a rather trivial effort, something like putting printf 
into a loop to test the performance of a C compiler, but this is something I 
think needed to be done in order for me to move-on with some more advanced 
efforts for working with SHR images that I will be releasing for Win32 
shortly

Note Also: Due to lack of interest I will no longer be providing binaries 
from my websites for Linux or OSX. Unless of course I see a better effort. 
After all, it takes much less time for a Linux or OSX user to run a compiler 
than it does to write a program. I will also not accept binaries from 
anonymous sources. That's just about being careful and not damaging anyone's 
computer.

This decision of mine would simplify the release of my proposed Apple II 
Image Studio. I initially intended to provide desktop binaries for use in 
Linux and OSX. But I already have much of the code written for a simpler 
Win32 version in MicroSoft C which is much easier for me. Since I doubt if I 
will port my studio to other platforms when complete due to lack of support 
from Linux and OSX users in providing me with binaries of my utilities for 
those respective platforms, in some small way this studio of mine becomes 
like AppleWin and CiderPress, and accessible to the majority of computer 
users who are of course Windows users, but not available otherwise.

That's really too bad from my view but facts is facts. There seems little 
interest despite the fun that can be had from any of this so a guy just 
needs to cut his losses.

Best Regards,

Bill

Back to comp.sys.apple2.programmer | Previous | Next | Find similar | Unroll thread


Thread

Announcing: Hacking it In And UnPacking It Out - Portable HackBytes in C "Bill Buckels" <bbuckels@mts.net> - 2014-05-07 01:36 -0500

csiph-web