summaryrefslogtreecommitdiffstats
path: root/generate_utils.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2022-11-26 17:08:09 -0800
committeryum <yum.food.vr@gmail.com>2022-11-26 17:13:36 -0800
commit480463b0578407a8f5a6585eb7018933e6ec7186 (patch)
tree2a11d8298aaca6169581008f225f7fcbcc70bae8 /generate_utils.py
parent89a929fe76e4dbd56436288055366d9416c13e74 (diff)
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.
Diffstat (limited to 'generate_utils.py')
-rw-r--r--generate_utils.py12
1 files changed, 3 insertions, 9 deletions
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.