<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Attila Szegedi - Blog</title>
  <subtitle>Quick thoughts, updates, and shorter pieces</subtitle>
  <link href="http://szegedi.live/blog/feed.xml" rel="self"/>
  <link href="http://szegedi.live/blog/"/>
  <updated>2026-01-26T00:00:00.000Z</updated>
  <id>http://szegedi.live/blog/</id>
  <author>
    <name>Attila Szegedi</name>
  </author>
  
  <entry>
    <title>Floppy Disk Rescue Mission</title>
    <link href="http://szegedi.live/blog/floppy-rescue/"/>
    <updated>2026-01-26T00:00:00.000Z</updated>
    <id>http://szegedi.live/blog/floppy-rescue/</id>
    <content type="html"><![CDATA[
      <p>The first article is up, and it’s about my involvement with <a href="/blog/fractals">fractals and fractal generators</a>. This blog post is rather about a side quest I had before/while writing it.</p>
<h1>A message</h1>
<p>The story of how that article came to be starts, weirdly enough, with a message from my sister. She sent me a message just after Christmas letting me know how she was telling her kids about some butterfly-shaped fractals I discovered when I was a kid, but all she can find online are formulae, and whether I could send her some pictures?</p>
<p>Truth is, I did have a webpage about them, except, it was the old page on the old domain I <a href="/blog/first-post">lost</a>. I thought, no biggie, I’ll just checkout my local source of my former website, and realized with horror that I… don’t have them anymore somehow? After some digging, I managed to find them in the <a href="https://web.archive.org/web/20170613115949/http://www.szegedi.org/fractals/butterfly/index.html">Wayback Machine</a> (I was so relieved and thankful that I immediately sent them a donation, too!)</p>
<h1>A floppy disk rescue mission</h1>
<p>That being my winter break time of the year, it also gave me an impulse to do something I do every third winter break on average related to old software and data – bring out an old Atari ST to the living room floor, power it up, check if some floppies are still readable after many years, maybe create a fresh copy of the more important ones. Like this:</p>
<p style="text-align: center;">
  <img src="/assets/images/IMG_6809.jpeg" alt="An Atari STE on the carpet in my living room, connected to an Atari SM124 monochrome monitor. To the right is a folder of floppy disks that also serves as a mouse pad.">
</p>
<p>I’d also fire up and play around with some of these programs, marveling at just what I was able to achieve as a seventeen year old kid. I wrote a bunch of software for Atari ST in my youth. Some games, but by far my most favorite piece of software was a fractal generator I named Butterfly Fractal Generator after the visual resemblance of some fractals I discovered. Now you see how did a message from my sister lead me to bring out the old Atari again.</p>
<p>During these times I would also quietly despair at the thought that over the years I never managed to transfer any data off the floppy disks into a more modern ecosystem (e.g. an SSD in a laptop) for preservation. The only media that contains these precious bits of nostalgia are few 3.5&quot; floppy disks. Miraculously, most of them are still readable after three decades, but it’s just a question of time before data gets corrupted and they get lost forever.</p>
<p>So every time I’d try different schemes to rescue them. I have an older PC that still has an internal floppy drive, and I tried various programs in the past that claimed to read and write Atari floppies on PC, but none of them worked. There are solutions to connecting Atari’s serial port to PC’s serial port and transferring data that way, but I was always stumped by the need to find or make a cable for that, or by the fact that I had no way to transfer the necessary software to an Atari floppy so it can run it.</p>
<p>I even considered some crazy schemes myself, like typing in a program on Atari from scratch that’ll convert floppies into modem sounds, recording them, and writing a program on PC that’ll decode them. Fortunately, I didn’t quite follow through on that one.</p>
<p>This year, I found some new rescue tool candidates: a low-level floppy driver named <a href="https://simonowen.com/fdrawcmd/">fdrawcmd.sys</a> and an Open-Source program named <a href="https://github.com/ChrisBertrandDotNet/ST-Recover">ST-Recover</a> and an older one named <a href="https://atari.8bitchip.info/floimgd.php">FloImg</a>. Unfortunately, none of them worked either. The floppies kep Being Not Read (or rather, Being Read With Lots of Weird Drive Noise and Accompanying Errors.)</p>
<p>In desperation, I <a href="https://bsky.app/profile/szegedia.bsky.social/post/3mbjkcslxbc23">asked for advice</a> on the interwebs, and a kind soul suggested I should try <a href="https://github.com/keirf/greaseweazle">Greaseweazle</a>, which is both software and a little circuit board that directly drives floppy drives. It <em>“directly reads the magnetic flux on the surface of the floppies”</em> – come on, how could I not desperately want to own one of these?</p>
<p>So I ordered a prebuilt Greaseweazle from a shop in Portugal, and it arrived, and I connected everything together, which ended up looking kind of ridiculous. So on one end there’s my MacBook Pro, which connects with a USB-C cable to Greaseweazle, which then connects with a floppy ribbon cable to a floppy disk drive that I took out of the PC chassis. Except… the drive also needs power through a 4-pin Berg connector, and the only power cable I have for it is the one coming out of the PC’s power supply, so I’m operating a noisy old PC beside all of this with an open chassis <em>solely so it can provide power to the floppy disk drive I took out of it in the first place.</em> Oh well, as jury-rigged assemblies go, I’ve had worse. I’m sad I didn’t remember to take a photo.</p>
<p>Anyhow, all of these gadgets are now properly connected to one another, I put in a floppy disk, and… I still got read errors! However, Greaseweazle diagnostics pointed out a curious thing: all read errors were on one side of the disk. I tried a different disk, with same results. Oh dang… it was never any of the software solutions’ fault; rather my old internal floppy disk drive is bust!</p>
<p>Wouldn’t you know it, I found a local business that advertises itself as a “PC scrapyard” and phoned them to confirm whether they have 3.5&quot; floppy disk drives. They did (“we pre-test each one whether it works!”) I went to the place – it was, in fact, very scrapyard like. A store in a basement, with all kinds of PC parts from various eras in heaps on shelves, the proprietor himself not exactly a youngster anymore either. I had a chat with him how his inventory system still runs off of a floppy disk, so having a stash of replacement drives is absolutely essential for his business. Truly a shop frozen in time, that.</p>
<p>I returned home, connected the new drive to the Greaseweazle, and <em>IT WORKED!</em>. Finally, after 33 years, I had a copy of my software that is safe from entropy on floppy disks and I could run on an emulator!</p>
<p>On a sidenote, Greaseweazle needs the exact geometry of the disk on input if you use it in high level read mode (so not imaging the magnetic flux), and back in my youth I carelessly formatted my floppies as anything from 80 to 86 tracks, and from 9 to 11 sectors per track, so it was a bit tedious to figure out the format. I eventually switched back to running ST-Recover and FloImg on the PC, as they read the declared geometry of the disk from its boot sector data. And because of the power supply for the floppy disk, I couldn’t eliminate the PC from the setup anyway.</p>
<h1>Next steps</h1>
<p>Now that I could extract the data from floppies, I could also use an excellent feature from the <a href="https://www.hatari-emu.org">Hatari</a> emulator where I can mount a directory on my Mac as a HDD for the emulated Atari, so I can super easily transfer data into the file system on my laptop.</p>
<p>I already created an archival source code repository for my <a href="https://github.com/szegedi/butterfly">Butterfly Fractal Generator source code</a> on Github. I also spent about a day trying to embed a browser version of the Hatari emulator into the page with the generator preloaded so people can play around with it, but it kept Not Wanting To Work so I gave up on that. In lieu, there’s an Atari ST <a href="/assets/images/butterfly.st">disk image</a> that you can load into an emulator yourself, should you want to.</p>
<p>I have some other projects from the past that I plan to upload for posterity later, as time allows, but all-in-all it’s a great feeling that they have finally escaped the confines of the old floppy disks.</p>

    ]]></content>
  </entry>
  
  <entry>
    <title>Fractals!</title>
    <link href="http://szegedi.live/blog/fractals/"/>
    <updated>2026-01-25T00:00:00.000Z</updated>
    <id>http://szegedi.live/blog/fractals/</id>
    <content type="html"><![CDATA[
      <h1>How I met fractals</h1>
<p>I got introduced to fractals when I was maybe 14 years old. I grew up in Croatia in the '80s, then still part of Yugoslavia, and there were 3 monthly magazines you could subscribe to in Yugoslavia if you were a computer afficionado: “Moj Mikro”, published in Slovenia, and “Računari” and “Svet Kompjutera”, both published in Serbia. Naturally, I was subscribed to all three.</p>
<p>I don’t remember anymore which one of these three had an article around 1987-88 about the Mandelbrot Set, illustrated with black-and-white pictures of some interesting zoomed-in areas. I was immediately mesmerized by the beauty of it all. Despite not having any prior knowledge of complex numbers, I managed to write a small program in Commodore 64 BASIC (yep) to compute an image of the Mandelbrot Set in C64’s 160x200 resolution with 4 colors.</p>
<p>As you can imagine, it was <em>slow</em><sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup>. Like, go for lunch and come back to see it rendered few more columns of pixels slow. It wasn’t until several hours into runtime that I could tell if it even computes the right thing! Luckily, it did.</p>
<h1>Writing my first proper fractal generator</h1>
<p>Maybe a year later, I managed to convince my parents to sell the Commodore and instead buy an Atari ST. Going from a 1MHz 8-bit CPU to a 8MHz 16-bit CPU was a huge leap. Naturally, I wrote a fractal generator for it. By then, Fractint was around on PCs, and I learned a lot from it, e.g. some tricks to speed up computation. Most importantly, I learned that you can generate fractals from pretty much any formula. The generator I wrote ended up supporting a whopping 39 formulas! It supported not just the Mandelbrot/Julia set pairs, but it could even plot attractors.</p>
<h1>Finding a new fractal</h1>
<p>Many of these were well-known formulas, but of course, I wanted to know if I can find some hitherto undiscovered formulas, so I started experimenting with them. I didn’t have any methodology to my exploration; I was just assembling formulas by randomly constructing algebraic expressions and then watching what fractal image they produce. Most of the time, the generated fractal would be quite boring, often just a black circle surrounded by a sea of blue. It was summer, I was 16, so I had other things to do too (swimming, playing table tennis, reading books, being hopelessly clumsy around girls), but from time to time especially when it was too hot outside I’d stay in my room, sit in front of the Atari, and think of more ways to contort algebra.</p>
<p>Eventually, one formula caused this to appear on the screen:</p>
<p style="text-align: center;">
  <img src="/assets/images/butterfly-atari-1.png" alt="My first Butterfly fractal, as originally rendered on an Atari ST in a 320x200 resolution and 16 colors.">
</p>
<p>Wow! I could not believe my eyes, but it was real.</p>
<p><em>(As a sidenote, this is an actual rendering from my original fractal generator software I wrote for Atari ST back then. I recently managed to <a href="/blog/floppy-rescue">finally transfer it</a> from its original floppy disks where it spent a good 30 years without getting corrupted, so I can now run it in an emulator!)</em><sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup></p>
<p>In the video below, you can also see how it looked like while the software was running to render the fractal. It’s actually four times faster than it were on my original machine back in the day, as I could tell the emulator (the excellent Hatari) to run the emulated machine at 32MHz clock speed instead of its original 8MHz.</p>
<p style="text-align: center;">
  <video controls style="max-width: 640px; width: 100%;">
    <source src="/assets/videos/butterfly-atari.mp4" type="video/mp4">
    Your browser doesn't support video playback.
  </video>
</p>
<h1>What’s the formula?</h1>
<p>If you want a good introduction to Mandelbrot/Julia style fractals, I can recommend both an excellent <a href="https://www.youtube.com/watch?v=LqbZpur38nw">3Blue1Brown video</a> and a similarly excellent <a href="https://www.youtube.com/watch?v=FFftmWSzgmk">Numberphile video</a>. I’ll try to give you a quick summary here too, but if you’re intimidated by the math, just skip this section and keep looking at the pictures!</p>
<p>All Mandelbrot-Set style fractals are generated by iterating some function over the set of complex numbers. For every possible constant value $c \in \mathbb{C}$ we compute the sequence of $z_0 = 0; z_n = f(z_{n-1}) + c$ and if the sequence doesn’t escape towards infinity, then $c$ is part of the set (customarily colored black or white), and if it escapes towards infinity, then $c$ isn’t part of the set (and we color it according to some notion of how fast does it escape.)</p>
<p>For Mandelbrot Set proper, the iterated function is simply the square of a number, $f : \mathbb{C} \to \mathbb{C}, f(z) = z^2$. Or, written in the $z=(a+b\mathrm{i})$ notation that decomposes the complex number into a sum of its real and imaginary parts: $f(a+b\mathrm{i}) = a^2 - b^2 + 2ab\mathrm{i}$.</p>
<p>The iterated function for Szegedi Butterfly 1 fractal is also easiest to express in this decomposed notation. This is the function:</p>
<p>
$$
f : \mathbb{C} \to \mathbb{C}, \quad
f(a + b \mathrm{i}) = b^2 - \sqrt{|a|} + \left(a^2 - \sqrt{|b|}\right)\mathrm{i}
$$
</p>
<h1>Finding more fractals</h1>
<p>Now that I had this function, a trivial next function to try was to take the previous one and just swap the real and imaginary components in the function to obtain Szegedi Butterfly 2:</p>
<p>
$$
f : \mathbb{C} \to \mathbb{C}, \quad
f(a + b \mathrm{i}) = a^2 - \sqrt{|b|} + \left(b^2 - \sqrt{|a|}\right)\mathrm{i}
$$
</p>
<p>This resulted in this image:</p>
<p style="text-align: center;">
  <img src="/assets/images/butterfly-atari-2.png" alt="My second Butterfly fractal, as originally rendered on an Atari ST in a 320x200 resolution and 16 colors.">
</p>
<h1>Szegedi Butterfly fractals in modern software</h1>
<p>If you want to explore these fractals today, I can recommend <a href="https://www.ultrafractal.com">Ultra Fractal</a>. It is commercial software but at $29 for its Express Edition it’s quite a steal (I’m not affiliated.) A nice thing about Ultra Fractal is that it has a large <a href="https://www.ultrafractal.com/cgi/formuladb?browse">formula database</a>, and many years ago I had my Butterfly Fractals <a href="https://www.ultrafractal.com/cgi/formuladb?view;file=sza.ufm;type=.txt">added to it</a>, so you can generate them as soon as you downloaded the formula database.</p>
<p>Here’s how they are rendered in Ultra Fractal, with more colors and a higher resolution (note how the horizontal axis is mirrored compared to my generator.)</p>
<p style="text-align: center;">
  <img src="/assets/images/butterfly-uf-1.png" alt="First Butterfly Fractal, as rendered using Ultra Fractal software on modern hardware.">
</p>
<p style="text-align: center;">
  <img src="/assets/images/butterfly-uf-2.png" alt="Second Butterfly Fractal, as rendered using Ultra Fractal software on modern hardware.">
</p>
<p>In addition to the two fractals generated with the Mandelbrot-style iteration, there’s also an infinite set of their Julia/Fatou Set equivalents. Here’s a random representative of a Julia dual of Szegedi Butterfly 1:</p>
<p style="text-align: center;">
  <img src="/assets/images/butterfly-julia-uf-1.png" alt="One of Julia duals of the first Butterfly Fractal, as rendered using Ultra Fractal software on modern hardware.">
</p>
<p>And here’s one random representative Julia dual of Szegedi Butterfly 2:</p>
<p style="text-align: center;">
  <img src="/assets/images/butterfly-julia-uf-2.png" alt="One of Julia duals of the second Butterfly Fractal, as rendered using Ultra Fractal software on modern hardware.">
</p>
<h1>Bioforms</h1>
<p>In addition to the butterflies, I also discovered another function that produces – especially in its Julia sets – something that looks very much like living cells, or maybe a cross-cut of a living tissue. I call this one Bioform:</p>
<p>
$$
f : \mathbb{C} \to \mathbb{C}, \quad
f(a + b\mathrm{i}) = (2 - a^2 - b^2) * (b + a\mathrm{i})
$$
</p>
<p>Its Mandelbrot Set equivalent looks like this:</p>
<p style="text-align: center;">
  <img src="/assets/images/bioform.png" alt="Bioform Fractal, as rendered using Ultra Fractal software on modern hardware.">
</p>
<p>It’s however the Julia sets that really show why I named this one Bioform. Just look at this animation going through a bit of the parameter space:</p>
<p style="text-align: center;">
  <video controls style="max-width: 640px; width: 100%;">
    <source src="/assets/videos/bioform.mov">
    Your browser doesn't support video playback.
  </video>
</p>
<p>So… that’s it, that’s the fractals. Again, if you want to play with them, I recommend Ultra Fractal – happy exploring, and if you find some interesting regions in them, do let me know!</p>
<hr>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>Commodore 64 even had this weirdness where VIC (the video controller chip) and the CPU shared the memory bus, so if VIC was on, the CPU could use only half the cycles on the memory bus. By turning the VIC off, you could gain some speed, but it also meant that you had to blindly type the correct BASIC <code>POKE</code> command to flip a bit in the register controlling it in order to get video output back. Exciting times! <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn2" class="footnote-item"><p>I put the source code up as a historic archive <a href="https://github.com/szegedi/butterfly">on GitHub</a> and if you want to run it yourself, <a href="/assets/images/butterfly.st">here</a>’s an Atari ST disk image too. <a href="#fnref2" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>

    ]]></content>
  </entry>
  
  <entry>
    <title>The personal website is back!</title>
    <link href="http://szegedi.live/blog/first-post/"/>
    <updated>2026-01-16T00:00:00.000Z</updated>
    <id>http://szegedi.live/blog/first-post/</id>
    <content type="html"><![CDATA[
      <h1>The demise of my old personal website</h1>
<p>I used to have a personal website with <code>.org</code> domain but then due to some e-mail misconfiguration managed to miss its renewal reminders some years ago. When it expired, it was immediately snatched up by someone with address in Russian-occupied part of Ukraine and turned into a generic parked website with content revolving between fishy ads and porn. I guess squatted domains are being bought and sold, and these days according to Whois it belongs to an entity in Seyschelles. The new owner currently (fishily) advertises casinos on it.</p>
<h1>The new personal website</h1>
<p>So, this is the new personal website! Of all free similar domains, <code>.live</code> was the one that looks most legit. (I learned that you don’t really want to host an <code>.xyz</code> domain unless you are deliberately going for a shady look.) I’m also hosting it on Cloudflare Pages, and using a static site generator for it. We’ve come far from the original days of using a Secure Copy Protocol client and manually crafting HTML! Cloudflare is also my domain registrar now with an autorenew option, so fingers crossed I don’t lose at least this one!</p>
<h2>What’s going to be here?</h2>
<p>Mostly a blog. Maybe something more over time.</p>

    ]]></content>
  </entry>
  
</feed>
