From f49b82c98938110e48150f9a63c91bc991779149 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 25 Oct 2017 14:22:19 +0300 Subject: [PATCH] Bus fixes: Reading of CPU MMIO registers does not update MDR Also fixes controller timings to be more realistic. --- bsnes | 2 +- bsnes-patches/v085/0001-Make-libsnes-compile.patch | 6 +- ...ersion-number-in-libsnes-to-be-v085-not-v.patch | 6 +- .../0003-Don-t-use-time-in-emulating-chips.patch | 14 +- ...04-Save-controller-state-when-savestating.patch | 34 +- ...unserialization-of-64-bit-signed-integers.patch | 6 +- ...ow-frontend-to-control-random-number-seed.patch | 10 +- bsnes-patches/v085/0007-Fix-mouse-polling.patch | 8 +- .../v085/0008-Fix-uninitialized-variables.patch | 20 +- ...support-for-detecting-true-polls-as-oppos.patch | 8 +- .../v085/0010-Fix-compiling-on-GCC-4.7.patch | 6 +- .../v085/0011-Support-notifying-latches.patch | 12 +- ...2-Support-unlimited-number-of-breakpoints.patch | 70 ++-- ...0013-Support-auto-detecting-bsnes-version.patch | 6 +- ...port-alternate-more-accurate-poll-timings.patch | 16 +- .../v085/0015-Fix-mouse-speed-support.patch | 12 +- ...0016-Fix-tracelog-of-controller-registers.patch | 6 +- ...formance-problem-with-non-bus-breakpoints.patch | 10 +- ...ort-VRAM-OAM-CGRAM-and-APURAM-breakpoints.patch | 28 +- .../v085/0019-SA1-trace-hook-support.patch | 10 +- .../0020-Fixes-to-SA1-open-bus-emulation.patch | 6 +- ...-latch-function-on-alternate-timings-mode.patch | 6 +- bsnes-patches/v085/0022-Support-DMA-tracing.patch | 26 +- .../0023-Add-autopoller-and-IRQ-NMI-tracing.patch | 8 +- .../v085/0024-Build-fixes-for-GCC-5.X.patch | 6 +- ...ug-where-write-to-MSU1BASE-4-is-mirred-to.patch | 6 +- ...to-avoid-compile-error-due-to-missing-std.patch | 6 +- ...o-not-update-MDR-on-read-from-CPU-MMIO-sp.patch | 377 +++++++++++++++++++++ src/emulation/bsnes-legacy/core.cpp | 16 + 29 files changed, 570 insertions(+), 177 deletions(-) create mode 100644 bsnes-patches/v085/0027-Bus-fixes-Do-not-update-MDR-on-read-from-CPU-MMIO-sp.patch diff --git a/bsnes b/bsnes index c0a2270c..4cfbbead 160000 --- a/bsnes +++ b/bsnes @@ -1 +1 @@ -Subproject commit c0a2270cfd5f56e8a311b36011e1f15fac6c54ca +Subproject commit 4cfbbeadc3abe3e3911f7f59ce57b715edc76563 diff --git a/bsnes-patches/v085/0001-Make-libsnes-compile.patch b/bsnes-patches/v085/0001-Make-libsnes-compile.patch index a84a73c3..d2c914c5 100644 --- a/bsnes-patches/v085/0001-Make-libsnes-compile.patch +++ b/bsnes-patches/v085/0001-Make-libsnes-compile.patch @@ -1,7 +1,7 @@ From b19b3b2d1d7a522af695f4482abb28e52804326b Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:30:36 +0200 -Subject: [PATCH 01/26] Make libsnes compile +Subject: [PATCH 01/27] Make libsnes compile Changes between v083 and v084 had broken libsnes. Fix it so it at least compiles. @@ -10,7 +10,7 @@ compiles. 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/ui-libsnes/libsnes.cpp b/ui-libsnes/libsnes.cpp -index fbb4482..5f5ded6 100755 +index fbb4482c..5f5ded69 100755 --- a/ui-libsnes/libsnes.cpp +++ b/ui-libsnes/libsnes.cpp @@ -1,5 +1,6 @@ @@ -78,5 +78,5 @@ index fbb4482..5f5ded6 100755 } SNES::cartridge.load(SNES::Cartridge::Mode::SuperGameBoy, xmlrom); -- -2.8.1 +2.15.0.rc1 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 89b0ab8f..e83f3410 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,7 @@ From bb2fed04fbfe62a89e4bcfe90f44b4738f7c7c1a Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:31:59 +0200 -Subject: [PATCH 02/26] Fix bsnes version number in libsnes to be v085, not +Subject: [PATCH 02/27] Fix bsnes version number in libsnes to be v085, not v083 --- @@ -9,7 +9,7 @@ Subject: [PATCH 02/26] Fix bsnes version number in libsnes to be v085, not 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-libsnes/libsnes.cpp b/ui-libsnes/libsnes.cpp -index 5f5ded6..0e63075 100755 +index 5f5ded69..0e63075e 100755 --- a/ui-libsnes/libsnes.cpp +++ b/ui-libsnes/libsnes.cpp @@ -112,7 +112,7 @@ struct Interface : public SNES::Interface { @@ -22,5 +22,5 @@ index 5f5ded6..0e63075 100755 unsigned snes_library_revision_major(void) { -- -2.8.1 +2.15.0.rc1 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 191e97df..e6bd036e 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 7379b4570e5755a5a1da25181ba4f5d1ca461a98 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 00:37:44 +0200 -Subject: [PATCH 03/26] Don't use time() in emulating chips +Subject: [PATCH 03/27] 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 @@ -15,7 +15,7 @@ override the current time bsnes is using. 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/snes/chip/bsx/satellaview/satellaview.cpp b/snes/chip/bsx/satellaview/satellaview.cpp -index 386fb62..3c98019 100755 +index 386fb628..3c980195 100755 --- a/snes/chip/bsx/satellaview/satellaview.cpp +++ b/snes/chip/bsx/satellaview/satellaview.cpp @@ -38,7 +38,7 @@ uint8 BSXSatellaview::mmio_read(unsigned addr) { @@ -28,7 +28,7 @@ index 386fb62..3c98019 100755 regs.r2192_hour = t->tm_hour; diff --git a/snes/chip/spc7110/spc7110.cpp b/snes/chip/spc7110/spc7110.cpp -index d2dc640..74a817a 100755 +index d2dc640b..74a817a6 100755 --- a/snes/chip/spc7110/spc7110.cpp +++ b/snes/chip/spc7110/spc7110.cpp @@ -101,7 +101,7 @@ void SPC7110::set_data_adjust(unsigned addr) { r4814 = addr; r4815 = addr >> 8; @@ -41,7 +41,7 @@ index d2dc640..74a817a 100755 //sizeof(time_t) is platform-dependent; though rtc[] needs to be platform-agnostic. //yet platforms with 32-bit signed time_t will overflow every ~68 years. handle this by diff --git a/snes/chip/srtc/srtc.cpp b/snes/chip/srtc/srtc.cpp -index 1b2fd2a..78fc4c1 100755 +index 1b2fd2aa..78fc4c1f 100755 --- a/snes/chip/srtc/srtc.cpp +++ b/snes/chip/srtc/srtc.cpp @@ -31,7 +31,7 @@ void SRTC::reset() { @@ -54,7 +54,7 @@ index 1b2fd2a..78fc4c1 100755 //sizeof(time_t) is platform-dependent; though rtc[] needs to be platform-agnostic. //yet platforms with 32-bit signed time_t will overflow every ~68 years. handle this by diff --git a/snes/interface/interface.cpp b/snes/interface/interface.cpp -index a0e3a81..b3017c9 100755 +index a0e3a81b..b3017c90 100755 --- a/snes/interface/interface.cpp +++ b/snes/interface/interface.cpp @@ -18,4 +18,9 @@ void Interface::message(const string &text) { @@ -68,7 +68,7 @@ index a0e3a81..b3017c9 100755 + } diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp -index f1a48c0..df975e8 100755 +index f1a48c0f..df975e83 100755 --- a/snes/interface/interface.hpp +++ b/snes/interface/interface.hpp @@ -5,6 +5,7 @@ struct Interface { @@ -80,5 +80,5 @@ index f1a48c0..df975e8 100755 extern Interface *interface; -- -2.8.1 +2.15.0.rc1 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 5142de87..12ffff88 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 efe1b5884c316ce070953edd87c6c9aeffffaa94 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 9 Nov 2011 01:52:08 +0200 -Subject: [PATCH 04/26] Save controller state when savestating +Subject: [PATCH 04/27] Save controller state when savestating When savestating, save the controller state and restore it upon loadstate. Prevents libsnes from mixing up buttons. @@ -24,7 +24,7 @@ Prevents libsnes from mixing up buttons. 15 files changed, 142 insertions(+), 3 deletions(-) diff --git a/snes/controller/controller.cpp b/snes/controller/controller.cpp -index 9091b21..f254bed 100755 +index 9091b21b..f254bedb 100755 --- a/snes/controller/controller.cpp +++ b/snes/controller/controller.cpp @@ -46,8 +46,16 @@ void Controller::iobit(bool data) { @@ -45,7 +45,7 @@ index 9091b21..f254bed 100755 + } diff --git a/snes/controller/controller.hpp b/snes/controller/controller.hpp -index 7332712..827b2eb 100755 +index 73327129..827b2eb4 100755 --- a/snes/controller/controller.hpp +++ b/snes/controller/controller.hpp @@ -13,12 +13,14 @@ @@ -64,7 +64,7 @@ index 7332712..827b2eb 100755 bool iobit(); void iobit(bool data); diff --git a/snes/controller/gamepad/gamepad.cpp b/snes/controller/gamepad/gamepad.cpp -index 594020d..4fa1c99 100755 +index 594020d2..4fa1c99e 100755 --- a/snes/controller/gamepad/gamepad.cpp +++ b/snes/controller/gamepad/gamepad.cpp @@ -13,6 +13,19 @@ void Gamepad::latch(bool data) { @@ -88,7 +88,7 @@ index 594020d..4fa1c99 100755 latched = 0; counter = 0; diff --git a/snes/controller/gamepad/gamepad.hpp b/snes/controller/gamepad/gamepad.hpp -index c5ca69c..a2392d1 100755 +index c5ca69ca..a2392d1e 100755 --- a/snes/controller/gamepad/gamepad.hpp +++ b/snes/controller/gamepad/gamepad.hpp @@ -2,7 +2,7 @@ struct Gamepad : Controller { @@ -101,7 +101,7 @@ index c5ca69c..a2392d1 100755 bool latched; unsigned counter; diff --git a/snes/controller/justifier/justifier.cpp b/snes/controller/justifier/justifier.cpp -index 6207916..ad13a9b 100755 +index 62079166..ad13a9bd 100755 --- a/snes/controller/justifier/justifier.cpp +++ b/snes/controller/justifier/justifier.cpp @@ -100,6 +100,42 @@ void Justifier::latch(bool data) { @@ -148,7 +148,7 @@ index 6207916..ad13a9b 100755 create(Controller::Enter, 21477272); latched = 0; diff --git a/snes/controller/justifier/justifier.hpp b/snes/controller/justifier/justifier.hpp -index f927acf..6b7bba0 100755 +index f927acf6..6b7bba07 100755 --- a/snes/controller/justifier/justifier.hpp +++ b/snes/controller/justifier/justifier.hpp @@ -2,6 +2,7 @@ struct Justifier : Controller { @@ -160,7 +160,7 @@ index f927acf..6b7bba0 100755 //private: diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp -index c9f5d16..6b26fae 100755 +index c9f5d16b..6b26fae5 100755 --- a/snes/controller/mouse/mouse.cpp +++ b/snes/controller/mouse/mouse.cpp @@ -61,6 +61,19 @@ void Mouse::latch(bool data) { @@ -184,7 +184,7 @@ index c9f5d16..6b26fae 100755 latched = 0; counter = 0; diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp -index 95e24b6..b66ea51 100755 +index 95e24b65..b66ea513 100755 --- a/snes/controller/mouse/mouse.hpp +++ b/snes/controller/mouse/mouse.hpp @@ -2,7 +2,7 @@ struct Mouse : Controller { @@ -197,7 +197,7 @@ index 95e24b6..b66ea51 100755 bool latched; unsigned counter; diff --git a/snes/controller/multitap/multitap.cpp b/snes/controller/multitap/multitap.cpp -index 3a6eb72..146c41d 100755 +index 3a6eb720..146c41d4 100755 --- a/snes/controller/multitap/multitap.cpp +++ b/snes/controller/multitap/multitap.cpp @@ -30,6 +30,22 @@ void Multitap::latch(bool data) { @@ -224,7 +224,7 @@ index 3a6eb72..146c41d 100755 latched = 0; counter1 = 0; diff --git a/snes/controller/multitap/multitap.hpp b/snes/controller/multitap/multitap.hpp -index 0540af7..e6324ac 100755 +index 0540af71..e6324ac5 100755 --- a/snes/controller/multitap/multitap.hpp +++ b/snes/controller/multitap/multitap.hpp @@ -2,7 +2,7 @@ struct Multitap : Controller { @@ -237,7 +237,7 @@ index 0540af7..e6324ac 100755 bool latched; unsigned counter1; diff --git a/snes/controller/superscope/superscope.cpp b/snes/controller/superscope/superscope.cpp -index 12068f0..1a1dfbf 100755 +index 12068f05..1a1dfbff 100755 --- a/snes/controller/superscope/superscope.cpp +++ b/snes/controller/superscope/superscope.cpp @@ -100,6 +100,37 @@ void SuperScope::latch(bool data) { @@ -279,7 +279,7 @@ index 12068f0..1a1dfbf 100755 create(Controller::Enter, 21477272); latched = 0; diff --git a/snes/controller/superscope/superscope.hpp b/snes/controller/superscope/superscope.hpp -index a7a90b7..93509d7 100755 +index a7a90b71..93509d79 100755 --- a/snes/controller/superscope/superscope.hpp +++ b/snes/controller/superscope/superscope.hpp @@ -2,6 +2,7 @@ struct SuperScope : Controller { @@ -291,7 +291,7 @@ index a7a90b7..93509d7 100755 //private: diff --git a/snes/system/input.cpp b/snes/system/input.cpp -index 9050310..ec5559d 100755 +index 90503106..ec5559dc 100755 --- a/snes/system/input.cpp +++ b/snes/system/input.cpp @@ -26,6 +26,22 @@ void Input::connect(bool port, Input::Device id) { @@ -318,7 +318,7 @@ index 9050310..ec5559d 100755 connect(Controller::Port1, Input::Device::Joypad); connect(Controller::Port2, Input::Device::Joypad); diff --git a/snes/system/input.hpp b/snes/system/input.hpp -index 13ef46e..6832e82 100755 +index 13ef46e1..6832e823 100755 --- a/snes/system/input.hpp +++ b/snes/system/input.hpp @@ -31,6 +31,7 @@ struct Input { @@ -330,7 +330,7 @@ index 13ef46e..6832e82 100755 Input(); ~Input(); diff --git a/snes/system/serialization.cpp b/snes/system/serialization.cpp -index f7d6f3b..08e7051 100755 +index f7d6f3b1..08e70510 100755 --- a/snes/system/serialization.cpp +++ b/snes/system/serialization.cpp @@ -56,6 +56,7 @@ void System::serialize_all(serializer &s) { @@ -342,5 +342,5 @@ index f7d6f3b..08e7051 100755 if(cartridge.mode() == Cartridge::Mode::SufamiTurbo) sufamiturbo.serialize(s); if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) icd2.serialize(s); -- -2.8.1 +2.15.0.rc1 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 3a8c37cc..d50d2474 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,14 +1,14 @@ From cdf2f46490f128308eb7f399d03530936ebeda0a Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 11 Nov 2011 03:05:48 +0200 -Subject: [PATCH 05/26] Fix unserialization of 64-bit signed integers +Subject: [PATCH 05/27] Fix unserialization of 64-bit signed integers --- nall/serializer.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nall/serializer.hpp b/nall/serializer.hpp -index ff2337a..e6bc8fa 100755 +index ff2337ab..e6bc8fad 100755 --- a/nall/serializer.hpp +++ b/nall/serializer.hpp @@ -58,7 +58,7 @@ namespace nall { @@ -21,5 +21,5 @@ index ff2337a..e6bc8fa 100755 isize += size; } -- -2.8.1 +2.15.0.rc1 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 409ce1cc..fcaad3a0 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 4dc46334ec175e26277632fee4aea80768749af9 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Fri, 11 Nov 2011 19:49:46 +0200 -Subject: [PATCH 06/26] Allow frontend to control random number seed +Subject: [PATCH 06/27] Allow frontend to control random number seed --- snes/interface/interface.cpp | 5 +++++ @@ -10,7 +10,7 @@ Subject: [PATCH 06/26] Allow frontend to control random number seed 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/snes/interface/interface.cpp b/snes/interface/interface.cpp -index b3017c9..0a21a13 100755 +index b3017c90..0a21a132 100755 --- a/snes/interface/interface.cpp +++ b/snes/interface/interface.cpp @@ -23,4 +23,9 @@ time_t Interface::currentTime() @@ -24,7 +24,7 @@ index b3017c9..0a21a13 100755 + } diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp -index df975e8..30ee7fd 100755 +index df975e83..30ee7fde 100755 --- a/snes/interface/interface.hpp +++ b/snes/interface/interface.hpp @@ -6,6 +6,7 @@ struct Interface { @@ -36,7 +36,7 @@ index df975e8..30ee7fd 100755 extern Interface *interface; diff --git a/snes/system/system.cpp b/snes/system/system.cpp -index c19a7c5..dbd912d 100755 +index c19a7c51..dbd912d8 100755 --- a/snes/system/system.cpp +++ b/snes/system/system.cpp @@ -146,7 +146,7 @@ void System::unload() { @@ -49,5 +49,5 @@ index c19a7c5..dbd912d 100755 region = config.region; expansion = config.expansion_port; -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0007-Fix-mouse-polling.patch b/bsnes-patches/v085/0007-Fix-mouse-polling.patch index 7f961584..0ab38473 100644 --- a/bsnes-patches/v085/0007-Fix-mouse-polling.patch +++ b/bsnes-patches/v085/0007-Fix-mouse-polling.patch @@ -1,7 +1,7 @@ From eeaf6dc52d39ca9c150ff61864c11297d200d968 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 7 Mar 2012 16:57:18 +0200 -Subject: [PATCH 07/26] Fix mouse polling +Subject: [PATCH 07/27] Fix mouse polling Don't poll for mouse motion excessive number of times (no need to poll it for each bit!) @@ -11,7 +11,7 @@ each bit!) 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp -index 6b26fae..1a066b9 100755 +index 6b26fae5..1a066b98 100755 --- a/snes/controller/mouse/mouse.cpp +++ b/snes/controller/mouse/mouse.cpp @@ -3,9 +3,13 @@ @@ -48,7 +48,7 @@ index 6b26fae..1a066b9 100755 } diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp -index b66ea51..b07c8ab 100755 +index b66ea513..b07c8ab7 100755 --- a/snes/controller/mouse/mouse.hpp +++ b/snes/controller/mouse/mouse.hpp @@ -6,4 +6,6 @@ struct Mouse : Controller { @@ -59,5 +59,5 @@ index b66ea51..b07c8ab 100755 + int _position_y; }; -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0008-Fix-uninitialized-variables.patch b/bsnes-patches/v085/0008-Fix-uninitialized-variables.patch index 2f5800a7..504d87ee 100644 --- a/bsnes-patches/v085/0008-Fix-uninitialized-variables.patch +++ b/bsnes-patches/v085/0008-Fix-uninitialized-variables.patch @@ -1,7 +1,7 @@ From 7018377c93553071fc404db872b2746d40ac3bce Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sat, 1 Sep 2012 11:23:34 +0300 -Subject: [PATCH 08/26] Fix uninitialized variables +Subject: [PATCH 08/27] Fix uninitialized variables These uninitialized variables cause a lot of desyncs in Shadowrun. --- @@ -16,7 +16,7 @@ These uninitialized variables cause a lot of desyncs in Shadowrun. 8 files changed, 38 insertions(+) diff --git a/snes/alt/dsp/dsp.cpp b/snes/alt/dsp/dsp.cpp -index d0c9e07..c6809f7 100755 +index d0c9e077..c6809f73 100755 --- a/snes/alt/dsp/dsp.cpp +++ b/snes/alt/dsp/dsp.cpp @@ -40,6 +40,8 @@ void DSP::write(uint8 addr, uint8 data) { @@ -29,7 +29,7 @@ index d0c9e07..c6809f7 100755 spc_dsp.reset(); spc_dsp.set_output(samplebuffer, 8192); diff --git a/snes/alt/ppu-compatibility/ppu.cpp b/snes/alt/ppu-compatibility/ppu.cpp -index 1a3835b..a21e5e3 100755 +index 1a3835b3..a21e5e31 100755 --- a/snes/alt/ppu-compatibility/ppu.cpp +++ b/snes/alt/ppu-compatibility/ppu.cpp @@ -345,6 +345,17 @@ void PPU::power() { @@ -51,7 +51,7 @@ index 1a3835b..a21e5e3 100755 } diff --git a/snes/cpu/core/core.cpp b/snes/cpu/core/core.cpp -index 427176b..a5b809b 100755 +index 427176b0..a5b809b9 100755 --- a/snes/cpu/core/core.cpp +++ b/snes/cpu/core/core.cpp @@ -86,4 +86,12 @@ CPUcore::CPUcore() { @@ -68,7 +68,7 @@ index 427176b..a5b809b 100755 + } diff --git a/snes/cpu/core/core.hpp b/snes/cpu/core/core.hpp -index 964bd12..7a685a8 100755 +index 964bd128..7a685a8d 100755 --- a/snes/cpu/core/core.hpp +++ b/snes/cpu/core/core.hpp @@ -7,6 +7,8 @@ struct CPUcore { @@ -81,7 +81,7 @@ index 964bd12..7a685a8 100755 virtual uint8_t op_read(uint32_t addr) = 0; virtual void op_write(uint32_t addr, uint8_t data) = 0; diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp -index f6ae975..2d7d343 100755 +index f6ae9754..2d7d3432 100755 --- a/snes/cpu/cpu.cpp +++ b/snes/cpu/cpu.cpp @@ -125,6 +125,7 @@ void CPU::power() { @@ -93,7 +93,7 @@ index f6ae975..2d7d343 100755 void CPU::reset() { diff --git a/snes/smp/core/core.cpp b/snes/smp/core/core.cpp -index 9c94d00..2fc29be 100755 +index 9c94d00a..2fc29be1 100755 --- a/snes/smp/core/core.cpp +++ b/snes/smp/core/core.cpp @@ -269,4 +269,15 @@ void SMPcore::op_step() { @@ -113,7 +113,7 @@ index 9c94d00..2fc29be 100755 + } diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp -index 6adf6f6..1489fce 100755 +index 6adf6f6b..1489fcef 100755 --- a/snes/smp/core/core.hpp +++ b/snes/smp/core/core.hpp @@ -11,6 +11,8 @@ struct SMPcore { @@ -126,7 +126,7 @@ index 6adf6f6..1489fce 100755 string disassemble_opcode(uint16 addr); diff --git a/snes/smp/smp.cpp b/snes/smp/smp.cpp -index 9080624..d4ccf42 100755 +index 90806245..d4ccf425 100755 --- a/snes/smp/smp.cpp +++ b/snes/smp/smp.cpp @@ -53,6 +53,7 @@ void SMP::power() { @@ -138,5 +138,5 @@ index 9080624..d4ccf42 100755 void SMP::reset() { -- -2.8.1 +2.15.0.rc1 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 ccfa14a0..409e08e1 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,7 +1,7 @@ From 6e0364c9a86caa71623a188a720b2d68b304b89b Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 24 Sep 2012 21:46:09 +0300 -Subject: [PATCH 09/26] Add needed support for detecting true polls as opposed +Subject: [PATCH 09/27] Add needed support for detecting true polls as opposed to just autopolling --- @@ -10,7 +10,7 @@ Subject: [PATCH 09/26] Add needed support for detecting true polls as opposed 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/snes/cpu/cpu.hpp b/snes/cpu/cpu.hpp -index 3da865e..4944577 100755 +index 3da865e2..49445773 100755 --- a/snes/cpu/cpu.hpp +++ b/snes/cpu/cpu.hpp @@ -25,6 +25,7 @@ struct CPU : public Processor, public CPUcore, public PPUcounter { @@ -22,7 +22,7 @@ index 3da865e..4944577 100755 #include "dma/dma.hpp" #include "memory/memory.hpp" diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp -index 8b6aaa6..c5ee930 100755 +index 8b6aaa6a..c5ee930f 100755 --- a/snes/cpu/mmio/mmio.cpp +++ b/snes/cpu/mmio/mmio.cpp @@ -42,6 +42,7 @@ void CPU::mmio_w4016(uint8 data) { @@ -65,5 +65,5 @@ index 8b6aaa6..c5ee930 100755 //DMAPx uint8 CPU::mmio_r43x0(uint8 i) { -- -2.8.1 +2.15.0.rc1 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 877cfc1c..95f1f639 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,14 +1,14 @@ From e397bd46f17d6ea00c8c96d5a8e0c5f5b4a6f642 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 14 Oct 2012 23:31:36 +0300 -Subject: [PATCH 10/26] Fix compiling on GCC 4.7 +Subject: [PATCH 10/27] Fix compiling on GCC 4.7 --- nall/string.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nall/string.hpp b/nall/string.hpp -index 1b255ce..07a64df 100755 +index 1b255ce2..07a64dfc 100755 --- a/nall/string.hpp +++ b/nall/string.hpp @@ -25,8 +25,8 @@ @@ -22,5 +22,5 @@ index 1b255ce..07a64df 100755 #include #include -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0011-Support-notifying-latches.patch b/bsnes-patches/v085/0011-Support-notifying-latches.patch index cabe62c6..f9f285d7 100644 --- a/bsnes-patches/v085/0011-Support-notifying-latches.patch +++ b/bsnes-patches/v085/0011-Support-notifying-latches.patch @@ -1,7 +1,7 @@ From e047aa8eb9883f60e4141effba8128a4a555d8be Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 27 Oct 2013 10:52:45 +0200 -Subject: [PATCH 11/26] Support notifying latches +Subject: [PATCH 11/27] Support notifying latches --- snes/cpu/mmio/mmio.cpp | 1 + @@ -11,7 +11,7 @@ Subject: [PATCH 11/26] Support notifying latches 4 files changed, 8 insertions(+) diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp -index c5ee930..b7afff0 100755 +index c5ee930f..b7afff00 100755 --- a/snes/cpu/mmio/mmio.cpp +++ b/snes/cpu/mmio/mmio.cpp @@ -33,6 +33,7 @@ void CPU::mmio_w2183(uint8 data) { @@ -23,7 +23,7 @@ index c5ee930..b7afff0 100755 input.port2->latch(data & 1); } diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp -index 179df27..6a98de0 100755 +index 179df27d..6a98de00 100755 --- a/snes/cpu/timing/joypad.cpp +++ b/snes/cpu/timing/joypad.cpp @@ -9,6 +9,7 @@ void CPU::step_auto_joypad_poll() { @@ -35,7 +35,7 @@ index 179df27..6a98de0 100755 input.port2->latch(1); input.port1->latch(0); diff --git a/snes/interface/interface.cpp b/snes/interface/interface.cpp -index 0a21a13..6685556 100755 +index 0a21a132..6685556c 100755 --- a/snes/interface/interface.cpp +++ b/snes/interface/interface.cpp @@ -28,4 +28,9 @@ time_t Interface::randomSeed() @@ -49,7 +49,7 @@ index 0a21a13..6685556 100755 + } diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp -index 30ee7fd..203f7b0 100755 +index 30ee7fde..203f7b0c 100755 --- a/snes/interface/interface.hpp +++ b/snes/interface/interface.hpp @@ -7,6 +7,7 @@ struct Interface { @@ -61,5 +61,5 @@ index 30ee7fd..203f7b0 100755 extern Interface *interface; -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0012-Support-unlimited-number-of-breakpoints.patch b/bsnes-patches/v085/0012-Support-unlimited-number-of-breakpoints.patch index 2cb728ce..92677c4a 100644 --- a/bsnes-patches/v085/0012-Support-unlimited-number-of-breakpoints.patch +++ b/bsnes-patches/v085/0012-Support-unlimited-number-of-breakpoints.patch @@ -1,7 +1,7 @@ From a5b380757b086e3a00b47fe14e2a63c74683e8da Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Thu, 28 Nov 2013 22:36:29 +0200 -Subject: [PATCH 12/26] Support unlimited number of breakpoints +Subject: [PATCH 12/27] Support unlimited number of breakpoints --- snes/alt/cpu/cpu.cpp | 22 +++++++------- @@ -40,7 +40,7 @@ Subject: [PATCH 12/26] Support unlimited number of breakpoints 33 files changed, 166 insertions(+), 70 deletions(-) diff --git a/snes/alt/cpu/cpu.cpp b/snes/alt/cpu/cpu.cpp -index 814908d..dcbb92d 100755 +index 814908d0..dcbb92d3 100755 --- a/snes/alt/cpu/cpu.cpp +++ b/snes/alt/cpu/cpu.cpp @@ -89,24 +89,24 @@ void CPU::enable() { @@ -80,7 +80,7 @@ index 814908d..dcbb92d 100755 void CPU::power() { diff --git a/snes/alt/ppu-compatibility/ppu.cpp b/snes/alt/ppu-compatibility/ppu.cpp -index a21e5e3..122b143 100755 +index a21e5e31..122b1430 100755 --- a/snes/alt/ppu-compatibility/ppu.cpp +++ b/snes/alt/ppu-compatibility/ppu.cpp @@ -126,8 +126,8 @@ void PPU::enable() { @@ -95,7 +95,7 @@ index a21e5e3..122b143 100755 void PPU::power() { diff --git a/snes/alt/ppu-parallel/ppu.cpp b/snes/alt/ppu-parallel/ppu.cpp -index 1c3dcb7..8dd118b 100755 +index 1c3dcb70..8dd118b2 100755 --- a/snes/alt/ppu-parallel/ppu.cpp +++ b/snes/alt/ppu-parallel/ppu.cpp @@ -36,8 +36,8 @@ void PPU::frame() { @@ -110,7 +110,7 @@ index 1c3dcb7..8dd118b 100755 void PPU::power() { diff --git a/snes/alt/ppu-performance/ppu.cpp b/snes/alt/ppu-performance/ppu.cpp -index 7c231bc..4b2b294 100755 +index 7c231bc0..4b2b2948 100755 --- a/snes/alt/ppu-performance/ppu.cpp +++ b/snes/alt/ppu-performance/ppu.cpp @@ -90,8 +90,8 @@ void PPU::enable() { @@ -125,7 +125,7 @@ index 7c231bc..4b2b294 100755 void PPU::power() { diff --git a/snes/cartridge/cartridge.hpp b/snes/cartridge/cartridge.hpp -index 37555bc..82e73c4 100755 +index 37555bc0..82e73c4c 100755 --- a/snes/cartridge/cartridge.hpp +++ b/snes/cartridge/cartridge.hpp @@ -12,6 +12,22 @@ struct Cartridge : property { @@ -160,7 +160,7 @@ index 37555bc..82e73c4 100755 Mapping(); Mapping(const function&, const function&); diff --git a/snes/cartridge/markup.cpp b/snes/cartridge/markup.cpp -index e639fe5..2dd0d64 100755 +index e639fe52..2dd0d646 100755 --- a/snes/cartridge/markup.cpp +++ b/snes/cartridge/markup.cpp @@ -74,6 +74,7 @@ void Cartridge::parse_markup_rom(XML::Node &root) { @@ -250,7 +250,7 @@ index e639fe5..2dd0d64 100755 write = { &Memory::write, &memory }; mode = Bus::MapMode::Direct; diff --git a/snes/cheat/cheat.cpp b/snes/cheat/cheat.cpp -index 46c42d1..3a269cc 100755 +index 46c42d1c..3a269cc5 100755 --- a/snes/cheat/cheat.cpp +++ b/snes/cheat/cheat.cpp @@ -21,9 +21,9 @@ void Cheat::synchronize() { @@ -283,7 +283,7 @@ index 46c42d1..3a269cc 100755 } } diff --git a/snes/cheat/cheat.hpp b/snes/cheat/cheat.hpp -index 306b99b..b4d2a42 100755 +index 306b99b1..b4d2a42e 100755 --- a/snes/cheat/cheat.hpp +++ b/snes/cheat/cheat.hpp @@ -1,6 +1,7 @@ @@ -295,7 +295,7 @@ index 306b99b..b4d2a42 100755 struct Cheat : public linear_vector { diff --git a/snes/chip/bsx/satellaview/satellaview.cpp b/snes/chip/bsx/satellaview/satellaview.cpp -index 3c98019..25af8e5 100755 +index 3c980195..25af8e56 100755 --- a/snes/chip/bsx/satellaview/satellaview.cpp +++ b/snes/chip/bsx/satellaview/satellaview.cpp @@ -6,8 +6,8 @@ void BSXSatellaview::init() { @@ -310,7 +310,7 @@ index 3c98019..25af8e5 100755 void BSXSatellaview::unload() { diff --git a/snes/chip/hitachidsp/hitachidsp.cpp b/snes/chip/hitachidsp/hitachidsp.cpp -index 1042267..3e5c5bd 100755 +index 1042267e..3e5c5bdb 100755 --- a/snes/chip/hitachidsp/hitachidsp.cpp +++ b/snes/chip/hitachidsp/hitachidsp.cpp @@ -23,7 +23,7 @@ void HitachiDSP::enter() { @@ -323,7 +323,7 @@ index 1042267..3e5c5bd 100755 } state = State::Idle; diff --git a/snes/chip/hitachidsp/memory.cpp b/snes/chip/hitachidsp/memory.cpp -index 3c9c3af..36868e8 100755 +index 3c9c3af1..36868e88 100755 --- a/snes/chip/hitachidsp/memory.cpp +++ b/snes/chip/hitachidsp/memory.cpp @@ -1,7 +1,7 @@ @@ -336,7 +336,7 @@ index 3c9c3af..36868e8 100755 } diff --git a/snes/chip/nss/nss.cpp b/snes/chip/nss/nss.cpp -index 964973d..5946af3 100755 +index 964973d0..5946af3b 100755 --- a/snes/chip/nss/nss.cpp +++ b/snes/chip/nss/nss.cpp @@ -10,8 +10,8 @@ void NSS::init() { @@ -351,7 +351,7 @@ index 964973d..5946af3 100755 void NSS::unload() { diff --git a/snes/chip/sa1/memory/memory.cpp b/snes/chip/sa1/memory/memory.cpp -index d13ac92..9bb4ff2 100755 +index d13ac929..9bb4ff20 100755 --- a/snes/chip/sa1/memory/memory.cpp +++ b/snes/chip/sa1/memory/memory.cpp @@ -107,7 +107,7 @@ void SA1::op_io() { @@ -364,7 +364,7 @@ index d13ac92..9bb4ff2 100755 if(((addr & 0x40e000) == 0x006000) || ((addr & 0xd00000) == 0x400000)) tick(); return bus_read(addr); diff --git a/snes/chip/sa1/memory/memory.hpp b/snes/chip/sa1/memory/memory.hpp -index ffb9e9f..ab8e1ed 100755 +index ffb9e9f6..ab8e1edd 100755 --- a/snes/chip/sa1/memory/memory.hpp +++ b/snes/chip/sa1/memory/memory.hpp @@ -3,7 +3,7 @@ void bus_write(unsigned addr, uint8 data); @@ -377,7 +377,7 @@ index ffb9e9f..ab8e1ed 100755 uint8 mmc_read(unsigned addr); diff --git a/snes/chip/sa1/sa1.cpp b/snes/chip/sa1/sa1.cpp -index 71c6310..30e0080 100755 +index 71c6310a..30e00809 100755 --- a/snes/chip/sa1/sa1.cpp +++ b/snes/chip/sa1/sa1.cpp @@ -37,7 +37,7 @@ void SA1::enter() { @@ -390,7 +390,7 @@ index 71c6310..30e0080 100755 if(!regs.e) op_writestack(regs.pc.b); op_writestack(regs.pc.h); diff --git a/snes/chip/sdd1/sdd1.cpp b/snes/chip/sdd1/sdd1.cpp -index c9b8b1c..5d6cc55 100755 +index c9b8b1c4..5d6cc55f 100755 --- a/snes/chip/sdd1/sdd1.cpp +++ b/snes/chip/sdd1/sdd1.cpp @@ -14,8 +14,8 @@ void SDD1::init() { @@ -405,7 +405,7 @@ index c9b8b1c..5d6cc55 100755 void SDD1::unload() { diff --git a/snes/cpu/core/core.hpp b/snes/cpu/core/core.hpp -index 7a685a8..9d77f3c 100755 +index 7a685a8d..9d77f3c5 100755 --- a/snes/cpu/core/core.hpp +++ b/snes/cpu/core/core.hpp @@ -10,7 +10,7 @@ struct CPUcore { @@ -418,7 +418,7 @@ index 7a685a8..9d77f3c 100755 virtual void last_cycle() = 0; virtual bool interrupt_pending() = 0; diff --git a/snes/cpu/core/disassembler/disassembler.cpp b/snes/cpu/core/disassembler/disassembler.cpp -index 030b3ab..ab8dde2 100755 +index 030b3ab5..ab8dde24 100755 --- a/snes/cpu/core/disassembler/disassembler.cpp +++ b/snes/cpu/core/disassembler/disassembler.cpp @@ -6,7 +6,7 @@ uint8 CPUcore::dreadb(uint32 addr) { @@ -431,7 +431,7 @@ index 030b3ab..ab8dde2 100755 uint16 CPUcore::dreadw(uint32 addr) { diff --git a/snes/cpu/core/memory.hpp b/snes/cpu/core/memory.hpp -index 4992657..132501c 100755 +index 49926578..132501c1 100755 --- a/snes/cpu/core/memory.hpp +++ b/snes/cpu/core/memory.hpp @@ -1,5 +1,5 @@ @@ -442,7 +442,7 @@ index 4992657..132501c 100755 alwaysinline uint8_t op_readstack() { diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp -index 2d7d343..39da6b1 100755 +index 2d7d3432..39da6b16 100755 --- a/snes/cpu/cpu.cpp +++ b/snes/cpu/cpu.cpp @@ -78,8 +78,8 @@ void CPU::enter() { @@ -493,7 +493,7 @@ index 2d7d343..39da6b1 100755 void CPU::power() { diff --git a/snes/cpu/debugger/debugger.cpp b/snes/cpu/debugger/debugger.cpp -index a33518e..8301bdb 100755 +index a33518ed..8301bdb6 100755 --- a/snes/cpu/debugger/debugger.cpp +++ b/snes/cpu/debugger/debugger.cpp @@ -19,8 +19,8 @@ void CPUDebugger::op_step() { @@ -508,7 +508,7 @@ index a33518e..8301bdb 100755 debugger.breakpoint_test(Debugger::Breakpoint::Source::CPUBus, Debugger::Breakpoint::Mode::Read, addr, data); return data; diff --git a/snes/cpu/debugger/debugger.hpp b/snes/cpu/debugger/debugger.hpp -index 579f6f0..c3d66db 100755 +index 579f6f03..c3d66db5 100755 --- a/snes/cpu/debugger/debugger.hpp +++ b/snes/cpu/debugger/debugger.hpp @@ -16,7 +16,7 @@ public: @@ -521,7 +521,7 @@ index 579f6f0..c3d66db 100755 CPUDebugger(); diff --git a/snes/cpu/dma/dma.cpp b/snes/cpu/dma/dma.cpp -index e8cdb3e..0a00bfe 100755 +index e8cdb3ec..0a00bfea 100755 --- a/snes/cpu/dma/dma.cpp +++ b/snes/cpu/dma/dma.cpp @@ -26,7 +26,7 @@ bool CPU::dma_addr_valid(uint32 abus) { @@ -543,7 +543,7 @@ index e8cdb3e..0a00bfe 100755 dma_write(dma_addr_valid(abus), abus, regs.mdr); } diff --git a/snes/cpu/memory/memory.cpp b/snes/cpu/memory/memory.cpp -index c2c8f1f..31f82c3 100755 +index c2c8f1fa..31f82c31 100755 --- a/snes/cpu/memory/memory.cpp +++ b/snes/cpu/memory/memory.cpp @@ -10,11 +10,11 @@ void CPU::op_io() { @@ -561,7 +561,7 @@ index c2c8f1f..31f82c3 100755 alu_edge(); return regs.mdr; diff --git a/snes/cpu/memory/memory.hpp b/snes/cpu/memory/memory.hpp -index d33861d..fd64ba8 100755 +index d33861d4..fd64ba8b 100755 --- a/snes/cpu/memory/memory.hpp +++ b/snes/cpu/memory/memory.hpp @@ -1,4 +1,4 @@ @@ -571,7 +571,7 @@ index d33861d..fd64ba8 100755 debugvirtual void op_write(uint32 addr, uint8 data); alwaysinline unsigned speed(unsigned addr) const; diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp -index b7afff0..30048c1 100755 +index b7afff00..30048c19 100755 --- a/snes/cpu/mmio/mmio.cpp +++ b/snes/cpu/mmio/mmio.cpp @@ -5,7 +5,7 @@ bool CPU::joylatch() { return status.joypad_strobe_latch; } @@ -584,7 +584,7 @@ index b7afff0..30048c1 100755 //WMDATA diff --git a/snes/debugger/debugger.cpp b/snes/debugger/debugger.cpp -index b131233..e8d0f5a 100755 +index b1312339..e8d0f5af 100755 --- a/snes/debugger/debugger.cpp +++ b/snes/debugger/debugger.cpp @@ -33,7 +33,7 @@ uint8 Debugger::read(Debugger::MemorySource source, unsigned addr) { @@ -597,7 +597,7 @@ index b131233..e8d0f5a 100755 case MemorySource::APUBus: { diff --git a/snes/memory/memory-inline.hpp b/snes/memory/memory-inline.hpp -index 70503be..45f150c 100755 +index 70503bea..45f150c9 100755 --- a/snes/memory/memory-inline.hpp +++ b/snes/memory/memory-inline.hpp @@ -51,11 +51,26 @@ MappedRAM::MappedRAM() : data_(0), size_(0), write_protect_(false) {} @@ -631,7 +631,7 @@ index 70503be..45f150c 100755 return writer[lookup[addr]](target[addr], data); } diff --git a/snes/memory/memory.cpp b/snes/memory/memory.cpp -index ede9cbd..a9a484a 100755 +index ede9cbd0..a9a484a0 100755 --- a/snes/memory/memory.cpp +++ b/snes/memory/memory.cpp @@ -27,6 +27,7 @@ void Bus::map( @@ -715,7 +715,7 @@ index ede9cbd..a9a484a 100755 } diff --git a/snes/memory/memory.hpp b/snes/memory/memory.hpp -index 634e071..c20e14d 100755 +index 634e0717..c20e14db 100755 --- a/snes/memory/memory.hpp +++ b/snes/memory/memory.hpp @@ -44,10 +44,13 @@ private: @@ -756,7 +756,7 @@ index 634e071..c20e14d 100755 ~Bus(); }; diff --git a/snes/ppu/ppu.cpp b/snes/ppu/ppu.cpp -index 8545175..13e231c 100755 +index 8545175f..13e231cf 100755 --- a/snes/ppu/ppu.cpp +++ b/snes/ppu/ppu.cpp @@ -87,8 +87,8 @@ void PPU::enable() { @@ -771,7 +771,7 @@ index 8545175..13e231c 100755 void PPU::power() { diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp -index 1489fce..13d6936 100755 +index 1489fcef..13d69364 100755 --- a/snes/smp/core/core.hpp +++ b/snes/smp/core/core.hpp @@ -2,7 +2,7 @@ struct SMPcore { @@ -784,7 +784,7 @@ index 1489fce..13d6936 100755 #include "registers.hpp" #include "memory.hpp" diff --git a/snes/snes.hpp b/snes/snes.hpp -index dffeeee..37ed1fe 100755 +index dffeeee3..37ed1feb 100755 --- a/snes/snes.hpp +++ b/snes/snes.hpp @@ -1,5 +1,6 @@ @@ -795,5 +795,5 @@ index dffeeee..37ed1fe 100755 namespace SNES { namespace Info { -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0013-Support-auto-detecting-bsnes-version.patch b/bsnes-patches/v085/0013-Support-auto-detecting-bsnes-version.patch index 36700e23..1fbc459e 100644 --- a/bsnes-patches/v085/0013-Support-auto-detecting-bsnes-version.patch +++ b/bsnes-patches/v085/0013-Support-auto-detecting-bsnes-version.patch @@ -1,7 +1,7 @@ From 8bc6bb381e680616dcc843c99889799aedd43163 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sat, 30 Nov 2013 10:27:37 +0200 -Subject: [PATCH 13/26] Support auto-detecting bsnes version +Subject: [PATCH 13/27] Support auto-detecting bsnes version --- bsnes.mk | 3 +++ @@ -10,7 +10,7 @@ Subject: [PATCH 13/26] Support auto-detecting bsnes version diff --git a/bsnes.mk b/bsnes.mk new file mode 100644 -index 0000000..20f22f6 +index 00000000..20f22f61 --- /dev/null +++ b/bsnes.mk @@ -0,0 +1,3 @@ @@ -18,5 +18,5 @@ index 0000000..20f22f6 +LIBSNES_DIR=ui-libsnes +BSNES_VERSION=085 -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0014-Support-alternate-more-accurate-poll-timings.patch b/bsnes-patches/v085/0014-Support-alternate-more-accurate-poll-timings.patch index ad9be399..683fefb9 100644 --- a/bsnes-patches/v085/0014-Support-alternate-more-accurate-poll-timings.patch +++ b/bsnes-patches/v085/0014-Support-alternate-more-accurate-poll-timings.patch @@ -1,7 +1,7 @@ From 40c456dadd79cb2c94379fda8b41a4d0ba051ad1 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sat, 7 Dec 2013 23:32:44 +0200 -Subject: [PATCH 14/26] Support alternate (more accurate) poll timings +Subject: [PATCH 14/27] Support alternate (more accurate) poll timings --- snes/config/config.cpp | 1 + @@ -13,7 +13,7 @@ Subject: [PATCH 14/26] Support alternate (more accurate) poll timings 6 files changed, 56 insertions(+), 4 deletions(-) diff --git a/snes/config/config.cpp b/snes/config/config.cpp -index 701af94..206daae 100755 +index 701af94c..206daae0 100755 --- a/snes/config/config.cpp +++ b/snes/config/config.cpp @@ -13,6 +13,7 @@ Configuration::Configuration() { @@ -25,7 +25,7 @@ index 701af94..206daae 100755 smp.ntsc_frequency = 24607104; //32040.5 * 768 smp.pal_frequency = 24607104; diff --git a/snes/config/config.hpp b/snes/config/config.hpp -index 1f4d037..dabde59 100755 +index 1f4d037c..dabde597 100755 --- a/snes/config/config.hpp +++ b/snes/config/config.hpp @@ -10,6 +10,7 @@ struct Configuration { @@ -37,7 +37,7 @@ index 1f4d037..dabde59 100755 struct SMP { diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp -index 6a98de0..ae8e94f 100755 +index 6a98de00..ae8e94f8 100755 --- a/snes/cpu/timing/joypad.cpp +++ b/snes/cpu/timing/joypad.cpp @@ -29,4 +29,44 @@ void CPU::step_auto_joypad_poll() { @@ -86,7 +86,7 @@ index 6a98de0..ae8e94f 100755 + #endif diff --git a/snes/cpu/timing/timing.cpp b/snes/cpu/timing/timing.cpp -index f1378f0..d7cf24f 100755 +index f1378f0c..d7cf24f3 100755 --- a/snes/cpu/timing/timing.cpp +++ b/snes/cpu/timing/timing.cpp @@ -17,10 +17,18 @@ void CPU::add_clocks(unsigned clocks) { @@ -113,7 +113,7 @@ index f1378f0..d7cf24f 100755 if(status.dram_refreshed == false && hcounter() >= status.dram_refresh_position) { diff --git a/snes/cpu/timing/timing.hpp b/snes/cpu/timing/timing.hpp -index 6c225da..bf15a72 100755 +index 6c225dab..bf15a727 100755 --- a/snes/cpu/timing/timing.hpp +++ b/snes/cpu/timing/timing.hpp @@ -22,3 +22,4 @@ alwaysinline bool irq_test(); @@ -122,7 +122,7 @@ index 6c225da..bf15a72 100755 void step_auto_joypad_poll(); +void step_auto_joypad_poll_NEW(bool polarity); diff --git a/snes/snes.hpp b/snes/snes.hpp -index 37ed1fe..4e3ba64 100755 +index 37ed1feb..4e3ba64c 100755 --- a/snes/snes.hpp +++ b/snes/snes.hpp @@ -1,6 +1,7 @@ @@ -134,5 +134,5 @@ index 37ed1fe..4e3ba64 100755 namespace SNES { namespace Info { -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0015-Fix-mouse-speed-support.patch b/bsnes-patches/v085/0015-Fix-mouse-speed-support.patch index 22d9f0ec..8984d080 100644 --- a/bsnes-patches/v085/0015-Fix-mouse-speed-support.patch +++ b/bsnes-patches/v085/0015-Fix-mouse-speed-support.patch @@ -1,7 +1,7 @@ From 863bde899b53ae31e854096ac5258208c848a293 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Thu, 6 Mar 2014 21:07:54 +0200 -Subject: [PATCH 15/26] Fix mouse speed support +Subject: [PATCH 15/27] Fix mouse speed support --- snes/config/config.cpp | 1 + @@ -11,7 +11,7 @@ Subject: [PATCH 15/26] Fix mouse speed support 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/snes/config/config.cpp b/snes/config/config.cpp -index 206daae..1983137 100755 +index 206daae0..19831370 100755 --- a/snes/config/config.cpp +++ b/snes/config/config.cpp @@ -8,6 +8,7 @@ Configuration::Configuration() { @@ -23,7 +23,7 @@ index 206daae..1983137 100755 cpu.version = 2; cpu.ntsc_frequency = 21477272; //315 / 88 * 6000000 diff --git a/snes/config/config.hpp b/snes/config/config.hpp -index dabde59..68fe0bd 100755 +index dabde597..68fe0bde 100755 --- a/snes/config/config.hpp +++ b/snes/config/config.hpp @@ -1,9 +1,12 @@ @@ -40,7 +40,7 @@ index dabde59..68fe0bd 100755 struct CPU { unsigned version; diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp -index 1a066b9..caa7a35 100755 +index 1a066b98..caa7a358 100755 --- a/snes/controller/mouse/mouse.cpp +++ b/snes/controller/mouse/mouse.cpp @@ -1,6 +1,10 @@ @@ -87,7 +87,7 @@ index 1a066b9..caa7a35 100755 #endif diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp -index b07c8ab..13a9313 100755 +index b07c8ab7..13a9313e 100755 --- a/snes/controller/mouse/mouse.hpp +++ b/snes/controller/mouse/mouse.hpp @@ -6,6 +6,7 @@ struct Mouse : Controller { @@ -99,5 +99,5 @@ index b07c8ab..13a9313 100755 int _position_y; }; -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0016-Fix-tracelog-of-controller-registers.patch b/bsnes-patches/v085/0016-Fix-tracelog-of-controller-registers.patch index 99879900..9fbc4ec0 100644 --- a/bsnes-patches/v085/0016-Fix-tracelog-of-controller-registers.patch +++ b/bsnes-patches/v085/0016-Fix-tracelog-of-controller-registers.patch @@ -1,14 +1,14 @@ From 60267d1f22fd2ff3197c6c829640f66304c89283 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 16 Mar 2014 16:40:55 +0200 -Subject: [PATCH 16/26] Fix tracelog of controller registers +Subject: [PATCH 16/27] Fix tracelog of controller registers --- snes/cpu/core/disassembler/disassembler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snes/cpu/core/disassembler/disassembler.cpp b/snes/cpu/core/disassembler/disassembler.cpp -index ab8dde2..624a80c 100755 +index ab8dde24..624a80ce 100755 --- a/snes/cpu/core/disassembler/disassembler.cpp +++ b/snes/cpu/core/disassembler/disassembler.cpp @@ -1,6 +1,8 @@ @@ -21,5 +21,5 @@ index ab8dde2..624a80c 100755 //$[00-3f|80-bf]:[2000-5fff] //do not read MMIO registers within debugger -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0017-Fix-performance-problem-with-non-bus-breakpoints.patch b/bsnes-patches/v085/0017-Fix-performance-problem-with-non-bus-breakpoints.patch index c19b1f57..95051657 100644 --- a/bsnes-patches/v085/0017-Fix-performance-problem-with-non-bus-breakpoints.patch +++ b/bsnes-patches/v085/0017-Fix-performance-problem-with-non-bus-breakpoints.patch @@ -1,7 +1,7 @@ From de71f12eb59a41899a5c77d797e144e6f0919777 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 17 Mar 2014 14:22:58 +0200 -Subject: [PATCH 17/26] Fix performance problem with non-bus breakpoints +Subject: [PATCH 17/27] Fix performance problem with non-bus breakpoints --- snes/memory/memory.cpp | 35 ++++++++++++++++++++++++++--------- @@ -10,7 +10,7 @@ Subject: [PATCH 17/26] Fix performance problem with non-bus breakpoints 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/snes/memory/memory.cpp b/snes/memory/memory.cpp -index a9a484a..d22e313 100755 +index a9a484a0..d22e3137 100755 --- a/snes/memory/memory.cpp +++ b/snes/memory/memory.cpp @@ -43,6 +43,7 @@ void Bus::map( @@ -77,7 +77,7 @@ index a9a484a..d22e313 100755 Bus::Bus() { diff --git a/snes/memory/memory.hpp b/snes/memory/memory.hpp -index c20e14d..ee0c0a9 100755 +index c20e14db..ee0c0a9e 100755 --- a/snes/memory/memory.hpp +++ b/snes/memory/memory.hpp @@ -52,6 +52,7 @@ struct Bus { @@ -89,7 +89,7 @@ index c20e14d..ee0c0a9 100755 unsigned idcount; function reader[256]; diff --git a/snes/snes.hpp b/snes/snes.hpp -index 4e3ba64..9589db9 100755 +index 4e3ba64c..9589db9b 100755 --- a/snes/snes.hpp +++ b/snes/snes.hpp @@ -38,6 +38,7 @@ namespace SNES { @@ -101,5 +101,5 @@ index 4e3ba64..9589db9 100755 #include -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0018-Support-VRAM-OAM-CGRAM-and-APURAM-breakpoints.patch b/bsnes-patches/v085/0018-Support-VRAM-OAM-CGRAM-and-APURAM-breakpoints.patch index 718708e6..0685bf20 100644 --- a/bsnes-patches/v085/0018-Support-VRAM-OAM-CGRAM-and-APURAM-breakpoints.patch +++ b/bsnes-patches/v085/0018-Support-VRAM-OAM-CGRAM-and-APURAM-breakpoints.patch @@ -1,7 +1,7 @@ From 6bd069191d29ad70d38c82d59dd72cd0996fc45c Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 31 Mar 2014 20:17:46 +0300 -Subject: [PATCH 18/26] Support VRAM, OAM, CGRAM and APURAM breakpoints +Subject: [PATCH 18/27] Support VRAM, OAM, CGRAM and APURAM breakpoints --- snes/alt/ppu-compatibility/memory/memory.cpp | 44 +++++++++++++++++++++-- @@ -19,7 +19,7 @@ Subject: [PATCH 18/26] Support VRAM, OAM, CGRAM and APURAM breakpoints 12 files changed, 122 insertions(+), 45 deletions(-) diff --git a/snes/alt/ppu-compatibility/memory/memory.cpp b/snes/alt/ppu-compatibility/memory/memory.cpp -index 3f120d8..e47cf20 100755 +index 3f120d84..e47cf201 100755 --- a/snes/alt/ppu-compatibility/memory/memory.cpp +++ b/snes/alt/ppu-compatibility/memory/memory.cpp @@ -47,20 +47,31 @@ uint8 PPU::vram_mmio_read(uint16 addr) { @@ -139,7 +139,7 @@ index 3f120d8..e47cf20 100755 } } diff --git a/snes/alt/ppu-compatibility/ppu.hpp b/snes/alt/ppu-compatibility/ppu.hpp -index cccaabb..4adac4c 100755 +index cccaabba..4adac4c4 100755 --- a/snes/alt/ppu-compatibility/ppu.hpp +++ b/snes/alt/ppu-compatibility/ppu.hpp @@ -3,6 +3,12 @@ public: @@ -156,7 +156,7 @@ index cccaabb..4adac4c 100755 enum : bool { Threaded = true }; alwaysinline void step(unsigned clocks); diff --git a/snes/cartridge/cartridge.hpp b/snes/cartridge/cartridge.hpp -index 82e73c4..2358c08 100755 +index 82e73c4c..2358c088 100755 --- a/snes/cartridge/cartridge.hpp +++ b/snes/cartridge/cartridge.hpp @@ -26,6 +26,10 @@ struct Cartridge : property { @@ -171,7 +171,7 @@ index 82e73c4..2358c08 100755 enum class Slot : unsigned { diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp -index 13d6936..03f9ac6 100755 +index 13d69364..03f9ac66 100755 --- a/snes/smp/core/core.hpp +++ b/snes/smp/core/core.hpp @@ -1,6 +1,6 @@ @@ -183,7 +183,7 @@ index 13d6936..03f9ac6 100755 virtual void op_step(); diff --git a/snes/smp/core/memory.hpp b/snes/smp/core/memory.hpp -index c4b6d99..c297962 100755 +index c4b6d99f..c297962f 100755 --- a/snes/smp/core/memory.hpp +++ b/snes/smp/core/memory.hpp @@ -1,9 +1,9 @@ @@ -208,7 +208,7 @@ index c4b6d99..c297962 100755 alwaysinline void op_writedp(uint8 addr, uint8 data) { diff --git a/snes/smp/core/opcodes.cpp b/snes/smp/core/opcodes.cpp -index 95b9844..43db081 100755 +index 95b9844f..43db081d 100755 --- a/snes/smp/core/opcodes.cpp +++ b/snes/smp/core/opcodes.cpp @@ -11,7 +11,7 @@ template @@ -348,7 +348,7 @@ index 95b9844..43db081 100755 } diff --git a/snes/smp/debugger/debugger.cpp b/snes/smp/debugger/debugger.cpp -index 9546c11..894fdac 100755 +index 9546c118..894fdac9 100755 --- a/snes/smp/debugger/debugger.cpp +++ b/snes/smp/debugger/debugger.cpp @@ -18,8 +18,8 @@ void SMPDebugger::op_step() { @@ -363,7 +363,7 @@ index 9546c11..894fdac 100755 debugger.breakpoint_test(Debugger::Breakpoint::Source::APURAM, Debugger::Breakpoint::Mode::Read, addr, data); return data; diff --git a/snes/smp/debugger/debugger.hpp b/snes/smp/debugger/debugger.hpp -index d5d28e5..26bc7af 100755 +index d5d28e53..26bc7af9 100755 --- a/snes/smp/debugger/debugger.hpp +++ b/snes/smp/debugger/debugger.hpp @@ -14,7 +14,7 @@ public: @@ -376,7 +376,7 @@ index d5d28e5..26bc7af 100755 SMPDebugger(); diff --git a/snes/smp/memory/memory.cpp b/snes/smp/memory/memory.cpp -index 391324c..58c1191 100755 +index 391324c4..58c11915 100755 --- a/snes/smp/memory/memory.cpp +++ b/snes/smp/memory/memory.cpp @@ -19,61 +19,83 @@ void SMP::port_write(uint2 port, uint8 data) { @@ -490,7 +490,7 @@ index 391324c..58c1191 100755 cycle_edge(); return r; diff --git a/snes/smp/memory/memory.hpp b/snes/smp/memory/memory.hpp -index 1a07445..faa28da 100755 +index 1a07445d..faa28daa 100755 --- a/snes/smp/memory/memory.hpp +++ b/snes/smp/memory/memory.hpp @@ -1,9 +1,9 @@ @@ -506,7 +506,7 @@ index 1a07445..faa28da 100755 +debugvirtual uint8 op_read(uint16 addr, bool exec); debugvirtual void op_write(uint16 addr, uint8 data); diff --git a/snes/smp/smp.hpp b/snes/smp/smp.hpp -index 6b387cb..6b6ae83 100755 +index 6b387cba..6b6ae837 100755 --- a/snes/smp/smp.hpp +++ b/snes/smp/smp.hpp @@ -1,6 +1,10 @@ @@ -521,7 +521,7 @@ index 6b387cb..6b6ae83 100755 enum : bool { Threaded = true }; alwaysinline void step(unsigned clocks); diff --git a/snes/snes.hpp b/snes/snes.hpp -index 9589db9..27632bf 100755 +index 9589db9b..27632bff 100755 --- a/snes/snes.hpp +++ b/snes/snes.hpp @@ -1,6 +1,7 @@ @@ -533,5 +533,5 @@ index 9589db9..27632bf 100755 namespace SNES { -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0019-SA1-trace-hook-support.patch b/bsnes-patches/v085/0019-SA1-trace-hook-support.patch index 9917d13b..7045b940 100644 --- a/bsnes-patches/v085/0019-SA1-trace-hook-support.patch +++ b/bsnes-patches/v085/0019-SA1-trace-hook-support.patch @@ -1,7 +1,7 @@ From f1106d3dffd27dab526a703aa434512495fbacea Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 14 Apr 2014 21:21:36 +0300 -Subject: [PATCH 19/26] SA1 trace hook support +Subject: [PATCH 19/27] SA1 trace hook support --- snes/chip/sa1/sa1.cpp | 2 ++ @@ -10,7 +10,7 @@ Subject: [PATCH 19/26] SA1 trace hook support 3 files changed, 6 insertions(+) diff --git a/snes/chip/sa1/sa1.cpp b/snes/chip/sa1/sa1.cpp -index 30e0080..fdec362 100755 +index 30e00809..fdec362c 100755 --- a/snes/chip/sa1/sa1.cpp +++ b/snes/chip/sa1/sa1.cpp @@ -32,6 +32,8 @@ void SA1::enter() { @@ -23,7 +23,7 @@ index 30e0080..fdec362 100755 } } diff --git a/snes/chip/sa1/sa1.hpp b/snes/chip/sa1/sa1.hpp -index 732b2a8..efd3637 100755 +index 732b2a85..efd36376 100755 --- a/snes/chip/sa1/sa1.hpp +++ b/snes/chip/sa1/sa1.hpp @@ -15,6 +15,9 @@ public: @@ -37,7 +37,7 @@ index 732b2a8..efd3637 100755 void enter(); void tick(); diff --git a/snes/snes.hpp b/snes/snes.hpp -index 27632bf..3bdca7e 100755 +index 27632bff..3bdca7e5 100755 --- a/snes/snes.hpp +++ b/snes/snes.hpp @@ -3,6 +3,7 @@ @@ -49,5 +49,5 @@ index 27632bf..3bdca7e 100755 namespace SNES { namespace Info { -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0020-Fixes-to-SA1-open-bus-emulation.patch b/bsnes-patches/v085/0020-Fixes-to-SA1-open-bus-emulation.patch index 51d46c03..9ed4cf87 100644 --- a/bsnes-patches/v085/0020-Fixes-to-SA1-open-bus-emulation.patch +++ b/bsnes-patches/v085/0020-Fixes-to-SA1-open-bus-emulation.patch @@ -1,14 +1,14 @@ From cf662a12578778cb50c25d5275ce58deabd7eabe Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Wed, 30 Apr 2014 00:18:58 +0300 -Subject: [PATCH 20/26] Fixes to SA1 open bus emulation +Subject: [PATCH 20/27] Fixes to SA1 open bus emulation --- snes/chip/sa1/memory/memory.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/snes/chip/sa1/memory/memory.cpp b/snes/chip/sa1/memory/memory.cpp -index 9bb4ff2..614dfb0 100755 +index 9bb4ff20..614dfb0c 100755 --- a/snes/chip/sa1/memory/memory.cpp +++ b/snes/chip/sa1/memory/memory.cpp @@ -36,6 +36,7 @@ uint8 SA1::bus_read(unsigned addr) { @@ -74,5 +74,5 @@ index 9bb4ff2..614dfb0 100755 uint8 SA1::mmc_read(unsigned addr) { -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0021-Call-notify-latch-function-on-alternate-timings-mode.patch b/bsnes-patches/v085/0021-Call-notify-latch-function-on-alternate-timings-mode.patch index 36762868..859fa1b0 100644 --- a/bsnes-patches/v085/0021-Call-notify-latch-function-on-alternate-timings-mode.patch +++ b/bsnes-patches/v085/0021-Call-notify-latch-function-on-alternate-timings-mode.patch @@ -1,7 +1,7 @@ From 63fc77b07d517c2f9a0fd6ca3fa94f30fb0f5ec2 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 15 Jun 2014 22:01:26 +0300 -Subject: [PATCH 21/26] Call notify latch function on alternate timings mode +Subject: [PATCH 21/27] Call notify latch function on alternate timings mode too --- @@ -9,7 +9,7 @@ Subject: [PATCH 21/26] Call notify latch function on alternate timings mode 1 file changed, 1 insertion(+) diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp -index ae8e94f..3fd4d23 100755 +index ae8e94f8..3fd4d23e 100755 --- a/snes/cpu/timing/joypad.cpp +++ b/snes/cpu/timing/joypad.cpp @@ -41,6 +41,7 @@ void CPU::step_auto_joypad_poll_NEW(bool polarity) { @@ -21,5 +21,5 @@ index ae8e94f..3fd4d23 100755 input.port2->latch(1); } -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0022-Support-DMA-tracing.patch b/bsnes-patches/v085/0022-Support-DMA-tracing.patch index 818055fa..59b7c8f9 100644 --- a/bsnes-patches/v085/0022-Support-DMA-tracing.patch +++ b/bsnes-patches/v085/0022-Support-DMA-tracing.patch @@ -1,7 +1,7 @@ From 5bc96b8aeea26729ef4399c2d8d5e562894616e1 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Tue, 20 Jan 2015 10:04:58 +0200 -Subject: [PATCH 22/26] Support DMA tracing +Subject: [PATCH 22/27] Support DMA tracing --- snes/alt/ppu-compatibility/mmio/mmio.cpp | 18 +++++++ @@ -18,7 +18,7 @@ Subject: [PATCH 22/26] Support DMA tracing 11 files changed, 137 insertions(+) diff --git a/snes/alt/ppu-compatibility/mmio/mmio.cpp b/snes/alt/ppu-compatibility/mmio/mmio.cpp -index aedb67c..0a269cc 100755 +index aedb67c1..0a269cc0 100755 --- a/snes/alt/ppu-compatibility/mmio/mmio.cpp +++ b/snes/alt/ppu-compatibility/mmio/mmio.cpp @@ -1,5 +1,23 @@ @@ -46,7 +46,7 @@ index aedb67c..0a269cc 100755 void PPU::mmio_w2100(uint8 value) { if(regs.display_disabled == true && cpu.vcounter() == (!overscan() ? 225 : 240)) { diff --git a/snes/alt/ppu-compatibility/ppu.cpp b/snes/alt/ppu-compatibility/ppu.cpp -index 122b143..ac886ed 100755 +index 122b1430..ac886edc 100755 --- a/snes/alt/ppu-compatibility/ppu.cpp +++ b/snes/alt/ppu-compatibility/ppu.cpp @@ -1,4 +1,5 @@ @@ -56,7 +56,7 @@ index 122b143..ac886ed 100755 #define PPU_CPP namespace SNES { diff --git a/snes/alt/ppu-compatibility/ppu.hpp b/snes/alt/ppu-compatibility/ppu.hpp -index 4adac4c..b0eabf7 100755 +index 4adac4c4..b0eabf7c 100755 --- a/snes/alt/ppu-compatibility/ppu.hpp +++ b/snes/alt/ppu-compatibility/ppu.hpp @@ -14,6 +14,10 @@ public: @@ -71,7 +71,7 @@ index 4adac4c..b0eabf7 100755 #include "mmio/mmio.hpp" #include "render/render.hpp" diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp -index 39da6b1..ce112af 100755 +index 39da6b16..ce112afa 100755 --- a/snes/cpu/cpu.cpp +++ b/snes/cpu/cpu.cpp @@ -1,4 +1,5 @@ @@ -81,7 +81,7 @@ index 39da6b1..ce112af 100755 #define CPU_CPP namespace SNES { diff --git a/snes/cpu/cpu.hpp b/snes/cpu/cpu.hpp -index 4944577..fd665b1 100755 +index 49445773..fd665b1f 100755 --- a/snes/cpu/cpu.hpp +++ b/snes/cpu/cpu.hpp @@ -26,6 +26,7 @@ struct CPU : public Processor, public CPUcore, public PPUcounter { @@ -93,7 +93,7 @@ index 4944577..fd665b1 100755 #include "dma/dma.hpp" #include "memory/memory.hpp" diff --git a/snes/cpu/dma/dma.cpp b/snes/cpu/dma/dma.cpp -index 0a00bfe..8f7be26 100755 +index 0a00bfea..8f7be263 100755 --- a/snes/cpu/dma/dma.cpp +++ b/snes/cpu/dma/dma.cpp @@ -144,6 +144,7 @@ void CPU::dma_run() { @@ -207,7 +207,7 @@ index 0a00bfe..8f7be26 100755 + #endif diff --git a/snes/cpu/dma/dma.hpp b/snes/cpu/dma/dma.hpp -index 33755bd..8740bb3 100755 +index 33755bde..8740bb3a 100755 --- a/snes/cpu/dma/dma.hpp +++ b/snes/cpu/dma/dma.hpp @@ -77,3 +77,8 @@ void hdma_init(); @@ -220,7 +220,7 @@ index 33755bd..8740bb3 100755 +void dma_trace_end(unsigned i); +void dma_trace_hdma(unsigned i); diff --git a/snes/ppu/mmio/mmio.cpp b/snes/ppu/mmio/mmio.cpp -index 302f74f..4a4fb9c 100755 +index 302f74f8..4a4fb9ce 100755 --- a/snes/ppu/mmio/mmio.cpp +++ b/snes/ppu/mmio/mmio.cpp @@ -1,5 +1,23 @@ @@ -248,7 +248,7 @@ index 302f74f..4a4fb9c 100755 return display.interlace; } diff --git a/snes/ppu/ppu.cpp b/snes/ppu/ppu.cpp -index 13e231c..5874209 100755 +index 13e231cf..58742098 100755 --- a/snes/ppu/ppu.cpp +++ b/snes/ppu/ppu.cpp @@ -1,4 +1,5 @@ @@ -258,7 +258,7 @@ index 13e231c..5874209 100755 #define PPU_CPP namespace SNES { diff --git a/snes/ppu/ppu.hpp b/snes/ppu/ppu.hpp -index fdba113..0addb77 100755 +index fdba113c..0addb775 100755 --- a/snes/ppu/ppu.hpp +++ b/snes/ppu/ppu.hpp @@ -21,6 +21,9 @@ struct PPU : public Processor, public PPUcounter { @@ -272,7 +272,7 @@ index fdba113..0addb77 100755 uint32 *surface; uint32 *output; diff --git a/snes/snes.hpp b/snes/snes.hpp -index 3bdca7e..7c48ebb 100755 +index 3bdca7e5..7c48ebb3 100755 --- a/snes/snes.hpp +++ b/snes/snes.hpp @@ -4,6 +4,7 @@ @@ -284,5 +284,5 @@ index 3bdca7e..7c48ebb 100755 namespace SNES { namespace Info { -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0023-Add-autopoller-and-IRQ-NMI-tracing.patch b/bsnes-patches/v085/0023-Add-autopoller-and-IRQ-NMI-tracing.patch index 0b908f3c..39b4386f 100644 --- a/bsnes-patches/v085/0023-Add-autopoller-and-IRQ-NMI-tracing.patch +++ b/bsnes-patches/v085/0023-Add-autopoller-and-IRQ-NMI-tracing.patch @@ -1,7 +1,7 @@ From 9682df9e33c366dfe047a99c8bcefc2c8ab29620 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sat, 24 Jan 2015 16:46:18 +0200 -Subject: [PATCH 23/26] Add autopoller and IRQ/NMI tracing +Subject: [PATCH 23/27] Add autopoller and IRQ/NMI tracing --- snes/cpu/cpu.cpp | 3 +++ @@ -9,7 +9,7 @@ Subject: [PATCH 23/26] Add autopoller and IRQ/NMI tracing 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp -index ce112af..e11fc88 100755 +index ce112afa..e11fc882 100755 --- a/snes/cpu/cpu.cpp +++ b/snes/cpu/cpu.cpp @@ -69,14 +69,17 @@ void CPU::enter() { @@ -31,7 +31,7 @@ index ce112af..e11fc88 100755 add_clocks(186); regs.pc.l = bus.read(0xfffc, false); diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp -index 3fd4d23..afca750 100755 +index 3fd4d23e..afca7504 100755 --- a/snes/cpu/timing/joypad.cpp +++ b/snes/cpu/timing/joypad.cpp @@ -6,9 +6,9 @@ void CPU::step_auto_joypad_poll() { @@ -82,5 +82,5 @@ index 3fd4d23..afca750 100755 status.auto_joypad_counter++; } -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0024-Build-fixes-for-GCC-5.X.patch b/bsnes-patches/v085/0024-Build-fixes-for-GCC-5.X.patch index 4c09a41b..8f2d046b 100644 --- a/bsnes-patches/v085/0024-Build-fixes-for-GCC-5.X.patch +++ b/bsnes-patches/v085/0024-Build-fixes-for-GCC-5.X.patch @@ -1,14 +1,14 @@ From f2bbef8a4e12e05190a68dfe410cff3e4b1eb13f Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sat, 8 Aug 2015 11:09:41 +0300 -Subject: [PATCH 24/26] Build fixes for GCC 5.X +Subject: [PATCH 24/27] Build fixes for GCC 5.X --- nall/bit.hpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/nall/bit.hpp b/nall/bit.hpp -index 67a35ad..11d9d8d 100755 +index 67a35ad6..11d9d8de 100755 --- a/nall/bit.hpp +++ b/nall/bit.hpp @@ -8,18 +8,27 @@ namespace nall { @@ -46,5 +46,5 @@ index 67a35ad..11d9d8d 100755 namespace bit { -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0025-Fix-MSU-1-bug-where-write-to-MSU1BASE-4-is-mirred-to.patch b/bsnes-patches/v085/0025-Fix-MSU-1-bug-where-write-to-MSU1BASE-4-is-mirred-to.patch index 63816e1c..3be045d8 100644 --- a/bsnes-patches/v085/0025-Fix-MSU-1-bug-where-write-to-MSU1BASE-4-is-mirred-to.patch +++ b/bsnes-patches/v085/0025-Fix-MSU-1-bug-where-write-to-MSU1BASE-4-is-mirred-to.patch @@ -1,7 +1,7 @@ From d39571de650d49636778a73c66414aff372c08af Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 7 Sep 2015 20:48:14 +0300 -Subject: [PATCH 25/26] Fix MSU-1 bug where write to MSU1BASE+4 is mirred to +Subject: [PATCH 25/27] Fix MSU-1 bug where write to MSU1BASE+4 is mirred to MSUBASE+5 --- @@ -9,7 +9,7 @@ Subject: [PATCH 25/26] Fix MSU-1 bug where write to MSU1BASE+4 is mirred to 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snes/chip/msu1/msu1.cpp b/snes/chip/msu1/msu1.cpp -index 71700e6..ec1cf46 100755 +index 71700e60..ec1cf46a 100755 --- a/snes/chip/msu1/msu1.cpp +++ b/snes/chip/msu1/msu1.cpp @@ -107,7 +107,7 @@ void MSU1::mmio_write(unsigned addr, uint8 data) { @@ -22,5 +22,5 @@ index 71700e6..ec1cf46 100755 if(audiofile.open()) audiofile.close(); if(audiofile.open(interface->path(Cartridge::Slot::Base, { "-", (unsigned)mmio.audio_track, ".pcm" }), file::mode::read)) { -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0026-Add-vector-to-avoid-compile-error-due-to-missing-std.patch b/bsnes-patches/v085/0026-Add-vector-to-avoid-compile-error-due-to-missing-std.patch index f6ed93d6..5df086b2 100644 --- a/bsnes-patches/v085/0026-Add-vector-to-avoid-compile-error-due-to-missing-std.patch +++ b/bsnes-patches/v085/0026-Add-vector-to-avoid-compile-error-due-to-missing-std.patch @@ -1,7 +1,7 @@ From c0a2270cfd5f56e8a311b36011e1f15fac6c54ca Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Tue, 9 Aug 2016 18:54:57 +0300 -Subject: [PATCH 26/26] Add to avoid compile error due to missing +Subject: [PATCH 26/27] Add to avoid compile error due to missing std::vector --- @@ -9,7 +9,7 @@ Subject: [PATCH 26/26] Add to avoid compile error due to missing 1 file changed, 1 insertion(+) diff --git a/snes/snes.hpp b/snes/snes.hpp -index 7c48ebb..3a65e36 100755 +index 7c48ebb3..3a65e360 100755 --- a/snes/snes.hpp +++ b/snes/snes.hpp @@ -22,6 +22,7 @@ namespace SNES { @@ -21,5 +21,5 @@ index 7c48ebb..3a65e36 100755 #include #include -- -2.8.1 +2.15.0.rc1 diff --git a/bsnes-patches/v085/0027-Bus-fixes-Do-not-update-MDR-on-read-from-CPU-MMIO-sp.patch b/bsnes-patches/v085/0027-Bus-fixes-Do-not-update-MDR-on-read-from-CPU-MMIO-sp.patch new file mode 100644 index 00000000..3f5dca61 --- /dev/null +++ b/bsnes-patches/v085/0027-Bus-fixes-Do-not-update-MDR-on-read-from-CPU-MMIO-sp.patch @@ -0,0 +1,377 @@ +From 4cfbbeadc3abe3e3911f7f59ce57b715edc76563 Mon Sep 17 00:00:00 2001 +From: Ilari Liusvaara +Date: Wed, 25 Oct 2017 14:18:34 +0300 +Subject: [PATCH 27/27] Bus fixes: Do not update MDR on read from CPU MMIO + space + +Also, updates the controller read timings to be more accurate. +--- + snes/config/config.cpp | 1 + + snes/config/config.hpp | 1 + + snes/cpu/cpu.cpp | 2 + + snes/cpu/memory/memory.cpp | 26 ++++++++- + snes/cpu/mmio/mmio.cpp | 14 +++-- + snes/cpu/timing/joypad.cpp | 132 +++++++++++++++++++++++++++++++++++++++------ + snes/cpu/timing/timing.cpp | 11 ++-- + snes/cpu/timing/timing.hpp | 3 +- + snes/snes.hpp | 1 + + 9 files changed, 166 insertions(+), 25 deletions(-) + +diff --git a/snes/config/config.cpp b/snes/config/config.cpp +index 19831370..8dcfd7e8 100755 +--- a/snes/config/config.cpp ++++ b/snes/config/config.cpp +@@ -15,6 +15,7 @@ Configuration::Configuration() { + cpu.pal_frequency = 21281370; + cpu.wram_init_value = 0x55; + cpu.alt_poll_timings = false; ++ cpu.bus_fixes = false; + + smp.ntsc_frequency = 24607104; //32040.5 * 768 + smp.pal_frequency = 24607104; +diff --git a/snes/config/config.hpp b/snes/config/config.hpp +index 68fe0bde..d8577e39 100755 +--- a/snes/config/config.hpp ++++ b/snes/config/config.hpp +@@ -14,6 +14,7 @@ struct Configuration { + unsigned pal_frequency; + unsigned wram_init_value; + bool alt_poll_timings; ++ bool bus_fixes; + } cpu; + + struct SMP { +diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp +index e11fc882..5e8e3137 100755 +--- a/snes/cpu/cpu.cpp ++++ b/snes/cpu/cpu.cpp +@@ -1,5 +1,7 @@ + #include + #include ++#include ++#include + + #define CPU_CPP + namespace SNES { +diff --git a/snes/cpu/memory/memory.cpp b/snes/cpu/memory/memory.cpp +index 31f82c31..df439c22 100755 +--- a/snes/cpu/memory/memory.cpp ++++ b/snes/cpu/memory/memory.cpp +@@ -14,10 +14,32 @@ uint8 CPU::op_read(uint32 addr, bool exec) { + status.clock_count = speed(addr); + dma_edge(); + add_clocks(status.clock_count - 4); +- regs.mdr = bus.read(addr, exec); ++ //MDR presents the state held by parasitic capacitance of the external bus. ++ //This bus is not affected by reads from CPU-internal registers, only if ++ //some external device responds. SDD1 does hook some of these addresses, but ++ //passes read straight through, as expected (as the CPU probably won't ++ //monitor if external device responds, even if it broadcasts a read). ++ // ++ //We use 4000-43FF as CPU register range, and not 4000-437F it likely is ++ //for quickness of checking. This will only affect things if some device ++ //tries to map the 4380-43FF range (that device will still work correctly, ++ //but openbus in that range won't). ++ // ++ //This was discovered while investigating why one Super Metroid glitch ++ //worked on emulator but crashed on real console. ++ // ++ //a word fetch from 2f4017 AND 0xfffc results in 2f3c and a word fetch from ++ //2f4210 AND 0x7f7f results in 2f22. This also extends to long fetches ++ //by arguments. E.g. long argument fetch from 94420F with 2F already on ++ //the bus AND 0x7f7fff results in 2f222f. ++ // ++ //The reason for masking some bits in above explanation was to ignore some ++ //known bits in those registers (bits 7 of 4210 and 4211, bits 0&1 of 4017). ++ uint8_t tmp = bus.read(addr, exec); ++ if(!config.cpu.bus_fixes || (addr & 0x40FC00) != 0x004000) regs.mdr = tmp; + add_clocks(4); + alu_edge(); +- return regs.mdr; ++ return tmp; + } + + void CPU::op_write(uint32 addr, uint8 data) { +diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp +index 30048c19..be2990a3 100755 +--- a/snes/cpu/mmio/mmio.cpp ++++ b/snes/cpu/mmio/mmio.cpp +@@ -33,9 +33,17 @@ void CPU::mmio_w2183(uint8 data) { + //strobing $4016.d0 affects both controller port latches. + //$4017 bit 0 writes are ignored. + void CPU::mmio_w4016(uint8 data) { +- if(data&1) interface->notifyLatched(); +- input.port1->latch(data & 1); +- input.port2->latch(data & 1); ++ //Only consider autoassert if both busfix and auto flags are set. ++ auto auto_asserted = (status.auto_joypad_counter & 384) == 384; ++ //Bit 6 of status.auto_joypad_counter follows "manual" latch. ++ auto oldstatus = auto_asserted || (status.auto_joypad_counter & 64) != 0; ++ status.auto_joypad_counter &= ~64; ++ status.auto_joypad_counter |= (data & 1) << 6; ++ auto newstatus = auto_asserted || (status.auto_joypad_counter & 64) != 0; ++ //If !oldstatus and newstatus, signal latch. ++ if(!oldstatus && newstatus) interface->notifyLatched(); ++ input.port1->latch(newstatus); ++ input.port2->latch(newstatus); + } + + //JOYSER0 +diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp +index afca7504..b60be020 100755 +--- a/snes/cpu/timing/joypad.cpp ++++ b/snes/cpu/timing/joypad.cpp +@@ -3,11 +3,14 @@ + //called every 256 clocks; see CPU::add_clocks() + void CPU::step_auto_joypad_poll() { + if(vcounter() >= (ppu.overscan() == false ? 225 : 240)) { ++ auto cycle = status.auto_joypad_counter & 63; + //cache enable state at first iteration +- if(status.auto_joypad_counter == 0) status.auto_joypad_latch = status.auto_joypad_poll; +- status.auto_joypad_active = status.auto_joypad_counter <= 15; ++ if(cycle == 0) status.auto_joypad_latch = status.auto_joypad_poll; ++ status.auto_joypad_active = cycle <= 15; + if(status.auto_joypad_active && status.auto_joypad_latch) { +- if(status.auto_joypad_counter == 0) { ++ if(cycle == 0) { ++ if(status.auto_joypad_counter & 128) ++ std::cerr << "step_auto_joypad_poll(): bus fixes set (counter=" << status.auto_joypad_counter << ")???" << std::endl; + if(dma_trace_fn) dma_trace_fn("-- Start automatic polling --"); + interface->notifyLatched(); + input.port1->latch(1); +@@ -23,7 +26,7 @@ void CPU::step_auto_joypad_poll() { + status.joy2 = (status.joy2 << 1) | (bool)(port1 & 1); + status.joy3 = (status.joy3 << 1) | (bool)(port0 & 2); + status.joy4 = (status.joy4 << 1) | (bool)(port1 & 2); +- if(status.auto_joypad_counter == 15) { ++ if(cycle == 15) { + char buf[512]; + sprintf(buf, "-- End automatic polling [%04x %04x %04x %04x] --", + status.joy1, status.joy2, status.joy3, status.joy4); +@@ -31,32 +34,129 @@ void CPU::step_auto_joypad_poll() { + } + } + +- status.auto_joypad_counter++; ++ //Only bits 0-5 are supposed to increment. ++ if(cycle < 60) ++ status.auto_joypad_counter++; + } + } + + //called every 128 clocks; see CPU::add_clocks() +-void CPU::step_auto_joypad_poll_NEW(bool polarity) { +- if(status.auto_joypad_counter > 0 && status.auto_joypad_counter <= 34) { ++void CPU::step_auto_joypad_poll_NEW2(bool polarity) { ++ //Poll starts on multiple of 128 mod 256 clocks (polarity=false) on first ++ //vblank scanline. If autopoller is off, mark as done for the frame. ++ if(vcounter() >= (ppu.overscan() == false ? 225 : 240) && !polarity && ++ (status.auto_joypad_counter & 63) == 0) { ++ if(!(status.auto_joypad_counter & 128)) ++ std::cerr << "step_auto_joypad_poll_NEW2(): bus fixes clear???" << std::endl; ++ //Preserve high bits of autopoll counter. ++ auto x = status.auto_joypad_counter & ~63; ++ status.auto_joypad_counter = x | (status.auto_joypad_poll ? 1 : 36); ++ status.auto_joypad_latch = status.auto_joypad_poll; ++ } ++ //Abuse bit 6 of counter for "manual" poll flag. Bit 7 is supposed to be ++ //always set. ++ auto cycle = status.auto_joypad_counter & 63; ++ auto old_latchstate = (status.auto_joypad_counter & 320) != 0; ++ //If not enabled... This is not latched, as autopoll can be aborted. ++ if(!status.auto_joypad_poll && cycle > 0 && cycle < 36) { ++ if(dma_trace_fn) dma_trace_fn("-- Automatic polling ABORTED --"); ++ status.auto_joypad_counter += (36 - cycle); ++ status.auto_joypad_active = false; ++ status.auto_joypad_latch = false; ++ //Release autopoll latch. ++ status.auto_joypad_counter &= ~256; //Autopoll clears latch. ++ auto new_latchstate = (status.auto_joypad_counter & 320) != 0; ++ if(old_latchstate && !new_latchstate) { ++ input.port1->latch(0); ++ input.port2->latch(0); ++ } ++ return; ++ } ++ //On cycle #1, latch is asserted (unless latch is already high, in this ++ //case the autopoller is supposed to force latch high too). ++ if(cycle == 1) { ++ if(dma_trace_fn) dma_trace_fn("-- Start automatic polling --"); ++ //Assert autopoll latch. ++ status.auto_joypad_counter |= 256; ++ auto new_latchstate = (status.auto_joypad_counter & 320) != 0; ++ if(!old_latchstate && new_latchstate) { ++ interface->notifyLatched(); ++ input.port1->latch(1); ++ input.port2->latch(1); ++ } ++ } ++ //On cycle #2, busy is asserted and controllers are cleared. ++ if(cycle == 2) { ++ status.joy1 = 0; ++ status.joy2 = 0; ++ status.joy3 = 0; ++ status.joy4 = 0; ++ status.auto_joypad_active = true; ++ } ++ //Then, on cycle #3, latch is deasserted, unless "manual" latch forces ++ //real latch high. ++ if(cycle == 3) { ++ //Release autopoll latch. ++ status.auto_joypad_counter &= ~256; ++ auto new_latchstate = (status.auto_joypad_counter & 320) != 0; ++ if(old_latchstate && !new_latchstate) { ++ input.port1->latch(0); ++ input.port2->latch(0); ++ } ++ } ++ //Then on cycles #4, #6, #8, ..., #34, a bit is shifted. Also, clock would ++ //go low, but we can not emulate that. ++ if(cycle >= 4 && cycle <= 34 && cycle % 2 == 0) { ++ uint2 port0 = input.port1->data(); ++ uint2 port1 = input.port2->data(); ++ status.joy1 = (status.joy1 << 1) | (bool)(port0 & 1); ++ status.joy2 = (status.joy2 << 1) | (bool)(port1 & 1); ++ status.joy3 = (status.joy3 << 1) | (bool)(port0 & 2); ++ status.joy4 = (status.joy4 << 1) | (bool)(port1 & 2); ++ } ++ //Then on cycles #5, #7, #9, ..., #35, clock drops high, But we can not ++ //emulate that. ++ //Then on cycle #35, busy flag is deasserted and poll is complete. ++ if(cycle == 35) { ++ status.auto_joypad_active = false; ++ char buf[512]; ++ sprintf(buf, "-- End automatic polling [%04x %04x %04x %04x] --", ++ status.joy1, status.joy2, status.joy3, status.joy4); ++ if(dma_trace_fn) dma_trace_fn(buf); ++ } ++ //The entiere train is 35 cycles. ++ if(cycle > 0 && cycle < 36) { ++ status.auto_joypad_counter++; ++ } ++} ++ ++ ++//called every 128 clocks; see CPU::add_clocks() ++void CPU::step_auto_joypad_poll_NEW(bool polarity, bool new2) { ++ if(new2) return step_auto_joypad_poll_NEW2(polarity); ++ auto cycle = status.auto_joypad_counter & 63; ++ if(cycle > 0 && cycle <= 34) { + if(!status.auto_joypad_latch) { + //FIXME: Is this right, busy flag goes on even if not enabled??? +- if(status.auto_joypad_counter == 1) ++ if(cycle == 1) + status.auto_joypad_active = true; +- if(status.auto_joypad_counter == 34) ++ if(cycle == 34) + status.auto_joypad_active = false; + } else { +- if(status.auto_joypad_counter == 1) { ++ if(cycle == 1) { ++ if(status.auto_joypad_counter & 128) ++ std::cerr << "step_auto_joypad_poll_NEW(): bus fixes set???" << std::endl; + if(dma_trace_fn) dma_trace_fn("-- Start automatic polling --"); + status.auto_joypad_active = true; + interface->notifyLatched(); + input.port1->latch(1); + input.port2->latch(1); + } +- if(status.auto_joypad_counter == 3) { ++ if(cycle == 3) { + input.port1->latch(0); + input.port2->latch(0); + } +- if((status.auto_joypad_counter & 1) != 0 && status.auto_joypad_counter != 1) { ++ if((cycle & 1) != 0 && cycle != 1) { + uint2 port0 = input.port1->data(); + uint2 port1 = input.port2->data(); + +@@ -65,7 +165,7 @@ void CPU::step_auto_joypad_poll_NEW(bool polarity) { + status.joy3 = (status.joy3 << 1) | (bool)(port0 & 2); + status.joy4 = (status.joy4 << 1) | (bool)(port1 & 2); + } +- if(status.auto_joypad_counter == 34) { ++ if(cycle == 34) { + status.auto_joypad_active = false; + char buf[512]; + sprintf(buf, "-- End automatic polling [%04x %04x %04x %04x] --", +@@ -75,9 +175,11 @@ void CPU::step_auto_joypad_poll_NEW(bool polarity) { + } + status.auto_joypad_counter++; + } +- if(vcounter() >= (ppu.overscan() == false ? 225 : 240) && status.auto_joypad_counter == 0 && !polarity) { ++ if(vcounter() >= (ppu.overscan() == false ? 225 : 240) && cycle == 0 && !polarity) { ++ //Preserve high bits of autopoller counter. ++ auto x = status.auto_joypad_counter & ~63; + status.auto_joypad_latch = status.auto_joypad_poll; +- status.auto_joypad_counter = 1; ++ status.auto_joypad_counter = x | 1; + } + } + +diff --git a/snes/cpu/timing/timing.cpp b/snes/cpu/timing/timing.cpp +index d7cf24f3..ef81d891 100755 +--- a/snes/cpu/timing/timing.cpp ++++ b/snes/cpu/timing/timing.cpp +@@ -17,12 +17,12 @@ void CPU::add_clocks(unsigned clocks) { + + step(clocks); + +- if(config.cpu.alt_poll_timings) { ++ if(config.cpu.alt_poll_timings || config.cpu.bus_fixes) { + bool opolarity = (status.auto_joypad_clock & 128); + status.auto_joypad_clock = (status.auto_joypad_clock + clocks) & 0xFF; + bool npolarity = (status.auto_joypad_clock & 128); + if(opolarity != npolarity) +- step_auto_joypad_poll_NEW(opolarity); ++ step_auto_joypad_poll_NEW(opolarity, config.cpu.bus_fixes); + } else { + status.auto_joypad_clock += clocks; + if(status.auto_joypad_clock >= 256) { +@@ -53,7 +53,8 @@ void CPU::scanline() { + status.hdma_init_position = (cpu_version == 1 ? 12 + 8 - dma_counter() : 12 + dma_counter()); + status.hdma_init_triggered = false; + +- status.auto_joypad_counter = 0; ++ //Only clear the low 6 bits (counter). ++ status.auto_joypad_counter &= ~63; + } + + //DRAM refresh occurs once every scanline +@@ -200,7 +201,9 @@ void CPU::timing_reset() { + + status.auto_joypad_active = false; + status.auto_joypad_latch = false; +- status.auto_joypad_counter = 0; ++ //Set bit 7 of joypad counter if bus fixes are active (for combined ++ //latch behavior). ++ status.auto_joypad_counter = config.cpu.bus_fixes ? 128 : 0; + status.auto_joypad_clock = 0; + } + +diff --git a/snes/cpu/timing/timing.hpp b/snes/cpu/timing/timing.hpp +index bf15a727..8be2b830 100755 +--- a/snes/cpu/timing/timing.hpp ++++ b/snes/cpu/timing/timing.hpp +@@ -22,4 +22,5 @@ alwaysinline bool irq_test(); + + //joypad.cpp + void step_auto_joypad_poll(); +-void step_auto_joypad_poll_NEW(bool polarity); ++void step_auto_joypad_poll_NEW(bool polarity, bool new2); ++void step_auto_joypad_poll_NEW2(bool polarity); +diff --git a/snes/snes.hpp b/snes/snes.hpp +index 3a65e360..961842b3 100755 +--- a/snes/snes.hpp ++++ b/snes/snes.hpp +@@ -3,6 +3,7 @@ + #define BSNES_SUPPORTS_ADV_BREAKPOINTS + #define BSNES_SUPPORTS_ADV_BREAKPOINTS_PPU + #define BSNES_SUPPORTS_ALT_TIMINGS ++#define BSNES_SUPPORTS_BUS_FIXES + #define BSNES_SUPPORTS_TRACE_SA1 + #define BSNES_SUPPORTS_DMA_TRACE + +-- +2.15.0.rc1 + diff --git a/src/emulation/bsnes-legacy/core.cpp b/src/emulation/bsnes-legacy/core.cpp index 2e56a879..d93ee608 100644 --- a/src/emulation/bsnes-legacy/core.cpp +++ b/src/emulation/bsnes-legacy/core.cpp @@ -561,6 +561,9 @@ namespace #ifdef BSNES_SUPPORTS_ALT_TIMINGS {"alttimings", "Alternate poll timings", "0", boolean_values}, #endif +#ifdef BSNES_SUPPORTS_BUS_FIXES + {"busfixes", "System bus fixes", "0", boolean_values}, +#endif #ifdef BSNES_SUPPORTS_MOUSE_SPEED_FIX {"mousespeed", "Support mouse speeds", "0", boolean_values}, #endif @@ -640,6 +643,9 @@ namespace #ifdef BSNES_SUPPORTS_ALT_TIMINGS signed ialttimings = bsnes_settings.ivalue_to_index(_settings, "alttimings"); #endif +#ifdef BSNES_SUPPORTS_BUS_FIXES + signed ibusfixes = bsnes_settings.ivalue_to_index(_settings, "busfixes"); +#endif #ifdef BSNES_SUPPORTS_MOUSE_SPEED_FIX signed ispeedfix = bsnes_settings.ivalue_to_index(_settings, "mousespeed"); #endif @@ -655,6 +661,9 @@ namespace #ifdef BSNES_SUPPORTS_ALT_TIMINGS SNES::config.cpu.alt_poll_timings = (ialttimings != 0); #endif +#ifdef BSNES_SUPPORTS_BUS_FIXES + SNES::config.cpu.bus_fixes = (ibusfixes != 0); +#endif #ifdef BSNES_SUPPORTS_MOUSE_SPEED_FIX SNES::config.mouse_speed_fix = (ispeedfix != 0); #endif @@ -1743,6 +1752,13 @@ again2: y += 16; } #endif +#ifdef BSNES_SUPPORTS_BUS_FIXES + if(SNES::config.cpu.bus_fixes) { + cover_render_string(cover_fbmem, 0, y, "Bus fixes enabled.", 0x7FFFF, 0x00000, + 512, 448, 2048, 4); + y += 16; + } +#endif #ifdef BSNES_SUPPORTS_MOUSE_SPEED_FIX if(SNES::config.mouse_speed_fix) { cover_render_string(cover_fbmem, 0, y, "Mouse speed support enabled.", 0x7FFFF, 0x00000, -- 2.11.4.GIT