N64 Mouse

What is the N64 Mouse?
A mouse is scheduled to be developed in the near future. The mouse will be connected to the N64 Controller port. This section explains the use of the mouse.

There are no special N64 functions for use with a mouse. When creating applications which utilize a mouse, use the same set of functions which are used with the Standard N64 Controller.

How to Use the N64 Mouse
First execute the osContInit() function in order to make the initial settings for using the SI. Next check the value of the "type" member variable of the OSContStatus structure to confirm that the mouse has been attached. You know the mouse is attached when b12~b8 of "type" are all 0, the CONT_RELATIVE bit is raised, and the CONT_ABSOLUTE and CONT_JOYPORT bits are not raised.

A macro has been defined in OS 2.0I and after, so check using the following method:

osContInit(&siMessageQ, &pattern, contstat);
for (I = 0 ; I < MAXCONTROLLERS ; I ++) {
	if ((pattern >> I) & 1) {
		if ((contstat[I].type & CONT_TYPE_MASK) == CONT_TYPE_MOUSE){
			osSyncPrintf("Mouse\n");
		} else {
			osSyncPrintf("Some other device\n");
		}
	} else {
		osSyncPrintf("Nothing is inserted\n");
	}
}

How to Read the Data
To read data from the mouse, use the Controller read functions, osContStartReadData() and osContGetReadData().

The data read about the movement of the mouse is placed in the "stick_x" and "stick_y" member variables of the OSContPad structure, while the data read about clicking the mouse buttons is placed in the "button" member variable.

The left mouse button corresponds to the A_BUTTON, and right mouse button corresponds to the B_BUTTON.

The "button" member variable is ANDed with A_BUTTON or B_BUTTON to check which mouse button has been clicked.


Copyright © 1999
Nintendo of America Inc. All Rights Reserved
Nintendo and N64 are registered trademarks of Nintendo
Last Updated January, 1999