Vic GUI

Basic and Machine Language

Moderator: Moderators

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

Vic GUI

Post by Kananga »

Since I am slowly making progress on my little project I want to share early results and your input.
The project is a little prototype for a GUI framework for the VIC. Of course it may use lots of the precious RAM, but we should finally make use of the new wonderful carts with 512K RAM!
(My FE3 isn't working yet, but that's another story)
Joystick or a Joystick emulating mouse works for the pointer (tested with M1 mouse) and I think about supporting a light-pen too. (I got one so have to put it to some use)

ImageImageImageImage

For now, you can only move the pointer and click Exit in the start-menu.

The framework uses dynamic allocation of char-gen cells for frames containing windows, buttons, etc. So you cannot display a full-screen frame, but smaller frames can coexist and go of-screen if unused and return the char-gen resources to the framework.
Text output uses built-in fonts, but is prepared for custom fonts. I haven't found the time yet to create a smaller font...

Next I want to build a small program like a calculator to continue testing and extending the framework. It should still run on a Vic+8/16K.

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

Post by Wilson »

Very nice! :D This looks really cool.
Have you considered making the whole screen a bitmap a la MINIGRAFIK? That would solve all of the problems related to character memory limitations.

How are applications going to run on top of GUI? If you want to take the FE3 route, it almost makes sense to just give each program its own memory bank and leave a bank for the GUI. That'd allow 15 programs to run at a time and solve any disputes that might otherwise occur over the sharing of RAM between programs. But there are a many people a lot more intelligent than me here that may have a better idea.

I assume you've put a fair amount of thought into how programs will interface with the GUI since you're planning to make a calculator. Care to share any details in that regard?

Keep up the good work! I look forward to future updates. :)
English Invader
Vic 20 Scientist
Posts: 1193
Joined: Tue Apr 28, 2009 3:51 pm

Post by English Invader »

I don't think I'd want the VIC to have a GUI. It would destroy everything the VIC is about.
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Wilson wrote:Very nice! :D This looks really cool.
Have you considered making the whole screen a bitmap a la MINIGRAFIK? That would solve all of the problems related to character memory limitations.
If you do it a la MINIGRAFIK the limits are still imposed by the character memory, so programs like MINGRAFIK or the super expander use a lower resolution. I like the idea of having a higher virtual resulation that is filled with characters on demand or in this case blocks of characters for frames.
Wilson wrote: How are applications going to run on top of GUI? If you want to take the FE3 route, it almost makes sense to just give each program its own memory bank and leave a bank for the GUI. That'd allow 15 programs to run at a time and solve any disputes that might otherwise occur over the sharing of RAM between programs. But there are a many people a lot more intelligent than me here that may have a better idea.

I assume you've put a fair amount of thought into how programs will interface with the GUI since you're planning to make a calculator. Care to share any details in that regard?
Actually I haven't put enough thought into the programming interface yet, since it is still evolving and at present not the easiest to use. A Basic extension/wedge would be cool. And a BASIC console of course, perhaps using a 4px wide font, so it fits into a frame ;)
In ASM the interface requires a lot of code atm, e.g.

Code: Select all

; create menu bar
menu_init:	; create main frame
		ldx #MAX_WIDTH
		ldy #16
		jsr frm_create
		ldx #BAR_POS_X
		ldy #BAR_POS_Y
		jsr frm_setpos
		ldy #FFLG_PERM
		jsr frm_setflags
		jsr frm_getwin
		sta h_bar
		jsr win_realize
		lda #WSTYLE_BCKGND
		jsr win_setstyle
		lda #1					; lower case system font
		jsr win_setfont

... create buttons, etc.

		; draw window			
		lda h_bar
		jsr win_draw
		lda h_bar
		jsr win_show			; to screen
		rts
I am also not sure yet about how to use the banks in FE3. According to the documentation all blocks switch bank simultaneously, so I don't know where to put the code needed from all banks. ($1000-$1FFF is video and char ram)
Wilson wrote: Keep up the good work! I look forward to future updates. :)
Thanks! :)
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

English Invader wrote:I don't think I'd want the VIC to have a GUI. It would destroy everything the VIC is about.
25 years ago I dreamed about putting 512K RAM into my VIC and allowing the VIC-I to see the lower 3K and other stuff. Now we get all the cool stuff and I like it. I have to admit, I do not want to open the case of my VIC and modify anything on the inside any more. And what I got so far runs on any off-the-shelf (PAL)VIC with 8K expansion.
Don't get me wrong, I don't think my point of view is right for everybody and I respect your opinion. Still I am curious, what is the VIC about?
User avatar
pitcalco
just pitcalco
Posts: 1272
Joined: Wed Dec 28, 2005 4:13 pm
Location: Berlin

Post by pitcalco »

:shock:
Wow!
What else can I say?

I would be on board with this.
There are only three kinds of people in the world: those who can count and those who can't.

Paul Lambert
Berlin
Federal Republic of Germany
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

you need about 5 minutes to click start then exit, wow :shock: :lol:

Just a suggestion, substitute the [START] button with a [VIC] button or better with a nice CBM chicken logo. :wink:
Mega-Cart: the cartridge you plug in once and for all.
User avatar
Wilson
Vic 20 Enthusiast
Posts: 190
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Post by Wilson »

Kananga wrote: Actually I haven't put enough thought into the programming interface yet, since it is still evolving and at present not the easiest to use. A Basic extension/wedge would be cool. And a BASIC console of course, perhaps using a 4px wide font, so it fits into a frame
Yes please! :D
Kananga wrote: I am also not sure yet about how to use the banks in FE3. According to the documentation all blocks switch bank simultaneously, so I don't know where to put the code needed from all banks. ($1000-$1FFF is video and char ram)
$0000-$0400 should be safe right? In that case, the only reasonable way I can think of would be to pass the function parameters on the stack and have all the universal GUI code in a single bank. You would also need a small routine in the cassette buffer or at the end of the stack to switch to this bank. Similarly, you would need a routine to switch back to the bank that the GUI routine was called from. If there are 256 or less GUI routines, the "ID" of the routine could be sent in A. Of course the GUI code would need to know which bank to return control to after the routine has been completed.
I envision something like this:

Code: Select all

 lda currBank ; the current bank # (so that control can return here after GUI subroutine)
 pha
 lda param1   ; first parameter for GUI routine
 pha
 lda param2   ; second parameter for GUI routine
 pha
 ...
 lda #$01     ; GUI routine ID number
 jsr callGUI  ; switch to GUI bank and do GUI routine #01
Thoughts?
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

nbla000 wrote:you need about 5 minutes to click start then exit, wow :shock: :lol:
You have to spend that much time, because there is nothing else to do yet ;)
Actually it is not that bad. It took me so long to make the screenshots, crop and save them. I could put the .prg somewhere, if I knew where, but as I said, besides clicking exit there is not much in it yet.
nbla000 wrote: Just a suggestion, substitute the [START] button with a [VIC] button or better with a nice CBM chicken logo. :wink:
I thought about that too. And make C= the hotkey for the menu ;)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Kananga wrote:I thought about that too. And make C= the hotkey for the menu ;)
Very nice choice, the [Start] button remembers me another OS :wink:

Just another thing, why you don't put the bar on top like Amiga Workbench, Atari ST OS, C64 GEOS ?
Mega-Cart: the cartridge you plug in once and for all.
gklinger
Vic 20 Elite
Posts: 2051
Joined: Tue Oct 03, 2006 1:39 am

Post by gklinger »

nbla000 wrote:Just another thing, why you don't put the bar on top like Amiga Workbench, Atari ST OS, C64 GEOS ?
Given the lack of real estate, why have a bar at all? I would think an X-windows-like clean slate approach would be more efficient.
In the end it will be as if nothing ever happened.
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

gklinger wrote:
nbla000 wrote:Just another thing, why you don't put the bar on top like Amiga Workbench, Atari ST OS, C64 GEOS ?
Given the lack of real estate, why have a bar at all? I would think an X-windows-like clean slate approach would be more efficient.
Sure, no problem. The bar is just a frame/window. It would be easy to pop-up a menu whenever the user clicks on the background like in X, because unhandled mouse events go to the root window.
gklinger
Vic 20 Elite
Posts: 2051
Joined: Tue Oct 03, 2006 1:39 am

Post by gklinger »

Kananga wrote:Sure, no problem.
Excellent! I'm a big fan of the minimalist desktop. The only crap I want on screen is the crap I put there. :)
In the end it will be as if nothing ever happened.
User avatar
robinsonmason
Vic 20 Enthusiast
Posts: 195
Joined: Sun Mar 14, 2010 9:17 pm

Post by robinsonmason »

Very cool!

I guess I would look at GEOS as a model of what can be done. It would also be neat to be able to run a game or two from the "desktop", even if it is nothing more than a text adventure.
Diddl
Vic 20 Afficionado
Posts: 425
Joined: Wed Jun 10, 2009 3:18 am

Re: Vic GUI

Post by Diddl »

Kananga wrote:(My FE3 isn't working yet, but that's another story)
Can I help you? Whats the problem with your FE3?
Post Reply