Changing from all uppercase to mixed?

Started by xlar54, June 26, 2006, 03:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xlar54

ANyone know how to do this via pokes?

istvan

Sorry to respond to an ancient post, but I saw this one and thought I'd give it a shot.

I couldn't tell you how to do this in 40-col mode, but in 80-col it's easy.  There's a variable called COLOR at $F1.  My memory map says it holds the character color to print, but in 80-col mode it holds the actual attribute that gets written to VDC attrib memory.  Bits 3-0 are the color code (VDC color code, not the normal Commodore codes), bit 7 is clear for upper/graphics or set for upper/lower, bits 6-4 control underline, flash, and reverse, but I don't remember which goes with which.  To my knowledge, all of the KERNAL (and therefore BASIC) print routines use the value in COLOR.

The VDC color codes use the following scheme:  bit 3 = red, bit 2 = green, bit 1 = blue, bit 0 = intensity.

        00 dark black
        01 light black
        02 dark blue
        03 light blue
        04 dark green
        05 light green
        06 dark cyan
        07 light cyan
        08 dark red
        09 light red
        10 dark purple
        11 light purple
        12 dark yellow
        13 light yellow
        14 dark white
        15 light white

So, clear bit 7 of $F1 and subsequent PRINTs will be in upper/graphics, set bit 7 and you'll be in upper/lower.

POKE 241, color code : REM SWITCH TO UPPER/GRAPHICS
POKE 241, (128 OR color code) : REM SWITCH TO UPPER/LOWER

Stephane Richard

That was about to be my next question. You two aren't psychics are you? ;-).

Thanks for the answer istvan.  I knew from old books that you could have all 512 avaialble in VDC mode, but I didn't know how.  There's my answer ;-)

Edited: I think it's a good idea to answer questions even if in old posts.  I think one of the roles of a website like this one is to serve as a reference site as well as it's other purposes.  For those reasons, you'll notice I did the same thing you did and answered a question about making the numeric keypad available in 64 mode.  :-).

People wanna know, they will be able to here :-).
When God created light, so too was born, the first Shadow!

MystikShadows

xlar54

Agreed :) I still come back and read the new replies :)

bill.mann

Quote from: xlar54Agreed :) I still come back and read the new replies :)
I'm only able to check in about once a week at the moment (working away from home) - it's bloody amazing how many new posts (around 70 in the last week!) there are. But it is good when people pick up on some of the older posts & make comments or replies - especially when the answer might not have been posted first time around.

Makes for a lot of reading though :/

xlar54

Yep... this site is easily THE definitive site for 128 info.  I wanted to start a site myself, but time was my enemy, and when I saw what Lance was doing, I wanted to help out as much as I could.  Just takes us all checking in from time to time to help keep it going.  Too many 64 game sites out there and not enough 128.  I never played games much... oh, Id leech stuff as much as anyone (...anyone with a 2400 baud modem...hehehe), but Id play it once or twice and never play again.  Programming to me was much more interesting.  My current "waste-o-time" is MAME - playing Ms Pac Man believe it or not... Simple, elegant, and hard as hell... I have my eyes on building a MAME cabinet... that would rock...

Stephane Richard

Amen to that xlar.  I think a MAME cabinet would definitaly rock.  and of course, you're completely right about Lance's website.  for 128 stuff I don't google, I look here first...then google :-)
When God created light, so too was born, the first Shadow!

MystikShadows

Edwing

There is a poke I don't remember right now that will alter the flag normally toggled by pressing SHIFT-CBM, thus archieving what you are looking for.

A way of doing this WITHOUT pokes (and working fine in 40 col mode, too ;) ) would be the same as on the 64: CTRL-N for lower case/upper case, CTRL-SHIFT-N for upper case/graphics. The first one is CHR$(14), the second CHR$(142).

If you press CTRL-N, the screen will switch to lower case, except for if you had entered an uneven number of quotation marks before, in which case a reverse "n" is displayed. In this way you can incorporate the character into BASIC programs (or even ML programs using the kernal output routines) for switching to lower case (just like you would do with Shift-Home for clearing screen - I prefer that to incorporating the expression CHR$(147) into programs) - but how to do that with switching to upper case?

Best is, when writing a program, to type two quotation marks (second one for switching off quotation mark mode), then deleting the second one, switching to reverse characters with CTRL-9, type SHIFT-N, switching to normal characters again with CTRL-0... Afterwards your program line should look like:
10 PRINT"*THIS SHOULD APPEAR IN UPPERCASE
except for that in place of the asterisk there's going to be a reverse shifted "n" (or, if uppercase mode is active, the appropiate gfx character.)

BTW, did you guys know you also can enter an ESC character that way, without any explicit CHR$(27)? Just incorporate a reverse "[" (i.e. CTRL-[) into the string... Only problem is that it will be executed when LISTing, so you could have a program doing sensible things like switching the screen to reverse every time it is listed :P There's patches somewhere out there to prevent the LIST routine from doing that. But CTRL-n and CTRL-N are "safe" for listing.

Oh, by the way: Basic 7.0 keeps separate flags for both screen editors (40 & 80 col), so you can have seperate modes on each of the screens, and changing mode
- no matter if by PRINT or POKE 241,x - will only affect the current screen (i.e. that one the cursor blinks on or the PRINTs go to.)

Regards,
George :)