Page 1 of 2
GUI in text mode?
Posted: Tue Apr 11, 2023 9:45 am
by Dacobi
I've been reading the programmers guide but can't figure out how to write a text character to a specific cursor pos with a specified fore/background color?
Is it just in the normal VERA VRAM?
If anyone has an example it would be very appreciated. I'm using C but ASM would also be useful.
Re: GUI in text mode?
Posted: Tue Apr 11, 2023 1:49 pm
by Dacobi
Nevermind. Found what I needed in Calliope Zsound code.
Re: GUI in text mode?
Posted: Tue Apr 11, 2023 7:40 pm
by JimmyDansbo
If you want to use kernal functions, you can use the
plot function to place the cursor on specific coordinates. Then you use
PETSCII codes to change color for both foreground and background (PETSCII $01). Last you use
chrout to output characters and other PETSCII codes.
You could also have a look at
VTUI library if you don't want to use kernal functions.
Or you could write directly to VERA
Re: GUI in text mode?
Posted: Tue Apr 11, 2023 10:28 pm
by Dacobi
Thanks for your reply.
I think I can get away with using just vtui_gotoxy and vtui_plot_char
Re: GUI in text mode?
Posted: Wed Apr 12, 2023 5:14 am
by JimmyDansbo
Glad to hear that the VTUI library might be useful for you. Let me know if there are any questions or comments.
If you are only going to use gotoxy and plotchar, you may want to roll your own functions, you are welcome to copy from the VTUI library, they are only a few instructions each and hopefully the source has enough comments to be understandable.
Re: GUI in text mode?
Posted: Wed Apr 12, 2023 6:04 am
by Dacobi
I might end up making the functions I need in C. Using your code as a reference.
Forresten hvor bor du henne? Jeg bor på Samsø : )
Re: GUI in text mode?
Posted: Wed Apr 12, 2023 4:38 pm
by TomXP411
Dacobi wrote: ↑Wed Apr 12, 2023 6:04 am
I might end up making the functions I need in C. Using your code as a reference.
Forresten hvor bor du henne? Jeg bor på Samsø : )
Which C compiler are you using? The conio library should already include gotoxy and color commands.
Re: GUI in text mode?
Posted: Wed Apr 12, 2023 6:13 pm
by Dacobi
Which C compiler are you using? The conio library should already include gotoxy and color commands.
I'm using cc65. I was just hoping that writing directly to VERA would speed things up compared to the conio functions, but I haven't tested yet.
Re: GUI in text mode?
Posted: Wed Apr 12, 2023 7:43 pm
by JimmyDansbo
Dacobi wrote: ↑Wed Apr 12, 2023 6:04 am
Forresten hvor bor du henne? Jeg bor på Samsø : )
Jeg bor på Nordyn
If you happen to come by nordfyn at the end of September, be sure to drop in on
Retro Computing Fest
Re: GUI in text mode?
Posted: Wed Apr 12, 2023 8:50 pm
by Dacobi
If you happen to come by nordfyn at the end of September, be sure to drop in on Retro Computing Fest
Sound interesting. I'll mark the date and see how my schedule is at the time.