[Scummvm-cvs-logs] scummvm master -> d65479a9d7c6248f499c0ea4ced97232b91ff6e6

hkzlab hkzlabnet at gmail.com
Wed May 4 16:52:42 CEST 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f16311291d N64: avoid bogus events if no controller plugged
d65479a9d7 Merge branch 'master' of https://github.com/scummvm/scummvm


Commit: f16311291df4cd0fa6003beee330be2b808aa360
    https://github.com/scummvm/scummvm/commit/f16311291df4cd0fa6003beee330be2b808aa360
Author: Fabio Battaglia (hkzlabnet at gmail.com)
Date: 2011-05-04T07:48:52-07:00

Commit Message:
N64: avoid bogus events if no controller plugged

If the user has only a N64 mouse plugged in and no controllers
this avoids fake clicks.

Changed paths:
    backends/platform/n64/osys_n64.h
    backends/platform/n64/osys_n64_base.cpp
    backends/platform/n64/osys_n64_events.cpp
    backends/platform/n64/pad_rom.sh



diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h
index 7a84de0..b9acb7c 100644
--- a/backends/platform/n64/osys_n64.h
+++ b/backends/platform/n64/osys_n64.h
@@ -129,7 +129,7 @@ protected:
 	volatile int _mouseMaxX, _mouseMaxY;
 	int _mouseHotspotX, _mouseHotspotY;
 
-	uint8 _controllerPort;
+	int8 _controllerPort;
 	int8 _mousePort;
 	bool _controllerHasRumble; // Gets enabled if rumble-pak is detected
 
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 2320378..32b2b98 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -910,7 +910,7 @@ void OSystem_N64::detectControllers(void) {
 	controller_data_status *ctrl_status = (controller_data_status*)memalign(8, sizeof(controller_data_status));
 	controller_Read_Status(ctrl_status);
 
-	_controllerPort = 0; // Use first controller as default
+	_controllerPort = -1; // Default no controller
 	_mousePort = -1; // Default no mouse
 	for (int8 ctrl_port = 3; ctrl_port >= 0; ctrl_port--) {
 		// Found a standard pad, use this by default.
diff --git a/backends/platform/n64/osys_n64_events.cpp b/backends/platform/n64/osys_n64_events.cpp
index 22b9add..69c8547 100644
--- a/backends/platform/n64/osys_n64_events.cpp
+++ b/backends/platform/n64/osys_n64_events.cpp
@@ -94,8 +94,13 @@ void OSystem_N64::readControllerAnalogInput(void) {
 	// Read current controller status
 	controller_Read_Buttons(&_ctrlData);
 
-	pad_analogX = (_ctrlData.c[_controllerPort].throttle >> 8) & 0xFF;
-	pad_analogY = (_ctrlData.c[_controllerPort].throttle >> 0) & 0xFF;
+	pad_analogX = 0;
+	pad_analogY = 0;
+
+	if (_controllerPort >= 0) {
+		pad_analogX = (_ctrlData.c[_controllerPort].throttle >> 8) & 0xFF;
+		pad_analogY = (_ctrlData.c[_controllerPort].throttle >> 0) & 0xFF;
+	}
 
 	pad_mouseX = 0;
 	pad_mouseY = 0;
@@ -157,9 +162,11 @@ bool OSystem_N64::pollEvent(Common::Event &event) {
 	static uint16 oldButtons = 0; // old button data... used for button press/release
 	static uint16 oldMouseButtons = 0;
 
-	uint16 newButtons = _ctrlData.c[_controllerPort].buttons; // Read from controller
+	uint16 newButtons = 0;
+	if (_controllerPort >= 0)
+		newButtons = _ctrlData.c[_controllerPort].buttons; // Read from controller
+	
 	uint16 newMouseButtons = 0;
-
 	if (_mousePort >= 0)
 		newMouseButtons = _ctrlData.c[_mousePort].buttons;
 
diff --git a/backends/platform/n64/pad_rom.sh b/backends/platform/n64/pad_rom.sh
old mode 100644
new mode 100755


Commit: d65479a9d7c6248f499c0ea4ced97232b91ff6e6
    https://github.com/scummvm/scummvm/commit/d65479a9d7c6248f499c0ea4ced97232b91ff6e6
Author: Fabio Battaglia (hkzlabnet at gmail.com)
Date: 2011-05-04T07:51:04-07:00

Commit Message:
Merge branch 'master' of https://github.com/scummvm/scummvm

Changed paths:
    backends/midi/timidity.cpp
    backends/module.mk
    backends/plugins/sdl/sdl-provider.h
    configure









More information about the Scummvm-git-logs mailing list