VTUI library
- JimmyDansbo
- Posts: 476
- Joined: Sun Apr 26, 2020 8:10 pm
- Location: Denmark
- Contact:
VTUI library
Now there is an input_str function...
That took up a lot of space. Library size went from 900 bytes in 0.7 to 1008 now in 0.8
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
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
- kliepatsch
- Posts: 247
- Joined: Thu Oct 08, 2020 9:54 pm
VTUI library
Whohoo you did it! Now VTUI Library seems almost maxed out. Really impressive. Thanks!
- desertfish
- Posts: 1097
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
VTUI library
the input_str() routine, does it return the input string in petscii or in screencodes?
- JimmyDansbo
- Posts: 476
- Joined: Sun Apr 26, 2020 8:10 pm
- Location: Denmark
- Contact:
VTUI library
2 minutes ago, desertfish said:
the input_str() routine, does it return the input string in petscii or in screencodes?
The string is returned in PETSCII. I will update the documentation to make that clear.
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
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
- desertfish
- Posts: 1097
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
VTUI library
Playing some more with input_str.... :
entered string in buffer seems to be terminated by a zero byte (I like this!)
... this probably means you want to allocate 1 byte more in your input buffer to have room for this. Maybe good to document this too
after pressing enter, the cursor remains visible. I expected it to disappear
i cannot enter petscii symbols (or capitals when in lowercase character mode) ?
- JimmyDansbo
- Posts: 476
- Joined: Sun Apr 26, 2020 8:10 pm
- Location: Denmark
- Contact:
VTUI library
@desertfish
String in buffer is NOT zero terminated. If you type a string an press backspace before return, you will see
I actually meant to document my way out of the cursor not disappearing, but I may have to just use the 8 extra bytes and hide it before return
input_str supports the same characters as print_str
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
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
- desertfish
- Posts: 1097
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
- JimmyDansbo
- Posts: 476
- Joined: Sun Apr 26, 2020 8:10 pm
- Location: Denmark
- Contact:
VTUI library
12 minutes ago, desertfish said:
About zero termination, I'm a bit confused
I share your confusion. I am currently looking into why those 0's are added to the buffer.
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
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
- JimmyDansbo
- Posts: 476
- Joined: Sun Apr 26, 2020 8:10 pm
- Location: Denmark
- Contact:
VTUI library
@desertfish, I figured it out.
I store anything that is returned by the GETIN Kernal function in the buffer, but only if the character is within the allowed range is the length incremented.
This means that so long as the user has not used all allowed characters, you will essentially have a zero-terminated string, but if the user uses the full allowed length, there is no zero added to the end of the buffer.
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
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
- JimmyDansbo
- Posts: 476
- Joined: Sun Apr 26, 2020 8:10 pm
- Location: Denmark
- Contact:
VTUI library
I have been toying with the notion that maybe I could use a kernal function to do the conversion between petscii and screencodes. Unfortunately it seems that the only place the kernal converts from petscii to screencodes is in a function that also prints the character to the screen.
My next thought is that I could possible make use of kernal functions in the VTUI library instead of writing directly to VERA. I am fairly sure that if I change the library to use kernal routines, the size will be decreased a fair bit and it would most likely be better at converting between petscii and screencodes.
What are your thoughts? Would there be any problems in using kernal routines instead of writing directly to VERA?
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
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