If you haven't used Tiled, I strongly recommend it. It's a platform agnostic tile based mapping tool with a number of nice features. A particularly nice one is CSV export - a format that can be very quickly converted into byte code or something else.
I won't cover how to make or organize a tile map here - that is something covered in detail in a number of places. Skipping ahead, let's assume you've made a simple map something like this:
In our case, we want it as an .h file we can include in our SGDK project. After exporting the map as a CSV, we get the following data, or something like it:
The entirety of the python script I wrote to convert the CSV to a .h file is here (explanation below):
1. If the byte is NOT 0xFE, copy through2. If the byte IS 0xFE:- The next byte is the value to copy- The following byte is how many times to copy it- Move to next byte, back to 1.
That means the following are true:
"1 1 1 1 2" = 0xFE 0x01 0x04 0x02"2 2 2 1 1" = 0xFE 0x02 0x03 0x01 0x01