Page 1 of 2

VTUI Library

Posted: Mon Jan 16, 2023 1:57 pm
by JimmyDansbo
VTUI (Vera Text User Interface) library
Version 1.2

Can be used to create text user interfaces using VERA instead of relying on the KERNAL functions for writing to screen.

The library is less than 1KB which means it can be loaded into Golden RAM at $400. As an alternative, include files are provided for Acme and CA65 assemblers as well as CC65 compiler.

See https://github.com/JimmyDansbo/VTUIlib for documentation, examples and include files.
vtui-logo.jpg
vtui-logo.jpg (59.9 KiB) Viewed 11891 times
vtui-mc.jpg
vtui-mc.jpg (176 KiB) Viewed 11891 times
v0.8.scrennshot.jpg
v0.8.scrennshot.jpg (377.8 KiB) Viewed 11989 times
The latest binary of the library can be downloaded here:
VTUI1.2.BIN
(976 Bytes) Downloaded 221 times
Below is a program that demo's some of the functionality of the VTUI library, VTUI1.1.BIN must be placed in the same directory as DEMO.PRG
DEMO.PRG
(8.58 KiB) Downloaded 156 times

Try It Now!

#r45

Re: VTUI Library

Posted: Wed Jan 18, 2023 5:49 am
by TomXP411
This looks great, Jimmy! It reminds me of Borland's text based GUI that they used for Turbo C++ and Turbo Pascal.

Re: VTUI Library

Posted: Mon Jan 23, 2023 2:35 pm
by JimmyDansbo
I am happy to announce that I have released version 1.0 of the VTUI library.
Now with even more functions as well as support for inclusion in CC65 C projects.
All images, downloads and links in top post are edited to correspond to version 1.0

As always, please let me know if you find any bugs or errors, or if you have questions or comments.

Re: VTUI Library

Posted: Tue Jan 24, 2023 6:40 am
by codewar65
ncurses for cx16?

Re: VTUI Library

Posted: Tue Jan 24, 2023 6:51 am
by JimmyDansbo
ncurses and the old Pascal Crt library were both inspirations.
The VTUI library is not at all as capable as one of the main goals I set was that it should fit in a single KB of memory.
Feel free to play around with the library and don't hesitate to let me know if you have questions, comments or have found a bug.

Re: VTUI Library

Posted: Mon Jul 03, 2023 5:33 am
by Martin Schmalenbach
Quick question on using fill_box, border, save_rect, load_rect

If I first use gotoxy and then any of the above will that effectively mean I will get a filled box, a border box, save & restore of a rectangle of specified height and width with the top left corner providing the effective zero datum for these functions?

I don't want to be working with rectangles etc that are only referenced to the 0,0 location in the text screen!

Many thanks in advance.

Re: VTUI Library

Posted: Sun Jul 16, 2023 8:45 am
by JimmyDansbo
Correct, the fill_box, border, save_rect and load_rect functions have their top left corner at the current VERA address which can be set with the gotoxy function.

I will try to update the documentation to make this more clear.

Re: VTUI Library

Posted: Mon Dec 18, 2023 8:27 pm
by oodler
I have started playing with this to do a vi-inspired modal editor in prog8 - don't get excited, still learning. But I had a question that is not related and I figured I'd just keep things in this thread.

This example in the prog8 repo has a "bug", it is an adaptation of the DEMO.PRG:

Image

Should be more like,

Image

In learning vtui and prog8 (and everything else basically), and I trying to figure out how to "fix" it. I've located the initial copy of the logo before the screen is cleared and redrawn, and basically just copied to a new subroutine that will take the same area and save it into memory without clobbering the saved logo in memory. I have not quite worked out how to do this but can break it in informative ways. I am missing some pieces of insight:

Image

The new subroutine results in partially overwriting the original save rectangular area.

Image

I need a patient person to explain to me how the memory addresses can be adjusted, and maybe point to some resource that can give me something to read more about it. I have tracked down the prog8 binding to VTUI1.0.BIN and its source, https://github.com/JimmyDansbo/VTUIlib/ ... eneric.asm.

TIA!

Re: VTUI Library

Posted: Tue Dec 19, 2023 6:10 pm
by JimmyDansbo
I am not exactly sure what it is you are asking.

What I can tell you is that the original DEMO.PRG starts out by creating a 7x7 character area filled with spaces, it then saves the logo to another point in memory.

When arrowkeys are pressed, the logo is first overwritten with the area created with spaces and the logo is then drawn at the new coordinates from the saved version.

I am not sure why the store_logo and store_where_logo_was functions are using vtui.save_rect twice ?

Re: VTUI Library

Posted: Wed Dec 20, 2023 5:17 am
by oodler
JimmyDansbo wrote: Tue Dec 19, 2023 6:10 pm ...
I am not sure why the store_logo and store_where_logo_was functions are using vtui.save_rect twice ?
Sorry that was kind of incoherent. This helps a lot. It's a prog8 example, so I think I'll play around more with it to see what I learn. With your implication that it should be only called once, can you tell me what $80 is for and what $0000 is pointing to? (still super n00b here). Thanks!