nesdev.com
http://forums.nesdev.com/

xpm-nes, embedding X11 xpm files in NES software
http://forums.nesdev.com/viewtopic.php?f=2&t=11194
Page 1 of 1

Author:  erana [ Sat Apr 26, 2014 1:48 am ]
Post subject:  xpm-nes, embedding X11 xpm files in NES software

Hi, there's a NES demo for making xpm available in NES programs. Basically an xpm file is for coming into a program so you can convert its data in a buffer of characters, a structure has been made for that.

This is an example of such a file :
/* XPM */
static char * tilegrass2_16x16_xpm[] = {
"16 16 8 1",
" c None",
". c #406030",
"+ c #688038",
"@ c #2B471D",
"# c #80A820",
"$ c #E0F830",
"% c #C0B060",
"& c #908040",
".+.@.+.+@.+.@.+.",
".+#.+#.+@.+##.+.",
"..##+.#+.+.#+.+#",
"+..#@.+#.#.#$%.+",
".+.+#@.#.+.#%&..",
".@.$$@.+#.@+.@+.",
"+@@$%..+#.@@.@+.",
"++.@@+@..@.@@...",
"...#.+.@.+..@.#+",
"+..+#.@@@..#+.++",
"+++++.+++.++.+.@",
".+..+#++.##+.+.@",
"..@..+.#.@$%..#+",
"+#.@@@++.@%&@.+.",
".+.+..+..@+@.++.",
"..@.+.+.@+.+...@"};

Now my program just gives you something which can be made to a choice of NES image binary formats, you only have to convert from a character array as I said, pygame works this way also.

Source code is at https://sf.net/projects/xpmnes

If your NES incbins are full you can use my program for embedding xpm files just in plain C.

HTH.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/