VTUI library

All aspects of programming on the Commander X16.
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

VTUI library

Post by JimmyDansbo »


Does anyone use the Acme or Ca65 include files for the VTUI library?

I ask because I am contemplating a restructure that probably will mean significant change in the include files...

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
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

VTUI library

Post by desertfish »


I am using the assembled BIN file only, so no impact for me

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

VTUI library

Post by JimmyDansbo »


Library updated to version 0.7


Only real usage change is that print_str no longer accepts a zero-terminated string. Instead the length of string is provided in .Y also a lot of the functions can now skip color information if VERA stride is set to 2.

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
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

VTUI library

Post by desertfish »



3 hours ago, JimmyDansbo said:




no longer accepts a zero-terminated string. Instead the length of string is provided in



aw... this now means for Prog8, that I have to iterate strings twice to print it (once to determine its length based on 0-termination, and then again in VTUI while printing it).  It is what it is, I suppose. At least for constant strings I always know the lengths beforehand.

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

VTUI library

Post by JimmyDansbo »



20 minutes ago, desertfish said:




aw... this now means for Prog8, that I have to iterate strings twice to print it



I am sorry for the inconvenience, but since print_str supports writing screen codes directly, we can not use a value as termination as all 256 bytes are occupied by characters.

@desertfish, I could possibly support zero-termination if the string is converted... Would that 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
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

VTUI library

Post by desertfish »



1 hour ago, JimmyDansbo said:




we can not use a value as termination as all 256 bytes are occupied by characters



That makes sense... I actually don't have a proper way of dealing with screencode strings in Prog8 that require a zero character. It's always the terminator.

As for supporting it for converted strings: it would help a bit, but I think it's best to have a consistent API over sometimes supporting it and sometimes not supporting it (which could lead to confusion)

SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

VTUI library

Post by SlithyMatt »


NULL is still NULL, there is no other control character mapped to zero. You should be able to use null termination, no problem. Doing a CHROUT with NULL has no effect.

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

VTUI library

Post by JimmyDansbo »



2 hours ago, SlithyMatt said:




NULL is still NULL, there is no other control character mapped to zero.



When we are talking screencodes in VERA, 0 = @

So a zero-terminated string that is not converted from petscii to screencodes would not be able to write the @ sign.

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
SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

VTUI library

Post by SlithyMatt »



1 hour ago, JimmyDansbo said:




When we are talking screencodes in VERA, 0 = @



Ok, it wasn't clear that you were talking about screen codes. Yeah, in that case you don't have a safe terminating character.

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

VTUI library

Post by BruceMcF »



20 hours ago, desertfish said:




That makes sense... I actually don't have a proper way of dealing with screencode strings in Prog8 that require a zero character. It's always the terminator.



As for supporting it for converted strings: it would help a bit, but I think it's best to have a consistent API over sometimes supporting it and sometimes not supporting it (which could lead to confusion)



A counted string that was converted FROM screencodes could be converted to one that was nul terminated. Then its the screencode converting routine that takes the count, not print_str.

Post Reply