heckmeck!

Nerd content and
cringe since 1999

Alexander Grupe
Losso/ATW

Some cool stuff I’ve read in the past months.

  • Inside the Machine
    Back in October Gigabates posted an exhaustive write-up of the excellent Amiga demo by Desire. Coder porn and thrilling.
  • D.O.C. – Demons are Forever
    MnemoTroN/Spreadpoint disassembled, commented and fixed the legendary D.O.C. intro. That one has a special place in my heart; my first Teletext demo starts out with a nod to this classic. “Ignition! Kick down! Let’s do it!”
  • How to start writing an actual demo in <400 lines
    I don’t know anything of contemporary Windows demo coding (or any native Windows coding really), so this mini-howto by Gargaj was an insightful read. Also, what a great way to present code blocks in small steps!
  • The Most Mario Colors
    The good kind of nerdy deep-dive that makes my own rabbithole explorations of Greek charsets or system fonts feel less obsessive…
  • The first perfect computer
    An ode to the Amiga 1000 and a restauration odyssey at the same time. Amazing what kinds of modern add-ons you can get for that machine!
  • The Coolest Amiga Setup
    A new datagubbe.se article, admiring the setup of the Amiga 1200 that serves as the main compo machine at the GERP demoparty. Really makes me want to do more stuff on the real hardware, not just testing!

Lovebyte 2025 is over, and it was a blast! There’s been a plethora of insane sizecoding miracles again, from 1024 down to 16 bytes. I’m especially eager to study gigabates’ pretty-looking 256-byte Amiga entry. Also I need to rewatch all the entries of MountainBytes 2025 which also took place last weekend.

I took part in the size-restricted text graphics competition (no more than 256 characters) with a Teletext image alluding to this year’s party theme, “blind date” (editor link).

Blind date gone wrong

Just before Lovebyte started, I had an idea for a Valentine’s card in 512 bytes. Here’s a screenshot, and there’s also a video on the write-up page – it’s got sound! :)

To you, from a secret admirer

In terms of debugging, I’m a printer, not a stepper. Yes, single-stepping and breakpoints are nice, but I like this:

        PUTMSG  10,<"searching for ""%s""">,a0
        ...
        move.l  next_part(a6),a0
        PUTMSG  10,<"will jsr to %p">,a0
        jsr     (a0)
        PUTMSG  10,<"returned with $%lx = %ld">,d0,d0

The inner debugging monologue becomes so much more relaxing and constructive when strategic log statements are providing the answers.

WTF, where does this pointer come from?
Well, you overwrote the lower word, apparently.
How in hell are those sine values all off?!
I’d say $0000 looks like a weird amplitude.
I swear to god, my memory allocator cannot possibly fail here!
It can and it does, especially when you try to reserve a negative value.

You get the idea. :) The following trick is old news, by the way, but not exactly well-documented, either.

The hard way

In the past, I’ve been using a logging setup like this:

  • Configure WinUAE to expose the serial port via TCP on port 1234
  • Do the log message formatting in assembly, with the help of exec.library’s RawDoFmt (which still works when you’ve taken over the system)
  • Send out the formatted log output through the serial port, manually banging SERDAT and SERPER
  • Display the live log with netcat or a custom tool that connects to WinUAE’s serial TCP port

A rather convoluted process – but there’s an easier way!

(It does have the advantage that you could also debug on real hardware this way – just connect the Amiga’s serial port to a terminal! I have used that exactly once and it was cool and all, but also cumbersome.)

Easy and light-weight with WinUAE

Ever since release 4.4.0, WinUAE has included a more elegant “API” to do printf calls from your Amiga code. (I’ve learned about this when I started using the PLatOS demo framework for new art – it comes with a million amenities and also has a logging macro built in.)

  • Start WinUAE with -log -s debug_mem=true
  • Write your printf arguments to $bfff00 one after another
  • Put a pointer to your format string into $bfff04
  • Done! WinUAE will do the formatting for you and display your message in its console/debug window

Neat, huh? Here’s a self-contained snippet for a “PUTMSG” macro, modelled after its PLatOS counterpart (but only supporting seven arguments for compatibility):

  • debug-putmsg.i
    Self-contained PUTMSG macro for formatted log messages in WinUAE

In your code, do this:

DEBUG_DETAIL = 10 ; 0 disables logging

        include debug-putmsg.i

        PUTMSG 10,<"Stack at %p, d0.w is %x">,a7,d0
        PUTMSG 8,<"Low-level message"> ; not printed: 8 < 10
FormatOutput
%dDecimal word
%ldDecimal longword
%xHex word
%lxHex longword
%cByte as char
%sString (null-terminated, passed as pointer)
%pZero-padded hex longword, 8 hex digits with $ prefix
%08lxZero-padded hex longword, 8 hex digits

The macro passes all arguments as longwords. If you pass a word from a memory address, you need to subtract 2:

        PUTMSG  10,<"ticks = %d">,ticks-2(a6)

No, that’s not a typo. I did run into this virus warning the other day, surfing the web on my 1988 Amiga 500.

Now, computer viruses are annoying, and I hope nobody has suffered data loss or some other trouble because of this bugger, but I found it very heart-warming at the same time, with…

  • Virus infections still being a thing on the Amiga (this one being called Happy New Year 96, hehe),
  • Aminet and its wiki pages still serving content over HTTP (thankfully, as I don’t have any SSL library installed), and mostly
  • being able to browse the web (certain corners at least) on that machine – a little slow, but bearable. (I’m using AWeb Lite which can run on 68000 Amigas.)

Really makes me want to pursue the goal of having a retro-friendly version of this website, served over HTTP with a simplified markup and layout. You can still make a beautful website with tables only – I should know because I was there! :)

This could work with some dirty browser detection magic (allow HTTP and switch the layout if the user agent contains “Amiga” or something). There could be, I don’t know, maybe a dozen Amiga users in the world who could enjoy this if they ever stumble upon my little blog… Good thing neither rationality nor audience size are a concern for my projects!

On a whim, I tried to reanimate my 2016 iPhone SE. Oh, and also for serious web testing, of course! Last time I checked, the Lightning port was erratic and I needed to firmly press the connector at an angle. Not anymore! I pulled out some nasty dust bunnies from the port and it’s charging again.

Or is it?

Yes, it took a hit or two

Ugh, that screen still makes me extremely uncomfortable. (The image on the screen, not so much the shattered glass.) Back when this was my main and only phone, I never knew if it was actually charging a not. There’s a version of that screen with and without a lightning cable at the bottom, and I was never sure if I had shoved in the lightning plug at the right angle. Reddit to the rescue! More specifically (and aptly), /r/CrappyDesign:

Thanks, Reddit

After some minutes of charging it woke up again, and this website’s still looking good even on a 320×568 pixel display. In landscape mode, too!

Bonus: It has a less embarassing screen time report than my main phone… :)

Even better: Since the touch sensor still works (and still recognizes my thumb), I can finally pay for my groceries with my thumb again instead of my face! No more twisting my head weirdly towards the phone at the counter!

Update: Well, that didn’t work. The olde SE wouldn’t pick up the NFC (?) signal when it was paying time. Good thing it does not look sketchy at all to try paying with an aged, shattered phone and then pulling out a second, different phone! :) Later I found out that while Apple Pay should still work, my banking app to re-verify the credit card on the phone requires at least iOS 16 now. That’s a bummer, especially since the 1st-gen iPhone SE is still receiving iOS updates from Apple, nine years after its release (currently on 15.8.3)…

previous next close