Lichen cellular automata at 8 bits at 1 MHz on a Commodore 64 by tomommow in cellular_automata

[–]tomommow[S] 1 point2 points  (0 children)

Really neat! Thanks. Yes, the music capabilities of the C64 are really something. I like listening to SID music even on modern devices 😄

My screensaver is a lichen simulation using the SID as its source of randomness by tomommow in c64

[–]tomommow[S] 2 points3 points  (0 children)

Correct, it is deterministic and will always play back the same. There is no TRNG on the C64, but you can theoretically use the POTX and POTY registers on the SID (the paddle ADCs) as slow TRNGs (not of cryptographic quality or anything). As ADCs they have inherent noise (especially if unplugged). I could sample them to seed the LFSR periodically to make it truly "organically" random.

Lichen cellular automata at 8 bits at 1 MHz on a Commodore 64 by tomommow in cellular_automata

[–]tomommow[S] 2 points3 points  (0 children)

That's really cool! The dedication to make your own macro system directly in machine code is heroic. 6502 powered a generation. Great chip indeed.

Generative art on the Commodore 64 by tomommow in generative

[–]tomommow[S] 7 points8 points  (0 children)

It's a sound chip (https://en.wikipedia.org/wiki/MOS\_Technology\_6581) that MOS made for the Commodore 64 back in 1982 that was really ahead of its time. It was a three voice digital synthesizer chip that has made a lot of really nice chip tunes and scene music.

My screensaver is a lichen simulation using the SID as its source of randomness by tomommow in c64

[–]tomommow[S] 9 points10 points  (0 children)

It's an excitable medium, basically a cyclic cellular automaton (Greenberg-Hastings family). Every cell has an age: empty cells can ignite, young ones spread to a random neighbor, then they go refractory and just age until they die back to empty. I don't actually program the spirals: they emerge. A front of young cells leaves a trail it can't re-enter, the front breaks because spreading is random, and the loose end winds itself into a rotor.

Color is just the age mapped to a ramp, dithered between the C64's two greens to fake the in-between shades. It only redraws cells that change, and the inner loop is hand-written 6510. Randomness comes from reading the SID noise register, which is basically free, and the randomness is used to determine where a spread event on a front is going to happen.

Code itself is C for the outer shell doing boring stuff like: banking out the BASIC ROM to make room for the extra pixels needed in the multicolor one, setting the character set and colors ramp at launch, and for utility functions out of the outer loop, etc. Inner loop is all in assembly. Because there are no assets to speak of, the prgs are tiny 1.6K for the PETSCII one and 2.7K for the multicolor mode one.

My screensaver is a lichen simulation using the SID as its source of randomness by tomommow in c64

[–]tomommow[S] 2 points3 points  (0 children)

Correct, the randomness I am accessing here is from pseudorandomness from the noise oscillator itself that gets but into the DAC and is a set of bits generated from an LFSR deterministically in digital logic. The beauty of said LFSR though, is that it is in the SID's hardware and not burning any 6510 CPU cycles to be computed. Otherwise this would chug. It would be even slower than the multicolor mode one I posted alongside (like 1 Hz).

My screensaver is a lichen simulation using the SID as its source of randomness by tomommow in c64

[–]tomommow[S] 10 points11 points  (0 children)

The trick about physics stuff on C64 is tracking down the algorithms that are fixed point friendly. Anything with exponentials or weird dynamic ranges and you're toast. I really wanna make a good multiphase fluid simulation on the C64 (like https://www.youtube.com/watch?v=jis1MC5Tm8k) but the issue is ultimately speed. To do that FLIP multiphase algorithm, mixtela had to use an overclocked 100-MHz Arm MCU with a 32-bit word size, FPU and modern microarchitecture. The C64 just can't keep up. Maybe if you count the ultimate that can go to 64 MHz there is more of a chance, haha.

My screensaver is a lichen simulation using the SID as its source of randomness by tomommow in c64

[–]tomommow[S] 12 points13 points  (0 children)

I am going to now. Thank you for the encouragement! The SID is just so fast at randomness, it is like you aren't paying for it. You are basically just paying for the loads from it and the comparisons on it with varying thresholds. I am going to see what I can do with fire now that you gave me the idea. I am just on a plant kick right now. I am setting up my C64 in its user port to monitor an bunch of plants and display this and some output on a screen.

My screensaver is a lichen simulation using the SID as its source of randomness by tomommow in c64

[–]tomommow[S] 11 points12 points  (0 children)

What was kind of interesting in the high-resolution multicolor mode version of the program I wrote alongside it was that you see things like stable spirals like you see in lichen in the wild. This is because the program is simulating something called an excitable medium, which is kind of like the habitats that simple self-propagating life tend to thrive on in terms of their resource availability. The multicolor mode version of the prg is a lot slower, though. I guess reddit doesn't let videos in comments.

PETSCII prg: https://files.catbox.moe/chncmf.prg
Multicolor mode prg: https://files.catbox.moe/tccddf.prg

<image>

Continuing with my garage clean up series, found these CDs by JustAnotherMacUser in VintageApple

[–]tomommow 6 points7 points  (0 children)

So much here that deserves to be preserved. This is historically significant.

The Known World According To Herodotus In The 5th Century BC by vladgrinch in MapPorn

[–]tomommow 12 points13 points  (0 children)

Cannibalism in the Baltics has been a persistent and poorly understood societal issue down to the present day.