From f47dd3efa3763eb946564bd324873d53061e398f Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 30 Sep 2022 21:59:08 -0700 Subject: Add line wrapping and support for arbitrarily long messages Add trivial line wrapping algorithm. Words are only added to a line if they don't put it over the column limit, and only broken if they alone exceed the column limit. Extend board size to 16x6, using 145 bits of parameter memory. Add simple generate.sh script, which generates everything needed to use the text-to-text board. --- generate_utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'generate_utils.py') diff --git a/generate_utils.py b/generate_utils.py index 1abb694..e50a656 100644 --- a/generate_utils.py +++ b/generate_utils.py @@ -7,7 +7,7 @@ def replaceMacros(lines, macro_defs): return lines BOARD_ROWS=6 -BOARD_COLS=14 +BOARD_COLS=16 INDEX_BITS=3 CHARS_PER_CELL=80 @@ -34,10 +34,11 @@ def getEnableParam(which_layer): return "TaSTT_L%02d_E" % which_layer def getBoardIndex(which_layer, s0, s1, s2): - # TODO(yum_food) because we divide the board into a multiple of 8 cells, - # some cells describe animations which don't exist. We work around this by - # simply wrapping those animations back to the top of the board, and rely - # on the OSC controller to simply not reference those cells. Clean this up. + # Because we divide the board into a multiple of 8 cells, some cells may + # describe animations which don't exist, depending on the size of the board. + # We work around this by simply wrapping those animations back to the top + # of the board, and rely on the OSC controller to simply not reference + # those cells. return ((s0 * 4 + s1 * 2 + s2) * NUM_LAYERS + which_layer) % (BOARD_ROWS * BOARD_COLS) # Mapping from layer to shader param. -- cgit v1.2.3