Showing posts with label ulaplus. Show all posts
Showing posts with label ulaplus. Show all posts

Saturday, 14 September 2019

Multipaint 2019: ULAplus, QL, pull-down menus and more


Multipaint 2019 has been long in the making, but there are quite a lot of tiny and bit bigger new things.

Get it at http://multipaint.kameli.net/

In this blog post I'll discuss some of the new features and add background detail that wouldn't fit the webpage and the manual.


Application behaviour

The application window is no longer scaled according to the chosen target platform.

The uniform sized application window helped me get rid of the java-based dialogue box when running the application, and you will see an in-application menu for choosing the platforms.


Because of this it's also possible to change the platform (FILE / NEW MODE) on the fly, so you don't have to re-run the application just to try a different platform. Don't expect it to convert your images on the fly as yet.

In the future Multipaint will likely suggest a mode change when loading a file for different platform, it's no longer hard to do but I didn't want to do the testing now.

I have removed the application window zoom size 1 (mini) from the prefs, as supporting it became a bit problematic. Tell me if you really, really need it.

There are now more tricks to access the "prefs.txt", this may help Macintosh users who have had problems with the preferences. If Multipaint is run from terminal, it outputs file-related messages to the console, hopefully helping solve these problems in the future.

Overall the program might not be as fast as before. I changed some convoluted code to something that is easier to handle, but likely a bit slower. I was also reluctant to optimize the all-new window and menu drawing routines.


File safety

Multipaint 2019 imposes some (conventional) rules for increased safety:
  • File overwrites and mode changes will have to be confirmed.
  • Multipaint reminds you of unsaved work when loading a new file.
  • Unsaved pages are pointed out when quitting (However, see note below).
  • Using “clear all” will reset the filename.
  • You cannot UNDO past a point that would require a filename change.
A page is  “unsaved” if a tool has been used on the page, it's currently no more clever than that.


The UNDO limit may sound like an overkill but it's been the only real source of lost work for me personally. Some have reported lost work due to clicking wrong icons or window close button accidentally.

NOTE: As much as I tried, I could not get Processing/Java to reliably bypass the window close button on the exported application. The work on this continues.

In the meantime, Multipaint tries to save pages automatically on exit, the files are called multipaint_auto_page1.bin and multipaint_auto_page2.bin, saved in the Multipaint application folder.


Drawing tools and magnify mode


There are more magnify levels (5 including the full view), making the mouse wheel magnify much more fluid. It should work a bit more like you would expect in this type of program (e.g. Krita) and to me it has quickly become the standard way of zooming in and out. The old magnify tool icon and magnify keys work like they did before.

I'd go so far as to say a two-button mouse with a wheel (doubling as a middle mousebutton) is the optimal tool for using Multipaint. Well, at least that's what I'm using all the time. However, the new style interface means the program should be more useable with a drawing tablet (wacom).

I cautiously added an auto-scroll for the second phase of two-phased tools such as rectangle and line. So, if you drag these tools outside the entire Multipaint window the mag window ought to scroll a bit. I'll probably improve the panning options in the future.

You can now reset your tool options by pressing SPACE. This means if you have a cluster of switches on (mirror, recolor, dither etc), and you are not quite sure why you can't draw properly, just hit SPACE and you will get back your one-point, one-color brush with all the switches off.


Pull-down menus and interface changes

Multipaint 2019 introduces drop-down menus, much like in Amiga Deluxe Paint. (Or nearly every other application for that matter!)

With the new menus I can add options and dialogues for functions that have been a bit too well hidden. In the future, the dialogues also help in adding features that would not fit well within the icon/keypress logic. It's also a way to divide the immediate drawing tools/switches and the other functions.


Currently the menus don't do that much as I am a bit wary of crowding them with options. Also, a bit more planning may be needed for the new dialogues. As a sort of demo what will happen in the future, the Text export now opens a dialogue for export options (that also have been improved a bit).

The main toolbar can be flipped, it can be on the left or right hand side of the screen, using OTHER/SWAP SIDE. DeluxePaint had the menus at the right but most applications these days seem to favor the left side. To me the left-side felt quite natural. You choose.

As file options no longer have icons, I got more room for the remaining icons. I gave some padding around them and their groupings, which could again be helpful for drawing tablet users. I might consider reducing the amount of icons further, or making even more clear division between drawing tools and the switches.

Some functions are now in a more standard location, for example the Load/Save/Export/Import icons can be found from the top left FILE menu. Keyboard shortcuts work as usual.

Although redundant, Undo/Redo and clear-all can also be found from the menus for added comfort.  Also, select border/background etc. are added to the menus as they were not very visible. Clear background comes in two varieties, using 1st or 2nd color.

Quick flip is accessible from menu, so the image can be viewed as mirrored.

Two Commodore 64 alternate palettes (Pepto and Colodore) can be quick-accessed from the menu. Custom .ACT-format palette files can still be loaded using the Load menu option.

I added the Pipette tool as an icon, as people tended to think it does not exist at all. It does help drawing tablet users I think.


New Target Platforms: Sinclair Spectrum ULAplus and Sinclair QL

The biggest addition is the ZX Spectrum ULAplus colour enhanced mode, based on the ULAplus specification by Andrew Owen. The current ULAplus support is limited for the ZX Spectrum 32 x 24 colour resolution, and not every idea in gestation could be included. In the future, I might support the "timex" 8x1 mode.

An original ULAplus image made with Multipaint
I hesitated to add ULAplus as I've previously avoided any 'special' modes. ULAplus was interesting and compatible enough to do and has some actual support. I'll possibly discuss this in more detail in near future. Let's just say it's not an easy mode to work with!

Sinclair QL mode 8 has been promoted from a semi-supported platform into a "fully" supported platform. The mode has an approximated flat aspect ratio that cannot be turned off. I added this mode mainly because I have grown so fond of the QL.

More importantly, the QL mode represents a small step towards supporting some low resolution 16-bit modes (Atari ST 320 x 200). I've resisted this in the past as Multipaint does not really have the type of tools and interface for handling them in the best way, but the day is getting closer.

Multipaint at http://multipaint.kameli.net/



Sunday, 14 April 2019

ZX Spectrum ULAplus mode, Multipaint etc.

I was asked to do ULAplus extended ZX Spectrum graphics mode support for the Multipaint painting software.

I was initially reluctant. Multipaint supports only the most established and "culturally recognized" modes, and I've not bothered to make C64 FLI/AFLI modes either, and they don't even require new hardware.

But I then saw that some images might actually come out of it, and seeing as I already own hardware that can display the mode (ZX Evolution) my curiosity grew. It's a challenging mode to work with, and Multipaint might help here.

I suppose a fairly huge proportion of currently active ZX Spectrum enthusiasts would be at least aware of the ULAplus mode. Although there are many modded and patched games and converted images that use the palette, the lack of editors and paint programs means Multipaint could even fill a niche here.

I'd usually prefer to release things before discussing them, but here I'll make an exception as there's a bit more to digest than usual.


ULAplus hardware?

In addition to the already mentioned ZX Evolution, I know about a ZX-UNO computer that has it. Then there is the SLAM drop-in ULA replacement which works on 128k or a +2.

A HDMI video board called the TK-Pie appears to promise these modes too.


Emulators also support the mode. I couldn't get my Linux Fuse patched to support it, but I have the mode working on ZX-UNO emulation within the ZEsarUX emulator. There I have to switch the mode on in the Display segment of the settings menu.



ULAplus and ZX Evolution

I had to update the firmware of my ZX Evolution to make this mode work. The firmware you get from one of the nedopc pages is not recent enough, so I went to GitHub and downloaded the latest zxevo_fw.bin and zxevo.rom. (Go look for the ROM at pentevo/rom/bin/)

I cannot guarantee this is the best option for your ZX Evolution, but at least I have my ULAplus mode working on a hardware speccy.

Upgrading the firmware was easy as I have my Evo inside a mini-ITX case. Wired correctly, I can then copy the zxevo_fw.bin to the SD card, and simply hold down the "soft" power button while plugging the cable in. The power LED flashes a bit and the firmware has been upgraded. These days the ZXevo ROM can be updated from within the baseconf service and it is a good practice to have both the ROM and the firmware updated at the same time.

ZX Evolution does not have a full ULAplus mode, it omits the difference between 6th and 7th level of the Red and Green components. So it might be something to consider when making graphics on the ULAplus.




ULAplus mode in Multipaint

Here I focus on how ULAplus works in practice and what it might mean for someone using Multipaint, although it's not yet definite how it will work.

ULAplus is clever in that it does not make the Specrum incompatible, it simply changes what is done with the memory bits that make up the display file. So, I'm only talking about the most standard mode, which has the same old resolution of 256 x 192 and the 32 x 24 attribute resolution with 256 colours to choose from.

The attribute "clash" is not removed, there are still two colours inside an 8x8 area, and much like with the ZX Spectrum there are rules to how these colours can be chosen.

But as there are more colours and they can be combined in more flexible ways, the look of the graphics can be changed quite radically. I'd go as far as to say the ULAplus experience proves the colour clash wasn't such a huge problem with the original ZX Spectrum, the limited colour palette was.

Here's a diagram that may be more confusing than helpful, but let's try it out:

From Multipaint painter's perspective:

-There is an index of 64 colours.
-These 64 colours can be adjusted with RGB sliders from a total of 256 colours. It is a kind of semi-9-bits RGB palette.
-The 64 colours are really four sets of 16 colours. No colours from two different 16-colour sets can be mixed inside the 8 x 8 area.
-Each of the 16-colour sets are further split into two subsets of 8 colours. The colours inside the 8x8 must be from a different subset. ("INK" and "PAPER")

Just as in the normal ZX Spectrum mode, Multipaint does not care which colour is INK or which is PAPER. This is why I have described the mode in a bit idiosyncratic way.

The internal workings can be partly forgotten by the artist, but still ULAplus is more complex than the ZX Spectrum limitations and it would be better if the artist understood these rules.

My starting point for the ULAplus Multipaint engine was to first prevent any pixel drawing operations that cannot be done, and then attempt to fill in the gaps with some helpful intelligence, without going overboard with this "helpfulness".

An early test of the TAP export, shown on the screen of a ZX Evolution computer.
The 16-colour set is technically called a Colour Look-Up Table (CLUT) and I will now follow that terminology here.

So, if the pen colour is from another 16-colour set (CLUT) than the colours underneath, then Multipaint likely won't allow you to draw on it.

If there is no diversifying pixel information at all within the 8x8 cell (it is filled with 64 pixels of the same colour) and it is not legal to draw with the current pen colour, it will be "primed" by Multipaint with the chosen colour. The area will also belong from that point onwards to that CLUT.

However, if the pen colour is legal the pixels will be added on that square and from that point on it will have two colours in it.

So, two different halves of a CLUT combine to make the colours on the same 8x8 area. It doesn't matter which colours or bits are there internally, just as long as you use the same pen colours that already exist on the area, it will work.

Multipaint allows a small detour here: If there is a way to resolve the drawing operation by using different colours from the same CLUT, this will be attempted. If this won't work, a possible combination will be sought from another CLUT.

For example you might have the colour black (0,0,0) in both sides of the same CLUT, this would facilitate drawing black easily on any colours that belongs to that CLUT without having to pick the correct colour everytime.

If the colour black is present at all sides of all four CLUTs, you can freely draw with the colour black over any portion of the picture, the 2-colour rule of course applies.

Also, if you want to breathe freely and have 8 colours that behave like the Spectrum with no CLUT nonsense, define the colours 8-15 same as the colours 0-7, and draw away!

Powerdrome pitstop from Atari ST/Amiga. An adaptation, not a conversion.
Importantly, the palette will be visually separated to show the 16-colour sets as rows. The artist ought to internalize the idea that the colours within an 8x8 area have to be from within the same CLUT, and from different "sides".