| |
Case
Registered: Aug 2002 Posts: 142 |
Help the old brain cells
Hi,
I have recently been asked to do some code for a small project the bulk of which is displaying 4 bitmaps one after the other in a loop whilst playing some music.
I was wondering if i could pack the 4 bitmap files, store them in memory until needed and then just depack as required and if this can be done, can anyone help nudge my old brain cells with some pointers.
i am using kickass 4.19 along with relaunch and having fun. |
|
| |
Mixer
Registered: Apr 2008 Posts: 452 |
void*
Depends on many things, but for example a hiress full bitmap is 8000 bytes. Your 4 bitmaps x 8000 = 32000 bytes + possible screen/colormaps another 1000-2000 bytes each x 4is 4000-8000 bytes.
You need 8192+1024 bytes of one bank for showing the graphics.
So we are at 32000+8000+8192+1024 which is 49216, which is less than 65536, so there is room for music.
So all in all you could fit it all in memory even without compressing. |
| |
Smasher
Registered: Feb 2003 Posts: 520 |
Hello Case! this one uses 4 bitmaps packed in a single prg: Meet Us at the Zoo!
I've uploaded the source files (100% spaghetti coding, almost no comments, ehm...). I hope they can be useful for you. if you have questions just ask.
the compiled prg is 250 blocks, so you need to pack it first or use a cartridge that handles memory till $ffxx. |
| |
Smasher
Registered: Feb 2003 Posts: 520 |
"4 bitmaps packed" means that the 4 bitmaps stay all in a single file, one in each vic bank. packed doesn't mean pre-crunched, ok? sorry for the confusion. |
| |
Case
Registered: Aug 2002 Posts: 142 |
thanks for all replies.
it is 4 koala bitmaps, i would have used one per bank as this is the easiest way however the music is sitting in one of the banks and this cannot be changed.
i was hopeing that i could pack the pictures using maybe a level packer and then using a lookup table pick the 1 i want and depack it, display it and then move onto the next one. |