Vic GUI

Basic and Machine Language

Moderator: Moderators

User avatar
Wilson
Vic 20 Enthusiast
Posts: 198
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Post by Wilson »

Kananga wrote:Did I say I hate writing documentation?
No, but you did a great job with it! :) It was interesting to read.

Nice demo as well. I can't help but notice a certain visual problem though. The cursor seems to consistently flicker during movement (at least in VICE). Are you waiting until the next frame to redraw after erasing?

This really is progressing quite nicely. Good work! :D
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Thanks for the encouragement :)

The cursor also flickers on the real Vic-20.
The graphics routines do not wait for screen refresh yet and screen updates and cursor movement simply hide the cursor and redraw it after the update.
Certainly much room for improvements there.

I don't know if you noticed, but the source code is on Google code too. Admittedly it is perhaps a bit hard to read. Suggestions for changes or better code are very much welcome too!
User avatar
Ivanhoe76
Vic 20 Devotee
Posts: 200
Joined: Fri Sep 28, 2007 11:17 am
Location: Italy

Post by Ivanhoe76 »

Kananga, you have all my admiration, this project is a real wonder, go on with it!!! About the name, I'd propose Vic=ndows.... I know, I know... maybe It's better Vic=ux, far less bugs inside!!!!
No one should tolerate death and violence because tolerance will generate habit.
User avatar
akator
Vic 20 Afficionado
Posts: 334
Joined: Wed Apr 14, 2010 6:01 pm

Post by akator »

A GUI on the VIC is really impressive, to say the least. I've just gotten back into the VIC after many years, and I'm astounded by what's possible...
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Actually "vin" was just the first name I came up with, without pondering too much. I am open for suggestions ;)

In the meantime, I am slowly making progress on keyboad input handling (and focus management) so I am getting closer to the point where disk I/O will come in.

Due to the lack of multi-tasking, it may be a good idea to have a routine which takes a device,filename,target address, loads the file to the given address (in background*) and fires an event when done.
On the device side, it might be good to have some kind of driver interface. On first sight, the minimum functions needed for the low-level interface are: open device/file, read (byte or or block), write (byte or block), close. For devices that support it seek and tell are needed too. That's how it is done in POSIX and ANSI-C. Looks simple and clear enough to me.

* that's where timers come in.

Something else I keep thinking about is color & sound. Simple beeps shouldn't be too difficult, but I am still impressed by the music & sound of recent demos. It's impressive what the good ol' Vic can do.
I don't want to spend all of the CPU time on a sound routine, so is anything feasible for playing some kind of system sounds/effects?
Vic20-Ian
Vic 20 Scientist
Posts: 1216
Joined: Sun Aug 24, 2008 1:58 pm

Post by Vic20-Ian »

Kananga,

I tried this last night and am very impressed.

I look forward to being able to click on a drive button and see the directory and click on a game and start it.

So far this is very cool, I never used GEOS but expect it was similar. Will it be able to do simple multi tasking via interrupts? e.g. open a little clock display that updates while using a calculator and browsing a disk?

A lot to ask of the humble Vic but I wonder if this would be a record breaking lowest powered multitasking gui?

You should be able to have a background piece of music playing via interrupt. Mega Cart does this. If you kept it to 2 channels plus noise you could also have system beeps on one of the 3 channels.

Great work. I look forward to seeing more and a big thank you.
Vic20-Ian

The best things in life are Vic-20

Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Ian, thanks for your comment!
Vic20-Ian wrote:I look forward to being able to click on a drive button and see the directory and click on a game and start it.
I want that too! Let's see how long it takes to get there.
Vic20-Ian wrote:So far this is very cool, I never used GEOS but expect it was similar. Will it be able to do simple multi tasking via interrupts? e.g. open a little clock display that updates while using a calculator and browsing a disk?
You can achieve the appearance of multi-tasking with an event-driven-system, timers and careful programming. That's how I did it in the nineties in DOS (*shudder*). GEOS works similar. It requires splitting long-running task into pieces. The protothread concept of ConTiki looks interesting, maybe that is the way to go.
Vic20-Ian wrote:You should be able to have a background piece of music playing via interrupt. Mega Cart does this. If you kept it to 2 channels plus noise you could also have system beeps on one of the 3 channels.
The first interrupt handler I ever wrote did play three channels from a table. Most of the music I put together sounded horrible, because some of the notes you can play on the VIC are slightly off-tune. And perhaps because I am too stupid when it comes to music. But you are right, it shouldn't cost too much CPU time.
Vic20-Ian
Vic 20 Scientist
Posts: 1216
Joined: Sun Aug 24, 2008 1:58 pm

Post by Vic20-Ian »

Carlsson (if he returns) is the music expert but 6502 Dude and Nbla000 should be able to help with a chunk of music player code and tunes from the background of the Megacart.
Vic20-Ian

The best things in life are Vic-20

Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

No music yet, but another step towards a GUI:
http://vin20.googlecode.com/files/vin-0.1.prg

New features:
- Keyboard input. (find the input field ;) )
- Improved Window handling.
- Lots of minor improvements. (cursor still flickers though)
- One bug guaranteed!

Until now I have mainly concentrated on UI primitives, but most future enhancements like fonts, etc. need at least file I/O and memory management. So I will probably not release another prototype too soon.

Have fun and please post comments! :)
Buy the new Bug-Wizard, the first 100 bugs are free!
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Cool! :) I think the "mouse" needs to be a bit faster.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Boray wrote:Cool! :) I think the "mouse" needs to be a bit faster.
True. It gets worse, when using a real mouse at the Vic-20. A configurable increment for X/Y movements would be good.
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
Ivanhoe76
Vic 20 Devotee
Posts: 200
Joined: Fri Sep 28, 2007 11:17 am
Location: Italy

Post by Ivanhoe76 »

:shock: :shock: :shock: Is it a "poor" vic doing that? I can't believe it: windows open and close quickly without caring if they contain hires graphic or text only... and you can even switch each other without problems!!!! If this is the beginning, I think the fianl version will really shock us!!!!!
No one should tolerate death and violence because tolerance will generate habit.
User avatar
Wilson
Vic 20 Enthusiast
Posts: 198
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Post by Wilson »

Wow! Some nice improvements!

Regarding the mouse speed: I don't know how it would feel in this application, but have you thought about making the cursor accelerate as the joystick is held in one direction? Examples of it in action can be found in Deja Vu and Uninvited for the C64. It's nice because you get both precision and speed, but then again GEOS feels just fine without it.
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

What exact settings should I be using to run this in VICE?
High Scores, Links, and Jeff's Basic Games page.
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

@Mousespeed:
Accelerating the mouse cursor may be an option for the Joystick-mouse. It's on the list of things I'd like to try. If implemented wrong it can be annoying, because you have to do tiny steps for precise movements, otherwise acceleration jumps in and pushes the cursor beyond the target.

@VICE settings:
- 16K or more (I know it's like cheating for "unexpanded" purists ;-) )
- PAL
- Joystick emulation.
That's what I use. And PAL emulation for the "real" touch.
Everything else I left at default settings.

On the real VIC (PAL) I just plug in the 16K expansion and a Competition Pro or M1 mouse. (And of course uIEC-SD or 64HDD to load the program, haven't put it on a floppy disk yet)
Buy the new Bug-Wizard, the first 100 bugs are free!
Post Reply