Function EnableSnesMouse

From Uzebox Wiki
Jump to: navigation, search
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);
}