|
Post by DarkKobold on Mar 27, 2019 20:09:29 GMT
It might not be worth the 5 second load time in a HuCard game. I dunno. I think you might be overestimating the time needed to decompress graphics with RLE
I'm suggesting that an algorithm that did RLE decompression on a 16x16 sprite in palette form, and converted it to VRAM format would be incredibly slow. Sure, VRAM RLE to decompressed RLE would be fast. But to truly get the savings, you'd have to do all the math for VRAM conversion in code.
Byte1&0x01 << 8 + Byte2 & 0x01 << 7 + Byte3 & 0x01 << 6 ....
Byte1&0x02 << 7 + Byte2 & 0x02 << 6 + Byte3 & 0x02 << 5 ....
etc etc etc.
So, yeah, I thought some of this might be within my skillset. I'm quickly learning I'm well outside my depth.
EDIT: Huc6802 does have ROR ROL functions. My bad.
|
|
|
Post by elmer on Mar 28, 2019 1:14:14 GMT
That said, the motivation is because we are at 600kB, and we don't have a single SFX or Husak song in place. We don't know if that's going to take 10kB or 300kB.... And even if it doesn't take much, we're still burning through ROM space. Each song in Huzak should be way less than 8KB, unless you hit michirin9801-like levels of complexity. IIRC, her largest tune was approx 10KB. The use of samples will dramatically change that, though. If you're only at 60% usage, you're far from needing to panic about this, yet. Try allocating a static array of 1024, 2048 and 4906 chars (bytes). If you can do even one of those, then you've got enough free space to add in some kind of LZ77 decompression later on. The larger the space, the better for the compression, but you should get decent results with even a 1024 byte window. If you can do that, then leave it allocated so that you won't use the memory for anything else, and then I can throw a simple compressor into HuC at some point. BTW ... in response to your earlier comment, "yes", using HuC has avoided you needing to learn about too much about the hardware and saved you from getting bogged-down in a mountain of details when you're just getting started. Just like all of the old home computers that came with BASIC ... that's the point of providing a relatively-easy-to-use high-level language. For some people, HuC (or BASIC) will be as much as they want to learn, and do all that they need. For others, they're just a starting point into getting down-and-dirty with the low-level details that will allow them to put together much more ambitious projects as they learn more and more.
|
|