Compare commits

..

No commits in common. "master" and "lsnes-rr2-beta23" have entirely different histories.

157 changed files with 518 additions and 2525 deletions

2
bsnes

@ -1 +1 @@
Subproject commit 4cfbbeadc3abe3e3911f7f59ce57b715edc76563
Subproject commit 9682df9e33c366dfe047a99c8bcefc2c8ab29620

View file

@ -1,7 +1,7 @@
From b19b3b2d1d7a522af695f4482abb28e52804326b 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 01/27] Make libsnes compile
Subject: [PATCH 01/23] 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 fbb4482c..5f5ded69 100755
index fbb4482..5f5ded6 100755
--- a/ui-libsnes/libsnes.cpp
+++ b/ui-libsnes/libsnes.cpp
@@ -1,5 +1,6 @@
@ -78,5 +78,5 @@ index fbb4482c..5f5ded69 100755
}
SNES::cartridge.load(SNES::Cartridge::Mode::SuperGameBoy, xmlrom);
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From bb2fed04fbfe62a89e4bcfe90f44b4738f7c7c1a 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 02/27] Fix bsnes version number in libsnes to be v085, not
Subject: [PATCH 02/23] Fix bsnes version number in libsnes to be v085, not
v083
---
@ -9,7 +9,7 @@ Subject: [PATCH 02/27] 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 5f5ded69..0e63075e 100755
index 5f5ded6..0e63075 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 5f5ded69..0e63075e 100755
unsigned snes_library_revision_major(void) {
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 7379b4570e5755a5a1da25181ba4f5d1ca461a98 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 03/27] Don't use time() in emulating chips
Subject: [PATCH 03/23] 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 386fb628..3c980195 100755
index 386fb62..3c98019 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 386fb628..3c980195 100755
regs.r2192_hour = t->tm_hour;
diff --git a/snes/chip/spc7110/spc7110.cpp b/snes/chip/spc7110/spc7110.cpp
index d2dc640b..74a817a6 100755
index d2dc640..74a817a 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 d2dc640b..74a817a6 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 1b2fd2aa..78fc4c1f 100755
index 1b2fd2a..78fc4c1 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 1b2fd2aa..78fc4c1f 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 a0e3a81b..b3017c90 100755
index a0e3a81..b3017c9 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 a0e3a81b..b3017c90 100755
+
}
diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp
index f1a48c0f..df975e83 100755
index f1a48c0..df975e8 100755
--- a/snes/interface/interface.hpp
+++ b/snes/interface/interface.hpp
@@ -5,6 +5,7 @@ struct Interface {
@ -80,5 +80,5 @@ index f1a48c0f..df975e83 100755
extern Interface *interface;
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From efe1b5884c316ce070953edd87c6c9aeffffaa94 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 04/27] Save controller state when savestating
Subject: [PATCH 04/23] 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 9091b21b..f254bedb 100755
index 9091b21..f254bed 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 9091b21b..f254bedb 100755
+
}
diff --git a/snes/controller/controller.hpp b/snes/controller/controller.hpp
index 73327129..827b2eb4 100755
index 7332712..827b2eb 100755
--- a/snes/controller/controller.hpp
+++ b/snes/controller/controller.hpp
@@ -13,12 +13,14 @@
@ -64,7 +64,7 @@ index 73327129..827b2eb4 100755
bool iobit();
void iobit(bool data);
diff --git a/snes/controller/gamepad/gamepad.cpp b/snes/controller/gamepad/gamepad.cpp
index 594020d2..4fa1c99e 100755
index 594020d..4fa1c99 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 594020d2..4fa1c99e 100755
latched = 0;
counter = 0;
diff --git a/snes/controller/gamepad/gamepad.hpp b/snes/controller/gamepad/gamepad.hpp
index c5ca69ca..a2392d1e 100755
index c5ca69c..a2392d1 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 c5ca69ca..a2392d1e 100755
bool latched;
unsigned counter;
diff --git a/snes/controller/justifier/justifier.cpp b/snes/controller/justifier/justifier.cpp
index 62079166..ad13a9bd 100755
index 6207916..ad13a9b 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 62079166..ad13a9bd 100755
create(Controller::Enter, 21477272);
latched = 0;
diff --git a/snes/controller/justifier/justifier.hpp b/snes/controller/justifier/justifier.hpp
index f927acf6..6b7bba07 100755
index f927acf..6b7bba0 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 f927acf6..6b7bba07 100755
//private:
diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp
index c9f5d16b..6b26fae5 100755
index c9f5d16..6b26fae 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 c9f5d16b..6b26fae5 100755
latched = 0;
counter = 0;
diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp
index 95e24b65..b66ea513 100755
index 95e24b6..b66ea51 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 95e24b65..b66ea513 100755
bool latched;
unsigned counter;
diff --git a/snes/controller/multitap/multitap.cpp b/snes/controller/multitap/multitap.cpp
index 3a6eb720..146c41d4 100755
index 3a6eb72..146c41d 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 3a6eb720..146c41d4 100755
latched = 0;
counter1 = 0;
diff --git a/snes/controller/multitap/multitap.hpp b/snes/controller/multitap/multitap.hpp
index 0540af71..e6324ac5 100755
index 0540af7..e6324ac 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 0540af71..e6324ac5 100755
bool latched;
unsigned counter1;
diff --git a/snes/controller/superscope/superscope.cpp b/snes/controller/superscope/superscope.cpp
index 12068f05..1a1dfbff 100755
index 12068f0..1a1dfbf 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 12068f05..1a1dfbff 100755
create(Controller::Enter, 21477272);
latched = 0;
diff --git a/snes/controller/superscope/superscope.hpp b/snes/controller/superscope/superscope.hpp
index a7a90b71..93509d79 100755
index a7a90b7..93509d7 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 a7a90b71..93509d79 100755
//private:
diff --git a/snes/system/input.cpp b/snes/system/input.cpp
index 90503106..ec5559dc 100755
index 9050310..ec5559d 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 90503106..ec5559dc 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 13ef46e1..6832e823 100755
index 13ef46e..6832e82 100755
--- a/snes/system/input.hpp
+++ b/snes/system/input.hpp
@@ -31,6 +31,7 @@ struct Input {
@ -330,7 +330,7 @@ index 13ef46e1..6832e823 100755
Input();
~Input();
diff --git a/snes/system/serialization.cpp b/snes/system/serialization.cpp
index f7d6f3b1..08e70510 100755
index f7d6f3b..08e7051 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 f7d6f3b1..08e70510 100755
if(cartridge.mode() == Cartridge::Mode::SufamiTurbo) sufamiturbo.serialize(s);
if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) icd2.serialize(s);
--
2.15.0.rc1
2.1.4

View file

@ -1,14 +1,14 @@
From cdf2f46490f128308eb7f399d03530936ebeda0a 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 05/27] Fix unserialization of 64-bit signed integers
Subject: [PATCH 05/23] 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 ff2337ab..e6bc8fad 100755
index ff2337a..e6bc8fa 100755
--- a/nall/serializer.hpp
+++ b/nall/serializer.hpp
@@ -58,7 +58,7 @@ namespace nall {
@ -21,5 +21,5 @@ index ff2337ab..e6bc8fad 100755
isize += size;
}
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 4dc46334ec175e26277632fee4aea80768749af9 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 06/27] Allow frontend to control random number seed
Subject: [PATCH 06/23] Allow frontend to control random number seed
---
snes/interface/interface.cpp | 5 +++++
@ -10,7 +10,7 @@ Subject: [PATCH 06/27] 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 b3017c90..0a21a132 100755
index b3017c9..0a21a13 100755
--- a/snes/interface/interface.cpp
+++ b/snes/interface/interface.cpp
@@ -23,4 +23,9 @@ time_t Interface::currentTime()
@ -24,7 +24,7 @@ index b3017c90..0a21a132 100755
+
}
diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp
index df975e83..30ee7fde 100755
index df975e8..30ee7fd 100755
--- a/snes/interface/interface.hpp
+++ b/snes/interface/interface.hpp
@@ -6,6 +6,7 @@ struct Interface {
@ -36,7 +36,7 @@ index df975e83..30ee7fde 100755
extern Interface *interface;
diff --git a/snes/system/system.cpp b/snes/system/system.cpp
index c19a7c51..dbd912d8 100755
index c19a7c5..dbd912d 100755
--- a/snes/system/system.cpp
+++ b/snes/system/system.cpp
@@ -146,7 +146,7 @@ void System::unload() {
@ -49,5 +49,5 @@ index c19a7c51..dbd912d8 100755
region = config.region;
expansion = config.expansion_port;
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From eeaf6dc52d39ca9c150ff61864c11297d200d968 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 07/27] Fix mouse polling
Subject: [PATCH 07/23] 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 6b26fae5..1a066b98 100755
index 6b26fae..1a066b9 100755
--- a/snes/controller/mouse/mouse.cpp
+++ b/snes/controller/mouse/mouse.cpp
@@ -3,9 +3,13 @@
@ -48,7 +48,7 @@ index 6b26fae5..1a066b98 100755
}
diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp
index b66ea513..b07c8ab7 100755
index b66ea51..b07c8ab 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 b66ea513..b07c8ab7 100755
+ int _position_y;
};
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 7018377c93553071fc404db872b2746d40ac3bce 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 08/27] Fix uninitialized variables
Subject: [PATCH 08/23] 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 d0c9e077..c6809f73 100755
index d0c9e07..c6809f7 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 d0c9e077..c6809f73 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 1a3835b3..a21e5e31 100755
index 1a3835b..a21e5e3 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 1a3835b3..a21e5e31 100755
}
diff --git a/snes/cpu/core/core.cpp b/snes/cpu/core/core.cpp
index 427176b0..a5b809b9 100755
index 427176b..a5b809b 100755
--- a/snes/cpu/core/core.cpp
+++ b/snes/cpu/core/core.cpp
@@ -86,4 +86,12 @@ CPUcore::CPUcore() {
@ -68,7 +68,7 @@ index 427176b0..a5b809b9 100755
+
}
diff --git a/snes/cpu/core/core.hpp b/snes/cpu/core/core.hpp
index 964bd128..7a685a8d 100755
index 964bd12..7a685a8 100755
--- a/snes/cpu/core/core.hpp
+++ b/snes/cpu/core/core.hpp
@@ -7,6 +7,8 @@ struct CPUcore {
@ -81,7 +81,7 @@ index 964bd128..7a685a8d 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 f6ae9754..2d7d3432 100755
index f6ae975..2d7d343 100755
--- a/snes/cpu/cpu.cpp
+++ b/snes/cpu/cpu.cpp
@@ -125,6 +125,7 @@ void CPU::power() {
@ -93,7 +93,7 @@ index f6ae9754..2d7d3432 100755
void CPU::reset() {
diff --git a/snes/smp/core/core.cpp b/snes/smp/core/core.cpp
index 9c94d00a..2fc29be1 100755
index 9c94d00..2fc29be 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 9c94d00a..2fc29be1 100755
+
}
diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp
index 6adf6f6b..1489fcef 100755
index 6adf6f6..1489fce 100755
--- a/snes/smp/core/core.hpp
+++ b/snes/smp/core/core.hpp
@@ -11,6 +11,8 @@ struct SMPcore {
@ -126,7 +126,7 @@ index 6adf6f6b..1489fcef 100755
string disassemble_opcode(uint16 addr);
diff --git a/snes/smp/smp.cpp b/snes/smp/smp.cpp
index 90806245..d4ccf425 100755
index 9080624..d4ccf42 100755
--- a/snes/smp/smp.cpp
+++ b/snes/smp/smp.cpp
@@ -53,6 +53,7 @@ void SMP::power() {
@ -138,5 +138,5 @@ index 90806245..d4ccf425 100755
void SMP::reset() {
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 6e0364c9a86caa71623a188a720b2d68b304b89b 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 09/27] Add needed support for detecting true polls as opposed
Subject: [PATCH 09/23] Add needed support for detecting true polls as opposed
to just autopolling
---
@ -10,7 +10,7 @@ Subject: [PATCH 09/27] 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 3da865e2..49445773 100755
index 3da865e..4944577 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 3da865e2..49445773 100755
#include "dma/dma.hpp"
#include "memory/memory.hpp"
diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp
index 8b6aaa6a..c5ee930f 100755
index 8b6aaa6..c5ee930 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 8b6aaa6a..c5ee930f 100755
//DMAPx
uint8 CPU::mmio_r43x0(uint8 i) {
--
2.15.0.rc1
2.1.4

View file

@ -1,14 +1,14 @@
From e397bd46f17d6ea00c8c96d5a8e0c5f5b4a6f642 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 10/27] Fix compiling on GCC 4.7
Subject: [PATCH 10/23] 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 1b255ce2..07a64dfc 100755
index 1b255ce..07a64df 100755
--- a/nall/string.hpp
+++ b/nall/string.hpp
@@ -25,8 +25,8 @@
@ -22,5 +22,5 @@ index 1b255ce2..07a64dfc 100755
#include <nall/string/convert.hpp>
#include <nall/string/cstring.hpp>
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From e047aa8eb9883f60e4141effba8128a4a555d8be Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Sun, 27 Oct 2013 10:52:45 +0200
Subject: [PATCH 11/27] Support notifying latches
Subject: [PATCH 11/23] Support notifying latches
---
snes/cpu/mmio/mmio.cpp | 1 +
@ -11,7 +11,7 @@ Subject: [PATCH 11/27] Support notifying latches
4 files changed, 8 insertions(+)
diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp
index c5ee930f..b7afff00 100755
index c5ee930..b7afff0 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 c5ee930f..b7afff00 100755
input.port2->latch(data & 1);
}
diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp
index 179df27d..6a98de00 100755
index 179df27..6a98de0 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 179df27d..6a98de00 100755
input.port2->latch(1);
input.port1->latch(0);
diff --git a/snes/interface/interface.cpp b/snes/interface/interface.cpp
index 0a21a132..6685556c 100755
index 0a21a13..6685556 100755
--- a/snes/interface/interface.cpp
+++ b/snes/interface/interface.cpp
@@ -28,4 +28,9 @@ time_t Interface::randomSeed()
@ -49,7 +49,7 @@ index 0a21a132..6685556c 100755
+
}
diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp
index 30ee7fde..203f7b0c 100755
index 30ee7fd..203f7b0 100755
--- a/snes/interface/interface.hpp
+++ b/snes/interface/interface.hpp
@@ -7,6 +7,7 @@ struct Interface {
@ -61,5 +61,5 @@ index 30ee7fde..203f7b0c 100755
extern Interface *interface;
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From a5b380757b086e3a00b47fe14e2a63c74683e8da Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Thu, 28 Nov 2013 22:36:29 +0200
Subject: [PATCH 12/27] Support unlimited number of breakpoints
Subject: [PATCH 12/23] Support unlimited number of breakpoints
---
snes/alt/cpu/cpu.cpp | 22 +++++++-------
@ -40,7 +40,7 @@ Subject: [PATCH 12/27] 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 814908d0..dcbb92d3 100755
index 814908d..dcbb92d 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 814908d0..dcbb92d3 100755
void CPU::power() {
diff --git a/snes/alt/ppu-compatibility/ppu.cpp b/snes/alt/ppu-compatibility/ppu.cpp
index a21e5e31..122b1430 100755
index a21e5e3..122b143 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 a21e5e31..122b1430 100755
void PPU::power() {
diff --git a/snes/alt/ppu-parallel/ppu.cpp b/snes/alt/ppu-parallel/ppu.cpp
index 1c3dcb70..8dd118b2 100755
index 1c3dcb7..8dd118b 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 1c3dcb70..8dd118b2 100755
void PPU::power() {
diff --git a/snes/alt/ppu-performance/ppu.cpp b/snes/alt/ppu-performance/ppu.cpp
index 7c231bc0..4b2b2948 100755
index 7c231bc..4b2b294 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 7c231bc0..4b2b2948 100755
void PPU::power() {
diff --git a/snes/cartridge/cartridge.hpp b/snes/cartridge/cartridge.hpp
index 37555bc0..82e73c4c 100755
index 37555bc..82e73c4 100755
--- a/snes/cartridge/cartridge.hpp
+++ b/snes/cartridge/cartridge.hpp
@@ -12,6 +12,22 @@ struct Cartridge : property<Cartridge> {
@ -160,7 +160,7 @@ index 37555bc0..82e73c4c 100755
Mapping();
Mapping(const function<uint8 (unsigned)>&, const function<void (unsigned, uint8)>&);
diff --git a/snes/cartridge/markup.cpp b/snes/cartridge/markup.cpp
index e639fe52..2dd0d646 100755
index e639fe5..2dd0d64 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 e639fe52..2dd0d646 100755
write = { &Memory::write, &memory };
mode = Bus::MapMode::Direct;
diff --git a/snes/cheat/cheat.cpp b/snes/cheat/cheat.cpp
index 46c42d1c..3a269cc5 100755
index 46c42d1..3a269cc 100755
--- a/snes/cheat/cheat.cpp
+++ b/snes/cheat/cheat.cpp
@@ -21,9 +21,9 @@ void Cheat::synchronize() {
@ -283,7 +283,7 @@ index 46c42d1c..3a269cc5 100755
}
}
diff --git a/snes/cheat/cheat.hpp b/snes/cheat/cheat.hpp
index 306b99b1..b4d2a42e 100755
index 306b99b..b4d2a42 100755
--- a/snes/cheat/cheat.hpp
+++ b/snes/cheat/cheat.hpp
@@ -1,6 +1,7 @@
@ -295,7 +295,7 @@ index 306b99b1..b4d2a42e 100755
struct Cheat : public linear_vector<CheatCode> {
diff --git a/snes/chip/bsx/satellaview/satellaview.cpp b/snes/chip/bsx/satellaview/satellaview.cpp
index 3c980195..25af8e56 100755
index 3c98019..25af8e5 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 3c980195..25af8e56 100755
void BSXSatellaview::unload() {
diff --git a/snes/chip/hitachidsp/hitachidsp.cpp b/snes/chip/hitachidsp/hitachidsp.cpp
index 1042267e..3e5c5bdb 100755
index 1042267..3e5c5bd 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 1042267e..3e5c5bdb 100755
}
state = State::Idle;
diff --git a/snes/chip/hitachidsp/memory.cpp b/snes/chip/hitachidsp/memory.cpp
index 3c9c3af1..36868e88 100755
index 3c9c3af..36868e8 100755
--- a/snes/chip/hitachidsp/memory.cpp
+++ b/snes/chip/hitachidsp/memory.cpp
@@ -1,7 +1,7 @@
@ -336,7 +336,7 @@ index 3c9c3af1..36868e88 100755
}
diff --git a/snes/chip/nss/nss.cpp b/snes/chip/nss/nss.cpp
index 964973d0..5946af3b 100755
index 964973d..5946af3 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 964973d0..5946af3b 100755
void NSS::unload() {
diff --git a/snes/chip/sa1/memory/memory.cpp b/snes/chip/sa1/memory/memory.cpp
index d13ac929..9bb4ff20 100755
index d13ac92..9bb4ff2 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 d13ac929..9bb4ff20 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 ffb9e9f6..ab8e1edd 100755
index ffb9e9f..ab8e1ed 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 ffb9e9f6..ab8e1edd 100755
uint8 mmc_read(unsigned addr);
diff --git a/snes/chip/sa1/sa1.cpp b/snes/chip/sa1/sa1.cpp
index 71c6310a..30e00809 100755
index 71c6310..30e0080 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 71c6310a..30e00809 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 c9b8b1c4..5d6cc55f 100755
index c9b8b1c..5d6cc55 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 c9b8b1c4..5d6cc55f 100755
void SDD1::unload() {
diff --git a/snes/cpu/core/core.hpp b/snes/cpu/core/core.hpp
index 7a685a8d..9d77f3c5 100755
index 7a685a8..9d77f3c 100755
--- a/snes/cpu/core/core.hpp
+++ b/snes/cpu/core/core.hpp
@@ -10,7 +10,7 @@ struct CPUcore {
@ -418,7 +418,7 @@ index 7a685a8d..9d77f3c5 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 030b3ab5..ab8dde24 100755
index 030b3ab..ab8dde2 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 030b3ab5..ab8dde24 100755
uint16 CPUcore::dreadw(uint32 addr) {
diff --git a/snes/cpu/core/memory.hpp b/snes/cpu/core/memory.hpp
index 49926578..132501c1 100755
index 4992657..132501c 100755
--- a/snes/cpu/core/memory.hpp
+++ b/snes/cpu/core/memory.hpp
@@ -1,5 +1,5 @@
@ -442,7 +442,7 @@ index 49926578..132501c1 100755
alwaysinline uint8_t op_readstack() {
diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp
index 2d7d3432..39da6b16 100755
index 2d7d343..39da6b1 100755
--- a/snes/cpu/cpu.cpp
+++ b/snes/cpu/cpu.cpp
@@ -78,8 +78,8 @@ void CPU::enter() {
@ -493,7 +493,7 @@ index 2d7d3432..39da6b16 100755
void CPU::power() {
diff --git a/snes/cpu/debugger/debugger.cpp b/snes/cpu/debugger/debugger.cpp
index a33518ed..8301bdb6 100755
index a33518e..8301bdb 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 a33518ed..8301bdb6 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 579f6f03..c3d66db5 100755
index 579f6f0..c3d66db 100755
--- a/snes/cpu/debugger/debugger.hpp
+++ b/snes/cpu/debugger/debugger.hpp
@@ -16,7 +16,7 @@ public:
@ -521,7 +521,7 @@ index 579f6f03..c3d66db5 100755
CPUDebugger();
diff --git a/snes/cpu/dma/dma.cpp b/snes/cpu/dma/dma.cpp
index e8cdb3ec..0a00bfea 100755
index e8cdb3e..0a00bfe 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 e8cdb3ec..0a00bfea 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 c2c8f1fa..31f82c31 100755
index c2c8f1f..31f82c3 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 c2c8f1fa..31f82c31 100755
alu_edge();
return regs.mdr;
diff --git a/snes/cpu/memory/memory.hpp b/snes/cpu/memory/memory.hpp
index d33861d4..fd64ba8b 100755
index d33861d..fd64ba8 100755
--- a/snes/cpu/memory/memory.hpp
+++ b/snes/cpu/memory/memory.hpp
@@ -1,4 +1,4 @@
@ -571,7 +571,7 @@ index d33861d4..fd64ba8b 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 b7afff00..30048c19 100755
index b7afff0..30048c1 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 b7afff00..30048c19 100755
//WMDATA
diff --git a/snes/debugger/debugger.cpp b/snes/debugger/debugger.cpp
index b1312339..e8d0f5af 100755
index b131233..e8d0f5a 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 b1312339..e8d0f5af 100755
case MemorySource::APUBus: {
diff --git a/snes/memory/memory-inline.hpp b/snes/memory/memory-inline.hpp
index 70503bea..45f150c9 100755
index 70503be..45f150c 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 70503bea..45f150c9 100755
return writer[lookup[addr]](target[addr], data);
}
diff --git a/snes/memory/memory.cpp b/snes/memory/memory.cpp
index ede9cbd0..a9a484a0 100755
index ede9cbd..a9a484a 100755
--- a/snes/memory/memory.cpp
+++ b/snes/memory/memory.cpp
@@ -27,6 +27,7 @@ void Bus::map(
@ -715,7 +715,7 @@ index ede9cbd0..a9a484a0 100755
}
diff --git a/snes/memory/memory.hpp b/snes/memory/memory.hpp
index 634e0717..c20e14db 100755
index 634e071..c20e14d 100755
--- a/snes/memory/memory.hpp
+++ b/snes/memory/memory.hpp
@@ -44,10 +44,13 @@ private:
@ -756,7 +756,7 @@ index 634e0717..c20e14db 100755
~Bus();
};
diff --git a/snes/ppu/ppu.cpp b/snes/ppu/ppu.cpp
index 8545175f..13e231cf 100755
index 8545175..13e231c 100755
--- a/snes/ppu/ppu.cpp
+++ b/snes/ppu/ppu.cpp
@@ -87,8 +87,8 @@ void PPU::enable() {
@ -771,7 +771,7 @@ index 8545175f..13e231cf 100755
void PPU::power() {
diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp
index 1489fcef..13d69364 100755
index 1489fce..13d6936 100755
--- a/snes/smp/core/core.hpp
+++ b/snes/smp/core/core.hpp
@@ -2,7 +2,7 @@ struct SMPcore {
@ -784,7 +784,7 @@ index 1489fcef..13d69364 100755
#include "registers.hpp"
#include "memory.hpp"
diff --git a/snes/snes.hpp b/snes/snes.hpp
index dffeeee3..37ed1feb 100755
index dffeeee..37ed1fe 100755
--- a/snes/snes.hpp
+++ b/snes/snes.hpp
@@ -1,5 +1,6 @@
@ -795,5 +795,5 @@ index dffeeee3..37ed1feb 100755
namespace SNES {
namespace Info {
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 8bc6bb381e680616dcc843c99889799aedd43163 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Sat, 30 Nov 2013 10:27:37 +0200
Subject: [PATCH 13/27] Support auto-detecting bsnes version
Subject: [PATCH 13/23] Support auto-detecting bsnes version
---
bsnes.mk | 3 +++
@ -10,7 +10,7 @@ Subject: [PATCH 13/27] Support auto-detecting bsnes version
diff --git a/bsnes.mk b/bsnes.mk
new file mode 100644
index 00000000..20f22f61
index 0000000..20f22f6
--- /dev/null
+++ b/bsnes.mk
@@ -0,0 +1,3 @@
@ -18,5 +18,5 @@ index 00000000..20f22f61
+LIBSNES_DIR=ui-libsnes
+BSNES_VERSION=085
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 40c456dadd79cb2c94379fda8b41a4d0ba051ad1 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Sat, 7 Dec 2013 23:32:44 +0200
Subject: [PATCH 14/27] Support alternate (more accurate) poll timings
Subject: [PATCH 14/23] Support alternate (more accurate) poll timings
---
snes/config/config.cpp | 1 +
@ -13,7 +13,7 @@ Subject: [PATCH 14/27] 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 701af94c..206daae0 100755
index 701af94..206daae 100755
--- a/snes/config/config.cpp
+++ b/snes/config/config.cpp
@@ -13,6 +13,7 @@ Configuration::Configuration() {
@ -25,7 +25,7 @@ index 701af94c..206daae0 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 1f4d037c..dabde597 100755
index 1f4d037..dabde59 100755
--- a/snes/config/config.hpp
+++ b/snes/config/config.hpp
@@ -10,6 +10,7 @@ struct Configuration {
@ -37,7 +37,7 @@ index 1f4d037c..dabde597 100755
struct SMP {
diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp
index 6a98de00..ae8e94f8 100755
index 6a98de0..ae8e94f 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 6a98de00..ae8e94f8 100755
+
#endif
diff --git a/snes/cpu/timing/timing.cpp b/snes/cpu/timing/timing.cpp
index f1378f0c..d7cf24f3 100755
index f1378f0..d7cf24f 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 f1378f0c..d7cf24f3 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 6c225dab..bf15a727 100755
index 6c225da..bf15a72 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 6c225dab..bf15a727 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 37ed1feb..4e3ba64c 100755
index 37ed1fe..4e3ba64 100755
--- a/snes/snes.hpp
+++ b/snes/snes.hpp
@@ -1,6 +1,7 @@
@ -134,5 +134,5 @@ index 37ed1feb..4e3ba64c 100755
namespace SNES {
namespace Info {
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 863bde899b53ae31e854096ac5258208c848a293 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Thu, 6 Mar 2014 21:07:54 +0200
Subject: [PATCH 15/27] Fix mouse speed support
Subject: [PATCH 15/23] Fix mouse speed support
---
snes/config/config.cpp | 1 +
@ -11,7 +11,7 @@ Subject: [PATCH 15/27] Fix mouse speed support
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/snes/config/config.cpp b/snes/config/config.cpp
index 206daae0..19831370 100755
index 206daae..1983137 100755
--- a/snes/config/config.cpp
+++ b/snes/config/config.cpp
@@ -8,6 +8,7 @@ Configuration::Configuration() {
@ -23,7 +23,7 @@ index 206daae0..19831370 100755
cpu.version = 2;
cpu.ntsc_frequency = 21477272; //315 / 88 * 6000000
diff --git a/snes/config/config.hpp b/snes/config/config.hpp
index dabde597..68fe0bde 100755
index dabde59..68fe0bd 100755
--- a/snes/config/config.hpp
+++ b/snes/config/config.hpp
@@ -1,9 +1,12 @@
@ -40,7 +40,7 @@ index dabde597..68fe0bde 100755
struct CPU {
unsigned version;
diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp
index 1a066b98..caa7a358 100755
index 1a066b9..caa7a35 100755
--- a/snes/controller/mouse/mouse.cpp
+++ b/snes/controller/mouse/mouse.cpp
@@ -1,6 +1,10 @@
@ -87,7 +87,7 @@ index 1a066b98..caa7a358 100755
#endif
diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp
index b07c8ab7..13a9313e 100755
index b07c8ab..13a9313 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 b07c8ab7..13a9313e 100755
int _position_y;
};
--
2.15.0.rc1
2.1.4

View file

@ -1,14 +1,14 @@
From 60267d1f22fd2ff3197c6c829640f66304c89283 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Sun, 16 Mar 2014 16:40:55 +0200
Subject: [PATCH 16/27] Fix tracelog of controller registers
Subject: [PATCH 16/23] 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 ab8dde24..624a80ce 100755
index ab8dde2..624a80c 100755
--- a/snes/cpu/core/disassembler/disassembler.cpp
+++ b/snes/cpu/core/disassembler/disassembler.cpp
@@ -1,6 +1,8 @@
@ -21,5 +21,5 @@ index ab8dde24..624a80ce 100755
//$[00-3f|80-bf]:[2000-5fff]
//do not read MMIO registers within debugger
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From de71f12eb59a41899a5c77d797e144e6f0919777 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Mon, 17 Mar 2014 14:22:58 +0200
Subject: [PATCH 17/27] Fix performance problem with non-bus breakpoints
Subject: [PATCH 17/23] Fix performance problem with non-bus breakpoints
---
snes/memory/memory.cpp | 35 ++++++++++++++++++++++++++---------
@ -10,7 +10,7 @@ Subject: [PATCH 17/27] 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 a9a484a0..d22e3137 100755
index a9a484a..d22e313 100755
--- a/snes/memory/memory.cpp
+++ b/snes/memory/memory.cpp
@@ -43,6 +43,7 @@ void Bus::map(
@ -77,7 +77,7 @@ index a9a484a0..d22e3137 100755
Bus::Bus() {
diff --git a/snes/memory/memory.hpp b/snes/memory/memory.hpp
index c20e14db..ee0c0a9e 100755
index c20e14d..ee0c0a9 100755
--- a/snes/memory/memory.hpp
+++ b/snes/memory/memory.hpp
@@ -52,6 +52,7 @@ struct Bus {
@ -89,7 +89,7 @@ index c20e14db..ee0c0a9e 100755
unsigned idcount;
function<uint8 (unsigned)> reader[256];
diff --git a/snes/snes.hpp b/snes/snes.hpp
index 4e3ba64c..9589db9b 100755
index 4e3ba64..9589db9 100755
--- a/snes/snes.hpp
+++ b/snes/snes.hpp
@@ -38,6 +38,7 @@ namespace SNES {
@ -101,5 +101,5 @@ index 4e3ba64c..9589db9b 100755
#include <gameboy/gameboy.hpp>
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 6bd069191d29ad70d38c82d59dd72cd0996fc45c Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Mon, 31 Mar 2014 20:17:46 +0300
Subject: [PATCH 18/27] Support VRAM, OAM, CGRAM and APURAM breakpoints
Subject: [PATCH 18/23] Support VRAM, OAM, CGRAM and APURAM breakpoints
---
snes/alt/ppu-compatibility/memory/memory.cpp | 44 +++++++++++++++++++++--
@ -19,7 +19,7 @@ Subject: [PATCH 18/27] 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 3f120d84..e47cf201 100755
index 3f120d8..e47cf20 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 3f120d84..e47cf201 100755
}
}
diff --git a/snes/alt/ppu-compatibility/ppu.hpp b/snes/alt/ppu-compatibility/ppu.hpp
index cccaabba..4adac4c4 100755
index cccaabb..4adac4c 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 cccaabba..4adac4c4 100755
enum : bool { Threaded = true };
alwaysinline void step(unsigned clocks);
diff --git a/snes/cartridge/cartridge.hpp b/snes/cartridge/cartridge.hpp
index 82e73c4c..2358c088 100755
index 82e73c4..2358c08 100755
--- a/snes/cartridge/cartridge.hpp
+++ b/snes/cartridge/cartridge.hpp
@@ -26,6 +26,10 @@ struct Cartridge : property<Cartridge> {
@ -171,7 +171,7 @@ index 82e73c4c..2358c088 100755
enum class Slot : unsigned {
diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp
index 13d69364..03f9ac66 100755
index 13d6936..03f9ac6 100755
--- a/snes/smp/core/core.hpp
+++ b/snes/smp/core/core.hpp
@@ -1,6 +1,6 @@
@ -183,7 +183,7 @@ index 13d69364..03f9ac66 100755
virtual void op_step();
diff --git a/snes/smp/core/memory.hpp b/snes/smp/core/memory.hpp
index c4b6d99f..c297962f 100755
index c4b6d99..c297962 100755
--- a/snes/smp/core/memory.hpp
+++ b/snes/smp/core/memory.hpp
@@ -1,9 +1,9 @@
@ -208,7 +208,7 @@ index c4b6d99f..c297962f 100755
alwaysinline void op_writedp(uint8 addr, uint8 data) {
diff --git a/snes/smp/core/opcodes.cpp b/snes/smp/core/opcodes.cpp
index 95b9844f..43db081d 100755
index 95b9844..43db081 100755
--- a/snes/smp/core/opcodes.cpp
+++ b/snes/smp/core/opcodes.cpp
@@ -11,7 +11,7 @@ template<uint8 (SMPcore::*op)(uint8)>
@ -348,7 +348,7 @@ index 95b9844f..43db081d 100755
}
diff --git a/snes/smp/debugger/debugger.cpp b/snes/smp/debugger/debugger.cpp
index 9546c118..894fdac9 100755
index 9546c11..894fdac 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 9546c118..894fdac9 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 d5d28e53..26bc7af9 100755
index d5d28e5..26bc7af 100755
--- a/snes/smp/debugger/debugger.hpp
+++ b/snes/smp/debugger/debugger.hpp
@@ -14,7 +14,7 @@ public:
@ -376,7 +376,7 @@ index d5d28e53..26bc7af9 100755
SMPDebugger();
diff --git a/snes/smp/memory/memory.cpp b/snes/smp/memory/memory.cpp
index 391324c4..58c11915 100755
index 391324c..58c1191 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 391324c4..58c11915 100755
cycle_edge();
return r;
diff --git a/snes/smp/memory/memory.hpp b/snes/smp/memory/memory.hpp
index 1a07445d..faa28daa 100755
index 1a07445..faa28da 100755
--- a/snes/smp/memory/memory.hpp
+++ b/snes/smp/memory/memory.hpp
@@ -1,9 +1,9 @@
@ -506,7 +506,7 @@ index 1a07445d..faa28daa 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 6b387cba..6b6ae837 100755
index 6b387cb..6b6ae83 100755
--- a/snes/smp/smp.hpp
+++ b/snes/smp/smp.hpp
@@ -1,6 +1,10 @@
@ -521,7 +521,7 @@ index 6b387cba..6b6ae837 100755
enum : bool { Threaded = true };
alwaysinline void step(unsigned clocks);
diff --git a/snes/snes.hpp b/snes/snes.hpp
index 9589db9b..27632bff 100755
index 9589db9..27632bf 100755
--- a/snes/snes.hpp
+++ b/snes/snes.hpp
@@ -1,6 +1,7 @@
@ -533,5 +533,5 @@ index 9589db9b..27632bff 100755
namespace SNES {
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From f1106d3dffd27dab526a703aa434512495fbacea Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Mon, 14 Apr 2014 21:21:36 +0300
Subject: [PATCH 19/27] SA1 trace hook support
Subject: [PATCH 19/23] SA1 trace hook support
---
snes/chip/sa1/sa1.cpp | 2 ++
@ -10,7 +10,7 @@ Subject: [PATCH 19/27] SA1 trace hook support
3 files changed, 6 insertions(+)
diff --git a/snes/chip/sa1/sa1.cpp b/snes/chip/sa1/sa1.cpp
index 30e00809..fdec362c 100755
index 30e0080..fdec362 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 30e00809..fdec362c 100755
}
}
diff --git a/snes/chip/sa1/sa1.hpp b/snes/chip/sa1/sa1.hpp
index 732b2a85..efd36376 100755
index 732b2a8..efd3637 100755
--- a/snes/chip/sa1/sa1.hpp
+++ b/snes/chip/sa1/sa1.hpp
@@ -15,6 +15,9 @@ public:
@ -37,7 +37,7 @@ index 732b2a85..efd36376 100755
void enter();
void tick();
diff --git a/snes/snes.hpp b/snes/snes.hpp
index 27632bff..3bdca7e5 100755
index 27632bf..3bdca7e 100755
--- a/snes/snes.hpp
+++ b/snes/snes.hpp
@@ -3,6 +3,7 @@
@ -49,5 +49,5 @@ index 27632bff..3bdca7e5 100755
namespace SNES {
namespace Info {
--
2.15.0.rc1
2.1.4

View file

@ -1,14 +1,14 @@
From cf662a12578778cb50c25d5275ce58deabd7eabe Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Wed, 30 Apr 2014 00:18:58 +0300
Subject: [PATCH 20/27] Fixes to SA1 open bus emulation
Subject: [PATCH 20/23] 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 9bb4ff20..614dfb0c 100755
index 9bb4ff2..614dfb0 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 9bb4ff20..614dfb0c 100755
uint8 SA1::mmc_read(unsigned addr) {
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 63fc77b07d517c2f9a0fd6ca3fa94f30fb0f5ec2 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Sun, 15 Jun 2014 22:01:26 +0300
Subject: [PATCH 21/27] Call notify latch function on alternate timings mode
Subject: [PATCH 21/23] Call notify latch function on alternate timings mode
too
---
@ -9,7 +9,7 @@ Subject: [PATCH 21/27] 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 ae8e94f8..3fd4d23e 100755
index ae8e94f..3fd4d23 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 ae8e94f8..3fd4d23e 100755
input.port2->latch(1);
}
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 5bc96b8aeea26729ef4399c2d8d5e562894616e1 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Tue, 20 Jan 2015 10:04:58 +0200
Subject: [PATCH 22/27] Support DMA tracing
Subject: [PATCH 22/23] Support DMA tracing
---
snes/alt/ppu-compatibility/mmio/mmio.cpp | 18 +++++++
@ -18,7 +18,7 @@ Subject: [PATCH 22/27] 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 aedb67c1..0a269cc0 100755
index aedb67c..0a269cc 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 aedb67c1..0a269cc0 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 122b1430..ac886edc 100755
index 122b143..ac886ed 100755
--- a/snes/alt/ppu-compatibility/ppu.cpp
+++ b/snes/alt/ppu-compatibility/ppu.cpp
@@ -1,4 +1,5 @@
@ -56,7 +56,7 @@ index 122b1430..ac886edc 100755
#define PPU_CPP
namespace SNES {
diff --git a/snes/alt/ppu-compatibility/ppu.hpp b/snes/alt/ppu-compatibility/ppu.hpp
index 4adac4c4..b0eabf7c 100755
index 4adac4c..b0eabf7 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 4adac4c4..b0eabf7c 100755
#include "mmio/mmio.hpp"
#include "render/render.hpp"
diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp
index 39da6b16..ce112afa 100755
index 39da6b1..ce112af 100755
--- a/snes/cpu/cpu.cpp
+++ b/snes/cpu/cpu.cpp
@@ -1,4 +1,5 @@
@ -81,7 +81,7 @@ index 39da6b16..ce112afa 100755
#define CPU_CPP
namespace SNES {
diff --git a/snes/cpu/cpu.hpp b/snes/cpu/cpu.hpp
index 49445773..fd665b1f 100755
index 4944577..fd665b1 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 49445773..fd665b1f 100755
#include "dma/dma.hpp"
#include "memory/memory.hpp"
diff --git a/snes/cpu/dma/dma.cpp b/snes/cpu/dma/dma.cpp
index 0a00bfea..8f7be263 100755
index 0a00bfe..8f7be26 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 0a00bfea..8f7be263 100755
+
#endif
diff --git a/snes/cpu/dma/dma.hpp b/snes/cpu/dma/dma.hpp
index 33755bde..8740bb3a 100755
index 33755bd..8740bb3 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 33755bde..8740bb3a 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 302f74f8..4a4fb9ce 100755
index 302f74f..4a4fb9c 100755
--- a/snes/ppu/mmio/mmio.cpp
+++ b/snes/ppu/mmio/mmio.cpp
@@ -1,5 +1,23 @@
@ -248,7 +248,7 @@ index 302f74f8..4a4fb9ce 100755
return display.interlace;
}
diff --git a/snes/ppu/ppu.cpp b/snes/ppu/ppu.cpp
index 13e231cf..58742098 100755
index 13e231c..5874209 100755
--- a/snes/ppu/ppu.cpp
+++ b/snes/ppu/ppu.cpp
@@ -1,4 +1,5 @@
@ -258,7 +258,7 @@ index 13e231cf..58742098 100755
#define PPU_CPP
namespace SNES {
diff --git a/snes/ppu/ppu.hpp b/snes/ppu/ppu.hpp
index fdba113c..0addb775 100755
index fdba113..0addb77 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 fdba113c..0addb775 100755
uint32 *surface;
uint32 *output;
diff --git a/snes/snes.hpp b/snes/snes.hpp
index 3bdca7e5..7c48ebb3 100755
index 3bdca7e..7c48ebb 100755
--- a/snes/snes.hpp
+++ b/snes/snes.hpp
@@ -4,6 +4,7 @@
@ -284,5 +284,5 @@ index 3bdca7e5..7c48ebb3 100755
namespace SNES {
namespace Info {
--
2.15.0.rc1
2.1.4

View file

@ -1,7 +1,7 @@
From 9682df9e33c366dfe047a99c8bcefc2c8ab29620 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Sat, 24 Jan 2015 16:46:18 +0200
Subject: [PATCH 23/27] Add autopoller and IRQ/NMI tracing
Subject: [PATCH 23/23] Add autopoller and IRQ/NMI tracing
---
snes/cpu/cpu.cpp | 3 +++
@ -9,7 +9,7 @@ Subject: [PATCH 23/27] 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 ce112afa..e11fc882 100755
index ce112af..e11fc88 100755
--- a/snes/cpu/cpu.cpp
+++ b/snes/cpu/cpu.cpp
@@ -69,14 +69,17 @@ void CPU::enter() {
@ -31,7 +31,7 @@ index ce112afa..e11fc882 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 3fd4d23e..afca7504 100755
index 3fd4d23..afca750 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 3fd4d23e..afca7504 100755
status.auto_joypad_counter++;
}
--
2.15.0.rc1
2.1.4

View file

@ -1,50 +0,0 @@
From f2bbef8a4e12e05190a68dfe410cff3e4b1eb13f Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Sat, 8 Aug 2015 11:09:41 +0300
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 67a35ad6..11d9d8de 100755
--- a/nall/bit.hpp
+++ b/nall/bit.hpp
@@ -8,18 +8,27 @@ namespace nall {
}
template<int bits> constexpr inline unsigned uclip(const unsigned x) {
- enum { m = (1U << (bits - 1)) + ((1U << (bits - 1)) - 1) };
- return (x & m);
+ return x & ((1U << (bits - 1)) + ((1U << (bits - 1)) - 1));
+ }
+
+ template<int bits> constexpr inline signed sclamp_b() {
+ return 1U << (bits - 1);
+ }
+
+ template<int bits> constexpr inline signed sclamp_m() {
+ return (1U << (bits - 1)) - 1;
}
template<int bits> constexpr inline signed sclamp(const signed x) {
- enum { b = 1U << (bits - 1), m = (1U << (bits - 1)) - 1 };
- return (x > m) ? m : (x < -b) ? -b : x;
+ return (x > sclamp_m<bits>()) ? sclamp_m<bits>() : (x < -sclamp_b<bits>()) ? -sclamp_b<bits>() : x;
+ }
+
+ template<int bits> constexpr inline signed sclip_m() {
+ return (1U << (bits)) - 1;
}
template<int bits> constexpr inline signed sclip(const signed x) {
- enum { b = 1U << (bits - 1), m = (1U << bits) - 1 };
- return ((x & m) ^ b) - b;
+ return ((x & sclip_m<bits>()) ^ sclamp_b<bits>()) - sclamp_b<bits>();
}
namespace bit {
--
2.15.0.rc1

View file

@ -1,26 +0,0 @@
From d39571de650d49636778a73c66414aff372c08af Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Date: Mon, 7 Sep 2015 20:48:14 +0300
Subject: [PATCH 25/27] Fix MSU-1 bug where write to MSU1BASE+4 is mirred to
MSUBASE+5
---
snes/chip/msu1/msu1.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/snes/chip/msu1/msu1.cpp b/snes/chip/msu1/msu1.cpp
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) {
if(datafile.open()) datafile.seek(mmio.data_offset);
mmio.data_busy = false;
break;
- case 4: mmio.audio_track = (mmio.audio_track & 0xff00) | (data << 0);
+ case 4: mmio.audio_track = (mmio.audio_track & 0xff00) | (data << 0); break;
case 5: mmio.audio_track = (mmio.audio_track & 0x00ff) | (data << 8);
if(audiofile.open()) audiofile.close();
if(audiofile.open(interface->path(Cartridge::Slot::Base, { "-", (unsigned)mmio.audio_track, ".pcm" }), file::mode::read)) {
--
2.15.0.rc1

View file

@ -1,25 +0,0 @@
From c0a2270cfd5f56e8a311b36011e1f15fac6c54ca Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilariliusvaara@welho.com>
Date: Tue, 9 Aug 2016 18:54:57 +0300
Subject: [PATCH 26/27] Add <vector> to avoid compile error due to missing
std::vector
---
snes/snes.hpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/snes/snes.hpp b/snes/snes.hpp
index 7c48ebb3..3a65e360 100755
--- a/snes/snes.hpp
+++ b/snes/snes.hpp
@@ -22,6 +22,7 @@ namespace SNES {
#include <libco/libco.h>
+#include <vector>
#include <nall/platform.hpp>
#include <nall/algorithm.hpp>
#include <nall/any.hpp>
--
2.15.0.rc1

View file

@ -1,377 +0,0 @@
From 4cfbbeadc3abe3e3911f7f59ce57b715edc76563 Mon Sep 17 00:00:00 2001
From: Ilari Liusvaara <ilariliusvaara@welho.com>
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 <snes/snes.hpp>
#include <cstdio>
+#include <iostream>
+#include <cassert>
#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

View file

@ -5,7 +5,6 @@
#include <set>
#include <stdexcept>
#include <iostream>
#include <functional>
#include "library/framebuffer.hpp"
#include "library/dispatch.hpp"

View file

@ -5,8 +5,6 @@
#include <string>
#include <map>
class audioapi_instance;
//All the following need to be implemented by the sound driver itself
struct _audioapi_driver
{
@ -81,29 +79,4 @@ std::map<std::string, std::string> audioapi_driver_get_devices(bool rec) throw(s
*/
const char* audioapi_driver_name() throw();
/**
* Add an instance to be mixed.
*/
void audioapi_connect_instance(audioapi_instance& instance);
/**
* Remove an instance from being mixed.
*/
void audioapi_disconnect_instance(audioapi_instance& instance);
/**
* Send a rate change.
*/
void audioapi_send_rate_change(unsigned rrate, unsigned prate);
/**
* Broadcast voice input to all instances.
*/
void audioapi_put_voice(float* samples, size_t count);
/**
* Get mixed music + voice out from all instances.
*/
void audioapi_get_mixed(int16_t* samples, size_t count, bool stereo);
#endif

View file

@ -121,9 +121,6 @@ private:
std::map<std::string, active_bind> active_buttons;
std::map<std::string, keyboard::ctrlrkey*> added_keys;
std::set<core_core*> cores_done;
bool promote_autohold;
bool promote_autofire;
bool promote_typed;
controller_state& controls;
keyboard::mapper& mapper;
keyboard::keyboard& keyboard;
@ -141,12 +138,6 @@ private:
command::_fnptr<const std::string&> button_ar;
command::_fnptr<const std::string&> button_at;
command::_fnptr<const std::string&> button_a;
command::_fnptr<> afire_p;
command::_fnptr<> afire_n;
command::_fnptr<> ahold_p;
command::_fnptr<> ahold_n;
command::_fnptr<> typed_p;
command::_fnptr<> typed_n;
};

View file

@ -2,7 +2,6 @@
#define _framebuffer__hpp__included__
#include "core/window.hpp"
#include "core/queue.hpp"
#include "library/command.hpp"
#include "library/framebuffer.hpp"
#include "library/triplebuffer.hpp"
@ -32,7 +31,7 @@ class emu_framebuffer
public:
emu_framebuffer(subtitle_commentary& _subtitles, settingvar::group& _settings, memwatch_set& _mwatch,
keyboard::keyboard& _keyboard, emulator_dispatch& _dispatch, lua_state& _lua2, loaded_rom& _rom,
status_updater& _supdater, command::group& _cmd, input_queue& _iqueue);
status_updater& _supdater, command::group& _cmd);
/**
* The main framebuffer.
*/
@ -111,7 +110,6 @@ private:
loaded_rom& rom;
status_updater& supdater;
command::group& cmd;
input_queue& iqueue;
command::_fnptr<command::arg_filename> screenshot;
};

View file

@ -21,16 +21,6 @@ public:
*/
void set_speed_multiplier(double multiplier) throw();
/**
* Increase the speed to next step.
*/
void increase_speed() throw();
/**
* Decrease the speed to next step.
*/
void decrease_speed() throw();
/**
* Get the target speed multiplier.
*
@ -99,10 +89,6 @@ private:
double get_realized_fps();
void add_frame(uint64_t linear_time);
std::pair<bool, double> read_fps();
//Step should be ODD.
void set_speedstep(unsigned step);
//Step can be EVEN if between steps.
unsigned get_speedstep();
uint64_t last_time_update;
uint64_t time_at_last_update;
bool time_frozen;
@ -111,15 +97,12 @@ private:
//Framerate.
double nominal_framerate;
double multiplier_framerate;
bool framerate_realtime_locked;
threads::lock framerate_lock;
command::group& cmd;
command::_fnptr<> turbo_p;
command::_fnptr<> turbo_r;
command::_fnptr<> turbo_t;
command::_fnptr<const std::string&> setspeed_t;
command::_fnptr<> spd_inc;
command::_fnptr<> spd_dec;
};
#endif

View file

@ -23,7 +23,7 @@ struct joystick_driver
* - The call occurs in the main thread.
* - Implemented by the joystick plugin.
*/
void joystick_driver_init(bool soft = false) throw();
void joystick_driver_init() throw();
/**
* Joystick quit function.
*
@ -31,7 +31,7 @@ void joystick_driver_init(bool soft = false) throw();
* - The call occurs in the main thread.
* - Implemented by the joystick plugin.
*/
void joystick_driver_quit(bool soft = false) throw();
void joystick_driver_quit() throw();
/**
* Signal the joystick thread to quit.
*/

View file

@ -7,8 +7,5 @@ void handle_post_loadlibrary();
void autoload_libraries(void(*on_error)(const std::string& libname, const std::string& err, bool system) = NULL);
void with_loaded_library(const loadlib::module& l);
bool with_unloaded_library(loadlib::module& l);
std::string loadlib_debug_get_user_library_dir();
std::string loadlib_debug_get_system_library_dir();
#endif

View file

@ -4,7 +4,6 @@
#include <string>
#include <stdexcept>
#include <set>
#include <functional>
#include "library/memorywatch.hpp"
#include "library/json.hpp"

View file

@ -1,7 +1,6 @@
#ifndef _moviefile_common__hpp__included__
#define _moviefile_common__hpp__included__
#include <functional>
#include "core/moviefile.hpp"
#define DEFAULT_RTC_SECOND 1000000000ULL
#define DEFAULT_RTC_SUBSECOND 0ULL

View file

@ -164,7 +164,7 @@ class project_state
{
public:
project_state(voice_commentary& _commentary, memwatch_set& _mwatch, command::group& _command,
controller_state& _controls, settingvar::group& _setgroup, button_mapping& _buttons,
controller_state& _controls, settingvar::cache& _setcache, button_mapping& _buttons,
emulator_dispatch& _edispatch, input_queue& _iqueue, loaded_rom& _rom, status_updater& _supdater);
~project_state();
/**
@ -232,7 +232,7 @@ private:
memwatch_set& mwatch;
command::group& command;
controller_state& controls;
settingvar::group& setgroup;
settingvar::cache& setcache;
button_mapping& buttons;
emulator_dispatch& edispatch;
input_queue& iqueue;

View file

@ -4,7 +4,6 @@
#include "library/exrethrow.hpp"
#include "library/keyboard.hpp"
#include "library/threads.hpp"
#include <functional>
#include <deque>
namespace command

View file

@ -1,7 +1,6 @@
#ifndef _romimage__hpp__included__
#define _romimage__hpp__included__
#include <functional>
#include "core/rom-small.hpp"
#include "interface/romtype.hpp"
#include "library/fileimage.hpp"

View file

@ -5,10 +5,4 @@
extern settingvar::set lsnes_setgrp;
extern settingvar::supervariable<settingvar::model_path> SET_rompath;
extern settingvar::supervariable<settingvar::model_path> SET_moviepath;
extern settingvar::supervariable<settingvar::model_path> SET_firmwarepath;
extern settingvar::supervariable<settingvar::model_path> SET_slotpath;
#endif

View file

@ -51,7 +51,6 @@ THE SOFTWARE.
* - If you only have one region, use ID of 0 for that and GET_REGION/SET_REGION are not needed.
*/
#include <unistd.h>
#include <stdint.h>
#include <time.h>
@ -213,7 +212,7 @@ struct lsnes_core_fontrender_req
//Input: Text to render (UTF-8).
const char* text;
//Input: Length of text in bytes. If negative, text is null-terminated.
ssize_t text_len;
long text_len;
//Input: Bytes per pixel to request. Can be 1, 2, 3 or 4.
unsigned bytes_pp;
//Input: Foreground color (native endian).

View file

@ -26,7 +26,6 @@ public:
void render(fb<false>& fb, int32_t x, int32_t y, color fg, color bg, color hl) const;
void render(fb<true>& fb, int32_t x, int32_t y, color fg, color bg, color hl) const;
void render(uint8_t* buf, size_t stride, uint32_t u, uint32_t v, uint32_t w, uint32_t h) const;
void dump(std::ostream& s) const;
};
font2();
font2(const std::string& file);
@ -39,7 +38,6 @@ public:
std::pair<uint32_t, uint32_t> get_metrics(const std::u32string& str, uint32_t xalign) const;
void for_each_glyph(const std::u32string& str, uint32_t xalign, std::function<void(uint32_t x, uint32_t y,
const glyph& g)> cb) const;
void dump(const std::string& file) const;
private:
std::map<std::u32string, glyph> glyphs;
unsigned rowadvance;

View file

@ -1,7 +1,6 @@
#ifndef _library__gamepad__hpp__included__
#define _library__gamepad__hpp__included__
#include <functional>
#include <cstdint>
#include <set>
#include "json.hpp"

View file

@ -6,7 +6,6 @@
#include <cstdlib>
#include <map>
#include <string>
#include <functional>
#include "threads.hpp"
class http_request
@ -120,7 +119,7 @@ public:
/**
* Get final code.
*/
uint32_t get_http_code();
long get_http_code();
private:
static int progress(void* userdata, double dltotal, double dlnow, double ultotal, double ulnow);
int _progress(double dltotal, double dlnow, double ultotal, double ulnow);
@ -146,7 +145,7 @@ struct http_async_request
int64_t final_dl; //Final amount downloaded (OUTPUT).
int64_t final_ul; //Final amound uploaded (OUTPUT).
std::string errormsg; //Final error (OUTPUT).
uint32_t http_code; //HTTP error code (OUTPUT).
long http_code; //HTTP error code (OUTPUT).
volatile bool finished; //Finished flag (semi-transient).
threads::cv finished_cond; //This condition variable is fired on finish.
http_request* req; //The HTTP request object (TRANSIENT).

View file

@ -40,9 +40,4 @@ private:
char v[3];
};
template<typename T> struct is_ss_int24 { const static bool flag = false; };
template<> struct is_ss_int24<ss_uint24_t> { const static bool flag = true; };
template<> struct is_ss_int24<ss_int24_t> { const static bool flag = true; };
#endif

View file

@ -1,13 +1,16 @@
#ifndef _library__loadlib__hpp__included__
#define _library__loadlib__hpp__included__
#include <functional>
#include <string>
#include <stdexcept>
#include <map>
#include <set>
#include "threads.hpp"
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#endif
namespace loadlib
{
threads::lock& global_mutex();
@ -114,7 +117,11 @@ private:
void* operator[](const std::string& symbol) const throw(std::bad_alloc, std::runtime_error);
internal(const internal&);
internal& operator=(const internal&);
#if defined(_WIN32) || defined(_WIN64)
HMODULE handle;
#elif !defined(NO_DLFCN)
void* handle;
#endif
size_t refs;
std::string libname;
void mark(const void* obj) { marked.insert(obj); }

View file

@ -13,7 +13,6 @@
#include <cassert>
#include "string.hpp"
#include "utf8.hpp"
#include "int24.hpp"
#include "lua-version.hpp"
namespace lua
@ -514,7 +513,7 @@ public:
int toboolean(int index) { return lua_toboolean(lua_handle, index); }
const char* tolstring(int index, size_t *len) { return lua_tolstring(lua_handle, index, len); }
lua_Number tonumber(int index) { return lua_tonumber(lua_handle, index); }
int64_t tointeger(int index) { return LUA_INTEGER_POSTFIX(lua_to) (lua_handle, index); }
uint64_t tointeger(int index) { return LUA_INTEGER_POSTFIX(lua_to) (lua_handle, index); }
void gettable(int index) { lua_gettable(lua_handle, index); }
int load(lua_Reader reader, void* data, const char* chunkname, const char* mode) {
(void)mode;
@ -542,14 +541,16 @@ public:
void rawgeti(int index, int n) { lua_rawgeti(lua_handle, index, n); }
template<typename T> void pushnumber(T val)
{
if(std::numeric_limits<T>::is_integer || is_ss_int24<T>::flag)
return LUA_INTEGER_POSTFIX(lua_push) (lua_handle, val);
if(std::numeric_limits<T>::is_integer)
_pushinteger(val);
else
return lua_pushnumber(lua_handle, val);
_pushnumber(val);
}
void pushboolean(bool b) { lua_pushboolean(lua_handle, b); }
void pushglobals() { LUA_LOADGLOBALS }
private:
void _pushnumber(lua_Number n) { return lua_pushnumber(lua_handle, n); }
void _pushinteger(uint64_t n) { return LUA_INTEGER_POSTFIX(lua_push) (lua_handle, n); }
static void builtin_oom();
static void builtin_soft_oom(int status);
static void* builtin_alloc(void* user, void* old, size_t olds, size_t news);

View file

@ -1,7 +1,6 @@
#ifndef _library__lua_class__hpp__included__
#define _library__lua_class__hpp__included__
#include <functional>
#include "lua-base.hpp"
#include "lua-pin.hpp"

View file

@ -1,8 +1,6 @@
#ifndef _library__lua_function__hpp__included__
#define _library__lua_function__hpp__included__
#include <functional>
namespace lua
{
class parameters;

View file

@ -1,7 +1,6 @@
#ifndef _library__memorywatch_fb__hpp__included__
#define _library__memorywatch_fb__hpp__included__
#include <functional>
#include "framebuffer.hpp"
#include "memorywatch.hpp"
#include "mathexpr.hpp"

View file

@ -2,7 +2,6 @@
#define _library__memorywatch__hpp__included__
#include "mathexpr.hpp"
#include <functional>
#include <list>
#include <set>
#include <map>

View file

@ -1243,10 +1243,6 @@ public:
* Find subframe number corresponding to given frame (1-based).
*/
int64_t find_frame(uint64_t n);
/**
* Find frame number corresponding to given subframe (0-based).
*/
int64_t subframe_to_frame(uint64_t n);
/**
* Notify sync flag polarity change.
*

View file

@ -1,7 +1,6 @@
#ifndef _library__string__hpp__included__
#define _library__string__hpp__included__
#include <functional>
#include <string>
#include <sstream>
#include <set>
@ -266,11 +265,6 @@ bool regex_match(const std::string& regex, const std::string& str, enum regex_ma
*/
int string_to_bool(const std::string& cast_to_bool);
template<typename T> T raw_lexical_cast(const std::string& value)
{
return boost::lexical_cast<T>(value);
}
/**
* \brief Typeconvert string.
*/
@ -321,7 +315,7 @@ template<typename T> inline T parse_value(const std::string& value) throw(std::b
}
return val;
}
return raw_lexical_cast<T>(value);
return boost::lexical_cast<T>(value);
} catch(std::exception& e) {
throw std::runtime_error("Can't parse value '" + value + "': " + e.what());
}

View file

@ -1,7 +1,6 @@
#ifndef _library_triplebuffer__hpp__included__
#define _library_triplebuffer__hpp__included__
#include <functional>
#include <stdexcept>
#include "threads.hpp"
@ -46,12 +45,6 @@ public:
* Throws std::logic_error: If write count is 0.
*/
void put_write() throw(std::logic_error);
/**
* Call specified function synchronously for last written buffer.
*
* The buffer number is passed to specified function.
*/
void read_last_write_synchronous(std::function<void(unsigned)> fn) throw();
private:
threads::lock lock;
unsigned last_complete; //Number of last completed buffer
@ -110,15 +103,6 @@ public:
* Throws std::logic_error: If write count is 0.
*/
void put_write() throw(std::logic_error) { l.put_write(); }
/**
* Call specified function synchronously for last written buffer.
*
* The buffer itself is passed to the function.
*/
void read_last_write_synchronous(std::function<void(T&)> fn) throw()
{
l.read_last_write_synchronous([this,fn](unsigned x){ fn(*objs[x]); });
}
private:
T* objs[3];
logic l;

View file

@ -145,12 +145,12 @@ public:
/**
* This iterator iterates members of ZIP archive in forward order.
*/
typedef iterator_class<std::map<std::string, uint64_t>::iterator, std::string> iterator;
typedef iterator_class<std::map<std::string, unsigned long long>::iterator, std::string> iterator;
/**
* This iterator iterates members of ZIP archive in reverse order
*/
typedef iterator_class<std::map<std::string, uint64_t>::reverse_iterator, std::string>
typedef iterator_class<std::map<std::string, unsigned long long>::reverse_iterator, std::string>
riterator;
/**
@ -278,7 +278,7 @@ public:
private:
reader(reader&);
reader& operator=(reader&);
std::map<std::string, uint64_t> offsets;
std::map<std::string, unsigned long long> offsets;
std::ifstream* zipstream;
size_t* refcnt;
};
@ -421,10 +421,10 @@ public:
private:
struct file_info
{
uint32_t crc;
uint32_t uncompressed_size;
uint32_t compressed_size;
uint32_t offset;
unsigned long crc;
unsigned long uncompressed_size;
unsigned long compressed_size;
unsigned long offset;
};
writer(writer&);

View file

@ -9,7 +9,6 @@
#include "library/lua-class.hpp"
#include "library/lua-params.hpp"
#include "library/framebuffer.hpp"
#include "library/range.hpp"
#include "library/threads.hpp"
#include "library/string.hpp"
@ -56,14 +55,11 @@ struct lua_bitmap
int pset(lua::state& L, lua::parameters& P);
int pget(lua::state& L, lua::parameters& P);
int size(lua::state& L, lua::parameters& P);
int hflip(lua::state& L, lua::parameters& P);
int vflip(lua::state& L, lua::parameters& P);
int hash(lua::state& L, lua::parameters& P);
template<bool scaled, bool porterduff> int blit(lua::state& L, lua::parameters& P);
template<bool scaled> int blit_priority(lua::state& L, lua::parameters& P);
int save_png(lua::state& L, lua::parameters& P);
int _save_png(lua::state& L, lua::parameters& P, bool is_method);
int sample_texture(lua::state& L, lua::parameters& P);
};
struct lua_dbitmap
@ -83,14 +79,11 @@ struct lua_dbitmap
int pset(lua::state& L, lua::parameters& P);
int pget(lua::state& L, lua::parameters& P);
int size(lua::state& L, lua::parameters& P);
int hflip(lua::state& L, lua::parameters& P);
int vflip(lua::state& L, lua::parameters& P);
int hash(lua::state& L, lua::parameters& P);
template<bool scaled, bool porterduff> int blit(lua::state& L, lua::parameters& P);
int save_png(lua::state& L, lua::parameters& P);
int adjust_transparency(lua::state& L, lua::parameters& P);
int _save_png(lua::state& L, lua::parameters& P, bool is_method);
int sample_texture(lua::state& L, lua::parameters& P);
};
struct lua_loaded_bitmap
@ -106,75 +99,5 @@ struct lua_loaded_bitmap
template<bool png> static int load_str(lua::state& L, lua::parameters& P);
};
template<bool T> class lua_bitmap_holder
{
public:
lua_bitmap_holder(lua_bitmap& _b, lua_palette& _p) : b(_b), p(_p) {};
size_t stride() { return b.width; }
void lock()
{
p.palette_mutex.lock();
palette = p.colors;
pallim = p.color_count;
}
void unlock()
{
p.palette_mutex.unlock();
}
void draw(size_t bmpidx, typename framebuffer::fb<T>::element_t& target)
{
uint16_t i = b.pixels[bmpidx];
if(i < pallim)
palette[i].apply(target);
}
private:
lua_bitmap& b;
lua_palette& p;
framebuffer::color* palette;
size_t pallim;
};
template<bool T> class lua_dbitmap_holder
{
public:
lua_dbitmap_holder(lua_dbitmap& _d) : d(_d) {};
size_t stride() { return d.width; }
void lock() {}
void unlock() {}
void draw(size_t bmpidx, typename framebuffer::fb<T>::element_t& target)
{
d.pixels[bmpidx].apply(target);
}
private:
lua_dbitmap& d;
};
template<bool T, class B> void lua_bitmap_composite(struct framebuffer::fb<T>& scr, int32_t xp,
int32_t yp, const range& X, const range& Y, const range& sX, const range& sY, bool outside, B bmp) throw()
{
if(!X.size() || !Y.size()) return;
size_t stride = bmp.stride();
bmp.lock();
for(uint32_t r = Y.low(); r != Y.high(); r++) {
typename framebuffer::fb<T>::element_t* rptr = scr.rowptr(yp + r);
size_t eptr = xp + X.low();
uint32_t xmin = X.low();
bool cut = outside && sY.in(r);
if(cut && sX.in(xmin)) {
xmin = sX.high();
eptr += (sX.high() - X.low());
}
for(uint32_t c = xmin; c < X.high(); c++, eptr++) {
if(__builtin_expect(cut && c == sX.low(), 0)) {
c += sX.size();
eptr += sX.size();
}
bmp.draw(r * stride + c, rptr[eptr]);
}
}
bmp.unlock();
}
#endif

View file

@ -17,7 +17,7 @@ void render_halo(unsigned char* pixmap, size_t width, size_t height);
* Blit a bitmap to screen.
*/
template<bool X> void halo_blit(struct framebuffer::fb<X>& scr, unsigned char* pixmap, size_t width,
size_t height, size_t owidth, size_t oheight, uint32_t x, uint32_t y, framebuffer::color& bg,
framebuffer::color& fg, framebuffer::color& hl) throw();
size_t height, uint32_t x, uint32_t y, framebuffer::color& bg, framebuffer::color& fg, framebuffer::color& hl)
throw();
#endif

View file

@ -19,10 +19,8 @@ namespace keyboard { class key; }
#define LUA_TIMED_HOOK_IDLE 0
#define LUA_TIMED_HOOK_TIMER 1
class emulator_instance;
void init_lua(emulator_instance& inst) throw();
void quit_lua(emulator_instance& inst) throw();
void init_lua() throw();
void quit_lua() throw();
struct lua_state
{

View file

@ -2,7 +2,6 @@
#define _plat_wxwidgets__menu_branches__hpp__included__
#include "core/dispatch.hpp"
#include <functional>
#include <wx/string.h>
#include <wx/wx.h>
#include <map>

View file

@ -1,7 +1,6 @@
#ifndef _plat_wxwidgets__menu_loadrom__hpp__included__
#define _plat_wxwidgets__menu_loadrom__hpp__included__
#include <functional>
#include <wx/string.h>
#include <wx/wx.h>
#include "interface/romtype.hpp"

View file

@ -3,7 +3,6 @@
#include "core/dispatch.hpp"
#include "library/recentfiles.hpp"
#include <functional>
#include <wx/string.h>
#include <wx/wx.h>
#include <map>

View file

@ -2,7 +2,6 @@
#define _plat_wxwidgets__menu_tracelog__hpp__included__
#include "core/dispatch.hpp"
#include <functional>
#include <wx/string.h>
#include <wx/wx.h>
#include <map>

View file

@ -11,7 +11,6 @@
#include "core/window.hpp"
#include "library/threads.hpp"
#include <functional>
#include <cstdlib>
#include <cstdint>
#include <cstddef>

View file

@ -1,7 +1,6 @@
#ifndef _platform__wxwidgets__settings_common__hpp__included__
#define _platform__wxwidgets__settings_common__hpp__included__
#include <functional>
#include <string>
#include "platform/wxwidgets/platform.hpp"
#include <wx/wx.h>

556
lua.lyx
View file

@ -1,9 +1,7 @@
#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
@ -11,16 +9,16 @@
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
@ -135,10 +133,6 @@ Drawing and contexts
Methods that draw something (unless stated otherwise) require a valid rendering
context.
This context can come in three ways:
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -181,10 +175,6 @@ Non-negative numbers less than
\end_inset
)
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -205,10 +195,6 @@ Non-negative numbers less than
\end_inset
would be fully transparent.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -330,10 +316,6 @@ n4 steelblue steelblue1 steelblue2 steelblue3 steelblue4 tan tan1 tan2 tan3
\begin_layout Itemize
The HSL base color names: hsl-<hue><saturation><lightness>.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -357,10 +339,6 @@ The color names can have a modifier after space (multiple modifiers are
allowed, separated by spaces): opaque10, opaque20, opaque25, opaque30,
opaque40, opaque50, opaque60, opaque70, opaque75, opaque80, opaque90, opaque,
hue{+,-}{1-23}, {saturation,lightness}{+,-}{1-16}.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -473,10 +451,6 @@ addrobj: ADDRESS: The memory address.
\begin_layout Itemize
type: String: The type of data to map.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -1399,10 +1373,6 @@ Load a palette from file <file> (resolved relative to <base>).
\begin_layout Itemize
The file format is a series of lines, each with following format:
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -1917,10 +1887,6 @@ h: number: The height of area to blit.
\begin_layout Itemize
ck: number: The color key.
Pixels with this index are not copied.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -1995,10 +1961,6 @@ vscl: number: Vertical scale factor (integer).
\begin_layout Itemize
ck: number: The color key.
Pixels with this index are not copied.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -2062,10 +2024,6 @@ h: number: The height of area to blit.
\begin_layout Itemize
operator: string: The operator to use.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -2146,10 +2104,6 @@ vscl: number: Vertical scale factor (integer).
\begin_layout Itemize
operator: string: The operator to use.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -2367,85 +2321,6 @@ Hashes bitmap <bitmap> and returns crypto-strong hash.
Color order in bitmap is significant.
\end_layout
\begin_layout Subsubsection
Method sample_texture: Sample a texture
\end_layout
\begin_layout Itemize
Syntax: none bitmap:sample_texture(BITMAP source, number xx, number xy,
number x0, number yx, number yy, number y0, number scale, boolean wrap)
\end_layout
\begin_layout Standard
Parameters:
\end_layout
\begin_layout Itemize
source: BITMAP: The bitmap to sample
\end_layout
\begin_layout Itemize
xx: number: s times the source x coefficient of target x axis.
\end_layout
\begin_layout Itemize
xy: number: s times the source y coefficient of target x axis.
\end_layout
\begin_layout Itemize
x0: number: s times the target x axis offset.
\end_layout
\begin_layout Itemize
yx: number: s times the source x coefficient of target y axis.
\end_layout
\begin_layout Itemize
yy: number: s times the source y coefficient of target y axis.
\end_layout
\begin_layout Itemize
y0: number: s times the target y axis offset.
\end_layout
\begin_layout Itemize
s: number: Scale of coordinates
\end_layout
\begin_layout Itemize
wrap: boolean: If true, wrap the texture.
If false, read outside the texture as color 0.
\end_layout
\begin_layout Standard
Samples the source as texture, performing linear transform (with nearest-neighbo
r sampling) and writes the result to this bitmap.
\end_layout
\begin_layout Subsubsection
Method hflip: Horizontally flip a bitmap
\end_layout
\begin_layout Itemize
Syntax: none bitmap:hflip()
\end_layout
\begin_layout Standard
Horizontally flips a bitmap.
\end_layout
\begin_layout Subsubsection
Method vflip: Vertically flip a bitmap
\end_layout
\begin_layout Itemize
Syntax: none bitmap:vflip()
\end_layout
\begin_layout Standard
Vertically flips a bitmap.
\end_layout
\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset
@ -2777,10 +2652,6 @@ h: number: The height of area to blit.
\begin_layout Itemize
ck: number: The color key.
Pixels with this index are not copied.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -2868,10 +2739,6 @@ vscl: number: Vertical scale factor (integer).
\begin_layout Itemize
ck: number: The color key.
Pixels with this index are not copied.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -2947,10 +2814,6 @@ h: number: The height of area to blit.
\begin_layout Itemize
operator: string: The operator to use.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -3042,10 +2905,6 @@ vscl: number: Vertical scale factor (integer).
\begin_layout Itemize
operator: string: The operator to use.
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -3165,92 +3024,6 @@ hash: string: 64-hex digit hash
\begin_layout Standard
Hashes bitmap <bitmap> and returns crypto-strong hash.
\end_layout
\begin_layout Subsubsection
Method sample_texture: Sample a texture
\end_layout
\begin_layout Itemize
Syntax: none bitmap:sample_texture(BITMAP source, number xx, number xy,
number x0, number yx, number yy, number y0, number scale, boolean wrap)
\end_layout
\begin_layout Standard
Parameters:
\end_layout
\begin_layout Itemize
source: BITMAP: The bitmap to sample
\end_layout
\begin_layout Itemize
xx: number: s times the source x coefficient of target x axis.
\end_layout
\begin_layout Itemize
xy: number: s times the source y coefficient of target x axis.
\end_layout
\begin_layout Itemize
x0: number: s times the target x axis offset.
\end_layout
\begin_layout Itemize
yx: number: s times the source x coefficient of target y axis.
\end_layout
\begin_layout Itemize
yy: number: s times the source y coefficient of target y axis.
\end_layout
\begin_layout Itemize
y0: number: s times the target y axis offset.
\end_layout
\begin_layout Itemize
s: number: Scale of coordinates
\end_layout
\begin_layout Itemize
wrap: boolean: If true, wrap the texture.
If false, read outside the texture as color 0.
\end_layout
\begin_layout Standard
Samples the source as texture, performing linear transform (with nearest-neighbo
r sampling) and writes the result to this bitmap.
\end_layout
\begin_layout Subsubsection
Method hflip: Horizontally flip a bitmap
\end_layout
\begin_layout Itemize
Syntax: none dbitmap:hflip()
\end_layout
\begin_layout Standard
Horizontally flips a bitmap.
\end_layout
\begin_layout Subsubsection
Method vflip: Vertically flip a bitmap
\end_layout
\begin_layout Itemize
Syntax: none dbitmap:vflip()
\end_layout
\begin_layout Standard
Vertically flips a bitmap.
\end_layout
\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset
\end_layout
\begin_layout Subsection
@ -3577,7 +3350,7 @@ Method edit: Alter glyph in font
\end_layout
\begin_layout Itemize
Syntax: font:edit(string character, bitmap glyph)
Syntax: font:edit(character, glyph)
\end_layout
\begin_layout Standard
@ -3614,31 +3387,6 @@ Color index 0 is background, everything else is foreground.
ligature.
\end_layout
\begin_layout Subsubsection
Method dump: Dump font into file
\end_layout
\begin_layout Itemize
Syntax: font:dump(string filename[, string base])
\end_layout
\begin_layout Standard
Parameters:
\end_layout
\begin_layout Itemize
filename: string: The file to dump to
\end_layout
\begin_layout Itemize
base: string: The base filename
\end_layout
\begin_layout Standard
Dump contents of <font> in file <filename> (resolved relative to <base>).
The dump is in format CUSTOMFONT:load() can load.
\end_layout
\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset
@ -3731,10 +3479,6 @@ unconvered: number: Number of bytes that were not converted (only if <success>
\begin_layout Itemize
error: string: Error that caused conversion to stop (only if <success> is
false).
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -4352,19 +4096,11 @@ Calls function <fun> with function and specified arguments.
\begin_layout LyX-Code
on_paint = loopwrapper(function(wait)
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
\begin_layout LyX-Code
while true do
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -4547,51 +4283,6 @@ Handy for paint callback if one is using render queues updated in other
handle = callback.paint:register(render_queue_function(my_rq));
\end_layout
\begin_layout Subsection
get_directory_contents: Get files in directory
\end_layout
\begin_layout Itemize
Syntax: table get_directory_contents(string name[, string base[, string
pattern]])
\end_layout
\begin_layout Standard
Return array containg all files in specified directory <name> (relative
to <base>).
If <pattern> is specified, the filenames are matched to specified regex.
The returned filenames inherit path.
\end_layout
\begin_layout Subsection
get_file_type: Get type of file
\end_layout
\begin_layout Itemize
Syntax: string/nil get_file_type(string path)
\end_layout
\begin_layout Standard
Return type of file <path>.
Currently possible return values are:
\end_layout
\begin_layout Itemize
regular: regular file
\end_layout
\begin_layout Itemize
directory: subdirectory
\end_layout
\begin_layout Itemize
unknown: Exists, but type not known (not anything above).
\end_layout
\begin_layout Itemize
<nil>: File does not exist.
\end_layout
\begin_layout Subsection
identify_class: Identify class of object
\end_layout
@ -5123,10 +4814,6 @@ Set v' to <v>.
\begin_layout Enumerate
For each <q> q:
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -5173,50 +4860,6 @@ Multiply 32-bit numbers <a> and <b>.
bits.
\end_layout
\begin_layout Subsection
bit.fextract: Extract bit field
\end_layout
\begin_layout Itemize
Syntax: number bit.fextract(number value, number shift, number width)
\end_layout
\begin_layout Standard
Extract <width> bits starting from bit <shift> from number <value>.
This is more compact way to write
\begin_inset Formula $\left(value\gg shift\right)\&\left(2^{width}-1\right)$
\end_inset
.
\end_layout
\begin_layout Subsection
bit.bfields: Split number into bit fields
\end_layout
\begin_layout Itemize
Syntax: number...
bit.bfields(number v, number q...)
\end_layout
\begin_layout Standard
Split a number <v> into bitfields of <q> bits (in order, from least significant
towards more significant bits), with no padding in between.
\end_layout
\begin_layout Itemize
Eg.
number of form 0 bbbbb ggggg rrrrr can be decoded to its component fields
using r,g,b = bit.bfields(v, 5, 5, 5).
\end_layout
\begin_layout Itemize
Eg.
number of form x yyyyyyy w zzzzzzz can be decode to its component fields
using z, w, y, x = bit.bfields(v, 7, 1, 7, 1).
\end_layout
\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset
@ -6082,10 +5725,6 @@ button_count (number): Number of buttons on controller
\begin_layout Itemize
buttons (array): Array of following info about each button:
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -6242,10 +5881,6 @@ Returns table of tables of all available keys and axes.
\begin_layout Itemize
value: Last reported value for control
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
@ -6999,25 +6634,6 @@ Returns starting subframe of given frame (frame numbers are 1-based).
Returns -1 if frame number is bad.
\end_layout
\begin_layout Subsection
movie.subframe_to_frame/INPUTMOVIE::subframe_to_frame: Find frame corresponding
to subframe
\end_layout
\begin_layout Itemize
Syntax: number movie.subframe_to_frame([INPUTMOVIE/string movie], number
subframe)
\end_layout
\begin_layout Itemize
Syntax: number INPUTMOVIE::subframe_to_frame(number subframe)
\end_layout
\begin_layout Standard
Returns frame containing given subframe (subframe numbers are 0-based).
Returns -1 if subframe number is bad.
\end_layout
\begin_layout Subsection
movie.blank_frame/INPUTMOVIE::blank_frame: Return a blank frame
\end_layout
@ -8512,105 +8128,6 @@ zip.writer: Class ZIPWRITER
See class ZIPWRITER.
\end_layout
\begin_layout Section
Table paths
\end_layout
\begin_layout Subsection
paths.get_executable_file: Get the name of lsnes executable file
\end_layout
\begin_layout Itemize
Syntax: String paths.get_executable_file()
\end_layout
\begin_layout Standard
Returns the filename of the lsnes executable (together with path), if known.
If unknown, returns nil.
\end_layout
\begin_layout Subsection
paths.get_executable_path: Get the path of lsnes executable file
\end_layout
\begin_layout Itemize
Syntax: String paths.get_executable_path()
\end_layout
\begin_layout Standard
Returns the directory of the lsnes executable path, if known.
If unknown, returns nil.
\end_layout
\begin_layout Subsection
paths.get_config_path: Get the path of lsnes config file
\end_layout
\begin_layout Itemize
Syntax: String paths.get_config_path()
\end_layout
\begin_layout Standard
Returns the directory of the lsnes configuration.
\end_layout
\begin_layout Subsection
paths.get_rompath: Get the path of ROM files
\end_layout
\begin_layout Itemize
Syntax: String paths.get_rompath()
\end_layout
\begin_layout Standard
Returns the default directory for various ROMs.
\end_layout
\begin_layout Subsection
paths.get_firmwarepath: Get the path of firmware files
\end_layout
\begin_layout Itemize
Syntax: String paths.get_firmwarepath()
\end_layout
\begin_layout Standard
Returns the default directory for various firmwares.
\end_layout
\begin_layout Subsection
paths.get_slotpath: Get the path of save slot files
\end_layout
\begin_layout Itemize
Syntax: String paths.get_slotpath()
\end_layout
\begin_layout Standard
Returns the default directory for various save slots.
If in project context, returns the project directory.
\end_layout
\begin_layout Subsection
paths.get_save_slot_file: Get save slot filename
\end_layout
\begin_layout Itemize
Syntax: String paths.get_slotpath(string name)
\end_layout
\begin_layout Itemize
Syntax: String paths.get_slotpath(integer slotnum, bool for_save)
\end_layout
\begin_layout Standard
Resolve the filename of specified save slot <name> or <slotnum>.
Projects and save branches are taken into account.
If <for_save> is true, the filename is always for current branch.
If <for_save> is false, branch tree is walked upwards until root is reached
or desired file is located.
\end_layout
\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset
@ -8629,7 +8146,7 @@ Various callback-related functions.
\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "subsec:callback.register:-Register-a"
name "sub:callback.register:-Register-a"
\end_inset
@ -8666,7 +8183,7 @@ paint
\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "subsec:callback.unregister:-Unregister-"
name "sub:callback.unregister:-Unregister-"
\end_inset
@ -8694,7 +8211,7 @@ Syntax: function callback.<cbname>:register(function cbfun)
Synonym for callback.register (section
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:callback.register:-Register-a"
reference "sub:callback.register:-Register-a"
\end_inset
@ -8713,7 +8230,7 @@ Syntax: function callback.<cbname>:unregister(function cbfun)
Synonym for callback.unregister (section
\begin_inset CommandInset ref
LatexCommand ref
reference "subsec:callback.unregister:-Unregister-"
reference "sub:callback.unregister:-Unregister-"
\end_inset
@ -8752,37 +8269,13 @@ VRAM
<Stride> overrides row stride (default 512).
\end_layout
\begin_layout Subsection
bsnes.dump_sprite2: Dump a 2bpp sprite
\end_layout
\begin_layout Itemize
Syntax: BITMAP bsnes.dump_sprite2(string marea, number addr, number width,
number height[, number stride])
\end_layout
\begin_layout Standard
Dumps given sprite (in 2bpp format) from memory.
memory area is usually
\begin_inset Quotes eld
\end_inset
VRAM
\begin_inset Quotes erd
\end_inset
.
<Width> and <height> are given in 8x8 blocks.
<Stride> overrides row stride (default 256).
\end_layout
\begin_layout Subsection
bsnes.dump_palette: Dump a palette
\end_layout
\begin_layout Itemize
Syntax: PALETTE bsnes.dump_palette(string marea, number addr, bool/integer
full256, bool first_trans)
Syntax: PALETTE bsnes.dump_palette(string marea, number addr, bool full256,
bool first_trans)
\end_layout
\begin_layout Standard
@ -8797,7 +8290,6 @@ CGRAM
.
If <full256> is true, 256 colors are dumped (otherwise 16).
<full256> can also be number of colors (4, 16 or 256).
If <first_trans> is true, first color is forced transparent.
\end_layout
@ -8827,20 +8319,6 @@ Like bsnes.dump_sprite, but instead dumps to specified bitmap <bitmap>.
The specified bitmap must have size multiple of 8x8.
\end_layout
\begin_layout Subsection
bsnes.redump_sprite2: Redump a 2bpp sprite
\end_layout
\begin_layout Itemize
Syntax: none bsnes.redump_sprite2(BITMAP bitmap, string marea, number addr[,
number stride])
\end_layout
\begin_layout Standard
Like bsnes.dump_sprite2, but instead dumps to specified bitmap <bitmap>.
The specified bitmap must have size multiple of 8x8.
\end_layout
\begin_layout Subsection
bsnes.redump_palette: Redump a palette
\end_layout
@ -9300,10 +8778,6 @@ index: Index of button.
\begin_layout Itemize
type: Type of event, one of:
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper

BIN
lua.pdf

Binary file not shown.

View file

@ -1,30 +0,0 @@
{
"__mod":"BMODE",
"+make-autofire":[
"afp", "Make normal buttons autofire",
{"":"Make normal buttons autofire"},
{"":"Button modes‣Make autofire"}
],
"-make-autofire":[
"afn", "No longer make normal buttons autofire",
{"":"No longer make normal buttons autofire"}
],
"+make-autohold":[
"ahp", "Make normal buttons autohold",
{"":"Make normal buttons autofire"},
{"":"Button modes‣Make autohold"}
],
"-make-autohold":[
"ahn", "No longer make normal buttons autohold",
{"":"No longer make normal buttons autohold"}
],
"+make-typed":[
"atp", "Make normal buttons typed",
{"":"Make normal buttons typed"},
{"":"Button modes‣Make typed"}
],
"-make-typed":[
"atn", "No longer make normal buttons typed",
{"":"No longer make normal buttons typed"}
]
}

View file

@ -1,12 +1,12 @@
{
"__mod":"CCOMMENTARY",
"+tangent":[
"p", "Voice tangent enage (start recording)",
{"":"Start recording audio for commentary track item (creating new item)."},
"p", "Voice tangent enage",
{"":"Voice tangent enage"},
{"":"Movie‣Voice tangent"}
],
"-tangent":[
"r", "Voice tangent disenage (stop recording)",
{"":"Stop recording audio for commentary track item (finishing the item)."}
"r", "Voice tangent disenage",
{"":"Voice tangent disenage."}
]
}

View file

@ -162,8 +162,7 @@
],
"flush-slotinfo":[
"flushslots", "Flush slotinfo cache",
{"":"Flush slotinfo cache"},
{"":"Save‣Flush slotinfo cache"}
{"":"Flush slotinfo cache"}
],
"load-rom":[
"lrom", "Load specified ROM",
@ -171,12 +170,10 @@
],
"reload-rom":[
"rlrom", "Reload the current ROM",
{"":"Reload the currently loaded ROM from disk"},
{"":"Movie‣Reload the current ROM"}
{"":"Reload the currently loaded ROM from disk"}
],
"close-rom":[
"clrom", "Close the current ROM",
{"":"Close the currentloy loaded ROM and return to null core"},
{"":"Movie‣Close current ROM"}
{"":"Close the currentloy loaded ROM and return to null core"}
]
}

View file

@ -31,15 +31,5 @@
"3.0":"Speed‣Set 3x speed",
"10.0":"Speed‣Set 10x speed",
"turbo":"Speed‣Set turbo speed"}
],
"increase-speed":[
"inc", "Increase speed",
{"":"Increase emulation speed."},
{"":"Speed‣Increase speed"}
],
"decrease-speed":[
"dec", "Decrease speed",
{"":"Decrease emulation speed."},
{"":"Speed‣Decrease speed"}
]
}

View file

@ -5,7 +5,6 @@
#include "library/string.hpp"
#include "lua/lua.hpp"
#include <functional>
#include <map>
#include <string>

View file

@ -13,20 +13,15 @@
#include <iostream>
#include <unistd.h>
#include <sys/time.h>
#include <set>
#define MUSIC_BUFFERS 8
#define MAX_VOICE_ADJUST 200
namespace
{
std::set<audioapi_instance*> instances;
threads::lock instances_lock;
unsigned current_rrate = 0;
unsigned current_prate = 0;
void dummy_init() throw()
{
lsnes_instance.audio->voice_rate(0, 0);
}
void dummy_quit() throw()
@ -122,52 +117,3 @@ const char* audioapi_driver_name() throw()
{
return driver.name();
}
void audioapi_connect_instance(audioapi_instance& instance)
{
threads::alock h(instances_lock);
instance.voice_rate(current_rrate, current_prate);
instances.insert(&instance);
}
void audioapi_disconnect_instance(audioapi_instance& instance)
{
threads::alock h(instances_lock);
instance.voice_rate(0, 0);
instances.erase(&instance);
}
void audioapi_send_rate_change(unsigned rrate, unsigned prate)
{
threads::alock h(instances_lock);
current_rrate = rrate;
current_prate = prate;
for(auto i: instances)
i->voice_rate(current_rrate, current_prate);
}
void audioapi_get_mixed(int16_t* samples, size_t count, bool stereo)
{
size_t tcount = count * (stereo ? 2 : 1);
threads::alock h(instances_lock);
int32_t mixbuf[tcount];
memset(mixbuf, 0, sizeof(mixbuf[0]) * tcount);
//Collect all samples.
for(auto i: instances) {
int16_t tmp[tcount];
i->get_mixed(tmp, count, stereo);
for(size_t i = 0; i < tcount; i++)
mixbuf[i] += (int32_t)tmp[i];
}
//Downcast result with saturation.
for(size_t i = 0; i < tcount; i++)
samples[i] = (int16_t)clip(mixbuf[i], -32768, 32767);
}
void audioapi_put_voice(float* samples, size_t count)
{
threads::alock h(instances_lock);
//Broadcast to all instances.
for(auto i: instances)
i->put_voice(samples, count);
}

View file

@ -106,7 +106,6 @@ exit:
audioapi_instance::audioapi_instance()
: dummyproc(*this)
{
dummythread = NULL;
music_ptr = 0;
last_complete_music_seen = MUSIC_BUFFERS + 1;
last_complete_music = MUSIC_BUFFERS;

View file

@ -2,7 +2,6 @@
#include "cmdhelp/button.hpp"
#include "cmdhelp/macro.hpp"
#include "cmdhelp/buttonmode.hpp"
#include "core/command.hpp"
#include "core/controller.hpp"
#include "core/dispatch.hpp"
@ -44,13 +43,7 @@ button_mapping::button_mapping(controller_state& _controls, keyboard::mapper& _m
button_ap(cmd, CBUTTON::ap, [this](const std::string& a) { this->do_autofire_action(a, 1); }),
button_ar(cmd, CBUTTON::ar, [this](const std::string& a) { this->do_autofire_action(a, 0); }),
button_at(cmd, CBUTTON::at, [this](const std::string& a) { this->do_autofire_action(a, -1); }),
button_a(cmd, CBUTTON::a, [this](const std::string& a) { this->do_analog_action(a); }),
afire_p(cmd, BMODE::afp, [this]() { this->promote_autofire = true; }),
afire_n(cmd, BMODE::afn, [this]() { this->promote_autofire = false; }),
ahold_p(cmd, BMODE::ahp, [this]() { this->promote_autohold = true; }),
ahold_n(cmd, BMODE::ahn, [this]() { this->promote_autohold = false; }),
typed_p(cmd, BMODE::atp, [this]() { this->promote_typed = true; }),
typed_n(cmd, BMODE::atn, [this]() { this->promote_typed = false; })
button_a(cmd, CBUTTON::a, [this](const std::string& a) { this->do_analog_action(a); })
{
ncore.set(notify_new_core, [this]() { this->init(); });
}
@ -395,22 +388,14 @@ void button_mapping::do_button_action(const std::string& name, short newstate, i
auto x = active_buttons[name];
if(x.bind.mode != 0)
return;
if(mode == 0 && newstate == 1 && promote_autofire) {
this->do_autofire_action(name, -1);
}
if(mode == 1 || (mode == 0 && promote_autohold && newstate == 1)) {
if(mode == 1) {
//Autohold.
int16_t nstate = controls.autohold2(x.port, x.controller, x.bind.control1) ^ newstate;
if(lua2.callback_do_button(x.port, x.controller, x.bind.control1, nstate ? "hold" : "unhold"))
return;
controls.autohold2(x.port, x.controller, x.bind.control1, nstate);
edispatch.autohold_update(x.port, x.controller, x.bind.control1, nstate);
if(nstate)
messages << "Holding " << name << std::endl;
else
messages << "Not holding " << name << std::endl;
}
if(mode == 2 || (mode == 0 && promote_typed && newstate == 1)) {
} else if(mode == 2) {
//Framehold.
bool nstate = controls.framehold2(x.port, x.controller, x.bind.control1) ^ newstate;
if(lua2.callback_do_button(x.port, x.controller, x.bind.control1, nstate ? "type" : "untype"))
@ -420,8 +405,7 @@ void button_mapping::do_button_action(const std::string& name, short newstate, i
messages << "Holding " << name << " for the next frame" << std::endl;
else
messages << "Not holding " << name << " for the next frame" << std::endl;
}
if(mode == 0 && !promote_autohold && !promote_autofire && !promote_typed) {
} else {
if(lua2.callback_do_button(x.port, x.controller, x.bind.control1, newstate ? "press" :
"release"))
return;
@ -528,13 +512,11 @@ void button_mapping::do_autofire_action(const std::string& a, int mode)
return;
controls.autofire2(z.port, z.controller, z.bind.control1, duty, cyclelen);
edispatch.autofire_update(z.port, z.controller, z.bind.control1, duty, cyclelen);
messages << "Autofiring " << name << " (duty " << duty << "/" << cyclelen << ")" << std::endl;
} else if(mode == 0 || (mode == -1 && afire.first != 0)) {
//Turn off.
if(lua2.callback_do_button(z.port, z.controller, z.bind.control1, "autofire"))
return;
controls.autofire2(z.port, z.controller, z.bind.control1, 0, 1);
edispatch.autofire_update(z.port, z.controller, z.bind.control1, 0, 1);
messages << "Not autofiring " << name << std::endl;
}
}

View file

@ -10,7 +10,6 @@
#include "library/directory.hpp"
#include "library/memoryspace.hpp"
#include <functional>
#include <stdexcept>
#include <list>
#include <map>

View file

@ -30,19 +30,19 @@ joystick_driver::joystick_driver(_joystick_driver drv)
driver = drv;
}
void joystick_driver_init(bool soft) throw()
void joystick_driver_init() throw()
{
if(!soft) lsnes_gamepads_init();
lsnes_gamepads_init();
driver.init();
joystick_thread_handle = new threads::thread(joystick_thread, 6);
}
void joystick_driver_quit(bool soft) throw()
void joystick_driver_quit() throw()
{
driver.quit();
joystick_thread_handle->join();
joystick_thread_handle = NULL;
if(!soft) lsnes_gamepads_deinit();
lsnes_gamepads_deinit();
}
void joystick_driver_signal() throw()

View file

@ -7,7 +7,6 @@
#include "library/streamcompress.hpp"
#include "library/string.hpp"
#include <functional>
#include <fstream>
#include <boost/iostreams/categories.hpp>
#include <boost/iostreams/copy.hpp>

View file

@ -90,10 +90,10 @@ framebuffer::raw emu_framebuffer::screen_corrupt;
emu_framebuffer::emu_framebuffer(subtitle_commentary& _subtitles, settingvar::group& _settings, memwatch_set& _mwatch,
keyboard::keyboard& _keyboard, emulator_dispatch& _dispatch, lua_state& _lua2, loaded_rom& _rom,
status_updater& _supdater, command::group& _cmd, input_queue& _iqueue)
status_updater& _supdater, command::group& _cmd)
: buffering(buffer1, buffer2, buffer3), subtitles(_subtitles), settings(_settings), mwatch(_mwatch),
keyboard(_keyboard), edispatch(_dispatch), lua2(_lua2), rom(_rom), supdater(_supdater), cmd(_cmd),
iqueue(_iqueue), screenshot(cmd, CFRAMEBUF::ss, [this](command::arg_filename a) { this->do_screenshot(a); })
screenshot(cmd, CFRAMEBUF::ss, [this](command::arg_filename a) { this->do_screenshot(a); })
{
last_redraw_no_lua = false;
}
@ -170,8 +170,9 @@ void emu_framebuffer::redraw_framebuffer(framebuffer::raw& todraw, bool no_lua,
void emu_framebuffer::redraw_framebuffer()
{
framebuffer::raw copy;
buffering.read_last_write_synchronous([&copy](render_info& ri) { copy = ri.fbuf; });
render_info& ri = buffering.get_read();
framebuffer::raw copy = ri.fbuf;
buffering.put_read();
//Redraws are never spontaneous
redraw_framebuffer(copy, last_redraw_no_lua, false);
}
@ -185,19 +186,16 @@ void emu_framebuffer::render_framebuffer()
main_screen.copy_from(ri.fbuf, ri.hscl, ri.vscl);
ri.rq.run(main_screen);
//We would want divide by 2, but we'll do it ourselves in order to do mouse.
keyboard::key* mouse_x = keyboard.try_lookup_key("mouse_x");
keyboard::key* mouse_y = keyboard.try_lookup_key("mouse_y");
keyboard::mouse_calibration xcal;
keyboard::mouse_calibration ycal;
xcal.offset = ri.lgap;
ycal.offset = ri.tgap;
auto kbd = &keyboard;
iqueue.run_async([kbd, xcal, ycal]() {
keyboard::key* mouse_x = kbd->try_lookup_key("mouse_x");
keyboard::key* mouse_y = kbd->try_lookup_key("mouse_y");
if(mouse_x && mouse_x->get_type() == keyboard::KBD_KEYTYPE_MOUSE)
mouse_x->cast_mouse()->set_calibration(xcal);
if(mouse_y && mouse_y->get_type() == keyboard::KBD_KEYTYPE_MOUSE)
mouse_y->cast_mouse()->set_calibration(ycal);
}, [](std::exception& e){});
if(mouse_x && mouse_x->get_type() == keyboard::KBD_KEYTYPE_MOUSE)
mouse_x->cast_mouse()->set_calibration(xcal);
if(mouse_y && mouse_y->get_type() == keyboard::KBD_KEYTYPE_MOUSE)
mouse_y->cast_mouse()->set_calibration(ycal);
buffering.put_read();
}

View file

@ -15,7 +15,6 @@
#include <sys/time.h>
#include <unistd.h>
#include <limits>
#include <cmath>
bool graphics_driver_is_dummy();
@ -24,11 +23,8 @@ framerate_regulator::framerate_regulator(command::group& _cmd)
turbo_p(cmd, CTURBO::p, [this]() { this->turboed = true; }),
turbo_r(cmd, CTURBO::r, [this]() { this->turboed = false; }),
turbo_t(cmd, CTURBO::t, [this]() { this->turboed = !this->turboed; }),
setspeed_t(cmd, CTURBO::ss, [this](const std::string& args) { this->set_speed_cmd(args); }),
spd_inc(cmd, CTURBO::inc, [this]() { this->increase_speed(); }),
spd_dec(cmd, CTURBO::dec, [this]() { this->decrease_speed(); })
setspeed_t(cmd, CTURBO::ss, [this](const std::string& args) { this->set_speed_cmd(args); })
{
framerate_realtime_locked = false;
last_time_update = 0;
time_at_last_update = 0;
time_frozen = true;
@ -45,7 +41,6 @@ void framerate_regulator::set_speed_multiplier(double multiplier) throw()
{
threads::alock h(framerate_lock);
multiplier_framerate = multiplier;
framerate_realtime_locked = false;
}
//Get the speed multiplier. Note that this may be INFINITE.
@ -71,14 +66,7 @@ void framerate_regulator::unfreeze_time(uint64_t curtime)
void framerate_regulator::set_nominal_framerate(double fps) throw()
{
threads::alock h(framerate_lock);
double old_nominal_framerate = nominal_framerate;
nominal_framerate = fps;
//If framerate is realtime-locked, adjust the framerate multiplier as nominal framerate changes.
//E.g. if multiplier is 1/30 and nominal framerate changes from 60 to 30, the multiplier needs to be
//adjusted to 1/15.
if(framerate_realtime_locked) {
multiplier_framerate *= old_nominal_framerate / nominal_framerate;
}
}
double framerate_regulator::get_realized_multiplier() throw()
@ -191,102 +179,3 @@ void framerate_regulator::set_speed_cmd(const std::string& args)
messages << "Expected positive speed multiplier or \"turbo\"" << std::endl;
}
}
namespace
{
double seconds_per_frame[] = {4, 3, 2, 1, 0.5, 0.2};
double relative_speed[] = {0.01, 0.04, 0.1, 0.2, 0.25, 0.333, 0.5, 1, 2, 3, 5, 10};
std::vector<std::pair<double, bool>> construct_speedscale(double basefps)
{
std::vector<std::pair<double, bool>> ret;
unsigned idx1 = 0;
unsigned idx2 = 0;
unsigned size1 = sizeof(seconds_per_frame)/sizeof(seconds_per_frame[0]);
unsigned size2 = sizeof(relative_speed)/sizeof(relative_speed[0]);
while(idx1 < size1 || idx2 < size2) {
double x1 = std::numeric_limits<double>::infinity();
double x2 = std::numeric_limits<double>::infinity();
if(idx1 < size1) x1 = 1 / (seconds_per_frame[idx1] * basefps);
if(idx2 < size2) x2 = relative_speed[idx2];
if(x1 < x2) {
ret.push_back(std::make_pair(x1, true));
idx1++;
} else if(x1 > x2) {
ret.push_back(std::make_pair(x2, false));
idx2++;
} else {
ret.push_back(std::make_pair(x2, true));
idx1++;
idx2++;
}
}
return ret;
}
}
//Step should be ODD.
void framerate_regulator::set_speedstep(unsigned step)
{
auto scale = construct_speedscale(nominal_framerate);
step = (step - 1) / 2;
if(step >= scale.size()) {
//Infinity.
multiplier_framerate = std::numeric_limits<double>::infinity();
framerate_realtime_locked = false;
messages << "Speed set to turbo." << std::endl;
return;
}
auto _step = scale[step];
multiplier_framerate = _step.first;
framerate_realtime_locked = _step.second;
if(framerate_realtime_locked)
messages << "Speed set to " << multiplier_framerate * nominal_framerate << "fps." << std::endl;
else
messages << "Speed set to " << (double)(unsigned)(multiplier_framerate * 1000) / 10 << "%."
<< std::endl;
}
#define SPD_TOLERANCE 1e-10
//{1/100, 1/fps, 2/fps, 1/10, 1/5, 1/3, 1/2, 1, 2, 3, 5, 10}
//Step can be EVEN if between steps.
unsigned framerate_regulator::get_speedstep()
{
auto scale = construct_speedscale(nominal_framerate);
if(multiplier_framerate == std::numeric_limits<double>::infinity())
return 2 * scale.size() + 1; //Infinity.
unsigned idx = 0;
for(auto i: scale) {
if(multiplier_framerate < i.first)
return idx; //Between steps.
if(fabs(multiplier_framerate) - i.first < SPD_TOLERANCE)
return idx + 1; //On step.
idx += 2;
}
return 2 * scale.size(); //Above maximum step but below infinity.
}
void framerate_regulator::increase_speed() throw()
{
threads::alock h(framerate_lock);
unsigned step = get_speedstep();
if(step < 2) return; //At or below minimum speed in scale.
if(step & 1)
step-=2; //If step is odd, decrement by 2 (full step).
else
step--; //If step is even, decrement by 1 to reach previous step.
set_speedstep(step);
}
void framerate_regulator::decrease_speed() throw()
{
threads::alock h(framerate_lock);
unsigned step = get_speedstep();
if(multiplier_framerate == std::numeric_limits<double>::infinity()) return; //Already turbo.
if(step & 1)
step+=2; //If step is odd, increment by 2 (full step).
else
step++; //If step is even, increment by 1 to reach next step.
set_speedstep(step);
}

View file

@ -98,8 +98,7 @@ emulator_instance::emulator_instance()
D.init(keyboard);
D.init(mapper, *keyboard, *command);
D.init(rom);
D.init(fbuf, *subtitles, *settings, *mwatch, *keyboard, *dispatch, *lua2, *rom, *supdater, *command,
*iqueue);
D.init(fbuf, *subtitles, *settings, *mwatch, *keyboard, *dispatch, *lua2, *rom, *supdater, *command);
D.init(buttons, *controls, *mapper, *keyboard, *fbuf, *dispatch, *lua2, *command);
D.init(mteditor, *mlogic, *controls, *dispatch, *supdater, *buttons, *command);
D.init(status_A);
@ -109,7 +108,7 @@ emulator_instance::emulator_instance()
D.init(abindmanager, *mapper, *command);
D.init(nrrdata);
D.init(cmapper, *memory, *mlogic, *rom);
D.init(project, *commentary, *mwatch, *command, *controls, *settings, *buttons, *dispatch, *iqueue, *rom,
D.init(project, *commentary, *mwatch, *command, *controls, *setcache, *buttons, *dispatch, *iqueue, *rom,
*supdater);
D.init(dbg, *dispatch, *rom, *memory, *command);
D.init(framerate, *command);

View file

@ -3,7 +3,6 @@
#include "core/settings.hpp"
#include "library/settingvar.hpp"
#include <functional>
#include <stdexcept>
namespace

View file

@ -116,9 +116,9 @@ namespace
command::fnptr<> reset_joysticks(lsnes_cmds, CKEYMAPPER::reset,
[]() throw(std::bad_alloc, std::runtime_error) {
joystick_driver_quit(true);
lsnes_gamepads.offline_all(); //Not supposed to have online gamepads when entering reset.
joystick_driver_init(true);
joystick_driver_quit();
lsnes_gamepads.offline_all(); //Not supposed to have online gamepads.
joystick_driver_init();
messages << "Reset gamepads" << std::endl;
});

View file

@ -208,6 +208,3 @@ void autoload_libraries(void(*on_error)(const std::string& libname, const std::s
}
handle_post_loadlibrary();
}
std::string loadlib_debug_get_user_library_dir() { return get_user_library_dir(); }
std::string loadlib_debug_get_system_library_dir() { return get_system_library_dir(); }

View file

@ -179,11 +179,8 @@ namespace
//Do pending load (automatically unpauses).
void mark_pending_load(std::string filename, int lmode)
{
auto& core = CORE();
//Ignore requests to loadstate when loadstate is already in progress. Should fix that "gets stuck
//on high speed" bug.
if(core.runmode->get() == emulator_runmode::LOAD) return;
//Convert break pause to ordinary pause.
auto& core = CORE();
loadmode = lmode;
pending_load = filename;
core.runmode->decay_break();
@ -261,7 +258,7 @@ public:
std::string get_firmware_path()
{
return SET_firmwarepath(*CORE().settings);
return CORE().setcache->get("firmwarepath");
}
std::string get_base_path()
@ -947,17 +944,13 @@ void main_loop(struct loaded_rom& rom, struct moviefile& initial, bool load_has_
out:
core.jukebox->unset_update();
core.mdumper->end_dumps();
core_core::uninstall_all_handlers();
core.commentary->kill();
core.iqueue->system_thread_available = false;
//Kill some things to avoid crashes.
core.dbg->core_change();
core.project->set(NULL, true);
core.mwatch->clear_multi(core.mwatch->enumerate());
//Close the ROM.
load_null_rom();
do_load_rom();
//Uninstall the handlers. Don't do this with ROM loaded.
core_core::uninstall_all_handlers();
}
void set_stop_at_frame(uint64_t frame)

View file

@ -12,7 +12,6 @@
#include "library/minmax.hpp"
#include "library/string.hpp"
#include <functional>
#include <iostream>
#include <limits>
#include <sstream>

View file

@ -20,7 +20,6 @@
#include "library/memorywatch-null.hpp"
#include "library/string.hpp"
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <list>

View file

@ -175,7 +175,7 @@ std::string translate_name_mprefix(std::string original, int& binary, int save)
}
return filename;
} else {
std::string pprf = SET_slotpath(*core.settings) + "/";
std::string pprf = core.setcache->get("slotpath") + "/";
return pprf + get_mprefix() + r[1] + ".lsmv";
}
} else {
@ -412,16 +412,13 @@ namespace
return portctrl::type_set::make(ctrldata.ports, ctrldata.portindex());
}
void handle_load_core(moviefile& _movie, portctrl::type_set& portset, bool will_load_state,
bool force = false);
void handle_load_core(moviefile& _movie, portctrl::type_set& portset, bool will_load_state, bool force)
void handle_load_core(moviefile& _movie, portctrl::type_set& portset, bool will_load_state)
{
auto& core = CORE();
core.random_seed_value = _movie.movie_rtc_second;
if(will_load_state) {
//If settings possibly change, reload the ROM.
if(force || !*core.mlogic || core.mlogic->get_mfile().projectid != _movie.projectid)
if(!*core.mlogic || core.mlogic->get_mfile().projectid != _movie.projectid)
core.rom->load(_movie.settings, _movie.movie_rtc_second, _movie.movie_rtc_subsecond);
//Load the savestate and movie state.
//Set the core ports in order to avoid port state being reinitialized when loading.
@ -431,7 +428,7 @@ namespace
core.controls->set_macro_frames(_movie.dyn.active_macros);
} else {
//If settings possibly change, reload the ROM. Otherwise rewind to beginning.
if(force || !*core.mlogic || core.mlogic->get_mfile().projectid != _movie.projectid)
if(!*core.mlogic || core.mlogic->get_mfile().projectid != _movie.projectid)
core.rom->load(_movie.settings, _movie.movie_rtc_second, _movie.movie_rtc_subsecond);
else
core.rom->reset_to_load();
@ -460,9 +457,7 @@ void do_load_rom() throw(std::bad_alloc, std::runtime_error)
portctrl::type_set& portset = construct_movie_portset(core.mlogic->get_mfile(), *core.rom);
//If portset or gametype changes, force readwrite with new movie.
if(core.mlogic->get_mfile().input->get_types() != portset) load_readwrite = true;
else if(!core.rom->is_of_type(core.mlogic->get_mfile().gametype->get_type())) load_readwrite = true;
else if(!core.rom->region_compatible_with(core.mlogic->get_mfile().gametype->get_region()))
load_readwrite = true;
if(!core.rom->is_of_type(core.mlogic->get_mfile().gametype->get_type())) load_readwrite = true;
}
if(!load_readwrite) {
@ -476,10 +471,7 @@ void do_load_rom() throw(std::bad_alloc, std::runtime_error)
portctrl::type_set& portset = construct_movie_portset(core.mlogic->get_mfile(), *core.rom);
try {
//Force game's region to run's region. We already checked this is possible above.
core.rom->set_internal_region(core.mlogic->get_mfile().gametype->get_region());
handle_load_core(core.mlogic->get_mfile(), portset, false, true);
handle_load_core(core.mlogic->get_mfile(), portset, false);
core.mlogic->get_mfile().gametype = &core.rom->get_sysregion();
for(size_t i = 0; i < ROM_SLOT_COUNT; i++) {
auto& img = core.rom->get_rom(i);
@ -538,7 +530,7 @@ void do_load_rom() throw(std::bad_alloc, std::runtime_error)
//Movie data is lost.
core.lua2->callback_movie_lost("reload");
try {
handle_load_core(*_movie.get(), portset2, false, true);
handle_load_core(*_movie.get(), portset2, false);
_movie.get()->gametype = &core.rom->get_sysregion();
} catch(std::bad_alloc& e) {
OOM_panic();
@ -648,7 +640,7 @@ void do_load_state_preserve(struct moviefile& _movie)
//Paint the screen.
framebuffer::raw tmp;
if(will_load_state) {
tmp.load(core.mlogic->get_mfile().dyn.screenshot);
tmp.load(_movie.dyn.screenshot);
core.fbuf->redraw_framebuffer(tmp);
} else
core.fbuf->redraw_framebuffer(core.rom->draw_cover());

View file

@ -191,9 +191,9 @@ namespace
}
project_state::project_state(voice_commentary& _commentary, memwatch_set& _mwatch, command::group& _command,
controller_state& _controls, settingvar::group& _setgroup, button_mapping& _buttons,
controller_state& _controls, settingvar::cache& _setcache, button_mapping& _buttons,
emulator_dispatch& _edispatch, input_queue& _iqueue, loaded_rom& _rom, status_updater& _supdater)
: commentary(_commentary), mwatch(_mwatch), command(_command), controls(_controls), setgroup(_setgroup),
: commentary(_commentary), mwatch(_mwatch), command(_command), controls(_controls), setcache(_setcache),
buttons(_buttons), edispatch(_edispatch), iqueue(_iqueue), rom(_rom), supdater(_supdater),
branch_ls(command, CPROJECT::bls, [this]() { this->do_branch_ls(); }),
branch_mk(command, CPROJECT::bmk, [this](const std::string& a) { this->do_branch_mk(a); }),
@ -460,7 +460,7 @@ std::string project_state::moviepath()
if(active_project)
return active_project->directory;
else
return SET_moviepath(setgroup);
return setcache.get("moviepath");
}
std::string project_state::otherpath()

View file

@ -3,7 +3,6 @@
#include "core/random.hpp"
#include "library/command.hpp"
#include "library/threads.hpp"
#include <functional>
input_queue::input_queue(command::group& _command)
: command(_command)

View file

@ -139,8 +139,8 @@ namespace
{
auto& core = CORE();
std::string x;
std::string romdir = SET_rompath(*core.settings);
std::string biosdir = SET_firmwarepath(*core.settings);
std::string romdir = core.setcache->get("rompath");
std::string biosdir = core.setcache->get("firmwarepath");
if((x = try_scan_hint_dir(hint, hash, xhash, romdir, extensions, headersize)) != "") return x;
if(bios && (x = try_scan_hint_dir(hint, hash, xhash, biosdir, extensions, headersize)) != "")
return x;

View file

@ -7,7 +7,6 @@
#include "core/window.hpp"
#include "library/memtracker.hpp"
#include "library/zip.hpp"
#include <functional>
fileimage::image rom_image::null_img;
fileimage::hash lsnes_image_hasher;
@ -198,7 +197,7 @@ rom_image::rom_image(const std::string& file, core_type& ctype) throw(std::bad_a
if((bios = ctype.get_biosname()) != "") {
//This thing has a BIOS.
romidx = 1;
std::string basename = SET_firmwarepath(*CORE().settings) + "/" + bios;
std::string basename = CORE().setcache->get("firmwarepath") + "/" + bios;
romimg[0] = fileimage::image(lsnes_image_hasher, basename, "", xlate_info(ctype.get_image_info(0)));
if(zip::file_exists(basename + ".xml"))
romxml[0] = fileimage::image(lsnes_image_hasher, basename + ".xml", "", get_xml_info());
@ -242,7 +241,7 @@ rom_image::rom_image(const std::string& file, const std::string& tmpprefer) thro
if((bios = coretype->get_biosname()) != "") {
//This thing has a BIOS.
romidx = 1;
std::string basename = SET_firmwarepath(*CORE().settings) + "/" + bios;
std::string basename = CORE().setcache->get("firmwarepath") + "/" + bios;
romimg[0] = fileimage::image(lsnes_image_hasher, basename, "",
xlate_info(coretype->get_image_info(0)));
if(zip::file_exists(basename + ".xml"))
@ -364,7 +363,7 @@ void rom_image::load_bundle(const std::string& file, std::istream& spec, const s
}
//MSU-1 base.
if(rtype->get_biosname() != "")
if(cromimg[1] != "")
msu1_base = zip::resolverel(cromimg[1], file);
else
msu1_base = zip::resolverel(cromimg[0], file);
@ -396,7 +395,7 @@ rom_image::rom_image(const std::string& file, const std::string& core, const std
std::string bios = t->get_biosname();
unsigned romidx = (bios != "") ? 1 : 0;
if(bios != "") {
std::string basename = SET_firmwarepath(*CORE().settings) + "/" + bios;
std::string basename = CORE().setcache->get("firmwarepath") + "/" + bios;
romimg[0] = fileimage::image(lsnes_image_hasher, basename, "", xlate_info(t->get_image_info(0)));
if(zip::file_exists(basename + ".xml"))
romxml[0] = fileimage::image(lsnes_image_hasher, basename + ".xml", "", get_xml_info());

View file

@ -173,12 +173,12 @@ rom_image_handle construct_rom_multifile(core_type* ctype, const moviefile::brie
for(unsigned i = 0; i < ROM_SLOT_COUNT; i++) {
std::string optregex;
bool isbios = false;
auto psetting = &SET_firmwarepath;
std::string psetting;
std::string romid;
if(bios != "" && i == 0) {
optregex = "--bios=(.*)";
isbios = true;
psetting = &SET_firmwarepath;
psetting = "firmwarepath";
romid = "BIOS";
} else {
char j[2] = {0, 0};
@ -186,7 +186,7 @@ rom_image_handle construct_rom_multifile(core_type* ctype, const moviefile::brie
if(j[0] == 'a' + 26)
j[0] = '@';
optregex = std::string("--rom-") + j + "=(.*)";
psetting = &SET_rompath;
psetting = "rompath";
j[0] = i - ((bios != "") ? 1 : 0) + 'A';
if(j[0] == 'A' + 26)
j[0] = '@';
@ -211,7 +211,7 @@ rom_image_handle construct_rom_multifile(core_type* ctype, const moviefile::brie
//Try to use hint.
std::set<std::string> exts = img.extensions;
for(auto j : exts) {
std::string candidate = (*psetting)(*core.settings) + "/" + info.hint[i] +
std::string candidate = core.setcache->get(psetting) + "/" + info.hint[i] +
"." + j;
if(zip::file_exists(candidate)) {
roms[i] = candidate;
@ -221,7 +221,7 @@ rom_image_handle construct_rom_multifile(core_type* ctype, const moviefile::brie
}
if(isbios && roms[i] == "" && i == 0) {
//Fallback default.
roms[0] = SET_firmwarepath(*core.settings) + "/" + bios;
roms[0] = core.setcache->get("firmwarepath") + "/" + bios;
}
if(roms[i] == "" && info.hash[i] != "")
roms[i] = try_to_guess_rom(info.hint[i], info.hash[i], info.hashxml[i], *ctype, i);

View file

@ -2,10 +2,13 @@
settingvar::set lsnes_setgrp;
settingvar::supervariable<settingvar::model_path> SET_rompath(lsnes_setgrp, "rompath", "Paths‣ROMs", "");
settingvar::supervariable<settingvar::model_path> SET_moviepath(lsnes_setgrp, "moviepath", "Paths‣Movies",
"");
settingvar::supervariable<settingvar::model_path> SET_firmwarepath(lsnes_setgrp, "firmwarepath",
"Paths‣Firmware", "");
settingvar::supervariable<settingvar::model_path> SET_slotpath(lsnes_setgrp, "slotpath", "Paths‣Save slots",
"");
namespace
{
settingvar::supervariable<settingvar::model_path> SET_rompath(lsnes_setgrp, "rompath", "Paths‣ROMs", "");
settingvar::supervariable<settingvar::model_path> SET_moviepath(lsnes_setgrp, "moviepath", "Paths‣Movies",
"");
settingvar::supervariable<settingvar::model_path> SET_firmwarepath(lsnes_setgrp, "firmwarepath",
"Paths‣Firmware", "");
settingvar::supervariable<settingvar::model_path> SET_slotpath(lsnes_setgrp, "slotpath", "Paths‣Save slots",
"");
}

View file

@ -9,7 +9,6 @@
#include "core/rom.hpp"
#include "core/ui-services.hpp"
#include "library/keyboard.hpp"
#include <functional>
namespace
{
@ -196,14 +195,14 @@ dumper_information UI_get_dumpers(emulator_instance& inst)
void UI_start_dump(emulator_instance& inst, dumper_factory_base& factory, const std::string& mode,
const std::string& prefix)
{
inst.iqueue->run([&inst, &factory, mode, prefix]() {
lsnes_instance.iqueue->run([&inst, &factory, mode, prefix]() {
inst.mdumper->start(factory, mode, prefix);
});
}
void UI_end_dump(emulator_instance& inst, dumper_factory_base& factory)
{
inst.iqueue->run([&inst, &factory]() {
lsnes_instance.iqueue->run([&inst, &factory]() {
auto in = inst.mdumper->get_instance(&factory);
delete in;
});
@ -221,7 +220,7 @@ void UI_do_keypress(emulator_instance& inst, const keyboard::modifier_set& mods,
bool UI_has_movie(emulator_instance& inst)
{
bool ret = false;
inst.iqueue->run([&inst, &ret]() {
lsnes_instance.iqueue->run([&inst, &ret]() {
ret = !!*inst.mlogic && !inst.rom->isnull();
});
return ret;
@ -229,7 +228,7 @@ bool UI_has_movie(emulator_instance& inst)
void UI_save_movie(emulator_instance& inst, std::ostringstream& stream)
{
inst.iqueue->run([&inst, &stream]() {
lsnes_instance.iqueue->run([&inst, &stream]() {
auto prj = inst.project->get();
if(prj) {
inst.mlogic->get_mfile().gamename = prj->gamename;
@ -244,7 +243,7 @@ std::pair<std::string, std::string> UI_lookup_platform_and_game(emulator_instanc
{
std::string plat;
std::string game;
inst.iqueue->run([&inst, &plat, &game]() {
lsnes_instance.iqueue->run([&inst, &plat, &game]() {
auto prj = inst.project->get();
if(prj)
game = prj->gamename;
@ -258,7 +257,7 @@ std::pair<std::string, std::string> UI_lookup_platform_and_game(emulator_instanc
std::string UI_get_project_otherpath(emulator_instance& inst)
{
std::string path;
inst.iqueue->run([&inst, &path]() {
lsnes_instance.iqueue->run([&inst, &path]() {
path = inst.project->otherpath();
});
return path;
@ -267,7 +266,7 @@ std::string UI_get_project_otherpath(emulator_instance& inst)
std::string UI_get_project_moviepath(emulator_instance& inst)
{
std::string path;
inst.iqueue->run([&inst, &path]() {
lsnes_instance.iqueue->run([&inst, &path]() {
path = inst.project->moviepath();
});
return path;
@ -276,7 +275,7 @@ std::string UI_get_project_moviepath(emulator_instance& inst)
bool UI_in_project_context(emulator_instance& inst)
{
bool pc;
inst.iqueue->run([&inst, &pc]() {
lsnes_instance.iqueue->run([&inst, &pc]() {
pc = (inst.project->get() != NULL);
});
return pc;

View file

@ -276,12 +276,10 @@ void platform::init()
lsnes_instance.audio->init();
audioapi_driver_init();
joystick_driver_init();
audioapi_connect_instance(*lsnes_instance.audio);
}
void platform::quit()
{
audioapi_disconnect_instance(*lsnes_instance.audio);
joystick_driver_quit();
audioapi_driver_quit();
lsnes_instance.audio->quit();

View file

@ -7,14 +7,14 @@
namespace
{
template<bool create, bool bpp2>
template<bool create>
int dump_sprite(lua::state& L, lua::parameters& P)
{
auto& core = CORE();
lua_bitmap* b;
uint64_t addr;
uint32_t width, height;
size_t stride1 = bpp2 ? 16 : 32;
size_t stride1 = 32;
size_t stride2;
if(!create) {
@ -27,7 +27,7 @@ namespace
addr = lua_get_read_address(P);
if(create)
P(width, height);
P(P.optional(stride2, bpp2 ? 256 : 512));
P(P.optional(stride2, 512));
if(create)
b = lua::_class<lua_bitmap>::create(L, width * 8, height * 8);
@ -49,12 +49,11 @@ namespace
for(unsigned k = 0; k < 8; k++) {
uint8_t byte1 = mem[sbase + 2 * k];
uint8_t byte2 = mem[sbase + 2 * k + 1];
uint8_t byte3 = bpp2 ? 0 : mem[sbase + 2 * k + 16];
uint8_t byte4 = bpp2 ? 0 : mem[sbase + 2 * k + 17];
uint8_t byte3 = mem[sbase + 2 * k + 16];
uint8_t byte4 = mem[sbase + 2 * k + 17];
uint32_t soff = (j * 8 + k) * (8 * width) + i * 8;
for(unsigned l = 0; l < 8; l++) {
uint32_t v = 0;
//No harm including the nonexistent planes (they are 0).
if((byte1 >> (7 - l)) & 1) v |= 1;
if((byte2 >> (7 - l)) & 1) v |= 2;
if((byte3 >> (7 - l)) & 1) v |= 4;
@ -70,13 +69,10 @@ namespace
for(unsigned k = 0; k < 8; k++) {
uint8_t byte1 = core.memory->read<uint8_t>(sbase + 2 * k);
uint8_t byte2 = core.memory->read<uint8_t>(sbase + 2 * k + 1);
uint8_t byte3 = bpp2 ? 0 : core.memory->read<uint8_t>(sbase + 2 * k +
16);
uint8_t byte4 = bpp2 ? 0 : core.memory->read<uint8_t>(sbase + 2 * k +
17);
uint8_t byte3 = core.memory->read<uint8_t>(sbase + 2 * k + 16);
uint8_t byte4 = core.memory->read<uint8_t>(sbase + 2 * k + 17);
uint32_t soff = (j * 8 + k) * (8 * width) + i * 8;
for(unsigned l = 0; l < 8; l++) {
//No harm including the nonexistent planes (they are 0).
uint32_t v = 0;
if((byte1 >> (7 - l)) & 1) v |= 1;
if((byte2 >> (7 - l)) & 1) v |= 2;
@ -95,36 +91,22 @@ namespace
{
auto& core = CORE();
uint64_t addr;
bool full = false, ftrans;
bool fourcc = false;
bool full, ftrans;
lua_palette* p;
if(!create) {
P(p);
size_t ccount = p->color_count;
if(ccount != 4 && ccount != 16 && ccount != 256)
throw std::runtime_error("Palette to read must be 4, 16 or 256 colors");
if(ccount != 16 && ccount != 256)
throw std::runtime_error("Palette to read must be 16 or 256 colors");
full = (ccount == 256);
fourcc = (ccount == 4);
}
addr = lua_get_read_address(P);
if(create) {
//Hacky way to do integers.
if(P.is_number()) {
uint64_t col;
P(col);
if(col == 4) fourcc = true;
else if(col == 16);
else if(col == 256) full = true;
else
throw std::runtime_error("Palette to read must be 4, 16 or 256 colors");
} else {
P(full);
}
}
if(create)
P(full);
P(ftrans);
size_t ps = full ? 256 : (fourcc ? 4 : 16);
size_t ps = full ? 256 : 16;
if(create) {
p = lua::_class<lua_palette>::create(L);
p->adjust_palette_size(ps);
@ -167,9 +149,7 @@ namespace
lua::functions bitmap_fns_snes(lua_func_misc, "bsnes", {
{"dump_palette", dump_palette<true>},
{"redump_palette", dump_palette<false>},
{"dump_sprite", dump_sprite<true, false>},
{"redump_sprite", dump_sprite<false, false>},
{"dump_sprite2", dump_sprite<true, true>},
{"redump_sprite2", dump_sprite<false, true>},
{"dump_sprite", dump_sprite<true>},
{"redump_sprite", dump_sprite<false>},
});
}

View file

@ -561,9 +561,6 @@ 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
@ -643,9 +640,6 @@ 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
@ -661,9 +655,6 @@ 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
@ -771,8 +762,6 @@ namespace
{
uint16_t _l = l_sample;
uint16_t _r = r_sample;
//Don't overflow buffers if bsnes goes bonkers.
if(soundbuf_fill >= sizeof(soundbuf) / sizeof(soundbuf[0])) return;
soundbuf[soundbuf_fill++] = l_sample;
soundbuf[soundbuf_fill++] = r_sample;
//The SMP emits a sample every 768 ticks of its clock. Use this in order to keep track of
@ -1752,13 +1741,6 @@ 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,

View file

@ -1,7 +1,6 @@
#include "interface/disassembler.hpp"
#include "library/hex.hpp"
#include "library/string.hpp"
#include <functional>
#include <sstream>
#include <iomanip>
@ -215,7 +214,6 @@ namespace
case 'R':
o << "$" << hex::to(static_cast<uint16_t>(base + 3 +
fetch_le<int16_t>(fetchpc)));
break;
case 'w':
o << "$" << hex::to(fetch_le<uint16_t>(fetchpc));
break;

View file

@ -16,7 +16,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "lsnes.hpp"
#include <functional>
#include <sstream>
#include <iostream>
#include <map>

Some files were not shown because too many files have changed in this diff Show more