Page 2 of 2

Re: keyrow from assembly

Posted: Tue Feb 22, 2022 9:12 pm
by nitrofurano
and at http://www.dilwyn.me.uk/docs/manuals/qltm.pdf i'm seeing "18.13 Hardware Keys", "PC_IPCRD $18020 IPC read is the same", "PC_IPCWR $18003 IPC write" - does it mean that we can access ipc "directly" by poke/peek (i/o), and specially reading the keyrows, without using traps?

Re: keyrow from assembly

Posted: Tue Feb 22, 2022 9:45 pm
by mk79
nitrofurano wrote:and at http://www.dilwyn.me.uk/docs/manuals/qltm.pdf i'm seeing "18.13 Hardware Keys", "PC_IPCRD $18020 IPC read is the same", "PC_IPCWR $18003 IPC write" - does it mean that we can access ipc "directly" by poke/peek (i/o), and specially reading the keyrows, without using traps?
Could? Sure. Should? No no no no no and never.

Re: keyrow from assembly

Posted: Tue Feb 22, 2022 9:55 pm
by XorA
mk79 wrote:
nitrofurano wrote:and at http://www.dilwyn.me.uk/docs/manuals/qltm.pdf i'm seeing "18.13 Hardware Keys", "PC_IPCRD $18020 IPC read is the same", "PC_IPCWR $18003 IPC write" - does it mean that we can access ipc "directly" by poke/peek (i/o), and specially reading the keyrows, without using traps?
Could? Sure. Should? No no no no no and never.
As someone who has tried to understand IPC protocol and is now hairless, this is seconded. Use the pre-written code for that insanity!

Re: keyrow from assembly

Posted: Tue Feb 22, 2022 10:59 pm
by nitrofurano
tofro wrote:...

Code: Select all

***************************************************************************************
* keyScan
* Check keyboard row 1 (cursor keys, ESC, Enter and Space)
* return result in d1.b
* trashes d5 and d7!
***************************************************************************************
keyScan 
                lea.l   IPC_Cmd,a3
                move.w  #$11,d0
                trap 	#1
                ; (QDOSMT$ MT.IPCOM)
                rts 

IPC_Cmd         dc.l    $09010000               ;IPC command 
                dc.l    $00000102               ;9=kbd,1=4bits in,2=8bits out (set to read row 1 in here)
from these dc.l lines, which $01 is used for selecting the reading row?

Re: keyrow from assembly

Posted: Wed Feb 23, 2022 1:47 pm
by NormanDunbar
http://www.dilwyn.me.uk/docs/manuals/qltm.pdf pages 79-80 tells you everything you need to know.

For KEYROW it's:

Command $9 read a row of the keyboard:
1 parameter, 4 bits in size = the row number,
8 bits for the returned result.

So:

Code: Select all

      dc.b    9,1,0,0,0,0,1,2
Is:

9 = command.
1 = Number of parameter bytes to follow
0,0,0,0, = defines the bits of the parameter to send, 00 = least significant 4 bits. This is encoded in bits 0 and 1 for parameter 1, 2 and 3 for parameter 2, ....
1 = The parameter byte, LS nibble sent = row number.
2 = Size of reply, encoded in bits 0 and 1, 10 = all 8 bits.

Cheers,
Norm.