Merge branch 'rr1-maint'

This commit is contained in:
Ilari Liusvaara 2013-03-22 22:03:56 +02:00
commit cc366d3de0
30 changed files with 151 additions and 138 deletions

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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.

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 +-

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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.

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 +-

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 +++++

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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.

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 +-

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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.

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 +-

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 +++++

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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.
---

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 <nall/string/convert.hpp>
#include <nall/string/cstring.hpp>
--
1.7.10.4
1.7.9.48.g85da4d

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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.

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 +++++

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 <nall/snes/cartridge.hpp>
#include <nall/gameboy/cartridge.hpp>
--
1.7.10.4
1.7.9.48.g85da4d

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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.

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 +++++

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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

View file

@ -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 <ilari.liusvaara@elisanet.fi>
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 <nall/snes/cartridge.hpp>
#include <nall/gameboy/cartridge.hpp>
--
1.7.10.4
1.7.9.48.g85da4d