cbmplugs-1.2.2/0002755000175000000500000000000011305231507011453 5ustar taosrccbmplugs-1.2.2/Commodore64.gpl0000644000175000000500000000055711305231425014261 0ustar taosrcGIMP Palette Name: Commodore 64 Columns: 8 # 0 0 0 Black 255 255 255 White 104 55 43 Red 112 164 178 Cyan 111 61 134 Purple 88 141 67 Green 53 40 121 Blue 184 199 111 Yellow 111 79 37 Light Brown 67 57 0 Brown 154 103 89 Light Red 68 68 68 Dark Gray 108 108 108 Medium Gray 154 210 132 Light Green 108 94 181 Light Blue 149 149 149 Light Gray cbmplugs-1.2.2/hws.c0000644000175000000500000001016411305231425012417 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; #if 0 gint32 image_ID; #endif *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; #if 0 if (strcmp(name, "file_hws_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, HWS); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else #endif if (strcmp(name, "file_hws_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, HWS)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { #if 0 static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); #endif static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); #if 0 gimp_install_procedure("file_hws_load", "loads images in Hires with Sprite Layer " "file format", "This plug-in loads images in Hires with " "Sprite Layer file format.", "David Weinehall ", "David Weinehall", "2006", "/HWS", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_hws_load", "hws", ""); #endif gimp_install_procedure("file_hws_save", "saves images in Hires with Sprite Layer " "file format", "This plug-in saves images in Hires with " "Sprite Layer file format.", "David Weinehall ", "David Weinehall", "2006", "/HWS", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_hws_save", "hws", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/AUTHORS0000644000175000000500000000024611305231425012522 0ustar taosrcAuthors of cbmplugs. David Weinehall * All programming Maurtis Rijk * Inspiration and starting point for the first implementation David Murray * DTV v3 palette cbmplugs-1.2.2/sprite.c0000644000175000000500000000517611305231425013133 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_sprite_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, SPRITE)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_sprite_save", "saves images as Commodore 64 sprites", "This plug-in saves images as Commodore 64 sprites.", "David Weinehall ", "David Weinehall", "2002", "/Sprite", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_sprite_save", "spr", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/suxx.c0000644000175000000500000000774711305231425012642 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright (C) 2002-2005 David Weinehall * * These plugins are based off of work * * Copyright (C) 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_suxx_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, SUXX); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_suxx_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, SUXX)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_suxx_load", "loads images in Suxx-Editor file format", "This plug-in loads images in Suxx-Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/Suxx", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_suxx_load", "sux", ""); gimp_install_procedure("file_suxx_save", "saves images in Suxx-Editor file format", "This plug-in saves images in Suxx-Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/Suxx", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_suxx_save", "sux", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/shflixl.c0000644000175000000500000001005411305231425013265 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_shflixl_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, SHFXL); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } #if 0 } else if (strcmp(name, "file_shflixl_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, SHFXL)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } #endif } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); #if 0 static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); #endif gimp_install_procedure("file_shflixl_load", "loads images in SHF-XL Edit file format", "This plug-in loads images in SHF-XL Edit file format.", "David Weinehall ", "David Weinehall", "2002", "/SHFLI-XL", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_shflixl_load", "shfxl", ""); #if 0 gimp_install_procedure("file_shflixl_save", "saves images in SHF-XL Edit file format", "This plug-in saves images in SHF-XL Edit file format.", "David Weinehall ", "David Weinehall", "2002", "/SHFLI-XL", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_shflixl_save", "shfxl", ""); #endif } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/afli.c0000644000175000000500000000774711305231425012546 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_afli_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, AFLI); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_afli_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, AFLI)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_afli_load", "loads images in AFLI Editor file format", "This plug-in loads images in AFLI Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/AFLI", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_afli_load", "afli", ""); gimp_install_procedure("file_afli_save", "saves images in AFLI Editor file format", "This plug-in saves images in AFLI Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/AFLI", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_afli_save", "afli", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/cbmplugs.c0000644000175000000500000013360311305231425013436 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include "cbmplugs.h" enum { LORES = 0x0, HIRES, } gfxmode; enum { NORMAL = 0x0, FLI8, } colmode; /* Standard C64 and C128 VIC */ static guchar vicpalette[] = { 0x00, 0x00, 0x00, /* Black */ 0xff, 0xff, 0xff, /* White */ 0x68, 0x37, 0x2b, /* Red */ 0x70, 0xa4, 0xb2, /* Cyan */ 0x6f, 0x3d, 0x86, /* Purple */ 0x58, 0x8d, 0x43, /* Green */ 0x35, 0x28, 0x79, /* Blue */ 0xb8, 0xc7, 0x6f, /* Yellow */ 0x6f, 0x4f, 0x25, /* Orange */ 0x43, 0x39, 0x00, /* Brown */ 0x9a, 0x67, 0x59, /* Light Red */ 0x44, 0x44, 0x44, /* Dark Gray */ 0x6c, 0x6c, 0x6c, /* Medium Gray */ 0x9a, 0xd2, 0x84, /* Light Green */ 0x6c, 0x5e, 0xb5, /* Light Blue */ 0x95, 0x95, 0x95 /* Light Gray */ }; #define KOALA_BASE 0x6000 #define KOALA_BITMAP (0x6000 - KOALA_BASE + 2) #define KOALA_MCOLOUR (0x7f40 - KOALA_BASE + 2) #define KOALA_COLOUR (0x8328 - KOALA_BASE + 2) #define KOALA_BG (0x8710 - KOALA_BASE + 2) #define KOALA_SIZE (0x8711 - KOALA_BASE + 2) #define ADVOCP_BASE 0x2000 #define ADVOCP_BITMAP (0x2000 - ADVOCP_BASE + 2) #define ADVOCP_MCOLOUR (0x3f40 - ADVOCP_BASE + 2) #define ADVOCP_BG (0x4328 - ADVOCP_BASE + 2) #define ADVOCP_COLOUR (0x4338 - ADVOCP_BASE + 2) #define ADVOCP_SIZE (0x4720 - ADVOCP_BASE + 2) #define OCP_BASE 0x2000 #define OCP_BITMAP (0x2000 - OCP_BASE + 2) #define OCP_MCOLOUR (0x3f40 - OCP_BASE + 2) #define OCP_SIZE (0x4328 - OCP_BASE + 2) #define SUXXV2_BASE 0x5a24 #define SUXXV2_COLOUR (0x5a24 - SUXXV2_BASE + 2) #define SUXXV2_MCOLOUR (0x5c18 - SUXXV2_BASE + 2) #define SUXXV2_BITMAP (0x6000 - SUXXV2_BASE + 2) #define SUXXV2_SIZE (0x7f40 - SUXXV2_BASE + 2) #define SUXXV3_BASE 0x5a23 #define SUXXV3_BG (0x5a23 - SUXXV3_BASE + 2) #define SUXXV3_COLOUR (0x5a24 - SUXXV3_BASE + 2) #define SUXXV3_MCOLOUR (0x5c18 - SUXXV3_BASE + 2) #define SUXXV3_BITMAP (0x6000 - SUXXV3_BASE + 2) #define SUXXV3_SIZE (0x7f40 - SUXXV3_BASE + 2) #define VIDCOM_BASE 0x5800 #define VIDCOM_COLOUR (0x5800 - VIDCOM_BASE + 2) #define VIDCOM_MCOLOUR (0x5c00 - VIDCOM_BASE + 2) #define VIDCOM_BITMAP (0x6000 - VIDCOM_BASE + 2) #define VIDCOM_SIZE (0x7f40 - VIDCOM_BASE + 2) #define ARTIST_BASE 0x4000 #define ARTIST_BITMAP (0x4000 - ARTIST_BASE + 2) #define ARTIST_MCOLOUR (0x6000 - ARTIST_BASE + 2) #define ARTIST_COLOUR (0x6400 - ARTIST_BASE + 2) #define ARTIST_BG (0x67ff - ARTIST_BASE + 2) #define ARTIST_SIZE (0x6800 - ARTIST_BASE + 2) #define BLAZE_BASE 0xa000 #define BLAZE_BITMAP (0xa000 - BLAZE_BASE + 2) #define BLAZE_MCOLOUR (0xc000 - BLAZE_BASE + 2) #define BLAZE_COLOUR (0xc400 - BLAZE_BASE + 2) #define BLAZE_SIZE (0xc800 - BLAZE_BASE + 2) #define IMSYS_BASE 0x3c00 #define IMSYS_COLOUR (0x3c00 - IMSYS_BASE + 2) #define IMSYS_BITMAP (0x4000 - IMSYS_BASE + 2) #define IMSYS_MCOLOUR (0x6000 - IMSYS_BASE + 2) #define IMSYS_SIZE (0x63e8 - IMSYS_BASE + 2) #define FLI_BASE 0x3c00 #define FLI_COLOUR (0x3c00 - FLI_BASE + 2) #define FLI_MCOLOUR0 (0x4000 - FLI_BASE + 2) #define FLI_MCOLOUR1 (0x4400 - FLI_BASE + 2) #define FLI_MCOLOUR2 (0x4800 - FLI_BASE + 2) #define FLI_MCOLOUR3 (0x4c00 - FLI_BASE + 2) #define FLI_MCOLOUR4 (0x5000 - FLI_BASE + 2) #define FLI_MCOLOUR5 (0x5400 - FLI_BASE + 2) #define FLI_MCOLOUR6 (0x5800 - FLI_BASE + 2) #define FLI_MCOLOUR7 (0x5c00 - FLI_BASE + 2) #define FLI_BITMAP (0x6000 - FLI_BASE + 2) #define FLI_SIZE (0x8000 - FLI_BASE + 2) #define FLIV2_BASE 0x3b00 #define FLIV2_BG (0x3b00 - FLIV2_BASE + 2) #define FLIV2_COLOUR (0x3c00 - FLIV2_BASE + 2) #define FLIV2_MCOLOUR0 (0x4000 - FLIV2_BASE + 2) #define FLIV2_MCOLOUR1 (0x4400 - FLIV2_BASE + 2) #define FLIV2_MCOLOUR2 (0x4800 - FLIV2_BASE + 2) #define FLIV2_MCOLOUR3 (0x4c00 - FLIV2_BASE + 2) #define FLIV2_MCOLOUR4 (0x5000 - FLIV2_BASE + 2) #define FLIV2_MCOLOUR5 (0x5400 - FLIV2_BASE + 2) #define FLIV2_MCOLOUR6 (0x5800 - FLIV2_BASE + 2) #define FLIV2_MCOLOUR7 (0x5c00 - FLIV2_BASE + 2) #define FLIV2_BITMAP (0x6000 - FLIV2_BASE + 2) #define FLIV2_SIZE (0x7f40 - FLIV2_BASE + 2) #define AFLI_BASE 0x4000 #define AFLI_MCOLOUR0 (0x4000 - AFLI_BASE + 2) #define AFLI_MCOLOUR1 (0x4400 - AFLI_BASE + 2) #define AFLI_MCOLOUR2 (0x4800 - AFLI_BASE + 2) #define AFLI_MCOLOUR3 (0x4c00 - AFLI_BASE + 2) #define AFLI_MCOLOUR4 (0x5000 - AFLI_BASE + 2) #define AFLI_MCOLOUR5 (0x5400 - AFLI_BASE + 2) #define AFLI_MCOLOUR6 (0x5800 - AFLI_BASE + 2) #define AFLI_MCOLOUR7 (0x5c00 - AFLI_BASE + 2) #define AFLI_BITMAP (0x6000 - AFLI_BASE + 2) #define AFLI_SIZE (0x8000 - AFLI_BASE + 2) #define SPRITE_BASE 0x2000 #define SPRITE_BITMAP (0x2000 - SPRITE_BASE + 2) #define TLIGHT_BASE 0x5800 #define TLIGHT_COLOUR (0x5800 - TLIGHT_BASE + 2) #define TLIGHT_BG (0x5bff - TLIGHT_BASE + 2) #define TLIGHT_MCOLOUR (0x5c00 - TLIGHT_BASE + 2) #define TLIGHT_BITMAP (0x6000 - TLIGHT_BASE + 2) #define TLIGHT_SIZE (0x7f40 - TLIGHT_BASE + 2) #define RAIN_BASE 0x4000 #define RAIN_SCREEN1 (0x4000 - RAIN_BASE + 2) #define RAIN_MAGIC (0x43f0 - RAIN_BASE + 2) #define RAIN_COLTAB (0x43f4 - RAIN_BASE + 2) #define RAIN_SCREEN2 (0x4400 - RAIN_BASE + 2) #define RAIN_CHARMAP (0x4800 - RAIN_BASE + 2) #define RAIN_SPRMAP1 (0x5000 - RAIN_BASE + 2) #define RAIN_SPRMAP2 (0x5a00 - RAIN_BASE + 2) #define EAFLI_BASE 0x8000 #define EAFLI_MCOLOUR0 (0x8000 - EAFLI_BASE + 2) #define EAFLI_SPRMAP0 (0x81c0 - EAFLI_BASE + 2) #define EAFLI_SPRCOL0 (0x81ff - EAFLI_BASE + 2) #define EAFLI_SPRCOL1 (0x823f - EAFLI_BASE + 2) #define EAFLI_SPRCOL3 (0x827f - EAFLI_BASE + 2) #define EAFLI_SPRCOL2 (0x82bf - EAFLI_BASE + 2) #define EAFLI_MFLAG (0x82ff - EAFLI_BASE + 2) #define EAFLI_MCOLOUR1 (0x8400 - EAFLI_BASE + 2) #define EAFLI_SPRMAP1 (0x85c0 - EAFLI_BASE + 2) #define EAFLI_MCOLOUR2 (0x8800 - EAFLI_BASE + 2) #define EAFLI_SPRMAP2 (0x89c0 - EAFLI_BASE + 2) #define EAFLI_MCOLOUR3 (0x8c00 - EAFLI_BASE + 2) #define EAFLI_SPRMAP3 (0x8dc0 - EAFLI_BASE + 2) #define EAFLI_MCOLOUR4 (0x9000 - EAFLI_BASE + 2) #define EAFLI_MCOLOUR5 (0x9400 - EAFLI_BASE + 2) #define EAFLI_MCOLOUR6 (0x9800 - EAFLI_BASE + 2) #define EAFLI_MCOLOUR7 (0x9c00 - EAFLI_BASE + 2) #define EAFLI_BITMAP (0xa000 - EAFLI_BASE + 2) #define EAFLI_SIZE (0xadc0 - EAFLI_BASE + 2) #define IP64H_BASE 0x4000 #define IP64H_BITMAP (0x4000 - IP64H_BASE + 2) #define IP64H_MCOLOUR (0x5f40 - IP64H_BASE + 2) #define IP64H_SIZE (0x6328 - IP64H_BASE + 2) #define IP64L_BASE 0x4000 #define IP64L_BITMAP (0x4000 - IP64L_BASE + 2) #define IP64L_MCOLOUR (0x5f40 - IP64L_BASE + 2) #define IP64L_COLOUR (0x6328 - IP64L_BASE + 2) #define IP64L_BG (0x6710 - IP64L_BASE + 2) #define IP64L_SIZE (0x6711 - IP64L_BASE + 2) #define DRAZ_BASE 0x5800 #define DRAZ_COLOUR (0x5800 - DRAZ_BASE + 2) #define DRAZ_MCOLOUR (0x5c00 - DRAZ_BASE + 2) #define DRAZ_BITMAP (0x6000 - DRAZ_BASE + 2) #define DRAZ_BG (0x7f40 - DRAZ_BASE + 2) #define DRAZ_SIZE (0x7f42 - DRAZ_BASE + 2) #define SHFLI_BASE 0x4000 #define SHFLI_BANK (0x4000 - SHFLI_BASE + 2) #define SHFLI_MCOLOUR0 (0x4000 - SHFLI_BASE + 2) #define SHFLI_SCOLOUR0 (0x43e8 - SHFLI_BASE + 2) #define SHFLI_SCOLOUR1 (0x43e9 - SHFLI_BASE + 2) #define SHFLI_MCOLOUR1 (0x4400 - SHFLI_BASE + 2) #define SHFLI_MCOLOUR2 (0x4800 - SHFLI_BASE + 2) #define SHFLI_MCOLOUR3 (0x4c00 - SHFLI_BASE + 2) #define SHFLI_MCOLOUR4 (0x5000 - SHFLI_BASE + 2) #define SHFLI_MCOLOUR5 (0x5400 - SHFLI_BASE + 2) #define SHFLI_MCOLOUR6 (0x5800 - SHFLI_BASE + 2) #define SHFLI_MCOLOUR7 (0x5c00 - SHFLI_BASE + 2) #define SHFLI_BITMAP (0x6000 - SHFLI_BASE + 2) #define SHFLI_SIZE (0x7e00 - SHFLI_BASE + 2) #define SHFXL_BASE 0x4000 #define SHFXL_BANK (0x4000 - SHFXL_BASE + 2) #define SHFXL_MCOLOUR0 (0x4000 - SHFXL_BASE + 2) #define SHFXL_SCOLOUR0 (0x43e9 - SHFXL_BASE + 2) #define SHFXL_MCOLOUR1 (0x4400 - SHFXL_BASE + 2) #define SHFXL_MCOLOUR2 (0x4800 - SHFXL_BASE + 2) #define SHFXL_MCOLOUR3 (0x4c00 - SHFXL_BASE + 2) #define SHFXL_MCOLOUR4 (0x5000 - SHFXL_BASE + 2) #define SHFXL_MCOLOUR5 (0x5400 - SHFXL_BASE + 2) #define SHFXL_MCOLOUR6 (0x5800 - SHFXL_BASE + 2) #define SHFXL_MCOLOUR7 (0x5c00 - SHFXL_BASE + 2) #define SHFXL_BITMAP (0x6000 - SHFXL_BASE + 2) #define SHFXL_SIZE (0x7c00 - SHFXL_BASE + 2) #define HWS_BASE 0x4000 #define HWS_BITMAP (0x4000 - HWS_BASE + 2) #define HWS_SPRMAP1 (0x5f40 - HWS_BASE + 2) #define HWS_SPRMAP2 (0x6840 - HWS_BASE + 2) #define HWS_SIZE (0x7140 - HWS_BASE + 2) #define swap(_x, _y) \ do { gint _t; _t = _x; _x = _y; _y = _t; } while (0) #define colsort(_max) \ do { \ gint _i, _j; \ \ for (_i = 0; col[_i][0] < _max; _i++) { \ for (_j = _i + 1; \ col[_j][0] < _max; _j++) { \ if (col[_i][1] < col[_j][1]) { \ swap(col[_i][0], col[_j][0]); \ swap(col[_i][1], col[_j][1]); \ } \ } \ } \ } while (0) static gint rainoff1[] = { /* sprite 0-4, lines 0-14 */ 0x0, 0x3, 0x6, 0x9, 0xc, /* 0-4 */ 0xf, 0x12, 0x15, 0x18, 0x1b, /* 5-9 */ 0x1e, 0x21, 0x24, 0x27, 0x2a, /* 10-14 */ /* sprite 5-9, line 15-20 */ 0x16d, 0x170, 0x173, 0x176, 0x179, /* 15-19 */ 0x17c, /* 20 */ /* sprite 5-9, line 0-9 */ 0x140, 0x143, 0x146, 0x149, /* 21-24 */ 0x14c, 0x14f, 0x152, 0x155, 0x158, /* 25-29 */ 0x15b, /* 30 */ /* sprite 10-14, line 10-20 */ 0x29e, 0x2a1, 0x2a4, 0x2a7, /* 31-34 */ 0x2aa, 0x2ad, 0x2b0, 0x2b3, 0x2b6, /* 35-39 */ 0x2b9, 0x2bc, /* 40-41 */ /* sprite 10-14, line 0-4 */ 0x280, 0x283, 0x286, /* 42-44 */ 0x289, 0x28c, /* 45-46 */ /* sprite 15-19, line 5-20 */ 0x3cf, 0x3d2, 0x3d5, /* 47-49 */ 0x3d8, 0x3db, 0x3de, 0x3e1, 0x3e4, /* 50-54 */ 0x3e7, 0x3ea, 0x3ed, 0x3f0, 0x3f3, /* 55-59 */ 0x3f6, 0x3f9, 0x3fc, /* 60-62 */ /* sprite 20-24, lines 0-15 */ 0x500, 0x503, /* 63-64 */ 0x506, 0x509, 0x50c, 0x50f, 0x512, /* 65-69 */ 0x515, 0x518, 0x51b, 0x51e, 0x521, /* 70-74 */ 0x524, 0x527, 0x52a, 0x52d, /* 75-78 */ /* sprite 25-29, line 16-20 */ 0x670, /* 79 */ 0x673, 0x676, 0x679, 0x67c, /* 80-83 */ /* sprite 25-29, line 0-10 */ 0x640, /* 84 */ 0x643, 0x646, 0x649, 0x64c, 0x64f, /* 85-89 */ 0x652, 0x655, 0x658, 0x65b, 0x65e, /* 90-94 */ /* sprite 30-34, line 11-20 */ 0x7a1, 0x7a4, 0x7a7, 0x7aa, 0x7ad, /* 95-99 */ 0x7b0, 0x7b3, 0x7b6, 0x7b9, 0x7bc, /* 100-104 */ /* sprite 30-34, line 0-5 */ 0x780, 0x783, 0x786, 0x789, 0x78c, /* 105-109 */ 0x78f, /* 110 */ /* sprite 35-39, line 6-20 */ 0x8d2, 0x8d5, 0x8d8, 0x8db, /* 111-114 */ 0x8de, 0x8e1, 0x8e4, 0x8e7, 0x8ea, /* 115-119 */ 0x8ed, 0x8f0, 0x8f3, 0x8f6, 0x8f9, /* 120-124 */ 0x8fc, /* 125 */ }; static gint rainoff2[] = { /* sprite 0-4, lines 0-14 */ 0x0, 0x3, 0x6, 0x9, 0xc, /* 0-4 */ 0xf, 0x12, 0x15, 0x18, 0x1b, /* 5-9 */ 0x1e, 0x21, 0x24, 0x27, 0x2a, /* 10-14 */ /* sprite 3-5, line 15-19 */ 0xed, 0xf0, 0xf3, 0xf6, 0xf9, /* 15-19 */ 0xfc, /* 20 */ /* sprite 3-5, line 0-8 */ 0xc0, 0xc3, 0xc6, 0xc9, /* 21-24 */ 0xcc, 0xcf, 0xd2, 0xd5, 0xd8, /* 25-29 */ 0xdb, /* 30 */ /* sprite 6-8, line 10-20 */ 0x19e, 0x1a1, 0x1a4, 0x1a7, /* 31-34 */ 0x1aa, 0x1ad, 0x1b0, 0x1b3, 0x1b6, /* 35-39 */ 0x1b9, 0x1bc, /* 40-41 */ /* sprite 6-8, line 0-4 */ 0x180, 0x183, 0x186, /* 42-44 */ 0x189, 0x18c, /* 45-46 */ /* sprite 9-11, line 5-20 */ 0x24f, 0x252, 0x255, /* 47-49 */ 0x258, 0x25b, 0x25e, 0x261, 0x264, /* 50-54 */ 0x267, 0x26a, 0x26d, 0x270, 0x273, /* 55-59 */ 0x276, 0x279, 0x27c, /* 60-62 */ /* sprite 12-14, lines 0-15 */ 0x300, 0x303, /* 63-64 */ 0x306, 0x309, 0x30c, 0x30f, 0x312, /* 65-69 */ 0x315, 0x318, 0x31b, 0x31e, 0x321, /* 70-74 */ 0x324, 0x327, 0x32a, 0x32d, /* 75-78 */ /* sprite 15-17, line 16-20 */ 0x3f0, /* 79 */ 0x3f3, 0x3f6, 0x3f9, 0x3fc, /* 80-83 */ /* sprite 15-17, line 0-10 */ 0x3c0, /* 84 */ 0x3c3, 0x3c6, 0x3c9, 0x3cc, 0x3cf, /* 85-89 */ 0x3d2, 0x3d5, 0x3d8, 0x3db, 0x3de, /* 90-94 */ /* sprite 18-20, line 11-20 */ 0x4a1, 0x4a4, 0x4a7, 0x4aa, 0x4ad, /* 95-99 */ 0x4b0, 0x4b3, 0x4b6, 0x4b9, 0x4bc, /* 100-104 */ /* sprite 18-20, line 0-5 */ 0x480, 0x483, 0x486, 0x489, 0x48c, /* 105-109 */ 0x48f, /* 110 */ /* sprite 21-23, line 6-20 */ 0x552, 0x555, 0x558, 0x55b, /* 111-114 */ 0x55e, 0x561, 0x564, 0x567, 0x56a, /* 115-119 */ 0x56d, 0x570, 0x573, 0x576, 0x579, /* 120-124 */ 0x57c, /* 125 */ }; static guint8 tmpcol[1000]; static guint8 tmpbg[200]; static guint8 data[65536]; /* Since the Commodore 64 only has 64kB * of memory, it is reasonable to assume * that no image is larger than this... */ static guchar *buf; static gint32 rain_to_gimp(void) { gint32 image_ID; gint32 layer_ID; GimpPixelRgn pixel_rgn; GimpDrawable *drawable; guint16 baseaddr = data[0] + data[1] * 256; guint8 *charmap; guint8 *sprmap1; guint8 *sprmap2; guint8 background; guint8 colour0; guint8 colour1; guint8 colour2; guint8 x, y; guchar *bufp; guint width = 128, height = 128; if (baseaddr != RAIN_BASE) return -1; charmap = data + RAIN_CHARMAP; sprmap1 = data + RAIN_SPRMAP1; sprmap2 = data + RAIN_SPRMAP2; /* If there's no magic signature "rain", this image * does not contain any colour information; hence * we default to the colours used in Rainmaker */ if (data[RAIN_MAGIC] != 0x52 || data[RAIN_MAGIC + 1] != 0x1 || data[RAIN_MAGIC + 2] != 0x9 || data[RAIN_MAGIC + 3] != 0x4e) { colour0 = 0xb; colour1 = 0xc; colour2 = 0xf; background = 0x0; } else { colour0 = data[RAIN_COLTAB + 2]; colour1 = data[RAIN_COLTAB + 1]; colour2 = data[RAIN_COLTAB]; background = data[RAIN_COLTAB + 3]; } image_ID = gimp_image_new(width, height, GIMP_INDEXED); gimp_image_set_cmap(image_ID, vicpalette, 16); layer_ID = gimp_layer_new(image_ID, "Background", width, height, GIMP_INDEXED_IMAGE, 100, GIMP_NORMAL_MODE); gimp_image_add_layer(image_ID, layer_ID, 0); drawable = gimp_drawable_get(layer_ID); gimp_pixel_rgn_init(&pixel_rgn, drawable, 0, 0, width, height, TRUE, FALSE); buf = g_new0(guchar, width * height); /* layer 0: sprmap2 */ bufp = buf + 128; /* We begin at (0, 1) rather than (0, 0) * for this layer */ for (y = 0; y < 126; y++) { for (x = 0; x < 8; x++) { guint i, tmp; tmp = sprmap2[x % 3 + (x / 3) * 6 + rainoff2[y]]; for (i = 0; i < 8; i++) { *bufp++ = (tmp & 1 << (7 - i)) ? colour2 : background; *bufp++ = (tmp & 1 << (7 - i)) ? colour2 : background; } } } /* layer 1: sprmap1 */ bufp = buf + 132; /* We begin at (, 1) rather than (0, 0) * for this layer */ for (y = 0; y < 126; y++) { for (x = 0; x < 15; x++) { guint i, tmp; tmp = sprmap1[x % 3 + (x / 3) * 6 + rainoff1[y]]; for (i = 0; i < 8; i++, bufp++) if (tmp & 1 << (7 - i)) *bufp = colour1; } bufp += 8; } /* layer 2; charmap */ bufp = buf; for (y = 0; y < 128; y++) { for (x = 0; x < 16; x++) { guint8 i, tmp; tmp = charmap[y + x * 128]; for (i = 0; i < 8; i++, bufp++) if (tmp & 1 << (7 - i)) *bufp = colour0; } } gimp_pixel_rgn_set_rect(&pixel_rgn, buf, 0, 0, 128, 128); g_free(buf); gimp_drawable_flush(drawable); return image_ID; } static gint32 bitmap_to_gimp(guint8 type) { gint32 image_ID; gint32 layer_ID; GimpPixelRgn pixel_rgn; GimpDrawable *drawable; guint row, col; guint xoffset = 0; guint height = 200; guint width = 320; guint8 *bufp; guint8 *background = NULL; guint8 *mcolour0 = NULL; guint8 *mcolour1 = NULL; guint8 *mcolour2 = NULL; guint8 *mcolour3 = NULL; guint8 *mcolour4 = NULL; guint8 *mcolour5 = NULL; guint8 *mcolour6 = NULL; guint8 *mcolour7 = NULL; guint8 *scolour0 = NULL; guint8 *scolour1 = NULL; guint8 *scolour2 = NULL; guint8 *scolour3 = NULL; guint8 *sprmap0 = NULL; guint8 *sprmap1 = NULL; guint8 *sprmap2 = NULL; guint8 *sprmap3 = NULL; guint8 *colour = NULL; guint8 *bitmap = NULL; guint8 *bank = NULL; guint16 baseaddr = data[0] + data[1] * 256; guint8 colmode = NORMAL; guint8 smode = HIRES; guint8 mode = LORES; if (type == SUXX) { if (baseaddr == SUXXV2_BASE) type = SUXXV2; else if (baseaddr == SUXXV3_BASE) type = SUXXV3; else return -1; } switch (type) { case ADVOCP: if (baseaddr != ADVOCP_BASE) return -1; bitmap = data + ADVOCP_BITMAP; mcolour0 = data + ADVOCP_MCOLOUR; colour = data + ADVOCP_COLOUR; background = data + ADVOCP_BG; break; case AFLI: if (baseaddr != AFLI_BASE) return -1; bitmap = data + AFLI_BITMAP; mcolour0 = data + AFLI_MCOLOUR0; mcolour1 = data + AFLI_MCOLOUR1; mcolour2 = data + AFLI_MCOLOUR2; mcolour3 = data + AFLI_MCOLOUR3; mcolour4 = data + AFLI_MCOLOUR4; mcolour5 = data + AFLI_MCOLOUR5; mcolour6 = data + AFLI_MCOLOUR6; mcolour7 = data + AFLI_MCOLOUR7; colmode = FLI8; mode = HIRES; break; case ARTIST: if (baseaddr != ARTIST_BASE) return -1; bitmap = data + ARTIST_BITMAP; mcolour0 = data + ARTIST_MCOLOUR; colour = data + ARTIST_COLOUR; background = data + ARTIST_BG; break; case BLAZE: if (baseaddr != BLAZE_BASE) return -1; bitmap = data + BLAZE_BITMAP; mcolour0 = data + BLAZE_MCOLOUR; colour = data + BLAZE_COLOUR; background = NULL; break; case DRAZ: if (baseaddr != DRAZ_BASE) return -1; bitmap = data + DRAZ_BITMAP; mcolour0 = data + DRAZ_MCOLOUR; colour = data + DRAZ_COLOUR; background = data + DRAZ_BG; break; case EAFLI: if (baseaddr != EAFLI_BASE) return -1; bitmap = data + EAFLI_BITMAP; mcolour0 = data + EAFLI_MCOLOUR0; mcolour1 = data + EAFLI_MCOLOUR1; mcolour2 = data + EAFLI_MCOLOUR2; mcolour3 = data + EAFLI_MCOLOUR3; mcolour4 = data + EAFLI_MCOLOUR4; mcolour5 = data + EAFLI_MCOLOUR5; mcolour6 = data + EAFLI_MCOLOUR6; mcolour7 = data + EAFLI_MCOLOUR7; sprmap0 = data + EAFLI_SPRMAP0; sprmap1 = data + EAFLI_SPRMAP1; sprmap2 = data + EAFLI_SPRMAP2; sprmap3 = data + EAFLI_SPRMAP3; scolour0 = data + EAFLI_SPRCOL0; scolour1 = data + EAFLI_SPRCOL1; scolour2 = data + EAFLI_SPRCOL2; scolour3 = data + EAFLI_SPRCOL3; colmode = FLI8; smode = data[EAFLI_MFLAG] & 1 ? LORES : HIRES; mode = HIRES; height = 84; break; case FLI: if (baseaddr != FLI_BASE && baseaddr != FLIV2_BASE) return -1; if (baseaddr == FLI_BASE) { bitmap = data + FLI_BITMAP; mcolour0 = data + FLI_MCOLOUR0; mcolour1 = data + FLI_MCOLOUR1; mcolour2 = data + FLI_MCOLOUR2; mcolour3 = data + FLI_MCOLOUR3; mcolour4 = data + FLI_MCOLOUR4; mcolour5 = data + FLI_MCOLOUR5; mcolour6 = data + FLI_MCOLOUR6; mcolour7 = data + FLI_MCOLOUR7; colour = data + FLI_COLOUR; background = NULL; } else { bitmap = data + FLIV2_BITMAP; mcolour0 = data + FLIV2_MCOLOUR0; mcolour1 = data + FLIV2_MCOLOUR1; mcolour2 = data + FLIV2_MCOLOUR2; mcolour3 = data + FLIV2_MCOLOUR3; mcolour4 = data + FLIV2_MCOLOUR4; mcolour5 = data + FLIV2_MCOLOUR5; mcolour6 = data + FLIV2_MCOLOUR6; mcolour7 = data + FLIV2_MCOLOUR7; colour = data + FLIV2_COLOUR; background = data + FLIV2_BG; } colmode = FLI8; break; case IMSYS: if (baseaddr != IMSYS_BASE) return -1; bitmap = data + IMSYS_BITMAP; mcolour0 = data + IMSYS_MCOLOUR; colour = data + IMSYS_COLOUR; background = NULL; break; case IP64H: if (baseaddr != IP64H_BASE) return -1; bitmap = data + IP64H_BITMAP; mcolour0 = data + IP64H_MCOLOUR; mode = HIRES; break; case IP64L: if (baseaddr != IP64L_BASE) return -1; bitmap = data + IP64L_BITMAP; mcolour0 = data + IP64L_MCOLOUR; colour = data + IP64L_COLOUR; background = data + IP64L_BG; break; case KOALA: if (baseaddr != KOALA_BASE) return -1; bitmap = data + KOALA_BITMAP; mcolour0 = data + KOALA_MCOLOUR; colour = data + KOALA_COLOUR; background = data + KOALA_BG; break; case OCP: if (baseaddr != OCP_BASE) return -1; bitmap = data + OCP_BITMAP; mcolour0 = data + OCP_MCOLOUR; mode = HIRES; break; case SHFLI: if (baseaddr != SHFLI_BASE) return -1; bitmap = data + SHFLI_BITMAP; mcolour0 = data + SHFLI_MCOLOUR0; mcolour1 = data + SHFLI_MCOLOUR1; mcolour2 = data + SHFLI_MCOLOUR2; mcolour3 = data + SHFLI_MCOLOUR3; mcolour4 = data + SHFLI_MCOLOUR4; mcolour5 = data + SHFLI_MCOLOUR5; mcolour6 = data + SHFLI_MCOLOUR6; mcolour7 = data + SHFLI_MCOLOUR7; scolour0 = data + SHFLI_SCOLOUR0; scolour1 = data + SHFLI_SCOLOUR1; bank = data + SHFLI_BANK; colmode = FLI8; mode = HIRES; xoffset = 112; width = 96; height = 168; break; case SHFXL: if (baseaddr != SHFXL_BASE) return -1; bitmap = data + SHFXL_BITMAP; mcolour0 = data + SHFXL_MCOLOUR0; mcolour1 = data + SHFXL_MCOLOUR1; mcolour2 = data + SHFXL_MCOLOUR2; mcolour3 = data + SHFXL_MCOLOUR3; mcolour4 = data + SHFXL_MCOLOUR4; mcolour5 = data + SHFXL_MCOLOUR5; mcolour6 = data + SHFXL_MCOLOUR6; mcolour7 = data + SHFXL_MCOLOUR7; scolour0 = data + SHFXL_SCOLOUR0; bank = data + SHFXL_BANK; colmode = FLI8; mode = HIRES; xoffset = 88; width = 144; height = 168; break; case SUXXV2: bitmap = data + SUXXV2_BITMAP; mcolour0 = data + SUXXV2_MCOLOUR; colour = data + SUXXV2_COLOUR; background = NULL; break; case SUXXV3: bitmap = data + SUXXV3_BITMAP; mcolour0 = data + SUXXV3_MCOLOUR; colour = data + SUXXV3_COLOUR; background = data + SUXXV3_BG; break; case TLIGHT: if (baseaddr != TLIGHT_BASE) return -1; bitmap = data + TLIGHT_BITMAP; mcolour0 = data + TLIGHT_MCOLOUR; colour = data + TLIGHT_COLOUR; background = data + TLIGHT_BG; break; case VIDCOM: if (baseaddr != VIDCOM_BASE) return -1; bitmap = data + VIDCOM_BITMAP; mcolour0 = data + VIDCOM_MCOLOUR; colour = data + VIDCOM_COLOUR; background = NULL; break; default: return -1; } if (type == SUXXV2 || type == SUXXV3) { int i; for (i = 0; i < 500; i++) { tmpcol[i] = colour[i] & 0xf; tmpcol[i + 500] = colour[i] >> 4 & 0xf; } colour = tmpcol; } image_ID = gimp_image_new(width, height, GIMP_INDEXED); gimp_image_set_cmap(image_ID, vicpalette, 16); layer_ID = gimp_layer_new(image_ID, "Background", width, height, GIMP_INDEXED_IMAGE, 100, GIMP_NORMAL_MODE); gimp_image_add_layer(image_ID, layer_ID, 0); drawable = gimp_drawable_get(layer_ID); gimp_pixel_rgn_init(&pixel_rgn, drawable, 0, 0, width, height, TRUE, FALSE); buf = g_new0(guchar, width * height); bufp = buf + 8; for (row = 0; row < height; row++) { static guint8 *cp; static gint off; if (type == FLI) off = 24 - (row / 8) + 25 * (row % 8); else off = 0; if (colmode == FLI8) { switch (row % 8) { default: case 0: cp = mcolour0; break; case 1: cp = mcolour1; break; case 2: cp = mcolour2; break; case 3: cp = mcolour3; break; case 4: cp = mcolour4; break; case 5: cp = mcolour5; break; case 6: cp = mcolour6; break; case 7: cp = mcolour7; break; } } else { cp = mcolour0; } for (col = xoffset / 8; col < (xoffset + width) / 8; col++) { static guint8 col1, col2, col3 = 0; static gint i; guint8 *src = bitmap + (row / 8) * 320 + row % 8 + col * 8; if (col < 10 && type == EAFLI) { col1 = *(mcolour0 + col) >> 4 & 0xf; col2 = *(mcolour0 + col) & 0xf; } else { col1 = *(cp + (row / 8) * 40 + col) >> 4 & 0xf; col2 = *(cp + (row / 8) * 40 + col) & 0xf; } if (mode != HIRES) col3 = colour[(row >> 3) * 40 + col] & 0xf; for (i = 0; i < ((mode != HIRES) ? 4 : 8); i++) { static guint8 tmp; if (mode == HIRES) { switch (*src >> i & 1) { case 0: tmp = col2; break; case 1: tmp = col1; break; default: break; } *--bufp = tmp; } else { switch (*src >> i * 2 & 3) { case 0: tmp = (!background) ? 0 : *(background + off) & 0xf; break; case 1: tmp = col1; break; case 2: tmp = col2; break; case 3: tmp = col3; break; default: break; } *--bufp = tmp; *--bufp = tmp; } } bufp += 16; } } if (type == SHFLI) { for (row = 0; row < height; row++) { guint8 *sb; switch (row % 8) { default: case 0: sb = mcolour0; break; case 1: sb = mcolour1; break; case 2: sb = mcolour2; break; case 3: sb = mcolour3; break; case 4: sb = mcolour4; break; case 5: sb = mcolour5; break; case 6: sb = mcolour6; break; case 7: sb = mcolour7; break; } sb += 0x3f8; for (col = 0; col < width / 8; col++) { static guint8 i; guint8 *dst = buf + row * width + col * 8 + width; for (i = 0; i < 8; i++) { guint8 tmp = *(dst + i); tmp = (*(bank + sb[4 + col / 3] * 64 + col % 3 + (row % 21) * 3) & 1 << (7 - i)) ? *scolour1 : tmp; tmp = (*(bank + sb[col / 3] * 64 + col % 3 + (row % 21) * 3) & 1 << (7 - i)) ? *scolour0 : tmp; *(dst + i) = tmp; } } } } else if (type == SHFXL) { for (row = 0; row < height; row++) { guint8 *sb; switch ((row + 7) % 8) { default: case 0: sb = mcolour0; break; case 1: sb = mcolour1; break; case 2: sb = mcolour2; break; case 3: sb = mcolour3; break; case 4: sb = mcolour4; break; case 5: sb = mcolour5; break; case 6: sb = mcolour6; break; case 7: sb = mcolour7; break; } sb += 0x3f8; for (col = 0; col < width / 8; col++) { static guint8 i; guint8 *dst = buf + row * width + col * 8; for (i = 0; i < 8; i++) { guint8 tmp = *(dst + i); tmp = (*(bank + sb[1 + col / 3] * 64 + col % 3 + (row % 21) * 3) & 1 << (7 - i)) ? *scolour0 : tmp; *(dst + i) = tmp; } } } } else if (type == EAFLI) { for (row = 0; row < height; row++) { guint8 *src = NULL; switch (row / 42) { case 0: src = (row % 2) ? sprmap0 : sprmap1; break; case 1: src = (row % 2) ? sprmap2 : sprmap3; break; default: break; } src += (row % 42) / 2 * 3; for (col = 0; col < 24; col++) { guint8 *dst = buf + row * 320 + 80 + col * 8; guint8 i; for (i = 0; i < 8; i += 2) { guint8 tmp; tmp = *(src + col % 3 + (col / 3) * 64); tmp = tmp >> (6 - i) & 3; if (col > 2) { if (tmp & 0x2) *(dst + i) = *scolour0; if (tmp & 0x1) *(dst + i + 1) = *scolour0; } else if (smode == LORES) { switch (tmp) { case 0x1: *(dst + i) = *scolour1; *(dst + i + 1) = *scolour1; break; case 0x2: *(dst + i) = *scolour2; *(dst + i + 1) = *scolour2; break; case 0x3: *(dst + i) = *scolour3; *(dst + i + 1) = *scolour3; break; case 0x0: default: *(dst + i) = 0xf; *(dst + i + 1) = 0xf; break; } } else { if (tmp & 0x1) *(dst + i) = *scolour1; else *(dst + i) = 0xf; if (tmp & 0x2) *(dst + i) = *scolour1; else *(dst + i + 1) = 0xf; } } } } } gimp_pixel_rgn_set_rect(&pixel_rgn, buf, 0, 0, width, height); g_free(buf); gimp_drawable_flush(drawable); return image_ID; } /* This section written by Vanessa Ezekowitz, cleaned up by Shadewalker * Here we get GIMP's background colour, look up the closest match in * the VIC-II colour palette, and return the index to that colour. * This replaces the old routine that counts colours to determine what * should have been the background colour. */ static gint8 get_bgcol(gint line, guint8 type) { guint8 colour_index; guint8 x, bg_red, bg_green, bg_blue; guint8 colour_r, colour_g, colour_b; gfloat min_d, d; GimpRGB bgcolour; if (!gimp_context_get_background(&bgcolour)) return 0; printf("bg colour is (%f, %f, %f).\n", bgcolour.r, bgcolour.g, bgcolour.b); min_d = 99999999; /* insanely high to make sure d is never higher. */ colour_index = 0; /* Convert floating 0 <= x <= 1 values to normal 8-bit ranges * the 0.5 being added forces rounding (normally, it truncates) */ bg_red = bgcolour.r * 255 + 0.5; bg_green = bgcolour.g * 255 + 0.5; bg_blue = bgcolour.b * 255 + 0.5; printf("in 8-bit notation, (%u, %u, %u).\n", bg_red, bg_green, bg_blue); for (x = 0; x < 16; x++) { colour_r = vicpalette[x * 3]; colour_g = vicpalette[x * 3 + 1]; colour_b = vicpalette[x * 3 + 2]; d = sqrt(pow((bg_red - colour_r), 2) + pow((bg_green - colour_g), 2) + pow((bg_blue - colour_b), 2) ); printf("Checked colour %u = %u, %u, %u. Error is %f.\n", x, colour_r, colour_g, colour_b, d); if (d < min_d) { min_d = d; colour_index = x; } } printf("Closest match is %u.\n\n", colour_index); return colour_index; } static gboolean get_fgcols(gint8 *col0, gint8 *col1, gint8 *col2, guint8 type, guint x, guint y, guint8 line) { guint8 tcol[8][4]; guint8 i, j; guint16 cbits[8]; guint8 tmp; if (line % 8 != 0 && type != FLI) return TRUE; for (i = 0; i < 8; i++) { tcol[i][0] = 0; /* colour counter */ tcol[i][1] = 0x10; /* fg 1 */ tcol[i][2] = 0x10; /* fg 2 */ tcol[i][3] = 0x10; /* colram */ cbits[i] = 0; } /* Create colour statistics */ for (i = 0; i < 8; i++) { guint8 l = 0; if (type == FLI || i == 0) l = i; for (j = 0; j < 8; j += 2) { tmp = buf[x * 8 + j + 320 * (y * 8 + i)]; if (tmp != tmpbg[y * 8 + i]) cbits[l] |= 1 << tmp; } } for (i = 0; i < 8; i++) { guint8 l = 0; if (type == FLI || i == 0) l = i; for (j = 0; j < 16; j++) { gint c = (cbits[l] & 1 << j) ? j : 0x10; if (c == 0x10 || c == tcol[l][1] || c == tcol[l][2] || c == tcol[l][3]) continue; if (++tcol[l][0] > 3) return FALSE; tcol[l][tcol[l][0]] = c; } } for (i = 0; i < 16; i++) { for (j = 0; j < 8; j++) { guint8 l = 0; if (type == FLI || j == 0) l = j; if (tcol[l][0] < 3) continue; if (i != tcol[l][1] && i != tcol[l][2] && i != tcol[l][3]) break; } if (j == 8) break; } if (j < 8) return FALSE; if (line % 8 == 0) *col2 = i & 0xf; if (type != FLI) line = 0; *col0 = ((tcol[line][1] != *col2) ? tcol[line][1] : tcol[line][2]); *col1 = ((tcol[line][2] != *col0 && (tcol[line][2] != *col2)) ? tcol[line][2] : tcol[line][3]); *col0 &= 0xf; *col1 &= 0xf; return TRUE; } /* FIXME */ static gint gimp_to_rain(gint32 image_ID) { guint size = 0; (void)image_ID; return size; } /** * Set a pixel in a 64 bitmap picture * * @param bitmap The bitmap picture to set the pixel in * @param x The x-coordinate of the pixel * @param y The y-coordinate of the pixel */ static void set_bitmap_pixel(guint8 **bitmap, guint x, guint y) { *(*bitmap + (y / 8) * 320 + (y % 8) + (x / 8) * 8) |= (1 << (7 - (x % 8))); } /** * Set a pixel in a 64 spritemap * * @param bitmap The bitmap picture to set the pixel in * @param x The x-coordinate of the pixel * @param y The y-coordinate of the pixel * @param width The width of the sprite map (in pixels) */ static void set_sprmap_pixel(guint8 **sprmap, guint x, guint y, guint width) { *(*sprmap + (y / 21) * width / 24 * 64 + (y % 21) * 3 + (x / 24) * 64 + (x % 24) / 8) |= (1 << (7 - (x % 8))); } #if 0 /** * Calculate colour statistics * Note: for multicolour images, this is going to be off by a factor of 2, * but since that holds equally for all colours, this does not matter * * @param cmap The image map to scan * @param colstats An pointer to the an array to store colour stats in */ static void get_colour_statistics(guchar *cmap, guint8 **colstats) { int i; /* Empty colstats */ for (i = 0; i < 16; i++) **colstats = 0; /* Collect the colour statistics */ for (i = 0; i < (320 * 200); i++) *(*colstats + cmap[i]) += 1; } #endif static gint gimp_to_bitmap(gint32 image_ID, guint8 type) { GimpDrawable *drawable = NULL; GimpPixelRgn pixel_rgn; guint8 mode = LORES; gint32 drawable_ID; guint8 *mcolp = NULL; guint8 *colp = NULL; guint8 *bitp; guint8 *sprmap1; guint8 *sprmap2; guchar *cmap; guint8 *bgp = NULL; guint height; guint width; gint ncols; guint size; guint x, y; width = gimp_image_width(image_ID); height = gimp_image_height(image_ID); if (type != SPRITE) { if (width != 320 || height != 200) { gimp_message("Image-size must be 320x200. Aborting."); return -1; } } else { if (width % 24 || height % 21) { gimp_message("Image must be evenly divisible " "into 24x21 blocks. Aborting."); return -1; } } drawable_ID = gimp_image_get_active_drawable(image_ID); drawable = gimp_drawable_get(drawable_ID); if (gimp_drawable_type(drawable_ID) != GIMP_INDEXED_IMAGE) { gimp_message("Image must be indexed. Aborting."); return -1; } cmap = gimp_image_get_cmap(image_ID, &ncols); if (type == HWS) { if (ncols > 4) { gimp_message("Image has more than 4 colours. " "Aborting."); return -1; } } else if (ncols > 16) { gimp_message("Image has more than 16 colours. Aborting."); return -1; } gimp_pixel_rgn_init(&pixel_rgn, drawable, 0, 0, width, height, FALSE, FALSE); buf = g_new0(guint8, width * height); gimp_pixel_rgn_get_rect(&pixel_rgn, buf, 0, 0, width, height); /* clear any remnants of old image-data */ for (x = 0; x < sizeof (data); x++) data[x] = 0; for (x = 0; x < sizeof (tmpbg); x++) tmpbg[x] = 0; for (x = 0; x < sizeof (tmpcol); x++) tmpcol[x] = 0; /* setup initial pointers and start address */ switch (type) { case ADVOCP: data[0] = ADVOCP_BASE & 0xff; data[1] = ADVOCP_BASE >> 8 & 0xff; bitp = data + ADVOCP_BITMAP; mcolp = data + ADVOCP_MCOLOUR; colp = data + ADVOCP_COLOUR; bgp = data + ADVOCP_BG; size = ADVOCP_SIZE; break; case AFLI: data[0] = AFLI_BASE & 0xff; data[1] = AFLI_BASE >> 8 & 0xff; bitp = data + AFLI_BITMAP; mcolp = data + AFLI_MCOLOUR0; size = AFLI_SIZE; mode = HIRES; break; case ARTIST: data[0] = ARTIST_BASE & 0xff; data[1] = ARTIST_BASE >> 8 & 0xff; bitp = data + ARTIST_BITMAP; mcolp = data + ARTIST_MCOLOUR; colp = data + ARTIST_COLOUR; bgp = data + ARTIST_BG; size = ARTIST_SIZE; break; case BLAZE: data[0] = BLAZE_BASE & 0xff; data[1] = BLAZE_BASE >> 8 & 0xff; bitp = data + BLAZE_BITMAP; mcolp = data + BLAZE_MCOLOUR; colp = data + BLAZE_COLOUR; bgp = NULL; size = BLAZE_SIZE; break; case DRAZ: data[0] = DRAZ_BASE & 0xff; data[1] = DRAZ_BASE >> 8 & 0xff; bitp = data + DRAZ_BITMAP; mcolp = data + DRAZ_MCOLOUR; colp = data + DRAZ_COLOUR; bgp = data + DRAZ_BG; size = DRAZ_SIZE; break; case FLI: /* Only FLIv2 is supported for saving */ data[0] = FLIV2_BASE & 0xff; data[1] = FLIV2_BASE >> 8 & 0xff; bitp = data + FLIV2_BITMAP; mcolp = data + FLIV2_MCOLOUR0; colp = data + FLIV2_COLOUR; bgp = data + FLIV2_BG; size = FLIV2_SIZE; break; case IMSYS: data[0] = IMSYS_BASE & 0xff; data[1] = IMSYS_BASE >> 8 & 0xff; bitp = data + IMSYS_BITMAP; mcolp = data + IMSYS_MCOLOUR; colp = data + IMSYS_COLOUR; bgp = NULL; size = IMSYS_SIZE; break; case IP64H: data[0] = IP64H_BASE & 0xff; data[1] = IP64H_BASE >> 8 & 0xff; bitp = data + IP64H_BITMAP; mcolp = data + IP64H_MCOLOUR; size = IP64H_SIZE; mode = HIRES; break; case IP64L: data[0] = IP64L_BASE & 0xff; data[1] = IP64L_BASE >> 8 & 0xff; bitp = data + IP64L_BITMAP; mcolp = data + IP64L_MCOLOUR; colp = data + IP64L_COLOUR; bgp = data + IP64L_BG; size = IP64L_SIZE; break; case KOALA: data[0] = KOALA_BASE & 0xff; data[1] = KOALA_BASE >> 8 & 0xff; bitp = data + KOALA_BITMAP; mcolp = data + KOALA_MCOLOUR; colp = data + KOALA_COLOUR; bgp = data + KOALA_BG; size = KOALA_SIZE; break; case OCP: data[0] = OCP_BASE & 0xff; data[1] = OCP_BASE >> 8 & 0xff; bitp = data + OCP_BITMAP; mcolp = data + OCP_MCOLOUR; size = OCP_SIZE; mode = HIRES; break; case SPRITE: data[0] = SPRITE_BASE & 0xff; data[1] = SPRITE_BASE >> 8 & 0xff; bitp = data + SPRITE_BITMAP; size = width / 24 * height / 21 * 64 + 2; break; case SUXX: /* Only SUXXv3 is supported for saving */ data[0] = SUXXV3_BASE & 0xff; data[1] = SUXXV3_BASE >> 8 & 0xff; bitp = data + SUXXV3_BITMAP; mcolp = data + SUXXV3_MCOLOUR; colp = tmpcol; bgp = data + SUXXV3_BG; size = SUXXV3_SIZE; break; case TLIGHT: data[0] = TLIGHT_BASE & 0xff; data[1] = TLIGHT_BASE >> 8 & 0xff; bitp = data + TLIGHT_BITMAP; mcolp = data + TLIGHT_MCOLOUR; colp = data + TLIGHT_COLOUR; bgp = data + TLIGHT_BG; size = TLIGHT_SIZE; break; case VIDCOM: data[0] = VIDCOM_BASE & 0xff; data[1] = VIDCOM_BASE >> 8 & 0xff; bitp = data + VIDCOM_BITMAP; mcolp = data + VIDCOM_MCOLOUR; colp = data + VIDCOM_COLOUR; bgp = NULL; size = VIDCOM_SIZE; break; case HWS: data[0] = HWS_BASE & 0xff; data[1] = HWS_BASE >> 8 & 0xff; bitp = data + HWS_BITMAP; sprmap1 = data + HWS_SPRMAP1; sprmap2 = data + HWS_SPRMAP2; size = HWS_SIZE; mode = HIRES; break; default: gimp_message("Target format not supported. Aborting."); return -1; } if (mode == LORES || type == SPRITE) { guint i; for (i = 0; i < width * height; i += 2) { if (buf[i] != buf[i + 1]) { mode = HIRES; break; } } if (mode == HIRES && type != SPRITE) { gimp_message("Too high resolution: Aborting."); printf("x: %d, y: %d\n", i % 320, i / 320); return -1; } } if (type == SPRITE) { gint col[4][2]; static guint8 byte[3]; static gint8 tmp; static guint i, j; col[0][0] = 0xff; col[1][0] = 0xff; col[2][0] = 0xff; col[3][0] = 0xff; col[0][1] = 0; col[1][1] = 0; col[2][1] = 0; col[3][1] = 0; for (i = 0; i < width * height; i++) { tmp = buf[i]; if (!col[0][1] || col[0][0] == tmp) { col[0][0] = tmp; col[0][1]++; } else if (!col[1][1] || col[1][0] == tmp) { col[1][0] = tmp; col[1][1]++; } else if (!col[2][1] || col[2][0] == tmp) { col[2][0] = tmp; col[2][1]++; } else if (!col[3][1] || col[3][0] == tmp) { col[3][0] = tmp; col[3][1]++; } else { gimp_message("Too many colours used. Aborting."); return -1; } } colsort(4); if (col[2][1] > 0 && mode == HIRES) { gimp_message("Too many colours used. Aborting."); return -1; } for (y = 0; y < height; y += 21) { for (x = 0; x < width; x += 24) { for (i = 0; i < 21; i++) { byte[0] = 0; byte[1] = 0; byte[2] = 0; for (j = 0; j < 24; j++) { tmp = buf[x + j + width * (y + i)]; if (mode == HIRES) byte[j / 8] <<= 1; else byte[j / 8] <<= 2; if (col[0][0] == tmp) { ; /* nothing */ } else if (col[1][0] == tmp) { byte[j / 8] |= 0x1; } else if (col[2][0] == tmp) { byte[j / 8] |= 0x2; } else { byte[j / 8] |= 0x3; } if (mode != HIRES) j++; } bitp[0] = byte[0]; bitp[1] = byte[1]; bitp[2] = byte[2]; bitp += 3; } bitp++; } } } else if (type == HWS) { gint col0 = -1, col1 = -1, col2 = -1, col3 = -1; /* Find out what colours to use for the bitmap */ for (y = 0; y < 200; y++) { for (x = 96; x < 320; x++) { static gint tmp; tmp = buf[x + 320 * y] & 0xf; if (col0 == tmp || col0 == -1) { col0 = tmp; } else if (col1 == tmp || col1 == -1) { col1 = tmp; } else { gimp_message("Columns 96-319 " "cannot " "contain more than 2 " "colours. Aborting."); return -1; } } } for (y = 0; y < 200; y++) { for (x = 0; x < 320; x++) { static gint tmp; tmp = buf[x + 320 * y] & 0xf; if (col0 == tmp) { } else if (col1 == tmp || col1 == -1) { col1 = tmp; /* set to bitmap */ set_bitmap_pixel(&bitp, x, y); } else if (col2 == tmp || col2 == -1) { if (y < 8 || y > 196) { gimp_message("Row 0-7 and " "197-199 cannot " "contain more " "than 2 colours. " "Aborting."); return -1; } col2 = tmp; set_sprmap_pixel(&sprmap1, x, y - 8, 96); } else { if (y < 8 || y > 196) { gimp_message("Row 0-7 and " "197-199 cannot " "contain more " "than 2 colours. " "Aborting."); return -1; } col3 = tmp; set_sprmap_pixel(&sprmap2, x, y - 8, 96); } } } } else if (mode == HIRES) { guint8 block[8]; /* We process each block of 8x8 pixels separately, * to make sure that the there only are two colours * per unit */ for (y = 0; y < 25; y++) { static gint col0, col1; for (x = 0; x < 40; x++) { gint i, j; for (i = 0; i < 8; i++) { static gint off = 0; if (type == AFLI || i == 0) { col0 = -1; col1 = -1; switch (i) { case 0: off = 0; break; case 1: off = AFLI_MCOLOUR1 - AFLI_MCOLOUR0; break; case 2: off = AFLI_MCOLOUR2 - AFLI_MCOLOUR0; break; case 3: off = AFLI_MCOLOUR3 - AFLI_MCOLOUR0; break; case 4: off = AFLI_MCOLOUR4 - AFLI_MCOLOUR0; break; case 5: off = AFLI_MCOLOUR5 - AFLI_MCOLOUR0; break; case 6: off = AFLI_MCOLOUR6 - AFLI_MCOLOUR0; break; case 7: off = AFLI_MCOLOUR7 - AFLI_MCOLOUR0; break; default: break; } } for (j = 0; j < 8; j++) { static gint tmp; tmp = buf[x * 8 + j + 320 * (y * 8 + i)]; tmp &= 0xf; block[i] <<= 1; if (col0 == tmp || col0 == -1) { col0 = tmp; } else if (col1 == tmp || col1 == -1) { col1 = tmp; block[i] |= 0x1; } else { gimp_message("Too many colours in a 8x8 block. Aborting."); return -1; } } if (col1 == -1) mcolp[off] = col0; else mcolp[off] = col1 << 4 | col0; } mcolp++; for (i = 0; i < 8; i++) *bitp++ = block[i]; } } } else if (mode == LORES) { guint8 block[8]; gint8 col0 = -1, col1 = -1, col2 = -1, bgcol = -1; gboolean is4col = TRUE; guint i; /* If the picture contains a maximum of 4 colours, * always use the same bit pattern for the same colour */ for (i = 0; i < (320 * 200); i += 2) { guint8 tmp; tmp = buf[i]; if (col0 == tmp || col0 == -1) { col0 = tmp; } else if (col1 == tmp || col1 == -1) { col1 = tmp; } else if (col2 == tmp || col2 == -1) { col2 = tmp; } else if (bgcol == tmp || bgcol == -1) { bgcol = tmp; } else { is4col = FALSE; break; } } if (bgp) { guint8 bg = 0; guint i; for (i = 0; i < 200; i++) { if (is4col == TRUE) { bg = bgcol; } else if (type == FLI || i == 0) bg = get_bgcol(i, type); if (type == FLI) *(bgp + 24 - (i / 8) + 25 * (i % 8)) = bg; else *bgp = bg; *(tmpbg + i) = bg; } } /* We process each block of 4x8 pixels separately, * to make sure that the there only are three colours * plus background per unit */ for (y = 0; y < 25; y++) { for (x = 0; x < 40; x++) { static gint j; for (i = 0; i < 8; i++) { static gint off = 0; /* If is4col is TRUE we already * know what colours to use */ if (is4col == TRUE) { } else if (!get_fgcols(&col0, &col1, &col2, type, x, y, i)) { gimp_message("Too many colours in a 4x8 block. Aborting."); printf("x: %d (%d), y: %d (%d)\n", x, x * 8, y, y * 8 + i); return -1; } if (type == FLI || i == 0) { switch (i) { case 0: off = 0; break; case 1: off = FLIV2_MCOLOUR1 - FLIV2_MCOLOUR0; break; case 2: off = FLIV2_MCOLOUR2 - FLIV2_MCOLOUR0; break; case 3: off = FLIV2_MCOLOUR3 - FLIV2_MCOLOUR0; break; case 4: off = FLIV2_MCOLOUR4 - FLIV2_MCOLOUR0; break; case 5: off = FLIV2_MCOLOUR5 - FLIV2_MCOLOUR0; break; case 6: off = FLIV2_MCOLOUR6 - FLIV2_MCOLOUR0; break; case 7: off = FLIV2_MCOLOUR7 - FLIV2_MCOLOUR0; break; default: break; } } for (j = 0; j < 8; j += 2) { static gint tmp; tmp = buf[x * 8 + j + 320 * (y * 8 + i)]; block[i] <<= 2; if (tmpbg[y * 8 + i] == tmp) ; /* nothing */ else if (col0 == tmp) block[i] |= 0x2; else if (col1 == tmp) block[i] |= 0x1; else block[i] |= 0x3; } mcolp[off] = col1 << 4 | col0; } mcolp++; *colp++ = col2; for (i = 0; i < 8; i++) *bitp++ = block[i]; } } if (type == SUXX) { guint tmp = sizeof (tmpcol) / 2; for (x = 0; x < tmp; x++) { data[SUXXV3_COLOUR + x] = tmpcol[x]; data[SUXXV3_COLOUR + x] |= tmpcol[x + tmp] << 4; } } } else { gimp_message("Target format not supported. Aborting."); return -1; } g_free(buf); return size; } gint32 load_image(char *filename, guint8 type) { gint32 image_ID; FILE *in; if ((in = fopen(filename, "r"))) { fread(&data, sizeof (data), 1, in); fclose(in); if (type == RAIN) image_ID = rain_to_gimp(); else image_ID = bitmap_to_gimp(type); gimp_image_set_filename(image_ID, filename); } else { gimp_message("Unable to open file for reading. Aborting."); return -1; } return image_ID; } gint save_image(char *filename, gint32 image_ID, guint8 type) { FILE *out; gint size; if (type == RAIN) size = gimp_to_rain(image_ID); else size = gimp_to_bitmap(image_ID, type); if (size < 0) return -1; if ((out = fopen(filename, "wb"))) { fwrite(&data, size, 1, out); fclose(out); } else { gimp_message("Unable to open file for writing. Aborting."); return -1; } return 0; } cbmplugs-1.2.2/artstudio.c0000644000175000000500000001003111305231425013625 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_artstudio_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, OCP); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_artstudio_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, OCP)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_artstudio_load", "loads images in OCP Art Studio file format", "This plug-in loads images in OCP Art Studio file format.", "David Weinehall ", "David Weinehall", "2002", "/Art Studio", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_artstudio_load", "ocp", ""); gimp_install_procedure("file_artstudio_save", "saves images in OCP Art Studio file format", "This plug-in saves images in OCP Art Studio file format.", "David Weinehall ", "David Weinehall", "2002", "/Art Studio", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_artstudio_save", "ocp", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/BUGS0000644000175000000500000000044011305231425012131 0ustar taosrco The algorithm that calculates background colour may sometimes fail, since it expects the most used colour to be the background colour; for FLI, only the first 24 pixels of every line are checked, since these are usually empty anyway (or possibly gray; if so, you have a problem...) cbmplugs-1.2.2/artist64.c0000644000175000000500000000777511305231425013314 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_artist64_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, ARTIST); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_artist64_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, ARTIST)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_artist64_load", "loads images in Artist64 file format", "This plug-in loads images in Artist64 file format.", "David Weinehall ", "David Weinehall", "2002", "/Artist64", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_artist64_load", "a64", ""); gimp_install_procedure("file_artist64_save", "saves images in Artist64 file format", "This plug-in saves images in Artist64 file format.", "David Weinehall ", "David Weinehall", "2002", "/Artist64", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_artist64_save", "a64", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/cbmplugs.h0000644000175000000500000000322011305231425013432 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __C64PLUGS_H__ #define __C64PLUGS_H__ #ifdef GIMP12 #define gimp_image_get_active_drawable gimp_image_active_drawable #define GimpRunMode GimpRunModeType #define _runheader static void run(gchar *name, gint nparams, \ GimpParam *param, \ gint *nreturn_vals, \ GimpParam **return_vals) #else #define _runheader static void run(const gchar *name, gint nparams, \ const GimpParam *param, \ gint *nreturn_vals, \ GimpParam **return_vals) #endif enum { KOALA = 0x0, ADVOCP, OCP, SUXX, SUXXV2, SUXXV3, VIDCOM, ARTIST, BLAZE, IMSYS, FLI, AFLI, SPRITE, TLIGHT, RAIN, EAFLI, IP64H, IP64L, DRAZ, SHFLI, SHFXL, HWS, } gfxformat; gint32 load_image(char *filename, guint8 type); gint save_image(char *filename, gint32 image_ID, guint8 type); #endif /* __C64PLUGS_H__ */ cbmplugs-1.2.2/imagesystem.c0000644000175000000500000001005311305231425014142 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_image_system_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, IMSYS); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_image_system_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, IMSYS)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_image_system_load", "loads images in Image System file format", "This plug-in loads images in Image System file format.", "David Weinehall ", "David Weinehall", "2002", "/Image System", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_image_system_load", "64i", ""); gimp_install_procedure("file_image_system_save", "saves images in Image System file format", "This plug-in saves images in Image System file format.", "David Weinehall ", "David Weinehall", "2002", "/Image System", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_image_system_save", "64i", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/COPYING0000644000175000000500000004310511305231425012506 0ustar taosrc GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. cbmplugs-1.2.2/rain.c0000644000175000000500000001000611305231425012542 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_rain_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, RAIN); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } #if 0 } else if (strcmp(name, "file_rain_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, RAIN)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } #endif } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); #if 0 static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); #endif gimp_install_procedure("file_rain_load", "loads images in Rainmaker file format", "This plug-in loads images in Rainmaker file format.", "David Weinehall ", "David Weinehall", "2002", "/Rain", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_rain_load", "rain", ""); #if 0 gimp_install_procedure("file_rain_save", "saves images in Rainmaker file format", "This plug-in saves images in Rainmaker file format.", "David Weinehall ", "David Weinehall", "2002", "/Rain", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_rain_save", "rain", ""); #endif } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/NEWS0000644000175000000500000000234711305231425012155 0ustar taosrccbmplugs NEWS -- history of user-visible changes. 2006-06-04 Copyright (C) 2002-2006 David Weinehall See the end for copying conditions. Please send cbmplugs bug reports to tao@acc.umu.se. Version 1.2.0 * New image format: HWS (Hires with Sprite Layer) * Bitmap colour converter modified to (at least attempt to) always sort colours in the same order | Important for pictures that should be converted | to charset + screen map Version 1.1.2 * Fix typo in sprite plugin. Version 1.1.1 * Fix installation-problems with latest version of gimptool. Version 1.1.0 * First release with NEWS-file. * Support for The GIMP v2.0. ---------------------------------------------------------------------- Copyright information: Copyright (C) 2002-2006 David Weinehall Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn. Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them. cbmplugs-1.2.2/vidcom64.c0000644000175000000500000000777711305231425013271 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright (C) 2002-2005 David Weinehall * * These plugins are based off of work * * Copyright (C) 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_vidcom64_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, VIDCOM); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_vidcom64_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, VIDCOM)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_vidcom64_load", "loads images in Vidcom64 file format", "This plug-in loads images in Vidcom64 file format.", "David Weinehall ", "David Weinehall", "2002", "/Vidcom64", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_vidcom64_load", "vco", ""); gimp_install_procedure("file_vidcom64_save", "saves images in Vidcom64 file format", "This plug-in saves images in Vidcom64 file format.", "David Weinehall ", "David Weinehall", "2002", "/Vidcom64", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_vidcom64_save", "vco", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/Makefile0000644000175000000500000000553511305231500013112 0ustar taosrc# Makefile for cbmplugs # Copyright © 2002-2007, 2009 David Weinehall PRGNAME := cbmplugs VERSION := 1.2.2 GIMPTOOL := gimptool-2.0 PALETTE_DIR := /usr/share/gimp/2.0/palettes ifdef LOCAL_PLUGINS GIMP_INSTALL_BIN := --install-bin GIMP_UNINSTALL_BIN := --uninstall-bin # Use Makefile as plugin to install, to be sure the file exists PALETTE_DIR := \ $(shell pkg-config --variable=gimpdatadir gimp-2.0)/palettes else GIMP_INSTALL_BIN := --install-admin-bin GIMP_UNINSTALL_BIN := --uninstall-admin-bin endif # Use Makefile as plugin to install, to be sure the file exists PLUGIN_DIR := \ $(shell pkg-config --variable=gimplibdir gimp-2.0)/plug-ins AM_CFLAGS += `$(GIMPTOOL) --cflags-noui` # AM_CFLAGS += -Werror # AM_CFLAGS += -W -Wall -Wpointer-arith -Wcast-align # AM_CFLAGS += -Wbad-function-cast -Wsign-compare # AM_CFLAGS += -Waggregate-return -Wmissing-noreturn -Wnested-externs # AM_CFLAGS += -Wchar-subscripts -Wformat-security -Wmissing-prototypes AM_LDFLAGS += `$(GIMPTOOL) --libs-noui` -lm RM := rm -f INSTALL := install --mode=755 INSTALL_DATA := install --mode=644 INSTALL_DIR := install -d ARCHIVE := $(PRGNAME)-$(VERSION) MKDIR := mkdir -p TAR_EXCLUDES := --exclude="*.swp" --exclude="*.bak" --exclude=".svnignore" TAR_EXCLUDES += --exclude="*~" --exclude="*.o" --exclude=".svn" TAR := tar cz $(TAR_EXCLUDES) --file PLUGINS = \ advartstudio afli artist64 artstudio blazingpaddles drazpaint \ eafli fli64 imagesystem interpainthires interpaintlores koala \ rain shfli shflixl sprite suxx twilight vidcom64 hws PALETTES = \ Commodore64.gpl DTV.gpl INCLUDES = cbmplugs.c HEADERS = cbmplugs.h .PHONY: default default: $(PLUGINS) $(PLUGINS): %: %.c $(INCLUDES) $(HEADERS) $(CC) $(CFLAGS) $(AM_CFLAGS) -o $@ $< $(INCLUDES) $(AM_LDFLAGS) .PHONY: install-plugins install-plugins: $(INSTALL_DIR) $(DESTDIR)$(PLUGIN_DIR) &&\ for plugin in $(PLUGINS); do \ $(INSTALL) $$plugin $(DESTDIR)$(PLUGIN_DIR); \ done .PHONY: install-palettes install-palettes: $(INSTALL_DIR) $(DESTDIR)$(PALETTE_DIR) &&\ for palette in $(PALETTES); do \ $(INSTALL_DATA) $$palette $(DESTDIR)$(PALETTE_DIR); \ done .PHONY: install install: install-plugins install-palettes .PHONY: uninstall-plugins uninstall-plugins: for plugin in $(PLUGINS); do \ $(RM) $(PLUGIN_DIR)/$$plugin; \ done .PHONY: uninstall-palettes uninstall-palettes: for palette in $(PALETTES); do \ $(RM) $(PALETTE_DIR)/$$palette; \ done .PHONY: uninstall uninstall: uninstall-plugins uninstall-palettes .PHONY: clean clean: for plugin in $(PLUGINS); do \ $(RM) $$plugin; \ done .PHONY: archive archive: clean $(RM) ../$(ARCHIVE).tar.gz &&\ $(RM) -r $(ARCHIVE) &&\ $(MKDIR) $(ARCHIVE) &&\ find . -maxdepth 1 -path '*/$(ARCHIVE)' -prune -o \ -not -name '.' -exec cp -a {} $(ARCHIVE) \; &&\ $(TAR) ../$(ARCHIVE).tar.gz $(ARCHIVE) &&\ $(RM) -r $(ARCHIVE) cbmplugs-1.2.2/shfli.c0000644000175000000500000001002611305231425012720 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_shfli_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, SHFLI); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } #if 0 } else if (strcmp(name, "file_shfli_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, SHFLI)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } #endif } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); #if 0 static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); #endif gimp_install_procedure("file_shfli_load", "loads images in SHF-Editor file format", "This plug-in loads images in SHF-Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/SHFLI", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_shfli_load", "shfli", ""); #if 0 gimp_install_procedure("file_shfli_save", "saves images in SHF-Editor file format", "This plug-in saves images in SHF-Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/SHFLI", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_shfli_save", "shfli", ""); #endif } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/ChangeLog0000644000175000000500000000635111305231425013227 0ustar taosrc2009-12-01 David Weinehall * Release 1.2.2. * Makefile: Apply build fix by Tzafrir Cohen to use pkgconfig instead of gimptool. | Thanks! * Makefile: Properly link against libm | Thanks to Peter Fritzsche for reporting! * Makefile: Drop support for The GIMP v1.2. * Makefile: Update tar ignores. * ChangeLog: Corrected typos. * README: Update to cover the fact that we no longer support The GIMP v1.2. * hws.c: Comment out image_ID, since it's not used at the moment 2007-06-19 David Weinehall * Release 1.2.1. 2007-06-19 David Weinehall * Makefile: Fix local install/uninstall targets. * DTV.gpl: Added a DTV v3 palette, shamelessly taken from David Murray's DTV homepage. * cbmplugs.c: Apply patch from Vanessa Ezekowitz to fix background colour handling. | Thanks! 2005-06-04 David Weinehall * Release 1.2.0. 2005-05-04 David Weinehall * cbmplugs.c: Fix warnings about incorrect pointer types. * cbmplugs.c: Add support for HWS. * cbmplugs.h: Add HWS. * hws.c: New file. * Makefile: Build HWS. * imageformats.txt: Add format description for HWS. 2005-08-31 David Weinehall * Release 1.1.2. * COPYING: new FSF address. * sprite.c: Fix typo. * advartstudio.c, afli.c, artist64.c, artstudio.c, blazingpaddles.c, cbmplugs.c, cbmplugs.h, drazpaint.c, eafli.c, fli64.c, imagesystem.c, interpainthires.c, interpaintlores.c, koala.c, rain.c, shfli.c, shflixl.c, sprite.c, suxx.c, twilight.c, vidcom64.c: New FSF address, new copyright year. * Makefile: new copyright year. 2004-04-21 David Weinehall * Release 1.1.1. * Makefile: Adapt install-target to latest version of gimptool. 2004-04-08 David Weinehall * Release 1.1.0. * Makefile: Disable compile-time warnings in distributed version. * cbmplugs.c: Fix warnings about unused variables. 2004-04-02 David Weinehall * AUTHORS: New file. * NEWS: New file. * ChangeLog: Renamed CHANGES to ChangeLog and reformatted it to GNU-style. * FIXME: Deleted file. * TODO: Merged the content of FIXME into this file. 2004-01-13 David Weinehall * Release 1.0.2. * Makefile: Changed gimptool-1.3 to gimptool-2.0 to adapt to latest changes in libgimp-1.3. * cbmplugs.c: Replace gimp_image_active_drawable with gimp_image_get_active_drawable. * cbmplugs.h: Added backwards-compability for gimp_image_get_active_drawable change. * advartstudio.c, afli.c, artist64.c, artstudio.c, blazingpaddles.c, cbmplugs.c, cbmplugs.h, drazpaint.c, eafli.c, fli64.c, imagesystem.c, interpainthires.c, interpaintlores.c, koala.c, rain.c, shfli.c, shflixl.c, sprite.c, suxx.c, twilight.c, vidcom64.c: Updated copyright information. 2004-08-19 David Weinehall * Release 1.0.1. * advartstudio.c,afli.c, artist64.c, artstudio.c, blazingpaddles.c, cbmplugs.h, drazpaint.c, eafli.c, fli64.c, imagesystem.c, interpainthires.c, interpaintlores.c, koala.c, rain.c, shfli.c, shflixl.c, sprite.c, suxx.c, twilight.c, vidcom64.c: made the run-header a macro. 2003-01-23 David Weinehall * Initial version. ChangeLog ends here cbmplugs-1.2.2/interpainthires.c0000644000175000000500000001013711305231425015026 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_interpaint_hires_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, IP64H); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_interpaint_hires_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, IP64H)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_interpaint_hires_load", "loads images in Interpaint Hires file format", "This plug-in loads images in Interpaint Hires file format.", "David Weinehall ", "David Weinehall", "2002", "/Interpaint Hires", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_interpaint_hires_load", "ip64h", ""); gimp_install_procedure("file_interpaint_hires_save", "saves images in Interpaint Hires file format", "This plug-in saves images in Interpaint Hires file format.", "David Weinehall ", "David Weinehall", "2002", "/Interpaint Hires", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_interpaint_hires_save", "ip64h", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/advartstudio.c0000644000175000000500000001021511305231425014324 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_advanced_artstudio_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, ADVOCP); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_advanced_artstudio_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, ADVOCP)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_advanced_artstudio_load", "loads images in Advanced OCP Art Studio file format", "This plug-in loads images in Advanced OCP Art Studio file format.", "David Weinehall ", "David Weinehall", "2002", "/Advanced Art Studio", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_advanced_artstudio_load", "mpic", ""); gimp_install_procedure("file_advanced_artstudio_save", "saves images in Advanced OCP Art Studio file format", "This plug-in saves images in Advanced OCP Art Studio file format.", "David Weinehall ", "David Weinehall", "2002", "/Advanced Art Studio", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_advanced_artstudio_save", "mpic", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/imageformats.txt0000644000175000000500000002310111305231425014664 0ustar taosrcThe following image-formats are supported: Advanced Art Studio: support: read/write plugin: advartstudio mode: multi suffix: .mpic 64-suffix: mpic blocks: 40 bytes: 2000-471f format: 2000-3f3f: bitmap 3f40-4327: mcolour 4328: background 4329-4337: padding 4338-471f: colour AFLI: support: read/write plugin: afli mode: hires suffix: .afli 64-suffix: N/A blocks: 65 bytes: 4000-7fff format: 4000-43e7: mcolour 0 43e8-43ff: padding 4400-47e7: mcolour 1 47e8-47ff: padding 4800-4be7: mcolour 2 4be8-4bff: padding 4c00-4fe7: mcolour 3 4fe8-4fff: padding 5000-53e7: mcolour 4 53e8-53ff: padding 5400-57e7: mcolour 5 57e8-57ff: padding 5800-5be7: mcolour 6 5be8-5bff: padding 5c00-5fe7: mcolour 7 5fe8-5fff: padding 6000-7f40: bitmap 7f40-7fff: padding Artist 64: support: read/write plugin: artist64 mode: multi suffix: .a64 64-prefix: p- blocks: 41 bytes: 4000-67ff format: 4000-5f3f: bitmap 5f40-5fff: padding 6000-63e7: mcolour 63e8-63ff: padding 6400-67e7: colour 67e8-67fe: padding 67ff: background Art Studio: support: read/write plugin: artstudio mode: hires suffix: .ocp 64-suffix: pic blocks: 36 bytes: 2000-4327 format: 2000-3f3f: bitmap 3f40-4327: mcolour Blazing Paddles: support: read/write plugin: bpaddles mode: multi suffix: .bpi 64-prefix: pi. blocks: 41 bytes: a000-c7ff format: a000-bf3f: bitmap bf40-bfff: padding c000-c3e7: mcolour c3e8-c3ff: padding c400-c7e7: colour c7e8-c7ff: padding Drazpaint: support: read/write plugin: drazpaint mode: multi suffix: .dp64 64-suffix: N/A blocks: 40 bytes: 5800-7f40 format: 5800-5be7: colour 5be8-5bfe: padding 5c00-5fe7: mcolour 5fe8-5fff: padding 6000-7f3f: bitmap 7f40: background 7f41: padding EAFLI: support: read plugin: eafli mode: hires + sprites suffix: .eafli 64-prefix: -. blocks: 47 bytes: 8000-adbf format: 8000-81bf mcolour0 81c0-83bf spriterow0 83c0-83ff padding 8400-85bf mcolour1 85c0-87bf spriterow1 83c0-83ff padding 8800-89bf mcolour2 89c0-8bbf spriterow2 8bc0-8bff padding 8c00-8dbf mcolour3 8dc0-8fbf spriterow3 8fc0-8fff padding 9000-91bf mcolour4 91c0-93ff padding 9400-95bf mcolour5 95c0-97ff padding 9800-99bf mcolour6 99c0-9bff padding 9c00-9dbf mcolour7 9dc0-9fff padding a000-adbf bitmap 81ff sprite 1-7 colour 823f sprite 0 colour 1 827f sprite 0 colour 2 82bf sprite 0 colour 0 82ff hires or multicolour for sprite 0 (1 = multi) FLI: support: read/write plugin: fli64 mode: multi suffix: .fli64 64-suffix: N/A blocks: 69 bytes: 3b00/3c00-7f3f/7fff format: 3b00-3bc7: bgcolour Interleave 18-0 (line % 8 == 0) 31-19 (line % 8 == 1) 4a-32 (line % 8 == 2) 63-4b (line % 8 == 3) 7c-64 (line % 8 == 4) 95-7d (line % 8 == 5) ae-96 (line % 8 == 6) c7-af (line % 8 == 7) 3bc8-3bff: padding 3c00-3fe7: colour 3fe8-3fff: padding 4000-43e7: mcolour 0 43e8-43ff: padding 4400-47e7: mcolour 1 47e8-47ff: padding 4800-4be7: mcolour 2 4be8-4bff: padding 4c00-4fe7: mcolour 3 4fe8-4fff: padding 5000-53e7: mcolour 4 53e8-53ff: padding 5400-57e7: mcolour 5 57e8-57ff: padding 5800-5be7: mcolour 6 5be8-5bff: padding 5c00-5fe7: mcolour 7 5fe8-5fff: padding 6000-7f3f: bitmap (7f40-7fff: padding) Image System: support: read/write plugin: imagesystem64 mode: multi suffix: .64i 64-prefix: ms. blocks: 41 bytes: 3c00-63e7 format: 3c00-3fe7: colour 3fe8-3fff: padding 4000-5f3f: bitmap 5f40-5fff: padding 6000-63e7: mcolour Interpaint Hires: support: read/write plugin: interpainthires mode: hires suffix: .ip64h 64-suffix: .hres blocks: 36 bytes: 4000-6327 format: 4000-5f3f: bitmap 5f40-6327: mcolour Interpaint Lores: support: read/write plugin: interpaintlores mode: multi suffix: .ip64l 64-suffix: .lres blocks: 40 bytes: 4000-6710 format: 4000-5f3f: bitmap 5f40-6327: mcolour 6328-670f: colour 6710: background Koala Painter: support: read/write plugin: koala mode: multi suffix: .koa 64-prefix: [reverse shift + a]pic[space] blocks: 40 bytes: 6000-8710 format: 6000-7f3f: bitmap 7f40-8327: mcolour 8328-870f: colour 8710: background Rain: support: read plugin: rain mode: hires charmap + sprites suffix: .rain 64-prefix: N/A blocks: 33 bytes: 4000-5fff format: 4000-43e7 col1 screenmap 1 00 10 ... f0 ff ... 01 11 ... f1 ff ... ... 0f 1f ... ff ff ... 43e8-43ef padding 43f0-43f3 "RAIN" 43f4 col2 43f5 col1 43f6 col0 43f7 bgcol 43f8-43ff spriteptrs 4400-43e7 col0 screenmap 2 00 10 ... f0 01 11 ... f1 ... 0f 1f ... ff 47e8-47f7 padding 47f8-47ff spriteptrs 4800-4fff: col0 (dark gray) charmap 5000-59ff: col1 (medium gray) sprites Rather complex; refer to cbmplugs.h 5a00-5fff: col2 (light gray) sprites Rather complex; refer to cbmplugs.h limitations: no bgcol + col2 nibbles no col1 on the first 4 and last 4 pixels each line no col1 or col2 on the first and last line SHFLI: support: read plugin: shfli mode: hires + sprites suffix: .shfli 64-suffix: .unp blocks: 63 bytes: 4000-7e00 format: 400e-401f + 28 * n (n = 0..14) mcolour0 4348-43e7 padding 43e8 sprite layer 0 colour 43e9 sprite layer 1 colour 43ea-43f7 padding 43f8-43ff spritepointer page 0 440e-441f + 28 * n (n = 0..14) mcolour1 4748-47f7 47f8-47ff spritepointer page 1 480e-481f + 28 * n (n = 0..14) mcolour2 4b48-4bff 4c0e-4c1f + 28 * n (n = 0..14) mcolour3 4f48-4fff 500e-501f + 28 * n (n = 0..14) mcolour4 5348-53ff 540e-541f + 28 * n (n = 0..14) mcolour5 5748-57ff 580e-581f + 28 * n (n = 0..14) mcolour6 5b48-5bff 5c0e-5c1f + 28 * n (n = 0..14) mcolour7 5f48-5fff 6000-603e sprite 0 layer 0 (row % 8 == 0) 603f padding 6040-6100 bitmap 6100-613e sprite 1 layer 0 (row % 8 == 0) 613f padding 6140-617e sprite 2 layer 0 (row % 8 == 0) 617f padding 6180-6240 bitmap 6240-627e sprite 3 layer 0 (row % 8 == 0) 627f padding 6280-62be sprite 0 layer 1 (row % 8 == 0) 62bf padding 62c0-6380 bitmap 6380-63be sprite 1 layer 1 (row % 8 == 0) 63bf padding 63c0-63fe sprite 2 layer 1 (row % 8 == 0) 63ff padding 6400-64c0 bitmap 64c0-64fe sprite 3 layer 1 (row % 8 == 0) 64ff padding 6500-653e sprite 0 layer 0 (row % 8 == 1) 653f padding 6540-6600 bitmap 6600-663e sprite 1 layer 0 (row % 8 == 1) 663f padding 6640-667e sprite 2 layer 0 (row % 8 == 1) 667f padding 6680-6740 bitmap 6740-677e sprite 3 layer 0 (row % 8 == 1) 677f padding 6780-67be sprite 0 layer 1 (row % 8 == 1) 67bf padding 67c0-6880 bitmap 6880-68be sprite 1 layer 1 (row % 8 == 1) 68bf padding 68c0-68fe sprite 2 layer 1 (row % 8 == 1) 68ff padding 6900-69c0 bitmap 69c0-69fe sprite 3 layer 1 (row % 8 == 1) 69ff padding a8, ac, ad, b1 b2, b6, b7, bb bc, c0, c1, c5 c6, ca, cb, cf d0, d4, d5, d9 da, de, df, e3 e4, e8, e9, ea eb, ec, ed, ee ef, f0, f1, f2 f3, f4, f5, f6 f7, 1e, 2e, 3e 4e, 5e, 6e, 7e SHFLI-XL: support: read plugin: shflixl mode: hires + sprites suffix: .shfxl 64-suffix: blocks: 61 bytes: 4000-7c00 format: 400b-401d + 28 * n (n = 0..14) mcolour0 6540-69c0 bitmap Sprite: support: write plugin: sprite mode: hires/multi suffix: .spr 64-prefix: N/A blocks: N/A bytes: n * 40 format: xx00-xx3e: bitmap xx3f: padding Super-Hires: support: - plugin: superhires mode: hires suffix: .sshe1 64-suffix: /sshe1 blocks: 59 bytes: 4650-7fff format: Suxx-Editor: support: read/write plugin: suxx mode: multi suffix: .sux 64-prefix: !> blocks: 38 bytes: 5a23/5a24-7f3f format: 5a23: background (optional; default = black) 5a24-5c17: colour high + low 5c18-5fff: mcolour 6000-7f3f: bitmap Twilight Bitmap Editor: support: read/write plugin: twilight mode: multi suffix: .tbe 64-suffix: N/A blocks: 40 bytes: 5800-7f3f format: 5800-5be7: colour 5be8-5bfe: padding 5bff: background 5c00-5fe7: mcolour 5fe8-5fff: padding 6000-7f3f: bitmap Vidcom 64: support: read/write plugin: vidcom64 mode: multi suffix: .vco 64-prefix: b. blocks: 40 bytes: 5800-7f3f format: 5800-5be7: colour 5be8-5bff: padding 5c00-5fe7: mcolour 5fe8-5fff: padding 6000-7f3f: bitmap HWS: support: write plugin: hws mode: hires suffix: .hws 64-prefix: .hws blocks: ? bytes: 4000-5f40 format: 4000-5f3f: bitmap 5f40-603f: sprite row1, col 1 ($40-54) 6040-613f: sprite row2, col 1 ($55-69) 6140-623f: sprite row3, col 1 ($6a-7e) 6240-633f: sprite row4, col 1 ($7f-93) 6340-643f: sprite row5, col 1 ($94-a8) 6440-653f: sprite row6, col 1 ($a9-bd) 6540-663f: sprite row7, col 1 ($be-d2) 6640-673f: sprite row8, col 1 ($d3-e7) 6740-683f: sprite row9, col 1 ($e8-fc) 6840-693f: sprite row1, col 2 ($40-54) 6940-6a3f: sprite row2, col 2 ($55-69) 6a40-6b3f: sprite row3, col 2 ($6a-7e) 6b40-6c3f: sprite row4, col 2 ($7f-93) 6c40-6d3f: sprite row5, col 2 ($94-a8) 6d40-6e3f: sprite row6, col 2 ($a9-bd) 6e40-6f3f: sprite row7, col 2 ($be-d2) 6f40-703f: sprite row8, col 2 ($d3-e7) 7040-713f: sprite row9, col 2 ($e8-fc) cbmplugs-1.2.2/README0000644000175000000500000000067411305231425012337 0ustar taosrcThese plugins for The GIMP v2.x are to be used for importing and exporting images from/to the Commodore 64. See the file imageformats.txt for details on what file formats are supported. A GIMP palette (Commodore64.gpl) which tries to imitate the colours of the Commodore 64 as closely as possible is also included. Ideas and part of the implementation is based on the Koala Painter plugin by Maurits Rijk, written in 1999 for The GIMP v1.0. cbmplugs-1.2.2/eafli.c0000644000175000000500000001003611305231425012674 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_eafli_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, EAFLI); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } #if 0 } else if (strcmp(name, "file_eafli_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, EAFLI)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } #endif } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); #if 0 static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); #endif gimp_install_procedure("file_eafli_load", "loads images in EAFLI Editor file format", "This plug-in loads images in EAFLI Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/EAFLI", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_eafli_load", "eafli", ""); #if 0 gimp_install_procedure("file_eafli_save", "saves images in EAFLI Editor file format", "This plug-in saves images in EAFLI Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/EAFLI", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_eafli_save", "eafli", ""); #endif } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/interpaintlores.c0000644000175000000500000001013711305231425015040 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_interpaint_lores_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, IP64L); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_interpaint_lores_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, IP64L)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_interpaint_lores_load", "loads images in Interpaint Lores file format", "This plug-in loads images in Interpaint Lores file format.", "David Weinehall ", "David Weinehall", "2002", "/Interpaint Lores", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_interpaint_lores_load", "ip64m", ""); gimp_install_procedure("file_interpaint_lores_save", "saves images in Interpaint Lores file format", "This plug-in saves images in Interpaint Lores file format.", "David Weinehall ", "David Weinehall", "2002", "/Interpaint Lores", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_interpaint_lores_save", "ip64m", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/blazingpaddles.c0000644000175000000500000001011711305231425014577 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_blazing_paddles_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, BLAZE); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_blazing_paddles_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, BLAZE)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_blazing_paddles_load", "loads images in Blazing Paddles file format", "This plug-in loads images in Blazing Paddles file format.", "David Weinehall ", "David Weinehall", "2002", "/Blazing Paddles", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_blazing_paddles_load", "bpi", ""); gimp_install_procedure("file_blazing_paddles_save", "saves images in Blazing Paddles file format", "This plug-in saves images in Blazing Paddles file format.", "David Weinehall ", "David Weinehall", "2002", "/Blazing Paddles", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_blazing_paddles_save", "bpi", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/fli64.c0000644000175000000500000000777311305231425012556 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_fli64_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, FLI); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_fli64_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, FLI)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_fli64_load", "loads images in FLI Graph v2.0 file format", "This plug-in loads images in FLI Graph v2.0 file format.", "David Weinehall ", "David Weinehall", "2002", "/FLI64", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_fli64_load", "fli64", ""); gimp_install_procedure("file_fli64_save", "saves images in FLI Graph v2.0 file format", "This plug-in saves images in FLI Graph v2.0 file format.", "David Weinehall ", "David Weinehall", "2002", "/FLI64", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_fli64_save", "fli64", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/TODO0000644000175000000500000000073511305231425012145 0ustar taosrco Read/Write support for Amica Paint (needs equal-char unpacker) o Read/write support for Zoomatic o Read support for HWS o Write support for Rain, EAFLI, SHFLI, SHFLI-XL | If plausible o Support for other non-interlaced image-formats o Unify the Rain-support with the rest o Make imageformats.txt reflect the actual formats of SHFLI & SHFLI-XL o Make more use of set_bitmap_pixel and set_sprmap_pixel o Image formats from the C= 128, DTV, etc o Read/Write support for 7Rain cbmplugs-1.2.2/koala.c0000644000175000000500000001003711305231425012704 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_koala_paint_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, KOALA); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_koala_paint_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, KOALA)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_koala_paint_load", "loads images in Koala Paint file format", "This plug-in loads images in Koala Paint file format.", "David Weinehall ", "David Weinehall", "2002", "/Koala Paint", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_koala_paint_load", "koa", ""); gimp_install_procedure("file_koala_paint_save", "saves images in Koala Paint file format", "This plug-in saves images in Koala Paint file format.", "David Weinehall ", "David Weinehall", "2002", "/Koala Paint", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_koala_paint_save", "koa", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/FIXME0000644000175000000500000000024311305231425012242 0ustar taosrco Unify the Rain-support with the rest o Make imageformats.txt reflect the actual formats of SHFLI & SHFLI-XL o Modify HWS to use 1 pixel offset for every sprite cbmplugs-1.2.2/twilight.c0000644000175000000500000001006711305231425013453 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright (C) 2002-2005 David Weinehall * * These plugins are based off of work * * Copyright (C) 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_twilight_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, TLIGHT); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_twilight_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, TLIGHT)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_twilight_load", "loads images in Twilight Bitmap Editor file format", "This plug-in loads images in Twilight Bitmap Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/Twilight", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_twilight_load", "tbe", ""); gimp_install_procedure("file_twilight_save", "saves images in Twilight Bitmap Editor file format", "This plug-in saves images in Twilight Bitmap Editor file format.", "David Weinehall ", "David Weinehall", "2002", "/Twilight", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_twilight_save", "tbe", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/drazpaint.c0000644000175000000500000001000711305231425013606 0ustar taosrc/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP * * Copyright © 2002-2007 David Weinehall * * These plugins are based off of work * * Copyright © 1999 Maurits Rijk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "cbmplugs.h" _runheader { static GimpParam values[2]; GimpRunMode run_mode; gint32 image_ID; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; if (nparams < 2) return; run_mode = param[0].data.d_int32; if (strcmp(name, "file_drazpaint_load") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; image_ID = load_image(param[1].data.d_string, DRAZ); if (image_ID != -1) { *nreturn_vals = 2; values[0].data.d_status = GIMP_PDB_SUCCESS; values[1].type = GIMP_PDB_IMAGE; values[1].data.d_image = image_ID; } } else if (strcmp(name, "file_drazpaint_save") == 0) { values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (!save_image(param[3].data.d_string, param[1].data.d_image, DRAZ)) { *nreturn_vals = 1; values[0].data.d_status = GIMP_PDB_SUCCESS; } } } static void query(void) { static GimpParamDef load_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to load" }, }; static GimpParamDef load_return_vals[] = { { GIMP_PDB_IMAGE, "image", "Output image" }, }; static int nload_args = sizeof (load_args) / sizeof (load_args[0]); static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]); static GimpParamDef save_args[] = { { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_IMAGE, "image", "Input image" }, { GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" }, { GIMP_PDB_STRING, "filename", "The name of the file to save the image in" }, { GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }, }; static int nsave_args = sizeof (save_args) / sizeof (save_args[0]); gimp_install_procedure("file_drazpaint_load", "loads images in Drazpaint file format", "This plug-in loads images in Drazpaint file format.", "David Weinehall ", "David Weinehall", "2002", "/Drazpaint", NULL, GIMP_PLUGIN, nload_args, nload_return_vals, load_args, load_return_vals); gimp_register_load_handler("file_drazpaint_load", "dp64", ""); gimp_install_procedure("file_drazpaint_save", "saves images in Drazpaint file format", "This plug-in saves images in Drazpaint file format.", "David Weinehall ", "David Weinehall", "2002", "/Drazpaint", "INDEXED", GIMP_PLUGIN, nsave_args, 0, save_args, NULL); gimp_register_save_handler("file_drazpaint_save", "dp64", ""); } GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN(); cbmplugs-1.2.2/DTV.gpl0000644000175000000500000001244511305231425012617 0ustar taosrcGIMP Palette Name: dtv3 Columns: 0 # 0 0 0 Untitled 16 17 20 Untitled 30 37 32 Untitled 49 56 47 Untitled 66 69 64 Untitled 85 87 83 Untitled 103 106 99 Untitled 120 123 119 Untitled 132 135 130 Untitled 152 155 150 Untitled 165 168 163 Untitled 186 189 185 Untitled 199 201 193 Untitled 221 223 219 Untitled 236 239 235 Untitled 255 255 255 Untitled 50 0 0 Untitled 67 7 0 Untitled 82 26 0 Untitled 102 44 0 Untitled 117 59 0 Untitled 135 80 0 Untitled 153 96 11 Untitled 166 116 36 Untitled 183 126 42 Untitled 202 140 67 Untitled 218 159 79 Untitled 235 181 92 Untitled 252 196 112 Untitled 255 213 132 Untitled 255 232 153 Untitled 255 251 162 Untitled 66 0 0 Untitled 77 0 0 Untitled 100 9 0 Untitled 115 30 7 Untitled 130 43 16 Untitled 150 63 37 Untitled 169 80 59 Untitled 173 93 60 Untitled 199 109 85 Untitled 213 130 99 Untitled 235 148 120 Untitled 255 162 142 Untitled 255 179 155 Untitled 255 199 170 Untitled 255 213 192 Untitled 255 232 208 Untitled 76 0 3 Untitled 83 0 9 Untitled 105 0 29 Untitled 123 19 46 Untitled 139 33 66 Untitled 155 50 79 Untitled 172 66 99 Untitled 192 86 107 Untitled 198 99 140 Untitled 223 116 146 Untitled 236 138 165 Untitled 255 150 186 Untitled 255 166 205 Untitled 255 185 223 Untitled 255 203 238 Untitled 255 219 252 Untitled 66 0 49 Untitled 77 0 62 Untitled 99 0 83 Untitled 119 10 102 Untitled 130 24 112 Untitled 146 44 130 Untitled 166 63 153 Untitled 185 79 166 Untitled 198 92 179 Untitled 215 107 201 Untitled 231 125 209 Untitled 251 142 234 Untitled 255 162 255 Untitled 255 181 255 Untitled 255 195 255 Untitled 255 213 255 Untitled 49 0 89 Untitled 62 0 102 Untitled 83 0 119 Untitled 102 7 136 Untitled 112 26 149 Untitled 132 43 182 Untitled 155 60 186 Untitled 169 79 209 Untitled 183 90 222 Untitled 196 109 242 Untitled 221 129 255 Untitled 236 146 255 Untitled 254 165 255 Untitled 255 179 255 Untitled 255 196 255 Untitled 255 212 255 Untitled 26 0 115 Untitled 40 0 135 Untitled 63 0 146 Untitled 77 16 166 Untitled 93 32 185 Untitled 106 52 199 Untitled 129 70 219 Untitled 148 86 239 Untitled 159 99 254 Untitled 176 117 255 Untitled 193 133 255 Untitled 208 150 255 Untitled 228 168 255 Untitled 244 188 255 Untitled 255 205 255 Untitled 255 225 255 Untitled 0 0 125 Untitled 17 0 139 Untitled 33 10 163 Untitled 52 30 181 Untitled 66 44 192 Untitled 86 64 212 Untitled 103 82 229 Untitled 120 96 248 Untitled 130 107 255 Untitled 152 128 255 Untitled 166 149 255 Untitled 182 165 255 Untitled 201 179 255 Untitled 222 198 255 Untitled 239 215 255 Untitled 255 239 255 Untitled 0 0 115 Untitled 0 7 135 Untitled 3 26 148 Untitled 23 43 169 Untitled 36 62 185 Untitled 57 76 208 Untitled 72 93 212 Untitled 97 112 239 Untitled 105 129 244 Untitled 122 146 255 Untitled 138 160 255 Untitled 153 176 255 Untitled 173 198 255 Untitled 186 215 255 Untitled 209 231 255 Untitled 228 249 255 Untitled 0 10 89 Untitled 0 24 99 Untitled 0 47 123 Untitled 3 64 143 Untitled 14 74 158 Untitled 36 97 176 Untitled 49 113 192 Untitled 67 133 208 Untitled 82 143 219 Untitled 102 158 236 Untitled 119 181 255 Untitled 135 196 255 Untitled 149 211 255 Untitled 168 234 255 Untitled 186 248 255 Untitled 201 255 255 Untitled 0 27 43 Untitled 0 42 56 Untitled 0 57 82 Untitled 0 83 102 Untitled 0 92 115 Untitled 17 112 135 Untitled 34 129 149 Untitled 46 150 160 Untitled 69 159 183 Untitled 85 175 196 Untitled 99 192 218 Untitled 119 215 226 Untitled 136 231 254 Untitled 152 249 255 Untitled 168 255 255 Untitled 185 255 255 Untitled 0 36 3 Untitled 0 53 13 Untitled 0 72 24 Untitled 0 90 50 Untitled 0 106 64 Untitled 11 126 87 Untitled 29 142 100 Untitled 46 163 112 Untitled 63 172 132 Untitled 79 188 145 Untitled 95 203 163 Untitled 115 223 183 Untitled 133 241 198 Untitled 152 255 218 Untitled 162 255 236 Untitled 186 255 255 Untitled 0 46 0 Untitled 0 59 0 Untitled 0 80 0 Untitled 0 100 1 Untitled 3 110 14 Untitled 13 132 32 Untitled 39 149 52 Untitled 57 166 73 Untitled 64 179 77 Untitled 80 198 92 Untitled 97 212 113 Untitled 120 229 136 Untitled 132 248 149 Untitled 159 255 175 Untitled 172 255 182 Untitled 183 255 203 Untitled 0 44 0 Untitled 0 63 0 Untitled 0 76 0 Untitled 1 97 0 Untitled 19 115 0 Untitled 36 128 0 Untitled 53 149 10 Untitled 70 163 32 Untitled 82 178 42 Untitled 102 201 49 Untitled 117 211 79 Untitled 136 226 96 Untitled 153 248 109 Untitled 168 255 125 Untitled 186 255 143 Untitled 206 255 162 Untitled 0 39 0 Untitled 0 56 0 Untitled 6 73 0 Untitled 24 95 0 Untitled 36 105 0 Untitled 56 125 0 Untitled 77 145 0 Untitled 92 160 0 Untitled 103 172 16 Untitled 129 189 34 Untitled 142 205 46 Untitled 158 226 66 Untitled 173 239 85 Untitled 196 255 100 Untitled 206 255 110 Untitled 231 255 139 Untitled 0 26 0 Untitled 16 42 0 Untitled 33 59 0 Untitled 50 79 0 Untitled 66 93 0 Untitled 87 109 0 Untitled 103 129 0 Untitled 115 146 0 Untitled 132 160 1 Untitled 149 181 26 Untitled 170 196 39 Untitled 185 212 57 Untitled 208 232 80 Untitled 225 249 89 Untitled 238 255 107 Untitled 255 255 126 Untitled