From ba6efda53eb02c0bff4ed912df0029304d541fdf Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 22 Mar 2013 22:03:38 +0200 Subject: [PATCH] Fix mouse movement --- .../v084/0001-Make-libsnes-compile.patch | 4 +- ...n-number-in-libsnes-to-be-v084-not-v.patch | 4 +- ...03-Don-t-use-time-in-emulating-chips.patch | 4 +- ...ve-controller-state-when-savestating.patch | 4 +- ...ialization-of-64-bit-signed-integers.patch | 4 +- ...ontend-to-control-random-number-seed.patch | 4 +- .../v084/0007-Fix-mouse-polling.patch | 39 ++++++++++--------- ...rt-for-detecting-true-polls-as-oppos.patch | 8 ++-- .../v085/0001-Make-libsnes-compile.patch | 4 +- ...n-number-in-libsnes-to-be-v085-not-v.patch | 5 ++- ...03-Don-t-use-time-in-emulating-chips.patch | 4 +- ...ve-controller-state-when-savestating.patch | 4 +- ...ialization-of-64-bit-signed-integers.patch | 4 +- ...ontend-to-control-random-number-seed.patch | 4 +- .../v085/0007-Fix-mouse-polling.patch | 39 ++++++++++--------- .../0008-Fix-uninitialized-variables.patch | 4 +- ...rt-for-detecting-true-polls-as-oppos.patch | 8 ++-- .../v085/0010-Fix-compiling-on-GCC-4.7.patch | 8 ++-- ...01-Don-t-use-time-in-emulating-chips.patch | 4 +- ...ve-controller-state-when-savestating.patch | 4 +- ...ontend-to-control-random-number-seed.patch | 4 +- .../v086/0004-Fix-mouse-polling.patch | 39 ++++++++++--------- ...rt-for-detecting-true-polls-as-oppos.patch | 8 ++-- .../v086/0006-Fix-compiling-on-GCC-4.7.patch | 8 ++-- ...01-Don-t-use-time-in-emulating-chips.patch | 4 +- ...ve-controller-state-when-savestating.patch | 4 +- ...ontend-to-control-random-number-seed.patch | 4 +- .../v087/0004-Fix-mouse-polling.patch | 39 ++++++++++--------- ...rt-for-detecting-true-polls-as-oppos.patch | 8 ++-- ...6-Add-missing-include-to-libsnes.cpp.patch | 8 ++-- 30 files changed, 151 insertions(+), 138 deletions(-) diff --git a/bsnes-patches/v084/0001-Make-libsnes-compile.patch b/bsnes-patches/v084/0001-Make-libsnes-compile.patch index 2c40cd70..a6212d5b 100644 --- a/bsnes-patches/v084/0001-Make-libsnes-compile.patch +++ b/bsnes-patches/v084/0001-Make-libsnes-compile.patch @@ -1,7 +1,7 @@ -From df75db4512ef7e6ad70f8cee8c7d7071132168f0 Mon Sep 17 00:00:00 2001 +From 53dc2ba4aa6f590d15d9bc65cefb11f74c2448e8 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:30:36 +0200 -Subject: [PATCH 1/7] Make libsnes compile +Subject: [PATCH 1/8] Make libsnes compile Changes between v083 and v084 had broken libsnes. Fix it so it at least compiles. diff --git a/bsnes-patches/v084/0002-Fix-bsnes-version-number-in-libsnes-to-be-v084-not-v.patch b/bsnes-patches/v084/0002-Fix-bsnes-version-number-in-libsnes-to-be-v084-not-v.patch index 90f75acd..1f8995a9 100644 --- a/bsnes-patches/v084/0002-Fix-bsnes-version-number-in-libsnes-to-be-v084-not-v.patch +++ b/bsnes-patches/v084/0002-Fix-bsnes-version-number-in-libsnes-to-be-v084-not-v.patch @@ -1,7 +1,7 @@ -From 637952f6b97bef882ca3870be8d434c31aeacf77 Mon Sep 17 00:00:00 2001 +From d5898559fdf6bb52bbe38c509e3d80ea46107ced Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:31:59 +0200 -Subject: [PATCH 2/7] Fix bsnes version number in libsnes to be v084, not v083 +Subject: [PATCH 2/8] Fix bsnes version number in libsnes to be v084, not v083 --- ui-libsnes/libsnes.cpp | 2 +- diff --git a/bsnes-patches/v084/0003-Don-t-use-time-in-emulating-chips.patch b/bsnes-patches/v084/0003-Don-t-use-time-in-emulating-chips.patch index 2b96339f..b45987eb 100644 --- a/bsnes-patches/v084/0003-Don-t-use-time-in-emulating-chips.patch +++ b/bsnes-patches/v084/0003-Don-t-use-time-in-emulating-chips.patch @@ -1,7 +1,7 @@ -From 308ba2d96d3dc0e49821c9db9902882e3919e372 Mon Sep 17 00:00:00 2001 +From a9a884ed827d5e61bbf5f3346001bd96cf4e80d2 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:37:44 +0200 -Subject: [PATCH 3/7] Don't use time() in emulating chips +Subject: [PATCH 3/8] Don't use time() in emulating chips Instead of using time() in chip emulation, create new interface method currentTime(), defaulting to time(0). This way frontend can cleanly diff --git a/bsnes-patches/v084/0004-Save-controller-state-when-savestating.patch b/bsnes-patches/v084/0004-Save-controller-state-when-savestating.patch index 2f4bd375..6a1745a5 100644 --- a/bsnes-patches/v084/0004-Save-controller-state-when-savestating.patch +++ b/bsnes-patches/v084/0004-Save-controller-state-when-savestating.patch @@ -1,7 +1,7 @@ -From 8d990991d97eb7742c4daa461b158d1aa9f6dce4 Mon Sep 17 00:00:00 2001 +From 0e21eb89711c7254bdcbf7054b4bcd3abe815c6f Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 01:52:08 +0200 -Subject: [PATCH 4/7] Save controller state when savestating +Subject: [PATCH 4/8] Save controller state when savestating When savestating, save the controller state and restore it upon loadstate. Prevents libsnes from mixing up buttons. diff --git a/bsnes-patches/v084/0005-Fix-unserialization-of-64-bit-signed-integers.patch b/bsnes-patches/v084/0005-Fix-unserialization-of-64-bit-signed-integers.patch index 5c049a1a..3dcc8540 100644 --- a/bsnes-patches/v084/0005-Fix-unserialization-of-64-bit-signed-integers.patch +++ b/bsnes-patches/v084/0005-Fix-unserialization-of-64-bit-signed-integers.patch @@ -1,7 +1,7 @@ -From 0520c04455b9e96e6caa54009d4ef7c300146c67 Mon Sep 17 00:00:00 2001 +From c8007a40719d62b6863f6f1fb452b747ade52dea Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 11 Nov 2011 03:05:48 +0200 -Subject: [PATCH 5/7] Fix unserialization of 64-bit signed integers +Subject: [PATCH 5/8] Fix unserialization of 64-bit signed integers --- nall/serializer.hpp | 2 +- diff --git a/bsnes-patches/v084/0006-Allow-frontend-to-control-random-number-seed.patch b/bsnes-patches/v084/0006-Allow-frontend-to-control-random-number-seed.patch index afb0a191..4d6e8c36 100644 --- a/bsnes-patches/v084/0006-Allow-frontend-to-control-random-number-seed.patch +++ b/bsnes-patches/v084/0006-Allow-frontend-to-control-random-number-seed.patch @@ -1,7 +1,7 @@ -From 723b5884d53db9d5e24b8cd300e97b1bb12fba29 Mon Sep 17 00:00:00 2001 +From b9697a3b68617afee7fbfcd33af2bfea4034380b Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 11 Nov 2011 19:49:46 +0200 -Subject: [PATCH 6/7] Allow frontend to control random number seed +Subject: [PATCH 6/8] Allow frontend to control random number seed --- snes/interface/interface.cpp | 5 +++++ diff --git a/bsnes-patches/v084/0007-Fix-mouse-polling.patch b/bsnes-patches/v084/0007-Fix-mouse-polling.patch index e56f7995..33257c93 100644 --- a/bsnes-patches/v084/0007-Fix-mouse-polling.patch +++ b/bsnes-patches/v084/0007-Fix-mouse-polling.patch @@ -1,59 +1,62 @@ -From eea50468e8d7e7a034b05c819aef11a032f972eb Mon Sep 17 00:00:00 2001 +From 33bb874115cbb28d567bfbeee682aa4e82319fb4 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 7 Mar 2012 16:57:18 +0200 -Subject: [PATCH 7/7] Fix mouse polling +Subject: [PATCH 7/8] Fix mouse polling Don't poll for mouse motion excessive number of times (no need to poll it for each bit!) --- - snes/controller/mouse/mouse.cpp | 12 ++++++++++-- + snes/controller/mouse/mouse.cpp | 14 ++++++++++++-- snes/controller/mouse/mouse.hpp | 2 ++ - 2 files changed, 12 insertions(+), 2 deletions(-) + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp -index 6b26fae..824ecd3 100755 +index 6b26fae..1a066b9 100755 --- a/snes/controller/mouse/mouse.cpp +++ b/snes/controller/mouse/mouse.cpp -@@ -3,8 +3,10 @@ +@@ -3,9 +3,13 @@ uint2 Mouse::data() { if(counter >= 32) return 1; - int position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right - int position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down + if(counter == 0) { -+ position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right -+ position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down ++ _position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right ++ _position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down + } ++ int position_x = _position_x; ++ int position_y = _position_y; bool direction_x = position_x < 0; //0 = right, 1 = left bool direction_y = position_y < 0; //0 = down, 1 = up -@@ -67,10 +69,16 @@ void Mouse::serialize(serializer& s) { + +@@ -67,10 +71,16 @@ void Mouse::serialize(serializer& s) { unsigned char block[Controller::SaveSize] = {0}; block[0] = latched ? 1 : 0; block[1] = counter; -+ block[2] = (unsigned short)position_x >> 8; -+ block[3] = (unsigned short)position_x; -+ block[4] = (unsigned short)position_y >> 8; -+ block[5] = (unsigned short)position_y; ++ block[2] = (unsigned short)_position_x >> 8; ++ block[3] = (unsigned short)_position_x; ++ block[4] = (unsigned short)_position_y >> 8; ++ block[5] = (unsigned short)_position_y; s.array(block, Controller::SaveSize); if(s.mode() == nall::serializer::Load) { latched = (block[0] != 0); counter = block[1]; -+ position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]); -+ position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]); ++ _position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]); ++ _position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]); } } diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp -index b66ea51..6074f34 100755 +index b66ea51..b07c8ab 100755 --- a/snes/controller/mouse/mouse.hpp +++ b/snes/controller/mouse/mouse.hpp @@ -6,4 +6,6 @@ struct Mouse : Controller { private: bool latched; unsigned counter; -+ int position_x; -+ int position_y; ++ int _position_x; ++ int _position_y; }; -- 1.7.9.48.g85da4d diff --git a/bsnes-patches/v084/0008-Add-needed-support-for-detecting-true-polls-as-oppos.patch b/bsnes-patches/v084/0008-Add-needed-support-for-detecting-true-polls-as-oppos.patch index 1b0db7e0..52127da6 100644 --- a/bsnes-patches/v084/0008-Add-needed-support-for-detecting-true-polls-as-oppos.patch +++ b/bsnes-patches/v084/0008-Add-needed-support-for-detecting-true-polls-as-oppos.patch @@ -1,8 +1,8 @@ -From 170490ff3a98a4d4c923fb3fe48014359d4b5f6f Mon Sep 17 00:00:00 2001 +From 0ab605a604efec1b4ae32b31e8ae8ecb62e6e1db Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 24 Sep 2012 21:46:09 +0300 -Subject: [PATCH] Add needed support for detecting true polls as opposed to - just autopolling +Subject: [PATCH 8/8] Add needed support for detecting true polls as opposed + to just autopolling --- snes/cpu/cpu.hpp | 1 + @@ -65,5 +65,5 @@ index 8b6aaa6..c5ee930 100755 //DMAPx uint8 CPU::mmio_r43x0(uint8 i) { -- -1.7.10.4 +1.7.9.48.g85da4d diff --git a/bsnes-patches/v085/0001-Make-libsnes-compile.patch b/bsnes-patches/v085/0001-Make-libsnes-compile.patch index 548011b0..86a4d611 100644 --- a/bsnes-patches/v085/0001-Make-libsnes-compile.patch +++ b/bsnes-patches/v085/0001-Make-libsnes-compile.patch @@ -1,7 +1,7 @@ -From 7c8d537a7be0f9c5883393e0d4a0df76d69bf19c Mon Sep 17 00:00:00 2001 +From b87f839552118e8a0f198509e995d21a14ea752f Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:30:36 +0200 -Subject: [PATCH 1/7] Make libsnes compile +Subject: [PATCH 01/10] Make libsnes compile Changes between v083 and v084 had broken libsnes. Fix it so it at least compiles. diff --git a/bsnes-patches/v085/0002-Fix-bsnes-version-number-in-libsnes-to-be-v085-not-v.patch b/bsnes-patches/v085/0002-Fix-bsnes-version-number-in-libsnes-to-be-v085-not-v.patch index 793f0408..bbe974fd 100644 --- a/bsnes-patches/v085/0002-Fix-bsnes-version-number-in-libsnes-to-be-v085-not-v.patch +++ b/bsnes-patches/v085/0002-Fix-bsnes-version-number-in-libsnes-to-be-v085-not-v.patch @@ -1,7 +1,8 @@ -From 5f9f74b1334cb05d8636d71c2cfc0a48685a7347 Mon Sep 17 00:00:00 2001 +From 98470a361dacf9e8948528cccf5cd3b79af233a9 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:31:59 +0200 -Subject: [PATCH 2/7] Fix bsnes version number in libsnes to be v085, not v083 +Subject: [PATCH 02/10] Fix bsnes version number in libsnes to be v085, not + v083 --- ui-libsnes/libsnes.cpp | 2 +- diff --git a/bsnes-patches/v085/0003-Don-t-use-time-in-emulating-chips.patch b/bsnes-patches/v085/0003-Don-t-use-time-in-emulating-chips.patch index 5191f654..54197d86 100644 --- a/bsnes-patches/v085/0003-Don-t-use-time-in-emulating-chips.patch +++ b/bsnes-patches/v085/0003-Don-t-use-time-in-emulating-chips.patch @@ -1,7 +1,7 @@ -From 773d0a3f71fca2df375a8e75c081d1f28c3b817b Mon Sep 17 00:00:00 2001 +From 6c6818de834be6664de6bb8a439c54997e43b33f Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:37:44 +0200 -Subject: [PATCH 3/7] Don't use time() in emulating chips +Subject: [PATCH 03/10] Don't use time() in emulating chips Instead of using time() in chip emulation, create new interface method currentTime(), defaulting to time(0). This way frontend can cleanly diff --git a/bsnes-patches/v085/0004-Save-controller-state-when-savestating.patch b/bsnes-patches/v085/0004-Save-controller-state-when-savestating.patch index ef396980..407af711 100644 --- a/bsnes-patches/v085/0004-Save-controller-state-when-savestating.patch +++ b/bsnes-patches/v085/0004-Save-controller-state-when-savestating.patch @@ -1,7 +1,7 @@ -From c7bf497a7016c9be3a1e2fff46973a555f9ad555 Mon Sep 17 00:00:00 2001 +From 3e9d5d306fb7f7c2e366e3eb84c0415673715d43 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 01:52:08 +0200 -Subject: [PATCH 4/7] Save controller state when savestating +Subject: [PATCH 04/10] Save controller state when savestating When savestating, save the controller state and restore it upon loadstate. Prevents libsnes from mixing up buttons. diff --git a/bsnes-patches/v085/0005-Fix-unserialization-of-64-bit-signed-integers.patch b/bsnes-patches/v085/0005-Fix-unserialization-of-64-bit-signed-integers.patch index 8ea09b13..c4217203 100644 --- a/bsnes-patches/v085/0005-Fix-unserialization-of-64-bit-signed-integers.patch +++ b/bsnes-patches/v085/0005-Fix-unserialization-of-64-bit-signed-integers.patch @@ -1,7 +1,7 @@ -From 18812e5cc5bd4cdc7cc7ef87a18bce78adbb4b13 Mon Sep 17 00:00:00 2001 +From 160ee6cc6a1907058870dd0ee1f4918885739c66 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 11 Nov 2011 03:05:48 +0200 -Subject: [PATCH 5/7] Fix unserialization of 64-bit signed integers +Subject: [PATCH 05/10] Fix unserialization of 64-bit signed integers --- nall/serializer.hpp | 2 +- diff --git a/bsnes-patches/v085/0006-Allow-frontend-to-control-random-number-seed.patch b/bsnes-patches/v085/0006-Allow-frontend-to-control-random-number-seed.patch index ef86e42a..5bcd069d 100644 --- a/bsnes-patches/v085/0006-Allow-frontend-to-control-random-number-seed.patch +++ b/bsnes-patches/v085/0006-Allow-frontend-to-control-random-number-seed.patch @@ -1,7 +1,7 @@ -From efe643e986ac15028ac7c7842532d8a8fb33963b Mon Sep 17 00:00:00 2001 +From 8e8917baa6aba22c3be013fbc7e57b9184be3ab9 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 11 Nov 2011 19:49:46 +0200 -Subject: [PATCH 6/7] Allow frontend to control random number seed +Subject: [PATCH 06/10] Allow frontend to control random number seed --- snes/interface/interface.cpp | 5 +++++ diff --git a/bsnes-patches/v085/0007-Fix-mouse-polling.patch b/bsnes-patches/v085/0007-Fix-mouse-polling.patch index 02a2faa4..54dbeda1 100644 --- a/bsnes-patches/v085/0007-Fix-mouse-polling.patch +++ b/bsnes-patches/v085/0007-Fix-mouse-polling.patch @@ -1,59 +1,62 @@ -From ce95700dc34ffdc5370aa699992bd8275e21c5c2 Mon Sep 17 00:00:00 2001 +From f13cc0de2ff39aaaf3b1bb32a28339f87c6a9c83 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 7 Mar 2012 16:57:18 +0200 -Subject: [PATCH 7/7] Fix mouse polling +Subject: [PATCH 07/10] Fix mouse polling Don't poll for mouse motion excessive number of times (no need to poll it for each bit!) --- - snes/controller/mouse/mouse.cpp | 12 ++++++++++-- + snes/controller/mouse/mouse.cpp | 14 ++++++++++++-- snes/controller/mouse/mouse.hpp | 2 ++ - 2 files changed, 12 insertions(+), 2 deletions(-) + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp -index 6b26fae..824ecd3 100755 +index 6b26fae..1a066b9 100755 --- a/snes/controller/mouse/mouse.cpp +++ b/snes/controller/mouse/mouse.cpp -@@ -3,8 +3,10 @@ +@@ -3,9 +3,13 @@ uint2 Mouse::data() { if(counter >= 32) return 1; - int position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right - int position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down + if(counter == 0) { -+ position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right -+ position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down ++ _position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right ++ _position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down + } ++ int position_x = _position_x; ++ int position_y = _position_y; bool direction_x = position_x < 0; //0 = right, 1 = left bool direction_y = position_y < 0; //0 = down, 1 = up -@@ -67,10 +69,16 @@ void Mouse::serialize(serializer& s) { + +@@ -67,10 +71,16 @@ void Mouse::serialize(serializer& s) { unsigned char block[Controller::SaveSize] = {0}; block[0] = latched ? 1 : 0; block[1] = counter; -+ block[2] = (unsigned short)position_x >> 8; -+ block[3] = (unsigned short)position_x; -+ block[4] = (unsigned short)position_y >> 8; -+ block[5] = (unsigned short)position_y; ++ block[2] = (unsigned short)_position_x >> 8; ++ block[3] = (unsigned short)_position_x; ++ block[4] = (unsigned short)_position_y >> 8; ++ block[5] = (unsigned short)_position_y; s.array(block, Controller::SaveSize); if(s.mode() == nall::serializer::Load) { latched = (block[0] != 0); counter = block[1]; -+ position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]); -+ position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]); ++ _position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]); ++ _position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]); } } diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp -index b66ea51..6074f34 100755 +index b66ea51..b07c8ab 100755 --- a/snes/controller/mouse/mouse.hpp +++ b/snes/controller/mouse/mouse.hpp @@ -6,4 +6,6 @@ struct Mouse : Controller { private: bool latched; unsigned counter; -+ int position_x; -+ int position_y; ++ int _position_x; ++ int _position_y; }; -- 1.7.9.48.g85da4d diff --git a/bsnes-patches/v085/0008-Fix-uninitialized-variables.patch b/bsnes-patches/v085/0008-Fix-uninitialized-variables.patch index f76e1d35..802972c9 100644 --- a/bsnes-patches/v085/0008-Fix-uninitialized-variables.patch +++ b/bsnes-patches/v085/0008-Fix-uninitialized-variables.patch @@ -1,7 +1,7 @@ -From 3761a50c0faed2d9252781c5508bf91cc84ad493 Mon Sep 17 00:00:00 2001 +From 14aaecac2238a00d51f295d29e1ebc283ca9ec79 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sat, 1 Sep 2012 11:23:34 +0300 -Subject: [PATCH] Fix uninitialized variables +Subject: [PATCH 08/10] Fix uninitialized variables These uninitialized variables cause a lot of desyncs in Shadowrun. --- diff --git a/bsnes-patches/v085/0009-Add-needed-support-for-detecting-true-polls-as-oppos.patch b/bsnes-patches/v085/0009-Add-needed-support-for-detecting-true-polls-as-oppos.patch index 28562d8b..eec15fae 100644 --- a/bsnes-patches/v085/0009-Add-needed-support-for-detecting-true-polls-as-oppos.patch +++ b/bsnes-patches/v085/0009-Add-needed-support-for-detecting-true-polls-as-oppos.patch @@ -1,8 +1,8 @@ -From 03f134f4db8d179cf95f6017dffd893cd3801e82 Mon Sep 17 00:00:00 2001 +From de9503d93bcb202684bbadcabba2a0192483a825 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 24 Sep 2012 21:46:09 +0300 -Subject: [PATCH] Add needed support for detecting true polls as opposed to - just autopolling +Subject: [PATCH 09/10] Add needed support for detecting true polls as opposed + to just autopolling --- snes/cpu/cpu.hpp | 1 + @@ -65,5 +65,5 @@ index 8b6aaa6..c5ee930 100755 //DMAPx uint8 CPU::mmio_r43x0(uint8 i) { -- -1.7.10.4 +1.7.9.48.g85da4d diff --git a/bsnes-patches/v085/0010-Fix-compiling-on-GCC-4.7.patch b/bsnes-patches/v085/0010-Fix-compiling-on-GCC-4.7.patch index e4d83b58..4c5ccff9 100644 --- a/bsnes-patches/v085/0010-Fix-compiling-on-GCC-4.7.patch +++ b/bsnes-patches/v085/0010-Fix-compiling-on-GCC-4.7.patch @@ -1,11 +1,11 @@ -From 36777ec11c093a1cc902b8b72188e06f49a4d0f2 Mon Sep 17 00:00:00 2001 +From fde47ff185a4f6dadd69f7afb47b5351dacbcb96 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 14 Oct 2012 23:31:36 +0300 -Subject: [PATCH] Fix compiling on GCC 4.7 +Subject: [PATCH 10/10] Fix compiling on GCC 4.7 --- nall/string.hpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/nall/string.hpp b/nall/string.hpp index 1b255ce..07a64df 100755 @@ -22,5 +22,5 @@ index 1b255ce..07a64df 100755 #include #include -- -1.7.10.4 +1.7.9.48.g85da4d diff --git a/bsnes-patches/v086/0001-Don-t-use-time-in-emulating-chips.patch b/bsnes-patches/v086/0001-Don-t-use-time-in-emulating-chips.patch index bef995f3..d69e893b 100644 --- a/bsnes-patches/v086/0001-Don-t-use-time-in-emulating-chips.patch +++ b/bsnes-patches/v086/0001-Don-t-use-time-in-emulating-chips.patch @@ -1,7 +1,7 @@ -From f66f4b9ecfcccb22b113acc6e5e92c93ed8890a9 Mon Sep 17 00:00:00 2001 +From 11817638cce47203329f3d45486a936fdfcf36c7 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:37:44 +0200 -Subject: [PATCH 1/4] Don't use time() in emulating chips +Subject: [PATCH 1/6] Don't use time() in emulating chips Instead of using time() in chip emulation, create new interface method currentTime(), defaulting to time(0). This way frontend can cleanly diff --git a/bsnes-patches/v086/0002-Save-controller-state-when-savestating.patch b/bsnes-patches/v086/0002-Save-controller-state-when-savestating.patch index dfd6fb52..6cf7ffcb 100644 --- a/bsnes-patches/v086/0002-Save-controller-state-when-savestating.patch +++ b/bsnes-patches/v086/0002-Save-controller-state-when-savestating.patch @@ -1,7 +1,7 @@ -From b02a77dd57546588a44b70bec3d6772e8ed5c11d Mon Sep 17 00:00:00 2001 +From 20ca58ee581dce5f147b7f8f004ed360543c78fe Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 01:52:08 +0200 -Subject: [PATCH 2/4] Save controller state when savestating +Subject: [PATCH 2/6] Save controller state when savestating When savestating, save the controller state and restore it upon loadstate. Prevents libsnes from mixing up buttons. diff --git a/bsnes-patches/v086/0003-Allow-frontend-to-control-random-number-seed.patch b/bsnes-patches/v086/0003-Allow-frontend-to-control-random-number-seed.patch index 018b7c9b..2153b10d 100644 --- a/bsnes-patches/v086/0003-Allow-frontend-to-control-random-number-seed.patch +++ b/bsnes-patches/v086/0003-Allow-frontend-to-control-random-number-seed.patch @@ -1,7 +1,7 @@ -From a47431385fedf705a3c9c1b820c116c230632943 Mon Sep 17 00:00:00 2001 +From f5c4df87246e2216abb8563f2ddad811eaf59520 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 11 Nov 2011 19:49:46 +0200 -Subject: [PATCH 3/4] Allow frontend to control random number seed +Subject: [PATCH 3/6] Allow frontend to control random number seed --- snes/interface/interface.cpp | 5 +++++ diff --git a/bsnes-patches/v086/0004-Fix-mouse-polling.patch b/bsnes-patches/v086/0004-Fix-mouse-polling.patch index 7484c29c..a90827a5 100644 --- a/bsnes-patches/v086/0004-Fix-mouse-polling.patch +++ b/bsnes-patches/v086/0004-Fix-mouse-polling.patch @@ -1,59 +1,62 @@ -From 395130ad02c50c329c0290b675086ff104839943 Mon Sep 17 00:00:00 2001 +From 22a4b8a4f4e84540702b34381ef7ba3860d1d0b5 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 7 Mar 2012 16:57:18 +0200 -Subject: [PATCH 4/4] Fix mouse polling +Subject: [PATCH 4/6] Fix mouse polling Don't poll for mouse motion excessive number of times (no need to poll it for each bit!) --- - snes/controller/mouse/mouse.cpp | 12 ++++++++++-- + snes/controller/mouse/mouse.cpp | 14 ++++++++++++-- snes/controller/mouse/mouse.hpp | 2 ++ - 2 files changed, 12 insertions(+), 2 deletions(-) + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp -index 6b26fae..824ecd3 100755 +index 6b26fae..1a066b9 100755 --- a/snes/controller/mouse/mouse.cpp +++ b/snes/controller/mouse/mouse.cpp -@@ -3,8 +3,10 @@ +@@ -3,9 +3,13 @@ uint2 Mouse::data() { if(counter >= 32) return 1; - int position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right - int position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down + if(counter == 0) { -+ position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right -+ position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down ++ _position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right ++ _position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down + } ++ int position_x = _position_x; ++ int position_y = _position_y; bool direction_x = position_x < 0; //0 = right, 1 = left bool direction_y = position_y < 0; //0 = down, 1 = up -@@ -67,10 +69,16 @@ void Mouse::serialize(serializer& s) { + +@@ -67,10 +71,16 @@ void Mouse::serialize(serializer& s) { unsigned char block[Controller::SaveSize] = {0}; block[0] = latched ? 1 : 0; block[1] = counter; -+ block[2] = (unsigned short)position_x >> 8; -+ block[3] = (unsigned short)position_x; -+ block[4] = (unsigned short)position_y >> 8; -+ block[5] = (unsigned short)position_y; ++ block[2] = (unsigned short)_position_x >> 8; ++ block[3] = (unsigned short)_position_x; ++ block[4] = (unsigned short)_position_y >> 8; ++ block[5] = (unsigned short)_position_y; s.array(block, Controller::SaveSize); if(s.mode() == nall::serializer::Load) { latched = (block[0] != 0); counter = block[1]; -+ position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]); -+ position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]); ++ _position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]); ++ _position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]); } } diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp -index b66ea51..6074f34 100755 +index b66ea51..b07c8ab 100755 --- a/snes/controller/mouse/mouse.hpp +++ b/snes/controller/mouse/mouse.hpp @@ -6,4 +6,6 @@ struct Mouse : Controller { private: bool latched; unsigned counter; -+ int position_x; -+ int position_y; ++ int _position_x; ++ int _position_y; }; -- 1.7.9.48.g85da4d diff --git a/bsnes-patches/v086/0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch b/bsnes-patches/v086/0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch index 099dd64f..04229a55 100644 --- a/bsnes-patches/v086/0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch +++ b/bsnes-patches/v086/0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch @@ -1,8 +1,8 @@ -From 574754de0ed7da044d3c559bb2c8bbca895c1e97 Mon Sep 17 00:00:00 2001 +From efa6b433e4f0123dca8bbc1bfd27c5762220a524 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 24 Sep 2012 21:46:09 +0300 -Subject: [PATCH] Add needed support for detecting true polls as opposed to - just autopolling +Subject: [PATCH 5/6] Add needed support for detecting true polls as opposed + to just autopolling --- snes/cpu/cpu.hpp | 1 + @@ -65,5 +65,5 @@ index 8b6aaa6..c5ee930 100755 //DMAPx uint8 CPU::mmio_r43x0(uint8 i) { -- -1.7.10.4 +1.7.9.48.g85da4d diff --git a/bsnes-patches/v086/0006-Fix-compiling-on-GCC-4.7.patch b/bsnes-patches/v086/0006-Fix-compiling-on-GCC-4.7.patch index f908c0ab..b0226038 100644 --- a/bsnes-patches/v086/0006-Fix-compiling-on-GCC-4.7.patch +++ b/bsnes-patches/v086/0006-Fix-compiling-on-GCC-4.7.patch @@ -1,12 +1,12 @@ -From 919c8935121c2ec7cb96ce561044981526c1ca7e Mon Sep 17 00:00:00 2001 +From f3e7cdb3815a3e0cc5beca79c78726d8f5f9b3ae Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 14 Oct 2012 23:29:40 +0300 -Subject: [PATCH] Fix compiling on GCC 4.7 +Subject: [PATCH 6/6] Fix compiling on GCC 4.7 --- nall/string.hpp | 2 +- ui-libsnes/libsnes.cpp | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/nall/string.hpp b/nall/string.hpp index 996cd68..4747e4c 100755 @@ -34,5 +34,5 @@ index 3b2be7a..ca90762 100755 #include #include -- -1.7.10.4 +1.7.9.48.g85da4d diff --git a/bsnes-patches/v087/0001-Don-t-use-time-in-emulating-chips.patch b/bsnes-patches/v087/0001-Don-t-use-time-in-emulating-chips.patch index 115ef5d9..e951db03 100644 --- a/bsnes-patches/v087/0001-Don-t-use-time-in-emulating-chips.patch +++ b/bsnes-patches/v087/0001-Don-t-use-time-in-emulating-chips.patch @@ -1,7 +1,7 @@ -From 22205d4d339cfa11f6d53e644eae1c859a56d349 Mon Sep 17 00:00:00 2001 +From d179ef70e8cfdecc92b58d8cbec013071140bcf5 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:37:44 +0200 -Subject: [PATCH 1/4] Don't use time() in emulating chips +Subject: [PATCH 1/6] Don't use time() in emulating chips Instead of using time() in chip emulation, create new interface method currentTime(), defaulting to time(0). This way frontend can cleanly diff --git a/bsnes-patches/v087/0002-Save-controller-state-when-savestating.patch b/bsnes-patches/v087/0002-Save-controller-state-when-savestating.patch index 61207d86..8904879c 100644 --- a/bsnes-patches/v087/0002-Save-controller-state-when-savestating.patch +++ b/bsnes-patches/v087/0002-Save-controller-state-when-savestating.patch @@ -1,7 +1,7 @@ -From fe11984ad18561506a7cc874cb7c0421f1e21ad1 Mon Sep 17 00:00:00 2001 +From 686e73181ce3b49d0dcbf94db564030bef350cbc Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 01:52:08 +0200 -Subject: [PATCH 2/4] Save controller state when savestating +Subject: [PATCH 2/6] Save controller state when savestating When savestating, save the controller state and restore it upon loadstate. Prevents libsnes from mixing up buttons. diff --git a/bsnes-patches/v087/0003-Allow-frontend-to-control-random-number-seed.patch b/bsnes-patches/v087/0003-Allow-frontend-to-control-random-number-seed.patch index b0f5ad17..16b334fd 100644 --- a/bsnes-patches/v087/0003-Allow-frontend-to-control-random-number-seed.patch +++ b/bsnes-patches/v087/0003-Allow-frontend-to-control-random-number-seed.patch @@ -1,7 +1,7 @@ -From 5f76449a70c9a546e18c2fdebe7588bbe90b56d2 Mon Sep 17 00:00:00 2001 +From f760a5a5981c811a4aeb878893fbad3fcaef3f5c Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 11 Nov 2011 19:49:46 +0200 -Subject: [PATCH 3/4] Allow frontend to control random number seed +Subject: [PATCH 3/6] Allow frontend to control random number seed --- snes/interface/interface.cpp | 5 +++++ diff --git a/bsnes-patches/v087/0004-Fix-mouse-polling.patch b/bsnes-patches/v087/0004-Fix-mouse-polling.patch index 5de1f170..300e6fee 100644 --- a/bsnes-patches/v087/0004-Fix-mouse-polling.patch +++ b/bsnes-patches/v087/0004-Fix-mouse-polling.patch @@ -1,59 +1,62 @@ -From 160dedf35571478781737ee35307b9321cfb41bb Mon Sep 17 00:00:00 2001 +From e6ec3c0d382f57e2c447b1a5dbfc4f58fc0ecfef Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 7 Mar 2012 16:57:18 +0200 -Subject: [PATCH 4/4] Fix mouse polling +Subject: [PATCH 4/6] Fix mouse polling Don't poll for mouse motion excessive number of times (no need to poll it for each bit!) --- - snes/controller/mouse/mouse.cpp | 12 ++++++++++-- + snes/controller/mouse/mouse.cpp | 14 ++++++++++++-- snes/controller/mouse/mouse.hpp | 2 ++ - 2 files changed, 12 insertions(+), 2 deletions(-) + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp -index 6b26fae..824ecd3 100755 +index 6b26fae..1a066b9 100755 --- a/snes/controller/mouse/mouse.cpp +++ b/snes/controller/mouse/mouse.cpp -@@ -3,8 +3,10 @@ +@@ -3,9 +3,13 @@ uint2 Mouse::data() { if(counter >= 32) return 1; - int position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right - int position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down + if(counter == 0) { -+ position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right -+ position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down ++ _position_x = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::X); //-n = left, 0 = center, +n = right ++ _position_y = interface->inputPoll(port, Input::Device::Mouse, 0, (unsigned)Input::MouseID::Y); //-n = up, 0 = center, +n = down + } ++ int position_x = _position_x; ++ int position_y = _position_y; bool direction_x = position_x < 0; //0 = right, 1 = left bool direction_y = position_y < 0; //0 = down, 1 = up -@@ -67,10 +69,16 @@ void Mouse::serialize(serializer& s) { + +@@ -67,10 +71,16 @@ void Mouse::serialize(serializer& s) { unsigned char block[Controller::SaveSize] = {0}; block[0] = latched ? 1 : 0; block[1] = counter; -+ block[2] = (unsigned short)position_x >> 8; -+ block[3] = (unsigned short)position_x; -+ block[4] = (unsigned short)position_y >> 8; -+ block[5] = (unsigned short)position_y; ++ block[2] = (unsigned short)_position_x >> 8; ++ block[3] = (unsigned short)_position_x; ++ block[4] = (unsigned short)_position_y >> 8; ++ block[5] = (unsigned short)_position_y; s.array(block, Controller::SaveSize); if(s.mode() == nall::serializer::Load) { latched = (block[0] != 0); counter = block[1]; -+ position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]); -+ position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]); ++ _position_x = (short)(((unsigned short)block[2] << 8) | (unsigned short)block[3]); ++ _position_y = (short)(((unsigned short)block[4] << 8) | (unsigned short)block[5]); } } diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp -index b66ea51..6074f34 100755 +index b66ea51..b07c8ab 100755 --- a/snes/controller/mouse/mouse.hpp +++ b/snes/controller/mouse/mouse.hpp @@ -6,4 +6,6 @@ struct Mouse : Controller { private: bool latched; unsigned counter; -+ int position_x; -+ int position_y; ++ int _position_x; ++ int _position_y; }; -- 1.7.9.48.g85da4d diff --git a/bsnes-patches/v087/0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch b/bsnes-patches/v087/0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch index d66c227f..d8a9ba55 100644 --- a/bsnes-patches/v087/0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch +++ b/bsnes-patches/v087/0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch @@ -1,8 +1,8 @@ -From f22d7a2b57d57959ac947465323870a8772d15ad Mon Sep 17 00:00:00 2001 +From e9a9d78c5ec20aadd42bc7433af236e413eea787 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 24 Sep 2012 21:46:09 +0300 -Subject: [PATCH] Add needed support for detecting true polls as opposed to - just autopolling +Subject: [PATCH 5/6] Add needed support for detecting true polls as opposed + to just autopolling --- snes/cpu/cpu.hpp | 1 + @@ -65,5 +65,5 @@ index 8b6aaa6..c5ee930 100755 //DMAPx uint8 CPU::mmio_r43x0(uint8 i) { -- -1.7.10.4 +1.7.9.48.g85da4d diff --git a/bsnes-patches/v087/0006-Add-missing-include-to-libsnes.cpp.patch b/bsnes-patches/v087/0006-Add-missing-include-to-libsnes.cpp.patch index c53d2e19..10044bb7 100644 --- a/bsnes-patches/v087/0006-Add-missing-include-to-libsnes.cpp.patch +++ b/bsnes-patches/v087/0006-Add-missing-include-to-libsnes.cpp.patch @@ -1,11 +1,11 @@ -From d4a3678c9cfbca544af8069b42b9eaa0205f8ea3 Mon Sep 17 00:00:00 2001 +From cb537c426d507164f6853f8e6cf82739a1bfb732 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 14 Oct 2012 23:25:33 +0300 -Subject: [PATCH] Add missing include to libsnes.cpp +Subject: [PATCH 6/6] Add missing include to libsnes.cpp --- target-libsnes/libsnes.cpp | 1 + - 1 file changed, 1 insertion(+) + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/target-libsnes/libsnes.cpp b/target-libsnes/libsnes.cpp index 3b2be7a..ca90762 100755 @@ -19,5 +19,5 @@ index 3b2be7a..ca90762 100755 #include #include -- -1.7.10.4 +1.7.9.48.g85da4d