GUI in text mode?

All aspects of programming on the Commander X16.
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Question GUI in text mode?

Post 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.
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: GUI in text mode?

Post by Dacobi »

Nevermind. Found what I needed in Calliope Zsound code.
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Re: GUI in text mode?

Post 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
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
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: GUI in text mode?

Post by Dacobi »

Thanks for your reply.

I think I can get away with using just vtui_gotoxy and vtui_plot_char
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Re: GUI in text mode?

Post 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.
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
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: GUI in text mode?

Post 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ø : )
TomXP411
Posts: 1806
Joined: Tue May 19, 2020 8:49 pm

Re: GUI in text mode?

Post 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.
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: GUI in text mode?

Post 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.
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Re: GUI in text mode?

Post 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
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
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: GUI in text mode?

Post 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.
Post Reply