fcbpaint - graphics editor with drawable inline color splits

Basic and Machine Language

Moderator: Moderators

tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

fcbpaint - graphics editor with drawable inline color splits

Post by tlr »

Name: fcbpaint-0.6
Author: tlr
Release Date: 2013-10-31
Requirements: VIC-20 (PAL) with 32Kb expansion.
Download: fcbpaint-0.6.zip

News:
fcbpaint V0.6, 2013-10-31
- pictures can now be exported as runnable binaries.
- colors in the upper and lower border area can be changed.
- added directory function.
- added a selectable direct color mode. in direct color mode selecting
a color on the keyboard immediately updates the current setting under
the cursor.
- fixed annoying glitch when panning using ijkl.
- <bs> in the viewer returns to the menu.
- added menu option to quit the program.
- general bug fixes.

(the previous version was discussed here)

Description:
This is an editor for a special software defined graphics mode.

The mode has 168*192 pixels with 8x4 char color and inline color splits.
The editor and viewer is a little rough around the edges but fully usable.
currently PAL only.

Basic format:
- bitmapped mode
- 21 * 48 "chars"
- each char is 8*4 pixels (hires) or 4*4 pixels (multicolor)
- each line (pixel row) has an initial border, background and auxcolor. (aux = $900E, border+bg = $900F).
- each line can split $900E and/or $900F in-line.

Splits:
- one register can change at a time. (eg, border+bg _or_ aux)
- splits always start at a point and continue until the next split to the right or until the end of the line.
- splits can start on any half char boundary (but will happen one hires pixel late)
- splits are compiled to machine code upon entering the viewer.
- the only way to guarantee that a particular combination of splits is allowed is to enter the viewer and check.
- there are some rules that can be followed to make success likely:
-- splits are always allowed 3 chars appart.
-- in some cases splits as close as 2 or 2.5 chars appart are allowed.

See the included README.txt for details.

Screenshots:
Image Image
Image Image

See also Exin's excellent picture here: Vic picture
User avatar
Wilson
Vic 20 Enthusiast
Posts: 190
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Post by Wilson »

Sweet, those are some great feature additions! Thanks for the Halloween treat, tlr! :)
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: fcbpaint - graphics editor with drawable inline color sp

Post by Mike »

Hi,
tlr wrote:-- in some cases splits as close as 2 or 2.5 chars apart are allowed.
from what I gathered, the placement of split 2.5 chars apart relies on the ZP being initialised to $00 .. $FF. That means a load instruction which would normally take 2 cycles in immediate mode can be replaced by one on the zeropage, now taking 3 cycles.

Would it be possible to replace this construction with a store instruction on the relevant VIC register which is made to take 5 instead of 4 cycles by means of a page overflow (this only requires, that at least one of the CPU registers contains a non-0 value at that time)?

If that's the case, I could imagine to lift the display routine on my VFLI mod, so fcb images could be displayed while there's still a user program running.
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Re: fcbpaint - graphics editor with drawable inline color sp

Post by tlr »

Mike wrote:from what I gathered, the placement of split 2.5 chars apart relies on the ZP being initialised to $00 .. $FF. That means a load instruction which would normally take 2 cycles in immediate mode can be replaced by one on the zeropage, now taking 3 cycles.

Would it be possible to replace this construction with a store instruction on the relevant VIC register which is made to take 5 instead of 4 cycles by means of a page overflow (this only requires, that at least one of the CPU registers contains a non-0 value at that time)?
2.5 chars is 5 cycles. It's done using a STA <abs>,X already. The current compiler seems to have a bug with that though. It seems I've mistaken which split the 5 cycle instruction affects. This can be seen as the glitch in the trapezoid in the screenshots. I'm looking into fixing that.

3.5 chars could be done with LDA #<imm>; STA <abs>,X instead of LDA <zp>; STA <abs> but the drawback is that only the accumulator can be used for those stores.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: fcbpaint - graphics editor with drawable inline color sp

Post by Mike »

I see. Scheduling the instructions should already be quite difficult as is.

...

For another few things:

- I could make fcbpaint crash by tapping RESTORE several times in the preview. Upon returning to the editor, the VIC-20 would end up in a perpetual warm start of BASIC (a blinking 'READY.' in the top-left corner).

- It would be nice, if you could make the cursor and cell/split markers blink at a slightly less 'nervous' rate. For example, the normal cursor changes between on and off only every 20 jiffies.

- A hot key in the editor for help regarding the assignment of keys to the functions would be handy.
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Re: fcbpaint - graphics editor with drawable inline color sp

Post by tlr »

Mike wrote:- I could make fcbpaint crash by tapping RESTORE several times in the preview. Upon returning to the editor, the VIC-20 would end up in a perpetual warm start of BASIC (a blinking 'READY.' in the top-left corner).
Noted and already on TODO list.
Mike wrote:- It would be nice, if you could make the cursor and cell/split markers blink at a slightly less 'nervous' rate. For example, the normal cursor changes between on and off only every 20 jiffies.
Noted but I have yet to come up with a behaviour that is useful. I guess it will have to adapt to the actual pixel shown. It doesn't do that now.
Mike wrote:- A hot key in the editor for help regarding the assignment of keys to the functions would be handy.
Noted. I'm trying to keep the main dispatcher within $a000-$c000 so memory is a bit tight. Still $0800 left though.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: fcbpaint - graphics editor with drawable inline color sp

Post by Mike »

tlr wrote:Noted but I have yet to come up with a behaviour that is useful. I guess it will have to adapt to the actual pixel shown. It doesn't do that now.
The cursor in MINIPAINT is a frame around the current pixel. It is drawn from the two global colours which have the lowest and highest brightness, respectively. [1] This way, the cursor is always visible and guaranteed to show a good contrast at least in one phase [2], regardless of background - and the cursor can't colour clash with parts of the picture in foreground colour.

This approach might be difficult to transfer to fcbpaint, as you always display a grid around all pixels. [3] Still it should be possible to take either black or white only as 'active' phase, whichever of these two has the better contrast against the underlying pixel colour (the 'inactive' phase), and then alternate these two phases at a moderate pace.

I had to take similar considerations regarding the other UI elements in MINIPAINT: the frames and the text in the status window and text window automatically change between white and black for maximum contrast against the current background colour. Black, red, purple, blue and orange use white as foreground, all other colours result in black as foreground.


[1] always recalculated as soon as one of the global colours is changed.

[2] except in the pathological case, where the user chooses three identical global colours - but why should he? ;)

[3] and you have good reasons for this :)
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

Name: fcbpaint-0.7
Author: tlr
Release Date: 2013-11-11
Requirements: VIC-20 (PAL) with 32Kb expansion.
Download: fcbpaint-0.7.zip

News:
fcbpaint V0.7, 2013-11-11
- split points are visualized in the editor as small flanges.
- added dots on multicolor pixels to indicate which type they are.
- more relaxed cursor blink.
- made cursor aware of the color under cursor and adapt contrast
appropriately.
- corner points now flash more smoothly.
- <restore> no longer produces crashes.
- added example picture by Exin.

Screenshot:
Image
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: fcbpaint - graphics editor with drawable inline color splits

Post by tokra »

I drew a little picture last Friday night, trying to recreate the cover of the latest New Order-album "Music Complete" released on that day:

Image

Download - executable and .fcb-image included.

I wanted to see if this picture was possible without the use of multicolor-mode (which looks to chunky I think). I realized I would need background-color-splits for light-blue and light-red at least so only fcbpaint was a possible format for this.

I first wrote a little MINIGRAFIK-programm to draw the outlines of the black lines (first measuring them on the album cover and converting to 5:3 ratio of the VIC). Once this was done I imported the picture to fcbpaint with Mike's Minigrafik to FCB converter. I then noticed that in order for the background splits to work the whole image needed to be shifted left 2 pixels. Another quick MINIGRAFIK-programm did the job (using the @(x,y) function).

Then the difficulty of handling the splits began. They need to be 3 chars apart mostly and there were some problematic areas. After some hours and trial-and-error in the end all but the top left corner of the image worked out. There a quick change from green back to white was needed, but the split was too close. I finally overcame this by defining black as background color in this area and using green and white as char colors. The black bar is a geat divider so there is no char-color-clash.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: fcbpaint - graphics editor with drawable inline color splits

Post by Mike »

Now that is a story quite to my taste: using the Best of Both Worlds™ to achieve a result exactly as wanted. :mrgreen:

And it actually made me buy that CD (couldn't find it as Vinyl at the shop) to investigate your taste in music. :wink:
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: fcbpaint - graphics editor with drawable inline color splits

Post by Mike »

tokra wrote:I wanted to see if this picture was possible without the use of multicolor-mode (which looks to chunky I think). I realized I would need background-color-splits for light-blue and light-red at least so only fcbpaint was a possible format for this.
It's not entirely impossible to pull this off with a MG bitmap, though: mc_mike.zip.

Also works on NTSC. :)

Cheers,

Michael
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: fcbpaint - graphics editor with drawable inline color splits

Post by tokra »

Yes, when I realized I needed the "inverse" setup on the top left corner I felt it might be possible to do the whole bitmap like that with black as background color. However light-blue and light-red are still both in the image, and as such need the raster-assist that you added to your MG-bitmap.

Only proves that you should think about color-setup thoroughly, before starting to pixel your image.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: fcbpaint - graphics editor with drawable inline color splits

Post by Mike »

Hi, Daniel,

today I ran into trouble with fcbpaint with I tried to 'port' over my Pokémon picture. :(

The background colour starts with $06 (blue) in the top and $0C (light purple) in the bottom, and then splits (between columns $54/$55) to $0D (light green) in the top and $08 (orange) in the bottom. Likewise the picture inits the auxiliary colour with $04 (purple) and then splits to $00 (black) between columns $44/$45.

Unfortunately, the splits of the auxiliary colour don't work in the viewer - the darker outlines of Celebi remain purple. Within the editor, everything's in order.

The two splits are only spaced apart by the absolute minimum of 16 pixels, but this should be within the limits, as there's plenty of time in each raster line to pre-load the necessary register values. I tried with 0.5, 0.6, 0.7 and also with the 0.8 beta, which tokra gave me (under a 'no further spread' agreement) to try out - all show the same error.

I have attached the problematic picture file (download), maybe you could take a look at it? TIA. :)

Michael
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Re: fcbpaint - graphics editor with drawable inline color splits

Post by tlr »

Mike wrote:Hi, Daniel,

today I ran into trouble with fcbpaint with I tried to 'port' over my Pokémon picture. :(

The background colour starts with $06 (blue) in the top and $0C (light purple) in the bottom, and then splits (between columns $54/$55) to $0D (light green) in the top and $08 (orange) in the bottom. Likewise the picture inits the auxiliary colour with $04 (purple) and then splits to $00 (black) between columns $44/$45.

Unfortunately, the splits of the auxiliary colour don't work in the viewer - the darker outlines of Celebi remain purple. Within the editor, everything's in order.

The two splits are only spaced apart by the absolute minimum of 16 pixels, but this should be within the limits, as there's plenty of time in each raster line to pre-load the necessary register values. I tried with 0.5, 0.6, 0.7 and also with the 0.8 beta, which tokra gave me (under a 'no further spread' agreement) to try out - all show the same error.

I have attached the problematic picture file, maybe you could take a look at it? TIA. :)

Michael
Thanks for the detailed bug report. I'll have a look at it when I get a slot. I fear it will need a partial rewrite of the viewer/compiler though. It's probably a corner case I didn't consider along with the occational 5 cycle (STA <abs>,X) split bug in there.
The compiler is a quite involved piece of code as you might imagine. I do have a c-model of parts of it but it was a really long time since I looked at it so it might take time to understand.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: fcbpaint - graphics editor with drawable inline color splits

Post by Mike »

tlr wrote:Thanks for the detailed bug report. I'll have a look at it when I get a slot. [...]
Great! For the moment, I would craft a dedicated test image, that is supposed to contain various combinations of splits, which I think should work.
Post Reply