-void WriteAsmFile (const StrBuf* Data, const Collection* A)
+void WriteAsmFile (const StrBuf* Data, const Collection* A, const Bitmap* B)
/* Write the contents of Data to the given file in assembler (ca65) format */
{
FILE* F;
unsigned Size;
+ /* Get the name of the image */
+ const StrBuf* S = GetBitmapName (B);
+
/* Get the file name */
const char* Name = NeedAttrVal (A, "name", "write");
/* Write a readable header */
fprintf (F,
";\n"
- "; This file was generated by %s %s\n"
+ "; This file was generated by %s %s from\n"
+ "; %.*s (%ux%u, %u colors%s)\n"
";\n"
"\n",
ProgName,
- GetVersionAsString ());
-
+ GetVersionAsString (),
+ SB_GetLen (S), SB_GetConstBuf (S),
+ GetBitmapWidth (B), GetBitmapHeight (B),
+ GetBitmapColors (B),
+ BitmapIsIndexed (B)? ", indexed" : "");
/* If we have a segment defined, output a segment directive */
if (Segment) {
#include "coll.h"
#include "strbuf.h"
+/* sp65 */
+#include "bitmap.h"
+
/*****************************************************************************/
-void WriteAsmFile (const StrBuf* Data, const Collection* A);
+void WriteAsmFile (const StrBuf* Data, const Collection* A, const Bitmap* B);
/* Write the contents of Data to a file in assembler (ca65) format */
#include <stdio.h>
#include <string.h>
+/* common */
+#include "attrib.h"
+
/* sp65 */
#include "attr.h"
#include "bin.h"
-void WriteBinFile (const StrBuf* Data, const Collection* A)
+void WriteBinFile (const StrBuf* Data, const Collection* A,
+ const Bitmap* B attribute ((unused)))
/* Write the contents of Data to the given file in binary format */
{
unsigned Size;
#include "coll.h"
#include "strbuf.h"
+/* sp65 */
+#include "bitmap.h"
+
/*****************************************************************************/
-void WriteBinFile (const StrBuf* Data, const Collection* A);
+void WriteBinFile (const StrBuf* Data, const Collection* A, const Bitmap* B);
/* Write the contents of Data to a file in binary format */
-void WriteCFile (const StrBuf* Data, const Collection* A)
+void WriteCFile (const StrBuf* Data, const Collection* A, const Bitmap* B)
/* Write the contents of Data to a file in C format */
{
FILE* F;
unsigned Size;
+ /* Get the name of the image */
+ const StrBuf* S = GetBitmapName (B);
+
/* Get the file name */
const char* Name = NeedAttrVal (A, "name", "write");
/* Write a readable header */
fprintf (F,
"/*\n"
- " * This file was generated by %s %s\n"
+ " * This file was generated by %s %s from\n"
+ " * %.*s (%ux%u, %u colors%s)\n"
" */\n"
"\n",
ProgName,
- GetVersionAsString ());
+ GetVersionAsString (),
+ SB_GetLen (S), SB_GetConstBuf (S),
+ GetBitmapWidth (B), GetBitmapHeight (B),
+ GetBitmapColors (B),
+ BitmapIsIndexed (B)? ", indexed" : "");
/* Output the declaration and identifier */
#include "coll.h"
#include "strbuf.h"
+/* sp65 */
+#include "bitmap.h"
+
/*****************************************************************************/
-void WriteCFile (const StrBuf* Data, const Collection* A);
+void WriteCFile (const StrBuf* Data, const Collection* A, const Bitmap* B);
/* Write the contents of Data to a file in C format */
Collection* A = ParseAttrList (Arg, NameList, 2);
/* Write the file */
- WriteOutputFile (D, A);
+ WriteOutputFile (D, A, C);
/* Delete the attribute list */
FreeAttrList (A);
struct OutputFormatDesc {
/* Write routine */
- void (*Write) (const StrBuf*, const Collection*);
+ void (*Write) (const StrBuf*, const Collection*, const Bitmap*);
};
-void WriteOutputFile (const StrBuf* Data, const Collection* A)
+void WriteOutputFile (const StrBuf* Data, const Collection* A, const Bitmap* B)
/* Write the contents of Data to a file. Format, file name etc. must be given
* as attributes in A. If no format is given, the function tries to autodetect
- * it by using the extension of the file name.
+ * it by using the extension of the file name. The bitmap passed to the
+ * function is the bitmap used as source of the conversion. It may be used to
+ * determine the bitmap properties for documentation purposes.
*/
{
const FileId* F;
}
/* Call the format specific write */
- OutputFormatTable[F->Id].Write (Data, A);
+ OutputFormatTable[F->Id].Write (Data, A, B);
}
/* common */
#include "strbuf.h"
+/* sp65 */
+#include "bitmap.h"
+
/*****************************************************************************/
-void WriteOutputFile (const StrBuf* Data, const Collection* A);
+void WriteOutputFile (const StrBuf* Data, const Collection* A, const Bitmap* B);
/* Write the contents of Data to a file. Format, file name etc. must be given
* as attributes in A. If no format is given, the function tries to autodetect
- * it by using the extension of the file name.
+ * it by using the extension of the file name. The bitmap passed to the
+ * function is the bitmap used as source of the conversion. It may be used to
+ * determine the bitmap properties for documentation purposes.
*/