[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 48K stage-loaded to 64K single-load?



Steve Nickolas wrote:
On Fri, 11 May 2012, Michael J. Mahon wrote:

I think he was suggesting that you could single-load the
*compressed* levels, then replace the disk access routine
with a routine to decompress them into the level buffer.

That way, you get a lot more levels in RAM.


True. But then I can't compress them *again* - and I don't know how to use the decompression code apart from SFX.

I'm not sure I understand.  Do the levels get modified and need to
be "saved" back to RAM in compressed form?  That seems unlikely.

Since the levels contain lots of repetition, they should, in principle,
compress pretty well using an appropriate compression scheme (hopefully
a simple one, since compression and decompression routines need to be
small to keep an advantage).

Depending on the kind of redundancy in the levels, it's possible that
a simple run-length compression would do nicely, and both compressor
and decompressor would be less than a page of code.

On the other hand, it seems unlikely that the compressor would need to
be resident, unless the levels are updated (that would mean disk writes
in the original game).

Practically any decompression routine will take a pointer to the
compressed data and a pointer to where the result goes, possibly
plus a maximum length to prevent disasters.  Then a JSR gets the
job done.

-michael

NadaNet 3.1 for Apple II parallel computing!
Home page:  http://home.comcast.net/~mjmahon/

"The wastebasket is our most important design
tool--and it's seriously underused."