(The following Article was featured for the February '99 edition of this page)
MC-10 interesting RAM locations
In January 1999 I posted at the MC-10 Users Club messages list some POKEs and PEEKs I had found while probing the MC-10's memory map with a rude Micro Color Basic program and the glorified monitor string of PRINT PEEK(49151) and POKE 20,0.... I got my share of MC-10 lockups due to my aimless investigation but at the end something useful came in return. I had absolutely no access to any technical data on the MC-10, and the response from the sales clerk at Radio Shack back around 1984 when I asked him about the MC-10 memory map was like: huh... memory maps?... huh... memory mapssss... hey Joe!, do you know something about memory maps for the MC-10?.
Fire up the MC-10 and try the following PEEKs:
This location returns the ASCII value of the last key pressed. Works like INKEY$
When pressing ANY key it will have decimal value 127. Returns a 0 (zero) with no key pressed
Returns the following decimal codes: No keys pressed - 255, 7 key - 239, ? key - 223, SPACEBAR - 247, W key - 251, O key - 253, G key - 254.
These two last PEEKs work in what I like to call real-time input , meaning that as long as a key is being pressed the value in RAM will change accordingly; release it and as soon as that's done the value in memory changes too. Only the first PEEK works in a latching mode, that is, you press the key and the value remains until a new key is pressed.
Using a combination of the first two PEEKs listed in a Basic program can have the effect of a real-time input with any key in the MC-10's keyboard. To the best of my knowledge, the MC-10 doesn't have a keyboard roll-over table like the CoCo does so by running the Basic lines listed below allows for such real-time input to the MC-10:
100 REM KY -> KEY CODE
110 REM HL -> FOR HOW LONG
115 CLS:PRINT@0,"USE THE W & Z KEYS"
130 IF (KY AND HL)=ASC("W") THEN VR=VR+1
140 IF (KY AND HL)=ASC("Z") THEN VR=VR-1
150 PRINT@260,"VERTICAL VALUE:";VR
160 GOAT 120
Â In the above program the AND instruction effectively allows us to modify the value of variable VR depending on how long we press the UP and DOWN arrow keys (actually, the W and Z keys). This routine was used a lot in some arcade-type games I did in the MC-10.
The following Pole Position styled Basic program shows how to use the routine:
110 FOR K=1 TO 10
140 J=8:REM J = TRACK WIDTH
150 FOR X=0 TO 6.2 STEP K/100
160 POKE P,159
180 PRINT@480+C,S$ TAB(C+J)S$
190 IF PEEK(P)=Q THEN 240
200 POKE P-32,143
210 IF (PEEK(KY) AND PEEK(HL))=ASC("A") THEN P=P-D:NEXT X,K
220 IF (PEEK(KY) AND PEEK(HL))=ASC("S") THEN P=P+D:NEXT X,K
230 NEXT X,K
240 PRINT"SECTORS PASSED:";K
So here your "car" is a white graphics block and you must avoid smashing into the walls on both sides of the track. Variable P holds the screen memory location to test for colision, and the X loop goes on to "drawing" a senoidal track way. Pressing the A key moves your car to the left and the S key moves it to the right and as the curves get nastier the speed at which the car turns is incremented - this is controlled by the D variable.
Hope you enjoy this small sample of what's to be included on the full site.