Page 1 of 1

Dumb question: Print color

Posted: Mon Jul 09, 2012 12:33 pm
by Rink
Hi,

This is probably the stupidest question I've ever asked but since I can't figure it out, I have no choice. :lol:

How can I change the colour of the text printed by the BASIC print commands? COLOR() only seems to affect high resolution graphics and apart from that, I have no ideas. Ideally I'm looking for white/buff text on a black background and don't want to waste memory by implementing my own text display routines or by using hi-res graphics when the text mode will do.

Any ideas?

Cheers.

Re: Dumb question: Print color

Posted: Mon Jul 09, 2012 1:24 pm
by Sarah
You need to find out the control sequence that your printer recognises for changing the ink colour. Then simply send it to the printer prior to whatever you want to print in that colour.

e.g. PRINT #-2, CHR$(whatever);CHR$(whatever);CHR$(whatever);

Replace the various 'whatever' with the ASCII values that the printer expects.

Re: Dumb question: Print color

Posted: Mon Jul 09, 2012 1:26 pm
by Rink
Sorry, my bad there - I blame the terminology adopted by BASIC - I meant the on-screen colours for the video display. :)

Re: Dumb question: Print color

Posted: Mon Jul 09, 2012 1:37 pm
by sixxie
You only have two colour set options in text mode (though you can invert - see "lower case" characters): Dark Green / Green and Dark Orange / Bright Orange.

Re: Dumb question: Print color

Posted: Mon Jul 09, 2012 1:42 pm
by Sarah
You want to change the text mode colours? :shock:

Sorry - you can't; they're fixed!

The only possibilities are inverting them or selecting the "orange" variants.

So these are all the options:

dark green on light green
light green on dark green
dark orange on light orange
light orange on dark orange

The dark colours are often described as "black" but they're not really true black and don't match with CHR$(128).

If you want the "orange" set instead of the "green" set then do SCREEN0,1 but it won't persist if you use the standard BASIC output routines (e.g. the PRINT command) because all the text mode attributes (equivalent to SCREEN0,0) are restored every time those are invoked.

Edit: Sorry, posted at the same time as sixxie!

Re: Dumb question: Print color

Posted: Mon Jul 09, 2012 1:47 pm
by Rink
Drat. :) I thought everything was fixable with a machine code hack or something back in the day. :lol:

I suppose the black on green gives it that special "Dragon" personality; but I'll see how much spare memory I end up with and maybe do a hi-res thing instead in.

Thanks very much for the info anyway. I wasn't aware of the "orange" mode so will have a play with that just for laughs.

Cheers.

Re: Dumb question: Print color

Posted: Mon Jul 09, 2012 9:50 pm
by Alastair
There was a program in one of the issues of Dragon User that inverted the text colours giving light green text on a dark green background (or light orange text on a dark orange background, if you wanted). According to Simon's database you want either the July 1986 (with corrections in the September 1986 issue) or October 1987 issue.

My own method for alleviating the green screen problem is to turn down the colour of the TV, this gives a far more pleasant dark grey text on light grey background!

Re: Dumb question: Print color

Posted: Tue Jul 10, 2012 12:28 am
by Sarah
Alastair wrote:There was a program in one of the issues of Dragon User that inverted the text colours giving light green text on a dark green background (or light orange text on a dark orange background, if you wanted).
I think this recent upload from zephyr also does the same thing:
viewtopic.php?f=7&t=716

Re: Dumb question: Print color

Posted: Tue Jul 10, 2012 8:51 am
by Rink
Cool. I'll have a play with those too - cheers guys.

Alastair - looks like I'll have to start reading Dragon User, I didn't realise it contained nice programming hints like that. Cheers mate.

Re: Dumb question: Print color

Posted: Tue Jul 10, 2012 10:19 am
by robcfg
If you use the graphic characters, you can use all the colours, as far as I remember.

Think of the microdeal text mode loading screens.

Also you can make a program to print all characters and see which are available in several colors, as they are also the base of the semigraphics modes.