UCSD - PS/2 keyboard on Zeta2 sbc with ParportProp #398
Replies: 9 comments 5 replies
-
Hi @z80micro-mc, Nice to see someone else using p-System! I am pretty sure that pressing special keys on the ParPortProp PS/2 keyboard is producing proper ANSI escape sequences. At least, I checked that it does work with a US keyboard. The p-System is very deficient in terminal handling. A trick is used to allow outbound terminal control sequences to be used for ANSI terminals. However, there is no reasonable way to get p-System to interpret incoming ANSI control sequences (special keys like arrows) to be understood. As a result, the arrow keys have been defined as indicated below:
I see that I have failed to document this in the RomWBW User Guide and will rectify that omission soon. This issue and some other p-System notes are found in the RomWBW distribution in the Source/pSys/ReadMe.txt file. Does this explain your issues? Thanks, Wayne |
Beta Was this translation helpful? Give feedback.
-
Wayne,
Again many thanks for the prompt response.
Yes that will help a lot. I will investigate further.
There is also an issue with the UK vs US KBD: several of the stndard
keys seem to be interpreted as US KBD rather than UK.
eg shift top row on UK kbd is:
¬ ! " £ $ % ^ & * ( ) _ +
3rd row is:
A S D F G H J K L ; ' #
shifted 3rd row is:
A S D F G H J K L : @ ~
4th row is:
\/ Z X C V B N M , . /
shifted 4th row is:
| Z X C V B N M < > ?
Peter
…------ Original Message ------
From: "Wayne Warthen" ***@***.***>
To: "wwarthen/RomWBW" ***@***.***>
Cc: "z80micro-mc" ***@***.***>; "Mention"
***@***.***>
Sent: Friday, 17 May, 24 At 16:46
Subject: Re: [wwarthen/RomWBW] UCSD - PS/2 keyboard on Zeta2 sbc with
ParportProp (Discussion #398)
Hi @z80micro-mc <https://github.com/z80micro-mc> ,
Nice to see someone else using p-System!
I am pretty sure that pressing special keys on the ParPortProp PS/2
keyboard is producing proper ANSI escape sequences. At least, I checked
that it does work with a US keyboard.
The p-System is very deficient in terminal handling. A trick is used to
allow outbound terminal control sequences to be used for ANSI terminals.
However, there is no reasonable way to get p-System to interpret
incoming ANSI control sequences (special keys like arrows) to be
understood. As a result, the arrow keys have been defined as indicated
below: KeyFunctionCtrl-EUpCtrl-XDownCtrl-SLeftCtrl-DRight
I see that I have failed to document this in the RomWBW User Guide and
will rectify that omission soon. This issue and some other p-System
notes are found in the RomWBW distribution in the Source/pSys/ReadMe.txt
file.
Does this explain your issues?
Thanks,
Wayne
—
Reply to this email directly, view it on GitHub
<#398 (comment)>
, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATCK64EFIA2TF3LDLIZ3KQLZCYQ6XAVCNFSM6AAAAABH35FBXCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TINZSGQ3TK>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi @z80micro-mc, Yes, in the ParPortProp keyboard driver, there is a table that maps keyboard scan codes to their ASCII values. Indeed, this table is the mapping for a US keyboard. There is no automated way of knowing the difference between a US and UK keyboard. They are simply different key caps. To support a UK keyboard on the ParPortProp, a conditional compilation needs to be created that controls which keyboard mapping to use and then create the additional table(s) for the desired keyboard layouts. This would be done in Source/Prop/Spin/Keyboard.spin. This is not terribly hard to do. Mostly just a matter of finding the UK keyboard scan code translations and building the alternative table. Truthfully, this is not likely to get to the top of my priority list for a long time. Are you interested in working on it? Thanks, Wayne |
Beta Was this translation helpful? Give feedback.
-
Hi Wayne,
Yes I'll take a look though I haven't programmed in 'spin' before. What
do I need by way of development system / documentation.
I have found a section in UCSD Users' Manual Supplement, Version IV
Installation Guide on additional support for ANSI terminals.
http://www.bitsavers.org/pdf/sage/pSystem/pSystem_Users_Manual_Supplement_Version_IV.0_Apr82.pdf
Extract copied below
UCSD Users' Manual Supplement, Version IV Installation Guide
IV .1.7 p-System Support F or ANSI Terminals
American National Standard Institute (ANSI) terminals, such as the DEC
VT100, are
now supported by the p-System. There is a special ANSI SCREENOPS unit
that
must be installed into the operating system if you wish to use such a
terminal.
The unit is described here. Also, some related notes about keyboard
input handling
and the SETUP utility are covered.
NOTE: Even if you do not have an ANSI terminal, if you have any plans to
use
the utility Library to move SCREENOPS or if you plan to write programs
which
memlock the SCREENOPS unit, you should also read this section.
The standard SCREENOPS unit is installed in the OS as it is delivered.
ANSI.CODE contains the ANSI SCREENOPS unit. In order to install it into
the
OS, you should use the utility Library as described in the Users'
Manual.
(In addi tion to the general description of Library given in the Users'
Manual, there
is also an example of installing GOTOXY into the as using Library that
is given in
the Installation Guide. This example may be useful to read if you are
not familiar
with the Library utili ty. That example incorrectly states that GOTOXY
must
occupy a slot greater than 15. Neither GOTOXY nor the SCREENOPS segments
need to occupy any particular slot. However, KERNEL must occupy slot 0,
and
USERPROG must occupy slot 15.)
Both the standard SCREENOPS unit and the ANSI SCREENOPS unit have the
same
interface section, and are both divided into the following 4 segments:
SCREENOP
SEGSCINI
SEGSCPRO
SEGSCCHE
Whenever you are planning to move the SCREENOPS unit using Library, you
must
move all four of these segments. (Formerly, only the first two existed.)
. You
must Library all four of these units into the as when installing ANSI
SCREENOPS,
for instance.
As an improtant side note, if you plan to memlock SCREENOPS from a
program,
you should specify all three of the following segments:
SCREENOP
SEGSCPRO
SEGSCCHE
IV-9
Users' Manual Supplement, Version IV
Installation Guide
(SEGSINI is an initialization segment which is only called by the OS
during system
in i tialization. It does not need to be memlocked by user programs
because it is
never used during program execution.)
The ANSI SCREENOPS unit causes the p-System to ignore all of the syscom
screen
parameters which are set using the SETUP utility. This isbecause ANSI
terminals
all use standard screen codes. The ignored fields include:
BACKSPACE
ERASE LINE
ERASE SCREEN
ERASE TO END OF LINE
ERASE TO END OF SCRN
LEAD IN TO SCREEN
MOVE CURSOR HOME
MOVE CURSOR RIGHT
MOVE CURSOR UP
A Iso, the p-System may now accept sequences of three codes for keyboard
input.
The first code being the prefix, the second code being ignored, and the
third code
determining what key was typed. In SETUP, you would specify that the key
is
prefixed, and you would specify the third code as the key.
Two code sequences may still be recognized along with three code
sequences. You
must be careful in setting up which keys your system will recognize,
however, so
that there are no con flicts.
As an example, you might have special function keys which retum three
code
sequences, and arrow keys which return two code sequences. You may
specify,
using SETUP, that a function key has significance as a p-System key
(e.g. editor
accept key) as long as the second code in the sequence does not match
any other
prefixed key according to SETUP.
If, for example a terminal returns codes as follows:
Left Arrow
Right Arrow
Up Arrow
Down Arrow
Fl
F2
<esc> a
<esc> b
<esc> c
<esc> d
<esc> [ 1
<esc> [ 2
there would be no problem. When the p-System receives a prefix character
(in
IV-IO
Users' Manual Supplement, Version IV
Installation Guide
this case <esc», it determines whether the next code matches a prefixed
key. If
it does not, then the p-System determines if the next code input matches
a
prefixed key. (If it does not, then the input is considered invalid.) In
this case,
typing a function key retums 'P' as the second character; this does not
conflict
with a, b, c, or d.
The situation would be different if a keyboard were to return code
sequences as
follows:
Left Arrow <esc> a
Right Arrow <esc> b
Up Arrow <esc> c
Down Arrow <esc> d
FI <esc> a 1
F2 <esc> a 2
In this case, the FI key could not be used as a p-System key because it
conflicts
with the left arrow.
NOTE: ANSI terminals can asynchronously send XON/XOFF sequences to delay
transmission when they are being overrun. They do this using the
following
definitions:
XOFF
X(N
= CTRL-S
= CTRL-Q
CTRL-S is normally the p-System soft toggle for START/STOP (which does
the
identical task as the ANSI predefined CTRL-S and CTRL-Q). It confuses
the p-
System, however, if the terminal itself sends these same sequences.
If you have purchased the UCSD p-System as an adaptable system and you
have an
A NSI terminal, it is recomended that KEY FOR STOP be set to some value
other
than CTRL-S (using the SETUP utility) •. You should also implement
XON/XOFF
support in your console I/O routines.
Peter
…------ Original Message ------
From: "Wayne Warthen" ***@***.***>
To: "wwarthen/RomWBW" ***@***.***>
Cc: "z80micro-mc" ***@***.***>; "Mention"
***@***.***>
Sent: Friday, 17 May, 24 At 22:29
Subject: Re: [wwarthen/RomWBW] UCSD - PS/2 keyboard on Zeta2 sbc with
ParportProp (Discussion #398)
Hi @z80micro-mc <https://github.com/z80micro-mc> ,
Yes, in the ParPortProp keyboard driver, there is a table that maps
keyboard scan codes to their ASCII values. Indeed, this table is the
mapping for a US keyboard.
There is no automated way of knowing the difference between a US and UK
keyboard. They are simply different key caps.
To support a UK keyboard on the ParPortProp, a conditional compilation
needs to be created that controls which keyboard mapping to use and then
create the additional table(s) for the desired keyboard layouts. This
would be done in Source/Prop/Spin/Keyboard.spin.
This is not terribly hard to do. Mostly just a matter of finding the UK
keyboard scan code translations and building the alternative table.
Truthfully, this is not likely to get to the top of my priority list for
a long time. Are you interested in working on it?
Thanks, Wayne
—
Reply to this email directly, view it on GitHub
<#398 (comment)>
, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATCK64ARUVU7D3UUGXPTMILZCZZDXAVCNFSM6AAAAABH35FBXCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TINZVGMYDO>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
A Spin compiler is included with the RomWBW distribution. The Spin code is built when running the normal RomWBW build cycle. If you look at the /Source/Prop directory, you will see a Build.cmd command file that will build all 3 variants of the Propeller based firmware. You can just run that to compile. Does that make sense? Thanks, Wayne |
Beta Was this translation helpful? Give feedback.
-
Wayne,
Ah! It siad IV.0 ok will keep you in mind if I come across a IV.I Z80
set of disks.
Peter
…------ Original Message ------
From: "Wayne Warthen" ***@***.***>
To: "wwarthen/RomWBW" ***@***.***>
Cc: "z80micro-mc" ***@***.***>; "Mention"
***@***.***>
Sent: Saturday, 18 May, 24 At 01:19
Subject: Re: [wwarthen/RomWBW] UCSD - PS/2 keyboard on Zeta2 sbc with
ParportProp (Discussion #398)
Sorry, I forgot to address your note about the support for ANSI
terminals in p-System. I am aware of this, but sadly it is only
available in version IV.1. Despite hours of searching, I am unable to
find anything newer than version IV.0 in the adaptable Z80 p-System. If
you find the distribution disk images for Adaptable Z80 p-System version
IV.1, please let me know. That version has multiple features that I
want.
Thanks, Wayne
—
Reply to this email directly, view it on GitHub
<#398 (reply in thread)>
, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATCK64EELOK4ZUDK3EEP3ATZC2NBJAVCNFSM6AAAAABH35FBXCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TINZVHE4TA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Wayne,
OK, many thanks. It is always beneficial to get others input when
starting in a new area.
I'll have aread through the Parallax website.
It is now on my list for the next rainy day. I have to fix the garage
doors whilst it is dry and sunny (rather rare over here. - We do get
odd nice days then it rains for the next couple of days. Helps the weeds
grow in the garden, but not with replacing my garage doors I need 3 dry
consequtive days to get the job done).
From what I have read from the code there are a number of modules for
the parportprop: main code parportprop.spin which links to various cog
support modules: keyboard, safespi for sd, serial, E555 sound, and a
terminal eg ansiterm which also needs a vga driver (vgacolour) plus a
vgacharacterfont (vga8x8). I see the tables in keyboard.spin. I believe
propio & propio2 are only needed for other systems and not for the
Zeta2.
I'll set up a build environment and see how I get on. Is there a quick
way to test new propeller code or do I need to reprogram the 24c512
flash?
BTW I see from CBIOS that you have reserved 256 KB from the 512
available for 'system use', I understand 64 KB main + 64 KB banked, what
is the other 128 KB reserved for?
Was there a particular reason when you created the UCSD implementation
that you built it for a fixed disk slice rather than the floppy drive?
Peter
…------ Original Message ------
From: "Wayne Warthen" ***@***.***>
To: "wwarthen/RomWBW" ***@***.***>
Cc: "z80micro-mc" ***@***.***>; "Mention"
***@***.***>
Sent: Saturday, 18 May, 24 At 17:41
Subject: Re: [wwarthen/RomWBW] UCSD - PS/2 keyboard on Zeta2 sbc with
ParportProp (Discussion #398)
I'm afraid I have no guidance here. Most of the Propeller code was
inherited or derived from other sources. I just hacked on it a bit to
integrate it with RomWBW. I used only the documentation I found on the
Parallax website. Sorry about that.
—
Reply to this email directly, view it on GitHub
<#398 (reply in thread)>
, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATCK64EFTQBKDKA5QFETXJ3ZC6ACXAVCNFSM6AAAAABH35FBXCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TIOBQGY3DI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Wayne,
BTW did you ever look at pixel graphics on the VGA on the parportprop?
If so did you look at Turtle Graphics for the UCSD implementation?
Peter
…------ Original Message ------
From: "Wayne Warthen" ***@***.***>
To: "wwarthen/RomWBW" ***@***.***>
Cc: "z80micro-mc" ***@***.***>; "Mention"
***@***.***>
Sent: Saturday, 18 May, 24 At 17:41
Subject: Re: [wwarthen/RomWBW] UCSD - PS/2 keyboard on Zeta2 sbc with
ParportProp (Discussion #398)
I'm afraid I have no guidance here. Most of the Propeller code was
inherited or derived from other sources. I just hacked on it a bit to
integrate it with RomWBW. I used only the documentation I found on the
Parallax website. Sorry about that.
—
Reply to this email directly, view it on GitHub
<#398 (reply in thread)>
, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATCK64EFTQBKDKA5QFETXJ3ZC6ACXAVCNFSM6AAAAABH35FBXCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TIOBQGY3DI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have a Zeta2 SBC with ParportProp 0.97 and a UK ps/2 keyboard running UCSD (psys.img). However, the control and special keys are not producing ANSI codes. The VGA screen is interpretting the screen o/p codes correctly.
Where / how is the keyboard defined? I suspect somewhere in the Parportprop Spin.
I could bypass this using UCSD-SETUP and produce a custom system.miscinfo but then it won't be correct for a VT100 terminal.
Thanks
Peter
Beta Was this translation helpful? Give feedback.
All reactions