From 5b5f4849d4ada11a0f27b6da2ae0280f37eac24a Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 21 Jan 2005 01:10:44 +0000 Subject: Initial checkin --- C64Mono.cs | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 C64Mono.cs (limited to 'C64Mono.cs') diff --git a/C64Mono.cs b/C64Mono.cs new file mode 100644 index 0000000..ead883e --- /dev/null +++ b/C64Mono.cs @@ -0,0 +1,172 @@ +// Base plugin for GfxEd8 +// Copyright (C) 2004 Ian Cowburn +// +// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// $Id$ +// +using System; +using System.IO; +using GfxEdInterface; + +namespace GfxEdBasePlugin +{ + /// + /// Description of MyClass. + /// + public class C64Mono : IPlugin + { + public C64Mono() + { + m_pal=new Colour[17]; + + // Colours taken from VICE screen grab + // + m_pal[0]=new Colour("Background",0,0,0); + m_pal[1]=new Colour("Black",0,0,0); + m_pal[2]=new Colour("White",255,255,255); + m_pal[3]=new Colour("Red",137,64,54); + m_pal[4]=new Colour("Cyan",122,191,199); + m_pal[5]=new Colour("Purple",138,70,174); + m_pal[6]=new Colour("Green",104,169,65); + m_pal[7]=new Colour("Blue",62,49,162); + m_pal[8]=new Colour("Yellow",208,220,113); + m_pal[9]=new Colour("Orange",144,95,37); + m_pal[10]=new Colour("Brown",165,42,42); + m_pal[11]=new Colour("Light Red",187,119,109); + m_pal[12]=new Colour("Dark Grey",85,85,85); + m_pal[13]=new Colour("Medium Grey",128,128,128); + m_pal[14]=new Colour("Light Green",172,234,136); + m_pal[15]=new Colour("Light Blue",124,112,218); + m_pal[16]=new Colour("Light Grey",171,171,171); + + m_size=new SpriteSize[1]; + m_size[0]=new SpriteSize(24,21,1,1); + + m_paledit=new bool[2] {false,true}; + m_palcommon=new bool[2] {true,false}; + + m_config=new C64ConfigForm(); + m_output=new Output(2,1,true,true); + } + + public string Description + { + get {return "Commodore 64 Mono Sprites";} + } + + public string ShortName + { + get {return "C64 Mono Sprites";} + } + + public string Author + { + get {return Global.Copyright;} + } + + public string URL + { + get {return Global.URL;} + } + + public uint MaxColours + { + get {return 2;} + } + + public Colour[] Palette + { + get {return m_pal;} + } + + public bool[] SprPalEditable + { + get {return m_paledit;} + } + + public bool[] SprPalCommon + { + get {return m_palcommon;} + } + + public SpriteSize[] AllowedSizes + { + get {return m_size;} + } + + public string ExportExtension + { + get + { + switch(m_config.Format) + { + case C64ConfigForm.ExportFormat.Assembly: + return "asm"; + case C64ConfigForm.ExportFormat.Basic: + return "bas"; + default: + return "c"; + } + } + } + + public bool Export(string path, SpriteList sprites) + { + TextWriter w=File.CreateText(path); + int line=6000; + + foreach (Sprite s in sprites) + { + switch(m_config.Format) + { + case C64ConfigForm.ExportFormat.Assembly: + m_output.Assembly(w,s); + break; + case C64ConfigForm.ExportFormat.Basic: + m_output.Basic(ref line,w,s); + break; + default: + m_output.C(w,s); + break; + } + } + + w.Close(); + + return true; + } + + public IConfig Config + { + get {return m_config;} + } + + public IProcess Process + { + get {return null;} + } + + // ------------------------------------------------ + // PRIVATE + // + private Colour[] m_pal; + private SpriteSize[] m_size; + private bool[] m_paledit; + private bool[] m_palcommon; + private C64ConfigForm m_config; + private Output m_output; + } +} -- cgit v1.2.3