Saturday, 27 January 2024

2023

The 2023 retrospective has been delayed a little...

Listing "what I did last year" is not now very appealing, but I'll try to keep up the tradition.

Programming, graphics

The year started with the release of Multipaint 2023 with Vic-20 modes and the beginnings of a large internal overhaul. Every export and import of native formats is handled through external scripts, and I hope to extend this idea to a few other facets of the software.

Still, the most ambitious programming task was the Commodore 64 game Lancess Priya, which had been brewing from since 2022 summer. The semi-vector graphics routines make it more of a technical exploration than a proper game. I found the energy to port the game to Commodore plus/4 too.

ZX Spectrum Next... but what's wrong?

Of old computers, Sinclair Z88 inspired me for a while, fostering thoughts about focused, keyboard-based text-only computing, but the computer eventually became just another oddity in the pile.

In December, at long last the ZX Spectrum Next arrived from the 2020 Kickstarter batch. The final moments of the year were spent tinkering with the Next and getting Multipaint to do 256-color graphics.

As the "Z80N" processor has fantasy extensions, there's really no way to build a similar computer by putting together a real Z80 and an FPGA for video/sound chip. But despite some quibbles about the authenticity of this new "Spectrum" it has been enjoyable to explore.

No Escape

The retro graphics output was modest this year, although notably it does feature the first official ZX Spectrum gfx compo outing, No Escape, a remote entry for the Edison 2023 demoparty.

For me this is somewhat humorous moment, as I originally made Multipaint to create ZX Spectrum graphics, way back in 2013. Well, okay, the one-screener Unhanged Speccy demo already featured my gfx.

This and the Vammala Party piece New King were mostly left-overs from earlier times.
Applescii Macscii, happy 40th, Mac!

Although the old computers never really left me during 1990s and early 2000s, it has now been a more dedicated ten-year journey with exploring 8/16-bit computers, PETSCII, bitmap graphics and programming.

I sometimes think this "phase" is winding down rather than going to higher gear, but something new comes up all the time. The balance of the hobby may become shifted but apparently there's no real end in sight.


Games

No sooner than I thought the year would not have much gaming in it, I found myself playing Eurotruck Simulator 2, Carrier Command 2, Mudrunner, Lake and Just Cause 3, as documented in the blog.

I did touch Disco Elysium, but despite all the accolades it didn't look like a game I would play. Too wordy and narrative-driven for me. Before 20 minutes had passed I switched it off.

I also started with the 2009 Bionic Commando, and although it looks solid enough it will have to wait for another time. 

Again, Proton/Linux with Steam largely enabled all of this. I'd perhaps nominate Carrier Command 2 as the most interesting game experience for my 2023, despite all its flaws.

Lake

In addition I would play the occasional vintage game, and a few games on the aforementioned ZX Spectrum Next platform. Perhaps the tiny tower defense variant Next War took most of my time.

I finally became fed up with chess, at least the online variety. On self reflection, what began as a slow alternative to computer games, with focus on physical pieces, boards and paper books, ended up as an online grind with diminishing returns, sense of wasted time and increased irritation. I will return to it eventually.


TV, Books, Films

Star Wars: Ahsoka was not that bad, but it's not my generation's Star Wars anymore. Perhaps it is made for those who grew up with the prequels, Expanded Universe novels and the animated Clone Wars and Rebels series. Now instead of having rare encounters with Samurai-like Jedi, we're now treated with 1-2 light saber fights every episode.

Ahsoka. Not the series.

The first resurgence of what should be the post-slump Doctor Who has arrived, and although it looks promising, I'm wondering if the re-invention is sufficient. Soon it's 20 years since the renewal of the series, and one can say there's already nostalgia building up for those early 2000s times.

Dark was the most memorable TV series I watched this year, even if the third season went off a tangent and mostly just stalled the outcome. It started out looking like a poor man's Stranger Things, but had its own clear voice after all.

More recently, Umbrella Academy has proven to be entertaining enough, following on the footsteps of Watchmen and the like. I don't too much care about TV or film format superhero adventures, having read the stories in comic book form long time ago. Again the third season meandered and stalled around a plot point that was already evident in previous season. Such is serial TV these days.

Talking of TV, my mind is rather blank about 2023's TV. Perhaps the increasingly splintered nature of streaming TV is something that puts me off watching more. Want to rewatch Twin Peaks or a few episodes of McGyver on the spur of the moment? No, not possible.

I managed to see about 70 films (not counting re-watches) in 2023, starting off with Koyaanisqatsi and Lawrence of Arabia. Koyaanisqatsi is less artsy than its makers probably intended, but at least it sports the Philip Glass soundtrack that eventually mutated into the C64 Delta tune in Rob Hubbard's hands. I could see Lawrence as an important and influential film, but the "grand historical epic" format dragged it down somewhat.

Truman Show could be added to the list of films I really ought to have seen before, and whatever one thinks of Jim Carrey I thought the concept was more interesting than the one in Matrix. Oh, and I did see the clever Barbie, but Oppenheimer is still waiting.

I saw more than the usual amount of Finnish movies in the theater, partly because of research purposes.  The new Hirttämättömät (Unhanged) and the Spede biopic were not all that impressive but were mandatory viewing. In addition I saw Je'vida, a not too happy film about the integration of Sámi people in the 1950s.

Aki Kaurismäki's Dead Leaves (Kuolleet Lehdet) was the same usual what Kaurismäki does, but the new actors made it feel fresher and less of a "one man's odyssey". Aki's films are often set in an ambiguous time period  Man without Past looks like it could be 1950s, but suddenly you see a computer terminal in a bank... Dead Leaves is set to a specific year with laser-precision. Also, weird to see some of my neighborhood, so recently filmed, in the film.

This new year is unlikely to be very film-heavy.

Nearing the end of the year I read what felt like a ginormous amount of sci-fi, but in actuality it was a generous handful of books. As a kind of literary highlight I read Thomas Pynchon's Gravity's Rainbow, a monumental and not entirely enjoyable task. At least afterwards I could easily read normal-sized sci-fi paperbacks in one evening or two.

Wednesday, 17 January 2024

Multipaint and ZX Spectrum Next

Some development notes about ZX Spectrum Next graphics modes in Multipaint, the multi-platform (Linux, Mac, PC) for creating 8/16 bit images.

The supported screenmodes are "layer 2" graphics, 256 x 192, or 320 x 256, both with 256 colors. ZX Next has many more modes, but these look like the most prominent for graphics and games.

I know it's possible to write code that displays 512 colors on-screen, but as usual, Multipaint only supports the most vanilla screenmodes.

Paint programs for 256 color modes are common, so I tried to compensate by adding a bunch of useful load/save options, more than the usual amount.

DK sprites from the Next SD card

Why are the formats individually listed in the menu, and not just integrated in the file selector? Well, I've found that if a feature is not very visible, people tend to think it does not exist.

Seriously though, one day I may add a better file extension recognition for the main file selector too.

Multipaint was designed for about 16 colors in mind, so the palette and color options for 256 color modes can appear a little limited.

At least the FX brush modes such as Lighten/Darken, Tint and Mix help somewhat and work better in 256 colors than in other modes. I still consider these as somewhat "beta". But you can draw a filled rectangle with the FX "Darken" on the desired area to make it more subdued, without having to pixel everything again or alter the palette.

Spectrum Next has a convention where the default palette holds a 256-color "8-bit RGB palette", 8 steps for Red, Green and 4 steps for Blue. 

This is especially useful for NextBASIC, you can work ideas without having to define palettes. The 256-color set is already very comprehensive – there isn't that much more you can do with the 512 color range. (8 greyscales is something that springs into mind, though.)

Next default "8-bit" palette

Multipaint respects this default palette convention, so if you import a PNG image, the palette is not altered.

This behavior can be changed from File->Settings, by turning on the "re-palette" option for incoming files.

Coders: Each platform specific Save menu option can be invoked from the File-> Export TXT item. From this dialogue you can save text/source versions of the same formats. These can then be copied to or included in an assembler source.

As of now the result is a little unresponsive, but the file ought to save even if it looks like nothing happened.

The Export as Text dialogue.

I've been asked for GIF and BMP support, makes sense as they are indexed modes with no ambiguity. Again something to think about in the future.

The Multipaint BIN project format obviously preserves the palette and the color index, and sticking to the default palette can also be helpful.

The ZX Next specific formats supported:

NXI

NXI is raw bitmap data, without any palette information.

The 256x192 and 320x256 variants can be detected from the file length.

Without palette, they are 49152 and 81920 respectively. With palette, add 512 bytes to length.

Note that the display order is different for the 320x256 version, the image is stored "vertically" in memory.

Multipaint doesn't currently change the screenmode automatically for an in-coming NXI, so you have to first pick the correct mode and then load the NXI. The dialog will warn of incorrect NXI length, though.

Notably, the PLOTIT-LITE paint program included in the ZX Next bundle can load and save 256x192 NXI files.

 

NXI with palette added

The same as NXI, but with 512 bytes of 9-bit palette data. Multipaint can detect which one it is from the file length.

For saving, you have to choose either NXI or "NXI wo" (without).

This format is largely useful for storing, I don't know of any other context of use. 

SL2

256 x 192 raw bitmap data, without palette. These files have a 128-byte PLUS3DOS header to facilitate system loading, or something.

Although the header ends with a checksum, the checksum apparently only matters for the 128 first bytes, thus the value is always the same for this image format.

The importance of SL2 is that the NextBASIC can easily load these files:

10 LAYER 2,1
20 LOAD "picture.sl2" LAYER
30 PAUSE 0

If the picture is in the same folder, NextBASIC should load and display the image.


SPR

SPR is 16384 bytes, raw bitmap data, containing 64 sprite definitions. The sprites are ordered as 16x16 entities, following each other.

Multipaint has no different mode for sprites, the SAVE SPR simply stores the top third of a 256x192 mode screen. This also means whatever is in the remainder, is NOT saved!

Hopefully I can come up with a clearer solution, as the bottom part works nicely as a scratchpad, and there's a chance of losing work.

Some tile work

Preferably, sprites and tiles should be saved in some other format, and only exported via SAVE SPR when needed.

The Sprite/Tile editor included with ZX Next bundle can load SPR files. *.SPR can even be launched from the Browser for inspection.

There's a couple of NextBASIC demos that show how to load and use SPR files in your own Basic programs, I won't go there now.

PAL

PAL is a 512 bytes file which contains the 9-bit RGB definitions for 256-color palette, from index 0 to 255. Practically every odd byte just contains the last needed bit for Blue component of each color.

This is identical to the way the palette is stored in NXI paletted format. It is also a handy order for dumping palette data via color registers in machine code.

This format also facilitates the loading and saving of alternative palettes, in case you need something else than the default palette. I'd recommend sticking to the default palette as much as possible.


NEX

Nex is not an image format, but a more generic means of "packaging" a code, its data and assets into a direct one-file executable, as described here.

I used this opportunity to have a NEX-based self-viewer that can be run from the Browser.

If you use the excellent NextSync for wireless file transfer, you could just export the NEX into your PC sync folder, sync the Next and then run the executable. Not too slow!


A few non-Next related notes

Multipaint is still being developed, and I am headed for a 2024 version, with some overhauls and a possible move to Processing 4.

Tutorial is a funny addition. It can be selected from the start menu. Hopefully, by going through the tutorial, it's more clear what kind of tools and options are available. The tutorial hasn't really been tested much, and may be adjusted in the future.

Another recent addition is a "key cheatsheet" menu item, which shows some (not all) keyboard shortcuts that might come in handy for more effective work.

Generally, Pull Down menus and the icon set and tooltips should give an idea of what is there, but there are also couple of functions that have never been really visible.

For example, scrolling of dither patterns using [ and ] keys is not widely known!

Multipaint website and Downloads