[Game]Pine-2K - A Fantasy Console For Pokitto

A bug:

  • if you have a “.git” folder in your game root folder, the resource buiding in Femto fails with “Error: EISDIR: illegal operation on a directory, read”
1 Like

How does the color selection work in the integrated gfx editor in Femto? If I choose the orange color in the gfx editor, it appears as yellow in the game.

There seems to be a off-by-one-row error in the returned bitmap pointer with the io("TILE") command.

    for(var i=0; i<27;i++)
    {
        bm=io("TILE", i+1, 19);
        tile(i,19, bm);
    }

I call the above function each time after shifting the tilemap 8 pixels. That is to move tiles to the left. So it cumulates the error as seen in the anim-gif.
PINE-SDK.bin.2

The first 2 bytes of a tile image are unused and the second two are the width and height of the image. When using io("TILE", x, y) however the returned pointer points to the first pixel. I discovered this when storing some additional information in the 2 unused bytes for my custom tiles.

Simply change it to

for (var i = 0; i < 27; ++i)
{
    bm=io("TILE", i + 1, 19)-4; //either subtract 4 from io here
    tile(i, 19, bm); //or subtract 4 from bm here
}

That’s interesting … I wonder what @FManga had in mind for those two unused bytes?

Its so that the tile images and sprite images are identical. For sprite images the first byte seems unused (most likely to align everything to 4 bytes), the second byte specifies the bit depth (1, 2, 4, or 8) and the third and fourth specify the width and height. Originally the tiles only had the width and height since tiles have to be 8bpp but it was changed to make them identical to sprite images. However, @FManga confirmed that pine2k simply adds 2 to the pointer supplied to the tile() function and so the first two bytes are unused.

Right. I forgot about the colour depth being encoded in the image itself. I guess it makes perfect sense to align the format.

Oops, I’ll make it subtract the two bytes in 'io(“TILE”)`.

It’s not just for alignment, it’s used for recoloring. If an image is 1bpp or 4bpp (like the symbols in the flash games), the index of the first color is stored in that first byte.

1 Like

Pine-2K uses the Miloslav.pal (2.5 KB) palette, so the colors need to match that. You can import it into Piskel by clicking on the pencil above the color picker.

2 Likes

For me I need to press a ‘+’ key, not a pencil. Pressing a pencil brings a “Download as file” button, when it should be “import from file” button (Btw. I am using Linux if that matters).

I have now imported the “miloslav.pal” file, but still no luck. e.g. the tyre colors are wrong in the emulator.

Try adding color(0); before drawing any sprites. Note that this will make text black, which is why the default is color(7);.

Thanks! That fixed it.

downloaded pine 2k, no example games anymore?

I still see 6 examples?

1 Like

I know after I sent that I realize I installed it wrong I found them