Pages

Friday, 13 August 2021

Vanquishing the Green Monster: Accessing the MC6847's Lesser-known Screen Colours

Some Coco users may wonder why the MC-10 seems to be able to use the alternate screen colours so much more easily than the Coco. Allen Huffman has a post about the difficulties of accessing these other screen modes on the Coco over on the Vintage is the New Old site. 

The TRS-80 MC-10 doesn't automatically switch back to the Green screen like the Coco does. If you POKE49151,64 you get the orange mode and you stay in that mode until you POKE49151,0 or use the SOUND command.  This has enabled me to make a fair number of games using these alternate screens (see the above for a few examples).  I have a bunch of Basic routines that allow me to use the alternate color sets without having to resort to hardware modifications.

The first trick I use is a routine for printing reverse video easily on the MC-10. Here's my latest version: 

0 DIMC1,C2,M$,MC:M=16384:GOTO10

7 C1=(PEEK(17024)AND1)*256+PEEK(17025)-1+M:FORC2=1TOLEN(M$):C3=ASC(MID$(M$,C2)):POKEC1+C2,C3-(C3AND64):NEXT:?@C1-M+C2,:RETURN

10 PRINT:INPUT M$:GOSUB7:GOTO10
To make this routine work on the Coco all you have to do is switch the PEEKS in line 7, which are just the ROM locations for storing the current location of the print cursor, and the screen memory location from M=16384 to M=1024.

The other routine I use is a little machine language routine by Greg Dionne, that changes the color used for new lines when the screen scrolls.
0 CLS0:CLEAR260,36762:DIMC2,C3,C4,M,CC,ZZ,VP,M$,I$,K$,W$:M=16384:M$="O"+"K":W$=CHR$(127):GOSUB15:GOTO10
5 FORCC=1TO16:GOSUB6:NEXT:PRINT@.,;:RETURN
6 PRINT@511,W$;:POKEM+479,32:RETURN

10 GOSUB5:PRINT@480,;:M$="HELLO WORLD!":GOSUB7:PRINT@0,;:END

15 FORCC=0TO103:POKE36762+CC,PEEK(64022+CC):NEXT:DATA49,49,60,55,54
16 FORCC=0TO4:READC2:POKE36762+CC,C2:NEXT:POKE36855,32:POKE17033,143:POKE17034,154:POKE17032,126:RETURN
17 FORN=1TO2500:NEXTN:RETURN
If you know that you are not going to be scrolling the screen then a simple M/L routine for clearing to reverse color has also been made by Anders Carlson
0 CLEAR200:DIMC1,C2,C3,M,M$:M=16384:GOSUB8:GOTO10
7 C1=(PEEK(17024)AND1)*256+PEEK(17025)-1+M:FORC2=1TOLEN(M$):C3=ASC(MID$(M$,C2)):POKEC1+C2,C3+64*(C3>63):NEXT:?@C1-M+C2,:RETURN
8 C1=20000:FORC2=0TO4:READC3:POKEC1+C2,C3:NEXT:DATA198,32,126,251,214
25 EXEC20000:PRINT@32*7+5,;:M$="SOME REVERSE VIDEO FUN! ":GOSUB7
30 M$=INKEY$:IFM$=""THEN30
40 GOSUB100
50 GOTO30
100 FORC2=33TO63:POKE 20001,C2:EXEC 20000:NEXT
110 RETURN
120 REM C1=36858 FOR 16K PACK
130 REM ANDERS CARLSSON 2020
I also have a routine for recreating the INPUT command on a reverse video screen, which can be found in my implementation of Hamurabi.

Anyway, people using Coco Basic might be able to implement some of these techniques to get a little more variety in their text screens.

2 comments: