Login
Back to forumSee the full topicGo to last reply

Posted By

MMS
on 2016-12-26
11:09:39
 Re: PC RS232 Mouse project for Plus/4 User port_a cheap and working one :-)

Hi JamesC,

-Actually when the PDF will be readible, it will be all clear for your. In short: I have the HW on my desk.

-Thank you for your comments and suggestions related to the speech mem area! I will consider it in the final version, though I calculated with speech area as 141 byte free mem. I want to make the driver positioned at an area do not collide with any program (including BASIC).
It could be positioned on the upper (>60K) RAM area too, as we do not have such huge utility programs, except of very few cases.

-Thank you for the hint on the Function key mem area.

-Corr: Yeah I made a mistake: in the zero page area there is no space for the code, just for the mouse position value stored there. It can make the code shorter due to shorter addresses and faster code. There is an zero page area I can use 00D8-00E8, supposed NOT to be used by the speech module (as per SVS map)
I meant for the resident code the below $1000 area, but without speech area it is only ~200 bytes long (even with tapy buffer)

Some answers:
-Yes, the original code happens with ACIA too. Without it, most of the CPU time would be spend just looking for the data come in via User port.

-When the byte comes in (change in mouse status), it generates an IQR at ACIA and we store the first byte. Then the second byte does the same, and the third too. After that we start the decoding.

-As my PDF still not visible in my post, I show you why we need a fast routine:
The RS232 mouse sends 3 bytes (but only 7 bit long) in the form like this:
D7 D6 D5 D4 D3 D2 D1 D0
1. x 1 LB RB Y7 Y6 X7 X6
2. x 0 X5 X4 X3 X2 X1 X0
3. x 0 Y5 Y4 Y3 Y2 Y1 Y0

The X and Y values are the movement of the mouse comperated to previous state.

Positive is right direction, format is in two's complement for to able to give negative result too, highest 7. bit means -128 and all the rest is positive number.
Mouse+protocol" target="_blank" rel="nofollow">http://everything2.com/title/Mouse+protocol

As you can see, it a lot of bit rotation and some calculations needed just to get eg total Y movement.
And certainly it sould be added to the previous position too.
That's why I called it bitbanging happy
(BTW the serial mouse position change value seems too high for Plussy, so we may need to divide the incoming value by two, just a single rotation)

So with the use of ACIA getting the 3 bytes is not a real issue, but ACIA cannot help to create from these received 3 bytes useful data, it is a CPU "wood cutting" task.



Back to top


Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon