From 480463b0578407a8f5a6585eb7018933e6ec7186 Mon Sep 17 00:00:00 2001 From: yum Date: Sat, 26 Nov 2022 17:08:09 -0800 Subject: Add emotes Add emotes.py. It accepts a list of images and creates a texture with 64 total embedded images. The shader knows how to draw these into fixed 6-character-wide slots. Each slot must be aligned to a 6-character boundary. osc_ctrl has to pad with spaces to make this work. This whole patch is a little more complicated than it has any right to be, but my brain feels fuzzy and I don't know where to start fixing it, so I'm going to leave it shitty-but-functional for now. There's also some bug where writing a character into the 11th slot causes it to show up at the end of the board. I'll figure that out later, idk. I didn't include any of the emotes I use since I couldn't find any info on their licenses. I'm just banking on having a good workflow later on so people can add their own. --- generate_utils.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'generate_utils.py') diff --git a/generate_utils.py b/generate_utils.py index e8c60b8..0480c3c 100644 --- a/generate_utils.py +++ b/generate_utils.py @@ -10,18 +10,12 @@ def replaceMacros(lines, macro_defs): # the last cell will (with the current implementation) wrap around to the front # of the board. BOARD_ROWS=4 -BOARD_COLS=44 -INDEX_BITS=4 +BOARD_COLS=48 +NUM_REGIONS = 16 CHARS_PER_CELL=256 BYTES_PER_CHAR=2 -NUM_LAYERS=ceil((BOARD_ROWS * BOARD_COLS) / (2**INDEX_BITS)) - -# The bits per layer are: -# 8 bits: letter selection (256 possible letters per slot) -# 3 bits: slot selection (each layer controls 8 slots) -# 1 bit: enable bit (turns layer off while we index to a new slot) -NUM_PARAM_BITS=(NUM_LAYERS * (8 + INDEX_BITS + 1)) +NUM_LAYERS=ceil((BOARD_ROWS * BOARD_COLS) / NUM_REGIONS) # Implementation detail. We use this parameter to return from the terminal # state of the FX layer to the starting state. -- cgit v1.2.3