MINISKETCH - the ultimate VIC-20 doodle program!

Basic and Machine Language

Moderator: Moderators

User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

MINISKETCH - the ultimate VIC-20 doodle program!

Post by Mike »

Code: Select all

 M   M  III  N   N  III
 MM MM   I   NN  N   I
 M M M   I   N N N   I
 M   M   I   N  NN   I
 M   M  III  N   N  III

     SSSS K   K EEEEE TTTTT  CCCC H   H
    S     K  K  E       T   C     H   H
     SSS  KKK   EEEE    T   C     HHHHH
        S K  K  E       T   C     H   H
    SSSS  K   K EEEEE   T    CCCC H   H

 ...the ultimate VIC-20 doodle program!
Image

MINISKETCH (download) requires a +8K RAM expansion and a lightpen with trigger switch (and a CRT, of course).

When no valid calibration data is found on disk, the program requires you to do the calibration procedure first. Just follow the instructions on screen. The start-up prompt then allows you to redo the calibration at any time (press "C").

In the start-up prompt, press "N" to create a new sketch or "E" to edit an existing sketch. Both selections request for a file name.

Then, the program immediately shows the graphics screen. When the lightpen is held near the screen and your VIC-20 can detect the position, MINISKETCH displays a cursor on-screen.

When the cursor is visible, a press on the trigger switch toggles MINISKETCH between pen on or off canvas.

When the lightpen is taken away from the screen, the cursor disappears. It also automatically makes it off canvas.

While the lightpen is off screen, a press on the trigger switch toggles between draw and erase action. This is indicated by a brief colour change of the drawing.

f1 saves/replaces the screen on storage under the given name.

f7 quits the program and returns you to the "READY." prompt. Use RUN to restart.

MINISKETCH uses the MG file format. You can load the files into MINIPAINT to further refine and colourize them.


Cheers,

Michael


P.S. Recent releases of VICE support a lightpen. Just choose "Enable lightpen emulation" and "Type: pen with button left". The pen position is derived from the mouse pointer within the VICE window, the left mouse button acts as "Lightpen is held on screen", and the right mouse button acts as trigger switch.

P.P.S. Thanks to tokra for lending me a Turbo Computer Lightpen which I could use to test the lightpen driver on real h/w. :D
Last edited by Mike on Sun Nov 13, 2016 9:01 am, edited 5 times in total.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by Boray »

Too bad I don't have a CRT TV and a light pen. :(
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by Mike »

@Boray: PM sent :)
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by tokra »

Considering how low the VIC-20 Lightpen-resolution is (4 pixels for X and 2 pixels for Y if I remember correctly), this sketch-program does a very good job at interpolating the "missing" pixels. Mike explained it to me once, maybe he can re-iterate it here?
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by Mike »

Yes, of course.

The position readout routine runs in the interrupt once per frame, and keeps a list of the last 4 "measurements". Only in case all 4 are valid (it checks for the lightpen at the screen) it calculates a new set of lightpen co-ordinates for the main program, by averaging those 4 measurements, subtracting the calibration constants and signalling the main program there's a new set of co-ordinates available.

When the pen is held in place, the cursor still 'snaps' in to the coarse grid of what the VIC chip only delivers, but as soon as the lightpen is moved, the routine has a good chance to interpolate co-ordinates. Faster movements will of course result in disjunct pixel co-ordinates for each new readout. The main program then uses a very fast line routine to connect these single points into a drawn through line.

The whole procedure during the drawing - removing the cursor at the old position, drawing the line segment between the two cursor positions and re-instating the cursor at the current position - takes place in a single frame! On real h/w, the movement of the cursor is ultra-smooth. What you can see in VICE just pales in comparison.
Last edited by Mike on Sun Aug 07, 2016 10:50 am, edited 2 times in total.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by Boray »

Tried it in VICE now. Really cool!
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
darkatx
Vic 20 Afficionado
Posts: 470
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by darkatx »

This thing needs a thumbs up or a like option :)
Learning all the time... :)
User avatar
darkatx
Vic 20 Afficionado
Posts: 470
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by darkatx »

Finally got to knock one off my bucket list - use my tablet with my Vic 20 emulator.

Image
Learning all the time... :)
User avatar
beamrider
Vic 20 Scientist
Posts: 1447
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by beamrider »

What light pens would work with this?

How about this one?

http://www.ebay.co.uk/itm/CAD-Master-Li ... Sw0QFXBji7
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by Mike »

beamrider wrote:What light pens would work with this?
I could only test with the Turbo Computer Lightpen, but surely one of the other users (downloads as of this posting here: 41) can shed some light on this.

...

Another program, PGM IMPORT MONO (contained in the MG batch suite) can be used effectively to import line-art from the PC for further use in MINISKETCH. Here's the necessary set of parameters at the prompt:

Code: Select all

PGM FILE? NAME.PGM
TARGET? NAME.PRG
FOREGROUND? 1
BACKGROUND? 14
BORDER? 7
INVERT INPUT? N
Of course, "NAME" is just a placeholder. The *.pgm file must be 160x192 pixels.

MINISKETCH makes use of the invert bit in register 36879, but PGM IMPORT MONO saves the file as non-inverted. That causes MINISKETCH to invert the picture on its own on load - thus the strange arrangement of white (1) as "foreground", light blue (14) as "background", yet no "invert input". But in the end, it all works out. ;)

I chose light blue as drawing colour so the lightpen still works at places where there's a lot of ink placed on screen. When the picture is loaded into MINIPAINT you can change the drawing colour to your liking, with Ctrl-1. Just in case the picture is loaded back into MINISKETCH, the 'light blue on white' colour scheme is enforced once again.

Cheers,

Michael

P.S. darkatx, would you like to post the *.prg file of Beth(?) vs. the Giant Snake (or Dragon?) :)
User avatar
darkatx
Vic 20 Afficionado
Posts: 470
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by darkatx »

Mike wrote:
P.S. darkatx, would you like to post the *.prg file of Beth(?) vs. the Giant Snake (or Dragon?) :)
I'm touching it up some more... :)
Learning all the time... :)
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by Mike »

darkatx wrote:I'm touching it up some more... :)
Even better! :mrgreen:
User avatar
darkatx
Vic 20 Afficionado
Posts: 470
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by darkatx »

I cannot stress enough how much I like this program even though it wasn't the creator's original intent ;)
Learning all the time... :)
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by Mike »

I have added an interlock between "lightpen on screen" and the actions on the fn-keys.

The OP has been updated, please re-download MINISKETCH.
User avatar
darkatx
Vic 20 Afficionado
Posts: 470
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Re: MINISKETCH - the ultimate VIC-20 doodle program!

Post by darkatx »

Already excited to check out the upgraded version...nice idea. :D
Learning all the time... :)
Post Reply