From a851a2d646f439f7126c232ba1524c55a8990872 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Fri, 9 Jan 2026 16:45:56 +0800 Subject: Remove _site from git. --- _site/log/matrix-digital-rain/index.html | 110 ------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 _site/log/matrix-digital-rain/index.html (limited to '_site/log/matrix-digital-rain/index.html') diff --git a/_site/log/matrix-digital-rain/index.html b/_site/log/matrix-digital-rain/index.html deleted file mode 100644 index 1915d04..0000000 --- a/_site/log/matrix-digital-rain/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Matrix Rain: 2025 refactor - - - - - - - - - - - -
-
-
-

MATRIX RAIN: 2025 REFACTOR

-
21 DECEMBER 2025
-
-

The 2022 version worked but had some loose ends. Unicode support was -inflexible–couldn’t mix ASCII with Katakana; Phosphor decay was stored in a -separate array when it should’ve been packed with RGB; Code was harder to read -than it needed to be.

- - - -

Moved phosphor decay into the 4th byte of the RGB union–should’ve done this -in 2022; What was I thinking.

- -

Keeping the RGB union despite portability concerns. All my systems are -little-endian and the code is cleaner this way.

- -

Fixed Unicode by introducing a charset array. UNICODE(min, max) packs Unicode -ranges into uint64: low four bytes for start, high four bytes for end. -insert_code() unpacks a random block and picks a character from it:

- -
#define UNICODE(min, max)  (((uint64_t)max << 32) | min)
-
-static uint64_t glyphs[] = {
-    UNICODE(0x0021, 0x007E), /* ASCII */
-    UNICODE(0xFF65, 0xFF9F), /* Half-width Katakana */
-};
-
-static inline void insert_code(matrix *mat,
-    size_t row, size_t col) 
-{
-    uint64_t blk;
-    uint32_t min, max;
-
-    blk = glyphs[(rand() % glyphlen)];
-    min = (uint32_t)blk;
-    max = (uint32_t)(blk >> 32);
-    mat->code[index(mat, row, col)] = rand() % (max - min) + min;
-}
-
- -

Full-width Katakana breaks column alignment. Stick to half-width -(U+FF61-U+FF9F) range. Compile with -DNOKANA to disable Katakana altogether.

- -

blend() is still good. Leaving it alone.

- -

Tossed license and automake cruft. Just cc -O3 main.c -o matrix now. Don’t -need the ceremony.

- -

Runs at 2-3% CPU on OpenBSD (T490). No regressions. Fans are quiet.

- -

Commit: f71b0de.

- -
- -
-
-
- - - - - - -- cgit v1.2.3