Posts

Showing posts from January, 2022

Picante: Render Buffer Go Bye-Bye

What's gone wrong My initial approach to rendering in a timely manner involved native/C code to 'blit' bitmaps to an 8bpp render buffer.  Every frame, that render buffer is expanded into 16bpp stripes for transfer to the display.  At about 18-19fps, this was pretty tidy. The next step I wanted to take was to render tilemaps to the background, so I found a tileset online and converted into bytes() objects in a .py file for import...and promptly ran out of RAM. The New Proposed Approach So then I started looking at a 4bpp (16 colour) render buffer with colour palette, and I didn't like the amount of pixel operations involved in drawing to it, let alone expanding it out to the stripe for display. So my intention now is to store a list of render commands for each stripe of the display.  These commands could be partial 'blits' of a bitmap, or straight colour-fill, or whatever else.  The key thing is that they are only actually executed once all render commands have b...

Picante: a Pi Pico-based handheld project

Image
In The Beginning... I'd been experimenting with SPI displays on the Micro:bit before now and was lamenting how little RAM they have. So when I read about the Pi Pico 's whopping great 264KB of RAM I immediately wanted to make a DOS-a-like handheld game platform.  It easily has enough RAM for a full 320x240x8bpp frame buffer and at 133MHz it's about the same speed as an original-series Pentium.  Plus, it's dual core! All those figures made me think it would be an absolute doddle to make a DOS-a-like. ...but then I started to think about how it would actually be used.  Sure, I could make it so that C programmers could make games for it, but that might just end up with curiosity value. But what if I could make it so that the students I teach could program games in Python?  That way it would have loads of inspiration power whilst also having high educational value! With the magic mix of both idea and plausible use case, I set about making a prototype. The Hardwa...