{
    "version": "https://jsonfeed.org/version/1",
    "title": "retrocomputing ephemera",
    "description": "",
    "home_page_url": "https://z80.timholyoake.uk",
    "feed_url": "https://z80.timholyoake.uk/feed.json",
    "user_comment": "",
    "author": {
        "name": "Tim"
    },
    "items": [
        {
            "id": "https://z80.timholyoake.uk/hacking-the-pico-romwbw/",
            "url": "https://z80.timholyoake.uk/hacking-the-pico-romwbw/",
            "title": "Hacking the Pico RomWBW",
            "summary": "I was talking to Derek of Extreme Kits at the RC2014 Assembly 2.0 about having to underclock the Pico 2 for the MZ-80K and MZ-80A emulations in the Pico MZ. Derek has the opposite problem on the Pico RomWBW, as it doesn't run quite as quickly as a real RC2014.",
            "content_html": "<p>I was talking to Derek of <a href=\"https://extkits.co.uk/\">Extreme Kits</a> at the RC2014 Assembly 2.0 about having to underclock the Pico 2 for the MZ-80K and MZ-80A emulations in the Pico MZ. Derek has the opposite problem on the <a href=\"https://extkits.co.uk/product/pico-romwbw/\">Pico RomWBW</a>, as it doesn't run quite as quickly as a real RC2014.</p>\n<p>There are a couple of obvious differences between the two systems, the first being that the MZ-80s run their Z80 at 2MHz, whereas the RC2014 runs at 7.37MHz. The other obvious difference is the Z80 emulation. The Pico RomWBW uses Gabriel Gambetta's libz80, whereas Pico MZ uses Nicolas Allemand's superzazu.</p>\n<p>When I first started experimenting with the Pico MZ I was using libz80 too, but fairly quickly replaced it with superzazu as I needed something that passed all of the zexall / zexdoc tests. It also had the benefit of using the MIT license, which is how I wanted to license Pico MZ.</p>\n<p>What I've never done is benchmark the two cores. As both have very similar interfaces, it's straightforward to experiment with changing them in Pico RomWBW<sup class=\"footnote\" id=\"fnref-1\"><a href=\"#fn-1\" rel=\"footnote\">1</a></sup>. As I'd noted previously, I'd also <a href=\"https://z80.timholyoake.uk/the-square-root-of-32-is-not-4-02/\">forked and bug fixed a copy of libz80</a> to correct some erroneous behaviour when running the Digital Research CBASIC compiler on Derek's RC2040.</p>\n<p>Using my standard prime number benchmark, these were the results I got with the three z80 cores I tried and on a real RC2014<sup class=\"footnote\" id=\"fnref-2\"><a href=\"#fn-2\" rel=\"footnote\">2</a></sup>.</p>\n<figure>\n<table>\n<tbody>\n<tr>\n<td><strong>Core</strong></td>\n<td><strong>Time (seconds) to generate </strong><br><strong>primes &lt; 10,000 </strong></td>\n<td><strong>Percentage improvement </strong><br><strong>vs standard libz80</strong></td>\n</tr>\n<tr>\n<td>Standard libz80</td>\n<td>213s<sup class=\"footnote\" id=\"fnref-3\"><a href=\"#fn-3\" rel=\"footnote\">3</a></sup></td>\n<td>-</td>\n</tr>\n<tr>\n<td>My libz80 fork</td>\n<td>197s</td>\n<td>7.5%</td>\n</tr>\n<tr>\n<td>Superzazu</td>\n<td>163s - 169s<sup class=\"footnote\" id=\"fnref-4\"><a href=\"#fn-4\" rel=\"footnote\">4</a></sup></td>\n<td>23.5% - 21%</td>\n</tr>\n<tr>\n<td>Real z80 on a RC2014</td>\n<td>143s</td>\n<td>33%</td>\n</tr>\n</tbody>\n</table>\n</figure>\n<p>All things being equal, the superzazu core seems to be more efficient than the libz80 core, even with the speed improvements I made in my fork. This naturally comes at a cost as libz80 is written in a way that's easier (for me) to understand the code.</p>\n<hr>\n<ul>\n<li><sup class=\"footnote\" id=\"fnref-1\"><a href=\"#fn-1\" rel=\"footnote\">1</a></sup> Or for that matter, in Pico MZ.</li>\n<li><sup class=\"footnote\" id=\"fnref-2\"><a href=\"#fn-2\" rel=\"footnote\">2</a></sup> All benchmarks are unfair, and this is more unfair than most, as it's a single algorithm rather than a suite of tests!</li>\n<li><sup class=\"footnote\" id=\"fnref-3\"><a href=\"#fn-3\" rel=\"footnote\">3</a></sup> As the standard libz80 lacks the big fix that impacts the correctness of the program when compiled with CBASIC, this time is for generating 1,231 almost correct prime numbers, rather than 1,229 correct prime numbers.</li>\n<li><sup class=\"footnote\" id=\"fnref-4\"><a href=\"#fn-4\" rel=\"footnote\">4</a></sup> The exact time achieved depends on how often the Pico RomWBW main loop allows device interupts to be processed vs z80 instructions executed.</li>\n</ul>\n<p> </p>",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2026-10-21T11:50:03+01:00",
            "date_modified": "2026-10-25T15:57:10+00:00"
        },
        {
            "id": "https://z80.timholyoake.uk/pico-mz-release-3-1/",
            "url": "https://z80.timholyoake.uk/pico-mz-release-3-1/",
            "title": "Pico MZ Release 3.1",
            "summary": "This is the first release of Pico MZ in 2026. It fixes a number of problems that I've found since the 3.0 release last November and introduces the ability to read and write multi-block BSD (BASIC sequential data) files. For ease of use (and code maintenance) it combines the MZ-80K,A&hellip;",
            "content_html": "<p><a href=\"https://github.com/psychotimmy/picomz-80k/releases/tag/3.1.1\">This is the first release of Pico MZ in 2026</a>. It fixes a number of problems that I've found since the 3.0 release last November and introduces the ability to read and write multi-block BSD (BASIC sequential data) files.</p>\n<p>For ease of use (and code maintenance) it combines the MZ-80K,A and 700 emulations into a single .uf2 file per Pico platform type when using a Pimoroni VGA demo base. In other words, one .uf2 file for the Pico and one for the Pico 2.</p>\n<p>There's a third .uf2 file that supports all three emulations for both of the RC2014 Pico and RP2040 VGA boards.</p>\n<p>The emulator type is selected at power on by holding down a button. Button 'A' is for the MZ-80A, 'B' or 'C' for the MZ-700. No button press at start up results in the emulator booting into MZ-80K mode.</p>\n<p>The most difficult piece of work was implementing multi-block data files. The sheer number of different ways each combination of Sharp MZ model and language tape approaches this is mind-bending. There's a note in the 1996 Sharp Users Club magazine Volume 16/3 referring to the development of SUPERCOPY that reads:</p>\n<p>\"This is where the fun starts! ... Sorting out these differences, and finding ways of accommodating them, has taken us the best part of the last three months, but we have succeeded ...\"</p>\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/75/2026-08-29-133919_1920x1080_scrot-1024x777.png\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/75/responsive/2026-08-29-133919_1920x1080_scrot-1024x777-xs.png 300w ,https://z80.timholyoake.uk/media/posts/75/responsive/2026-08-29-133919_1920x1080_scrot-1024x777-sm.png 480w ,https://z80.timholyoake.uk/media/posts/75/responsive/2026-08-29-133919_1920x1080_scrot-1024x777-md.png 768w\">\n<figcaption>The article explaining the many and varied differences between Sharp MZ data files carries on in this way for a few pages ...</figcaption>\n</figure>\n<p>The article goes on to explain the key differences in BSD file format between the machines and it's fortunate that the developers of SUPERCOPY did so, as it only(!) took me a couple of weeks to implement data file handling for the SP-5025, SA-5510 and S-BASIC dialects. There's more work to do - for example, the Knight's Wee Fortran compiler doesn't use any of the three formats I've implemented so far (and so still won't save Fortran source code to 'tape' on my emulator) but that will need to wait.</p>\n<p>It will need to wait not least because the code implementing cassette tape emulation was already unstructured and rather fragile before I started to implement BSD files. It's now even more unstructured and fragile. To carry on extending cassette data file handling and hopefully implement disk data files, the code desperately needs refactoring. Definitely a winter job.</p>\n<p>Combining the source code for the MZ80-K/A and MZ-700 emulations has also thrown up other opportunities for simplification and refactoring, particularly around keyboard and memory handling.</p>\n<p>Along the way to the 3.1 release I've found weirdness in busy_wait_us() and/or TinyUSB that makes using the Pico SDK 2.3.0 a non-starter for the time being. I've rationalised the way the emulator is slowed down to match real hardware by more closely linking timing delays to the number of Z80 t-states that have elapsed. I've smoothed out yet more issues in keyboard handling - the issue log for the project reads like a long lament on the differences between USB and Sharp MZ keyboards. Memory dump handling has been improved and bugfixed (again). Saving programs to sd card works more reliably. The documentation has been updated.</p>\n<p>That will definitely do for the time being. The emulator is not perfect (far from it), but it's good enough for most of my purposes and hopefully yours too, should you decide to try it.</p>\n<p>The new and improved Pico MZ will get its public debut at the <a href=\"https://z80.timholyoake.uk/pico-mz-at-the-rc2014-assembly-2-0/\">RC2014 assembly </a>at the end of September. I hope to see you there.</p>\n<h5>Update 20th September 2026</h5>\n<p><a href=\"https://github.com/psychotimmy/picomz-80k/releases/tag/3.1.1\">Pico MZ release 3.1.1 is now available</a>. There are a couple of bugs resolved that impacted keyboard handling on some games (for example, the MZ-700 and MZ-80K versions of Space Panic).</p>\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/75/20250110_093313-1024x642.jpg\" alt=\"A RC2014 backplane 8 holding a RP2040 VGA terminal card. There's a passive buzzer attached to gpio 23 via the expansion header. The card is running the Pico MZ-80K emulator.\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/75/responsive/20250110_093313-1024x642-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/75/responsive/20250110_093313-1024x642-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/75/responsive/20250110_093313-1024x642-md.jpg 768w\">\n<figcaption>A RC2014 backplane 8 holding a RP2040 VGA terminal card, running as the Pico MZ emulator.</figcaption>\n</figure>",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2026-09-02T16:04:29+01:00",
            "date_modified": "2026-10-25T16:24:22+00:00"
        },
        {
            "id": "https://z80.timholyoake.uk/pico-mz-at-the-rc2014-assembly-2-0/",
            "url": "https://z80.timholyoake.uk/pico-mz-at-the-rc2014-assembly-2-0/",
            "title": "Pico MZ at the RC2014 Assembly 2.0",
            "summary": "When the RC2014 assembly 2.0 was announced for Saturday 26th September 2026 at The National Museum of Computing, I decided to sign up as an exhibitor to give the first public outing of my Pico MZ Emulator. I had an enjoyable time at the first assembly last year. Everyone was&hellip;",
            "content_html": "<p>When the <a href=\"https://www.eventbrite.co.uk/e/rc2014-assembly-20-tickets-1992559683652\">RC2014 assembly 2.0</a> was announced for Saturday 26th September 2026 at The National Museum of Computing, I decided to sign up as an exhibitor to give the first public outing of my <a href=\"https://z80.timholyoake.uk/the-pico-mz-80k/\">Pico MZ Emulator</a>. I had an enjoyable time at the first assembly last year. Everyone was very friendly, so it seemed less intimidating than diving into the deep end at another retrocomputing event.</p>\n<p>The Pico MZ is RC2014 adjacent for a number of reasons, not least that it will run happily on a <a href=\"https://rc2014.co.uk/modules/pi-pico-vga-terminal/\">Pi Pico VGA Terminal</a> with an SD card backpack or on a <a href=\"https://rc2014.co.uk/modules/rp2040-vga-terminal/\">RP2040 VGA Terminal</a> card.</p>\n<p>My plan is to show it running '<a href=\"https://z80.timholyoake.uk/the-valley-at-42/\">The Valley</a>' (and other programs) alongside a real MZ-700. I'm intending to bring along my own RC2014 also running 'The Valley' - a port I created from my Sharp MZ version a little while ago. It was an interesting exercise getting it to run on a VT100 terminal emulator rather than a memory mapped display, but the code remains true to the original.</p>\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/74/20260807_160518-1024x696.jpg\" alt=\"A Sharp MZ-700 with a Pico MZ (a repurposed RC2014 RP2040 VGA Terminal card).\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/74/responsive/20260807_160518-1024x696-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/74/responsive/20260807_160518-1024x696-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/74/responsive/20260807_160518-1024x696-md.jpg 768w\">\n<figcaption>Getting ready - a Sharp MZ-700, a Pico MZ on a repurposed RC2014 RP2040 VGA Terminal card plus handouts.</figcaption>\n</figure>\n<p>I'm currently trying to make sure that everything works properly and that I have a foolproof system<sup class=\"footnote\" id=\"fnref-1\"><a href=\"#fn-1\" rel=\"footnote\">1</a></sup> to ensure that I don't leave a vital cable or three behind at home in Devon.</p>\n<p>I look forward to seeing fellow RC2014 and retrocomputing enthusiasts at the Assembly.</p>\n<h5>Update 30/09/2026</h5>\n<p>I made it to the Assembly and had a very enjoyable time meeting everyone and showing off the Pico MZ. It was also a great event for hatching my winter plans to extend the Pico MZ, tinker with the emulator on the Pico RomWBW to see if I can make it run more quickly and generally think of dozens of possible new projects.</p>\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/74/1000002773-1024x768.jpg\" alt=\"The Pico MZ and Sharp MZ-700 both playing the 1982 game Painful Man.\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/74/responsive/1000002773-1024x768-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/74/responsive/1000002773-1024x768-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/74/responsive/1000002773-1024x768-md.jpg 768w\">\n<figcaption>The Pico MZ and a Sharp MZ-700 playing the Painful Man game. In the middle is an RC2014 running CP/M which I used to show my port of \"The Valley\" during the afternoon session.</figcaption>\n</figure>",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2026-08-07T16:19:55+01:00",
            "date_modified": "2026-10-25T16:24:56+00:00"
        },
        {
            "id": "https://z80.timholyoake.uk/advent-of-code-2020-in-fortran-77-mostly/",
            "url": "https://z80.timholyoake.uk/advent-of-code-2020-in-fortran-77-mostly/",
            "title": "Advent of Code 2020 in Fortran 77 (mostly)",
            "summary": "It's rained nearly every day since the start of 2026 in Devon. On January 27th the River Otter reached it's highest recorded level. The picture below was taken from the footbridge in Ottery St Mary that afternoon. The river was around a metre off its peak at this point, but&hellip;",
            "content_html": "\n<p>It's rained nearly every day since the start of 2026 in Devon. On January 27th the River Otter reached it's highest recorded level. The picture below was taken from the footbridge in Ottery St Mary that afternoon. The river was around a metre off its peak at this point, but was still a couple of metres deeper than normal and over twice as wide.</p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/73/1000002643-1024x768.jpg\" alt=\"The River Otter running very high and fast. In the background is the Otter Mill, now converted into apartments.\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/73/responsive/1000002643-1024x768-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/73/responsive/1000002643-1024x768-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/73/responsive/1000002643-1024x768-md.jpg 768w\"><figcaption>The River Otter, Ottery St Mary, 27th January 2026.</figcaption></figure>\n\n\n\n<p>All the bad weather has meant that it's been difficult to do very much outside, so I've been entertaining myself working through 2020's Advent of Code using (mostly) Fortran 77. I finished the final puzzle this afternoon and that appears to have signalled a change in the weather for tomorrow! My <a href=\"https://github.com/psychotimmy/aoc2020\">solutions and commentary are in this repository</a>, so I don't intend to go into a blow-by-blow discussion here.</p>\n\n\n\n<p>I think the solutions that I'm happiest with are those for day 19 and day 24. Day 19 was fun, as I realised early on that the puzzle was about parsing a context free grammar. The design decisions I took in part 1 made part 2 straightforward. It's good that Fortran 77 doesn't have a regular expression capability as standard, because although an approach based on regex would have worked for part 1 it would not have been much fun trying to get part 2 to work that way.</p>\n\n\n\n<p>Day 24 required a little thinking before realising that a hex coordinate system was needed. Creating an implementation of the Hexagonal Efficient Coordinate System was fun. The code isn't the most compact I could have written but is very readable. The 'Life' algorithm required for part 2 was also interesting to write, even after implementing a 'Life' algorithm in 3D and 4D for day 11.</p>\n\n\n\n<p>The most frustrating puzzle was definitely that set for day 20. Part 1 wasn't too bad and I found a shortcut to find the four corners of the jigsaw without having to completely assemble it. Part 2 wasn't so forgiving and is over 450 lines of code! It's fortunate that the tiles all have unique edge matches with other tiles, otherwise I'd still be writing a solution now. I did manage to take liberties with the now deprecated EQUIVALENCE statement to map 2D grids onto 1D arrays and also use a DATA statement, so I certainly stretched Fortran 77 to the maximum.</p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/73/2026-02-16-172738_1920x1080_scrot-1024x777.png\" alt=\"The Advent of Code 2020 calendar completed. There's a sea monster swimming in the top right corner and what looks like a black hole headed towards me from the bottom right.\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/73/responsive/2026-02-16-172738_1920x1080_scrot-1024x777-xs.png 300w ,https://z80.timholyoake.uk/media/posts/73/responsive/2026-02-16-172738_1920x1080_scrot-1024x777-sm.png 480w ,https://z80.timholyoake.uk/media/posts/73/responsive/2026-02-16-172738_1920x1080_scrot-1024x777-md.png 768w\"><figcaption>50 stars achieved for Advent of Code 2020. I'm only 5 and a bit years late ...</figcaption></figure>\n\n\n\n<p>With the exception of dipping into recursion for a couple of problems, all of the code I wrote should work happily on any 32 bit compiler (such as Sun's) of the early 80s. I suspect even the recursion will work on the Sun Fortran compiler if the Fortran 90 RECURSIVE keyword is omitted.</p>\n\n\n\n<p>One thing I was asked about while working through the puzzles was why I use STOP 8 to indicate a serious failure has happened. It's simply that STOP 8 was the most frequent error message that the PAFEC DOGS computer aided design system spat out when something had gone horribly wrong! DOGS was the first commercial software suite that I ever wrote code for, so that error code will stay with me forever.</p>\n\n\n\n\n",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2026-02-16T21:16:12+00:00",
            "date_modified": "2026-02-17T03:08:39+00:00"
        },
        {
            "id": "https://z80.timholyoake.uk/building-a-pico-romwbw/",
            "url": "https://z80.timholyoake.uk/building-a-pico-romwbw/",
            "title": "Building a Pico RomWBW",
            "summary": "At the end of September I attended the first RC2014 assembly at The National Museum of Computing. I'd gone with strict instructions not to buy any more computers, but I couldn't resist buying a Pico RomWBW kit with a wooden case from Derek of Extreme Kits. Having moved house in&hellip;",
            "content_html": "\n<p>At the end of September I attended the first RC2014 assembly at The National Museum of Computing. I'd gone with strict instructions not to buy any more computers, but I couldn't resist buying a Pico RomWBW kit with a wooden case from Derek of <a href=\"https://extkits.co.uk/\">Extreme Kits</a>. Having moved house in August, a holiday booked in October and Christmas rapidly approaching, it took me until the new year to get around to building it.</p>\n\n\n\n<p>The kit emulates a Z80 running <a href=\"https://github.com/wwarthen/RomWBW\">Wayne Warthen's RomWBW</a> software. This is something I've been meaning to try out for a while, and buying the Pico RomWBW kit seemed like a good way to do it.</p>\n\n\n\n<p>The build took me most of a day. I found the trickiest part was assembling the case. I managed to break a part of the base before I'd persuaded the front and back panels into it, but nothing so bad that a bit of glue couldn't fix. The thing I was most worried about before starting was soldering the micro SD card holder to the pcb, but my soldering technique is obviously better than I feared as it presented no real difficulty.</p>\n\n\n\n<p>Here's a few pictures of the build in progress.    </p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/72/Board1-1024x768.jpg\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/72/responsive/Board1-1024x768-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/72/responsive/Board1-1024x768-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/72/responsive/Board1-1024x768-md.jpg 768w\"><figcaption>First board - the scruffiest bit of soldering is probably that of the switch in the foreground. I managed to rip this off the board while assembling the case, so it's been soldered back better now!</figcaption></figure>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/72/Board2-1024x768.jpg\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/72/responsive/Board2-1024x768-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/72/responsive/Board2-1024x768-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/72/responsive/Board2-1024x768-md.jpg 768w\"><figcaption>Front panel leds and switches. The soldering on the right hand side is for 18 1K resistors on the reverse. This is hidden by the front panel of the case when assembled. </figcaption></figure>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/72/PicoRomWBW-pcb-built-1024x768.jpg\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/72/responsive/PicoRomWBW-pcb-built-1024x768-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/72/responsive/PicoRomWBW-pcb-built-1024x768-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/72/responsive/PicoRomWBW-pcb-built-1024x768-md.jpg 768w\"><figcaption>The two boards are joined together by a right-angled 16 pin header at the bottom right hand side. </figcaption></figure>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/72/PicoRomWBW-completed-1024x768.jpg\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/72/responsive/PicoRomWBW-completed-1024x768-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/72/responsive/PicoRomWBW-completed-1024x768-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/72/responsive/PicoRomWBW-completed-1024x768-md.jpg 768w\"><figcaption>Case persuaded into position and the Pico RomWBW worked first time. You can just see the edge of my Pico MZ-700 in the background.  </figcaption></figure>\n\n\n\n<p>I chose to build the Pico RomWBW using a Pico 2 I had in my 'cardboard box of doomed projects', as I remember Derek saying that it was a bit of a struggle to fit all of the software into the more limited RAM on an original Pico. I think this decision future-proofs my 'investment' (!) </p>\n\n\n\n<p>Flashing the Pico 2 with the correct image and setting up the SD card was straightforward. The system booted correctly first time. I love the simulated disk noises it makes when it's running.</p>\n\n\n\n<p>I'm now playing with various disk images from the RomWBW repository while trying to get my head around the very impressive documentation supplied by Wayne. There's a lot to look at - it's an incredible piece of work.</p>\n\n\n\n<p>I've also built my own .uf2 file for the kit using <a href=\"https://github.com/ExtremeElectronics/RC2040-ROMWBW\">Derek's source code</a> and <a href=\"https://z80.timholyoake.uk/the-square-root-of-32-is-not-4-02/\">the version of libz80 I fixed a couple of years back</a> so that it calculates square roots correctly when running CBASIC. I really need to get around to pushing my fixes back to the original author, but it's not straightforward as it's moved on somewhat since I forked it.  </p>\n\n\n\n<p>This was a good way to start 2026!  </p>\n\n\n\n\n",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2026-01-07T15:05:32+00:00",
            "date_modified": "2026-01-07T15:05:32+00:00"
        },
        {
            "id": "https://z80.timholyoake.uk/advent-of-code-2025-in-fortran-77-mostly/",
            "url": "https://z80.timholyoake.uk/advent-of-code-2025-in-fortran-77-mostly/",
            "title": "Advent of Code 2025 in Fortran 77 (mostly)",
            "summary": "This year's Advent of Code was reduced to 12 days of puzzles. Thankfully, as I managed to complete the last puzzle I had outstanding (Day 10, part 2) a couple of days ago. In previous years I've skipped puzzles that took me a lot of effort, thinking that I'd have&hellip;",
            "content_html": "<p>This year's <a href=\"https://adventofcode.com/\">Advent of Code</a> was reduced to 12 days of puzzles. Thankfully, as I managed to complete the last puzzle I had outstanding (Day 10, part 2) a couple of days ago. In previous years I've skipped puzzles that took me a lot of effort, thinking that I'd have the time to catch up later. Of course, I never did. So this is the first year I've managed to complete the whole problem set - and before Christmas to boot.</p>\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/71/2025-12-24-104921_1920x1080_scrot-1024x688.png\" alt=\"The Advent of Code 2025 calendar. It shows the Elves' factory under the North Pole with Santa flying across the top in his sleigh. It is animated ASCII art.\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/71/responsive/2025-12-24-104921_1920x1080_scrot-1024x688-xs.png 300w ,https://z80.timholyoake.uk/media/posts/71/responsive/2025-12-24-104921_1920x1080_scrot-1024x688-sm.png 480w ,https://z80.timholyoake.uk/media/posts/71/responsive/2025-12-24-104921_1920x1080_scrot-1024x688-md.png 768w\">\n<figcaption>24 gold stars and a decorated North Pole in time for Christmas.</figcaption>\n</figure>\n<p>I used Fortran 77 this year and stuck to the standard fairly well. I resorted to recursion on a couple of days as writing iterative solutions was too painful to contemplate. I also used bitwise XOR and AND to help solve Day 10's puzzles.</p>\n<p>Back in the 1980s when I was porting Fortran code to various minicomputers and workstations there were f77 compilers that supported both of these extensions, but they didn't form part of the standard until Fortran 90 was ratified. I remember one instance of almost being held hostage over a weekend by a customer who was getting a crash in our software due to an unexpected recursion in some Fortran code, until we discovered late on the Friday afternoon where the problem was and fixed it. For anyone interested, the computer (and compiler) in question was the Harris HCX<sup class=\"footnote\" id=\"fnref-1\"><a href=\"#fn-1\" rel=\"footnote\">1</a></sup>.</p>\n<p>My Fortran 77 is pretty rusty as I last used it professionally around 30 years ago. But I think it has improved since last year's Advent of Code. For example, I'm no longer using COMMON blocks to pass data between subroutines and functions! COMMON has it's use of course, but not in the relatively small programs Advent of Code requires. Rediscovering list directed i/o has helped reduce the complexity of puzzle input parsing too.</p>\n<p>I wrote notes each day as I solved the problems and these are <a href=\"https://github.com/psychotimmy/aoc2025\">in my repository with the code</a>, so I won't repeat them here. I was happiest with my solution for day 7. Just about every other solution I've seen since I finished (I don't go anywhere near the internet to avoid spoilers until I have) used recursion, but even for part 2 it's not necessary to get a well-performing piece of code. On my Pi4B, parts 1 and 2 combined need just 0.08s to run.</p>\n<p>The toughest day for me was undoubtedly Day 10. It was the first time I broke with the standard to use recursion, as well as the bitwise operators. The second part took a lot of thinking about, a number of long walks, lots of paper and pen followed by half a dozen aborted attempts at writing the code over several days until I managed to get it to work for the sample data. Even then the puzzle data had a nasty surprise hidden in it that took a quick hack to work around.</p>\n<p>For posterity, here is the (final) pen and paper version of the algorithm I devised:</p>\n<figure class=\"post__image\"><img loading=\"lazy\" style=\"width: 768px; height: auto;\" src=\"https://z80.timholyoake.uk/media/posts/71/20251223_150953-768x1024.jpg\" alt=\"A handwritten piece of pseudo-pseudocode that details my approach to Day 10 part 2.\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/71/responsive/20251223_150953-768x1024-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/71/responsive/20251223_150953-768x1024-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/71/responsive/20251223_150953-768x1024-md.jpg 768w\">\n<figcaption>Day 10 part 2 handwritten pseudo - pseudocode.</figcaption>\n</figure>\n<p>Having looked at other Day 10 solutions since, I know that it would never have occurred to me to either use a 3rd party library like many Pythonistas seemed to do, or attempt (what I regard as) the heavy mathematics of Gaussian elimination<sup class=\"footnote\" id=\"fnref-2\"><a href=\"#fn-2\" rel=\"footnote\">2</a></sup>. However, I've since noticed that someone else came up with a very similar approach to mine several days before I did - and has helpfully provided <a href=\"https://www.reddit.com/r/adventofcode/comments/1pk87hl/2025_day_10_part_2_bifurcate_your_way_to_victory/\">a tutorial and a proof for the method</a>.</p>\n<p>Last year I wrote a quick and dirty insertion sort to help with a couple of the problems. I used the same algorithm again but it really came unstuck against the 500,000+ items that required sorting on Day 8<sup class=\"footnote\" id=\"fnref-3\"><a href=\"#fn-3\" rel=\"footnote\">3</a></sup>. I hit a similar time sink on Day 9, but this time there were *only* 120,000+ items to sort. As I've had some free time since I finished this year's event I've played with a few more (non-recursive) sorting algorithms. Here are the results ... unsurprisingly, the heapsort algorithm wins out every time!</p>\n<figure>\n<table>\n<thead>\n<tr>\n<th>Puzzle <br>(hardware)</th>\n<th class=\"align-center\" data-align=\"center\">Insertion Sort<br>O(n<sup>2</sup>)</th>\n<th class=\"align-center\" data-align=\"center\">Bubble Sort<br>O(n<sup>2</sup>)</th>\n<th class=\"align-center\" data-align=\"center\">'Optimised' <br>Bubble Sort<br>O(n<sup>2</sup>)</th>\n<th class=\"align-center\" data-align=\"center\">Heap Sort<br>O(n log n)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Day 8, part 1 <br>(Pi 5)</td>\n<td class=\"align-center\" data-align=\"center\">68s</td>\n<td class=\"align-center\" data-align=\"center\">482s</td>\n<td class=\"align-center\" data-align=\"center\">492s</td>\n<td class=\"align-center\" data-align=\"center\">0.09s</td>\n</tr>\n<tr>\n<td>Day 8, part 1 <br>(Pi 4B)</td>\n<td class=\"align-center\" data-align=\"center\">348s</td>\n<td class=\"align-center\" data-align=\"center\">1,180s</td>\n<td class=\"align-center\" data-align=\"center\">1,190s</td>\n<td class=\"align-center\" data-align=\"center\">0.27s</td>\n</tr>\n<tr>\n<td>Day 8, part 1<br>(Pi 1B)</td>\n<td class=\"align-center\" data-align=\"center\">14,725s</td>\n<td class=\"align-center\" data-align=\"center\">-</td>\n<td class=\"align-center\" data-align=\"center\">-</td>\n<td class=\"align-center\" data-align=\"center\">5.7s</td>\n</tr>\n</tbody>\n</table>\n<figcaption>All hardware running Debian Trixie (Raspberry Pi OS) with gcc (gfortran) 12.2.0</figcaption>\n</figure>\n<p>I enjoyed myself more this year than previously, mostly due to the reduced number of problems to solve and the posts from the community of Mastodon 'Adventers' all solving the problems in their own way across multiple languages<sup class=\"footnote\" id=\"fnref-4\"><a href=\"#fn-4\" rel=\"footnote\">4</a></sup>.</p>\n<p>Thank you to Eric Wastl and your team for the puzzles and I hope that there will be a 2026 edition in a little over eleven month's time!</p>\n<hr>\n<ul>\n<li><sup class=\"footnote\" id=\"fnref-1\"><a href=\"#fn-1\" rel=\"footnote\">1</a></sup> There appears to be remarkably little information on the internet about the Harris HCX machines. We had the same software running on the Harris MCX workstation (and about 20 other minicomputers and workstations) without it (or them) complaining about this coding error.</li>\n<li><sup class=\"footnote\" id=\"fnref-2\"><a href=\"#fn-2\" rel=\"footnote\">2</a></sup> When I was a computer science undergraduate in the 1980s, I used to joke that computer scientists were 10th rate mathematicians and that mathematicians were 10th rate computer scientists.</li>\n<li><sup class=\"footnote\" id=\"fnref-3\"><a href=\"#fn-3\" rel=\"footnote\">3</a></sup> The book 'Algorithms', by Robert Sedgewick, published in 1983 suggests that a sort of 50 items is 'small', 500 items 'not too large' and 5,000 items is 'moderately large'.</li>\n<li><sup class=\"footnote\" id=\"fnref-4\"><a href=\"#fn-4\" rel=\"footnote\">4</a></sup> According to the data from the unofficial survey, <a href=\"https://jeroenheijmans.github.io/advent-of-code-surveys/\">five people used Fortran this year</a>. We are a hardy breed.</li>\n</ul>",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2025-12-24T15:58:59+00:00",
            "date_modified": "2026-10-25T16:37:01+00:00"
        },
        {
            "id": "https://z80.timholyoake.uk/pico-mz-700-first-release/",
            "url": "https://z80.timholyoake.uk/pico-mz-700-first-release/",
            "title": "Pico MZ-700 – First release",
            "summary": "When I first started thinking about writing an emulator for the Sharp MZ-80K in September 2024, I decided that I was only going to attempt that model and no more. 15 months later (and a surprising RetroChallenge 2024/10 win)[^1] and here I am with a MZ-80A and MZ-700 emulator as&hellip;",
            "content_html": "<p>When I first started thinking about writing an emulator for the Sharp MZ-80K in September 2024, I decided that I was only going to attempt that model and no more. 15 months later (<a href=\"https://www.retrochallenge.org/2025/10/rc202410-resultsless-than-year-late.html\">and a surprising RetroChallenge 2024/10 win</a>)<sup class=\"footnote\" id=\"fnref-1\"><a href=\"#fn-1\" rel=\"footnote\">1</a></sup> and here I am with a MZ-80A and MZ-700 emulator as well. Never say never, I suppose.</p>\n<p>The code is scruffier than I'd like it to be, but it does seem to work reasonably well. The main changes / additions compared to the MZ-80K and MZ-80A emulators were:</p>\n<ul>\n<li><strong>Colour.</strong> The VGA module needed to be upgraded to cope with the 8 colours available. This was easier to achieve than I initially thought.</li>\n<li><strong>512, rather than 256 characters.</strong> The first 256 characters are dealt with in the same way as the earlier MZs, the second character set is only accessible through POKEs when S-BASIC is running. These characters are flagged using one of the spare bits in the colour VRAM and are dealt with at the same time as setting the colour information. The clunky way in which the second character set is handled in software has all the hallmarks of a last minute hardware addition!</li>\n<li><strong>USB keyboard -&gt; Sharp keyboard mapping.</strong> Different again to the MZ-80A and MZ-80K. There are also five function keys to deal with (and for backward compatibility reasons with the early MZ emulators I've mapped USB F5 - F9 onto the Sharp's F1 - F5).</li>\n<li><strong>Banked RAM. </strong>This is implemented differently to the method used on the MZ-80A (of course). It's split into two banks - one of 4K and the other 12K. The 4K bank can be used to replace the monitor ROM at address 0x0000, the 12K bank can be used to replace the VRAM, devices and other ROMs between addresses 0xD000 and 0xFFFF. Each bank works independently and are 'all or nothing' - the bank is either active or inactive. Most software I've found only ever seems to use the 4K RAM bank. I guess that's not too surprising given that using the 12K bank means that you lose access to the VRAM and devices!</li>\n<li><strong>Sound.</strong> This took a while to figure out. On the MZ-80K and A, address 0xE008 is used purely for outputting sounds. The note frequency (pitch) is stored as a 16 bit divider for a counter running at 1Mz on the internal 8253. The length of the note is determined by the value stored in the counter multiplied by another value to determine the tempo. The note is played for as long as it takes for the counter to reach zero, by setting and resetting the least significant bit of 0xE008. My implementation was simple - every time E008 was accessed I simply decremented its value. This isn't good enough on the MZ-700 as E008 is shared by the optional joystick(s), making the other bits of the address significant. The counter frequency is slightly different too. A fix seemed trivial (as I'm not currently emulating joysticks) - alternating the return value of the function to read E008 between 0xFF and 0xFE rather than decrementing it. But as I have a delay in this routine to slow down the Pico, that method didn't work properly for rest notes! Much hair pulling later and I have a solution that only triggers the delay in rdE008() if the counter is active. Solo Software's 'Demon Driver' and Zat Software's 'Painful Man' were invaluable in making sure that I'd got this right.</li>\n</ul>\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/70/20251126_173502-1024x519.jpg\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/70/responsive/20251126_173502-1024x519-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/70/responsive/20251126_173502-1024x519-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/70/responsive/20251126_173502-1024x519-md.jpg 768w\">\n<figcaption>Painful Man. Less painful than tracking down the sound/joystick issue and devising a fix.</figcaption>\n</figure>\n<p>I took the opportunity to clean up some pieces of code that also affect the MZ-80K and MZ-80A emulation, so I needed to put the emulator through regression testing and benchmarking. With the exception of the RC2014 VGA boards running as a MZ-80K<sup class=\"footnote\" id=\"fnref-2\"><a href=\"#fn-2\" rel=\"footnote\">2</a></sup>, all of the MZ variants are within +/-0.32% of the run time on a real machine when tested with a BASIC program that finds the primes up to 7,500.</p>\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/70/20251102_162751-1024x768.jpg\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/70/responsive/20251102_162751-1024x768-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/70/responsive/20251102_162751-1024x768-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/70/responsive/20251102_162751-1024x768-md.jpg 768w\">\n<figcaption>Benchmarking the Pico MZ-700. The emulator's screen is on the left hand side, the real machine is connected to the screen on the right hand side. Don't let the positions of the keyboards fool you!</figcaption>\n</figure>\n<p>The full benchmark results are in the <a href=\"https://github.com/psychotimmy/picomz-80k/tree/main/documentation\">project's documentation directory</a> if you're interested, along with completely re-written notes explaining how to install and use the Pico MZ as a MZ-80K, MZ-80A or MZ-700.</p>\n<p>The current release (v3.0.0 as of me writing this post) for Pico/Pico 2 on a Pimoroni VGA demo base and the Pico on RC2014 VGA cards <a href=\"https://github.com/psychotimmy/picomz-80k/releases/\">can be found in the usual place</a>.</p>\n<p>Have fun - and do let me know if you find any issues. (I guarantee that I will find a showstopper within an hour of hitting the 'publish' button ...)</p>\n<p>Anyway, I'm taking December off from working on the Pico MZ to have some fun with Advent of Code. Depending on the implementation difficulty of the problems, I may even try to solve a couple with S-BASIC.</p>\n<hr>\n<ul>\n<li><sup class=\"footnote\" id=\"fnref-1\"><a href=\"#fn-1\" rel=\"footnote\">1</a></sup> I believe that I'm the only person ever to come <a href=\"https://z80.timholyoake.uk/attributed-to-newton/\">dead last in the 10 liner BASIC competition</a> and win a RetroChallenge prize, a record that I'm certain will never be equaled.</li>\n<li><sup class=\"footnote\" id=\"fnref-2\"><a href=\"#fn-2\" rel=\"footnote\">2</a></sup> I'm really not sure why this is the case. The MZ-80A result on this board was perfect! It's around 3.5% too slow, but I'm reluctant just to increase the Pico's clock speed. My guess is there's an inefficiency somewhere that needs fixing for the MZ-80K emulation, so I will leave that to verison 3.0.x next year.</li>\n</ul>",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2025-11-30T11:23:00+00:00",
            "date_modified": "2026-10-25T16:53:49+00:00"
        },
        {
            "id": "https://z80.timholyoake.uk/pico-mz-700-progress/",
            "url": "https://z80.timholyoake.uk/pico-mz-700-progress/",
            "title": "Pico MZ-700 progress",
            "summary": "I'm making decent progress with adding MZ-700 emulation to the Pico MZ. As far as I can tell I have functionally correct code and I haven't broken the MZ-80K and MZ-80A emulations. I've even managed to update the documentation! I've limited testing to the Pico for the moment, as my&hellip;",
            "content_html": "\n<p>I'm making decent progress with adding MZ-700 emulation to the <a href=\"https://z80.timholyoake.uk/the-pico-mz-80k/\">Pico MZ</a>. As far as I can tell I have functionally correct code and I haven't broken the MZ-80K and MZ-80A emulations. I've even managed to update the documentation!</p>\n\n\n\n<p>I've limited testing to the Pico for the moment, as my Pico 2 with headers seems to have disappeared during our recent house move. I have a couple of Pico 2's without headers, so I need to find my soldering iron. Hopefully that will be soon so that I can get a first release out before <a href=\"https://adventofcode.com/2025/about\">Advent of Code 2025</a> starts.</p>\n\n\n\n<p>The last couple of days have been spent benchmarking the code so that the Pico MZ runs as close to the correct speed of the original hardware as possible. This has been much easier to achieve with the MZ-700 emulation as it's in a separate executable (.uf2). I've had to compromise a little with the MZ-80K/A code as these compile into a shared executable (80A mode is selected by holding down button A during power on).</p>\n\n\n\n<p>Even so, I'm happy with the results.</p>\n\n\n\n<figure><table><tbody><tr><td></td><td>MZ-80K</td><td>MZ-80A</td><td>MZ-700</td></tr><tr><td>Real hardware</td><td>618s</td><td>569s</td><td>358s</td></tr><tr><td>Pico mounted on a Pimoroni VGA board</td><td>618s</td><td>570s</td><td>358s</td></tr><tr><td>RC2014 Pico VGA and RC2014 RP2040 VGA cards </td><td>627s (1.5% slower)</td><td>563s (1% faster)</td><td>357s</td></tr></tbody></table><figcaption>Benchmark times for the original MZ hardware vs Pico MZ. Task is to generate all primes up to 7,500 using the Sieve of Erastothenes in BASIC. Identical source code used on all platforms with the standard Sharp BASIC interpreters. SP-5025 (MZ-80K), SA-5510 (MZ-80A) and 1Z-013B (MZ-700).</figcaption></figure>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/69/20251120_160702-1024x648.jpg\" alt=\"A screen showing the Prime numbers from 6983 to 7499, generated by the Sieve of Erastothenes. The output was produced by the Pico MZ emulating a Sharp MZ-80A, hence the green text on a black background. The task runs in 9m 30s, 1s slower than the real hardware.\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/69/responsive/20251120_160702-1024x648-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/69/responsive/20251120_160702-1024x648-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/69/responsive/20251120_160702-1024x648-md.jpg 768w\"><figcaption>Close enough! The Pico MZ (80A) generates the primes up to 7,500 just 1 second more slowly than real MZ-80A hardware. </figcaption></figure>\n\n\n\n<p>I've also been playing games on the MZ-700 emulator. Of course I have. I'm still as bad at them as I was 40 years ago.</p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/69/20251117_140049-1024x641.jpg\" alt=\"A game of space invaders being played on the Pico MZ (MZ-700). The aliens are a mixture of yellow and cyan. The score is 0 with a high score of 0. 3 bases are left.\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/69/responsive/20251117_140049-1024x641-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/69/responsive/20251117_140049-1024x641-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/69/responsive/20251117_140049-1024x641-md.jpg 768w\"><figcaption>Space Invaders on the Pico MZ (MZ-700).</figcaption></figure>\n\n\n\n<p>Now, where did I put my soldering iron?</p>\n",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2025-11-20T16:29:34+00:00",
            "date_modified": "2025-11-20T16:30:20+00:00"
        },
        {
            "id": "https://z80.timholyoake.uk/a-pico-mz-700/",
            "url": "https://z80.timholyoake.uk/a-pico-mz-700/",
            "title": "A Pico MZ-700 ?",
            "summary": "Autumn is here, so it means that the Caterham is SORNed until the spring, giving me time to tinker with some retrocomputing projects. The first project I'm attempting is to write a MZ-700 emulator for my Pico MZ platform. I've started off by creating a branch of the Pico MZ-80K/A&hellip;",
            "content_html": "\n<p>Autumn is here, so it means that the Caterham is SORNed until the spring, giving me time to tinker with some retrocomputing projects. The first project I'm attempting is to write a MZ-700 emulator for my Pico MZ platform.</p>\n\n\n\n<p>I've started off by creating a branch of the Pico MZ-80K/A code as many aspects will be similar. For the moment I'm creating a separate uf2 so that the code doesn't get overly complex. This means I have a new main program, VGA display module, keyboard handler and ROM definition file. Once I've got it working I may try to consolidate everything onto a single uf2, but to do that neatly there's quite a bit of code refactoring required. And re-testing of the MZ-80K/A code that already works. So for the moment I'm keeping the new code at arms length.</p>\n\n\n\n<p>The big differences with the 80K/A are that the MZ-700 uses an 8 colour display supporting 512 characters, has a faster clock, uses banked memory and has a different keyboard matrix to implement. There's also support for Sharp's QuickDisk and floppy disk formats, but I shall restrict myself to cassette tape emulation for the time being as that should be identical to the earlier MZ-80s. The MZ-731 had an inbuilt printer/plotter, but that's also not on my initial list of emulation targets.</p>\n\n\n\n<p>The first job I've attempted is to get colour output. This hasn't been too difficult to achieve and seems to work nicely on a Pico. I've not started over clocking the Pico to get the 3.5MHz Z80 emulation speed I need, so this is encouraging. I am concerned that I won't be able to over clock the Pico enough to get an accurate MZ-700 emulation, but fortunately the Pico 2 should have plenty of headroom.</p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/68/20251021_170630-1024x747.jpg\" alt=\"Sharp MZ-700 boot screen on the Pico MZ emulator\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/68/responsive/20251021_170630-1024x747-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/68/responsive/20251021_170630-1024x747-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/68/responsive/20251021_170630-1024x747-md.jpg 768w\"><figcaption>Sharp MZ-700 boot screen on the Pico MZ emulator</figcaption></figure>\n",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2025-10-21T17:12:06+01:00",
            "date_modified": "2025-10-21T17:29:20+01:00"
        },
        {
            "id": "https://z80.timholyoake.uk/fang-claw-and-knights-wee-fortran/",
            "url": "https://z80.timholyoake.uk/fang-claw-and-knights-wee-fortran/",
            "title": "Fang, Claw and Knight&#x27;s WEE FORTRAN",
            "summary": "I was recently sent a copy of Knight's WEE FORTRAN by Sharpworks who had rescued it from a tape belonging to HereBeDragons. There are a couple of references to it in issues 3 and 4 of the Knight's International Sharp User Group newsletters. In 1981 it retailed for £30+VAT and&hellip;",
            "content_html": "\n<p>I was recently sent a copy of Knight's WEE FORTRAN by <a href=\"https://bsky.app/profile/sharpworks.bsky.social\">Sharpworks</a> who had rescued it from a tape belonging to <a href=\"https://bsky.app/profile/heredragons.be\">HereBeDragons</a>. </p>\n\n\n\n<p>There are a couple of references to it in issues 3 and 4 of the Knight's International Sharp User Group newsletters. In 1981 it retailed for £30+VAT and Knight's were \"certain that KNIGHTS WEE FORTRAN will soon become as popular as our KNIGHT TAPE BASIC COMMANDER, KNIGHT DISK COMMANDER, and KNIGHT DIS-ASSEMBLER.\" Despite their certainty I'm not sure that it did become as popular as the other three titles. It definitely wasn't a tape that I'd seen before on a MZ-80K.</p>\n\n\n\n<p>Or ... had I seen it before? Some time ago I used the <a href=\"https://z80.timholyoake.uk/fortran-on-the-sharp-mz-700/\">MZ-700 RealFortran compiler</a> that had been distributed in German by a company called BBG. Knight's WEE FORTRAN probably pre-dates this version by a couple of years, but both are nearly identical. At the same time I'd also played with a compiler that introduced itself as SOSZ80. This would appear to be <strong>exactly</strong> the same piece of software as the Knight's WEE FORTRAN compiler, except for the screens identifying the software's producer.</p>\n\n\n\n<p>Software piracy was in its infancy in the early 1980s. Even so, it appeared to be affecting Knight's. Graham Knight's final word in issue 1 of their newsletter reads \"I have been surprised to see our programs running in three shops who did not buy them from us. Purchasers of our programs are reminded that they should not be copied for use on other user's computers. Perhaps those who are ripping off our programs would like to send some food for Fang and Claw our 'pets'.\"</p>\n\n\n\n<p>Assuming that Knight's wrote this compiler, it might appear that the SOSZ80 version is a direct unauthorised copy. The BBG tape is slightly different as my previous article notes, but it still looks as if it is a copy with a few patches, one of which removed the IRND (random integer) function.</p>\n\n\n\n<p>Case closed? Do Fang and Claw get their food? Well, perhaps not. One error message common to all three versions is \"OBJECT PROGRAM NOTHING !\" This message appears if you forget to compile your FORTRAN source before running it. The language used by this message is strange enough to a native English speaker (why not use something like NO EXECUTABLE FOUND) to suggest that the origin of the compiler might not have been Scotland after all.</p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/67/20250718_141433-1024x500.jpg\" alt=\"A Knight's WEE FORTRAN error message - OBJECT PROGRAM NOTHING !\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/67/responsive/20250718_141433-1024x500-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/67/responsive/20250718_141433-1024x500-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/67/responsive/20250718_141433-1024x500-md.jpg 768w\"><figcaption>Entering EDIT mode and typing &amp; deletes the current source code. ! exits to compiler mode, RUN has nothing to execute, so the error message OBJECT PROGRAM NOTHING ! is the result.</figcaption></figure>\n\n\n\n<p>Perhaps Knight's licensed it from elsewhere for the UK market - and perhaps BBG and SOSZ80 did likewise for theirs?</p>\n\n\n\n<p>The answer is lost somewhere in the mists of time ... unless, of course, you know differently! Please let me know if you can help solve this minor mystery from more than 40 years ago.     </p>\n\n\n\n<h2>Update 19/07/2025</h2>\n\n\n\n<p>The copy of WEE FORTRAN rescued by <a href=\"https://bsky.app/profile/sharpworks.bsky.social\">Sharpworks</a> has the real variable printing bug described in Knight's International User Group Newsletter 4. It's also referred to in the March 1983 (Vol. 3, issue 1) Sharp Users Club magazine. Although the compiler correctly stores and manipulates real variables, they are always displayed as 14087 by the WRITE statement and are not printed correctly.</p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/67/20250719_142642-1024x406.jpg\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/67/responsive/20250719_142642-1024x406-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/67/responsive/20250719_142642-1024x406-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/67/responsive/20250719_142642-1024x406-md.jpg 768w\"><figcaption>The unpatched WEE FORTRAN compiler always WRITEs 14087 for floating point variables.</figcaption></figure>\n\n\n\n<p>Fortunately the patch is simple to apply. It claims to correct the printing issue (but not when WRITE is used to display the variable on screen!) and also provides a '.F' format specifier allowing reals to be output in a 10 character wide field rounded to 3 decimal places.</p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/67/2025-07-19-161358_1920x1080_scrot-1024x751.png\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/67/responsive/2025-07-19-161358_1920x1080_scrot-1024x751-xs.png 300w ,https://z80.timholyoake.uk/media/posts/67/responsive/2025-07-19-161358_1920x1080_scrot-1024x751-sm.png 480w ,https://z80.timholyoake.uk/media/posts/67/responsive/2025-07-19-161358_1920x1080_scrot-1024x751-md.png 768w\"><figcaption>The patch code. USR(33) followed by USR(36) writes the patched compiler to tape.</figcaption></figure>\n\n\n\n<p>Even with this patch, WRITE (//,A,//) still sends 14087 to the screen, but using WRITE(//,A.F,//) gives a sensible result. I don't (yet) have a printer simulator for the Pico MZ-80K/A, so I can't check that the printer part of the patch works.</p>\n\n\n\n<figure class=\"post__image\"><img loading=\"lazy\" src=\"https://z80.timholyoake.uk/media/posts/67/20250719_162656-1024x553.jpg\" alt=\"\" sizes=\"(max-width: 48em) 100vw, 768px\" srcset=\"https://z80.timholyoake.uk/media/posts/67/responsive/20250719_162656-1024x553-xs.jpg 300w ,https://z80.timholyoake.uk/media/posts/67/responsive/20250719_162656-1024x553-sm.jpg 480w ,https://z80.timholyoake.uk/media/posts/67/responsive/20250719_162656-1024x553-md.jpg 768w\"><figcaption>The result. Note that WRITE (//,A,//) still produces 14087! I suppose half a patch is better than none ...</figcaption></figure>\n\n\n\n<p>Playing with this has also uncovered a bug in the Pico MZ-80K/A's tape handling. The FORTRAN compiler allows source code to be stored in tape data files with a block length of 256 bytes. If the source code is under 256 bytes, the file is written correctly to the SD card. If it is over 256 bytes, the write fails. I suspect this issue will also affect other multi-block files - for example, BASIC tape data files. The problem is now <a href=\"https://github.com/psychotimmy/picomz-80k/issues/64\">logged</a> and I will get around to fixing it in due course. </p>\n",
            "author": {
                "name": "Tim"
            },
            "tags": [
            ],
            "date_published": "2025-07-18T14:32:54+01:00",
            "date_modified": "2025-07-26T14:53:51+01:00"
        }
    ]
}
