-
Micro Font and other small things
11/14/2016 at 15:13 • 0 commentsin an effort to convey as much information on the small number of pixels available, I had designed a small number bitmap set, I have since expanded this into a full alphabet (Ascii 32 - 126)
this font is proportionately spaced, and as narrow as possible and only 6 pixels high with descenders. the bitmap table is under 256 bytes with a offset and width table taking up another 180 . these tables could be eliminated, but I want fast as possible performance without having to create a table in RAM.
Also have a working Tetris and Brick-Out now, and human control is working on 3 of 4 games.
Time from an ESP8266 is working, as is weather, but displaying the weather forecast without the micro font was not practical.
-
Complete Code Rewrite
10/10/2016 at 19:28 • 0 commentsI had waited long enough, and a complete code rewrite from procedural flat C to OO C++ model.
Advantages of OO redesign:
- Adding more functions becomes easer.
- Legibilidy and intent becomes clearer
- Memory management* issues easer to solve.
- Moving to PlatformIO makes C++ easer to navigate than the Arduino IDE.
*Memory Management: Due to the constraints of up to 64x64 RGB pixels on an arduino Mega, memory management had been key in the original implementation of the code. Moving the code to OO C++ would normally mean leaving even more of the memory in the hands of the compiler, but inorder to force reuse of the pool of available RAM, I wrote my own memory management routines, and each Mode or Module that runs on the device can clear out and use as required this same buffer of ram, that only has to be allocated once. Previous versions of the code had approached maximum allocation, forcing reuse of global variables such that adding one more 8Bit int could cause the code to no longer execute.