N64: if user has inserted a rumble-pak, rumble with shaking screen
svn-id: r47289
This commit is contained in:
parent
7db58ae29e
commit
6c6604d589
3 changed files with 13 additions and 6 deletions
|
@ -117,6 +117,7 @@ protected:
|
||||||
int _mouseHotspotX, _mouseHotspotY;
|
int _mouseHotspotX, _mouseHotspotY;
|
||||||
|
|
||||||
controller_data_buttons *_ctrlData; // Controller data read from the N64 serial interface
|
controller_data_buttons *_ctrlData; // Controller data read from the N64 serial interface
|
||||||
|
bool _controllerHasRumble;
|
||||||
|
|
||||||
bool _dirtyOffscreen;
|
bool _dirtyOffscreen;
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,7 @@ OSystem_N64::OSystem_N64() {
|
||||||
_dirtyOffscreen = false;
|
_dirtyOffscreen = false;
|
||||||
|
|
||||||
_ctrlData = (controller_data_buttons*)memalign(8, sizeof(controller_data_buttons));
|
_ctrlData = (controller_data_buttons*)memalign(8, sizeof(controller_data_buttons));
|
||||||
|
_controllerHasRumble = (identifyPak(0) == 2);
|
||||||
|
|
||||||
_fsFactory = new N64FilesystemFactory();
|
_fsFactory = new N64FilesystemFactory();
|
||||||
|
|
||||||
|
@ -602,6 +603,11 @@ void OSystem_N64::unlockScreen() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSystem_N64::setShakePos(int shakeOffset) {
|
void OSystem_N64::setShakePos(int shakeOffset) {
|
||||||
|
|
||||||
|
// If a rumble pak is plugged in and screen shakes, rumble!
|
||||||
|
if(shakeOffset && _controllerHasRumble) rumblePakEnable(1, 0);
|
||||||
|
else if(!shakeOffset && _controllerHasRumble) rumblePakEnable(0, 0);
|
||||||
|
|
||||||
_shakeOffset = shakeOffset;
|
_shakeOffset = shakeOffset;
|
||||||
_dirtyOffscreen = true;
|
_dirtyOffscreen = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue