Added VIC2 sprites as output format. Started to code the processing pipeline:

--slice, --pop.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5582 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-03-09 11:37:10 +00:00
parent 19ffc1ab08
commit 006be848f2
8 changed files with 317 additions and 28 deletions

View File

@@ -33,38 +33,70 @@
/* common */
#include "attrib.h"
/* sp65 */
#include "error.h"
#include "koala.h"
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Screen size of a koala picture */
#define WIDTH 160U
#define HEIGHT 200U
/*****************************************************************************/
/* Code */
/*****************************************************************************/
StrBuf* GenKoala (const Bitmap* B, const Collection* A)
StrBuf* GenKoala (const Bitmap* B, const Collection* A attribute ((unused)))
/* Generate binary output in koala format for the bitmap B. The output is
* stored in a string buffer (which is actually a dynamic char array) and
* returned.
*/
{
/* Koala pictures are always 160x200 in size with 16 colors */
if (GetBitmapType (B) != bmIndexed ||
GetBitmapColors (B) > 16 ||
GetBitmapHeight (B) != 200 ||
GetBitmapWidth (B) != 160) {
StrBuf* D;
unsigned char Screen[160][200];
unsigned char X, Y;
/* Koala pictures are always 160x200 in size with 16 colors */
if (GetBitmapType (B) != bmIndexed ||
GetBitmapColors (B) > 16 ||
GetBitmapHeight (B) != HEIGHT ||
GetBitmapWidth (B) != WIDTH) {
Error ("Bitmaps converted to koala format must be in indexed mode "
"with 16 colors max and a size of 160x200");
}
"with 16 colors max and a size of %ux%u", WIDTH, HEIGHT);
}
/* Read the image into Screen */
for (Y = 0; Y < HEIGHT; ++Y) {
for (X = 0; X < WIDTH; ++X) {
Screen[X][Y] = (unsigned char) GetPixel (B, X, Y).Index;
}
}
/* Create the output buffer and resize it to the required size. */
D = NewStrBuf ();
SB_Realloc (D, 10003);
/* Add $4400 as load address */
SB_AppendChar (D, 0x00);
SB_AppendChar (D, 0x44);
/* Return the converted bitmap */
return D;
}