From d2c9a7b88adae1e949af60b7f276364592e49869 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Thu, 25 Dec 2025 22:37:22 +0800 Subject: Matrix 1980s style. --- _site/feed.xml | 2 +- _site/log/matrix-digital-rain/index.html | 39 ++++++++++++-------------------- _site/posts.xml | 2 +- 3 files changed, 16 insertions(+), 27 deletions(-) (limited to '_site') diff --git a/_site/feed.xml b/_site/feed.xml index 53bfef3..109f0b4 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1 +1 @@ -Jekyll2025-12-25T17:24:55+08:00/feed.xmlASCIIMX | LogW. D. Sadeep MadurangeMatrix Rain: 2025 refactor2025-12-21T00:00:00+08:002025-12-21T00:00:00+08:00/log/matrix-digital-rainW. D. Sadeep MadurangeSuckless upgrade workflow2025-11-30T00:00:00+08:002025-11-30T00:00:00+08:00/log/suckless-softwareW. D. Sadeep MadurangeFingerprint door lock2025-08-18T00:00:00+08:002025-08-18T00:00:00+08:00/log/fpm-door-lockW. D. Sadeep MadurangeOn the use of MOSFETs as electronic switches2025-06-22T00:00:00+08:002025-06-22T00:00:00+08:00/log/mosfet-switchesW. D. Sadeep MadurangeHow to configure ATmega328P microcontrollers to run at 3.3V and 5V2025-06-10T00:00:00+08:002025-06-10T00:00:00+08:00/log/arduino-unoW. D. Sadeep MadurangeMy first PCB2025-04-26T00:00:00+08:002025-04-26T00:00:00+08:00/log/my-first-pcbW. D. Sadeep MadurangeBumblebee: browser automation2025-04-02T00:00:00+08:002025-04-02T00:00:00+08:00/log/bumblebeeW. D. Sadeep MadurangeHow to set up ATSAM3X8E microcontrollers for bare-metal programming in C2024-09-16T00:00:00+08:002024-09-16T00:00:00+08:00/log/arduino-dueW. D. Sadeep MadurangeEtlas: e-paper dashboard2024-09-05T00:00:00+08:002024-09-05T00:00:00+08:00/log/etlasW. D. Sadeep MadurangeExperimental e-reader2023-10-24T00:00:00+08:002023-10-24T00:00:00+08:00/log/e-readerW. D. Sadeep Madurange \ No newline at end of file +Jekyll2025-12-25T17:40:37+08:00/feed.xmlASCIIMX | LogW. D. Sadeep MadurangeMatrix Rain: 2025 refactor2025-12-21T00:00:00+08:002025-12-21T00:00:00+08:00/log/matrix-digital-rainW. D. Sadeep MadurangeSuckless upgrade workflow2025-11-30T00:00:00+08:002025-11-30T00:00:00+08:00/log/suckless-softwareW. D. Sadeep MadurangeFingerprint door lock2025-08-18T00:00:00+08:002025-08-18T00:00:00+08:00/log/fpm-door-lockW. D. Sadeep MadurangeOn the use of MOSFETs as electronic switches2025-06-22T00:00:00+08:002025-06-22T00:00:00+08:00/log/mosfet-switchesW. D. Sadeep MadurangeHow to configure ATmega328P microcontrollers to run at 3.3V and 5V2025-06-10T00:00:00+08:002025-06-10T00:00:00+08:00/log/arduino-unoW. D. Sadeep MadurangeMy first PCB2025-04-26T00:00:00+08:002025-04-26T00:00:00+08:00/log/my-first-pcbW. D. Sadeep MadurangeBumblebee: browser automation2025-04-02T00:00:00+08:002025-04-02T00:00:00+08:00/log/bumblebeeW. D. Sadeep MadurangeHow to set up ATSAM3X8E microcontrollers for bare-metal programming in C2024-09-16T00:00:00+08:002024-09-16T00:00:00+08:00/log/arduino-dueW. D. Sadeep MadurangeEtlas: e-paper dashboard2024-09-05T00:00:00+08:002024-09-05T00:00:00+08:00/log/etlasW. D. Sadeep MadurangeExperimental e-reader2023-10-24T00:00:00+08:002023-10-24T00:00:00+08:00/log/e-readerW. D. Sadeep Madurange \ No newline at end of file diff --git a/_site/log/matrix-digital-rain/index.html b/_site/log/matrix-digital-rain/index.html index f47ac5e..b428f9e 100644 --- a/_site/log/matrix-digital-rain/index.html +++ b/_site/log/matrix-digital-rain/index.html @@ -44,39 +44,28 @@

MATRIX RAIN: 2025 REFACTOR

21 DECEMBER 2025

-

Fixed the Unicode issue finally. Can now mix ASCII + Katakana.

- -

Took me 2 hours to decipher how this even works. For future me: mat.col[] -stores shuffled column indices, mat.row[] tracks last updated row per column. -shuffle() randomizes the working set, index i (line 333) and lines 364-370 draw -one column at a time, swap() rotates columns in and out. That’s the rain.

- -

Moved Phosphor decay level into the LSB of the RGB union - should’ve done this -in 2022 instead of separate array. WTF was I thinking?

- -

Keeping the RGB/PD union as it is. I know the ‘portability’ nerds hate it, but -I’m on a little-endian machine, and I’m the only one reading this. It’s -cleaner.

- -

New charset array works. UNICODE(min, max) macro packs the range into uint64. -insert_code() picks random block, unpacks it, and picks random char. Elegant.

- -

Looks a lot like the original now:

+

Unicode support added. ASCII + Katakana working:

-

Using half-width Katakana (U+FF61-U+FF9F) because full-width characters break -columns.

+

Algorithm notes: mat.col[] = shuffled column indices, mat.row[] = last row per +column. shuffle() sets working set, main loop draws columns via index i (line +333), swap() rotates set.

+ +

Phosphor decay moved to LSB of RGB union. Should have done this originally.

+ +

RGB/PD union stays. Little-endian machine, portability not a concern.

+ +

Charset via UNICODE(min, max) macro - packs range into uint64, insert_code() +unpacks and selects random char.

-

blend() is still good, left it alone.

+

Half-width Katakana (U+FF61-U+FF9F) for column alignment.

-

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

+

Removed license, automake files. Build: cc -O3 main.c -o matrix

-

Performance regressions: none. Runs like a charm on the T490. 2% CPU. No -whirring fans.

+

Performance: 2% CPU, OpenBSD, T490.

Commit: 03f8d87

diff --git a/_site/posts.xml b/_site/posts.xml index 0774115..ca75414 100644 --- a/_site/posts.xml +++ b/_site/posts.xml @@ -1 +1 @@ -Jekyll2025-12-25T17:24:55+08:00/posts.xmlASCIIMXW. D. Sadeep Madurange \ No newline at end of file +Jekyll2025-12-25T17:40:37+08:00/posts.xmlASCIIMXW. D. Sadeep Madurange \ No newline at end of file -- cgit v1.2.3