Page 8 of 11

VTUI library

Posted: Sat Feb 27, 2021 4:03 am
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.


VTUI library

Posted: Sat Feb 27, 2021 7:24 am
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.


VTUI library

Posted: Sat Feb 27, 2021 5:31 pm
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 


VTUI library

Posted: Sat Feb 27, 2021 7:16 pm
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! ?


VTUI library

Posted: Sat Feb 27, 2021 7:19 pm
by Greg King

VTUI library

Posted: Sat Feb 27, 2021 7:28 pm
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


VTUI library

Posted: Sat Feb 27, 2021 9:42 pm
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.


VTUI library

Posted: Sun Feb 28, 2021 9:18 am
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.


VTUI library

Posted: Tue Mar 02, 2021 4:57 am
by Jakebullet70

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


VTUI library

Posted: Tue Mar 02, 2021 5:41 am
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