I'm making a custom build of Piskel

That sounds easy enough to do just need to be able to to write to a file

Also the motivation to do it, the idea has been bouncing around in my head for months now, but tapping my foot or drumming my fingers on the desk seem like more fun at the time :-p

Is there any tools for sound effects and music? That would be great as well.

Yes. But I don’t think it’s user friendly that much. I can’t even get a sound coming out of it. :wink:

There is also a windows app which is using compatible tracker-files:

1 Like

I’ve added bit depth to Piskel functionality

kuva

Exporting to 256 colors (8-bit) is already working

kuva

The test image:

kuva

1 Like

Exporting to 4-bit colors (16 colors) also works now

Now I need to stop and go ship the pending Pokitto orders for today

3 Likes

Oh crap, looks like the tracker did work, it’s just that i need to put the sound almost to the max to hear it.

Thank you for all this! The better the tools are, the better and faster we will see interesting stuff made for the Pokitto!

1 Like

I’m not a webdev, but I know this is a thing:

1 Like

was talking about the pixel editor on the pokitto itself.
but yea in web context you basicly have to upload and download files, though it might be able to save the last state with a cookie so you dont lose your drawing by acidentaly refreshing the page

Now that would be a great idea!

2 Likes

Probably ready to deploy tomorrow.

  • customized UI
  • bit depth settings
  • fixed palette & palette export
  • 8-bit and 4-bit pixel data export to C headers
  • settings finetuned for Pokitto use

EDIT: @pharap, if you are serious about it being better to export to .cpp files, then specify how the output should be in detail

Output of above image

#include <stdint.h>

#define PISKEL_GHOST_FRAME_COUNT 1
#define PISKEL_GHOST_FRAME_WIDTH 24
#define PISKEL_GHOST_FRAME_HEIGHT 24
#define PISKEL_GHOST_COLOR_BITS 4

/* 16-bit (565 rgb) palette data for "Piskel Ghost" */
static const uint16_t piskel_ghost_pal[] = { 
0x0, 0xffff, 0x7e0, 0xf800, 
};

/* Piskel data for "Piskel Ghost" */
static const uint8_t piskel_ghost_data[1][288] = {
{
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x11,
0x11,0x11,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x11,0x00,
0x10,0x01,0x10,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x12,
0x01,0x20,0x10,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x10,0x22,
0x02,0x20,0x11,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x11,0x00,
0x10,0x01,0x11,0x00,0x00,0x00,
0x00,0x10,0x00,0x01,0x11,0x11,
0x11,0x11,0x11,0x00,0x01,0x00,
0x01,0x11,0x11,0x11,0x11,0x10,
0x01,0x11,0x11,0x01,0x11,0x10,
0x00,0x10,0x00,0x11,0x11,0x10,
0x01,0x11,0x10,0x00,0x01,0x00,
0x00,0x00,0x00,0x01,0x11,0x11,
0x11,0x11,0x10,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x11,0x11,
0x11,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x11,0x11,
0x11,0x11,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x11,0x11,
0x11,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x11,
0x11,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x11,
0x11,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x11,
0x11,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x11,
0x10,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x11,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x10,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x11,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
}
};

2 Likes

The equivalent of the output of that image would be:

#pragma once

#include <cstdint>

constexpr std::uint32_t piskel_ghost_frame_count = 1;
constexpr std::uint32_t piskel_ghost_frame_width = 24;
constexpr std::uint32_t piskel_ghost_frame_height = 24;
constexpr std::uint32_t piskel_ghost_color_bits = 4;

// 16-bit (565 rgb) palette data for "Piskel Ghost"
static const std::uint16_t piskel_ghost_pal[] =
{ 
	0x0, 0xffff, 0x7e0, 0xf800,
};

// Piskel data for "Piskel Ghost"
static const std::uint8_t piskel_ghost_data[piskel_ghost_frame_count][288] =
{
	{
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x01,0x11,
		0x11,0x11,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x11,0x00,
		0x10,0x01,0x10,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x10,0x12,
		0x01,0x20,0x10,0x00,0x00,0x00,
		0x00,0x00,0x00,0x01,0x10,0x22,
		0x02,0x20,0x11,0x00,0x00,0x00,
		0x00,0x00,0x00,0x01,0x11,0x00,
		0x10,0x01,0x11,0x00,0x00,0x00,
		0x00,0x10,0x00,0x01,0x11,0x11,
		0x11,0x11,0x11,0x00,0x01,0x00,
		0x01,0x11,0x11,0x11,0x11,0x10,
		0x01,0x11,0x11,0x01,0x11,0x10,
		0x00,0x10,0x00,0x11,0x11,0x10,
		0x01,0x11,0x10,0x00,0x01,0x00,
		0x00,0x00,0x00,0x01,0x11,0x11,
		0x11,0x11,0x10,0x00,0x00,0x00,
		0x00,0x00,0x00,0x01,0x11,0x11,
		0x11,0x10,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x11,0x11,
		0x11,0x11,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x11,0x11,
		0x11,0x10,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x01,0x11,
		0x11,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x01,0x11,
		0x11,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x01,0x11,
		0x11,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x01,0x11,
		0x10,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x01,0x11,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x01,0x10,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x11,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
		0x00,0x00,0x00,0x00,0x00,0x00,
	}
};

The main differences:

  • #pragma once is desirable if the file is going to be included as a .h file, it will ‘multiple definition’ errors if the header is included more than once
  • #include <cstdint> should be preferred because #include <stdint.h> is deprecated (see here and/or here.)
  • When using cstdint, expect the fixed width integer types to be in the std namespace. Many implementations also put them in the global namspace, but that’s not guaranteed by the standard
  • constexpr variables should be preferred over macros because the identifiers are confined to a specific namespace (in this case, the global namespace), whereas macros pollute the entire translation unit

Other things of note:

  • Naming conventions are debatable
  • Brace style is debatable
  • Indentation style is debatable
  • Spelling is debatable

It would be good (though not strictly necessary) to be able to choose which styles are used in the output.

What is the screen size of pokitto?
So I know how big I can make stuff.

110x88 in standard mode with 16 colors
220x176 in high resolution mode 4 colors
110x88 in mode13 with 256 colors
220x176 in mode15 with 16 colors

these are the ones that use the entire screen (and seem to be most commenly used i think)
there also the backwards compatibilaty modes but those are black and white

1 Like

Shouldn’t it be generating .h files instead of .c files?

If the graphics are in a .c file then you can’t include the file and if you can’t include it your code can’t see the identifiers defined by the file.

It either needs to generate a corresponding .h file that declares everything or it needs to generate a .h to begin with (in which case using C headers instead of C++ headers may still be a problem).

Should we change that to .h file then ?

1 Like

Currently there doesn’t seem to be a 4 colour mode option, only 256 and 16.

Also I had problems using Piskel at first because it requires cookies and I have cookies off by default - I use a whitelist system instead of a blacklist system.

1 Like

Whitelist is much better