VTUI library

All aspects of programming on the Commander X16.
kelli217
Posts: 532
Joined: Sun Jul 05, 2020 11:27 pm

VTUI library

Post by kelli217 »



1 hour ago, desertfish said:




Also a tiny suggestion for any future version: add new routines (if any) at the end of the jump table, instead of inserting them in the middle.



Yes. I just had a similar discussion over on Quora with regard to Amiga libraries.

Software that was written for a previous version will still work if new functions' jump table entries are added to the end instead of shuffling things around. You don't want other developers' apps to break when you make updates.

User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

VTUI library

Post by JimmyDansbo »


When I wrote the mock-up of midnight commander, I needed a way to copy text from one place on screen to another, but without copying the color information. The new functionality in print_str is meant as a step on the way to achieving that. I may not be a stop in the right direction, in which case I will remove the feature again, but for now the option is there.

In the future, new routines will be added to the bottom of the jump table. I had the exact same troubles when I updated my example code.

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

VTUI library

Post by JimmyDansbo »


I have manged to free up an extra 50 bytes in the library, so I think it is time to try and add a feature or two.

Looking through the posts in this subject I have found the following that is not yet implemented.


  1. Scrolling text within a "window"


  2. Getting a size-constrained string from keyboard


  3. Word-wrap at a specific length.


  4. Support for multiple character sets.


I am afraid that option 1 is not doable within the 1KB range, but if that is the one you all point to, I will give it a shot.

Which one would you guys most like to see added to the VTUI library? Have I missed something that is even more important?

Let me know 

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
User avatar
kliepatsch
Posts: 247
Joined: Thu Oct 08, 2020 9:54 pm

VTUI library

Post by kliepatsch »


My personal favourite is the string input routine. Give x and y and maximum length of the string. Backspace to delete, enter to confirm. That's it. Oh, and of course there needs to be a string buffer. The pointer to it can also be in one of the ZP variables. I don't know if it would be doable in the remaining space. But if it does, it would be awesome! ?

User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

VTUI library

Post by JimmyDansbo »


@Greg King Thanks. I am afraid that in the meantime things have changed again and I have actually updated both the source and the documentation.

If you find that I am overconfident, please let me know and show me once more.

Thank you very much for your interest and your help

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
Greg King
Posts: 162
Joined: Wed Jul 08, 2020 1:14 pm

VTUI library

Post by Greg King »



2 hours ago, JimmyDansbo said:




@Greg King Thanks. I am afraid that in the meantime things have changed again and I have actually updated both the source and the documentation.

If you find that I am overconfident, please let me know, and show me once more.



I know -- 0.6 version.  Those links are current -- try them.

User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

VTUI library

Post by JimmyDansbo »



12 hours ago, Greg King said:




I know -- 0.6 version.  Those links are current -- try them.



Ahh... Finally I see it. I had it mixed.

Here in Denmark we have a saying: The eyes are usually the first to go blind...

Anyway, I bumped the version to 0.6a as there are a few changes in usage. - See the downloads section or github.

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
User avatar
Jakebullet70
Posts: 15
Joined: Sat Nov 21, 2020 8:18 pm

VTUI library

Post by Jakebullet70 »


I am a little confused here. (Normal for me) Can this be called from BASIC or only ASM programs at this point? 

If you do not see any flak... Your not on target!
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

VTUI library

Post by JimmyDansbo »



44 minutes ago, Jakebullet70 said:




Can this be called from BASIC or only ASM programs at this point?



The VTUI library is designed to be called from the likes of Assembler and C. It is not designed to be called from BASIC.

When that is said, it should be possible to call the library from BASIC by POKE'ing the needed values to 780-782 for CPU registers and 02-.. for zeropage registers and then calling the needed function with SYS


Quote




5 REM LOAD LIBRARY TO ADDRESS $400

10 LOAD"VTUI0.6A.BIN",8,1,$400

15 REM INITIALIZE THE LIBRARY

20 SYS $400

25 REM SET .A CPU-REG TO 0 FOR 40X30 MODE

30 POKE 780,0

35 REM CALL VTUI-SET-SCREEN

40 SYS $402



For more information on passing CPU registers from BASIC, have a look at this page: https://www.c64-wiki.com/wiki/SYS

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
Post Reply