Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2024-03-24 13:06:27

Retron
New member
Registered: 2024-03-24
Posts: 2

Understanding tiles

unsigned char TestTile[] =
{
    0x18,0x81,0x81,0x81, 0x81,0x81,0x81,0x18,
    0x88,0x18,0x18,0x18, 0x00,0x00,0x00,0x81,
};

this snippet of code right here creates an 8x8 tile which I can put into memory using set_bkg_data(0, 1, TestTile);, right?

I can't find a decent tile editor for my mac (wine isn't working for me).  I decided to make my own tile editor, problem is that I don't understand how this works.  is 0x18 light grey?  How does the program know this is tile 0, etc.

If someone can help me understand how tiles work, that would be real neat.

P.S. I'm a newbie to all this gameboy/retro development stuff so please be patient with me.=

Offline

 

#2 2024-03-25 10:41:11

Retron
New member
Registered: 2024-03-24
Posts: 2

Re: Understanding tiles

UPDATE:
Nevermind, I figured it out.  It's a bit more complicated than I hoped. 

If anyone is looking for an answer, this video helped me: https://www.youtube.com/watch?v=tnMAEwT … l=AngelSix

Offline

 

#3 2024-03-25 11:57:43

toxa
Member
Registered: 2020-02-13
Posts: 305

Re: Understanding tiles

1. you can use any editor which produce PNG files and then use PNG2ASSET tool which is shipped with GBDK-2020
2. look into the GBDK-2020 examples, especially /examples/cross-platform/logo and /examples/cross-platform/metasprites that demonstrate usage of PNG2ASSET
3. use const specifier on the arrays, or else they take double amount of memory: array itself in WRAM and array initializer in ROM.
4. i suggest you to join the GBDK-2020 discord server where you can get support much faster

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson