Some extra details about the demo:
- Artwork is from the free Dawnlike tileset that you can find here:
http://opengameart.org/content/dawnlike ... ileset-v18
- The demo level was created in Tiled and I then made a custom program to convert from the .tmx format to a simple format for the demo to parse
- I arranged the format of the map to have the contents twice: column-major and row-major. This was so that the demo can easily read a 'strip' of the map in both horizontal and vertical orientations in a single read. As you pan the camera, it loads the new strip of data at the edge of the screen.
- For some strange reason, petitfatfs would cause all sorts of wild problems if my read buffer was a local array rather than a global one, i.e:
Code: Select all
// Bad, ends up overwriting bits of memory
void MyReadFn()
{
uint8_t buffer[BUFFER_SIZE];
WORD bytesRead;
pf_read(buffer, BUFFER_SIZE, &bytesRead);
}
// Good!
uint8_t buffer[BUFFER_SIZE];
void MyReadFn()
{
WORD bytesRead;
pf_read(buffer, BUFFER_SIZE, &bytesRead);
}