How to clear Screen and other things.

Basic and Machine Language

Moderator: Moderators

Post Reply
mysecretgarden
Vic 20 Newbie
Posts: 16
Joined: Thu Sep 18, 2008 2:10 pm

How to clear Screen and other things.

Post by mysecretgarden »

Hi! It's a long time, that don't visit this forum, but now I decided to start programming the vic20 with the CC65 compiler.

I need a basic information, how I can clear the screen in C?
Maybe i need to use some poke addres??

Thanks!
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

From C you should be able to call clrscr() which calls the commodore ROM functiom I think.

You need to include <conio.h>
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

here is a good deal of info on the main functions available:

http://www.cc65.org/doc/funcref.html

remember you can printf() or cprintf() the petscii chars, like the "reversed heart", as you'd do in basic:

printf("\x93 ...... "); // clear the screeen than print something
mysecretgarden
Vic 20 Newbie
Posts: 16
Joined: Thu Sep 18, 2008 2:10 pm

Post by mysecretgarden »

hawk wrote:From C you should be able to call clrscr() which calls the commodore ROM functiom I think.

You need to include <conio.h>
Thanks!!!!
mysecretgarden
Vic 20 Newbie
Posts: 16
Joined: Thu Sep 18, 2008 2:10 pm

Post by mysecretgarden »

pallas wrote:here is a good deal of info on the main functions available:

http://www.cc65.org/doc/funcref.html

remember you can printf() or cprintf() the petscii chars, like the "reversed heart", as you'd do in basic:

printf("\x93 ...... "); // clear the screeen than print something

Thanks!!!!
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

you're welcome, and nice to see someone nearby working on the vic :-)
mysecretgarden
Vic 20 Newbie
Posts: 16
Joined: Thu Sep 18, 2008 2:10 pm

Post by mysecretgarden »

pallas wrote:you're welcome, and nice to see someone nearby working on the vic :-)

Nice to meet you!!! ;)
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

pallas wrote:here is a good deal of info on the main functions available:

http://www.cc65.org/doc/funcref.html

remember you can printf() or cprintf() the petscii chars, like the "reversed heart", as you'd do in basic:

printf("\x93 ...... "); // clear the screeen than print something
Be cautious about using printf() unless you really need to. It's part of stdio.h module and is quite large.

You're better to try and keep to the conio.h functions if you can.
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

hawk wrote:
pallas wrote:here is a good deal of info on the main functions available:

http://www.cc65.org/doc/funcref.html

remember you can printf() or cprintf() the petscii chars, like the "reversed heart", as you'd do in basic:

printf("\x93 ...... "); // clear the screeen than print something
Be cautious about using printf() unless you really need to. It's part of stdio.h module and is quite large.

You're better to try and keep to the conio.h functions if you can.
Yes, the conio.h functions are smaller and faster (I believe they directly run kernal routines), while the ones in stdio.h support scrolling (which you may not need).
Post Reply