Re: A89: Re: Hello everyone.


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

Re: A89: Re: Hello everyone.




SirKnight writes:
 > Subroutine is the correct word.  But the idea is that in your code you put
 > the uncompressed images, and the assembler (compiles?) the code and
 > compresses the images then includes the _subroutine_ :) and automatically
 > calls it when needed.

Not practical, IMHO. On one hand, the assembler has to know that it is 
an image and not just general data. Also, the assembler has to know
*when* do you need the image (which it can't possibly) and decode it
just in time according your proghram flow (which the assembler can not 
deduce, not even theoretically - this is equivalent to the halting
problem, which is proven to be unsolvable).
In addition, the assembler should know *where* do you want the
decompressed image to be placed, which, again, it can't.

If you do games programming, then you usually do serious multitasking
and the compressed images are decompressed in parallel to the main
flow of the game. You have to have a prediction engine which will
select the images (and sonds) to decompress, cache and so on so that 
the current working set of images is always available. In addition, 
depending on the image content, different compression algorithms can 
be used, with decompression speed and size often traded in for the 
other, depending on your particular requirements for that particular 
image.

This extra knowledge is in your hand but it's not in the assembler's. 
Therefore, if space is a concern, you just compress the images with
whichever tool you choose and include the resulting data in your
assembly source. Then in your program you just bsr Decompress whenever 
you need the uncompressed image.

Added bonus is that the image is not compressed every time you
assemble the source thus you save some development time as well.

Regards,

Zoltan


References: