diff options
| author | yum <yum.food.vr@gmail.com> | 2022-09-30 21:59:08 -0700 |
|---|---|---|
| committer | yum <yumfood@airmail.cc> | 2022-09-30 21:59:08 -0700 |
| commit | f47dd3efa3763eb946564bd324873d53061e398f (patch) | |
| tree | cbf998184658c221199d5b93ec6359e4a63fe0c5 /generate_utils.py | |
| parent | 2fa5bc78b5c4500301327bd6a334ab4fb8e04a17 (diff) | |
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.
Diffstat (limited to 'generate_utils.py')
| -rw-r--r-- | generate_utils.py | 11 |
1 files changed, 6 insertions, 5 deletions
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. |
