PCX Palette Converter to SNES (C & C#)

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: PCX Palette Converter to SNES (C#)

Post by nicklausw »

I've found a library called ImageMagick.NET that allows the conversion of nearly every image format to pcx, but am having trouble implementing it. Wish me luck with it.
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: PCX Palette Converter to SNES (C#)

Post by Drew Sebastino »

So we can transport a non .pcx image file into an image file and then get the .pcx file to get the palette from? :wink:
Wish me luck with it.
Luck wished. :P
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: PCX Palette Converter to SNES (C#)

Post by tepples »

My Super NES sample project includes pilbmp2nes, a tile converter written in Python that converts an indexed image in any format that Pillow (Python Imaging Library) can load (namely BMP, GIF, PCX, and PNG) to any tile format that can be described as a planemap. Here's what I mean by "planemaps":
  • NES: "0;1" (one bitplane of bit 0, then one bitplane of bit 1)
  • Game Boy and Super NES 2-bit: "0,1" (bits 0 and 1, interleaved by line)
  • Sega Master System: "0,1,2,3" (bits 0-3, interleaved by line)
  • Super NES: "0,1;2,3" (bits 0-1, interleaved by line, then bits 2-3, interleaved by line)
  • Super Mario World 3-bit: "0,1;2"
  • Genesis: "3210" (four bits packed)
  • Super NES 8-bit for modes 3 and 4: "0,1;2,3;4,5;6,7"
  • Super NES mode 7 and GBA 8-bit: "76543210"
  • Virtual Boy: "10", hflip, bytes reversed
  • GBA 4-bit: "3210", hflip, bytes reversed
My program doesn't create palettes or nametables. Yet. I'm trying to think of a similarly extensible way to handle those. Any ideas?
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: PCX Palette Converter to SNES (C#)

Post by Drew Sebastino »

tepples wrote:It doesn't create palettes or nametables. Yet. I'm trying to think of a similarly extensible way to handle those. Any ideas?
What are you trying to say? If you say you are trying to find ways how to handle the palette files and nametables (tile maps?) you should look at the program pcx2snes. It has a whole list of options that you can select and it outputs files for tiles, palettes, and (optionally) tile maps for BGs. It can even output "special" mode 7 backgrounds. (The tiles and the tile map is interweaved, but I'm sure you already knew that. :wink: )
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: PCX Palette Converter to SNES (C#)

Post by nicklausw »

I don't know a thing about Python. Wanted to write the program for C (because extreme amounts of compatibility) but too many complications and I ended up with my head spinning.
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: PCX Palette Converter to SNES (C#)

Post by lidnariq »

ImageMagick is pretty awesome.
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: PCX Palette Converter to SNES (C#)

Post by nicklausw »

I took a look at Python. As simple and convenient as scripting languages can be, it seems inconvenient to open up a file expecting an executable just to find that it's a script and there's some interpreter needed. (Then again, I'm the one using .NET...)
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: PCX Palette Converter to SNES (C & C#)

Post by nicklausw »

Small update. (Read first post).
Optiroc
Posts: 129
Joined: Thu Feb 07, 2013 1:15 am
Location: Sweden

Re: PCX Palette Converter to SNES (C#)

Post by Optiroc »

nicklausw wrote:I took a look at Python. As simple and convenient as scripting languages can be, it seems inconvenient to open up a file expecting an executable just to find that it's a script and there's some interpreter needed. (Then again, I'm the one using .NET...)
I can see your reasoning, I guess, but usually a GUI app is exactly what you don't expect/want from an asset pipeline tool.

The larger problem with SNES tools is that the average quality of free/open stuff out there is very low. There's some good stuff around (I guess? Not too sure when I think of it) buried among 20 years of bad hacks, DOS binaries etc. So most people around today realize this and build some custom tools fit to their exact purpose, so they can get going with the actual SNES hacking as quickly as possible. Which is completely natural in an "eco system" as small as the SNES hacking scene. I guess if the scene would be larger and more active, we would also see more people taking pleasure in refining good, modern, tools for it.

Anyway, a shortlist of actually usable tools would be great.. Is there such a thing?
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: PCX Palette Converter to SNES (C#)

Post by nicklausw »

Optiroc wrote:
nicklausw wrote:I took a look at Python. As simple and convenient as scripting languages can be, it seems inconvenient to open up a file expecting an executable just to find that it's a script and there's some interpreter needed. (Then again, I'm the one using .NET...)
I can see your reasoning, I guess, but usually a GUI app is exactly what you don't expect/want from an asset pipeline tool.

The larger problem with SNES tools is that the average quality of free/open stuff out there is very low. There's some good stuff around (I guess? Not too sure when I think of it) buried among 20 years of bad hacks, DOS binaries etc. So most people around today realize this and build some custom tools fit to their exact purpose, so they can get going with the actual SNES hacking as quickly as possible. Which is completely natural in an "eco system" as small as the SNES hacking scene. I guess if the scene would be larger and more active, we would also see more people taking pleasure in refining good, modern, tools for it.

Anyway, a shortlist of actually usable tools would be great.. Is there such a thing?
There certainly needs to be. Perhaps we should gather things up? (If the broken links don't attack, that is).
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: PCX Palette Converter to SNES (C & C#)

Post by tepples »

Or if there are particular missing tools, perhaps we could describe how they should work and some smart cookie can put something together.
Post Reply