(still hard) no external RAM / Flash as cheap as possible simply sourceable Current / known interfaces Off the shelf peripherals, Languages, Compilers Current connectors & components DIY OK for double sided PCB and surface mount Doable by an individual in his basement (no BGA) Goals : DIY Hardware
• 8 contributors (GitHub), many contributed programs ! • DIY bitboxes • Documentation : improved Wiki – Central Software list • + 10 games + 3 public WIP + 1 emulator + 3D demos / engines + 2 music programs + other programs …
(not that complex !) – Compile – Compile emulator with SDL (test on PC!) – Load .bin to SD or write directly with USB cable – On-chip debugging with a $5 probe • Toolchain used : GCC / GDB arm-none-eabi-gcc – Compilers available on raw Linux ubuntu ubuntu , windows , haiku , mac : ✔ ✔ ✔ ✔
level drivers = a set of optional libraries No dependency, Open Source No specific algorithms (blitter, engine, mixer …) NOT an OS : one process, raw memory access. All programmed in C • Audio : snd_buffer(void *buffer) • Video : graph_line(void *line_buffer) • SD : FAT32 fatfs lib f_open, f_read… • USB HID : interface – Gamepad : u16 buttons[2] (1 bit/button) + u8 analog x/y – Mouse : int8 X,Y,buttons – Keyboard : u8 mod, char[6] keys
large ! – Reduce resolution (eg 320x240) → 170 k ! – Reduce color depth @8bpp → 70k \o/ • Usage : include lib/framebuffer.c/.h – Declare VGA_BPP + VGA_MODE in makefile – Write pixels to VRAM • Other mode : Text mode – Write letters to VRAM, kernel will write letters on screen – Usage : include textmode, define VGA_MODE + FONTSIZE – Also provides a font attribute array (each letter : bg/fg colors)
console hardware worked like that – NES, SNES, GB, GBA, Megadrive, NeoGeo ... • Sometimes coupled with different palettes per tile • Can store tilemap in ram (vram), tileset in flash (rom) • Allows large levels • Can couple the visual grid with logical grid
simple API different objects with render line func (in C) rectangles sprites (u16, c8, p4, rle) tilemaps (RAM and Flash) Stored in RAM or Flash Blit top down (z order) keeping track of blit progress Create tilemaps, tilesets, instanciate : from code ?
levels with Tiled Map editor : – Tilemap – Tilesets, tile names and properties – Sprites references (sevral compression types : RLE, 16c, couples ...) – Sprites positions, Animations • Export to binary files + .c/.h data readable from engine / code with scripts • Compile in game (or load from SD to RAM) (add to GAME_BIN variable in makefile) • Create game logic (.c) : – obj=new_sprite (sprite_data, …) ; obj2=new_tmap(tset, tmap) – reference data from Flash with .h created (or load in ram) – move/animate objects by changing coordinates / frames – Write inside VRAM tilemaps, move them (Scrolling) – Make higher-level state machine (menu, in-level, intro, death animation ...)