WIP: Vic GUI

Basic and Machine Language

Moderator: Moderators

Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

WIP: Vic GUI

Post by Kananga »

After finally being able to spend some time on the GUI, I want to share the little progress:

Update of the basic elements demo (former vin-0.2.prg): Demo
(Needs now at least 24K due to the grown framework code&data)

Demo of two new elements, the message box for simple text messages, and a list box: Listbox
(16K)

Besides many little internal improvements, you can grab a window by its title bar and drag it around on the screen.
The framework now includes Mike's font as a third font.

More to come soon...
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: WIP: Vic GUI

Post by Mike »

Cool! 8)
Kananga wrote:Besides many little internal improvements, you can grab a window by its title bar and drag it around on the screen.
I found one can even drag a window partly off-screen, but only to the right and bottom, not to the left. O.K., that one could make it difficult to close the window, as the close icon disappears. ;)
The framework now includes Mike's font as a third font.
:D

In 'font4.asm' I found these lines:

Code: Select all

f4loop:   lda (ch4ptr), y
          and #7
f4ptr:    sta $FFFF, y
That should be 'and #15': even though the majority of the glyphs only use 3 columns, there is one exception: ASCII 126, '~'.

Greetings,

Michael
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Re: WIP: Vic GUI

Post by Kananga »

Mike wrote:I found one can even drag a window partly off-screen, but only to the right and bottom, not to the left. O.K., that one could make it difficult to close the window, as the close icon disappears. ;)
Negative coordinates wouldn't work and the close button happens to be in the top left corner, so that fits nicely, eh?
Mike wrote:In 'font4.asm' I found these lines:

Code: Select all

f4loop:   lda (ch4ptr), y
          and #7
f4ptr:    sta $FFFF, y
That should be 'and #15': even though the majority of the glyphs only use 3 columns, there is one exception: ASCII 126, '~'.
Changed, thanks!

Did you notice the mouse cursor acceleration? At first I found it a bit annoying and sometimes it makes it harder to navigate. I had higher values first, but I turned it down to max 3 pixels/move as it is now and it seems a good compromise to me. Should be adjustable for user preferences, of course.
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

WOW, very impressive demo, my compliments !
Mega-Cart: the cartridge you plug in once and for all.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: WIP: Vic GUI

Post by Mike »

Kananga wrote:Changed, thanks!
:)
Did you notice the mouse cursor acceleration? At first I found it a bit annoying and sometimes it makes it harder to navigate.
I got used to it quite fast. The most important aspect being, that you still allow for pixel-exact positioning. And the fast speed is O.K.

One strange thing though: as I drag a window around left...right...left, it jumps one character upward every-now-and-then while going left, until it is stopped by the top of screen. :?
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Re: WIP: Vic GUI

Post by Kananga »

Mike wrote:One strange thing though: as I drag a window around left...right...left, it jumps one character upward every-now-and-then while going left, until it is stopped by the top of screen. :?
Funny that I didn't notice this effect. Thanks for pointing it out. Actually it was quite easy to find&fix: A missing clc (see execfun.asm;r44)
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Another thing: In one dialog box, you let the user change background and border colour. Default for background is black, with white for foreground. The foreground colour remains fixed, i.e. when you select white as background, you get an all-white screen.

Now, instead of "simply" adding a foreground select as well, you might consider providing either black or white as foreground for the GUI elements, depending which one of these two has the better contrast to the background, like:

Code: Select all

background: foreground:
black       white
white       black
red         white
cyan        black
purple      white
green       black
blue        white
yellow      black
If you also make the top 8 colours available as background, maybe Orange should have white as foreground as well, and all others can use a black foreground.

This is the method I use in MINIPAINT to keep the GUI elements visible, regardless which background the user chooses.
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Mike wrote:Now, instead of "simply" adding a foreground select as well, you might consider providing either black or white as foreground for the GUI elements, depending which one of these two has the better contrast to the background
Thanks again for the hint.
Actually, I put the color selection dialog into the demo to have something with a visible effect in there. But you are right, a serious configuration should be more sophisticated.

@nbla000: Thanks for the compliments! :)
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Cool!
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Bugs fixed and new listbox contents :-)
Listbox (Min 16k)
Buy the new Bug-Wizard, the first 100 bugs are free!
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

After adding file-I/O to the framework and fixing a couple of bugs,
I am proud to present the first almost useful application using the GUI:
diskmenu

Memory requirements are 16K from $2000-$5FFF plus at least the 3K expansion or more.

Image

You can browse through a directory and hit the load button, but ATM it works for directories only.
Unfortunately, the window dimensions do not allow to view more than one drive in parallel.

The program grabs all available RAM, so it may not work with floppy speeders. I plan to take a look at SJLOAD and find out how to make the framework use it.
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Kananga wrote:I plan to take a look at SJLOAD and find out how to make the framework use it.
Just to inform you that I'm working for a NTSC version of SJLOAD to support classic drives (1541/1541-II/1571/1581) with JiffyDOS ROM too.
At the moment it was successfully tested on 1581+JiffyDOS drive on NTSC machines and it will be tested on 1541 / 1571 drives soon.

If you need further info just send me PM or an email.
Mega-Cart: the cartridge you plug in once and for all.
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

I have put together the first release of the GUI prototype. Code size is already becoming a problem, so adding more essential features requires dynamically loading and discarding parts of the program at runtime.

Anyway, the GUI-based file browser is able to browse through SD2IEC drives and launch programs for different memory configurations that can be started with "RUN". It would be great, if you could post feedback about programs that don't load (or work surprisingly good ;-) )

Download

From the README:

GUI prototype for the VIC-20 (R1)
---------------------------------

This archive contains three programs that demonstrate the features
of the GUI prototype. All programs need a lot of RAM, so they are
best used with Final Expansion or MegaCart.
You can also use an expansion port expander and plug 2x16K and 3K in
to max out the available memory with genuine Commodore hardware.
Minimum requirements are 24K RAM from $2000-$7FFF.

The GUI requires a joystick or (better) a joystick emulating mouse.

You should have a drive with JiffyDOS to minimize load times.
(e.g. sd2iec)

The main application "VIN" scans for available disk drives at addresses
8 to 11 and displays disk icons. Click on an icon to open a file
browser window for the drive. You can now change into and out of
directories (DIR) or disk images (Dnn) and start programs (PRG).

All programs scan present drives for an RTC with valid time on startup.
So better set-up the RTC clock now!

INSTALL:

Copy all files from this archive to a disk or a directory on your SD card.

The files are:

VINBOOT - A boot loader for VIN that first loads SJLOAD into the 3K area ($0400).
VIN - The disk browser.
VINDEMO.PRG - The original demo of basic GUI elements.
VIN20.PRG - Demonstration of the compound elements message box and list box.
SJLOAD$04 - A JiffyDOS floppy speeder (currently maintained by nbla000).
LOADER - A sample loader configuration for the FE3.

Thanks to the community at Denial (http://www.sleepingelephant.com/denial/)
for the initial discussion and encouragement!

--
2010/09/24 A.M.
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
Wilson
Vic 20 Enthusiast
Posts: 190
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Post by Wilson »

Wow, this is great! With the ability to launch programs, I can now see this being legitimately useful. And support for different memory configurations to boot! :)
So, what's next? ;)
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Wilson wrote:Wow, this is great! With the ability to launch programs, I can now see this being legitimately useful. And support for different memory configurations to boot! :)
Thanks. Nothing you wouldn't get from CBM Filebrowser and you can't use the keyboard for navigation. But yes, it's useful after all. Plus you get a watch for free, if you have an RTC as in the FE3. ;-)
Wilson wrote:So, what's next? ;)
Could be a lot given enough time. Any suggestions?
Buy the new Bug-Wizard, the first 100 bugs are free!
Post Reply