Previous Thread
Next Thread
Print Thread
#119755 09/30/21 02:23 PM
Joined: Nov 2003
Posts: 177
Likes: 1
P
PhillHS Offline OP
Senior Member
OP Offline
Senior Member
P
Joined: Nov 2003
Posts: 177
Likes: 1
Hi all,

Working trying to fix the mouse handling in the rmnimbus driver.....

Is there a way of defining a mouse in a driver such that it returns a movement delta?

Ideally what I'd want is, 0 if the mouse is not moved +ve if moved right (for example) and -ve if moved right? No matter what I do the read() function always seems to return a +ve value that wraps.

Ports are currently defined as :
Code
	
PORT_START(MOUSEX_TAG) /* Mouse - X AXIS */
	PORT_BIT( 0xfff, 0x000, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)

	PORT_START(MOUSEY_TAG) /* Mouse - Y AXIS */
	PORT_BIT( 0xfff, 0x000, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)

And I'm reading them with :

Code
	int   x = 0;
	int   y = 0;

	x = m_io_mousex->read();
	y = m_io_mousey->read();

	if (x != 0) 
		logerror("x=%d\n",x);

Can anyone give me some hints please?

Cheers.

Phill.

Last edited by PhillHS; 09/30/21 02:24 PM.
Joined: Mar 2001
Posts: 16,815
Likes: 36
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,815
Likes: 36
Is this the common-ish case where there are 2 bits for each axis, one saying move/didn't move and one indicating the direction of movement?

ETA: if so, the best example is probably https://github.com/mamedev/mame/blob/master/src/mame/drivers/mac128.cpp#L927

Last edited by R. Belmont; 09/30/21 03:01 PM.
Joined: Jan 2012
Posts: 877
Likes: 7
C
Senior Member
Offline
Senior Member
C
Joined: Jan 2012
Posts: 877
Likes: 7
I spent a bit of time trying to fix that some years ago without much luck. Do you know if the mouse is connected to the io processor? I couldn't ever find much low level documentation for the system


Link Copied to Clipboard
Who's Online Now
0 members (), 36 guests, and 2 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,981
Posts117,966
Members5,003
Most Online890
Jan 17th, 2020
Forum Host
These forums are hosted by www.retrogamesformac.com
Forum hosted by www.retrogamesformac.com