Page 1 of 1

Question: how to use a mouse on MZ-800 ?

Posted: Tue Feb 13, 2018 11:48 am
by KnaxMax
Hi,

I always wondered if it would be possible to use an Atari or Commodore mouse at the MZ-800 joystick ports.
AFAIR the C64 mouse (1351) had a special mode, where it more or less emulated normal joystick imput, so it could be used with games, that triggered some kind of pointer/cursor via joystick.

Other software that used it more like a classical mouse, had special drivers for it (GEOS etc.)

So any experience on using such a mouse with Sharp?

Re: Question: how to use a mouse on MZ-800 ?

Posted: Tue Feb 13, 2018 2:07 pm
by goev
Hm... I haven't tried, but it should be possible to do. The joysticks are port $F0 and $F1, so I don't think there is any interrupts triggering on changes on these ports, which means you must poll the port. Using an Atari-mouse, up-down/down-up pulse indicates Y-movement, and left-right/right-left pulse indicates x-movement.

Re: Question: how to use a mouse on MZ-800 ?

Posted: Wed Feb 14, 2018 7:51 am
by Jo Even
I guess this would be similar to using mouse on other 8-bits, like the MSX. Polling is required there too. Maybe have a look at the SymbOS source code and see how it's done.

Btw. the MZ-800 would be a great target for SymbOS :)

Re: Question: how to use a mouse on MZ-800 ?

Posted: Wed Feb 14, 2018 8:44 am
by KnaxMax
Jo Even wrote: Wed Feb 14, 2018 7:51 am Btw. the MZ-800 would be a great target for SymbOS :)
This SymbOS looks really cool. Impressing what can be done with 8 Bit machines.
And today some 'makers' use the power of a RasPi3 for just blinking some LEDs.

Re: Question: how to use a mouse on MZ-800 ?

Posted: Wed Feb 14, 2018 10:32 am
by Jo Even
I have SymbOS on my CPC6128 with dual floppydrives and 640Kb RAM. It is indeed very impressive.

Re: Question: how to use a mouse on MZ-800 ?

Posted: Wed Feb 14, 2018 10:43 am
by goev
I think you should port SymbOS to the MZ-800, Jo Even! It is a good reason to finally buy one for yourself ;)

Re: Question: how to use a mouse on MZ-800 ?

Posted: Wed Feb 14, 2018 10:53 am
by Jo Even
Will not happen :D

Re: Question: how to use a mouse on MZ-800 ?

Posted: Wed Jun 13, 2018 6:49 am
by fitus
This issue has been solved many years ago. There is a software ´´MOUSE´´ which you can use with Atari comp. mouse. The manual is in slovak language. http://www.scav.cz/download/MZ-800/MZ-8 ... /Mouse.txt - try google translate. The software is somewhere in download area. You can download it . I didnt try it. Good luck.

Re: Question: how to use a mouse on MZ-800 ?

Posted: Sat Jul 07, 2018 9:22 pm
by TextAdventureKing
Translated the MOUSE manual into English for anybody that needs it.
Just download it by clicking on the link below.
https://mega.nz/#!DLw31QJT
decryption key is !PukZSN8yVrnyh5yZiCvaa3VKp4p-NnE9mL-IyHwz4oY

Re: Question: how to use a mouse on MZ-800 ?

Posted: Fri Jan 18, 2019 8:01 am
by Jo Even
Does anybody know where this software can be downloaded?.

The translated manual:

Code: Select all


** ** ** ** ***** ************ 
*** *** *** *** ** ** *** * ** ** **           
** ** ** ** ** ** **           
** ** ** ** ** ** ** ** ***** **           
* * ** ** ** ** ** ***** *******      
** ** ** ** ** ** ** ** **           
** ** ** * ** *** *** *** *** *** ** version 1.0          
** ** ***** ***** *********** ** 


	(c) 1992 by mZx software, BOX 93, 381 01 no. Krumlov 

  Program is designed for all those involved in programming on the 
SHARP MZ-800. Everyone who uses the program must adhere to the rules.

1. If you purchase the program, you may incorporate it into our own programs without any consultation 
   . 

2. But only if you 
   do not sell or distribute the program with our mouse driver. 

3. Therefore, there is point 3 - who puts our driver into his commercial 
   program, he has to inform us and negotiate the terms of sale. 



The program was tested with the ATARI mouse, which, given the same 
we recommend. He should, of course, walk with each parallel mouse. 


-------------------------------------------------- --------------- 
              HARDWAROV Á PRAVA 
------------------------------- ----------------------------------

	Before connecting the ATARI mouse to Sharp, it is necessary to spread the 
           signals on the mouse connector according to the following table: 


  ================================= ============================ 
  | pin number | signal | wire color edit for SHARP 
  ================================================== =========== 
  | 1 | XB | brown | XA | 
  -------------------------------------------------- ----------- 
  | 2 | XA | orange | XB | 
  -------------------------------------------------- ----------- 
  | 3 | YA | green | YA | 
  -------------------------------------------------- -----------
  | 4 | YB | blue | YB | 
  -------------------------------------------------- ----------- 
  | 5 | unconnected | --- | + 5V | 
  -------------------------------------------------- ----------- 
  | 6 | left press. | yellow | left button 
  -------------------------------------------------- ----------- 
  | 7 | + 5V | red | right button 
  -------------------------------------------------- ----------- 
  | 8 | ZEM | black | unconnected | 
  -------------------------------------------------- ----------- 
  | 9 | right print. | white | ZEM |
  ================================================== =========== 

	Although the connector is 
unmatchable, it can also be dismantled and re-bonded after interconnection. Who wants to save 15 
Kcs (for so much I bought a new and detachable connector), he can 
work with it. 

	After this adjustment, we can connect the mouse to the SHARP MZ-800 to the 
connector for JOYSTICK 1 or JOYSTICK 2. 


------------------------------ ----------------------------------- 
              PROGRAMMING OPERATION 
------------ -------------------------------------------------- --- 

	To understand the MOUSE routine described below, 
I briefly describe a parallel mouse activity.
	The parallel mouse has 
two wires drawn for each direction (horizontal and vertical) , in which the 
logical zeros and logical ones are alternated when the mouse moves, as shown in the following figure: 


                            right (down) 
                        --------------- -----> 

   XA (YA) ..... 0 0 1 1 0 0 1 1 
   XB (YB) 0 1 1 0 0 1 1 0 ..... all over 

                        <-------- ------------ 
                            left (up) 


	It is clear that the mouse movement information is not only its 
immediate state but also the previous state that must be 
stored somewhere. 
	The MOUSE routine described below provides decoding
mouse movement. Output from this routine is the value in the 
microprocessor register A with the reset nibble (bits 4-7). 

Bits 0-3 have the following meanings: 

		bit 3 - its setting indicates that the mouse 
			has taken a step in the vertical direction 
		bit 2 - if bit 3 is set, it indicates step 
				0 - step down 
				1 - step up 
			if bit 3 is zero, meaning 
		bit 1 - its setting indicates that the mouse 
			has moved in the horizontal direction 
		bit 0 - if bit 1 is set, it indicates step direction 
				0 - step right 
				1 - step left 
			if bit 1 is zero has no meaning The 

	routine does not test whether the right or left
mouse button. The status of the buttons can be read easily by reading the 
port and testing the appropriate bit. The status of the left button is on 
bit 4, the right button on bit 5. Such testing is much 
faster than if the entire MOUSE routine ever had to run. 
	For example, we will test the left button as follows: 

		IN A, (JOY), read the port with the 
		BIT 4 mouse , A, test the Button 

	But who would not do it, 
add the mouse test to the MOUSE routine or write a completely new routine. 


	Here's one of many of our mouse operations: 

--------------------------------------- ------------------------- 
; 
; TEST MOVES MOVEMENT AND MOVE AND WATER 
;
; 
; mouse status is accessible on port $ F0 (JOY1) or $ F1 (JOY2) 
; bits with the following meaning: 
; 
; bit 0 ................ XA 
; bit 1 ................ XB 
; bit 2 ................ YA 
; bit 3 ................ YB 
; 
; the mute input bits are insignificant in this routine 
; 
; ------------------------------------------, ------ --------------- 
JOY EQU 0F0H; or 0F1 @ = JOY2 
; 
MOUQE: POP HL; the address of the previous state 
	LD B, (HL), highlight it 
	IN A, (JOY), the new state of the mouse 
	AND 00FH, only this is interesting
	LD (HL), A, the new state will be the old old 
	INC HL, we must go one step further 
	PUSH HL 
	XOR B 
	RET Z, no change 
	LD C, A 
	RLA 
	XOR C 
	AND 00001010B, these are changes of 
	RET Z, none or 
	LD E , A 
	LD A, B 
	RRA 
	XOR B 
	XOR C 
	AND 00000101B, here is the direction 
	OR E, all together 
	RET 
; ----------------------------------------- 

	This routine is relocable even in the translated form. 
Requires a special way to call: 

	CALL MOUSE; 
	Deleted routing DEFS 1; Save 
			mouse state previous

	This method of calling requires that the routine is 
always called from the same location. This deficiency can be eliminated in two 
ways. We can modify the routine by reserving a mouse storage space in memory 
and keeping it up and highlighting it 
directly from the site (at the expense of relocability). Or we can 
create such a subroutine: 

MOUSE1: CALL MOUSE; 
	DEFS 1 call ; 
	RET mouse status ; return to the calling program 

We can place it anywhere and replace the CALL MOUSE 
call by calling CALL MOUSE1 that can be anywhere in the program. 

	Practical use of MOUSE routines demonstrates demonstration
the DEMOMOUS program. Who owns a mouse and has 
modified it according to our instructions can run DEMOMOUS.COM. Who does not have a mouse yet 
can at least look at DEMOMOUS.MAC how it works. 

	After running DEMOMOUS.COM, you can use the mouse to 
move the screen across the screen. When left pressed, the arrow 
leaves behind a trace (draws a line). Pressing the right 
button will delete everything. Finally, pushing both buttons will 
jump to CP / M. 

	Good advice at the end. It is important to test the mouse status as 
often as possible, whether you use the MOUSE routine or 
create your own. With faster mouse movements and larger ones
Testing intervals may result in the mouse doing 
two steps between two tests (more or less). In that case, it is 
not possible to evaluate which mouse the two steps were doing. If you 
accidentally make a mouse between two trials, we will evaluate 
it as step one but the opposite direction (a known strobing effect). 
For this reason, for example, it can not test mouse interrupted by VBLNK. 
Testing 50 times per second is slow. 
	
	DEMOMOUS shows that you can test a mouse 
at a speed and test some 
simple action (such as a cursor or arrow). 

	Many achievements in creating software for SHARP
MZ-800 and 
				Modified ATARI Mouse to Everyone 

				Ján Koštial, author 
and mZx software, POBOX 93, 
				381 01 Český Krumlov 

				Phone (038) 415 31