Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
2

I Bought A Scanner (No, Really This Time)

from Lee A Johnson [alt+shift+b] in programming

This is a transcript from a talk I gave at the German Perl Workshop earlier this year. If you'd prefer to watch the video recording, you can find it here. I have lots of photographic projects on the go. Lots of these being on film, as some of these I started shooting a long time ago. I don’t have any particular loyalty or attraction to film, it’s just that I started shooting many of these projects before affordable medium format digital was available. Since I mostly shoot medium/large format film I never really jumped to digital until recently, so film has continued to feature heavily in my workflow. That said, it’s a pain in the arse to shoot film now given the spiraling costs, limited availability, and issues around traveling with it: modern airport CT scanners, being rolled out across many airports, are much more convenient but will fog film. Asking for a hand inspection often comes down to arbitrary timing - how busy the security is, how experienced the operator is, or if you’re lucky/unlucky. I’ve had film forced to be scanned (and fogged) and politely argued with security on more than one occasion. I don’t want to deal with that so don’t travel with film anymore, thus I am shooting less of it and have mostly moved to digital. I still have a tonne of film I need to scan and process however. Here’s just some of the binders and files of film. I don’t plan to scan all of this, but I do plan to scan the ones I need to. Probably in the region of a couple of thousand frames. I want to scan to the highest possible quality (within reason) for archiving, book projects, and large prints. If you’re wondering how large I print, it can be up to 160x60cm panoramics for selling. This is restricted by the size of my printer (that’s another story). Three Years Ago Three years ago I almost bought a scanner. I ended up blogging about it and the post got a bit of traction on Hacker News (HN). I’m never quite sure which posts I submit will pique the interest of the users. I’ll...
3 weeks ago

Stay updated

Get a weekly newsletter with the top 5 articles worth reading every week.

More from Lee A Johnson

The Caretakers

If you haven’t been paying attention, which is likely given the small corner of the web I’m going to cover, you may have missed that BINGOS just hit 247 consecutive monthly uploads to CPAN1. This is noteworthy as it surpasses DROLSKY’s record set a while back. That’s an upload to CPAN, once a month, for over twenty years. Once a month minimum I should say, as many of the authors on the board are uploading more frequently than that, some even daily. My own monthly upload streak is a mere 149, or twelve and a half years, and really that’s only because I pay attention to the board. Once a month I will check it to remind myself to dig through my CPAN distributions for bugs, issues, and refactoring opportunities. This keeps their internals fresh in my mind for when reports from users or contributors come in. The other authors on the board maintain an order of magnitude more distributions than I do, so are more likely to get a steady stream of reports from users. A stream that is turning into a torrent given the current place we find ourselves in the world of open source software. And that’s where I start to worry a little. Here in the Perl world we’ve been quietly getting on with it since the first shouts of “nobody uses Perl anymore” going back almost as long as BINGOS’ streak. Quietly maintaining critical systems, billion dollar businesses, backwards compatibility, security patches, the occasional new feature, and yearly releases of the interpreter. But that torrent of reports and issues is going to become a flood, and it’s not just the Perl ecosystem that is at risk. CPAN being Perl’s software repository. The upload stats can be found at cpan.io ↩

8th Aug 2026 • 1 votes
A World of First Drafts

Five short essays on where we are currently at. A World of First Drafts Dreams and the Uncanny Valley Fiddlers in the Room The Last Hike Semantic Satiation of an Acronym A World of First Drafts I recently picked up a copy of “An Evening With Windham Hill”, a collection of early 1980s live performances by some of Windham Hill’s popular-at-the-time acoustic guitar players. I primarily bought the LP for the recording of “Turning: Turning Back” by Alex deGrassi, as it was the only way to get this on vinyl; the 1992 retrospective that also contains the track was never (officially) released on anything but CD. The album contains a more interesting track on it, that being the first (?) performance of a Michael Hedges composition. Introducing the performance Hedges says “This is a new piece for [that] started out for guitar and then, er, all of a sudden it needed piano and about a week ago it needed bass so… We need to play it tonight. It’s dedicated to Steve Reich, and it’s called Spare Change.” The performance starts out very Hedges like, with his (now) distinct playing style and tapping on his instrument, but then after about forty seconds the piano comes in and Hedges influence seems to be diluted. He pulls it back but seems to be fighting with the piano, and when the bass solo arrives at three minutes Hedges is then completely lost to Manring. The three instruments then battle for the remaining two minutes of the composition leaving us at an ending that feels unresolved. So unresolved it takes the audience several seconds to realise the performance is over. The composition and its performance was very much a first draft. Some interesting ideas in places, but ultimately lacking cohesion, unsatisfying, and even forgettable. Hedges’ voice (that of his guitar) is lost amongst the parts that aren’t his. When Hedges released the final version two years later, on the album “Aerial Boundaries”, he knew the piece needed work so he made some major changes. The first was to drop the key two semitones lower. I guess he removed the capo from his guitar. The second change was more substantial: Hedges decided to replace the piano and bass parts with his own guitar, spending over one hundred hours recording sounds, looping them, playing them backwards, splicing tapes, pulling them apart and sticking them together, experimenting, all to get the textures that fit. Over one hundred hours in the studio in 1983, and likely many hours after those first drafts in 1982, to create a five minute long piece of music. Hedges could have just released the original arrangement, but he knew it was mediocre so continued to refine it. The version realised on “Aerial Boundaries”, and the liner notes explicitly use the verb realised rather than recorded, is probably the most striking work in Hedges’ entire discography. Because there are other remarkable recordings on the album, especially the title track, and due to the near impossibility of performing the track live, “Spare Change” is often ignored. That doesn’t mean Hedges’ time and effort to refine it was a waste, as the track still stands out today. Along with the first live recording, the final version is a permanent record of an idea elevated to something interesting, influential, even epochal. Fingerstyle guitar was going through some major changes in the early eighties, and Hedges was one of several important composers and performers at the time. Had he just sat back, been satisfied with the first draft, not torn it apart to rebuild, it would have been forgotten. I wouldn’t be writing about it today, and it’s possible it may have been discarded and failed to make the final cut for the album. Perhaps the composition would have been dredged up some time in the future, when an artist’s career reaches that inevitable scraping of the barrel stage. Alas, Hedges was killed in an automobile accident in 1997, at the age of 43. The obvious place I’m going with all this is that I increasingly feel like we are moving into a world of first drafts. One where ideas are formed but then delegated to something else to refine them. The problem with this approach is there is nothing new to pull from the tombola, you still have a first draft at the end of that process and haven’t gone anywhere compelling. I’ve even had someone defend their approach with “the ideas are all mine”. But ideas are easy, execution and refinement are hard and that’s where your individuality comes through. Maybe your ideas are boring, and your arguments are weak? I’d still like to read them in your style. Writers have built entire careers on this. The reason I read your blog, or listen to your music, or watch your videos, or look at your photos is because I’m interested in how you see and react to and interpret the world. If your voice and idiom is lost to the machine’s then you are no longer interesting and I’m no longer interested. Dreams and the Uncanny Valley A few years after moving to the mountains I had an idea for a photo project that would involve shooting images of well known vistas and then subtly replacing some of the mountain ranges with different peaks. Or removing parts entirely. Or just messing with the horizon in some way. I played with this a little when I printed some postcards of the Matterhorn, flipping the mountain on its horizontal axis to result in a mirror image. I assumed people would notice, given that concrete chocolate mountain is in the top five of recognisable peaks. Nobody did, at least not for five years. Or nobody said anything as they weren’t quite sure if what they were looking at was wrong, a literal uncanny valley moment. Sometime later I had a dream, or a nightmare since I tend not to remember my dreams, in which everything was subtly wrong. Like something out of a half forgotten Philip K. Dick story or tired science fiction trope. All my friends faces were a little different, but I was the only one that could see this. All the music I knew was off in some way, a different tempo or transposed, or key lyrics were swapped with synonyms. Nobody else noticed and sang along like it had always been this way. They were oblivious to the changes. The books and films all had slightly different titles and plots, and the actors cast were not the same. The walk I took to work was a diversion, my keys were interchanged, the office was rearranged, my keyboard layout was swapped. At lunch the microwave controls were on the left, the food tasted weird. None of my colleagues had any qualms. Finally I realised that if that was the case externally, at the macroscopic level, then was it also the case at an atomic level? I rushed home to find my Roche Biochemical Pathways poster, unfolded it (the wrong way), and stared at the molecules trying to recall the chirality of the amino acids, nucleic acids, and sugars. But I couldn’t remember, it was too long since I had done any biochemistry. And then I woke up. Fiddlers in the Room There’s a certain type of software engineer, I’ve met several times in my ongoing career, that I like to term a “fiddler”. When the fiddler is tasked with solving a problem, instead of thinking “I will solve this problem” they instead think “I will solve this particular class of problem”. The non-fiddler will pick an existing solution, and if there isn’t one that fits they will code for the explicit problem at hand. The fiddler will build an entire system to cater for a hypothetical future and other people’s unknowns. The result is something that is not actually generic enough to solve the particular class of problem, being too brittle, and is too broad to solve the original specific problem in a maintainable way. An excess baggage of logic and abstractions means cognitive overload. Having to think about the generic class of problem when trying to maintain for the specific problem is always, well, a problem. Don’t get me wrong. Fiddlers are important, and have contributed to many critical parts of many ecosystems, and some fiddlers are very good at what they do; however, they are the minority and, more often than not, a one hit wonder. A key tell of some fiddlers is that they like to use the latest tools to facilitate their fiddling, and this is the most dangerous fiddler of all. New tools are more likely to change quickly, and churn is the enemy in software engineering. Now it seems that everyone can be a fiddler, so my term has become a tautology or changed to mean something else. Fiddling has been flipped on its head. Now it seems fiddlers can trivially generate for the explicit problem at hand, pulled from a vast corpus of existing classes of problems, likely previously generated by the previous generation of fiddlers. Those not-quite-generic-enough-and-a-little-too-brittle solutions. And if the fiddling is not enough? Have an entire orchestra. Keep screaming “COMPUTER, DO SOMETHING!” If and when it all goes wrong? Yes: “Switching over to manual control… good luck!” and of course: “This is the world’s smallest violin, and it’s playing a sad song for you.” The Last Hike The last hike took place on the 25th May 2026. Temperature was 20ºC, humidity 53%. Distance 13.00km, altitude change +/- 566m. 735kcal was expended in energy, with an average heart rate of 107bpm (max 153, min 70). Duration was 3h21m. The computer decided the effort was “moderate”. The last hike was somewhat more successful than the last bike ride, which took place on the 19th May 2026. Temperature was 10ºC, humidity 66%. Distance 11.56km, altitude change +/- 258m. 356kcal was expended in energy, with an average heart rate of 138bpm (max 161, min 69). Duration was 41:31. Max speed was 51km/h when a catastrophic puncture of the back tire took place, sending the rider veering off course into a 1m wide grass verge between the asphalt and a barbed wire fence. The rider was thrown over the handlebars of the bike, onto their right shoulder. Some moderate skin grazing occurred, but a six hour visit to the hospital was required to confirm no bones were broken. The computer, knowing nothing of this, decided the effort was “moderate”. I decided to stop tracking all this stuff because I don’t know what advantages it begets other than the obvious: exercise is beneficial. The disadvantages are not worth it, trying to beat personal bests, going faster, worrying about regressions, contributing to the world’s largest and longest ongoing clinical trial? My father used to run a lot in his youth. He would take me in the pram when he ran, and he ran so much he wore through two sets of wheels. There’s little evidence of that now, maybe a few photos in our attic, and his arthritic knees. It’s possible that his running has nothing to do with his knees, I know. None of this was tracked, so who knows? Even if it was tracked we wouldn’t know anyway. All of this data works at a population level, individually you need to ask yourself if you really need to know the minutia. Exercise is beneficial until the bones hit the asphalt. Even then, the net benefit is worth it. Just move a few times a week for more than a few minutes and you’ll feel better. Semantic Satiation of an Acronym There has to be an end state to all this, eventually? Surely? A point at which it just becomes the norm, at which it is everyday, normal, mundane? A point at which we can just all get on with our lives and benefit from the good, and be protected from the bad. A point where the thing producing so much noise is reduced to a background hum that can be ignored. I can't seem to escape this in any place. Technical discussions normally reserved for office work hours spill out into social settings. The pub, the dinner table, with strangers on a plane, in a queue, at a gig. I hear horror stories of wannabee software engineers making all the mistakes newbies make, but with none of the guardrails or mentoring to steer them in the safe direction. I end up talking shop with people I would never want to be my colleagues. I'm not trying to gatekeep here, I have no kingdom to protect, rather I am worried that the bar being so low will cause many people to trip over it. I do find this stuff useful, in the very specific areas it is currently limited to. It will become more useful in other areas over time and hopefully less dangerous, but that's an unknown for now. I didn't think semantic satiation was possible with an acronym. Can I please just go one day without hearing about this. Just one.

14th Jun 2026 • 1 votes
Print Sales, Costs, And Profit: 2025

Apparently the bottom is falling out of the art market, at least for those in the high-end segment1. That market of investors, speculators, and dealers who are working with mind-boggling prices. This isn’t surprising. The buyers in this market aren’t interested in art, they’re interested in the financial returns, and the last few years have seen more compelling investments in other areas. Cryptocurrencies, NFTs, and now AI. Why faff about with tangibles, which need shipping, storage2, maintenance, and insurance? Why bother with art that needs decades to see a return, when the alternatives can be turned around in months with a few clicks? At least when the bottom falls out of the art market you will still have something to hang on your wall, eh? Anyway, it’s three years since I bought a printer. I thought I would provide an update on running costs, print sales, and profit. I’m happy to be completely transparent about all this as I know it can be difficult to figure this out if you are thinking of creating your own printing business. Culan et Croix des Chaux, December 2024 Again, the reason why I do this from November to November is that the ski season runs December to April, and usually the most sales are during that period. Also I bought the printer in November 2022 so I’m just carrying on that way. You can find details from the previous year here. All the photos here are work shot in the last twelve months, I’ll cover this in a bit more detail below in the “Thoughts” section. Year Three Investment I needed to purchase more paper and ink this year, as expected. I also decided to buy a stand for the printer, as it was available at a significant discount. This gives me more freedom in my studio as I can now move the printer around easily. It also will allow me to add a second roll feeder in the future, should I decide I need that. Investment figures are included in the costs below. Income Income is made up of sales through a local gallery that I am part of, along with web sales: 11,409.- CHF - sales through the gallery 642.- CHF - sales through web shop = 12,051.- CHF total income Total income is up by about 20% compared to 2024 on both gallery sales and web shop sales. Costs I include the loan repayment here as that is an ongoing cost. I had to purchase consumables (paper and ink), at a total of 1,370.- CHF however that cost isn’t included in the total here as it will be amortised in future years under the “print consumables” category when they are used to make prints. First Tracks, January 2025 Rental cost of space in the gallery was reduced due to having overpayments of rent and my loan to the gallery, from the previous year, paid back to me. -4,058.- CHF - loan repayment -1,500.- CHF - rental cost of space in the gallery -672.- CHF - print consumables (paper, ink) -130.- CHF - investment (printer stand) -3,408.- CHF - framing/mounting/postage -2,323.- CHF - commission to the gallery -300.- CHF - web shop subscription -62.- CHF - stripe / paypal fees 0.- CHF - advertising (none this year) = -12,453.- CHF total costs Total costs are down by about 15% compared to 2024. Total Profit (Loss) 12,051.- CHF total income -12,453.- CHF total costs = -402.- CHF total loss Thoughts Holy crap, I only made a 402.- CHF loss this year. What happened? A combination of debt owed to me by the gallery and better sales meant I came close to breaking even. The original investment loan also accounted for 4,058.- CHF in costs, but this loan is now fully repaid and will not factor into future costs. I was lucky this year in that one of the local schools made a bulk order of small framed prints, which contributed to the boost in sales. If I were to net off the cost of the loan, but also this large order (since this is a rare occurrence), I would have a profit of about 2,000.- CHF. So still a good year, relatively speaking. However, that’s about 175.- CHF per month profit. You can’t live on this, and it’s an absolute grind if you want to start increasing that. Again, the reality remains that a physical space is absolutely essential for getting the work out there and sold - just look at the figures, approx twenty times the amount of income than from the web sales. Verbier the day after after record snowfall, April 2025 The Content Treadmill This year’s “trip to a ski resort in another country” was Chamonix, which I hadn’t been to in over a decade. I hired a guide for some off piste ventures, and we had a great time exploring the mountains. The snow was reasonable at the start of the week, but a bit naff at the end, but I did manage to shoot a couple of photos that have been added to the work for sale. We already have a trip planned for next year, and are considering the year after. This should result in more work. I should note that the work is a byproduct of my first interest - snowboarding. Really I’m not looking for locations or trips with a thought to shoot photos, they are purely an afterthought. If the places I go are suitable, and the conditions allow, then a photo might result. I have no interest in creating “content”, as that’s an absolute grind as well. I might shoot a couple of good photos a year, really. The work I shoot is very specific to a place, as I’ve talked about previously. If I wanted it to sell I would be looking to display it in galleries present in those locations. Sunset Over Le Col de la Croix, October 2025 And if I did want to boost the income from all of this I would have to jump on that content treadmill. Be thinking all the time about where to go next, what to shoot, and how to sell it. Be pushing out work all the time. That means producing mediocre work, that you’re not happy with, and that is a drag. Going out with the intent of creating content? Where’s the fun in that? The Storm Hits the Art Market ↩ Geneva Freeport ↩

1st Nov 2025 • 1 votes
A Survey of the Ticket (Re)Selling Landscape

TL;DR? It’s a quagmire, essentially. But let’s dive in. Possible strong language ahead, and copious footnotes with links to much more information below. scalper noun [ C ] US informal /ˈskæl.pər/ (UK: tout) someone who buys things, such as theatre tickets, at the usual prices and then sells them, when they are difficult to get, at much higher prices: “A scalper offered me a $20 ticket for the concert for $90.” We got tickets for Oasis, and it wasn’t easy. In fact, it was an absolute pain in the arse. There seems to have been a change in the ticket buying, selling, scalping, and reselling landscape of late, or the nature of this event has just brought it to my attention. Doing some research around this all suggests it’s always been bad, and yes it has always been bad. But this bad? I’m not so sure. I’d speculate it’s now so easy to put together something to automatically poll for (and purchase) tickets, that anyone who is after them can do it and anyone who wants to scalp can do it as well. The consequence of all this is that a ticket can be resold multiple times. Originally, which is then listed for sale ethically, then snapped up by a scalper, then reduced to sell nearer the event, then grabbed by another scalper, then sold once more to a genuine fan again. All the while the platforms are taking obscene amounts of fees every time that single ticket sells and sells again. Here’s some observations from the experience of trying to purchase Oasis tickets, and the platforms we ended up looking at to do this. Ticketmaster Part of me feels sorry for Ticketmaster (or Live Nation, it seems). I believe they have a shit tonne of technical debt that would make even the most seasoned senior nope out before getting beyond the first interview. This includes such madness as a custom operating system built on top of VAX that is holding up most of the backend. Given the age of these systems it’s all now layers of emulation. They’ve tried to rewrite it more than once but never get anything close enough to the existing implementation in terms of performance and reliability1. Part of me wonders if that might be an interesting challenge, but the other part wonders why they don’t just fix these with a sledgehammer. Radiohead recently announced shows and worked to reduce the inevitable stampede by way of a two stage lottery; you had to first register an interest, with a verified mobile number and email address and then, if you were lucky, you were sent a code that allowed you to join a queue on the day of the sale. A moderately high bar to those that automate scalping, with an aspect of a lottery to reduce scalping even more. That system brought the queue size down to manageable numbers and did cut the scalping markets. Not completely, but significantly given the number of tickets on the resale sites was, and remains, relatively low: Note - dozens, rather than hundreds, and being sold at relatively low prices. Also note the warning that “Resale of tickets is prohibited for this event. The ID of everyone entering the event will be checked to ensure it matches the name on their personal ticket.” … Resale of tickets is prohibited says the resale site. Eh? More on this below in the Stubhub section. The final part of me assumes Ticketmaster just doesn’t care. Their platform can handle the load, and they make gobs of money so why fix the non issues? Sure, the site can struggle sometimes, but that’s transient. The tickets will get sold eventually. Why worry? The experience with Oasis was about the same as most in demand events - join a queue and then hope there’s something left when you get to the end of it. The queues were absurd in size. Hundreds of thousands in line for a venue of a tenth of that capacity, with most in the queue likely buying multiple tickets. The double punch was that at the same time we were sat in the queue, some minutes then hours after the sale opened, we saw thousands of tickets being sold on resale sites. Scalped in seconds, then listed at hugely marked up prices before the official ticket sales had even sold out2. So we didn’t get tickets out of this system when it opened for sales over a year ago. We weren’t massively bothered, oh well we won’t see them. Then a work event coincided with the final gigs at Wembley in September 2025. Thus began the attempts to get some on the resale market. Stubhub A resale site with no limitations. Tickets sold out on the primary sales platform? Try a resale site where you can find them at ten times the price. Hmm, right… And I mean ten times the price. Oasis tickets for the general admission floor standing areas in Wembley were selling at, minimum, 600 GBP. Seated 1,000 GBP+. Absurd. What I find particularly irksome is that Stubhub will allow listings of tickets from the moment the official sales open. If this is supposed to be a fan resale site, why isn’t there at least some sort of delay? A week after the official sales open? A day? A few hours? Something? A genuine fan doesn’t buy four tickets and then immediately relist them at ten times the price. Stubhub is aiding the scalpers. I’ve had a script for a while that will watch Stubhub and alert me when tickets appear below a certain price3. This is to work around the lack of support for alerts in Stubhub’s platform. I set the price to a reasonable amount, about 250 GBP for floor standing tickets. Still high, but not absurd. The script merely alerts me, it doesn’t do anything to add tickets to a basket, purchase them, etc. Just a headsup that some tickets are listed. So I setup an alert for Oasis tickets, specifically for the general admission floor standing areas in Wembley. In other words the cheapest tickets. I actually did this not long after the first sales opened, in the hope that we might grab tickets and then we could plan a trip. It’s always been a useful script, but absolutely nothing came out of it this time. The script didn’t alert me once. Resale tickets for this event were all listed so high that it was never going to succeed. No luck on Stubhub. Twickets Twickets are one of the ethical resale sites, and they make a big point of this fact in their marketing spiel. The problem, which became clear with this event, is that scalpers have automated the purchasing of tickets through their site and that locks out the real fans. To summarise: real fans who can’t make the gig sell them at face value on Twickets. Scalpers automate purchasing these and then resell them on other sites at inflated prices. This completely fucks the site’s ethos. It’s infuriating trying to purchase through Twickets as the way it works is tickets are listed until their purchase is confirmed, and adding them to a basket holds a lock on them for ten minutes. The scalpers have automated this such that their bot will add to the basket, giving the scalper the option to get in front of the screen to complete the purchase. Sometimes the scalper can’t get to whatever device they need to in time. So what happens? The tickets are available to grab again and their own bot, or another bot, or one of many other bots, adds to their basket and holds the lock on the tickets again. Rinse and repeat. Tickets would be listed, but when you tried to purchase you were told “Looks like another fan grabbed this ticket just before you - when someone starts the checkout process, we temporarily hold the ticket so they have a fair chance to finish buying it. If they don’t complete their purchase, the ticket will be released back for others to buy.” The tickets would sit listed for over an hour, meaning they were being added to a basket, timing out, added, timing out, added, over and over again. The above tickets were an example of that, eventually selling almost two hours after they were listed. Who takes this many attempts to purchase? I can understand a couple of timeouts, maybe even twice that many, but an hour and a half? Eight timeouts before a successful purchase? Bots, nothing but bots or a very lucky actual fan that manages to slip in between the cracks and hits the purchase button at the right millisecond. 90 quid tickets, on their way to being resold for a much higher price. That’s likely 1,000 quid profit for the scalper. We saw this happen multiple times, I’d say we saw twenty tickets sold at face value going to scalpers on this ethical resale site, before we gave up. Twickets claim they have strong bot defence, but the evidence suggests otherwise and that they are failing in their mission statement4. There are technical solutions to this, and I’ll give them this suggestion for free: they don’t have alerts for in demand events, which is understandable as sending out hundreds of thousands of notifications, emails, etc, is costly and would lead to a stampede to their site causing more problems. Instead they should send out notifications in batches - don’t list the tickets, make them only available through an unlisted unique URL, which is provided via the notification, send out small batches of notifications to randomly picked users (say, one hundred at once) at ten minute intervals, and when the tickets are sold - stop. The key here is the URL in the notification should itself expire, meaning the bot race is eliminated. Don’t get to it in 10mins? Too late. If you chuck the ticket in the basket but don’t complete payment? Sorry, you lost your chance. I know the above suggestion is a bit “shit Hacker News says”, but come on Twickets - sort this out as you’re more Fuckwits than Twickets at the moment. TicketSwap Another ethical resale site that seems to be doing better than Twickets, but I’m not convinced. They do send notifications, and they might be using batching as I talk about above to reduce load5. So fair play. However we noticed that some sellers appear to be selling multiples of tickets via this platform, as distinct listings over different hours/days/weeks, and that in itself is fishy. Witness this seller (username removed) who we saw at least seven or eight times selling moderate value tickets via the app. At the end of the process, i.e. shortly before the gig, they had sold over twenty individual tickets. That seems off, and perhaps it was a scalper offloading. My suggestion here would be to not allow a seller to list tickets for the same event more than once, but that’s probably trivial to work around if you’re a scalper. Reddit Reddit is full of scammers, to the point that it’s just hilarious to read their attempts to make excuses around what they’re doing. The pattern is usually an account registered very recently, perhaps a day or two, or a week or two; alternatively they have an account of much longer standing with higher karma, but they have deleted/hidden the entire submission and comment history. Those are probably compromised accounts, and at least one I saw was playing the longer game: It started as an account registered a year ago, with the first submissions cleary karma farming in some of the larger subreddits. Get the account to some degree of trustworthiness. They pivoted to trying to resell tickets to in demand gigs about a month ago. These scammers were typically bait and switch when it came to proving they had the tickets, or the payment method. One even claimed they had a friend at Ticketmaster and therefore couldn’t sell on the resale sites as it would get their friend into trouble. Bollocks. I’m not saying there are no legitimate sellers on Reddit, but with in demand gigs your odds of being scammer are almost 100% so don’t risk it. I saved a couple of the threads as PDF printouts for posterity, so entertain yourself here and here if you want to. The second thread is particularly silly as I get into an argument with a poster who is advertising their own alerting service for Twickets, which they charge for, knowing full well that there is no way it can beat the other bots. They even had a page on their own site effectively admitting this fact (Mainbotpy section). Selling a service you know to be ineffective? Another scam. Viagogo Where we ended up purchasing tickets. The same observations apply as for Stubhub, which is not surprising as they are the same company with different frontends, but Viagogo are particularly egregious as they don’t list tickets with their fees so you are in for a shock when you hit the final payment page. Fees came in at almost 50% of the listing amount: This was more than I wanted to pay at the point of purchase, but likely the least I was going to pay. The fees are a piss take. I don’t think there’s much more to say about this one. However the interesting observation is making an incorrect assumption that prices would come down as the event got closer, with scalpers getting more desperate to offload their unsold tickets. That didn’t happen, and considering the profits involved probably never happens. I watched the listing values slowly decrease over the period of about a week, along with the number of available tickets, and purchased two on the Wednesday before the Saturday event. I’d figured the amount of time we’d spent on this was way beyond sunk costs territory. Even if the tickets continued to decrease in price we had already lost more than their value in time. The Wednesday turned out to be the lowest point they hit, and they started going up again reaching bonkers prices on the Friday and then even higher on the Saturday morning: You probably can’t see it there. Just know that there were 42 tickets left on the day, with the cheapest being £1,741. The thing is, these were selling, or at least appeared that way since the number of listings reduced to dozens a couple of hours later, and then was down to single figures a couple of hours before the event. I don’t think the bottom one here sold though: Just Write a Better Bot? We’re beyond that. It only takes a single scalper to ruin it for everyone, and if everyone decides to run bots to buy tickets… well, I don’t think I need to expand on why this is a terrible idea. So What Now? The Resale market needs killing. Dead. As in: no resale of tickets for events is ever possible and you just have to eat that fact. Fuck all the businesses that have built a model on gouging fans, you’re all gobshites. The lot of you. Line goes up? Fuck your line. If you buy a ticket it should be cryptographically stored in your account in a way that cannot be shared (time linked rotating qr/barcodes like most ticket apps use these days). And it cannot be sold. Period. You can’t make the gig, you change plans, you’re ill? Too bad. That would stop the scalping market instantly. And if we aren’t going to kill the resale market, how about using some recent buzzword tech to improve the situation? NF-ucking-Ts that would have some tangible use and allow artists to benefit from the resales, track how many times tickets are being resold, as well as giving information that allows identification of the scalpers so they can be named and shamed? Do it. Please? Some information here, here, and here that notes “It runs a proprietary operating system on a proprietary emulator. Tickets are actually the equivalent of blocks on a file system. It’s incredibly complex in the way that it’s able to represent the physical layout of venues, view obstructions, language stuff, and most famously the packing algorithm.” A much more comprehensive article can be found here, which does cover some of “The Host”. ↩ I posted about this on Reddit at the time (archive of the thread here) and one comment suggested that the resale sites themselves are scalping for high demand events. Unproven, but it’s a possibility. ↩ I gave a lightning talk about this last year. The script is pretty basic, and the most interesting thing is probably StubHub building large parts of their site through JSON so it really makes this a trivial thing to do. ↩ Twickets do have bot defence in place, but it’s the most naive and/or simple implementation. Their thresholds for some checks are also way too high - it’s possible to sit and refresh the page every second and not see a 429 (“too many requests”) response. Many of their endpoints are also not rate limited, allowing for easy automation of polling, and their “private” API endpoints are not as private as they should be, nor are they properly secured. ↩ I suspect the batching is effectively done through whichever provider they are using to send the notifications to mobile devices. Some of the events (as seen in the screenshot) show 30,000+ people waiting for tickets. That’s not a massive number, but enough to cause quite a stampede should notifications appear on all those devices at once. I do assume it’s also trivial to automate grabbing the tickets after receiving the notification, but the “not all at once” delivery is going to render that process ineffective. TicketSwap may suffer from the same issues as Twickets, but that’s unproven without further investigation (I only ever use TicketSwap via a mobile app). ↩

17th Oct 2025 • 1 votes

More in programming

How We Made the Move to Rural Japan

It’s nighttime, so why did a bright light suddenly flash through my window? It’s not raining, and there’s no sound of thunder. No cars have driven down the street, either. Hmm, did I just imagine it? Oh, there it is again. It took a few more instances before I clued into the source: the bright lights of a pachinko billboard, located behind my apartment building. Although it faced in the opposite direction, the beams somehow managed to reflect their way off several other buildings and directly into our window. In hindsight, I think this small incident was actually the breaking point for our life in downtown Osaka. That also means it was the first step toward my wife and I finding our new home in rural Miyazaki. We spent several months researching and testing different places to live before eventually moving to rural Miyazaki. Here’s how we chose where to live in rural Japan, used municipal trial stay programs, found relocation subsidies, and adjusted to everyday life in the Japanese countryside. Why we left Osaka for rural Japan How we chose where to live in rural Japan What living in rural Japan is really like The downsides of living in rural Japan In conclusion Why we left Osaka for rural Japan Life in Osaka had become increasingly disappointing to my girlfriend (now wife), who at the time was a pediatric nurse and often worked nights. Meanwhile, I was a freelance developer who worked remotely. While Osaka was fun, with many coffee shops and restaurants to try and neighbourhoods to explore, the allure wore off quickly. In addition to the bright LED lights disturbing our evenings, some of our frustrations included: Needing to take transit for at least an hour to get anywhere where we felt immersed in nature Having my locked bike stolen after owning it for just three weeks Encountering the occasional old man relieving himself on the side of our apartment building Squeezing into a fully-packed train like a can of sardines during rush hour Being surrounded by more people than at any other point in our lives, but also feeling like we didn’t know any of our neighbours Not all these frustrations are common occurrences everywhere in Osaka, but they were the ones that really motivated us to get out of the city. We decided we wanted to settle somewhere new once we got married. Choosing between Canada and Japan We already had plans to spend four months in Canada, to see my family and hold our wedding. As we began to reflect on where we wanted to put down roots, we decided to book a one-way flight there. However, we knew life in Canada would present a few challenges. My wife’s Japanese nursing degree wouldn’t transfer over smoothly, and she wasn’t a confident driver. Therefore, rural Canada didn’t seem like a realistic option, as my wife would need to pick up part-time work somewhere and also be able to drive. Trying to keep an open mind, we opened up our laptop and started to look at a few urban areas that interested us: Vancouver, where my wife had studied during her gap year, and Ottawa, where I had lived during my undergrad. After staying in downtown Osaka for the past year and spending around 65,000 yen per month on rent, those Canadian apartment listings were quite sobering. It seemed we wouldn’t be able to live anywhere comfortably without forking out at least triple what we had been spending in Japan. And so, to my wife’s chagrin, we turned our eyes back towards Japan. How we chose where to live in rural Japan Starting with a clean slate, my wife and I listed the various prefectures we were interested in: Kochi: Where my wife’s brother had recently moved to work on a citrus farm. It’s one of Japan’s most rural areas, with lots of mountains, rivers, and ocean front. Miyazaki: After enduring 25 years of cold winters in Canada, Miyazaki’s warm weather and countless surf breaks sounded very appealing to me. Nagano: My wife was drawn to this mountainous area, as it has cooler summers with scenery that changes vibrantly each season. With this list in mind, we began researching. How to try living in rural Japan with trial stay programs otameshi taizai) or トライアルステイ (toraiaru sutei). They’re also sometimes called “A little bit of living” (ちょっとぐらし, chotto gurashi). These programs give people weighing a move to the municipality a chance to live in the area for a while first, ranging from a few days to a few months. The town supplies furnished housing, either at no cost or for a fraction of typical rent. How to apply for a trial stay program Applying for a trial stay is typically straightforward and consists of filling out an online form on the town’s relocation resource site. You will need to detail: Where you are from Your current occupation How many people are in your household When you are planning on visiting After that, you will likely hear back from the town’s relocation coordinator, who will help you book your stay in the town. What you can do during your Japanese trial stay program Towns typically bundle the stay with introductions to available properties in the area and resources for finding work. They often will require you to do a bit of “homework” in the form of daily journalling about your experience staying in the town and how you made the best use of your stay. Here’s a breakdown of what our stays were like. Shimantocho, Kochi 30-minute orientation at town hall One to three month stay in a 2DK attached house 10,000 yen per month No homework required, just a quick 15 minute check-in chat with local coordinator Hyuga, Miyazaki 30-minute orientation at town hall Up to two weeks stay in a 3DK detached house 1000 yen per day Daily diary requirement Nichinan, Miyazaki 30-minute orientation at town hall One week at a subsidized hostel for 1000 yen per day, or up to 10 days in a spacious ocean-view house Daily diary requirement when staying at the house Kawaminami, Miyazaki 30-minute orientation at town hall One week stay in a spacious and modern 2LDK 1000 yen per day No homework required Who can apply for a trial stay program If you are interested in using the trial stay program, please be aware there may be a requirement that one member of the household be a Japanese national. When making our applications, my wife was always the one who filled out the forms. We weren’t rejected from any applications, but we did have non-Japanese friends (two parents and a child) who were rejected from a location we’d previously stayed at. Why we chose rural Miyazaki as our new home Our final trial stay was in Kawaminami, a small town with a population of under 15,000 that sits between Hyuga and Miyazaki. Truth be told, we weren’t interested in Kawaminami initially, and really only checked it out because we needed somewhere to stay between our trips to Hyuga and Nichinan. However, it turned out to be the most pleasant of all our trial stays. After our initial orientation at the town hall, the relocation coordinator invited us on a short tour and introduced us to a local green pepper farm. This farmer and his wife had also moved to the town from Osaka, and they gave us a warm welcome along with free fresh produce. After this tour, the coordinator invited us to a home party, where we shared hot pot and beers with four others who had also recently moved from Osaka. We soon learned there was a pattern of young families moving to this town from the Kansai area, often in search of a more relaxed environment closer to nature and surfing—exactly what we had been looking for ourselves. During our stay, we checked out job and apartment listings in the area and mingled with locals while running errands; we found people there more chatty than what we’d experienced in other areas. In the course of our one-week stay, we realized that this was the right town for us due to: The presence of a friendly and growing community of 20–50 year olds who also relocated from larger cities like Tokyo and Osaka in order to slow down their pace of life. Meeting so many like-minded new friends eased any fears we had about not fitting in Supermarkets that offer Miyazaki-sourced produce, meat, and fish, which we’ve found to be tastier than what we had access to in Osaka The town’s close proximity to nature–from the center of the town it’s five minutes to the beach, 10 minutes to crystal clear river swimming spots, and 15 minutes to mountains/hiking trails Nearby surf breaks, five of them within 30 minutes by car Access to Miyazaki only 45 minutes away, for that “big city feeling” whenever we wanted it “Getting adopted” by Japanese grandparents What really sealed the deal was being adopted by an elderly couple partway through our stay. During our trial stay, a close friend came to visit us in the area. The plan was for the two of us to travel by car and later meet up with my wife at a live music show a couple towns northward, in Hyuga. As we only had one car, my wife opted to walk to the local train station, not realizing it was a 45-minute walk from our accommodations. However, my wife was in luck when an older gentleman, who I’ll refer to as Mr. K, spotted my wife walking down the side of the road. He pulled his car over, took out his business card, and yelled, “I’m Town Counselor K! Are you walking to the station? Would you like a ride?!” While we would absolutely not recommend getting in a stranger’s car, my wife said she was convinced by his kind eyes, and took him up on his offer. (We later found out he pulled out his card in an attempt to seem less suspicious!) As my wife explained that she and I were from Osaka and doing a trial stay in the town, Mr. K’s eyes lit up. He loved the notion of a younger couple moving to his beloved town. Knowing that our accommodations in town were limited, he offered to let us stay in his backyard log cabin, which he had built himself, for as long as we liked. During our trial stay we actually did find an apartment we liked and signed a rental contract, but it would be a few weeks before we could actually move in. Thankfully, we now had a place to sleep before the big move! We ended up staying in Mr. K’s log cabin for two weeks, dining with him and his wife each night. They even let us store our luggage at their home while we traveled to and from Osaka to pick up our furniture. Fast forward to today, and they are essentially our adoptive grandparents, with whom we dine with a couple times a month. Thankfully they now also let us cook for them from time to time! Financial subsidies to move to rural Japan During our orientation at the town hall, we were also informed about various subsidies the town offers to new residents. Please note that these amounts may no longer be accurate, but at the time (February 2024) those incentives included: 150,000 yen for moving from a greater metropolitan area like Osaka or Tokyo (must have lived there for 4+ years prior) 15,000 yen per month for 36 months if hired for a job in the township 15,000 yen per month for 36 months if moving to the town as a newlywed couple Up to 1,000,000 yen towards purchasing and renovating an abandoned home in the township The other areas we visited offered incentives as well, but at the time Kawaminami’s were the most generous. Many towns post about their subsidies and incentives on their homepages, and you can often find them by searching for the name of the town and 補助金 (hojokin, subsidy). Subsidies exist for age, occupation, remote work, students, children, and more. What living in rural Japan is really like While our warm welcome to the town extinguished our fear of not fitting in, we knew it would take some time before Kawaminami truly felt like home. My wife didn’t want to return to nursing and the many night-shifts that come with it, so she applied and was hired to be a member of the town’s team for local revitalization group (地域おこし協力隊, chiiki okoshi kyouryokutai) as an international coordinator and children’s English teacher. This gave her (and myself by proxy) many opportunities to get involved with local groups and activities. Since we craved a deeper sense of community after our lonely experience in Osaka, we took it upon ourselves to say “Yes!” to as many of those opportunities as we could. The local revitalization program is funded by the Japanese government, and pays people to move from a city to a rural town for up to three years in order to help revitalize it. Members are often free to choose their own mission, such as promoting tourism, developing local products, or starting their own businesses. For example, the guesthouse, standing bar, and bakery in our town were all created by program participants. The hope is that these people will settle in their new town permanently. While this article would be far too long if I listed all of the highlights of the past few years, here are a few standout experiences we’ve enjoyed in Kawaminami. Discovering the joy of farming After Mr. K introduced us to a local organic farmer, my wife and I have been able to get our hands dirty with some farming. Initially we thought it might be a fun hobby to do on the side, but it’s actually impacted how we view our lives as a whole, and influenced us to try to build a more sustainable lifestyle for ourselves (similar to Levi Pells, who wrote about his journey to sustainability for TokyoDev). While our farming journey has come with many failures, we’ve also seen some great successes. We’ve loved being able to try growing different produce, including cucumbers, tomatoes, potatoes, eggplant, edamame, green beans, passion fruit, watermelon, taro, carrots, daikon, and chili peppers. I don’t think I am the only developer who has been feeling some AI fatigue recently. As the world of IT keeps shifting at a pace too fast to keep up with, farming has been a restorative escape. My wife and I are actually now working towards purchasing some land so that we can have our own little farm and possibly open up a farmstay. Helping organize a quarterly seasonal feast Kawaminami has a unique event called “Tasting the four seasons” (四季を食べる会, shiki wo taberu kai), which began 20 years ago. Four times a year, local farmers and fishermen gather to share home-style dishes made from seasonal ingredients. The cost is around 4000 yen per participant (or 1500 yen, if you bring a dish to share) and that includes unlimited beer and shochu. My wife and I joined the organizing team soon after moving here, and it’s been a fantastic way to meet new people from our town and the surrounding area. During our most recent summer gathering, I even got the chance to debut our homegrown watermelon, which was thankfully well received. A photo of our latest seasonal feast before everyone began to dig in. Participating in various sports events Our town hosts both a yearly 10 km foot race and a gourmet cycle race. For the latter, participants cycle 30 to 150 km (depending on their experience and fitness levels) through several towns in the Koyu region of Miyazaki. During the trip, riders stop frequently to rest and sample some local delicacies. We’ve loved joining these events with friends in the area, and often meet new ones as well, since everyone goes out for dinner and drinks after the races. We’ve also been involved in many sport exchange events. Since part of my wife’s mission was to internationalize our town, she helped to host an international boys’ baseball match by welcoming a team from Hawaii. She even facilitated a homestay program for them, the first in Kawaminami. At other times, she organized international volleyball and kickball events. While there aren’t many native English-speaking people in our area, there is a large population of people from Southeast Asia who’ve come to work on its many farms. These events have been a great way to connect with them, and it’s been awesome to see the Japanese residents receive them warmly as well. Volunteering for our town’s festivals Starting in early spring, a team of around 40 volunteers organizes a spectacular fireworks festival to celebrate the end of summer. The team meets frequently over the course of several months to plan the event, which hosts 20,000 attendees, more than 30 food vendors, and several dance performances. This past summer I volunteered for this team, and found it a great way to learn about the dynamics between local businesses, town committees, and the municipal government. Often, after the meeting, members will go out for dinner and drinks. These post-meeting gatherings have been great opportunities to get to know the other volunteers on a deeper level, as generally everyone is a bit more relaxed after having a beer. Just a few months after this firework festival, another volunteer team organizes a burger festival that hosts over 20 restaurants and food trucks from across Miyazaki prefecture. This event operates at a smaller scale than our town’s firework festival, but both committees work quite hard, with the simple goal of running a great event to help increase inbound tourism and support the local economy. The town wouldn’t be as exciting without the sacrifice and dedication of these volunteers. Overall, it seems like we’ve rarely had a completely free weekend since moving to Kawaminami. Whether it’s a local event or an evening hanging out with friends, our social calendars here are full, and we wouldn’t have it any other way. The downsides of living in rural Japan While we love our life here, it wouldn’t be fair to paint the countryside as perfect. A few things take some getting used to. Secrets don’t stay secret for long In a small town, people talk. It rarely feels like malicious gossip. It’s more that everyone knows everyone, and so news travels naturally. But if you tell one person something, don’t be surprised when someone you never told brings it up a few weeks later. You’ll need a car There’s no train arriving every few minutes out here, and the nearest station can be a long walk away (as my wife found out). We rely on our car to get almost everywhere. The silver lining is my wife has become more comfortable with driving, something that didn’t seem likely back when we were considering living in Canada. Warmth can take time Some locals, especially older residents, can be shy around foreigners at first. It isn’t unfriendliness: many simply haven’t had much chance to interact with people from overseas. In my experience, the ice melts quickly once you’ve shared a meal or a drink together. Be patient and open to conversation, and people will come around. In conclusion A few weeks ago, a bright light flashed across the sky again. But instead of lying awake and annoyed, I was standing in a field with 20,000 other people, sweaty from a day of setting up tents and directing traffic, watching the fireworks my community had spent half a year planning. Moving to the countryside hasn’t been perfect. We drive everywhere, it’s hard to keep a secret, and there are still days when I’m the only foreigner in the room. But in Osaka we were surrounded by millions of people and knew almost none of them. Here, it’s difficult to get to the supermarket without stopping to chat with someone we know. If you’re thinking of making a similar move, my advice is simple: use the trial stay programs, visit more than one town, and don’t judge a book by its cover. The town that feels like home might be the one you least expected. Once you arrive, it’s best to say yes to everything, from a random offer to drive you to the station, to volunteer opportunities. That’s when a town stops being just a place you live, and starts feeling more like home.

57 minutes ago • 1 votes
Organising my cross-stitch patterns

I have a lot of digital cross-stitch patterns and until recently they were a mess. My “collection” was a series of several hundred PDFs, disorganised and spread across my disk. Recently, I was looking for a pattern and it took me several minutes to find it. I had a brief moment of panic, thinking that I’d lost it, and the website this pattern came from is long since gone. Fortunately it did turn up, but it was clear I had to organise my pattern collection. Some people would use apps like Pattern Keeper or Flosshaven, but I just created another static website on my media drive. This is what it looks like: The patterns are arranged in a masonry layout with a preview thumbnail for each pattern, which is normally the first page of the PDF. If a pattern has multiple files – for example, different files for colour and black-and-white printing – there’s a list of links below the thumbnail. I can also add a source link to where I bought the pattern, if I want to find more patterns by the same author. Internally, it’s structured like my other static websites. The metadata for the patterns is stored in a JavaScript file, and then I have an HTML page which renders that metadata in this visual design. My pattern collection doesn’t change very often, so I’m adding new files by hand. There are no sorting or filtering options, because my collection is small enough that they’re unnecessary. I can scroll through the entire list in less than a minute and find whatever I need. I’d like to start making my own clothes soon, and I expect to copy this design to store clothing patterns. This collection now sits alongside my saved bookmarks, podcasts, TV shows, and more. I can keep all my patterns organised, and I won’t lose them in the depths of my hard drive. Technical tricks There are a couple of technical pieces I’m quite pleased with in this process: Masonry layout. I love the cascading grid style of a masonry layout, and I think they’re great when you have variable-sized content – like my pattern cards. I’ve been using them for over a decade; screenshots of my early web apps show my experiments with David Desandro’s Masonry.js library. Masonry layouts are now a native feature of CSS called “Grid Lanes”, which is simpler and more performant than the JavaScript approach. I’m excited to use these layouts in even more places. Thumbnails of PDFs. Most digital postage patterns are shipped as PDFs, and I’m creating the thumbnail images with my create_thumbnail tool. I had to extend my tool to support PDFs, which turned out to be straightforward with the pdf_oxide crate. I’d not come across Oxide before, but it’s a cross-language library for working with PDFs, and I can imagine using it in future. A coloured stripe for the palette. In the metadata for each project, I have the complete list of DMC thread colours and the pattern dimensions. I have a lookup table that converts DMC thread colours to hex codes, and then I’m able to create a linear gradient in CSS to render a coloured stripe of the pattern colours. Here’s an example from a pattern with four colours: border-bottom: 12px solid transparent; border-image: linear-gradient( to right, #7a451f 0%, #7a451f 25%, #985e33 25%, #985e33 50%, #e4bb8e 50%, #e4bb8e 75%, #361f0e 75%, #361f0e 100% ) 1; Building the HTML, CSS, and JavaScript was very quick – I have notes on how I build my media sites, and I’ve done it plenty of times before. I threw together the initial prototype in less than 15 minutes. The longer part was finding all the PDFs scattered across my disk – but now that’s done, and I know exactly where to find my patterns. [If the formatting of this post looks odd in your feed reader, visit the original article]

an hour ago • 1 votes
Writing a Demoscene Intro for the ZX Spectrum

Download Now View on pouet.net Intro In the late 80s, I spent an embarrassing number of hours hunched over my ZX Spectrum, typing in Sinclair BASIC programs and rudimentary assembler routines copied from magazines, trying to re-create the Amiga crack intros I’d seen round at a friend’s house. Obviously, they never came even slightly close - but now, many decades later, I’ve finally managed it! I’m now the proud author of a hand-rolled retro demoscene intro that runs on a stock 128Kb Spectrum. It features all those late 80s tropes: A smooth scrolltext (with ‘leet custom fonts!), a three-channel AY soundtrack, bouncing VU meters and the essential parallax starfield. It’s currently 10287 bytes of code, or 19552 bytes as a complete tape image - which, given I’ve been working on this since December 13th last year, means my average rate of code-production is a paltry ~ 455 bytes per week! This blog post is a technical overview of how I got there, some cool tricks I picked up, and everything I had to learn (and re-learn) about the Speccy and Z80 assembly along the way. It simultaneously rates as one of my favourite side-projects ever, and also the one that most often nearly triggered a foot put through my monitor in frustration. I’ll reflect on all that at the end, but for now if you just want to see the finished product, the download button is at the top of the article and the included .tap cassette tape image should load into any emulator. There’s also a YouTube capture, links to the production on pouet.net, and you can run it from within a web browser by visiting my TNFS site portal - check option 4 for recent uploads. Be Kind, Rewind But let’s skip back briefly to the late 80s. Coming from the world of an 8-bit, cassette tape loading computer, seeing an Amiga for the first time was like encountering something from outer space. Like everyone who saw one back in the day, I was blown away by the amazing graphics and sound on display, not to mention the library of ground-breaking games. But I found myself even more captivated by the mysterious (and totally badass) “intros” displayed at the beginning of pirated games. Created by the software piracy groups that had cracked the copy protection and distributed the floppy-disk based games, they were mini works of art in their own right - music, graphics and usually some cool-looking effect to show off the group’s prowess. There’s a great collection of these intros (or “cracktros”) archived on YouTube. Watch a few of those videos and you’ll quickly notice the “design” tropes that almost every cracktro shares: a cool, edgy logo at the top of the screen (bonus points if it’s dripping blood or in any way “metal”), some boastful text displayed on top of an effect of some sort - usually a scrolling parallax starfield, or rotating 3d object - and a further scroll-text full of shout outs, greetings to fellow pseudonymous crackers and adverts for illegal BBS systems galore. Needless to say, to a kid in the 80s/early 90s this was possibly the coolest thing ever. I thought this one was the absolute bomb when I first saw it. Sine-scroller, pirate BBS adverts, cool logo with a sword - and of course, a starfield. There’s something for everyone here. The music from this is burned into my brain. I think pretty much everyone of my classmates knew this intro given the popularity of Lemmings in the early 90s. Skid Row as a group are still active to this day and this is probably the quintessential Amiga cracktro of the period. Endless Piracy. Edgy. Another cool logo, sine-wave scroller, starfield and boasting text. The classics never go out of style. Another great combination of all the essential ingredients. Cool logo, even cooler text font, scrolling starfield and a scroll-text running along the bottom. Vintage stuff. Logo. Text. Scroller. But no starfield - otherwise a solid effort from Anthrox here :) The demoscene grew out of these intros. The cracking eventually faded into the background, and coders, “graphicians” and musicians all contributed to feature-length productions that showcased their abilities, competed with other groups and pushed the machine to its limits. In amazing feats of ingenuity and pure “code as an art form”, the scene lives on today, with groups producing breathtaking productions like this and this - bear in mind, both of those are running on a 7Mhz home computer equipped with a floppy disk, 1Mb of memory and a sound chip from 1985. But much as I admire the sheer skill and dedication that takes, it’s the early “single screen” scrolly-text-and-starfield cracktros I’ve always found captivating. They took on a sort of mystical quality for me, hinting at a scene and a culture I could only ever experience from the outside - which is exactly why I spent all those hours in Sinclair BASIC, trying in vain to re-create them, and dreaming of the day I’d eventually have an Amiga of my own. The Jump Back I eventually did trade up to a range of Amiga systems, joined a few “scene” groups myself and threw myself into a variety of activities until exams and the end of my teenage years beckoned. I dabbled with Z80 code back then, and at one point knew enough 68k assembly to bluff my way through - partly from the Amiga’s heyday, partly from a few “embedded systems” modules at University where I had to program a set of traffic lights or lift-controllers. Given there’s not much call for that sort of thing at my $DAYJOB, though, it had all pretty much faded from my memory. I have kept working on a bunch of projects in my spare time, and one of my favourites is my TNFS site - sort of an old-school BBS system or interactive “website” for the Spectrum, which grew out of a fun experiment to see how far I could push Sinclair BASIC. It relies on a modern network card fitted to the Spectrum, which is how I came to be chatting to “Desertkun”, another TNFS-protocol enthusiast. He’s now producing a great new WiFi network card for the Speccy, and was kind enough to send me a few of the prototypes to test out for him. I was massively inspired by his hardware and low-level coding chops, and during one of our video calls where we’d been comparing our development setups, he asked why I didn’t write any Z80 assembly myself. A throw-away comment, but the challenge was set! Now, I couldn’t face re-writing the whole site in asm, but I figured I could produce a self-contained intro to promote it in the style of the early “BBStros”, and finally be one of the cool kids with a scene production of my own :) I mean, how hard could it be ? (ooooh - foreshadowing!) Dev Environment My development environment through this was pretty straightforward, and is the same stack I use for developing my TNFS site. I just used a Makefile-driven build system which ran my code through the Pasmo assembler, my fork of zmakebas to build BASIC files, and the FUSE emulator for testing. For final testing on the real hardware, I uploaded my .tap files to my local TNFS server where I could run them on my +3. A few additional tools I have to call out because they ended up making a big difference - one is the amazing web-based “asm-editor” I discovered while looking up Z80 instructions. Not only does this site have a great reference of all the Z80 instructions, but it also has an editor where you can run example code and see how the memory and/or various registers change state. Take for example, the djnz instruction - you can build it and step through the example loop construct one instruction at a time. Or try my example of an add instruction in the screenshot to see how the carry flag works when a bit gets shifted out of a register. Although it uses a slightly different syntax to Pasmo (so I couldn’t drop my code directly in it), it massively helped when manually stepping through things. And lastly, probably the most significant debugging tools I used on this project - a notepad and pen, and my two dogs (say “Hi!” to Biscuit & Pebble…) I’ll write some more about this in the wrap-up, but this really was a highly unusual project for me, coming from decades of much higher-level languages and constructs. Most of my z80 code I only ever really understood after drawing out the bytes and bitmasks, keeping a table of register flags and drawing chunks of screen memory out by hand. And I found my evening walks with the two dogs provided ideal rubber duck exercises, although I’m not sure what they both made of my protracted mutterings about the hl register pair. Either way, debugging-by-dog is highly recommended! The Starting Point So, let’s get started. I followed a great “Hello, world!” example from futurice.com to validate my build environment. Beyond that, the first thing I wanted to do was load in my logo and background image I’d use as a “stage” for the remainder of the planned intro. I wasn’t really sure what I was going to do at this point, just that I wanted my logo at the top, and a scrolltext along the bottom row of the screen. As my TNFS site header already looked kinda demoscene-y, I made a quick edit putting in place two blue guide-bars inside which I’d put further content. Memory map courtesy of breakintoprogram.co.uk A Spectrum SCREEN$ file (usually displayed as loading screens) is just a dump of screen memory, starting from byte 16384, and running for 6912 bytes. The weird layout of this is very relevant later, but in order to display it all you need to do is load your file into that memory location. After a few hour’s work of reviewing Speccy internals and following various guides, I had a very simple starting point for my demo that served as the basis for everything else that came after. org $8000 screen EQU $4000 ; address of the first byte of screen memory, 16384 in dec scrlen EQU 6912 ; total length of the screen memory inc. attributes ula EQU $FE ; I/O port for the ULA to control the border black EQU 0 ; Spectrum colour number, the exact same ones BASIC uses start: ld a,black ; Set the border colour to black using the ULA out (ula),a ; Copy my logo header picture to screen memory ld hl,header ; HL = location of my screen file in this code ld de,screen ; DE = start of screen memory ld bc,scrlen ; BC = 6912 bytes to copy ldir ; block copy, see https://jnz.dk/z80/ldir.html ; busy loop - rest of intro goes here :P hold: halt ; sleep until the next interrupt (1/50 second) jr hold ; then jump back and sleep again, for ever header: incbin "assets/header.scr" ; my logo header/background end start Not much to look at now, but this simple starting point introduced me to important concepts like interfacing with the Spectrum’s hardware (ULA chip to start with, and AY sound chip later) via the out instruction, how to pull in binary files using Pasmo’s INCBIN directive, using the Z80’s block copy ldir instruction, the use of register pairs for 16-bit addressing, and simple branching to labels. Hello World The next step was to print something on the screen and explore some of the Speccy’s built-in ROM routines, which are somewhat analagous to syscalls on modern operating systems. There are plenty of disassemblies and guides to the Spectrum ROM available on the internet, one of the best commented and linked one is at https://skoolkid.github.io/rom/. Using this as a reference alongside the various “Hello, world!” tutorials showed me how this sort of thing is built up: at EQU 22 ; "at" control character used to position the cursor row EQU 11 ; coordinates where to print the message col EQU 9 prstring EQU $203C ; where the pr_string routine lives in ROM ld de,msg ; DE = address of the first character ld bc,msglen ; BC = how many characters to print call prstring ; print the lot ; busy loop is the same... msg: db at,row,col ; equivalent of "PRINT AT 11,9" in BASIC db "Hello, world!" msglen EQU $-msg ; 16 bytes in all, pasmo shortcut, $=program counter I ended up mostly not using the ROM routines in my code as they dragged in all sorts of things I didn’t need, but it was massively useful to understand how they worked as they introduced me to yet more commonly-used constructs. For example, the PR_STRING routine defined here shows how you can build a loop over each character. If you’re just starting out, I highly recommend going over the 8 lines in that routine with a notepad and pen, working out the contents of the registers and following the loop constructs. I also made a version of it in asm-editor you can try. If you click that link, you’ll see a version of the code loaded into the web editor. Click “Build”, and then step through the code using the “Step” button - although no text will be actually displayed (I skipped over the call to the Spectrum ROM “restart” vector that does this), you’ll see the various states of the registers and for example the BC register counting down as each byte of the string is processed. Adding Some Style Problem is, the Speccy’s built-in font is not exactly dripping with demoscene credibility. I wanted to use some stylish fonts and this turned out to be super easy - a quick search turned up Jim Blimey’s awesome font collection, which included a ready-to-use set of assembler files and some instructions which soon led me to these additions in my code: ; CHARS is the address the ROM's printing routine reads to find the font. ; Picking our own font is simply a matter of over-writing this chars EQU $5C36 ; from Jim's docs - POKE 23607=5C36 in hex ld hl,myfont-256 ; HL = font address - 256 as per docs ld (chars),hl ; from now on the ROM draws with it! ; rest of code is the same myfont: include "textfont.asm" ; "Cartoon" font from jimblimey.com There we go! Now that’s looking a little more elite. Sorry, I mean 31337. Strap in folks, we’re leaving lamer city… So at this point, a month or so in to my dabblings and I’d started to get a reasonable understanding of common idioms and was starting to feel like this was a project that might actually go somewhere. The problem started when I moved on to trying to implement actual demo effects: It became very apparent, very quickly, just how much I didn’t know about how this all worked. Not to mention the fact that at this level, you’re really closely exposed to the physical hardware intricacies, including the design decisions and trade-offs that the hardware designers had to make when working with the extremely limited specs of the early 1980s. Cursed Screen Layout The first such problem - and the cause of probably 90% of my pain - is the Speccy’s extremely weird screen layout. Rather than standard bitmapped display you might expect on more modern hardware, it is instead split into 3 sections, each with a set of interleaved rows (so if you keep adding 1 to a screen address, eventually instead of reaching the next row, you’ll instead end up 8 rows down, and so on until you hit the bottom of the section and then loop back to the row underneath where you started!) followed by a block of “attribute” bytes which determine the colours of each 8x8 block. The attribute blocks are the reason why each 8x8 character cell can only have two colours (a PAPER and INK attribute) which led to the garish “colour-clash” of spectrum games and distinctive style where artists try to keep inside 8x8 blocks as much as possible. But it was the layout of the bitmap portion that is such a mind twister. Download the video You can see this illustrated whenever a game reads in a loading screen from tape. You can see each section built up with the interleaved rows one at a time, and then finally the colour and other attributes (like flashing ). There’s a lot of detail at the fantastic Break Into Program site. In the defense of the designers, they were working with extremely limited hardware and I don’t think the Speccy was ever imagined as a games machine. When you start shuffling bytes around, you realise that this approach is really optimised for displaying text which is neatly arranged into 8x8 character boundaries. For example, using this “scrambled” bit order, if you have a screen address in the hl register pair, you can quickly get to the next pixel line of a given address by simply incrementing the “high” byte. There’s a bunch of other “cheap moves” you can make by simply shifting bits around: Move Instruction Right 8 pixels inc l Left 8 pixels dec l Down 1 pixel line inc h Up 1 pixel line dec h Down 1 character row add 32 to l It was a reasonable choice for a machine that would probably spend a lot of it’s time displaying BASIC program listings - it’s only when you start trying to write demo or sprite routines that it starts to feel really weird. This also means you’ll pretty quickly need a routine to convert X,Y addresses to the relevant memory addresses. Again, L Break Into Program has a useful routine and if you disassemble more or less any spectrum game or demo, you’ll find a version of this procedure somewhere. And yes, this all became horribly relevant later on… The Scroller Download the video Admittedly, not the most interesting demonstration - but this was the first time I had made something move on the Spectrum’s screen with assembly! I watched this with pride more times than I care to admit :) I had a snazzy logo and “Hello World” text, but that doesn’t make for a very interesting intro! The first effect I wanted was the scrolltext - without that, it’s not really an intro. Now, the Amiga had all kinds of hardware sprites, blitter operations, custom chips but the Spectrum had none of that. I was going to have to work out how to do things the hard way - “banging on the metal”, literally by shifting bits around the screen memory by hand and having the CPU do all the work. This is where understanding the Speccy’s weird screen and character cell layout is so important. It turns out there’s a neat trick as long as I stay inside one character row - there’s a RL instruction, which takes a byte and “rotates” it left. It inserts whatever is in the carry flag into the rightmost bit, and whatever gets shifted out ends up in the carry bit again. That means if you string a bunch of them together, you can move a set of pixels across the screen - the moment they “fall off” one character cell, they end up in the carry flag and then the next rl instruction inserts them at the beginning of the next character cell to the left. Repeat 32 times, and you’ve just moved a pixel (or set of pixels) across a line of the screen: linestart EQU $4880 ; leftmost byte of the line 12 rows down lineend EQU linestart+31 ; rightmost byte column ($489F) linelen EQU 32 ; one whole line is 32 bytes (character cells) across dot EQU %00000001 ; the dot "shape", just one pixel lit at the far right end newdot: ld a,dot ; load the dot shape (only rightmost pixel lit) into a ld (lineend),a ; store it in the rightmost byte of the line, pixel is now lit frame: halt ; wait for the next frame, otherwise it whizzes across too fast to see ld hl,lineend ; hl = last (rightmost) byte of the line ld b,linelen ; loop counter, 32 bytes to work through or a ; trick to clear the carry flag, or against itself leaves a register ; unchanged but clears various bits including the carry flag ; see https://jnz.dk/z80/or_r.html shift: rl (hl) ; rotate this byte left (00000001 -> 00000010) dec hl ; point hl at the next byte to the left djnz shift ; loop construct: b=b-1 and then jump back to shift label until b=0 jr c,newdot ; now we've shifted the whole line, so if the carry flag is set now it means ; the dot has just left the screen, so we jump back to the start jr frame ; otherwise it is still somewhere on the screen, so keep shifting! Download the video Hell yeah. It’s almost a proper scrolltext now! Wrapping this in another loop that increments h each time (remember - that gets us moving down a scanline) gets us moving an entire character cell. Here you can see it moving an entire row of my “Hello world” message. There was however a lot more work needed to make a proper scrolltext, with each letter appearing smoothly. I started off by just printing an entire character at a time on the right-hand edge of the screen - it worked, but was pretty ugly as you saw each new character appear at once in the right-hand side of the screen, scrolling 8 pixels over and then the next character flashed up. Instead, I wanted to make each character appear pixel by pixel and that required a bit more bit juggling. The routine I ended up with effectively streams each character in, line by line, pixel by pixel using the font data directly instead of calling the ROM print character routine. It does this by looking up the ASCII code for a character, and then fetching the corresponding font representation into a 8-byte buffer, one byte for each line of data. The font data starts with the space character (character code 32), so a lookup is simply font code base address + (ascii code - 32) * 8 to get to the bits for that letter. Arranged into an 8x8 grid, the bits for the letter H in the font data look like this. For each row of bits, I shift the line left using a neat trick. The byte is loaded into the a register, and then by adding itself to itself - add a,a we shift the value left (in binary, multiplying by 2 moves everything over one bit) so that the pixel I want to draw ends up dropping into the carry flag. This is an idiomatic way of doing it in Z80 code as it’s faster and smaller than the sla instruction. And every cycle quickly adds up when you’re re-drawing 256 bytes every frame! The character buffer then looks like this, with the top line shifted. Now, with the hl register pair pointing at the correct location on the screen, I can then use the rl trick discussed above. This shifts a scanline from the bottom character row of the screen left by one pixel and draws my pixel in the rightmost position by moving it in from the carry flag. Looping 32 times over this moves the entire row by 1 pixel with my new pixel inserted at the right. I then repeat this step again using inc h to move down one scan line until the entire character column has been drawn. At this point, the character buffer looks like this, and all 8 lines of the bottom screen row have all been shifted left by one bit by looping over all 32 character columns. The whole thing then repeats another 7 times until the entire character has been smoothly scrolled onto the screen. So just to re-state this because I think it’s worth the emphasis - just to scroll a message across the bottom of the screen, we’re having to loop over and re-draw 256 pixels every frame! It shows how much faster assembly is than the BASIC interpreter built into the spectrum’s ROM. I found it amazing to see my code finally working and imagining all the bits flying around and registers flapping away. It really makes me appreciate just how much effort went into creating the games I played back then. Music The original Amiga module I converted. A proper 1980s ear-worm! Of course, any good intro needs some music. On the Amiga, the standard was the “tracker” module format, which has a long and involved history of different forks, versions and tweaks. A song is built up from a series of patterns, each made up of rows of instructions. Each instruction usually includes note or pitch information, which sample to play and various parameters such as volume, effects - or in the case of some instructions, which position in the song to jump to. In many ways, it’s almost like a programming language for music. Using ProTracker as an example, a typical note cell is 4 bytes, shown on-screen as something like C-2 01 C20. That breaks down into three fields: the note and octave (C-2), the sample number (01), and the effect and its parameter (C20 - in this case, “set the volume to $20”, which is half of the maximum $40). A close-up of Protracker playing a tune. Note the VUmeters - another classic demo effect I would pinch later on! For an impressive demonstration of what’s possible with a tracker and to see what the note data looks like on-screen, check out the work of h0ffman, and in particular his winning “Professional Tracker” entry from the Revision 2014 competition. He’s an undisputed master of the science (or art!) of tracking, and his “Secrets of Protracker” talk gives a great overview of what’s possible. The Amiga’s sound hardware far eclipsed anything else on the market at the time, and the ZX Spectrum is paltry by comparison. The original 48K models only offered a rudimentary “beeper”, but the later 128K models included a 3-channel AY-3-8912 sound chip. This was very popular in 8-bit micros of the time, and a more-or-less identical variant was also used in the Atari ST. While it only offers basic waveforms and sound processing, it does enable multi-channel “chip music”, and so it became the mainstay of the ZX Spectrum demoscene. It also spawned a variety of SoundTracker clones on the Spectrum itself, although most musicians these days prefer to work in modern tools like Vortex Tracker II, which runs natively under Windows. The Conversion Pex looking back on his demos - this starts at the point where he features my letter and plays a bit of my cover version! For my intro, I wanted to port an Amiga module - and I had the perfect one in mind. One of my favourite Amiga music disks was “Sounds Of Gnome”, released in 1989 by the Swedish duo “Mahoney & Kaktus”. Mahoney also wrote NoiseTracker, one of the first really widely used trackers on the Amiga, and the program that served as my teenage introduction to making computer music of my own. Back in 2018 I made a rock cover of one of the other tunes on that disk, and wrote to Mahoney (real name “Pex”) about it. He ended up showing my “music video” at a demo conference, which I am eternally grateful for! So it seemed only fitting that I mangle another song from that collection with a Spectrum conversion… Sorry, guys! I picked the track “Milkman” which was written by “Glue Master”, an associate of Mahoney’s who had a few of his tracks featured on the compilation. It’s an ideal track for converting: It’s short (only 7 patterns in total), most of those patterns share the same chord sequence, and it looked fairly easy to squeeze the original 4 channels down into the Spectrum’s 3. Plus, it’s an incredibly catchy tune and I knew it well - I’ve been listening to it for 35+ years and often jam along to it on guitar or bass. The conversion started off pretty easily: all I really had to do was copy the patterns note-for-note from the Amiga mod, which I had open in OpenMPT as my Windows tracker. Below is a session with both trackers open on the same pattern - the original Amiga mod on the left, and my 3-channel Spectrum conversion on the right. Note the 11.7 in the 3rd channel of the Spectrum version. This is a “pitch slide down” effect in Vortex Tracker syntax, which drops the pitch by about a quarter-tone. It’s repeated on the next line, so the overall effect is a slide down from the A# that leads in to the next bass note. The original Amiga mod does the same thing using its own syntax - those are the 202s you can see on the same notes, at the bottom of the 4th track. Using just a single “beep” sound for everything was enough to check everything was working, and after a few weeks of hacking on it and re-arranging things in the evenings, I had a basic version which sounded surprisingly good for a first draft: Download the MP3 instead. I have to give a special mention to this forum post which was a massive help getting me started. It’s probably the best introduction to Vortex Tracker I’ve found - many, many thanks to the original author for taking the time to write it all up! The real challenge was making it sound as close to the original as possible. That meant building up a library of better-sounding samples for the different parts, and making extensive use of Vortex Tracker’s “ornaments”. Vortex Tracker comes with a great selection of sounds, and fortunately I’m also a weirdo who likes to listen to chiptunes in the background while I work! So whenever I found something particularly enticing, I filed it away for later pilfering inspiration. A Vortex Tracker sample isn’t really a “sample” in the Amiga sense of a recorded sound - it’s a definition of how a note sounds, one line per frame. Each line can mix in a tone or the white noise generator (useful for snare effects and suchlike), along with various other parameters. Ornaments, on the other hand, give you extra control over what pitch a note plays - and this enables really useful tricks like “arpeggio chords”. For example, an ornament of 0,4 makes the channel switch rapidly (25 times a second) between the note being played and the one 4 semitones above it. It happens so quickly that it sounds much like two notes played at the same time, which means you can build up full-sounding triad chords using only two channels. Take the opening chord in my fully converted version, Cm: It plays C in the first channel and the minor 3rd (D#) in the second, then I apply an ornament to the second channel to bring it up 4 semitones to the 5th (G). That gives all three notes of the chord, while keeping the 3rd channel free for other parts. As well as making much more efficient use of the limited 3 channels, this also gives Spectrum music that characteristic “warbling” sound, which I find really appealing in a retro kind of way! Between tricks like this and samples that mix tones with white noise (to make a combined “bass-snare” sound, for example), I managed to condense the full track down to 3 channels. Many months later, I have to say I’m really pleased with the final result. Playback The original site that was home to Vortex Tracker, documentation and other resources appears to be offline at the moment. I managed to grab a copy of everything I needed from archive.org - you’ll want the PTxTools.7z file for the playback routines discussed here. The playback was simple in theory: As this overview notes, you basically just pull in the player routine, include your module file and call the playback routine once per frame in your main loop. The catch is, none of the source code versions supplied in the archive worked with my Pasmo assembler. Fortunately, there is a pre-compiled binary object shipped alongside the source (VTII10bG in the PTxTools/PT3Play directory). This just has to be loaded in at address $C000 - this cannot be changed, as it has lots of absolute addresses baked in. My code to handle module playback now looks something like this, with the binary module loaded in place: ; Define the start address of the player routine and functions we need player EQU $C000 ; hard-coded org address of binary player plinit EQU player+3 ; init function in docs, module address in hl plplay EQU player+5 ; play and move on one frame ; from the docs - this "analyzes PT3 module header and prepares ; corresponding note and volume tables" ld hl,moduleimg call plinit ; main loop hold: halt call plplay call scroll ; other effects / routines go here... jr hold moduleimg: incbin "assets/music.pt3" Starfield Download the video Well, that didn’t work as hoped. TNFStro - tortoise edition. This brings me to the main event. No self-respecting cracktro is complete without a starfield! My first, naive approach to the classic starfield effect was to scatter random stars across the screen, then move down each scan-line applying the same rl trick I’d used for the scroll-text. I figured I could get parallax by shifting each row a different amount: One pixel for the first row, two for the second, three for the third, then back to one again, all the way down the screen to give the impression of several “fields” of stars moving at different speeds. It turned out there were two major problems with that approach. Firstly, shifting an entire row smeared whatever else was on it along with the stars - which I’d expected, and had filed away as a problem for future me. The bigger issue was speed: by the time I’d finished the first three rows I’d already performed hundreds of shift operations, and it was nowhere near fast enough to fit inside a single frame. Everything crawled across the screen, and the music playback slowed down so much that you could actually hear the arpeggio ornaments warbling away as separate notes. Clearly I was going to have to keep track of the individual stars instead. I found this routine, which was more-or-less what I had in mind and started me off with the idea of a structure to hold the state of each star. It also uses a screen address lookup much like the one from “Break Into Program”. Download the video Dammit. Back with another funeral dirge rendition :( That got things moving, but the co-ordinate lookup and tracking proved expensive to do (it has to run for every star, every frame as well as keep track of the old position for erasing) and I’d been ignoring the bigger question how to display stuff on top of the starfield. My original idea was simply to draw the stars and then paint text over them each frame, which blew the frame budget just as comprehensively as my first attempt. If I wanted something more interesting than an empty starfield, I’d have to keep track of which cells were occupied by text and avoid drawing stars in them in the first place, rather than over-painting them every time. After lots of scribbling in my notepad and visualising rows of bits, I eventually solved both challenges by “cheating” fairly liberally. So now, I don’t generate a random starfield at all. Instead, I built a table of pre-calculated Y and X position pairs: stdata: defb 109, 25, 88,182, 42, 96, 155,226 defb 59,254, 137,169, 160, 84, 125,193 ; ... and so on, for 32 stars ... This saves faffing about with an RNG, and once I have a layout that looks good I know it’ll always look good. I can also “fudge” things and ensure no two stars share the same y co-ordinate which sidesteps a whole class of problems like stars sharing a scanline, and having to deal with them overtaking each other. The “random” layout is generated by a simple Ruby script: #!/usr/bin/env ruby PAIRS = 32 PER_LINE = 4 # pairs per line Y_RANGE = 40..175 # exclude rows taken up by my logo & bars X_RANGE = 0..255 raise "y range too small" if Y_RANGE.size < PAIRS # no duplicate y values ys = Y_RANGE.to_a.sample(PAIRS) pairs = ys.map { |y| [y, rand(X_RANGE)] } pairs.each_slice(PER_LINE) do |row| body = row.map { |y, x| format('%3d,%3d,', y, x) }.join(' ') puts "defb #{body.chomp(',')}" end When the routine initialises, I convert those co-ordinate pairs into a table that tracks the state of each star. So rather than storing a position and translating it to a screen address every frame, each of my star records now looks like this (offsets from the base address): STSCR EQU 0 ; screen address of the byte the star is in, e.g. $4123 STOCC EQU 2 ; a pointer to the "occupancy check" table cell STMASK EQU 4 ; the star's bit pattern, e.g. %00010000 STSTEP EQU 5 ; "speed" - num. of pixels this star travels per frame The key thing is that there are no X/Y co-ordinates at all. For each star I store the screen byte it sits in and the bit mask within that byte, so it’s already in the form the screen writes need. That means no address conversion per frame, just simple bit shifting and rotation. Moving a star is then dead simple. I rotate its mask left with rlca, and when the bit rotates out of bit 7, it lands back in bit 0 with the carry flag set. That’s the signal I need to move the star one character cell to the left, which is one of the “cheap moves” from earlier. Because I’m tracking which cell each star is in, the collision check comes almost for free. That’s what the second pointer is for: STOCC (Star Occupancy) moves in step with STSCR through a table holding one byte per character cell. The “typewriter” routine sets a byte to 1 for every cell containing a text character or the cursor, so checking whether a star is hidden behind text is a single or instruction. If the cell is occupied, I skip drawing the star but carry on rotating and stepping it along until it reaches a cell where it can be displayed: ld l,(ix+STOCC) ld h,(ix+STOCC+1) ld a,(hl) ; A = the occupancy check for this cell or a ; test A against zero jr nz,stmove ; it's occupied, so leave the screen alone Parallax is still handled by moving each star a different number of pixels per frame, but the cost is a lot lower this time as I’m only touching the cells the stars actually occupy, rather than every byte of every row. Download the video That’s looking more like it! The typewriter routine is a simple copy of the font data from memory, and is very cheap as we can use the “cheap moves” to quickly fetch the 8x8 block. I also skip drawing any space character so it leaves the “occupancy cell” unmarked. This means the stars keep drifting through the gaps in the text - you can see here the odd star passing in between the words. I switched to ALL CAPS writing for the final version which helps the effect even more as the font is quite blocky, so you don’t really notice stars skipping the spaces inside a glyph at all. Misc Notes A few odds and ends that didn’t warrant a section of their own… VU Meters Some sort of graphic display bouncing along with the audio playback was another common early demo trope. I did originally consider a real-time graphic equaliser, but that would have been far too complex, probably in terms of spare cycles per frame, and definitely in terms of my limited mental capacity at this point! So I settled for a simple set of bouncing meter bars instead. It’s worth a mention mostly because it gives me an excuse to link to the awesome chibiakumas website! I just love the late 90s web design on display - one can argue that readability and accessibility take a hit, but it’s just so much fun to encounter a site that still looks like this. It’s a clear labour of love and there’s a wealth of content there as well, if your eyeballs are up to it. Their guide on Making Sound with the AY-3-8910 was what showed me how to get the data I needed to draw the meter bars. The examples write a register number to $FFFD to select a register, and I realised that once a register is selected, I could use the in instruction to read its value back out instead of writing a new one. As the page says, R8, R9 and R10 hold the channel amplitudes, so they feed nicely into the height parameter for drawing a bar. Getting the amplitude for channel A is then as simple as: ld a,8 ; Channel A register call ayread ; ... rest of code here ... ayread: ld bc,$FFFD ; Register select port out (c),a in a,(c) ret Twinkle, Twinkle, Little Star This is a simple effect that makes the header logo a little more interesting. I’m not sure where I originally got the idea - I’ve definitely seen something like it on a few late 80s/early 90s demos, though. All I wanted was to pick random star dots in the logo background and animate them. Here’s the header image loaded in ZXPaintbrush with the character cell grid showing. By happy chance, there are four stars which each sit neatly inside a single character cell with enough surrounding space, so they can be used to give an animated “twinkle” effect by drawing a cross out from the centre point and back in again. These dots map to the following co-ordinates, which target the top scanline of each fully-grown star (two pixels up from the centre): twkdata: defb 1,5 ; char row 0, col 5, centre y=3 ink 5 defb 1,20 ; char row 0, col 20, centre y=3 ink 1 bright defb 26,7 ; char row 3, col 7, centre y=4 ink 4 defb 25,22 ; char row 3, col 22, centre y=3 ink 6 bright The “twinkle” routine itself is simple enough: it adds a pixel on either axis to grow the star, waits a few frames, then shrinks it back down again. The interesting bit was how I made the twinkle order pseudo-random. Remember that my starfield was entirely pre-calculated from a data table generated by a Ruby script, which meant I’d never actually needed a random number generator in assembly. From Jonathan Cauldwell’s “How To Write Spectrum Games” e-book, I found another great “hack” which simply walks through the start of the Spectrum’s ROM, picking out random-looking bytes as it goes. As he says, he uses it in most of his games, and it does the job in a really simple way - as long as you stay below the block of structured, repeating data that sits 8Kb into the ROM. twkrand: push hl ld hl,(twkseed) ld a,h and 31 ; keep it within the first 8k of ROM ld h,a ld a,(hl) ; the "random" byte inc hl ld (twkseed),hl pop hl ret Out Of Space About halfway through writing the intro, I hit a fairly predictable problem: I had run out of memory. In an attempt to keep everything self-contained in one block of code, I was pulling all of the assets (the screen background, the player binary, the music file etc.) into the program itself, and then using the ldir block copy instruction to move each one into its correct location. Since that meant effectively storing every block twice, and the player routine had a hard-coded start address of $C000, I quickly ran out of room and my code started crashing into the playback routine. The simplest option was to split things out into separate code blocks, load each one directly to the address it needed to live at, and wrap the lot in a multi-stage BASIC tape loader: 10 CLEAR 32767 20 BORDER 0: PAPER 0: INK 0: CLS 30 LOAD "" CODE 40 LOAD "" CODE 50 LOAD "" CODE 60 RANDOMIZE USR 32768 This loads the main program, then the player routine directly into $C000, and finally the background screen straight into screen memory. It does mean the background starts appearing before the demo has fully loaded, but as I imagine most people will be seeing this running in an emulator or on my TNFS site, it doesn’t really matter. Plus, at this point I was in danger of disappearing down yet more rabbit holes (I still really want to work out how to do multi-colour border effects!) and I’d never have got this thing released. The Zen Of Z80 This whole project is a really weird one to look back at. On the one hand, I’ve fulfilled a childhood ambition and have something I’m very proud of. It’s also pretty unusual these days to end up with a binary where you can say pretty much what every single byte is doing and the story of how it got there. But on the other hand - I now have an answer for why I don’t code in assembly: It’s because I value (what’s left) of my sanity! The thing is, in order to write code like this you have to start thinking like the machine itself. You have to visualise the registers and the status flags flapping away, graphics as lines of bits slotted into strange orders, loops and conditionals as binary logic and so on. Getting this close to the hardware definitely brought about a greater sense of attachment to the hardware of my childhood, and it’s easy to see why assembly coders and sceners get so passionate about it. That said, I’m in no hurry to start re-writing my body of work in assembly! The projects I really enjoy are those that give me an excuse to learn something for the sheer hell of it, and to slow down a little from the ever-increasing velocity and demands of the modern work world. Going back to Z80 code is probably about the furthest I could have taken this, short of going into hardware hacking. I found it at times an intriguing puzzle, often a frustrating exercise that nearly had me throwing in the towel at several stages. This project has certainly taken the longest to go from the “idea” stage of any given feature to any kind of meaningful output. True, I didn’t spend every day of the last year working on it - my actual coding time was probably only a few hours over a couple of evenings a week. But I’ve certainly been thinking about it and pondering it most days (as my dogs will attest). The biggest breakthroughs and “aha!” moments usually didn’t come from behind the keyboard; they came from scribbles in my notebook and thinking about processor states while doing something unrelated. It has however given me massive appreciation and respect for the coders who pull this stuff off and make it look easy. And that goes double for those kids and bedroom coding superstars who managed all of this back in the 80s, and had to work it all out by experiment themselves. I only managed to get this far because of numerous books, online tutorials, GitHub repositories with sample code, YouTube videos… I can’t imagine how much longer this would have all taken me if the only resources I had were my Spectrum, a cassette tape recorder and a notepad. So, as I draw a line under this project - for now! - I raise a glass, and in the words of h0ffman: “Shout out to the hackers, graphicians and protrackers.”

yesterday • 1 votes
CalVer 26.0: 10th Anniversary Edition

A decade ago, a little bit of history was made. I didn't realize it, but a colleague made a great point, one of those real mind-changing points that seem too obvious to admit same-day. But, the next day, calver.org was born. At the time my team maintained the Python infrastructure for eBay and PayPal, and we were stuck deciding whether we were really ready for a "major" 1.0 release. Semantic Versioning was the only game in town and "major" means "big", right?! Thankfully, a wiser colleague mentioned: Ubuntu and Twisted don't struggle with version number debates. They slap a date on it and keep shipping. In fact, their date-based versions were even better because you always knew where it stood, in terms of updatedness and support. The only problem is that no one really knew about it. Somehow, this problem solving versioning alternative, arguably as old as history itself, had gone nameless for millenia, conspiring to make me feel foolish in an office meeting. Never again! Ten years of adoption Fast forward 10 years, we've seen CalVer adopted by Apple, Nvidia, JetBrains, and countless others. (We have a timeline!) The site may have more inbound links than any other project of mine. Apple made the biggest jump, at WWDC 2025: iOS went from 18 to 26 macOS from 15 to 26 watchOS from 11 to 26 and visionOS from 2 to 26 All landing on one, consistent number like a car's model year. I still remember the texts from the Venn diagram fanbase of my friends who love Apple and reasonable versioning. No such texts from when NVIDIA announced calendar versions across the GPU Operator, RAPIDS, and its monthly NGC containers, but still very cool. Open source, too: Home Assistant, pip, CockroachDB, and yt-dlp all ship on dates, with plenty more on the users page. The conversation even reached the language core; PEP 2026 proposed versioning CPython as 3.YY, and it almost happened, too. And it's never too late, time marches on! Fixing the notation But I don't think I got every detail right from day 1. That's the main motivator for CalVer 26. It's high time to start righting a couple idiosyncratic token design choices, starting with some additions: Meaning Before 26.0 26.0 Full year YYYY YYYY Short year (6, 16) YY YY Zero-padded year (06, 16) 0Y 0Y Short month (1 ... 12) MM M Zero-padded month (01 ... 12) 0M 0M Short week (1 ... 52) WW W Zero-padded week (01 ... 52) 0W 0W Short day (1 ... 31) DD D Zero-padded day (01 ... 31) 0D 0D Seeing double First, the doubled letters. From the first version (16.6), MM and DD meant the unpadded month and day, which reads backwards to anyone who knows date formats (ISO 8601's YYYY-MM-DD, Java, moment.js, day.js), as some community members correctly pointed out. I was ready to flip them, until I checked what people actually use: most projects with a YY.MM.MICRO badge (conda, Twisted, Ansible's tooling) don't pad, and more than a dozen other version management tools (like bumpver and bump-my-version) implement the old meaning. So, it's too late to flip MM's meaning. Instead, 26.0 deprecates it and offers a more explicit and hopefully clearer option: M is the short month, 0M the padded one, and MM is a technically-retired synonym for M. In case you're wondering, the explicit 0M was me being overinspired by Ubuntu's approach, perhaps: 6.06 pads its month but not its year, and YY.0M says exactly that. To pad or not to pad I think it's worth a detour into why padding is even a thing anyways. It's become important now that new ecosystems have emerged that enforced SemVer formatting semantics, and I wanted clear guidance about on the spec site. SemVer forbids leading zeros outright, so Cargo rejects 26.04.0 and Go modules reject v26.04.0. Even Python's packaging spec normalizes leading zeros away, so you can tag 2026.08.19 if you want, but PyPI will still show 2026.8.19. NVIDIA's GPU Operator docs put it this way: "Zero padding is omitted for month to be still compatible with semantic versioning." CalVer was always intended to drop in where SemVer was used. So 26.0 recommends unpadded (YYYY.M.D) as a sane "pure" default for software libraries. But libraries are not the only objects of versioning schemes. The exception is a version that becomes a filename, an image tag, or an object-store key that gets listed lexically. There, padding keeps 26.10 sorted after 26.09, which is why Ubuntu, NixOS, and NVIDIA's own NGC containers pad. More evidence of teams designing their versions. We love to see it. Our FAQ has a longer discussion of the padding issue, as well. Optional segments There was never any rule against them, but 26.0 makes optional trailing segments more explicit with square brackets. Now, yt-dlp's scheme can finally be written down: YYYY.0M.0D[.MICRO]. For the CalVer badges I could find on GitHub, they all stay valid for now. I've got a note on the deprecated spellings and a new copy-paste badge section for new ones. What else is new? It's always a great time to add more citations to the site. A spec changelog; the spec now versions itself: 16.6, 19.7, 26.0. A FAQ: breaking changes, same-day releases, and padding. The users page, rebuilt by category, with past users of note (schemes change; that's fine) and tooling. Case studies: Apple and NVIDIA in, yt-dlp replacing youtube-dl. Much of the thinking behind these changes happened in the GitHub issue tracker over the years, and 19 or so issues close with this release. That's where ideas for CalVer should go, so by all means, open an issue, and we'll get it sorted! In due time, of course. In closing, I can't believe I still love belaboring these numbers so much. Thanks to all (but especially Mark, Glyph, Hugo, issue reporters, translators, and maintainers) for the discussion, and ultimately making the most timely versioning system a timeless classic. See also 2016 announcement Designing a version My Yap on Why CalVer beats Semver

2 days ago • 1 votes
"You didn't do it right"

Four sincere attempts at OKRs, four failures, and every time: "you didn't do it right." Maybe the framework doesn't fit you -- so how do you find one that does?

2 days ago • 1 votes
📚 BoredReading

You seem to be enjoying this.

Join free to unlock everything.

Create free account

Already have an account? Sign in