Function EnableSnesMouse

From Uzebox Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Prototype

void EnableSnesMouse(unsigned char spriteIndex,const char *spriteMap);

Description

Activates the SNES mouse support and starts keeping track of the mouse movement and drawing the cursor on the screen.

Parameters
  • spriteIndex: The first sprite index from which to apply the map.
  • spriteMap: A regular map that contains sprites tile indexes.
Returns

Void

Video Modes

All

Since

V3

Notes

The SNES mouse is very slow to settle and the current implementation is not very efficient so it takes about 2.5 scanlines to fetch the extra X/Y axis bits.

Example:

#include "data/cursor.inc"
#define MOUSE 2 
...
//If there's a mouse connected to the second port, activate it
if(((DetectControllers() >> 2) && 0x3 == MOUSE) {
   EnableSnesMouse(0,map_cursor);
}