Other Publications

Achieving a regular flow of data between main() and an interrupt service routine using a lock-free circular queue with a producer-consumer design pattern

This article aims to illustrate how to take data that might not be produced at a regular interval by a routine inside main(), and smooth out the consumption of that data by an ISR, so it may be consumed at a regular interval using a lock-free circular queue. It also demonstrates how to design a lock-free data structure that can safely pass an arbitrary sized piece of data to an interrupt service routine, without having to disable interrupts (or use an ATOMIC_BLOCK). The sample code was written using AVR-GCC for an AVR ATmega328P, but it can be easily modified to work with other compilers and/or chips.

The concepts presented in this article were originally developed for my Rainbow Fire project, but are applicable to a wide range of solutions.

The full project described in the article is available in a git repository.

Click the thumbnail to view the PDF inside your web browser's default viewer.

Uzebox Mode 3 with Scrolling Guide

This is something that I wish existed back when I first started developing on the Uzebox. It includes diagrams to help explain the relationship between VRAM, the screen, and your level data, and it walks the reader through writing the code for each different scrolling configuration (horizontal only, vertical only, horizontal and vertical) line by line, explaining things as much as possible. The scrolling is bi-directional, it only loads data for a row and/or column when absolutely necessary, always loads the tiles into the hidden areas of VRAM, and it allows you to scroll the screen by up to 8 pixels per call to the Camera_update function. It doesn't cover everything, but it should be a pretty good start for people who want to learn how to use this video mode.

There are full projects available for all the examples in the guide in its git repository.

Click the thumbnail to view the PDF inside your web browser's default viewer.