Typing inverse characters

Basic and Machine Language

Moderator: Moderators

Post Reply
ChrisF
Vic 20 Newbie
Posts: 3
Joined: Thu Oct 30, 2008 1:07 pm

Typing inverse characters

Post by ChrisF »

Hello world,
I'm new to the VIC20. Back in the day it was a but before my time (my first computer was a Spectrum+2). Anyway, I bought a VIC to see how Jetpac compared to the Spectrum version, and then I found it was rather nice to type on so I decided to try some typeins I found on the net. Unfortunately, most of them contain inverse characters and I can't work out how to type them (my computer is in perfect working condition as far as I can tell, but it didn't come with any manuals, so forgive me if I'm asking something really basic and silly). Can somebody out there put me out of my misery please?
cheers
Chris
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

The inverse characters are special control characters that tell the VIC to do something like move a cursor in a specific direction, or change the colour of the output in a print statement when the program is RUN.

Most are obtained by pressing either SHIFT or the Commodore key at the same time you press a colour key (numbers 1 to 9?) or one of the cursor directional keys. Revers Video control characters can also be obtained this way (on the right side, top row, a little past the number characters....can't remember exactly which keys now).

Most of them will only show up after you have typed the first quotation marks in a PRINT or INPUT statement. Play around with them this way and you will so be able to tell which is which. In fact, COMPUTE! magazine always had a page telling you which was which....so if you can find a COMPUTE! magazine archive online, I'm sure you'll be able to find this page.
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Image
:wink:
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

I really wish we had a scan of that page somewhere on the wiki. I have it. I know. I'll have to find it.
High Scores, Links, and Jeff's Basic Games page.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

beat me by seconds.
High Scores, Links, and Jeff's Basic Games page.
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

Jeff-20 wrote:I really wish we had a scan of that page somewhere on the wiki.
Done.

http://sleepingelephant.com/denial/wiki ... characters
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

But the commodore + 1 to 8 combinations doesn't work on vic-20... That's for c64 etc...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

Boray wrote:But the commodore + 1 to 8 combinations doesn't work on vic-20... That's for c64 etc...
Thanks for that info....added to Wiki article.
ChrisF
Vic 20 Newbie
Posts: 3
Joined: Thu Oct 30, 2008 1:07 pm

Post by ChrisF »

Thanks, that was what I needed to know.
cheers
Chris
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

As a side note, on the C64 you can hold CTRL and press any letter except M to get that one inversed within quotes. Those extra control codes work on a VIC-20 too, just that it doesn't allow you to type them in that way. I suppose that difference lays within the Kernel, not Basic ROM?

An alternative way to get control codes:
1. PRINT""
2. Delete the last quote character
3. Press CTRL+9 (RVS ON)
4. Type the desired control code character
5. Press CTRL+0 (RVS OFF)
6. If you want to stay in quote mode, make one " and go on
7. If you want to end the PRINT statement, make two "" and delete one

Perhaps it sounds more complicated than it is.

Now you may ask what nice little secrets you can obtain. Here is a possibly incomplete list, where CTRL is used to clarify it is a control code:

CTRL+E : White text (duh)
CTRL+H : Locks switching upper/lower case (C= + SHIFT)
CTRL+I : Unlocks case switching
CTRL+M : Carriage return, will be converted to a such in listings
CTRL+N : Switch to lower case
CTRL+Q : Cursor down (duh)
CTRL+R : RVS ON (duh)
CTRL+S : Home cursor (duh)
CTRL+SHIFT+N : Switch to upper case
CTRL+SHIFT+P : Black text
CTRL+SHIFT+Q : Cursor up
CTRL+SHIFT+R : RVS OFF
CTRL+SHIFT+S : Clear screen

All those can of course be obtained with CHR$ codes too, but it may look more cool to include them as control codes in a PRINT statement. It can also save a few bytes in tight cases. In particular CTRL+H and CTRL+N may be nice in a program where you use Upper + Lower case and don't want the user to switch to the graphics character set.
Anders Carlsson

Image Image Image Image Image
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

Thanks Carlsson, that info has been added to the Wiki article.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Is there a CTRL code to insert large spaces, something equivalent to a TAB(X)? I remember looking at the LISTing of Blue Meanies from Outer Space once. They inserted huge spaces for fewer bytes than a SPC or TAB command.
High Scores, Links, and Jeff's Basic Games page.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I can't think of anything like that. I downloaded Blue Meanies and I believe it is this line you refer to:

4 PRINT:PRINT:PRINT"{4 SPC}{RVS ON}{14 SPC}{RVS OFF}":PRINT"{4 SPC}{RVS ON} BLUE MEANIES {RVS OFF}":PRINT"{4 SPC}{RVS ON}{14 SPC}{RVS OFF}"

That line expands to 97 characters, or almost 4.5 rows. The trick to fit it all in one line is of course to use ? for PRINT when you enter it, only 77 characters out of a maximum of 88.

On the C64 there were small hacks that lets you enter a Basic line up to 255 characters. I believe those exist for the VIC too, or at least would be easy to convert if desired. I remember the topic has been up to discussion before.

Duane Later has squeezed several lines > 88 characters into Blue Meanies, probably by using plenty of abbreviated keywords. The drawback is that a such line is much harder to edit if you need to fix something.
Anders Carlsson

Image Image Image Image Image
Post Reply