mirror of
https://github.com/rodamaral/lsnes.git
synced 2025-04-02 10:42:15 -04:00
Compare commits
137 commits
lsnes-rr2-
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
7d9b3e93ec | ||
|
3dee7b756a | ||
|
323db52b6b | ||
|
f49b82c989 | ||
|
6fd18bd0f0 | ||
|
b5f3e543d8 | ||
|
4c6338888d | ||
|
9318e4de94 | ||
|
298610752b | ||
|
f85cdab6c5 | ||
|
dd18168993 | ||
|
7be5215c08 | ||
|
8ac8304824 | ||
|
c2e40c4cd3 | ||
|
669381821e | ||
|
c5d441c6b0 | ||
|
5544b9ba12 | ||
|
4c9bb20270 | ||
|
eb6ff6c38b | ||
|
7903ba1fda | ||
|
40ac5d56e3 | ||
|
a3f1d7c8a4 | ||
|
d287f64c14 | ||
|
62ee8b0039 | ||
|
05ad5b9da1 | ||
|
019fbc2646 | ||
|
3da2e26e1b | ||
|
610685db0f | ||
|
6a580bb332 | ||
|
fa3e5b6751 | ||
|
813449ac1b | ||
|
ff697846d1 | ||
|
476f79f14a | ||
|
e9e00fd881 | ||
|
51bbbd1772 | ||
|
1834c61dfb | ||
|
5ab3b133a4 | ||
|
918dc6db7b | ||
|
97ba0292d6 | ||
|
d8048863e8 | ||
|
6d1a67719b | ||
|
5e73a844a9 | ||
|
4a4c71acf4 | ||
|
957738035f | ||
|
859d60513f | ||
|
7ada70888f | ||
|
250679f656 | ||
|
2e609624fa | ||
|
daa5ca41e9 | ||
|
4a4004d3f8 | ||
|
0b3743e258 | ||
|
73e0232176 | ||
|
d86f713aa4 | ||
|
52073af3ac | ||
|
1c48e0ab06 | ||
|
c5b368ab3f | ||
|
1056f4b4b2 | ||
|
80867950f3 | ||
|
88a00a2a84 | ||
|
2da23de987 | ||
|
0d83c3aba6 | ||
|
0960e967ea | ||
|
c2a7eed9d8 | ||
|
1dd19faaeb | ||
|
8bca9ce614 | ||
|
0c0156647b | ||
|
56deafcd4a | ||
|
82a7c255a4 | ||
|
6a2d7f9aa2 | ||
|
478472e883 | ||
|
f06eb401c4 | ||
|
f04379b03c | ||
|
a8bc4a2cf8 | ||
|
ae71090387 | ||
|
04d7e60fe1 | ||
|
15ff9e0cc8 | ||
|
8a794244be | ||
|
10eb0dbd22 | ||
|
eeaf3706d8 | ||
|
9aa8578e74 | ||
|
17efbec1a6 | ||
|
39286f820a | ||
|
653f44e353 | ||
|
a45baf5559 | ||
|
4d3d483a34 | ||
|
3571fb3e08 | ||
|
b7aedc6cd9 | ||
|
1bf49d532d | ||
|
a6b7391da5 | ||
|
8af9dda77f | ||
|
a1b96d75da | ||
|
2842b76907 | ||
|
c51cfe9099 | ||
|
71d649c487 | ||
|
ae3cb19a03 | ||
|
f2169b725f | ||
|
046bc221ef | ||
|
5f0d5dcdb0 | ||
|
3eb7585947 | ||
|
d7744e00e7 | ||
|
52dff27f3e | ||
|
93875839b9 | ||
|
929155f14d | ||
|
63b59e35f7 | ||
|
aade7a9fb8 | ||
|
fd65e1e435 | ||
|
8e95c54d68 | ||
|
e3fc1ed5fa | ||
|
94170ec2d5 | ||
|
ea78fecb1b | ||
|
19b12b1215 | ||
|
4e70e95e7f | ||
|
8967f3a261 | ||
|
7ece85f0c6 | ||
|
5f8f8af25f | ||
|
c86f10376a | ||
|
791684edc3 | ||
|
ff1004d7fa | ||
|
bdcf21a4e1 | ||
|
95ec8a8ba7 | ||
|
5c0f57448c | ||
|
773e84cfd7 | ||
|
44aa95cc57 | ||
|
54cbe456b4 | ||
|
94b603c9f2 | ||
|
1cb702bd5e | ||
|
7c7ee6637d | ||
|
5f0b9e3315 | ||
|
58e4ad1b94 | ||
|
2312324824 | ||
|
8d5783536a | ||
|
6e80331962 | ||
|
538128686a | ||
|
d507a05237 | ||
|
b3c0fc76f9 | ||
|
7584121717 | ||
|
792bb0867e |
255 changed files with 6453 additions and 2275 deletions
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
[submodule "bsnes"]
|
||||
path = bsnes
|
||||
url = ./
|
||||
[submodule "gambatte"]
|
||||
path = gambatte
|
||||
url = ./
|
80
CHANGELOG
80
CHANGELOG
|
@ -2047,3 +2047,83 @@ rr2-β22 [Saturday January 24th 2015]
|
|||
* Fix bad download crashing the emulator
|
||||
* bsnes: DMA tracing
|
||||
* bsnes: Support IRQ/NMI tracing
|
||||
|
||||
rr2-β23 [Thursday May 28th 2015]
|
||||
================================
|
||||
* Lua: Don't lua_error() out of context with pending dtors
|
||||
* Add $LSNES_NO_SOUND_IN to disable sound input
|
||||
* Makefile: Build cmdhelp before anything else
|
||||
* keymapper: Verify gamepad config write before committing
|
||||
* Remember volume settings across restarts
|
||||
* Remember video settings
|
||||
* Fix CUSTOMFONT text positioning
|
||||
* Only exit poll advance on poll to non-00 control
|
||||
* Show error instead silently failing tangent positive edge
|
||||
* Fix race condition in makefile
|
||||
* Fix scaling-related crashes
|
||||
* NULL video dumper
|
||||
* Fix some compilation errors on Mac OS X
|
||||
* Move all regex matching to library/string.cpp
|
||||
* Switch to std::regex by default
|
||||
* Movie editor: Don't lock up on trying to display error messages
|
||||
* Add a internal TODO list
|
||||
* Lua: add gui.get_runmode()
|
||||
* Movie editor: Fix unnamed branch to show properly in select branch
|
||||
* If initsram/initstate points to LSS file, pull the matching member
|
||||
* wxwidgets: Hide dumper called "NULL"
|
||||
* Force game panel to window size in fullscreen mode
|
||||
* Implicitly redirect cmdhelp includes to corresponding JSON files
|
||||
* Fix movie length being wrong for imported binary tracks
|
||||
* Lua: input.controller_info(): Don't crash with out-of-range port
|
||||
* Lua: movie.rom_loaded()
|
||||
* Lua: movie.get_rom_info()
|
||||
* Force a repaint when becoming fullscreen
|
||||
* wxwidgets: exit-fullscreen to forcibly exit fullscreen mode
|
||||
* Make gitlinks for bsnes and gambatte
|
||||
* Throw mic in to entropy pool
|
||||
* Fix hostendian memory watches
|
||||
* Fix race condition in do_mix_tsc()
|
||||
* Lua: Don't run class destructor if constructor failed
|
||||
* Fix typo in resolve_filename documentation
|
||||
* bit.(r)flagdecode: Fix unicode in on/off strings
|
||||
* Wxwidgets: Add keycode entries for å, ä and ö
|
||||
* Wxwidgets: Fix §
|
||||
* Wxwidgets: Fix some compile errors in editor-memorywatch.cpp
|
||||
* Wxwidgets: Fix some compile errors in window-fileupload.cpp
|
||||
* Lua: movie.get_game_info
|
||||
* Don't callback to Lua in inconsistent state when loading a new ROM
|
||||
* SNES: Functions for messing with clockrate (for debugging games)
|
||||
* Remove some unnecressary casts
|
||||
* Add back reload-rom and close-rom
|
||||
* Add load-rom command
|
||||
* Split overly large loaded_rom constructor
|
||||
* Fix speed going out of whack after doing unsafe rewind
|
||||
* Refactor loaded_rom to make public fields private
|
||||
* Move NULL core code to its own file
|
||||
* Internally refactor loaded ROM imageset out of loaded ROM code
|
||||
* Refer to loaded ROM imagesets as handles
|
||||
* A bit of code cleanup
|
||||
* Mark the core methods that should be idempotent as const
|
||||
* Refactor dynamic state to its own subobject
|
||||
* Refactor unsafe rewinding a bit now that state is its own subobject
|
||||
* Clean up dynamic state handling a bit
|
||||
* Circle coordinates can go negative and thus must be signed
|
||||
* Add dedicated method for resetting to poweron state
|
||||
* Add description of PALETTE:get()
|
||||
* Fix typo in Lua reference
|
||||
* Don't leak open file descriptors to loaded ROMs
|
||||
* Fix race between killing object and drawing object
|
||||
* Fix a compiler warning
|
||||
* Small rendering speedups
|
||||
* Actually kill objects using palette about to be GC'd
|
||||
* font rendering: Use ranges for bounding instead of buggy routine
|
||||
* Have only one main Lua function trampoline
|
||||
* Use master state for trampolines
|
||||
* Lua: Memory usage limit
|
||||
* Framework for memory usage tracking
|
||||
* Redo text rendering (adds halo support to gui.text())
|
||||
* Make git diff --check happier
|
||||
* Clean up system font drawing
|
||||
* Memory tracker: Add tracking of render objects
|
||||
* Rework how memory tracking works
|
||||
* Small whitespace cleanup
|
||||
|
|
11
Makefile
11
Makefile
|
@ -20,7 +20,8 @@ ifdef HOST_BOOST_NEEDS_MT
|
|||
HOST_BOOST_POSTFIX=-mt
|
||||
endif
|
||||
|
||||
LDFLAGS = -pthread -lboost_iostreams$(BOOST_LIB_POSTFIX) -lboost_filesystem$(BOOST_LIB_POSTFIX) -lboost_system$(BOOST_LIB_POSTFIX) -lboost_regex$(BOOST_LIB_POSTFIX) -lz $(USER_LDFLAGS)
|
||||
LDFLAGS = -pthread -lboost_iostreams$(BOOST_LIB_POSTFIX) -lboost_filesystem$(BOOST_LIB_POSTFIX) -lboost_system$(BOOST_LIB_POSTFIX) -lz $(USER_LDFLAGS)
|
||||
HOSTHELPER_LDFLAGS =
|
||||
|
||||
ifeq ($(THREADS), NATIVE)
|
||||
CFLAGS += -DNATIVE_THREADS
|
||||
|
@ -33,6 +34,14 @@ $(error "Bad value for THREADS (expected NATIVE or BOOST)")
|
|||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(REGEX), BOOST)
|
||||
CFLAGS += -DUSE_BOOST_REGEX
|
||||
LDFLAGS += -lboost_regex$(BOOST_LIB_POSTFIX)
|
||||
HOSTHELPER_LDFLAGS += -lboost_regex$(HOST_BOOST_POSTFIX)
|
||||
endif
|
||||
HOSTHELPER_LDFLAGS += -lboost_system$(HOST_BOOST_POSTFIX)
|
||||
|
||||
|
||||
ifdef NEED_LIBICONV
|
||||
LDFLAGS += -liconv
|
||||
endif
|
||||
|
|
3
TODO
Normal file
3
TODO
Normal file
|
@ -0,0 +1,3 @@
|
|||
- Memory Tracking: Track dynamic state.
|
||||
- Fix paths and filenames containing non-ASCII on Win32.
|
||||
- Win64 build.
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2-β22
|
||||
2-β23
|
||||
|
|
1
bsnes
Submodule
1
bsnes
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 4cfbbeadc3abe3e3911f7f59ce57b715edc76563
|
|
@ -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/23] Make libsnes compile
|
||||
Subject: [PATCH 01/27] Make libsnes compile
|
||||
|
||||
Changes between v083 and v084 had broken libsnes. Fix it so it at least
|
||||
compiles.
|
||||
|
@ -10,7 +10,7 @@ compiles.
|
|||
1 file changed, 35 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ui-libsnes/libsnes.cpp b/ui-libsnes/libsnes.cpp
|
||||
index fbb4482..5f5ded6 100755
|
||||
index fbb4482c..5f5ded69 100755
|
||||
--- a/ui-libsnes/libsnes.cpp
|
||||
+++ b/ui-libsnes/libsnes.cpp
|
||||
@@ -1,5 +1,6 @@
|
||||
|
@ -78,5 +78,5 @@ index fbb4482..5f5ded6 100755
|
|||
}
|
||||
SNES::cartridge.load(SNES::Cartridge::Mode::SuperGameBoy, xmlrom);
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fix bsnes version number in libsnes to be v085, not
|
||||
Subject: [PATCH 02/27] Fix bsnes version number in libsnes to be v085, not
|
||||
v083
|
||||
|
||||
---
|
||||
|
@ -9,7 +9,7 @@ Subject: [PATCH 02/23] Fix bsnes version number in libsnes to be v085, not
|
|||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ui-libsnes/libsnes.cpp b/ui-libsnes/libsnes.cpp
|
||||
index 5f5ded6..0e63075 100755
|
||||
index 5f5ded69..0e63075e 100755
|
||||
--- a/ui-libsnes/libsnes.cpp
|
||||
+++ b/ui-libsnes/libsnes.cpp
|
||||
@@ -112,7 +112,7 @@ struct Interface : public SNES::Interface {
|
||||
|
@ -22,5 +22,5 @@ index 5f5ded6..0e63075 100755
|
|||
|
||||
unsigned snes_library_revision_major(void) {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Don't use time() in emulating chips
|
||||
Subject: [PATCH 03/27] Don't use time() in emulating chips
|
||||
|
||||
Instead of using time() in chip emulation, create new interface method
|
||||
currentTime(), defaulting to time(0). This way frontend can cleanly
|
||||
|
@ -15,7 +15,7 @@ override the current time bsnes is using.
|
|||
5 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/snes/chip/bsx/satellaview/satellaview.cpp b/snes/chip/bsx/satellaview/satellaview.cpp
|
||||
index 386fb62..3c98019 100755
|
||||
index 386fb628..3c980195 100755
|
||||
--- a/snes/chip/bsx/satellaview/satellaview.cpp
|
||||
+++ b/snes/chip/bsx/satellaview/satellaview.cpp
|
||||
@@ -38,7 +38,7 @@ uint8 BSXSatellaview::mmio_read(unsigned addr) {
|
||||
|
@ -28,7 +28,7 @@ index 386fb62..3c98019 100755
|
|||
|
||||
regs.r2192_hour = t->tm_hour;
|
||||
diff --git a/snes/chip/spc7110/spc7110.cpp b/snes/chip/spc7110/spc7110.cpp
|
||||
index d2dc640..74a817a 100755
|
||||
index d2dc640b..74a817a6 100755
|
||||
--- a/snes/chip/spc7110/spc7110.cpp
|
||||
+++ b/snes/chip/spc7110/spc7110.cpp
|
||||
@@ -101,7 +101,7 @@ void SPC7110::set_data_adjust(unsigned addr) { r4814 = addr; r4815 = addr >> 8;
|
||||
|
@ -41,7 +41,7 @@ index d2dc640..74a817a 100755
|
|||
//sizeof(time_t) is platform-dependent; though rtc[] needs to be platform-agnostic.
|
||||
//yet platforms with 32-bit signed time_t will overflow every ~68 years. handle this by
|
||||
diff --git a/snes/chip/srtc/srtc.cpp b/snes/chip/srtc/srtc.cpp
|
||||
index 1b2fd2a..78fc4c1 100755
|
||||
index 1b2fd2aa..78fc4c1f 100755
|
||||
--- a/snes/chip/srtc/srtc.cpp
|
||||
+++ b/snes/chip/srtc/srtc.cpp
|
||||
@@ -31,7 +31,7 @@ void SRTC::reset() {
|
||||
|
@ -54,7 +54,7 @@ index 1b2fd2a..78fc4c1 100755
|
|||
//sizeof(time_t) is platform-dependent; though rtc[] needs to be platform-agnostic.
|
||||
//yet platforms with 32-bit signed time_t will overflow every ~68 years. handle this by
|
||||
diff --git a/snes/interface/interface.cpp b/snes/interface/interface.cpp
|
||||
index a0e3a81..b3017c9 100755
|
||||
index a0e3a81b..b3017c90 100755
|
||||
--- a/snes/interface/interface.cpp
|
||||
+++ b/snes/interface/interface.cpp
|
||||
@@ -18,4 +18,9 @@ void Interface::message(const string &text) {
|
||||
|
@ -68,7 +68,7 @@ index a0e3a81..b3017c9 100755
|
|||
+
|
||||
}
|
||||
diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp
|
||||
index f1a48c0..df975e8 100755
|
||||
index f1a48c0f..df975e83 100755
|
||||
--- a/snes/interface/interface.hpp
|
||||
+++ b/snes/interface/interface.hpp
|
||||
@@ -5,6 +5,7 @@ struct Interface {
|
||||
|
@ -80,5 +80,5 @@ index f1a48c0..df975e8 100755
|
|||
|
||||
extern Interface *interface;
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Save controller state when savestating
|
||||
Subject: [PATCH 04/27] Save controller state when savestating
|
||||
|
||||
When savestating, save the controller state and restore it upon loadstate.
|
||||
Prevents libsnes from mixing up buttons.
|
||||
|
@ -24,7 +24,7 @@ Prevents libsnes from mixing up buttons.
|
|||
15 files changed, 142 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/snes/controller/controller.cpp b/snes/controller/controller.cpp
|
||||
index 9091b21..f254bed 100755
|
||||
index 9091b21b..f254bedb 100755
|
||||
--- a/snes/controller/controller.cpp
|
||||
+++ b/snes/controller/controller.cpp
|
||||
@@ -46,8 +46,16 @@ void Controller::iobit(bool data) {
|
||||
|
@ -45,7 +45,7 @@ index 9091b21..f254bed 100755
|
|||
+
|
||||
}
|
||||
diff --git a/snes/controller/controller.hpp b/snes/controller/controller.hpp
|
||||
index 7332712..827b2eb 100755
|
||||
index 73327129..827b2eb4 100755
|
||||
--- a/snes/controller/controller.hpp
|
||||
+++ b/snes/controller/controller.hpp
|
||||
@@ -13,12 +13,14 @@
|
||||
|
@ -64,7 +64,7 @@ index 7332712..827b2eb 100755
|
|||
bool iobit();
|
||||
void iobit(bool data);
|
||||
diff --git a/snes/controller/gamepad/gamepad.cpp b/snes/controller/gamepad/gamepad.cpp
|
||||
index 594020d..4fa1c99 100755
|
||||
index 594020d2..4fa1c99e 100755
|
||||
--- a/snes/controller/gamepad/gamepad.cpp
|
||||
+++ b/snes/controller/gamepad/gamepad.cpp
|
||||
@@ -13,6 +13,19 @@ void Gamepad::latch(bool data) {
|
||||
|
@ -88,7 +88,7 @@ index 594020d..4fa1c99 100755
|
|||
latched = 0;
|
||||
counter = 0;
|
||||
diff --git a/snes/controller/gamepad/gamepad.hpp b/snes/controller/gamepad/gamepad.hpp
|
||||
index c5ca69c..a2392d1 100755
|
||||
index c5ca69ca..a2392d1e 100755
|
||||
--- a/snes/controller/gamepad/gamepad.hpp
|
||||
+++ b/snes/controller/gamepad/gamepad.hpp
|
||||
@@ -2,7 +2,7 @@ struct Gamepad : Controller {
|
||||
|
@ -101,7 +101,7 @@ index c5ca69c..a2392d1 100755
|
|||
bool latched;
|
||||
unsigned counter;
|
||||
diff --git a/snes/controller/justifier/justifier.cpp b/snes/controller/justifier/justifier.cpp
|
||||
index 6207916..ad13a9b 100755
|
||||
index 62079166..ad13a9bd 100755
|
||||
--- a/snes/controller/justifier/justifier.cpp
|
||||
+++ b/snes/controller/justifier/justifier.cpp
|
||||
@@ -100,6 +100,42 @@ void Justifier::latch(bool data) {
|
||||
|
@ -148,7 +148,7 @@ index 6207916..ad13a9b 100755
|
|||
create(Controller::Enter, 21477272);
|
||||
latched = 0;
|
||||
diff --git a/snes/controller/justifier/justifier.hpp b/snes/controller/justifier/justifier.hpp
|
||||
index f927acf..6b7bba0 100755
|
||||
index f927acf6..6b7bba07 100755
|
||||
--- a/snes/controller/justifier/justifier.hpp
|
||||
+++ b/snes/controller/justifier/justifier.hpp
|
||||
@@ -2,6 +2,7 @@ struct Justifier : Controller {
|
||||
|
@ -160,7 +160,7 @@ index f927acf..6b7bba0 100755
|
|||
|
||||
//private:
|
||||
diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp
|
||||
index c9f5d16..6b26fae 100755
|
||||
index c9f5d16b..6b26fae5 100755
|
||||
--- a/snes/controller/mouse/mouse.cpp
|
||||
+++ b/snes/controller/mouse/mouse.cpp
|
||||
@@ -61,6 +61,19 @@ void Mouse::latch(bool data) {
|
||||
|
@ -184,7 +184,7 @@ index c9f5d16..6b26fae 100755
|
|||
latched = 0;
|
||||
counter = 0;
|
||||
diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp
|
||||
index 95e24b6..b66ea51 100755
|
||||
index 95e24b65..b66ea513 100755
|
||||
--- a/snes/controller/mouse/mouse.hpp
|
||||
+++ b/snes/controller/mouse/mouse.hpp
|
||||
@@ -2,7 +2,7 @@ struct Mouse : Controller {
|
||||
|
@ -197,7 +197,7 @@ index 95e24b6..b66ea51 100755
|
|||
bool latched;
|
||||
unsigned counter;
|
||||
diff --git a/snes/controller/multitap/multitap.cpp b/snes/controller/multitap/multitap.cpp
|
||||
index 3a6eb72..146c41d 100755
|
||||
index 3a6eb720..146c41d4 100755
|
||||
--- a/snes/controller/multitap/multitap.cpp
|
||||
+++ b/snes/controller/multitap/multitap.cpp
|
||||
@@ -30,6 +30,22 @@ void Multitap::latch(bool data) {
|
||||
|
@ -224,7 +224,7 @@ index 3a6eb72..146c41d 100755
|
|||
latched = 0;
|
||||
counter1 = 0;
|
||||
diff --git a/snes/controller/multitap/multitap.hpp b/snes/controller/multitap/multitap.hpp
|
||||
index 0540af7..e6324ac 100755
|
||||
index 0540af71..e6324ac5 100755
|
||||
--- a/snes/controller/multitap/multitap.hpp
|
||||
+++ b/snes/controller/multitap/multitap.hpp
|
||||
@@ -2,7 +2,7 @@ struct Multitap : Controller {
|
||||
|
@ -237,7 +237,7 @@ index 0540af7..e6324ac 100755
|
|||
bool latched;
|
||||
unsigned counter1;
|
||||
diff --git a/snes/controller/superscope/superscope.cpp b/snes/controller/superscope/superscope.cpp
|
||||
index 12068f0..1a1dfbf 100755
|
||||
index 12068f05..1a1dfbff 100755
|
||||
--- a/snes/controller/superscope/superscope.cpp
|
||||
+++ b/snes/controller/superscope/superscope.cpp
|
||||
@@ -100,6 +100,37 @@ void SuperScope::latch(bool data) {
|
||||
|
@ -279,7 +279,7 @@ index 12068f0..1a1dfbf 100755
|
|||
create(Controller::Enter, 21477272);
|
||||
latched = 0;
|
||||
diff --git a/snes/controller/superscope/superscope.hpp b/snes/controller/superscope/superscope.hpp
|
||||
index a7a90b7..93509d7 100755
|
||||
index a7a90b71..93509d79 100755
|
||||
--- a/snes/controller/superscope/superscope.hpp
|
||||
+++ b/snes/controller/superscope/superscope.hpp
|
||||
@@ -2,6 +2,7 @@ struct SuperScope : Controller {
|
||||
|
@ -291,7 +291,7 @@ index a7a90b7..93509d7 100755
|
|||
|
||||
//private:
|
||||
diff --git a/snes/system/input.cpp b/snes/system/input.cpp
|
||||
index 9050310..ec5559d 100755
|
||||
index 90503106..ec5559dc 100755
|
||||
--- a/snes/system/input.cpp
|
||||
+++ b/snes/system/input.cpp
|
||||
@@ -26,6 +26,22 @@ void Input::connect(bool port, Input::Device id) {
|
||||
|
@ -318,7 +318,7 @@ index 9050310..ec5559d 100755
|
|||
connect(Controller::Port1, Input::Device::Joypad);
|
||||
connect(Controller::Port2, Input::Device::Joypad);
|
||||
diff --git a/snes/system/input.hpp b/snes/system/input.hpp
|
||||
index 13ef46e..6832e82 100755
|
||||
index 13ef46e1..6832e823 100755
|
||||
--- a/snes/system/input.hpp
|
||||
+++ b/snes/system/input.hpp
|
||||
@@ -31,6 +31,7 @@ struct Input {
|
||||
|
@ -330,7 +330,7 @@ index 13ef46e..6832e82 100755
|
|||
Input();
|
||||
~Input();
|
||||
diff --git a/snes/system/serialization.cpp b/snes/system/serialization.cpp
|
||||
index f7d6f3b..08e7051 100755
|
||||
index f7d6f3b1..08e70510 100755
|
||||
--- a/snes/system/serialization.cpp
|
||||
+++ b/snes/system/serialization.cpp
|
||||
@@ -56,6 +56,7 @@ void System::serialize_all(serializer &s) {
|
||||
|
@ -342,5 +342,5 @@ index f7d6f3b..08e7051 100755
|
|||
if(cartridge.mode() == Cartridge::Mode::SufamiTurbo) sufamiturbo.serialize(s);
|
||||
if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) icd2.serialize(s);
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fix unserialization of 64-bit signed integers
|
||||
Subject: [PATCH 05/27] Fix unserialization of 64-bit signed integers
|
||||
|
||||
---
|
||||
nall/serializer.hpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/nall/serializer.hpp b/nall/serializer.hpp
|
||||
index ff2337a..e6bc8fa 100755
|
||||
index ff2337ab..e6bc8fad 100755
|
||||
--- a/nall/serializer.hpp
|
||||
+++ b/nall/serializer.hpp
|
||||
@@ -58,7 +58,7 @@ namespace nall {
|
||||
|
@ -21,5 +21,5 @@ index ff2337a..e6bc8fa 100755
|
|||
isize += size;
|
||||
}
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Allow frontend to control random number seed
|
||||
Subject: [PATCH 06/27] Allow frontend to control random number seed
|
||||
|
||||
---
|
||||
snes/interface/interface.cpp | 5 +++++
|
||||
|
@ -10,7 +10,7 @@ Subject: [PATCH 06/23] Allow frontend to control random number seed
|
|||
3 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/snes/interface/interface.cpp b/snes/interface/interface.cpp
|
||||
index b3017c9..0a21a13 100755
|
||||
index b3017c90..0a21a132 100755
|
||||
--- a/snes/interface/interface.cpp
|
||||
+++ b/snes/interface/interface.cpp
|
||||
@@ -23,4 +23,9 @@ time_t Interface::currentTime()
|
||||
|
@ -24,7 +24,7 @@ index b3017c9..0a21a13 100755
|
|||
+
|
||||
}
|
||||
diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp
|
||||
index df975e8..30ee7fd 100755
|
||||
index df975e83..30ee7fde 100755
|
||||
--- a/snes/interface/interface.hpp
|
||||
+++ b/snes/interface/interface.hpp
|
||||
@@ -6,6 +6,7 @@ struct Interface {
|
||||
|
@ -36,7 +36,7 @@ index df975e8..30ee7fd 100755
|
|||
|
||||
extern Interface *interface;
|
||||
diff --git a/snes/system/system.cpp b/snes/system/system.cpp
|
||||
index c19a7c5..dbd912d 100755
|
||||
index c19a7c51..dbd912d8 100755
|
||||
--- a/snes/system/system.cpp
|
||||
+++ b/snes/system/system.cpp
|
||||
@@ -146,7 +146,7 @@ void System::unload() {
|
||||
|
@ -49,5 +49,5 @@ index c19a7c5..dbd912d 100755
|
|||
region = config.region;
|
||||
expansion = config.expansion_port;
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fix mouse polling
|
||||
Subject: [PATCH 07/27] Fix mouse polling
|
||||
|
||||
Don't poll for mouse motion excessive number of times (no need to poll it for
|
||||
each bit!)
|
||||
|
@ -11,7 +11,7 @@ each bit!)
|
|||
2 files changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp
|
||||
index 6b26fae..1a066b9 100755
|
||||
index 6b26fae5..1a066b98 100755
|
||||
--- a/snes/controller/mouse/mouse.cpp
|
||||
+++ b/snes/controller/mouse/mouse.cpp
|
||||
@@ -3,9 +3,13 @@
|
||||
|
@ -48,7 +48,7 @@ index 6b26fae..1a066b9 100755
|
|||
}
|
||||
|
||||
diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp
|
||||
index b66ea51..b07c8ab 100755
|
||||
index b66ea513..b07c8ab7 100755
|
||||
--- a/snes/controller/mouse/mouse.hpp
|
||||
+++ b/snes/controller/mouse/mouse.hpp
|
||||
@@ -6,4 +6,6 @@ struct Mouse : Controller {
|
||||
|
@ -59,5 +59,5 @@ index b66ea51..b07c8ab 100755
|
|||
+ int _position_y;
|
||||
};
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fix uninitialized variables
|
||||
Subject: [PATCH 08/27] Fix uninitialized variables
|
||||
|
||||
These uninitialized variables cause a lot of desyncs in Shadowrun.
|
||||
---
|
||||
|
@ -16,7 +16,7 @@ These uninitialized variables cause a lot of desyncs in Shadowrun.
|
|||
8 files changed, 38 insertions(+)
|
||||
|
||||
diff --git a/snes/alt/dsp/dsp.cpp b/snes/alt/dsp/dsp.cpp
|
||||
index d0c9e07..c6809f7 100755
|
||||
index d0c9e077..c6809f73 100755
|
||||
--- a/snes/alt/dsp/dsp.cpp
|
||||
+++ b/snes/alt/dsp/dsp.cpp
|
||||
@@ -40,6 +40,8 @@ void DSP::write(uint8 addr, uint8 data) {
|
||||
|
@ -29,7 +29,7 @@ index d0c9e07..c6809f7 100755
|
|||
spc_dsp.reset();
|
||||
spc_dsp.set_output(samplebuffer, 8192);
|
||||
diff --git a/snes/alt/ppu-compatibility/ppu.cpp b/snes/alt/ppu-compatibility/ppu.cpp
|
||||
index 1a3835b..a21e5e3 100755
|
||||
index 1a3835b3..a21e5e31 100755
|
||||
--- a/snes/alt/ppu-compatibility/ppu.cpp
|
||||
+++ b/snes/alt/ppu-compatibility/ppu.cpp
|
||||
@@ -345,6 +345,17 @@ void PPU::power() {
|
||||
|
@ -51,7 +51,7 @@ index 1a3835b..a21e5e3 100755
|
|||
}
|
||||
|
||||
diff --git a/snes/cpu/core/core.cpp b/snes/cpu/core/core.cpp
|
||||
index 427176b..a5b809b 100755
|
||||
index 427176b0..a5b809b9 100755
|
||||
--- a/snes/cpu/core/core.cpp
|
||||
+++ b/snes/cpu/core/core.cpp
|
||||
@@ -86,4 +86,12 @@ CPUcore::CPUcore() {
|
||||
|
@ -68,7 +68,7 @@ index 427176b..a5b809b 100755
|
|||
+
|
||||
}
|
||||
diff --git a/snes/cpu/core/core.hpp b/snes/cpu/core/core.hpp
|
||||
index 964bd12..7a685a8 100755
|
||||
index 964bd128..7a685a8d 100755
|
||||
--- a/snes/cpu/core/core.hpp
|
||||
+++ b/snes/cpu/core/core.hpp
|
||||
@@ -7,6 +7,8 @@ struct CPUcore {
|
||||
|
@ -81,7 +81,7 @@ index 964bd12..7a685a8 100755
|
|||
virtual uint8_t op_read(uint32_t addr) = 0;
|
||||
virtual void op_write(uint32_t addr, uint8_t data) = 0;
|
||||
diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp
|
||||
index f6ae975..2d7d343 100755
|
||||
index f6ae9754..2d7d3432 100755
|
||||
--- a/snes/cpu/cpu.cpp
|
||||
+++ b/snes/cpu/cpu.cpp
|
||||
@@ -125,6 +125,7 @@ void CPU::power() {
|
||||
|
@ -93,7 +93,7 @@ index f6ae975..2d7d343 100755
|
|||
|
||||
void CPU::reset() {
|
||||
diff --git a/snes/smp/core/core.cpp b/snes/smp/core/core.cpp
|
||||
index 9c94d00..2fc29be 100755
|
||||
index 9c94d00a..2fc29be1 100755
|
||||
--- a/snes/smp/core/core.cpp
|
||||
+++ b/snes/smp/core/core.cpp
|
||||
@@ -269,4 +269,15 @@ void SMPcore::op_step() {
|
||||
|
@ -113,7 +113,7 @@ index 9c94d00..2fc29be 100755
|
|||
+
|
||||
}
|
||||
diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp
|
||||
index 6adf6f6..1489fce 100755
|
||||
index 6adf6f6b..1489fcef 100755
|
||||
--- a/snes/smp/core/core.hpp
|
||||
+++ b/snes/smp/core/core.hpp
|
||||
@@ -11,6 +11,8 @@ struct SMPcore {
|
||||
|
@ -126,7 +126,7 @@ index 6adf6f6..1489fce 100755
|
|||
string disassemble_opcode(uint16 addr);
|
||||
|
||||
diff --git a/snes/smp/smp.cpp b/snes/smp/smp.cpp
|
||||
index 9080624..d4ccf42 100755
|
||||
index 90806245..d4ccf425 100755
|
||||
--- a/snes/smp/smp.cpp
|
||||
+++ b/snes/smp/smp.cpp
|
||||
@@ -53,6 +53,7 @@ void SMP::power() {
|
||||
|
@ -138,5 +138,5 @@ index 9080624..d4ccf42 100755
|
|||
|
||||
void SMP::reset() {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Add needed support for detecting true polls as opposed
|
||||
Subject: [PATCH 09/27] Add needed support for detecting true polls as opposed
|
||||
to just autopolling
|
||||
|
||||
---
|
||||
|
@ -10,7 +10,7 @@ Subject: [PATCH 09/23] Add needed support for detecting true polls as opposed
|
|||
2 files changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/snes/cpu/cpu.hpp b/snes/cpu/cpu.hpp
|
||||
index 3da865e..4944577 100755
|
||||
index 3da865e2..49445773 100755
|
||||
--- a/snes/cpu/cpu.hpp
|
||||
+++ b/snes/cpu/cpu.hpp
|
||||
@@ -25,6 +25,7 @@ struct CPU : public Processor, public CPUcore, public PPUcounter {
|
||||
|
@ -22,7 +22,7 @@ index 3da865e..4944577 100755
|
|||
#include "dma/dma.hpp"
|
||||
#include "memory/memory.hpp"
|
||||
diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp
|
||||
index 8b6aaa6..c5ee930 100755
|
||||
index 8b6aaa6a..c5ee930f 100755
|
||||
--- a/snes/cpu/mmio/mmio.cpp
|
||||
+++ b/snes/cpu/mmio/mmio.cpp
|
||||
@@ -42,6 +42,7 @@ void CPU::mmio_w4016(uint8 data) {
|
||||
|
@ -65,5 +65,5 @@ index 8b6aaa6..c5ee930 100755
|
|||
//DMAPx
|
||||
uint8 CPU::mmio_r43x0(uint8 i) {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fix compiling on GCC 4.7
|
||||
Subject: [PATCH 10/27] Fix compiling on GCC 4.7
|
||||
|
||||
---
|
||||
nall/string.hpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/nall/string.hpp b/nall/string.hpp
|
||||
index 1b255ce..07a64df 100755
|
||||
index 1b255ce2..07a64dfc 100755
|
||||
--- a/nall/string.hpp
|
||||
+++ b/nall/string.hpp
|
||||
@@ -25,8 +25,8 @@
|
||||
|
@ -22,5 +22,5 @@ index 1b255ce..07a64df 100755
|
|||
#include <nall/string/convert.hpp>
|
||||
#include <nall/string/cstring.hpp>
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Support notifying latches
|
||||
Subject: [PATCH 11/27] Support notifying latches
|
||||
|
||||
---
|
||||
snes/cpu/mmio/mmio.cpp | 1 +
|
||||
|
@ -11,7 +11,7 @@ Subject: [PATCH 11/23] Support notifying latches
|
|||
4 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp
|
||||
index c5ee930..b7afff0 100755
|
||||
index c5ee930f..b7afff00 100755
|
||||
--- a/snes/cpu/mmio/mmio.cpp
|
||||
+++ b/snes/cpu/mmio/mmio.cpp
|
||||
@@ -33,6 +33,7 @@ void CPU::mmio_w2183(uint8 data) {
|
||||
|
@ -23,7 +23,7 @@ index c5ee930..b7afff0 100755
|
|||
input.port2->latch(data & 1);
|
||||
}
|
||||
diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp
|
||||
index 179df27..6a98de0 100755
|
||||
index 179df27d..6a98de00 100755
|
||||
--- a/snes/cpu/timing/joypad.cpp
|
||||
+++ b/snes/cpu/timing/joypad.cpp
|
||||
@@ -9,6 +9,7 @@ void CPU::step_auto_joypad_poll() {
|
||||
|
@ -35,7 +35,7 @@ index 179df27..6a98de0 100755
|
|||
input.port2->latch(1);
|
||||
input.port1->latch(0);
|
||||
diff --git a/snes/interface/interface.cpp b/snes/interface/interface.cpp
|
||||
index 0a21a13..6685556 100755
|
||||
index 0a21a132..6685556c 100755
|
||||
--- a/snes/interface/interface.cpp
|
||||
+++ b/snes/interface/interface.cpp
|
||||
@@ -28,4 +28,9 @@ time_t Interface::randomSeed()
|
||||
|
@ -49,7 +49,7 @@ index 0a21a13..6685556 100755
|
|||
+
|
||||
}
|
||||
diff --git a/snes/interface/interface.hpp b/snes/interface/interface.hpp
|
||||
index 30ee7fd..203f7b0 100755
|
||||
index 30ee7fde..203f7b0c 100755
|
||||
--- a/snes/interface/interface.hpp
|
||||
+++ b/snes/interface/interface.hpp
|
||||
@@ -7,6 +7,7 @@ struct Interface {
|
||||
|
@ -61,5 +61,5 @@ index 30ee7fd..203f7b0 100755
|
|||
|
||||
extern Interface *interface;
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Support unlimited number of breakpoints
|
||||
Subject: [PATCH 12/27] Support unlimited number of breakpoints
|
||||
|
||||
---
|
||||
snes/alt/cpu/cpu.cpp | 22 +++++++-------
|
||||
|
@ -40,7 +40,7 @@ Subject: [PATCH 12/23] Support unlimited number of breakpoints
|
|||
33 files changed, 166 insertions(+), 70 deletions(-)
|
||||
|
||||
diff --git a/snes/alt/cpu/cpu.cpp b/snes/alt/cpu/cpu.cpp
|
||||
index 814908d..dcbb92d 100755
|
||||
index 814908d0..dcbb92d3 100755
|
||||
--- a/snes/alt/cpu/cpu.cpp
|
||||
+++ b/snes/alt/cpu/cpu.cpp
|
||||
@@ -89,24 +89,24 @@ void CPU::enable() {
|
||||
|
@ -80,7 +80,7 @@ index 814908d..dcbb92d 100755
|
|||
|
||||
void CPU::power() {
|
||||
diff --git a/snes/alt/ppu-compatibility/ppu.cpp b/snes/alt/ppu-compatibility/ppu.cpp
|
||||
index a21e5e3..122b143 100755
|
||||
index a21e5e31..122b1430 100755
|
||||
--- a/snes/alt/ppu-compatibility/ppu.cpp
|
||||
+++ b/snes/alt/ppu-compatibility/ppu.cpp
|
||||
@@ -126,8 +126,8 @@ void PPU::enable() {
|
||||
|
@ -95,7 +95,7 @@ index a21e5e3..122b143 100755
|
|||
|
||||
void PPU::power() {
|
||||
diff --git a/snes/alt/ppu-parallel/ppu.cpp b/snes/alt/ppu-parallel/ppu.cpp
|
||||
index 1c3dcb7..8dd118b 100755
|
||||
index 1c3dcb70..8dd118b2 100755
|
||||
--- a/snes/alt/ppu-parallel/ppu.cpp
|
||||
+++ b/snes/alt/ppu-parallel/ppu.cpp
|
||||
@@ -36,8 +36,8 @@ void PPU::frame() {
|
||||
|
@ -110,7 +110,7 @@ index 1c3dcb7..8dd118b 100755
|
|||
|
||||
void PPU::power() {
|
||||
diff --git a/snes/alt/ppu-performance/ppu.cpp b/snes/alt/ppu-performance/ppu.cpp
|
||||
index 7c231bc..4b2b294 100755
|
||||
index 7c231bc0..4b2b2948 100755
|
||||
--- a/snes/alt/ppu-performance/ppu.cpp
|
||||
+++ b/snes/alt/ppu-performance/ppu.cpp
|
||||
@@ -90,8 +90,8 @@ void PPU::enable() {
|
||||
|
@ -125,7 +125,7 @@ index 7c231bc..4b2b294 100755
|
|||
|
||||
void PPU::power() {
|
||||
diff --git a/snes/cartridge/cartridge.hpp b/snes/cartridge/cartridge.hpp
|
||||
index 37555bc..82e73c4 100755
|
||||
index 37555bc0..82e73c4c 100755
|
||||
--- a/snes/cartridge/cartridge.hpp
|
||||
+++ b/snes/cartridge/cartridge.hpp
|
||||
@@ -12,6 +12,22 @@ struct Cartridge : property<Cartridge> {
|
||||
|
@ -160,7 +160,7 @@ index 37555bc..82e73c4 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 e639fe5..2dd0d64 100755
|
||||
index e639fe52..2dd0d646 100755
|
||||
--- a/snes/cartridge/markup.cpp
|
||||
+++ b/snes/cartridge/markup.cpp
|
||||
@@ -74,6 +74,7 @@ void Cartridge::parse_markup_rom(XML::Node &root) {
|
||||
|
@ -250,7 +250,7 @@ index e639fe5..2dd0d64 100755
|
|||
write = { &Memory::write, &memory };
|
||||
mode = Bus::MapMode::Direct;
|
||||
diff --git a/snes/cheat/cheat.cpp b/snes/cheat/cheat.cpp
|
||||
index 46c42d1..3a269cc 100755
|
||||
index 46c42d1c..3a269cc5 100755
|
||||
--- a/snes/cheat/cheat.cpp
|
||||
+++ b/snes/cheat/cheat.cpp
|
||||
@@ -21,9 +21,9 @@ void Cheat::synchronize() {
|
||||
|
@ -283,7 +283,7 @@ index 46c42d1..3a269cc 100755
|
|||
}
|
||||
}
|
||||
diff --git a/snes/cheat/cheat.hpp b/snes/cheat/cheat.hpp
|
||||
index 306b99b..b4d2a42 100755
|
||||
index 306b99b1..b4d2a42e 100755
|
||||
--- a/snes/cheat/cheat.hpp
|
||||
+++ b/snes/cheat/cheat.hpp
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -295,7 +295,7 @@ index 306b99b..b4d2a42 100755
|
|||
|
||||
struct Cheat : public linear_vector<CheatCode> {
|
||||
diff --git a/snes/chip/bsx/satellaview/satellaview.cpp b/snes/chip/bsx/satellaview/satellaview.cpp
|
||||
index 3c98019..25af8e5 100755
|
||||
index 3c980195..25af8e56 100755
|
||||
--- a/snes/chip/bsx/satellaview/satellaview.cpp
|
||||
+++ b/snes/chip/bsx/satellaview/satellaview.cpp
|
||||
@@ -6,8 +6,8 @@ void BSXSatellaview::init() {
|
||||
|
@ -310,7 +310,7 @@ index 3c98019..25af8e5 100755
|
|||
|
||||
void BSXSatellaview::unload() {
|
||||
diff --git a/snes/chip/hitachidsp/hitachidsp.cpp b/snes/chip/hitachidsp/hitachidsp.cpp
|
||||
index 1042267..3e5c5bd 100755
|
||||
index 1042267e..3e5c5bdb 100755
|
||||
--- a/snes/chip/hitachidsp/hitachidsp.cpp
|
||||
+++ b/snes/chip/hitachidsp/hitachidsp.cpp
|
||||
@@ -23,7 +23,7 @@ void HitachiDSP::enter() {
|
||||
|
@ -323,7 +323,7 @@ index 1042267..3e5c5bd 100755
|
|||
}
|
||||
state = State::Idle;
|
||||
diff --git a/snes/chip/hitachidsp/memory.cpp b/snes/chip/hitachidsp/memory.cpp
|
||||
index 3c9c3af..36868e8 100755
|
||||
index 3c9c3af1..36868e88 100755
|
||||
--- a/snes/chip/hitachidsp/memory.cpp
|
||||
+++ b/snes/chip/hitachidsp/memory.cpp
|
||||
@@ -1,7 +1,7 @@
|
||||
|
@ -336,7 +336,7 @@ index 3c9c3af..36868e8 100755
|
|||
}
|
||||
|
||||
diff --git a/snes/chip/nss/nss.cpp b/snes/chip/nss/nss.cpp
|
||||
index 964973d..5946af3 100755
|
||||
index 964973d0..5946af3b 100755
|
||||
--- a/snes/chip/nss/nss.cpp
|
||||
+++ b/snes/chip/nss/nss.cpp
|
||||
@@ -10,8 +10,8 @@ void NSS::init() {
|
||||
|
@ -351,7 +351,7 @@ index 964973d..5946af3 100755
|
|||
|
||||
void NSS::unload() {
|
||||
diff --git a/snes/chip/sa1/memory/memory.cpp b/snes/chip/sa1/memory/memory.cpp
|
||||
index d13ac92..9bb4ff2 100755
|
||||
index d13ac929..9bb4ff20 100755
|
||||
--- a/snes/chip/sa1/memory/memory.cpp
|
||||
+++ b/snes/chip/sa1/memory/memory.cpp
|
||||
@@ -107,7 +107,7 @@ void SA1::op_io() {
|
||||
|
@ -364,7 +364,7 @@ index d13ac92..9bb4ff2 100755
|
|||
if(((addr & 0x40e000) == 0x006000) || ((addr & 0xd00000) == 0x400000)) tick();
|
||||
return bus_read(addr);
|
||||
diff --git a/snes/chip/sa1/memory/memory.hpp b/snes/chip/sa1/memory/memory.hpp
|
||||
index ffb9e9f..ab8e1ed 100755
|
||||
index ffb9e9f6..ab8e1edd 100755
|
||||
--- a/snes/chip/sa1/memory/memory.hpp
|
||||
+++ b/snes/chip/sa1/memory/memory.hpp
|
||||
@@ -3,7 +3,7 @@ void bus_write(unsigned addr, uint8 data);
|
||||
|
@ -377,7 +377,7 @@ index ffb9e9f..ab8e1ed 100755
|
|||
|
||||
uint8 mmc_read(unsigned addr);
|
||||
diff --git a/snes/chip/sa1/sa1.cpp b/snes/chip/sa1/sa1.cpp
|
||||
index 71c6310..30e0080 100755
|
||||
index 71c6310a..30e00809 100755
|
||||
--- a/snes/chip/sa1/sa1.cpp
|
||||
+++ b/snes/chip/sa1/sa1.cpp
|
||||
@@ -37,7 +37,7 @@ void SA1::enter() {
|
||||
|
@ -390,7 +390,7 @@ index 71c6310..30e0080 100755
|
|||
if(!regs.e) op_writestack(regs.pc.b);
|
||||
op_writestack(regs.pc.h);
|
||||
diff --git a/snes/chip/sdd1/sdd1.cpp b/snes/chip/sdd1/sdd1.cpp
|
||||
index c9b8b1c..5d6cc55 100755
|
||||
index c9b8b1c4..5d6cc55f 100755
|
||||
--- a/snes/chip/sdd1/sdd1.cpp
|
||||
+++ b/snes/chip/sdd1/sdd1.cpp
|
||||
@@ -14,8 +14,8 @@ void SDD1::init() {
|
||||
|
@ -405,7 +405,7 @@ index c9b8b1c..5d6cc55 100755
|
|||
|
||||
void SDD1::unload() {
|
||||
diff --git a/snes/cpu/core/core.hpp b/snes/cpu/core/core.hpp
|
||||
index 7a685a8..9d77f3c 100755
|
||||
index 7a685a8d..9d77f3c5 100755
|
||||
--- a/snes/cpu/core/core.hpp
|
||||
+++ b/snes/cpu/core/core.hpp
|
||||
@@ -10,7 +10,7 @@ struct CPUcore {
|
||||
|
@ -418,7 +418,7 @@ index 7a685a8..9d77f3c 100755
|
|||
virtual void last_cycle() = 0;
|
||||
virtual bool interrupt_pending() = 0;
|
||||
diff --git a/snes/cpu/core/disassembler/disassembler.cpp b/snes/cpu/core/disassembler/disassembler.cpp
|
||||
index 030b3ab..ab8dde2 100755
|
||||
index 030b3ab5..ab8dde24 100755
|
||||
--- a/snes/cpu/core/disassembler/disassembler.cpp
|
||||
+++ b/snes/cpu/core/disassembler/disassembler.cpp
|
||||
@@ -6,7 +6,7 @@ uint8 CPUcore::dreadb(uint32 addr) {
|
||||
|
@ -431,7 +431,7 @@ index 030b3ab..ab8dde2 100755
|
|||
|
||||
uint16 CPUcore::dreadw(uint32 addr) {
|
||||
diff --git a/snes/cpu/core/memory.hpp b/snes/cpu/core/memory.hpp
|
||||
index 4992657..132501c 100755
|
||||
index 49926578..132501c1 100755
|
||||
--- a/snes/cpu/core/memory.hpp
|
||||
+++ b/snes/cpu/core/memory.hpp
|
||||
@@ -1,5 +1,5 @@
|
||||
|
@ -442,7 +442,7 @@ index 4992657..132501c 100755
|
|||
|
||||
alwaysinline uint8_t op_readstack() {
|
||||
diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp
|
||||
index 2d7d343..39da6b1 100755
|
||||
index 2d7d3432..39da6b16 100755
|
||||
--- a/snes/cpu/cpu.cpp
|
||||
+++ b/snes/cpu/cpu.cpp
|
||||
@@ -78,8 +78,8 @@ void CPU::enter() {
|
||||
|
@ -493,7 +493,7 @@ index 2d7d343..39da6b1 100755
|
|||
|
||||
void CPU::power() {
|
||||
diff --git a/snes/cpu/debugger/debugger.cpp b/snes/cpu/debugger/debugger.cpp
|
||||
index a33518e..8301bdb 100755
|
||||
index a33518ed..8301bdb6 100755
|
||||
--- a/snes/cpu/debugger/debugger.cpp
|
||||
+++ b/snes/cpu/debugger/debugger.cpp
|
||||
@@ -19,8 +19,8 @@ void CPUDebugger::op_step() {
|
||||
|
@ -508,7 +508,7 @@ index a33518e..8301bdb 100755
|
|||
debugger.breakpoint_test(Debugger::Breakpoint::Source::CPUBus, Debugger::Breakpoint::Mode::Read, addr, data);
|
||||
return data;
|
||||
diff --git a/snes/cpu/debugger/debugger.hpp b/snes/cpu/debugger/debugger.hpp
|
||||
index 579f6f0..c3d66db 100755
|
||||
index 579f6f03..c3d66db5 100755
|
||||
--- a/snes/cpu/debugger/debugger.hpp
|
||||
+++ b/snes/cpu/debugger/debugger.hpp
|
||||
@@ -16,7 +16,7 @@ public:
|
||||
|
@ -521,7 +521,7 @@ index 579f6f0..c3d66db 100755
|
|||
|
||||
CPUDebugger();
|
||||
diff --git a/snes/cpu/dma/dma.cpp b/snes/cpu/dma/dma.cpp
|
||||
index e8cdb3e..0a00bfe 100755
|
||||
index e8cdb3ec..0a00bfea 100755
|
||||
--- a/snes/cpu/dma/dma.cpp
|
||||
+++ b/snes/cpu/dma/dma.cpp
|
||||
@@ -26,7 +26,7 @@ bool CPU::dma_addr_valid(uint32 abus) {
|
||||
|
@ -543,7 +543,7 @@ index e8cdb3e..0a00bfe 100755
|
|||
dma_write(dma_addr_valid(abus), abus, regs.mdr);
|
||||
}
|
||||
diff --git a/snes/cpu/memory/memory.cpp b/snes/cpu/memory/memory.cpp
|
||||
index c2c8f1f..31f82c3 100755
|
||||
index c2c8f1fa..31f82c31 100755
|
||||
--- a/snes/cpu/memory/memory.cpp
|
||||
+++ b/snes/cpu/memory/memory.cpp
|
||||
@@ -10,11 +10,11 @@ void CPU::op_io() {
|
||||
|
@ -561,7 +561,7 @@ index c2c8f1f..31f82c3 100755
|
|||
alu_edge();
|
||||
return regs.mdr;
|
||||
diff --git a/snes/cpu/memory/memory.hpp b/snes/cpu/memory/memory.hpp
|
||||
index d33861d..fd64ba8 100755
|
||||
index d33861d4..fd64ba8b 100755
|
||||
--- a/snes/cpu/memory/memory.hpp
|
||||
+++ b/snes/cpu/memory/memory.hpp
|
||||
@@ -1,4 +1,4 @@
|
||||
|
@ -571,7 +571,7 @@ index d33861d..fd64ba8 100755
|
|||
debugvirtual void op_write(uint32 addr, uint8 data);
|
||||
alwaysinline unsigned speed(unsigned addr) const;
|
||||
diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp
|
||||
index b7afff0..30048c1 100755
|
||||
index b7afff00..30048c19 100755
|
||||
--- a/snes/cpu/mmio/mmio.cpp
|
||||
+++ b/snes/cpu/mmio/mmio.cpp
|
||||
@@ -5,7 +5,7 @@ bool CPU::joylatch() { return status.joypad_strobe_latch; }
|
||||
|
@ -584,7 +584,7 @@ index b7afff0..30048c1 100755
|
|||
|
||||
//WMDATA
|
||||
diff --git a/snes/debugger/debugger.cpp b/snes/debugger/debugger.cpp
|
||||
index b131233..e8d0f5a 100755
|
||||
index b1312339..e8d0f5af 100755
|
||||
--- a/snes/debugger/debugger.cpp
|
||||
+++ b/snes/debugger/debugger.cpp
|
||||
@@ -33,7 +33,7 @@ uint8 Debugger::read(Debugger::MemorySource source, unsigned addr) {
|
||||
|
@ -597,7 +597,7 @@ index b131233..e8d0f5a 100755
|
|||
|
||||
case MemorySource::APUBus: {
|
||||
diff --git a/snes/memory/memory-inline.hpp b/snes/memory/memory-inline.hpp
|
||||
index 70503be..45f150c 100755
|
||||
index 70503bea..45f150c9 100755
|
||||
--- a/snes/memory/memory-inline.hpp
|
||||
+++ b/snes/memory/memory-inline.hpp
|
||||
@@ -51,11 +51,26 @@ MappedRAM::MappedRAM() : data_(0), size_(0), write_protect_(false) {}
|
||||
|
@ -631,7 +631,7 @@ index 70503be..45f150c 100755
|
|||
return writer[lookup[addr]](target[addr], data);
|
||||
}
|
||||
diff --git a/snes/memory/memory.cpp b/snes/memory/memory.cpp
|
||||
index ede9cbd..a9a484a 100755
|
||||
index ede9cbd0..a9a484a0 100755
|
||||
--- a/snes/memory/memory.cpp
|
||||
+++ b/snes/memory/memory.cpp
|
||||
@@ -27,6 +27,7 @@ void Bus::map(
|
||||
|
@ -715,7 +715,7 @@ index ede9cbd..a9a484a 100755
|
|||
|
||||
}
|
||||
diff --git a/snes/memory/memory.hpp b/snes/memory/memory.hpp
|
||||
index 634e071..c20e14d 100755
|
||||
index 634e0717..c20e14db 100755
|
||||
--- a/snes/memory/memory.hpp
|
||||
+++ b/snes/memory/memory.hpp
|
||||
@@ -44,10 +44,13 @@ private:
|
||||
|
@ -756,7 +756,7 @@ index 634e071..c20e14d 100755
|
|||
~Bus();
|
||||
};
|
||||
diff --git a/snes/ppu/ppu.cpp b/snes/ppu/ppu.cpp
|
||||
index 8545175..13e231c 100755
|
||||
index 8545175f..13e231cf 100755
|
||||
--- a/snes/ppu/ppu.cpp
|
||||
+++ b/snes/ppu/ppu.cpp
|
||||
@@ -87,8 +87,8 @@ void PPU::enable() {
|
||||
|
@ -771,7 +771,7 @@ index 8545175..13e231c 100755
|
|||
|
||||
void PPU::power() {
|
||||
diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp
|
||||
index 1489fce..13d6936 100755
|
||||
index 1489fcef..13d69364 100755
|
||||
--- a/snes/smp/core/core.hpp
|
||||
+++ b/snes/smp/core/core.hpp
|
||||
@@ -2,7 +2,7 @@ struct SMPcore {
|
||||
|
@ -784,7 +784,7 @@ index 1489fce..13d6936 100755
|
|||
#include "registers.hpp"
|
||||
#include "memory.hpp"
|
||||
diff --git a/snes/snes.hpp b/snes/snes.hpp
|
||||
index dffeeee..37ed1fe 100755
|
||||
index dffeeee3..37ed1feb 100755
|
||||
--- a/snes/snes.hpp
|
||||
+++ b/snes/snes.hpp
|
||||
@@ -1,5 +1,6 @@
|
||||
|
@ -795,5 +795,5 @@ index dffeeee..37ed1fe 100755
|
|||
namespace SNES {
|
||||
namespace Info {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Support auto-detecting bsnes version
|
||||
Subject: [PATCH 13/27] Support auto-detecting bsnes version
|
||||
|
||||
---
|
||||
bsnes.mk | 3 +++
|
||||
|
@ -10,7 +10,7 @@ Subject: [PATCH 13/23] Support auto-detecting bsnes version
|
|||
|
||||
diff --git a/bsnes.mk b/bsnes.mk
|
||||
new file mode 100644
|
||||
index 0000000..20f22f6
|
||||
index 00000000..20f22f61
|
||||
--- /dev/null
|
||||
+++ b/bsnes.mk
|
||||
@@ -0,0 +1,3 @@
|
||||
|
@ -18,5 +18,5 @@ index 0000000..20f22f6
|
|||
+LIBSNES_DIR=ui-libsnes
|
||||
+BSNES_VERSION=085
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Support alternate (more accurate) poll timings
|
||||
Subject: [PATCH 14/27] Support alternate (more accurate) poll timings
|
||||
|
||||
---
|
||||
snes/config/config.cpp | 1 +
|
||||
|
@ -13,7 +13,7 @@ Subject: [PATCH 14/23] Support alternate (more accurate) poll timings
|
|||
6 files changed, 56 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/snes/config/config.cpp b/snes/config/config.cpp
|
||||
index 701af94..206daae 100755
|
||||
index 701af94c..206daae0 100755
|
||||
--- a/snes/config/config.cpp
|
||||
+++ b/snes/config/config.cpp
|
||||
@@ -13,6 +13,7 @@ Configuration::Configuration() {
|
||||
|
@ -25,7 +25,7 @@ index 701af94..206daae 100755
|
|||
smp.ntsc_frequency = 24607104; //32040.5 * 768
|
||||
smp.pal_frequency = 24607104;
|
||||
diff --git a/snes/config/config.hpp b/snes/config/config.hpp
|
||||
index 1f4d037..dabde59 100755
|
||||
index 1f4d037c..dabde597 100755
|
||||
--- a/snes/config/config.hpp
|
||||
+++ b/snes/config/config.hpp
|
||||
@@ -10,6 +10,7 @@ struct Configuration {
|
||||
|
@ -37,7 +37,7 @@ index 1f4d037..dabde59 100755
|
|||
|
||||
struct SMP {
|
||||
diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp
|
||||
index 6a98de0..ae8e94f 100755
|
||||
index 6a98de00..ae8e94f8 100755
|
||||
--- a/snes/cpu/timing/joypad.cpp
|
||||
+++ b/snes/cpu/timing/joypad.cpp
|
||||
@@ -29,4 +29,44 @@ void CPU::step_auto_joypad_poll() {
|
||||
|
@ -86,7 +86,7 @@ index 6a98de0..ae8e94f 100755
|
|||
+
|
||||
#endif
|
||||
diff --git a/snes/cpu/timing/timing.cpp b/snes/cpu/timing/timing.cpp
|
||||
index f1378f0..d7cf24f 100755
|
||||
index f1378f0c..d7cf24f3 100755
|
||||
--- a/snes/cpu/timing/timing.cpp
|
||||
+++ b/snes/cpu/timing/timing.cpp
|
||||
@@ -17,10 +17,18 @@ void CPU::add_clocks(unsigned clocks) {
|
||||
|
@ -113,7 +113,7 @@ index f1378f0..d7cf24f 100755
|
|||
|
||||
if(status.dram_refreshed == false && hcounter() >= status.dram_refresh_position) {
|
||||
diff --git a/snes/cpu/timing/timing.hpp b/snes/cpu/timing/timing.hpp
|
||||
index 6c225da..bf15a72 100755
|
||||
index 6c225dab..bf15a727 100755
|
||||
--- a/snes/cpu/timing/timing.hpp
|
||||
+++ b/snes/cpu/timing/timing.hpp
|
||||
@@ -22,3 +22,4 @@ alwaysinline bool irq_test();
|
||||
|
@ -122,7 +122,7 @@ index 6c225da..bf15a72 100755
|
|||
void step_auto_joypad_poll();
|
||||
+void step_auto_joypad_poll_NEW(bool polarity);
|
||||
diff --git a/snes/snes.hpp b/snes/snes.hpp
|
||||
index 37ed1fe..4e3ba64 100755
|
||||
index 37ed1feb..4e3ba64c 100755
|
||||
--- a/snes/snes.hpp
|
||||
+++ b/snes/snes.hpp
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -134,5 +134,5 @@ index 37ed1fe..4e3ba64 100755
|
|||
namespace SNES {
|
||||
namespace Info {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fix mouse speed support
|
||||
Subject: [PATCH 15/27] Fix mouse speed support
|
||||
|
||||
---
|
||||
snes/config/config.cpp | 1 +
|
||||
|
@ -11,7 +11,7 @@ Subject: [PATCH 15/23] Fix mouse speed support
|
|||
4 files changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/snes/config/config.cpp b/snes/config/config.cpp
|
||||
index 206daae..1983137 100755
|
||||
index 206daae0..19831370 100755
|
||||
--- a/snes/config/config.cpp
|
||||
+++ b/snes/config/config.cpp
|
||||
@@ -8,6 +8,7 @@ Configuration::Configuration() {
|
||||
|
@ -23,7 +23,7 @@ index 206daae..1983137 100755
|
|||
cpu.version = 2;
|
||||
cpu.ntsc_frequency = 21477272; //315 / 88 * 6000000
|
||||
diff --git a/snes/config/config.hpp b/snes/config/config.hpp
|
||||
index dabde59..68fe0bd 100755
|
||||
index dabde597..68fe0bde 100755
|
||||
--- a/snes/config/config.hpp
|
||||
+++ b/snes/config/config.hpp
|
||||
@@ -1,9 +1,12 @@
|
||||
|
@ -40,7 +40,7 @@ index dabde59..68fe0bd 100755
|
|||
struct CPU {
|
||||
unsigned version;
|
||||
diff --git a/snes/controller/mouse/mouse.cpp b/snes/controller/mouse/mouse.cpp
|
||||
index 1a066b9..caa7a35 100755
|
||||
index 1a066b98..caa7a358 100755
|
||||
--- a/snes/controller/mouse/mouse.cpp
|
||||
+++ b/snes/controller/mouse/mouse.cpp
|
||||
@@ -1,6 +1,10 @@
|
||||
|
@ -87,7 +87,7 @@ index 1a066b9..caa7a35 100755
|
|||
|
||||
#endif
|
||||
diff --git a/snes/controller/mouse/mouse.hpp b/snes/controller/mouse/mouse.hpp
|
||||
index b07c8ab..13a9313 100755
|
||||
index b07c8ab7..13a9313e 100755
|
||||
--- a/snes/controller/mouse/mouse.hpp
|
||||
+++ b/snes/controller/mouse/mouse.hpp
|
||||
@@ -6,6 +6,7 @@ struct Mouse : Controller {
|
||||
|
@ -99,5 +99,5 @@ index b07c8ab..13a9313 100755
|
|||
int _position_y;
|
||||
};
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fix tracelog of controller registers
|
||||
Subject: [PATCH 16/27] Fix tracelog of controller registers
|
||||
|
||||
---
|
||||
snes/cpu/core/disassembler/disassembler.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/snes/cpu/core/disassembler/disassembler.cpp b/snes/cpu/core/disassembler/disassembler.cpp
|
||||
index ab8dde2..624a80c 100755
|
||||
index ab8dde24..624a80ce 100755
|
||||
--- a/snes/cpu/core/disassembler/disassembler.cpp
|
||||
+++ b/snes/cpu/core/disassembler/disassembler.cpp
|
||||
@@ -1,6 +1,8 @@
|
||||
|
@ -21,5 +21,5 @@ index ab8dde2..624a80c 100755
|
|||
//$[00-3f|80-bf]:[2000-5fff]
|
||||
//do not read MMIO registers within debugger
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fix performance problem with non-bus breakpoints
|
||||
Subject: [PATCH 17/27] Fix performance problem with non-bus breakpoints
|
||||
|
||||
---
|
||||
snes/memory/memory.cpp | 35 ++++++++++++++++++++++++++---------
|
||||
|
@ -10,7 +10,7 @@ Subject: [PATCH 17/23] Fix performance problem with non-bus breakpoints
|
|||
3 files changed, 28 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/snes/memory/memory.cpp b/snes/memory/memory.cpp
|
||||
index a9a484a..d22e313 100755
|
||||
index a9a484a0..d22e3137 100755
|
||||
--- a/snes/memory/memory.cpp
|
||||
+++ b/snes/memory/memory.cpp
|
||||
@@ -43,6 +43,7 @@ void Bus::map(
|
||||
|
@ -77,7 +77,7 @@ index a9a484a..d22e313 100755
|
|||
|
||||
Bus::Bus() {
|
||||
diff --git a/snes/memory/memory.hpp b/snes/memory/memory.hpp
|
||||
index c20e14d..ee0c0a9 100755
|
||||
index c20e14db..ee0c0a9e 100755
|
||||
--- a/snes/memory/memory.hpp
|
||||
+++ b/snes/memory/memory.hpp
|
||||
@@ -52,6 +52,7 @@ struct Bus {
|
||||
|
@ -89,7 +89,7 @@ index c20e14d..ee0c0a9 100755
|
|||
unsigned idcount;
|
||||
function<uint8 (unsigned)> reader[256];
|
||||
diff --git a/snes/snes.hpp b/snes/snes.hpp
|
||||
index 4e3ba64..9589db9 100755
|
||||
index 4e3ba64c..9589db9b 100755
|
||||
--- a/snes/snes.hpp
|
||||
+++ b/snes/snes.hpp
|
||||
@@ -38,6 +38,7 @@ namespace SNES {
|
||||
|
@ -101,5 +101,5 @@ index 4e3ba64..9589db9 100755
|
|||
|
||||
#include <gameboy/gameboy.hpp>
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Support VRAM, OAM, CGRAM and APURAM breakpoints
|
||||
Subject: [PATCH 18/27] Support VRAM, OAM, CGRAM and APURAM breakpoints
|
||||
|
||||
---
|
||||
snes/alt/ppu-compatibility/memory/memory.cpp | 44 +++++++++++++++++++++--
|
||||
|
@ -19,7 +19,7 @@ Subject: [PATCH 18/23] Support VRAM, OAM, CGRAM and APURAM breakpoints
|
|||
12 files changed, 122 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/snes/alt/ppu-compatibility/memory/memory.cpp b/snes/alt/ppu-compatibility/memory/memory.cpp
|
||||
index 3f120d8..e47cf20 100755
|
||||
index 3f120d84..e47cf201 100755
|
||||
--- a/snes/alt/ppu-compatibility/memory/memory.cpp
|
||||
+++ b/snes/alt/ppu-compatibility/memory/memory.cpp
|
||||
@@ -47,20 +47,31 @@ uint8 PPU::vram_mmio_read(uint16 addr) {
|
||||
|
@ -139,7 +139,7 @@ index 3f120d8..e47cf20 100755
|
|||
}
|
||||
}
|
||||
diff --git a/snes/alt/ppu-compatibility/ppu.hpp b/snes/alt/ppu-compatibility/ppu.hpp
|
||||
index cccaabb..4adac4c 100755
|
||||
index cccaabba..4adac4c4 100755
|
||||
--- a/snes/alt/ppu-compatibility/ppu.hpp
|
||||
+++ b/snes/alt/ppu-compatibility/ppu.hpp
|
||||
@@ -3,6 +3,12 @@ public:
|
||||
|
@ -156,7 +156,7 @@ index cccaabb..4adac4c 100755
|
|||
enum : bool { Threaded = true };
|
||||
alwaysinline void step(unsigned clocks);
|
||||
diff --git a/snes/cartridge/cartridge.hpp b/snes/cartridge/cartridge.hpp
|
||||
index 82e73c4..2358c08 100755
|
||||
index 82e73c4c..2358c088 100755
|
||||
--- a/snes/cartridge/cartridge.hpp
|
||||
+++ b/snes/cartridge/cartridge.hpp
|
||||
@@ -26,6 +26,10 @@ struct Cartridge : property<Cartridge> {
|
||||
|
@ -171,7 +171,7 @@ index 82e73c4..2358c08 100755
|
|||
|
||||
enum class Slot : unsigned {
|
||||
diff --git a/snes/smp/core/core.hpp b/snes/smp/core/core.hpp
|
||||
index 13d6936..03f9ac6 100755
|
||||
index 13d69364..03f9ac66 100755
|
||||
--- a/snes/smp/core/core.hpp
|
||||
+++ b/snes/smp/core/core.hpp
|
||||
@@ -1,6 +1,6 @@
|
||||
|
@ -183,7 +183,7 @@ index 13d6936..03f9ac6 100755
|
|||
virtual void op_step();
|
||||
|
||||
diff --git a/snes/smp/core/memory.hpp b/snes/smp/core/memory.hpp
|
||||
index c4b6d99..c297962 100755
|
||||
index c4b6d99f..c297962f 100755
|
||||
--- a/snes/smp/core/memory.hpp
|
||||
+++ b/snes/smp/core/memory.hpp
|
||||
@@ -1,9 +1,9 @@
|
||||
|
@ -208,7 +208,7 @@ index c4b6d99..c297962 100755
|
|||
|
||||
alwaysinline void op_writedp(uint8 addr, uint8 data) {
|
||||
diff --git a/snes/smp/core/opcodes.cpp b/snes/smp/core/opcodes.cpp
|
||||
index 95b9844..43db081 100755
|
||||
index 95b9844f..43db081d 100755
|
||||
--- a/snes/smp/core/opcodes.cpp
|
||||
+++ b/snes/smp/core/opcodes.cpp
|
||||
@@ -11,7 +11,7 @@ template<uint8 (SMPcore::*op)(uint8)>
|
||||
|
@ -348,7 +348,7 @@ index 95b9844..43db081 100755
|
|||
}
|
||||
|
||||
diff --git a/snes/smp/debugger/debugger.cpp b/snes/smp/debugger/debugger.cpp
|
||||
index 9546c11..894fdac 100755
|
||||
index 9546c118..894fdac9 100755
|
||||
--- a/snes/smp/debugger/debugger.cpp
|
||||
+++ b/snes/smp/debugger/debugger.cpp
|
||||
@@ -18,8 +18,8 @@ void SMPDebugger::op_step() {
|
||||
|
@ -363,7 +363,7 @@ index 9546c11..894fdac 100755
|
|||
debugger.breakpoint_test(Debugger::Breakpoint::Source::APURAM, Debugger::Breakpoint::Mode::Read, addr, data);
|
||||
return data;
|
||||
diff --git a/snes/smp/debugger/debugger.hpp b/snes/smp/debugger/debugger.hpp
|
||||
index d5d28e5..26bc7af 100755
|
||||
index d5d28e53..26bc7af9 100755
|
||||
--- a/snes/smp/debugger/debugger.hpp
|
||||
+++ b/snes/smp/debugger/debugger.hpp
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
|
@ -376,7 +376,7 @@ index d5d28e5..26bc7af 100755
|
|||
|
||||
SMPDebugger();
|
||||
diff --git a/snes/smp/memory/memory.cpp b/snes/smp/memory/memory.cpp
|
||||
index 391324c..58c1191 100755
|
||||
index 391324c4..58c11915 100755
|
||||
--- a/snes/smp/memory/memory.cpp
|
||||
+++ b/snes/smp/memory/memory.cpp
|
||||
@@ -19,61 +19,83 @@ void SMP::port_write(uint2 port, uint8 data) {
|
||||
|
@ -490,7 +490,7 @@ index 391324c..58c1191 100755
|
|||
cycle_edge();
|
||||
return r;
|
||||
diff --git a/snes/smp/memory/memory.hpp b/snes/smp/memory/memory.hpp
|
||||
index 1a07445..faa28da 100755
|
||||
index 1a07445d..faa28daa 100755
|
||||
--- a/snes/smp/memory/memory.hpp
|
||||
+++ b/snes/smp/memory/memory.hpp
|
||||
@@ -1,9 +1,9 @@
|
||||
|
@ -506,7 +506,7 @@ index 1a07445..faa28da 100755
|
|||
+debugvirtual uint8 op_read(uint16 addr, bool exec);
|
||||
debugvirtual void op_write(uint16 addr, uint8 data);
|
||||
diff --git a/snes/smp/smp.hpp b/snes/smp/smp.hpp
|
||||
index 6b387cb..6b6ae83 100755
|
||||
index 6b387cba..6b6ae837 100755
|
||||
--- a/snes/smp/smp.hpp
|
||||
+++ b/snes/smp/smp.hpp
|
||||
@@ -1,6 +1,10 @@
|
||||
|
@ -521,7 +521,7 @@ index 6b387cb..6b6ae83 100755
|
|||
enum : bool { Threaded = true };
|
||||
alwaysinline void step(unsigned clocks);
|
||||
diff --git a/snes/snes.hpp b/snes/snes.hpp
|
||||
index 9589db9..27632bf 100755
|
||||
index 9589db9b..27632bff 100755
|
||||
--- a/snes/snes.hpp
|
||||
+++ b/snes/snes.hpp
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -533,5 +533,5 @@ index 9589db9..27632bf 100755
|
|||
|
||||
namespace SNES {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] SA1 trace hook support
|
||||
Subject: [PATCH 19/27] SA1 trace hook support
|
||||
|
||||
---
|
||||
snes/chip/sa1/sa1.cpp | 2 ++
|
||||
|
@ -10,7 +10,7 @@ Subject: [PATCH 19/23] SA1 trace hook support
|
|||
3 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/snes/chip/sa1/sa1.cpp b/snes/chip/sa1/sa1.cpp
|
||||
index 30e0080..fdec362 100755
|
||||
index 30e00809..fdec362c 100755
|
||||
--- a/snes/chip/sa1/sa1.cpp
|
||||
+++ b/snes/chip/sa1/sa1.cpp
|
||||
@@ -32,6 +32,8 @@ void SA1::enter() {
|
||||
|
@ -23,7 +23,7 @@ index 30e0080..fdec362 100755
|
|||
}
|
||||
}
|
||||
diff --git a/snes/chip/sa1/sa1.hpp b/snes/chip/sa1/sa1.hpp
|
||||
index 732b2a8..efd3637 100755
|
||||
index 732b2a85..efd36376 100755
|
||||
--- a/snes/chip/sa1/sa1.hpp
|
||||
+++ b/snes/chip/sa1/sa1.hpp
|
||||
@@ -15,6 +15,9 @@ public:
|
||||
|
@ -37,7 +37,7 @@ index 732b2a8..efd3637 100755
|
|||
void enter();
|
||||
void tick();
|
||||
diff --git a/snes/snes.hpp b/snes/snes.hpp
|
||||
index 27632bf..3bdca7e 100755
|
||||
index 27632bff..3bdca7e5 100755
|
||||
--- a/snes/snes.hpp
|
||||
+++ b/snes/snes.hpp
|
||||
@@ -3,6 +3,7 @@
|
||||
|
@ -49,5 +49,5 @@ index 27632bf..3bdca7e 100755
|
|||
namespace SNES {
|
||||
namespace Info {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Fixes to SA1 open bus emulation
|
||||
Subject: [PATCH 20/27] Fixes to SA1 open bus emulation
|
||||
|
||||
---
|
||||
snes/chip/sa1/memory/memory.cpp | 19 +++++++++++--------
|
||||
1 file changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/snes/chip/sa1/memory/memory.cpp b/snes/chip/sa1/memory/memory.cpp
|
||||
index 9bb4ff2..614dfb0 100755
|
||||
index 9bb4ff20..614dfb0c 100755
|
||||
--- a/snes/chip/sa1/memory/memory.cpp
|
||||
+++ b/snes/chip/sa1/memory/memory.cpp
|
||||
@@ -36,6 +36,7 @@ uint8 SA1::bus_read(unsigned addr) {
|
||||
|
@ -74,5 +74,5 @@ index 9bb4ff2..614dfb0 100755
|
|||
|
||||
uint8 SA1::mmc_read(unsigned addr) {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Call notify latch function on alternate timings mode
|
||||
Subject: [PATCH 21/27] Call notify latch function on alternate timings mode
|
||||
too
|
||||
|
||||
---
|
||||
|
@ -9,7 +9,7 @@ Subject: [PATCH 21/23] Call notify latch function on alternate timings mode
|
|||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp
|
||||
index ae8e94f..3fd4d23 100755
|
||||
index ae8e94f8..3fd4d23e 100755
|
||||
--- a/snes/cpu/timing/joypad.cpp
|
||||
+++ b/snes/cpu/timing/joypad.cpp
|
||||
@@ -41,6 +41,7 @@ void CPU::step_auto_joypad_poll_NEW(bool polarity) {
|
||||
|
@ -21,5 +21,5 @@ index ae8e94f..3fd4d23 100755
|
|||
input.port2->latch(1);
|
||||
}
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Support DMA tracing
|
||||
Subject: [PATCH 22/27] Support DMA tracing
|
||||
|
||||
---
|
||||
snes/alt/ppu-compatibility/mmio/mmio.cpp | 18 +++++++
|
||||
|
@ -18,7 +18,7 @@ Subject: [PATCH 22/23] Support DMA tracing
|
|||
11 files changed, 137 insertions(+)
|
||||
|
||||
diff --git a/snes/alt/ppu-compatibility/mmio/mmio.cpp b/snes/alt/ppu-compatibility/mmio/mmio.cpp
|
||||
index aedb67c..0a269cc 100755
|
||||
index aedb67c1..0a269cc0 100755
|
||||
--- a/snes/alt/ppu-compatibility/mmio/mmio.cpp
|
||||
+++ b/snes/alt/ppu-compatibility/mmio/mmio.cpp
|
||||
@@ -1,5 +1,23 @@
|
||||
|
@ -46,7 +46,7 @@ index aedb67c..0a269cc 100755
|
|||
void PPU::mmio_w2100(uint8 value) {
|
||||
if(regs.display_disabled == true && cpu.vcounter() == (!overscan() ? 225 : 240)) {
|
||||
diff --git a/snes/alt/ppu-compatibility/ppu.cpp b/snes/alt/ppu-compatibility/ppu.cpp
|
||||
index 122b143..ac886ed 100755
|
||||
index 122b1430..ac886edc 100755
|
||||
--- a/snes/alt/ppu-compatibility/ppu.cpp
|
||||
+++ b/snes/alt/ppu-compatibility/ppu.cpp
|
||||
@@ -1,4 +1,5 @@
|
||||
|
@ -56,7 +56,7 @@ index 122b143..ac886ed 100755
|
|||
#define PPU_CPP
|
||||
namespace SNES {
|
||||
diff --git a/snes/alt/ppu-compatibility/ppu.hpp b/snes/alt/ppu-compatibility/ppu.hpp
|
||||
index 4adac4c..b0eabf7 100755
|
||||
index 4adac4c4..b0eabf7c 100755
|
||||
--- a/snes/alt/ppu-compatibility/ppu.hpp
|
||||
+++ b/snes/alt/ppu-compatibility/ppu.hpp
|
||||
@@ -14,6 +14,10 @@ public:
|
||||
|
@ -71,7 +71,7 @@ index 4adac4c..b0eabf7 100755
|
|||
#include "mmio/mmio.hpp"
|
||||
#include "render/render.hpp"
|
||||
diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp
|
||||
index 39da6b1..ce112af 100755
|
||||
index 39da6b16..ce112afa 100755
|
||||
--- a/snes/cpu/cpu.cpp
|
||||
+++ b/snes/cpu/cpu.cpp
|
||||
@@ -1,4 +1,5 @@
|
||||
|
@ -81,7 +81,7 @@ index 39da6b1..ce112af 100755
|
|||
#define CPU_CPP
|
||||
namespace SNES {
|
||||
diff --git a/snes/cpu/cpu.hpp b/snes/cpu/cpu.hpp
|
||||
index 4944577..fd665b1 100755
|
||||
index 49445773..fd665b1f 100755
|
||||
--- a/snes/cpu/cpu.hpp
|
||||
+++ b/snes/cpu/cpu.hpp
|
||||
@@ -26,6 +26,7 @@ struct CPU : public Processor, public CPUcore, public PPUcounter {
|
||||
|
@ -93,7 +93,7 @@ index 4944577..fd665b1 100755
|
|||
#include "dma/dma.hpp"
|
||||
#include "memory/memory.hpp"
|
||||
diff --git a/snes/cpu/dma/dma.cpp b/snes/cpu/dma/dma.cpp
|
||||
index 0a00bfe..8f7be26 100755
|
||||
index 0a00bfea..8f7be263 100755
|
||||
--- a/snes/cpu/dma/dma.cpp
|
||||
+++ b/snes/cpu/dma/dma.cpp
|
||||
@@ -144,6 +144,7 @@ void CPU::dma_run() {
|
||||
|
@ -207,7 +207,7 @@ index 0a00bfe..8f7be26 100755
|
|||
+
|
||||
#endif
|
||||
diff --git a/snes/cpu/dma/dma.hpp b/snes/cpu/dma/dma.hpp
|
||||
index 33755bd..8740bb3 100755
|
||||
index 33755bde..8740bb3a 100755
|
||||
--- a/snes/cpu/dma/dma.hpp
|
||||
+++ b/snes/cpu/dma/dma.hpp
|
||||
@@ -77,3 +77,8 @@ void hdma_init();
|
||||
|
@ -220,7 +220,7 @@ index 33755bd..8740bb3 100755
|
|||
+void dma_trace_end(unsigned i);
|
||||
+void dma_trace_hdma(unsigned i);
|
||||
diff --git a/snes/ppu/mmio/mmio.cpp b/snes/ppu/mmio/mmio.cpp
|
||||
index 302f74f..4a4fb9c 100755
|
||||
index 302f74f8..4a4fb9ce 100755
|
||||
--- a/snes/ppu/mmio/mmio.cpp
|
||||
+++ b/snes/ppu/mmio/mmio.cpp
|
||||
@@ -1,5 +1,23 @@
|
||||
|
@ -248,7 +248,7 @@ index 302f74f..4a4fb9c 100755
|
|||
return display.interlace;
|
||||
}
|
||||
diff --git a/snes/ppu/ppu.cpp b/snes/ppu/ppu.cpp
|
||||
index 13e231c..5874209 100755
|
||||
index 13e231cf..58742098 100755
|
||||
--- a/snes/ppu/ppu.cpp
|
||||
+++ b/snes/ppu/ppu.cpp
|
||||
@@ -1,4 +1,5 @@
|
||||
|
@ -258,7 +258,7 @@ index 13e231c..5874209 100755
|
|||
#define PPU_CPP
|
||||
namespace SNES {
|
||||
diff --git a/snes/ppu/ppu.hpp b/snes/ppu/ppu.hpp
|
||||
index fdba113..0addb77 100755
|
||||
index fdba113c..0addb775 100755
|
||||
--- a/snes/ppu/ppu.hpp
|
||||
+++ b/snes/ppu/ppu.hpp
|
||||
@@ -21,6 +21,9 @@ struct PPU : public Processor, public PPUcounter {
|
||||
|
@ -272,7 +272,7 @@ index fdba113..0addb77 100755
|
|||
uint32 *surface;
|
||||
uint32 *output;
|
||||
diff --git a/snes/snes.hpp b/snes/snes.hpp
|
||||
index 3bdca7e..7c48ebb 100755
|
||||
index 3bdca7e5..7c48ebb3 100755
|
||||
--- a/snes/snes.hpp
|
||||
+++ b/snes/snes.hpp
|
||||
@@ -4,6 +4,7 @@
|
||||
|
@ -284,5 +284,5 @@ index 3bdca7e..7c48ebb 100755
|
|||
namespace SNES {
|
||||
namespace Info {
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
|
@ -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/23] Add autopoller and IRQ/NMI tracing
|
||||
Subject: [PATCH 23/27] Add autopoller and IRQ/NMI tracing
|
||||
|
||||
---
|
||||
snes/cpu/cpu.cpp | 3 +++
|
||||
|
@ -9,7 +9,7 @@ Subject: [PATCH 23/23] Add autopoller and IRQ/NMI tracing
|
|||
2 files changed, 17 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/snes/cpu/cpu.cpp b/snes/cpu/cpu.cpp
|
||||
index ce112af..e11fc88 100755
|
||||
index ce112afa..e11fc882 100755
|
||||
--- a/snes/cpu/cpu.cpp
|
||||
+++ b/snes/cpu/cpu.cpp
|
||||
@@ -69,14 +69,17 @@ void CPU::enter() {
|
||||
|
@ -31,7 +31,7 @@ index ce112af..e11fc88 100755
|
|||
add_clocks(186);
|
||||
regs.pc.l = bus.read(0xfffc, false);
|
||||
diff --git a/snes/cpu/timing/joypad.cpp b/snes/cpu/timing/joypad.cpp
|
||||
index 3fd4d23..afca750 100755
|
||||
index 3fd4d23e..afca7504 100755
|
||||
--- a/snes/cpu/timing/joypad.cpp
|
||||
+++ b/snes/cpu/timing/joypad.cpp
|
||||
@@ -6,9 +6,9 @@ void CPU::step_auto_joypad_poll() {
|
||||
|
@ -82,5 +82,5 @@ index 3fd4d23..afca750 100755
|
|||
status.auto_joypad_counter++;
|
||||
}
|
||||
--
|
||||
2.1.4
|
||||
2.15.0.rc1
|
||||
|
||||
|
|
50
bsnes-patches/v085/0024-Build-fixes-for-GCC-5.X.patch
Normal file
50
bsnes-patches/v085/0024-Build-fixes-for-GCC-5.X.patch
Normal file
|
@ -0,0 +1,50 @@
|
|||
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
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
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
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
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
|
||||
|
|
@ -0,0 +1,377 @@
|
|||
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
|
||||
|
|
@ -9,9 +9,27 @@
|
|||
|
||||
namespace boost_fs = boost::filesystem;
|
||||
|
||||
std::string search_include(const std::list<std::string>& searchpath, const std::string& filename,
|
||||
bool is_cmdhelp_file(const std::string& filename)
|
||||
{
|
||||
std::string _filename = filename;
|
||||
return (_filename.length() > 8 && _filename.substr(0, 8) == "cmdhelp/");
|
||||
}
|
||||
|
||||
std::string search_include(const std::list<std::string>& searchpath, const std::string& _filename,
|
||||
const std::string& ref_by)
|
||||
{
|
||||
std::string filename = _filename;
|
||||
//Hack: process cmdhelp includes internally as the date were for the JSON include.
|
||||
if(is_cmdhelp_file(filename)) {
|
||||
if(filename != "cmdhelp/inverselist.hpp") {
|
||||
filename = "../src/" + filename;
|
||||
//Replace the extension with .json.
|
||||
size_t split = filename.find_last_of("./\\");
|
||||
if(split < filename.length() && filename[split] == '.') {
|
||||
filename = filename.substr(0, split) + ".json";
|
||||
}
|
||||
}
|
||||
}
|
||||
size_t p = ref_by.find_last_of("/");
|
||||
if(p < ref_by.length()) {
|
||||
std::string i = ref_by;
|
||||
|
|
1
gambatte
Submodule
1
gambatte
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit a77b5548ae91cf66d1d18d4fbe2aa76eb39c7ea3
|
|
@ -5,6 +5,7 @@
|
|||
#include <set>
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
|
||||
#include "library/framebuffer.hpp"
|
||||
#include "library/dispatch.hpp"
|
||||
|
@ -105,6 +106,10 @@ public:
|
|||
*/
|
||||
virtual dumper_base* start(master_dumper& _mdumper, const std::string& mode, const std::string& targetname)
|
||||
throw(std::bad_alloc, std::runtime_error) = 0;
|
||||
/**
|
||||
* Is hidden?
|
||||
*/
|
||||
virtual bool hidden() const { return false; }
|
||||
/**
|
||||
* Add dumper update notifier object.
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include <string>
|
||||
#include <map>
|
||||
|
||||
class audioapi_instance;
|
||||
|
||||
//All the following need to be implemented by the sound driver itself
|
||||
struct _audioapi_driver
|
||||
{
|
||||
|
@ -79,4 +81,29 @@ std::map<std::string, std::string> audioapi_driver_get_devices(bool rec) throw(s
|
|||
*/
|
||||
const char* audioapi_driver_name() throw();
|
||||
|
||||
#endif
|
||||
/**
|
||||
* 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
|
||||
|
|
|
@ -121,6 +121,9 @@ 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;
|
||||
|
@ -138,6 +141,12 @@ 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;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define _framebuffer__hpp__included__
|
||||
|
||||
#include "core/window.hpp"
|
||||
#include "core/queue.hpp"
|
||||
#include "library/command.hpp"
|
||||
#include "library/framebuffer.hpp"
|
||||
#include "library/triplebuffer.hpp"
|
||||
|
@ -31,7 +32,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);
|
||||
status_updater& _supdater, command::group& _cmd, input_queue& _iqueue);
|
||||
/**
|
||||
* The main framebuffer.
|
||||
*/
|
||||
|
@ -110,6 +111,7 @@ private:
|
|||
loaded_rom& rom;
|
||||
status_updater& supdater;
|
||||
command::group& cmd;
|
||||
input_queue& iqueue;
|
||||
command::_fnptr<command::arg_filename> screenshot;
|
||||
};
|
||||
|
||||
|
|
|
@ -21,6 +21,16 @@ 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.
|
||||
*
|
||||
|
@ -89,6 +99,10 @@ 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;
|
||||
|
@ -97,12 +111,15 @@ 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
|
||||
|
|
|
@ -23,7 +23,7 @@ struct joystick_driver
|
|||
* - The call occurs in the main thread.
|
||||
* - Implemented by the joystick plugin.
|
||||
*/
|
||||
void joystick_driver_init() throw();
|
||||
void joystick_driver_init(bool soft = false) throw();
|
||||
/**
|
||||
* Joystick quit function.
|
||||
*
|
||||
|
@ -31,7 +31,7 @@ void joystick_driver_init() throw();
|
|||
* - The call occurs in the main thread.
|
||||
* - Implemented by the joystick plugin.
|
||||
*/
|
||||
void joystick_driver_quit() throw();
|
||||
void joystick_driver_quit(bool soft = false) throw();
|
||||
/**
|
||||
* Signal the joystick thread to quit.
|
||||
*/
|
||||
|
|
|
@ -7,5 +7,8 @@ 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
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <set>
|
||||
#include <functional>
|
||||
#include "library/memorywatch.hpp"
|
||||
#include "library/json.hpp"
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include "library/string.hpp"
|
||||
#include "library/memtracker.hpp"
|
||||
|
||||
/**
|
||||
* \brief Fatal error.
|
||||
|
|
|
@ -77,8 +77,14 @@ public:
|
|||
*
|
||||
* parameter subframe: True if this is for subframe update, false if for frame update.
|
||||
*/
|
||||
portctrl::frame update_controls(bool subframe) throw(std::bad_alloc, std::runtime_error);
|
||||
portctrl::frame update_controls(bool subframe, bool forced = false) throw(std::bad_alloc, std::runtime_error);
|
||||
|
||||
/**
|
||||
* Notify user poll (exit poll advance).
|
||||
*
|
||||
* returns: If true, update_controls is forced.
|
||||
*/
|
||||
bool notify_user_poll() throw(std::bad_alloc, std::runtime_error);
|
||||
/**
|
||||
* Release memory for mov, mf and rrd.
|
||||
*/
|
||||
|
|
|
@ -51,7 +51,7 @@ extern std::string last_save;
|
|||
* Parameter secs: The seconds counter.
|
||||
* Parameter ssecs: The subsecond counter.
|
||||
*/
|
||||
void mainloop_restore_state(const std::vector<char>& state, uint64_t secs, uint64_t ssecs);
|
||||
void mainloop_restore_state(const dynamic_state& state);
|
||||
|
||||
std::string get_mprefix_for_project();
|
||||
void set_mprefix_for_project(const std::string& pfx);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#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
|
||||
|
@ -39,4 +40,25 @@ private:
|
|||
int s;
|
||||
};
|
||||
|
||||
struct moviefile_sram_extractor_text : public moviefile::sram_extractor
|
||||
{
|
||||
moviefile_sram_extractor_text(const std::string& filename);
|
||||
~moviefile_sram_extractor_text();
|
||||
std::set<std::string> enumerate();
|
||||
void read(const std::string& name, std::vector<char>& v);
|
||||
private:
|
||||
zip::reader z;
|
||||
};
|
||||
|
||||
struct moviefile_sram_extractor_binary : public moviefile::sram_extractor
|
||||
{
|
||||
moviefile_sram_extractor_binary(const std::string& filename);
|
||||
~moviefile_sram_extractor_binary();
|
||||
std::set<std::string> enumerate();
|
||||
void read(const std::string& name, std::vector<char>& v);
|
||||
private:
|
||||
int s;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,6 +14,69 @@
|
|||
|
||||
class loaded_rom;
|
||||
|
||||
/**
|
||||
* Dynamic state parts of movie file.
|
||||
*/
|
||||
struct dynamic_state
|
||||
{
|
||||
/**
|
||||
* Ctor.
|
||||
*/
|
||||
dynamic_state();
|
||||
/**
|
||||
* Contents of SRAM on time of savestate (if is_savestate is true).
|
||||
*/
|
||||
std::map<std::string, std::vector<char>> sram;
|
||||
/**
|
||||
* Core savestate (if is_savestate is true).
|
||||
*/
|
||||
std::vector<char> savestate; //Savestate to load (if is_savestate is true).
|
||||
/**
|
||||
* Host memory (if is_savestate is true).
|
||||
*/
|
||||
std::vector<char> host_memory;
|
||||
/**
|
||||
* Screenshot (if is_savestate is true).
|
||||
*/
|
||||
std::vector<char> screenshot;
|
||||
/**
|
||||
* Current frame (if is_savestate is true).
|
||||
*/
|
||||
uint64_t save_frame;
|
||||
/**
|
||||
* Number of lagged frames (if is_savestate is true).
|
||||
*/
|
||||
uint64_t lagged_frames;
|
||||
/**
|
||||
* Poll counters (if is_savestate is true).
|
||||
*/
|
||||
std::vector<uint32_t> pollcounters;
|
||||
/**
|
||||
* Poll flag.
|
||||
*/
|
||||
unsigned poll_flag;
|
||||
/**
|
||||
* Current RTC second.
|
||||
*/
|
||||
int64_t rtc_second;
|
||||
/**
|
||||
* Current RTC subsecond.
|
||||
*/
|
||||
int64_t rtc_subsecond;
|
||||
/**
|
||||
* Active macros at savestate.
|
||||
*/
|
||||
std::map<std::string, uint64_t> active_macros;
|
||||
/**
|
||||
* Clear the state to power-on defaults.
|
||||
*/
|
||||
void clear(int64_t sec, int64_t ssec, const std::map<std::string, std::vector<char>>& initsram);
|
||||
/**
|
||||
* Swap the dynamic state with another.
|
||||
*/
|
||||
void swap(dynamic_state& s) throw();
|
||||
};
|
||||
|
||||
/**
|
||||
* This structure gives parsed representationg of movie file, as result of decoding or for encoding.
|
||||
*/
|
||||
|
@ -52,6 +115,24 @@ struct moviefile
|
|||
private:
|
||||
branch_extractor* real;
|
||||
};
|
||||
/**
|
||||
* Extract SRAMs.
|
||||
*/
|
||||
struct sram_extractor
|
||||
{
|
||||
sram_extractor(const std::string& filename);
|
||||
virtual ~sram_extractor();
|
||||
virtual std::set<std::string> enumerate() { return real->enumerate(); }
|
||||
virtual void read(const std::string& name, std::vector<char>& v) { real->read(name, v); }
|
||||
protected:
|
||||
sram_extractor() { real = NULL; }
|
||||
private:
|
||||
sram_extractor* real;
|
||||
};
|
||||
/**
|
||||
* Identify if file is movie/savestate file or not.
|
||||
*/
|
||||
static bool is_movie_or_savestate(const std::string& filename);
|
||||
/**
|
||||
* This constructor construct movie structure with default settings.
|
||||
*
|
||||
|
@ -90,12 +171,12 @@ struct moviefile
|
|||
* throws std::bad_alloc: Not enough memory.
|
||||
* throws std::runtime_error: Can't save the movie file.
|
||||
*/
|
||||
void save(const std::string& filename, unsigned compression, bool binary, rrdata_set& rrd)
|
||||
void save(const std::string& filename, unsigned compression, bool binary, rrdata_set& rrd, bool as_state)
|
||||
throw(std::bad_alloc, std::runtime_error);
|
||||
/**
|
||||
* Reads this movie structure and saves it to stream (uncompressed ZIP).
|
||||
*/
|
||||
void save(std::ostream& outstream, rrdata_set& rrd) throw(std::bad_alloc, std::runtime_error);
|
||||
void save(std::ostream& outstream, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error);
|
||||
/**
|
||||
* Force loading as corrupt.
|
||||
*/
|
||||
|
@ -152,46 +233,10 @@ struct moviefile
|
|||
* Contents of RAM on time of initial powerup.
|
||||
*/
|
||||
std::map<std::string, std::vector<char>> ramcontent;
|
||||
/**
|
||||
* True if savestate, false if movie.
|
||||
*/
|
||||
bool is_savestate;
|
||||
/**
|
||||
* Contents of SRAM on time of savestate (if is_savestate is true).
|
||||
*/
|
||||
std::map<std::string, std::vector<char>> sram;
|
||||
/**
|
||||
* Core savestate (if is_savestate is true).
|
||||
*/
|
||||
std::vector<char> savestate; //Savestate to load (if is_savestate is true).
|
||||
/**
|
||||
* Anchoring core savestate (if not empty).
|
||||
*/
|
||||
std::vector<char> anchor_savestate;
|
||||
/**
|
||||
* Host memory (if is_savestate is true).
|
||||
*/
|
||||
std::vector<char> host_memory;
|
||||
/**
|
||||
* Screenshot (if is_savestate is true).
|
||||
*/
|
||||
std::vector<char> screenshot;
|
||||
/**
|
||||
* Current frame (if is_savestate is true).
|
||||
*/
|
||||
uint64_t save_frame;
|
||||
/**
|
||||
* Number of lagged frames (if is_savestate is true).
|
||||
*/
|
||||
uint64_t lagged_frames;
|
||||
/**
|
||||
* Poll counters (if is_savestate is true).
|
||||
*/
|
||||
std::vector<uint32_t> pollcounters;
|
||||
/**
|
||||
* Poll flag.
|
||||
*/
|
||||
unsigned poll_flag;
|
||||
/**
|
||||
* Compressed rrdata.
|
||||
*/
|
||||
|
@ -204,14 +249,6 @@ struct moviefile
|
|||
* Branches.
|
||||
*/
|
||||
std::map<std::string, portctrl::frame_vector> branches;
|
||||
/**
|
||||
* Current RTC second.
|
||||
*/
|
||||
int64_t rtc_second;
|
||||
/**
|
||||
* Current RTC subsecond.
|
||||
*/
|
||||
int64_t rtc_subsecond;
|
||||
/**
|
||||
* Movie starting RTC second.
|
||||
*/
|
||||
|
@ -233,9 +270,9 @@ struct moviefile
|
|||
*/
|
||||
std::map<moviefile_subtiming, std::string> subtitles;
|
||||
/**
|
||||
* Active macros at savestate.
|
||||
* Dynamic state.
|
||||
*/
|
||||
std::map<std::string, uint64_t> active_macros;
|
||||
dynamic_state dyn;
|
||||
/**
|
||||
* Get number of frames in movie.
|
||||
*
|
||||
|
@ -274,13 +311,18 @@ struct moviefile
|
|||
* Fixup input pointer post-copy.
|
||||
*/
|
||||
void fixup_current_branch(const moviefile& mv);
|
||||
/**
|
||||
* Clear the dynamic state to power-on defaults.
|
||||
*/
|
||||
void clear_dynstate();
|
||||
private:
|
||||
moviefile(const moviefile&);
|
||||
moviefile& operator=(const moviefile&);
|
||||
void binary_io(int stream, rrdata_set& rrd) throw(std::bad_alloc, std::runtime_error);
|
||||
void binary_io(int stream, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error);
|
||||
void binary_io(int stream, struct core_type& romtype) throw(std::bad_alloc, std::runtime_error);
|
||||
void save(zip::writer& w, rrdata_set& rrd) throw(std::bad_alloc, std::runtime_error);
|
||||
void save(zip::writer& w, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error);
|
||||
void load(zip::reader& r, core_type& romtype) throw(std::bad_alloc, std::runtime_error);
|
||||
memtracker::autorelease tracker;
|
||||
};
|
||||
|
||||
void emerg_save_movie(const moviefile& mv, rrdata_set& rrd);
|
||||
|
|
12
include/core/nullcore.hpp
Normal file
12
include/core/nullcore.hpp
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef _nullcore__hpp__included__
|
||||
#define _nullcore__hpp__included__
|
||||
|
||||
class core_core;
|
||||
class core_type;
|
||||
class core_region;
|
||||
|
||||
core_core& get_null_core();
|
||||
core_type& get_null_type();
|
||||
core_region& get_null_region();
|
||||
|
||||
#endif
|
|
@ -164,7 +164,7 @@ class project_state
|
|||
{
|
||||
public:
|
||||
project_state(voice_commentary& _commentary, memwatch_set& _mwatch, command::group& _command,
|
||||
controller_state& _controls, settingvar::cache& _setcache, button_mapping& _buttons,
|
||||
controller_state& _controls, settingvar::group& _setgroup, 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::cache& setcache;
|
||||
settingvar::group& setgroup;
|
||||
button_mapping& buttons;
|
||||
emulator_dispatch& edispatch;
|
||||
input_queue& iqueue;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "library/exrethrow.hpp"
|
||||
#include "library/keyboard.hpp"
|
||||
#include "library/threads.hpp"
|
||||
#include <functional>
|
||||
#include <deque>
|
||||
|
||||
namespace command
|
||||
|
|
|
@ -47,4 +47,9 @@ void random_mix_timing_entropy();
|
|||
*/
|
||||
void highrandom_256(uint8_t* buf);
|
||||
|
||||
/**
|
||||
* Contribute buffer of entropy.
|
||||
*/
|
||||
void contribute_random_entropy(void* buf, size_t bytes);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -7,27 +7,10 @@
|
|||
#include <stdexcept>
|
||||
#include "core/misc.hpp"
|
||||
#include "core/rom-small.hpp"
|
||||
#include "core/romimage.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/fileimage.hpp"
|
||||
|
||||
//ROM request.
|
||||
struct rom_request
|
||||
{
|
||||
//List of core types.
|
||||
std::vector<core_type*> cores;
|
||||
//Selected core (default core on call).
|
||||
bool core_guessed;
|
||||
size_t selected;
|
||||
//Filename selected (on entry, filename hint).
|
||||
bool has_slot[ROM_SLOT_COUNT];
|
||||
bool guessed[ROM_SLOT_COUNT];
|
||||
std::string filename[ROM_SLOT_COUNT];
|
||||
std::string hash[ROM_SLOT_COUNT];
|
||||
std::string hashxml[ROM_SLOT_COUNT];
|
||||
//Canceled flag.
|
||||
bool canceled;
|
||||
};
|
||||
|
||||
/**
|
||||
* ROM loaded into memory.
|
||||
*/
|
||||
|
@ -38,50 +21,13 @@ struct loaded_rom
|
|||
*/
|
||||
loaded_rom() throw();
|
||||
/**
|
||||
* Take in ROM filename (or a bundle) and load it to memory.
|
||||
* Create ROM from image.
|
||||
*
|
||||
* parameter file: The file to load
|
||||
* parameter tmpprefer: The core name to prefer.
|
||||
* parameter _image: The image to use load
|
||||
* throws std::bad_alloc: Not enough memory.
|
||||
* throws std::runtime_error: Loading ROM file failed.
|
||||
*/
|
||||
loaded_rom(const std::string& file, const std::string& tmpprefer = "") throw(std::bad_alloc,
|
||||
std::runtime_error);
|
||||
/**
|
||||
* Take a ROM and load it.
|
||||
*/
|
||||
loaded_rom(const std::string& file, const std::string& core, const std::string& type,
|
||||
const std::string& region);
|
||||
/**
|
||||
* Load a multi-file ROM.
|
||||
*/
|
||||
loaded_rom(const std::string file[ROM_SLOT_COUNT], const std::string& core, const std::string& type,
|
||||
const std::string& region);
|
||||
/**
|
||||
* Take in ROM filename and load it to memory with specified type.
|
||||
*
|
||||
* parameter file: The file to load
|
||||
* parameter ctype: The core type to use.
|
||||
* throws std::bad_alloc: Not enough memory.
|
||||
* throws std::runtime_error: Loading ROM file failed.
|
||||
*/
|
||||
loaded_rom(const std::string& file, core_type& ctype) throw(std::bad_alloc, std::runtime_error);
|
||||
/**
|
||||
* Loaded main ROM
|
||||
*/
|
||||
fileimage::image romimg[ROM_SLOT_COUNT];
|
||||
/**
|
||||
* Loaded main ROM XML
|
||||
*/
|
||||
fileimage::image romxml[ROM_SLOT_COUNT];
|
||||
/**
|
||||
* MSU-1 base.
|
||||
*/
|
||||
std::string msu1_base;
|
||||
/**
|
||||
* Load filename.
|
||||
*/
|
||||
std::string load_filename;
|
||||
loaded_rom(rom_image_handle _image) throw(std::bad_alloc, std::runtime_error);
|
||||
/**
|
||||
* Switches the active cartridge to this cartridge. The compatiblity between selected region and original region
|
||||
* is checked. Region is updated after cartridge has been loaded.
|
||||
|
@ -91,6 +37,10 @@ struct loaded_rom
|
|||
*/
|
||||
void load(std::map<std::string, std::string>& settings, uint64_t rtc_sec, uint64_t rtc_subsec)
|
||||
throw(std::bad_alloc, std::runtime_error);
|
||||
/**
|
||||
* Reset the emulation state to state just before last load.
|
||||
*/
|
||||
void reset_to_load() { return rtype().reset_to_load(); }
|
||||
/**
|
||||
* Saves core state into buffer. WARNING: This takes emulated time.
|
||||
*
|
||||
|
@ -107,19 +57,10 @@ struct loaded_rom
|
|||
*/
|
||||
void load_core_state(const std::vector<char>& buf, bool nochecksum = false) throw(std::runtime_error);
|
||||
|
||||
/**
|
||||
* Is file a gamepak?
|
||||
*
|
||||
* parameter filename: The file to probe.
|
||||
* retruns: True if gamepak, false if not.
|
||||
* throws std::runtime_error: No such file.
|
||||
*/
|
||||
static bool is_gamepak(const std::string& filename) throw(std::bad_alloc, std::runtime_error);
|
||||
|
||||
/**
|
||||
* Get internal type representation.
|
||||
*/
|
||||
core_type& get_internal_rom_type() { return *rtype; }
|
||||
core_type& get_internal_rom_type() { return rtype(); }
|
||||
/**
|
||||
* Get internal region representation.
|
||||
*/
|
||||
|
@ -127,95 +68,109 @@ struct loaded_rom
|
|||
/**
|
||||
* Is same ROM type?
|
||||
*/
|
||||
bool is_of_type(core_type& type) { return (rtype == &type); }
|
||||
bool is_of_type(core_type& type) { return image->is_of_type(type); }
|
||||
/**
|
||||
* Get gametype of this ROM.
|
||||
*/
|
||||
core_sysregion& get_sysregion() { return rtype->combine_region(*region); }
|
||||
core_sysregion& get_sysregion() { return rtype().combine_region(*region); }
|
||||
/**
|
||||
* Set internal region representation.
|
||||
*/
|
||||
void set_internal_region(core_region& reg) { region = ® }
|
||||
|
||||
/**
|
||||
* Access main ROM image.
|
||||
*
|
||||
* parameter index: The index of ROM slot to access.
|
||||
* returns: The ROM image (NULL image if index is out of range).
|
||||
*/
|
||||
fileimage::image& get_rom(size_t index) { return image->get_image(index, false); }
|
||||
/**
|
||||
* Access ROM markup image.
|
||||
*
|
||||
* parameter index: The index of ROM slot to access.
|
||||
* returns: The ROM markup image (NULL image if index is out of range).
|
||||
*/
|
||||
fileimage::image& get_markup(size_t index) { return image->get_image(index, true); }
|
||||
/**
|
||||
* Get filename of ROM pack, if any.
|
||||
*/
|
||||
const std::string& get_pack_filename() { return image->get_pack_filename(); }
|
||||
/**
|
||||
* Get MSU-1 base fileaname.
|
||||
*/
|
||||
const std::string& get_msu1_base() { return image->get_msu1_base(); }
|
||||
//ROM methods.
|
||||
std::string get_core_identifier() { return rtype->get_core_identifier(); }
|
||||
std::string get_core_identifier() { return rtype().get_core_identifier(); }
|
||||
std::pair<uint32_t, uint32_t> get_scale_factors(uint32_t width, uint32_t height)
|
||||
{
|
||||
return rtype->get_scale_factors(width, height);
|
||||
return rtype().get_scale_factors(width, height);
|
||||
}
|
||||
const std::string& get_hname() { return rtype->get_hname(); }
|
||||
core_sysregion& combine_region(core_region& reg) { return rtype->combine_region(reg); }
|
||||
bool isnull() { return !rtype || rtype->isnull(); }
|
||||
std::vector<std::string> get_trace_cpus() { return rtype->get_trace_cpus(); }
|
||||
const std::string& get_hname() { return image->get_hname(); }
|
||||
core_sysregion& combine_region(core_region& reg) { return rtype().combine_region(reg); }
|
||||
bool isnull() { return rtype().isnull(); }
|
||||
std::vector<std::string> get_trace_cpus() { return rtype().get_trace_cpus(); }
|
||||
controller_set controllerconfig(std::map<std::string, std::string>& settings)
|
||||
{
|
||||
return rtype->controllerconfig(settings);
|
||||
return rtype().controllerconfig(settings);
|
||||
}
|
||||
core_setting_group& get_settings() { return rtype->get_settings(); }
|
||||
std::set<std::string> srams() { return rtype->srams(); }
|
||||
double get_PAR() { return rtype->get_PAR(); }
|
||||
std::string get_systemmenu_name() { return rtype->get_systemmenu_name(); }
|
||||
unsigned action_flags(unsigned id) { return rtype->action_flags(id); }
|
||||
std::set<const interface_action*> get_actions() { return rtype->get_actions(); }
|
||||
core_setting_group& get_settings() { return rtype().get_settings(); }
|
||||
std::set<std::string> srams() { return rtype().srams(); }
|
||||
double get_PAR() { return rtype().get_PAR(); }
|
||||
std::string get_systemmenu_name() { return rtype().get_systemmenu_name(); }
|
||||
unsigned action_flags(unsigned id) { return rtype().action_flags(id); }
|
||||
std::set<const interface_action*> get_actions() { return rtype().get_actions(); }
|
||||
void execute_action(unsigned id, const std::vector<interface_action_paramval>& p)
|
||||
{
|
||||
return rtype->execute_action(id, p);
|
||||
return rtype().execute_action(id, p);
|
||||
}
|
||||
std::pair<unsigned, unsigned> lightgun_scale() { return rtype->lightgun_scale(); }
|
||||
const interface_device_reg* get_registers() { return rtype->get_registers(); }
|
||||
bool get_pflag() { return rtype->get_pflag(); }
|
||||
void set_pflag(bool pflag) { rtype->set_pflag(pflag); }
|
||||
std::pair<uint64_t, uint64_t> get_bus_map() { return rtype->get_bus_map(); }
|
||||
std::list<core_region*> get_regions() { return rtype->get_regions(); }
|
||||
const std::string& get_iname() { return rtype->get_iname(); }
|
||||
std::map<std::string, std::vector<char>> save_sram() throw(std::bad_alloc) { return rtype->save_sram(); }
|
||||
std::pair<unsigned, unsigned> lightgun_scale() { return rtype().lightgun_scale(); }
|
||||
const interface_device_reg* get_registers() { return rtype().get_registers(); }
|
||||
bool get_pflag() { return rtype().get_pflag(); }
|
||||
void set_pflag(bool pflag) { rtype().set_pflag(pflag); }
|
||||
std::pair<uint64_t, uint64_t> get_bus_map() { return rtype().get_bus_map(); }
|
||||
std::list<core_region*> get_regions() { return image->get_regions(); }
|
||||
const std::string& get_iname() { return rtype().get_iname(); }
|
||||
std::map<std::string, std::vector<char>> save_sram() throw(std::bad_alloc) { return rtype().save_sram(); }
|
||||
void load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc)
|
||||
{
|
||||
rtype->load_sram(sram);
|
||||
rtype().load_sram(sram);
|
||||
}
|
||||
std::list<core_vma_info> vma_list() { return rtype->vma_list(); }
|
||||
framebuffer::raw& draw_cover() { return rtype->draw_cover(); }
|
||||
int reset_action(bool hard) { return rtype->reset_action(hard); }
|
||||
void pre_emulate_frame(portctrl::frame& cf) { return rtype->pre_emulate_frame(cf); }
|
||||
void emulate() { rtype->emulate(); }
|
||||
void runtosave() { rtype->runtosave(); }
|
||||
std::pair<uint32_t, uint32_t> get_audio_rate() { return rtype->get_audio_rate(); }
|
||||
std::list<core_vma_info> vma_list() { return rtype().vma_list(); }
|
||||
framebuffer::raw& draw_cover() { return rtype().draw_cover(); }
|
||||
int reset_action(bool hard) { return rtype().reset_action(hard); }
|
||||
void pre_emulate_frame(portctrl::frame& cf) { return rtype().pre_emulate_frame(cf); }
|
||||
void emulate() { rtype().emulate(); }
|
||||
void runtosave() { rtype().runtosave(); }
|
||||
std::pair<uint32_t, uint32_t> get_audio_rate() { return rtype().get_audio_rate(); }
|
||||
void set_debug_flags(uint64_t addr, unsigned flags_set, unsigned flags_clear)
|
||||
{
|
||||
return rtype->set_debug_flags(addr, flags_set, flags_clear);
|
||||
return rtype().set_debug_flags(addr, flags_set, flags_clear);
|
||||
}
|
||||
void set_cheat(uint64_t addr, uint64_t value, bool set)
|
||||
{
|
||||
return rtype->set_cheat(addr, value, set);
|
||||
return rtype().set_cheat(addr, value, set);
|
||||
}
|
||||
void debug_reset()
|
||||
{
|
||||
rtype->debug_reset();
|
||||
rtype().debug_reset();
|
||||
}
|
||||
//Region methods.
|
||||
const std::string& orig_region_get_iname() { return orig_region->get_iname(); }
|
||||
const std::string& orig_region_get_hname() { return orig_region->get_hname(); }
|
||||
const std::string& orig_region_get_iname() { return image->get_region().get_iname(); }
|
||||
const std::string& orig_region_get_hname() { return image->get_region().get_hname(); }
|
||||
const std::string& region_get_iname() { return region->get_iname(); }
|
||||
const std::string& region_get_hname() { return region->get_hname(); }
|
||||
double region_approx_framerate() { return region->approx_framerate(); }
|
||||
void region_fill_framerate_magic(uint64_t* magic) { region->fill_framerate_magic(magic); }
|
||||
bool region_compatible_with(core_region& run)
|
||||
{
|
||||
return orig_region && orig_region->compatible_with(run);
|
||||
return image->get_region().compatible_with(run);
|
||||
}
|
||||
private:
|
||||
/**
|
||||
* ROM type
|
||||
*/
|
||||
core_type* rtype;
|
||||
/**
|
||||
* ROM region (this is the currently active region).
|
||||
*/
|
||||
core_type& rtype() { return image->get_type(); }
|
||||
//The internal ROM image.
|
||||
rom_image_handle image;
|
||||
//ROM region.
|
||||
core_region* region;
|
||||
/**
|
||||
* ROM original region (this is the region ROM is loaded as).
|
||||
*/
|
||||
core_region* orig_region;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -236,11 +191,6 @@ std::pair<core_type*, core_region*> get_current_rom_info() throw();
|
|||
std::map<std::string, std::vector<char>> load_sram_commandline(const std::vector<std::string>& cmdline)
|
||||
throw(std::bad_alloc, std::runtime_error);
|
||||
|
||||
/**
|
||||
* Set the hasher callback.
|
||||
*/
|
||||
void set_hasher_callback(std::function<void(uint64_t, uint64_t)> cb);
|
||||
|
||||
struct romload_request
|
||||
{
|
||||
//Pack file to load. Overrides everything else.
|
||||
|
@ -260,17 +210,10 @@ bool _load_new_rom(const romload_request& req);
|
|||
bool reload_active_rom();
|
||||
regex_results get_argument(const std::vector<std::string>& cmdline, const std::string& regexp);
|
||||
std::string get_requested_core(const std::vector<std::string>& cmdline);
|
||||
loaded_rom construct_rom(const std::string& movie_filename, const std::vector<std::string>& cmdline);
|
||||
void try_guess_roms(rom_request& req);
|
||||
void record_filehash(const std::string& file, uint64_t prefix, const std::string& hash);
|
||||
std::string try_to_guess_rom(const std::string& hint, const std::string& hash, const std::string& xhash,
|
||||
core_type& type, unsigned i);
|
||||
|
||||
|
||||
//Map of preferred cores for each extension and type.
|
||||
extern std::map<std::string, core_type*> preferred_core;
|
||||
//Main hasher
|
||||
extern fileimage::hash lsnes_image_hasher;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
231
include/core/romimage.hpp
Normal file
231
include/core/romimage.hpp
Normal file
|
@ -0,0 +1,231 @@
|
|||
#ifndef _romimage__hpp__included__
|
||||
#define _romimage__hpp__included__
|
||||
|
||||
#include <functional>
|
||||
#include "core/rom-small.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/fileimage.hpp"
|
||||
#include "library/threads.hpp"
|
||||
|
||||
//ROM request.
|
||||
struct rom_request
|
||||
{
|
||||
//List of core types.
|
||||
std::vector<core_type*> cores;
|
||||
//Selected core (default core on call).
|
||||
bool core_guessed;
|
||||
size_t selected;
|
||||
//Filename selected (on entry, filename hint).
|
||||
bool has_slot[ROM_SLOT_COUNT];
|
||||
bool guessed[ROM_SLOT_COUNT];
|
||||
std::string filename[ROM_SLOT_COUNT];
|
||||
std::string hash[ROM_SLOT_COUNT];
|
||||
std::string hashxml[ROM_SLOT_COUNT];
|
||||
//Canceled flag.
|
||||
bool canceled;
|
||||
};
|
||||
|
||||
/**
|
||||
* A collection of files making up a ROM image.
|
||||
*/
|
||||
class rom_image
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Create blank ROM
|
||||
*/
|
||||
rom_image() throw();
|
||||
/**
|
||||
* Take in ROM filename (or a bundle) and load it to memory.
|
||||
*
|
||||
* parameter file: The file to load
|
||||
* parameter tmpprefer: The core name to prefer.
|
||||
* throws std::bad_alloc: Not enough memory.
|
||||
* throws std::runtime_error: Loading ROM file failed.
|
||||
*/
|
||||
rom_image(const std::string& file, const std::string& tmpprefer = "") throw(std::bad_alloc,
|
||||
std::runtime_error);
|
||||
/**
|
||||
* Take a ROM and load it.
|
||||
*/
|
||||
rom_image(const std::string& file, const std::string& core, const std::string& type,
|
||||
const std::string& region);
|
||||
/**
|
||||
* Load a multi-file ROM.
|
||||
*/
|
||||
rom_image(const std::string file[ROM_SLOT_COUNT], const std::string& core, const std::string& type,
|
||||
const std::string& region);
|
||||
/**
|
||||
* Take in ROM filename and load it to memory with specified type.
|
||||
*
|
||||
* parameter file: The file to load
|
||||
* parameter ctype: The core type to use.
|
||||
* throws std::bad_alloc: Not enough memory.
|
||||
* throws std::runtime_error: Loading ROM file failed.
|
||||
*/
|
||||
rom_image(const std::string& file, core_type& ctype) throw(std::bad_alloc, std::runtime_error);
|
||||
/**
|
||||
* Destroy ROM image.
|
||||
*/
|
||||
~rom_image();
|
||||
/**
|
||||
* Get ROM type.
|
||||
*/
|
||||
core_type& get_type() { return *rtype; }
|
||||
/**
|
||||
* Get ROM region.
|
||||
*/
|
||||
core_region& get_region() { return *orig_region; }
|
||||
/**
|
||||
* Do region setup. Changes orig_region to specified if NULL.
|
||||
*/
|
||||
void setup_region(core_region& reg);
|
||||
/**
|
||||
* Get image.
|
||||
*/
|
||||
fileimage::image& get_image(size_t index, bool xml)
|
||||
{
|
||||
if(index < ROM_SLOT_COUNT) {
|
||||
if(xml)
|
||||
return romxml[index];
|
||||
else
|
||||
return romimg[index];
|
||||
} else
|
||||
return null_img;
|
||||
}
|
||||
/**
|
||||
* Get filename of ROM pack, if any.
|
||||
*/
|
||||
const std::string& get_pack_filename() { return load_filename; }
|
||||
/**
|
||||
* Get MSU-1 base fileaname.
|
||||
*/
|
||||
const std::string& get_msu1_base() { return msu1_base; }
|
||||
/**
|
||||
* Is same ROM type?
|
||||
*/
|
||||
bool is_of_type(core_type& type) { return (rtype == &type); }
|
||||
/**
|
||||
* Is file a gamepak?
|
||||
*
|
||||
* parameter filename: The file to probe.
|
||||
* retruns: True if gamepak, false if not.
|
||||
* throws std::runtime_error: No such file.
|
||||
*/
|
||||
static bool is_gamepak(const std::string& filename) throw(std::bad_alloc, std::runtime_error);
|
||||
//ROM functions.
|
||||
std::list<core_region*> get_regions() { return rtype->get_regions(); }
|
||||
const std::string& get_hname() { return rtype->get_hname(); }
|
||||
private:
|
||||
rom_image(const rom_image&);
|
||||
rom_image& operator=(const rom_image&);
|
||||
//Account images.
|
||||
void account_images();
|
||||
//Static NULL image.
|
||||
static fileimage::image null_img;
|
||||
//Loaded ROM images.
|
||||
fileimage::image romimg[ROM_SLOT_COUNT];
|
||||
//Loaded ROM XML (markup) images.
|
||||
fileimage::image romxml[ROM_SLOT_COUNT];
|
||||
//MSU-1 base filename.
|
||||
std::string msu1_base;
|
||||
//Load filename.
|
||||
std::string load_filename;
|
||||
//ROM type.
|
||||
core_type* rtype;
|
||||
//ROM region.
|
||||
core_region* region;
|
||||
//Region ROM was loaded as.
|
||||
core_region* orig_region;
|
||||
//Reference count.
|
||||
threads::lock usage_lock;
|
||||
size_t usage_count;
|
||||
void get() { threads::alock l(usage_lock); usage_count++; }
|
||||
bool put() { threads::alock l(usage_lock); return !--usage_count; }
|
||||
friend class rom_image_handle;
|
||||
//Handle bundle load case.
|
||||
void load_bundle(const std::string& file, std::istream& spec, const std::string& tmpprefer)
|
||||
throw(std::bad_alloc, std::runtime_error);
|
||||
//Tracker.
|
||||
memtracker::autorelease tracker;
|
||||
};
|
||||
|
||||
/**
|
||||
* A handle for ROM imageset.
|
||||
*/
|
||||
class rom_image_handle
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Create a handle to NULL imageset.
|
||||
*/
|
||||
rom_image_handle()
|
||||
{
|
||||
img = &null_img;
|
||||
}
|
||||
/**
|
||||
* Create a new handle with refcount 1. The specified ROM imageset has to be allocated using new.
|
||||
*/
|
||||
rom_image_handle(rom_image* _img)
|
||||
{
|
||||
img = _img;
|
||||
img->usage_count = 1;
|
||||
}
|
||||
/**
|
||||
* Copy-construct a handle.
|
||||
*/
|
||||
rom_image_handle(const rom_image_handle& h)
|
||||
{
|
||||
h.get();
|
||||
img = h.img;
|
||||
}
|
||||
/**
|
||||
* Assign a handle.
|
||||
*/
|
||||
rom_image_handle& operator=(const rom_image_handle& h)
|
||||
{
|
||||
if(img == h.img) return *this;
|
||||
h.get();
|
||||
put();
|
||||
img = h.img;
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* Destroy a handle.
|
||||
*/
|
||||
~rom_image_handle()
|
||||
{
|
||||
put();
|
||||
}
|
||||
/**
|
||||
* Access the handle.
|
||||
*/
|
||||
rom_image& operator*()
|
||||
{
|
||||
return *img;
|
||||
}
|
||||
/**
|
||||
* Access the handle.
|
||||
*/
|
||||
rom_image* operator->()
|
||||
{
|
||||
return img;
|
||||
}
|
||||
private:
|
||||
static rom_image null_img;
|
||||
mutable rom_image* img;
|
||||
void get() const { if(img != &null_img) img->get(); }
|
||||
void put() const { if(img != &null_img && img->put()) delete img; }
|
||||
};
|
||||
|
||||
|
||||
void record_filehash(const std::string& file, uint64_t prefix, const std::string& hash);
|
||||
void set_hasher_callback(std::function<void(uint64_t, uint64_t)> cb);
|
||||
rom_image_handle construct_rom(const std::string& movie_filename, const std::vector<std::string>& cmdline);
|
||||
|
||||
//Map of preferred cores for each extension and type.
|
||||
extern std::map<std::string, core_type*> preferred_core;
|
||||
//Main hasher
|
||||
extern fileimage::hash lsnes_image_hasher;
|
||||
|
||||
#endif
|
|
@ -161,9 +161,12 @@ public:
|
|||
* Get current point
|
||||
*/
|
||||
unsigned get_point();
|
||||
/**
|
||||
* Get the current runmode.
|
||||
*/
|
||||
uint64_t get();
|
||||
private:
|
||||
void revalidate();
|
||||
uint64_t get();
|
||||
void set(uint64_t m);
|
||||
bool is(uint64_t m);
|
||||
uint64_t mode;
|
||||
|
|
|
@ -5,4 +5,10 @@
|
|||
|
||||
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
|
||||
|
|
|
@ -49,6 +49,8 @@ struct dumper_information_1
|
|||
std::string name;
|
||||
//Is this dumper active?
|
||||
bool active;
|
||||
//Hidden?
|
||||
bool hidden;
|
||||
//Modes available (first is internal name, second is human-readable one).
|
||||
std::map<std::string, std::string> modes;
|
||||
};
|
||||
|
|
|
@ -7,4 +7,4 @@ extern framebuffer::font main_font;
|
|||
|
||||
void do_init_font();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -166,6 +166,10 @@ template<> struct e2t<LSNES_CORE_GET_VMA_LIST> {
|
|||
typedef lsnes_core_get_vma_list* t;
|
||||
typedef lsnes_core_get_vma_list& r;
|
||||
};
|
||||
template<> struct e2t<LSNES_CORE_REINIT> {
|
||||
typedef lsnes_core_reinit* t;
|
||||
typedef lsnes_core_reinit& r;
|
||||
};
|
||||
|
||||
template<typename T> class t2e {};
|
||||
template<> struct t2e<lsnes_core_enumerate_cores> { const static int e = LSNES_CORE_ENUMERATE_CORES; };
|
||||
|
@ -202,6 +206,7 @@ template<> struct t2e<lsnes_core_draw_cover> { const static int e = LSNES_CORE_D
|
|||
template<> struct t2e<lsnes_core_pre_emulate> { const static int e = LSNES_CORE_PRE_EMULATE; };
|
||||
template<> struct t2e<lsnes_core_get_device_regs> { const static int e = LSNES_CORE_GET_DEVICE_REGS; };
|
||||
template<> struct t2e<lsnes_core_get_vma_list> { const static int e = LSNES_CORE_GET_VMA_LIST; };
|
||||
template<> struct t2e<lsnes_core_reinit> { const static int e = LSNES_CORE_REINIT; };
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -51,6 +51,7 @@ 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>
|
||||
|
||||
|
@ -109,8 +110,9 @@ extern "C" {
|
|||
#define LSNES_CORE_CAP1_MEMWATCH 0x00010000U
|
||||
//Core supports lightguns (By setting lightgun_height/lightgun_width in LSNES_CORE_GET_AV_STATE).
|
||||
#define LSNES_CORE_CAP1_LIGHTGUN 0x00020000U
|
||||
//Core supports fast reinit (By supporting LSNES_CORE_REINIT).
|
||||
#define LSNES_CORE_CAP1_REINIT 0x00040000U
|
||||
//Reserved capabilities.
|
||||
#define LSNES_CORE_CAP1_RESERVED18 0x00040000U
|
||||
#define LSNES_CORE_CAP1_RESERVED19 0x00080000U
|
||||
#define LSNES_CORE_CAP1_RESERVED20 0x00100000U
|
||||
#define LSNES_CORE_CAP1_RESERVED21 0x00200000U
|
||||
|
@ -211,7 +213,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.
|
||||
long text_len;
|
||||
ssize_t text_len;
|
||||
//Input: Bytes per pixel to request. Can be 1, 2, 3 or 4.
|
||||
unsigned bytes_pp;
|
||||
//Input: Foreground color (native endian).
|
||||
|
@ -838,6 +840,16 @@ struct lsnes_core_get_vma_list
|
|||
struct lsnes_core_get_vma_list_vma** vmas;
|
||||
};
|
||||
|
||||
//Request 34: Reinit core to last loaded state.
|
||||
//Item id: Core ID.
|
||||
//Default action: Emulate using loadstate.
|
||||
//Signals that the core state should be reset to state just after last load (load savestate at moment of initial
|
||||
//poweron).
|
||||
#define LSNES_CORE_REINIT 27
|
||||
struct lsnes_core_reinit
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#ifdef LSNES_BUILD_AS_BUILTIN_CORE
|
||||
void lsnes_register_builtin_core(lsnes_core_func_t fn);
|
||||
|
|
|
@ -323,7 +323,7 @@ struct core_core
|
|||
std::pair<uint32_t, uint32_t> get_video_rate();
|
||||
double get_PAR();
|
||||
std::pair<uint32_t, uint32_t> get_audio_rate();
|
||||
std::string get_core_identifier();
|
||||
std::string get_core_identifier() const;
|
||||
std::map<std::string, std::vector<char>> save_sram() throw(std::bad_alloc);
|
||||
void load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc);
|
||||
void serialize(std::vector<char>& out);
|
||||
|
@ -340,7 +340,7 @@ struct core_core
|
|||
void set_pflag(bool pflag);
|
||||
framebuffer::raw& draw_cover();
|
||||
std::vector<portctrl::type*> get_port_types() { return port_types; }
|
||||
std::string get_core_shortname();
|
||||
std::string get_core_shortname() const;
|
||||
void pre_emulate_frame(portctrl::frame& cf);
|
||||
void execute_action(unsigned id, const std::vector<interface_action_paramval>& p);
|
||||
unsigned action_flags(unsigned id);
|
||||
|
@ -352,7 +352,7 @@ struct core_core
|
|||
static void uninstall_all_handlers();
|
||||
static void initialize_new_cores();
|
||||
void hide() { hidden = true; }
|
||||
bool is_hidden() { return hidden; }
|
||||
bool is_hidden() const { return hidden; }
|
||||
std::set<const interface_action*> get_actions();
|
||||
const interface_device_reg* get_registers();
|
||||
int reset_action(bool hard);
|
||||
|
@ -361,13 +361,14 @@ struct core_core
|
|||
void set_cheat(uint64_t addr, uint64_t value, bool set);
|
||||
std::vector<std::string> get_trace_cpus();
|
||||
void debug_reset();
|
||||
bool isnull();
|
||||
bool isnull() const;
|
||||
void reset_to_load() { c_reset_to_load(); }
|
||||
bool safe_to_unload(loadlib::module& mod) { return !mod.is_marked(this); }
|
||||
protected:
|
||||
/**
|
||||
* Get the name of the core.
|
||||
*/
|
||||
virtual std::string c_core_identifier() = 0;
|
||||
virtual std::string c_core_identifier() const = 0;
|
||||
/**
|
||||
* Set the current region.
|
||||
*
|
||||
|
@ -460,7 +461,7 @@ protected:
|
|||
/**
|
||||
* Get shortened name of the core.
|
||||
*/
|
||||
virtual std::string c_get_core_shortname() = 0;
|
||||
virtual std::string c_get_core_shortname() const = 0;
|
||||
/**
|
||||
* Set the system controls to appropriate values for next frame.
|
||||
*
|
||||
|
@ -530,10 +531,14 @@ protected:
|
|||
* Reset all debug hooks.
|
||||
*/
|
||||
virtual void c_debug_reset() = 0;
|
||||
/**
|
||||
* Reset to state equivalent to ROM load.
|
||||
*/
|
||||
virtual void c_reset_to_load() = 0;
|
||||
/**
|
||||
* Is null core (only NULL core should define this).
|
||||
*/
|
||||
virtual bool c_isnull();
|
||||
virtual bool c_isnull() const;
|
||||
private:
|
||||
std::vector<portctrl::type*> port_types;
|
||||
bool hidden;
|
||||
|
@ -548,18 +553,18 @@ public:
|
|||
core_type(std::initializer_list<core_type_params> p) : core_type(*p.begin()) {}
|
||||
virtual ~core_type() throw();
|
||||
static std::list<core_type*> get_core_types();
|
||||
core_region& get_preferred_region();
|
||||
std::list<core_region*> get_regions();
|
||||
core_sysregion& combine_region(core_region& reg);
|
||||
const std::string& get_iname();
|
||||
const std::string& get_hname();
|
||||
std::list<std::string> get_extensions();
|
||||
bool is_known_extension(const std::string& ext);
|
||||
core_sysregion& lookup_sysregion(const std::string& sysreg);
|
||||
std::string get_biosname();
|
||||
unsigned get_id();
|
||||
unsigned get_image_count();
|
||||
core_romimage_info get_image_info(unsigned index);
|
||||
core_region& get_preferred_region() const;
|
||||
std::list<core_region*> get_regions() const;
|
||||
core_sysregion& combine_region(core_region& reg) const;
|
||||
const std::string& get_iname() const;
|
||||
const std::string& get_hname() const;
|
||||
std::list<std::string> get_extensions() const;
|
||||
bool is_known_extension(const std::string& ext) const;
|
||||
core_sysregion& lookup_sysregion(const std::string& sysreg) const;
|
||||
std::string get_biosname() const;
|
||||
unsigned get_id() const;
|
||||
unsigned get_image_count() const;
|
||||
core_romimage_info get_image_info(unsigned index) const;
|
||||
bool load(core_romimage* images, std::map<std::string, std::string>& settings, uint64_t rtc_sec,
|
||||
uint64_t rtc_subsec);
|
||||
controller_set controllerconfig(std::map<std::string, std::string>& settings);
|
||||
|
@ -572,7 +577,7 @@ public:
|
|||
std::pair<uint32_t, uint32_t> get_video_rate() { return core->get_video_rate(); }
|
||||
std::pair<uint32_t, uint32_t> get_audio_rate() { return core->get_audio_rate(); }
|
||||
std::string get_core_identifier() { return core->get_core_identifier(); }
|
||||
std::string get_core_shortname() { return core->get_core_shortname(); }
|
||||
std::string get_core_shortname() const { return core->get_core_shortname(); }
|
||||
std::map<std::string, std::vector<char>> save_sram() throw(std::bad_alloc) { return core->save_sram(); }
|
||||
void load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc)
|
||||
{
|
||||
|
@ -600,7 +605,7 @@ public:
|
|||
return core->execute_action(id, p);
|
||||
}
|
||||
unsigned action_flags(unsigned id) { return core->action_flags(id); }
|
||||
bool is_hidden() { return core->is_hidden(); }
|
||||
bool is_hidden() const { return core->is_hidden(); }
|
||||
double get_PAR() { return core->get_PAR(); }
|
||||
void pre_emulate_frame(portctrl::frame& cf) { return core->pre_emulate_frame(cf); }
|
||||
std::set<const interface_action*> get_actions() { return core->get_actions(); }
|
||||
|
@ -617,8 +622,9 @@ public:
|
|||
}
|
||||
std::vector<std::string> get_trace_cpus() { return core->get_trace_cpus(); }
|
||||
void debug_reset() { core->debug_reset(); }
|
||||
bool isnull() { return core->isnull(); }
|
||||
bool safe_to_unload(loadlib::module& mod) { return core->safe_to_unload(mod); }
|
||||
bool isnull() const { return core->isnull(); }
|
||||
void reset_to_load() { return core->reset_to_load(); }
|
||||
bool safe_to_unload(loadlib::module& mod) const { return core->safe_to_unload(mod); }
|
||||
protected:
|
||||
/**
|
||||
* Load a ROM slot set. Changes the ROM currently loaded for core.
|
||||
|
@ -669,7 +675,7 @@ public:
|
|||
*/
|
||||
core_sysregion(const std::string& name, core_type& type, core_region& region);
|
||||
~core_sysregion() throw();
|
||||
const std::string& get_name();
|
||||
const std::string& get_name() const;
|
||||
core_region& get_region();
|
||||
core_type& get_type();
|
||||
void fill_framerate_magic(uint64_t* magic); //4 elements filled.
|
||||
|
|
|
@ -78,7 +78,6 @@ public:
|
|||
operator label&();
|
||||
operator label*();
|
||||
label& external(void* addr);
|
||||
|
||||
private:
|
||||
std::list<label> labels;
|
||||
};
|
||||
|
|
|
@ -8,4 +8,4 @@ template<typename T> void eat_argument(T arg) {
|
|||
_eat_argument((void*)arg2);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,6 @@ public:
|
|||
add_ex_spec(prio, [](std::exception& e) -> bool { return (dynamic_cast<T*>(&e) != NULL); },
|
||||
[](std::exception& e) -> std::function<void()> { T _ex = *dynamic_cast<T*>(&e);
|
||||
return [_ex]() -> void { throw _ex; }; });
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
|
@ -24,6 +25,8 @@ public:
|
|||
std::vector<uint32_t> fglyph; //Bitpacked, element breaks between rows.
|
||||
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);
|
||||
|
@ -33,6 +36,10 @@ public:
|
|||
throw(std::bad_alloc);
|
||||
const glyph& lookup_glyph(const std::u32string& key) const throw();
|
||||
unsigned get_rowadvance() const throw() { return rowadvance; }
|
||||
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;
|
||||
|
|
|
@ -8,9 +8,12 @@
|
|||
#include <map>
|
||||
#include <set>
|
||||
#include "framebuffer-pixfmt.hpp"
|
||||
#include "threads.hpp"
|
||||
#include "memtracker.hpp"
|
||||
|
||||
namespace framebuffer
|
||||
{
|
||||
extern const char* render_page_id;
|
||||
template<bool X> struct elem {};
|
||||
template<> struct elem<false> { typedef uint32_t t; };
|
||||
template<> struct elem<true> { typedef uint64_t t; };
|
||||
|
@ -491,6 +494,16 @@ struct font
|
|||
bool wide; //If set, 16 wide instead of 8.
|
||||
uint32_t* data; //Glyph data. Bitpacked with element padding between rows.
|
||||
size_t offset; //Glyph offset.
|
||||
uint32_t get_width() const throw() { return wide ? 16 : 8; }
|
||||
uint32_t get_height() const throw() { return 16; }
|
||||
bool read_pixel(uint32_t x, uint32_t y) const throw()
|
||||
{
|
||||
if(wide) {
|
||||
return ((data[y >> 1] >> (31 - (((y & 1) << 4) + x))) & 1) != 0;
|
||||
} else {
|
||||
return ((data[y >> 2] >> (31 - (((y & 3) << 3) + x))) & 1) != 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -527,7 +540,8 @@ struct font
|
|||
* Parameter string: The string to get metrics of.
|
||||
* Returns: A pair. First element is width of string, the second is height of string.
|
||||
*/
|
||||
std::pair<size_t, size_t> get_metrics(const std::string& string) throw();
|
||||
std::pair<size_t, size_t> get_metrics(const std::string& string, uint32_t xalign, bool xdbl, bool ydbl)
|
||||
throw();
|
||||
/**
|
||||
* Layout a string.
|
||||
*
|
||||
|
@ -535,6 +549,13 @@ struct font
|
|||
* Returns: String layout.
|
||||
*/
|
||||
std::vector<layout> dolayout(const std::string& string) throw(std::bad_alloc);
|
||||
/**
|
||||
* Get width of string.
|
||||
*
|
||||
* Parameter string: The string to get width of.
|
||||
* Returns: The width.
|
||||
*/
|
||||
uint32_t get_width(const std::string& string);
|
||||
/**
|
||||
* Get set of all glyph numbers.
|
||||
*/
|
||||
|
@ -557,6 +578,26 @@ struct font
|
|||
*/
|
||||
template<bool X> void render(struct fb<X>& scr, int32_t x, int32_t y, const std::string& text,
|
||||
color fg, color bg, bool hdbl, bool vdbl) throw();
|
||||
/**
|
||||
* Call function on every glyph.
|
||||
*
|
||||
* Parameter str: The string to call on.
|
||||
* Parameter alignx: The x alignment.
|
||||
* Parameter cb: The callback to call.
|
||||
*/
|
||||
void for_each_glyph(const std::string& str, uint32_t alignx, bool xdbl, bool ydbl,
|
||||
std::function<void(uint32_t x, uint32_t y, const glyph& g, bool xdbl, bool ydbl)> cb);
|
||||
/**
|
||||
* Render to bitmap.
|
||||
*
|
||||
* Parameter buf: The bufer to render on.
|
||||
* Parameter stride: The stride on buffer.
|
||||
* Parameter str: The string to render.
|
||||
* Parameter alignx: The x alignment.
|
||||
* Parameter hdbl: If set, double width horizontally.
|
||||
* Parameter vdbl: If set, double height vertically.
|
||||
*/
|
||||
void render(uint8_t* buf, size_t stride, const std::string& str, uint32_t alignx, bool hdbl, bool vdbl);
|
||||
private:
|
||||
glyph bad_glyph;
|
||||
uint32_t bad_glyph_data[4];
|
||||
|
@ -636,12 +677,18 @@ struct queue
|
|||
private:
|
||||
void add(struct object& obj) throw(std::bad_alloc);
|
||||
struct node { struct object* obj; struct node* next; bool killed; };
|
||||
struct page { char content[RENDER_PAGE_SIZE]; };
|
||||
struct page {
|
||||
char content[RENDER_PAGE_SIZE];
|
||||
page() { memtracker::singleton()(render_page_id, RENDER_PAGE_SIZE + 36); }
|
||||
~page() { memtracker::singleton()(render_page_id, -RENDER_PAGE_SIZE - 36); }
|
||||
};
|
||||
struct node* queue_head;
|
||||
struct node* queue_tail;
|
||||
size_t memory_allocated;
|
||||
size_t pages;
|
||||
threads::lock display_mutex; //Synchronize display and kill.
|
||||
std::map<size_t, page> memory;
|
||||
memtracker::autorelease tracker;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _library__gamepad__hpp__included__
|
||||
#define _library__gamepad__hpp__included__
|
||||
|
||||
#include <functional>
|
||||
#include <cstdint>
|
||||
#include <set>
|
||||
#include "json.hpp"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <cstdlib>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include "threads.hpp"
|
||||
|
||||
class http_request
|
||||
|
@ -119,7 +120,7 @@ public:
|
|||
/**
|
||||
* Get final code.
|
||||
*/
|
||||
long get_http_code();
|
||||
uint32_t 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);
|
||||
|
@ -145,7 +146,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).
|
||||
long http_code; //HTTP error code (OUTPUT).
|
||||
uint32_t 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).
|
||||
|
|
|
@ -40,4 +40,9 @@ 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
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
#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();
|
||||
|
@ -117,11 +114,7 @@ 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); }
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
#include <typeindex>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
#include <set>
|
||||
#include <list>
|
||||
#include <cassert>
|
||||
#include "string.hpp"
|
||||
#include "utf8.hpp"
|
||||
#include "int24.hpp"
|
||||
#include "lua-version.hpp"
|
||||
|
||||
namespace lua
|
||||
|
@ -28,6 +30,7 @@ class class_base;
|
|||
class state
|
||||
{
|
||||
public:
|
||||
const static unsigned trampoline_upvals = 2;
|
||||
//Auxillary type for store-tag.
|
||||
template<typename T> struct _store_tag
|
||||
{
|
||||
|
@ -218,6 +221,17 @@ public:
|
|||
* Set OOM handler.
|
||||
*/
|
||||
void set_oom_handler(void (*oom)()) { oom_handler = oom ? oom : builtin_oom; }
|
||||
/**
|
||||
* Set soft OOM handler.
|
||||
*/
|
||||
void set_soft_oom_handler(void (*oom)(int status)) { soft_oom_handler = oom ? oom : builtin_soft_oom; }
|
||||
/**
|
||||
* Set memory use change handler.
|
||||
*/
|
||||
void set_memory_change_handler(std::function<void(ssize_t change)> cb)
|
||||
{
|
||||
memory_change = cb;
|
||||
}
|
||||
/**
|
||||
* Reset the state.
|
||||
*/
|
||||
|
@ -226,6 +240,66 @@ public:
|
|||
* Deinit the state.
|
||||
*/
|
||||
void deinit() throw();
|
||||
/**
|
||||
* Create a trampoline.
|
||||
*
|
||||
* Parameter fn The function to execute.
|
||||
* Parameter n_upvals The number of extra upvalues besides the 2 used by trampoline itself. Popped from stack.
|
||||
*/
|
||||
void push_trampoline(int(*fn)(state& L), unsigned n_upvals);
|
||||
/**
|
||||
* Get specified trampoline upvalue index.
|
||||
*/
|
||||
int trampoline_upval(int val) { return lua_upvalueindex(trampoline_upvals + val); }
|
||||
/**
|
||||
* Set value of interruptable flag.
|
||||
*
|
||||
* Parameter flag: The flag.
|
||||
*/
|
||||
void set_interruptable_flag(bool flag)
|
||||
{
|
||||
if(master) master->set_interruptable_flag(flag); else interruptable = flag;
|
||||
}
|
||||
/**
|
||||
* Get interruptable flag.
|
||||
*/
|
||||
bool get_interruptable_flag()
|
||||
{
|
||||
if(master) return master->get_interruptable_flag(); else return interruptable;
|
||||
}
|
||||
/**
|
||||
* Set memory limit.
|
||||
*/
|
||||
void set_memory_limit(size_t limit)
|
||||
{
|
||||
if(master) master->set_memory_limit(limit); else memory_limit = limit;
|
||||
}
|
||||
/**
|
||||
* Get memory limit.
|
||||
*/
|
||||
size_t get_memory_limit()
|
||||
{
|
||||
if(master) return master->get_memory_limit(); else return memory_limit;
|
||||
}
|
||||
/**
|
||||
* Get memory use.
|
||||
*/
|
||||
size_t get_memory_use()
|
||||
{
|
||||
if(master) return master->get_memory_use(); else return memory_use;
|
||||
}
|
||||
/**
|
||||
* Charge against memory limit.
|
||||
*/
|
||||
bool charge_memory(size_t amount, bool release);
|
||||
/**
|
||||
* Execute function in interruptable mode.
|
||||
*
|
||||
* Parameter fn: The function to execute
|
||||
* Parameter in: Number of slots to copy in.
|
||||
* Parameter out: Number of slots to copy out.
|
||||
*/
|
||||
void run_interruptable(std::function<void()> fn, unsigned in, unsigned out);
|
||||
/**
|
||||
* Get a string argument.
|
||||
*
|
||||
|
@ -411,6 +485,7 @@ public:
|
|||
void* newuserdata(size_t size) { return lua_newuserdata(lua_handle, size); }
|
||||
int setmetatable(int index) { return lua_setmetatable(lua_handle, index); }
|
||||
int type(int index) { return lua_type(lua_handle, index); }
|
||||
void replace(int index) { lua_replace(lua_handle, index); }
|
||||
int getmetatable(int index) { return lua_getmetatable(lua_handle, index); }
|
||||
int rawequal(int index1, int index2) { return lua_rawequal(lua_handle, index1, index2); }
|
||||
void* touserdata(int index) { return lua_touserdata(lua_handle, index); }
|
||||
|
@ -439,7 +514,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); }
|
||||
uint64_t tointeger(int index) { return LUA_INTEGER_POSTFIX(lua_to) (lua_handle, index); }
|
||||
int64_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;
|
||||
|
@ -450,26 +525,41 @@ public:
|
|||
void pushlstring(const char* s, size_t len) { lua_pushlstring(lua_handle, s, len); }
|
||||
void pushlstring(const std::string& s) { lua_pushlstring(lua_handle, s.c_str(), s.length()); }
|
||||
void pushlstring(const char32_t* s, size_t len) { pushlstring(utf8::to8(std::u32string(s, len))); }
|
||||
int pcall(int nargs, int nresults, int errfunc) { return lua_pcall(lua_handle, nargs, nresults, errfunc); }
|
||||
int pcall(int nargs, int nresults, int errfunc)
|
||||
{
|
||||
state* master_state = this;
|
||||
while(master_state->master) master_state = master_state->master;
|
||||
//Upon entry to protected mode, interruptable mode is always set, and it is restored on exit
|
||||
//from protected mode.
|
||||
bool old_interruptable = master_state->interruptable;
|
||||
master_state->interruptable = true;
|
||||
auto ret = lua_pcall(lua_handle, nargs, nresults, errfunc);
|
||||
master_state->interruptable = old_interruptable;
|
||||
return ret;
|
||||
}
|
||||
int next(int index) { return lua_next(lua_handle, index); }
|
||||
int isnoneornil(int index) { return lua_isnoneornil(lua_handle, index); }
|
||||
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)
|
||||
_pushinteger(val);
|
||||
if(std::numeric_limits<T>::is_integer || is_ss_int24<T>::flag)
|
||||
return LUA_INTEGER_POSTFIX(lua_push) (lua_handle, val);
|
||||
else
|
||||
_pushnumber(val);
|
||||
return lua_pushnumber(lua_handle, 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);
|
||||
void (*oom_handler)();
|
||||
void (*soft_oom_handler)(int status);
|
||||
std::function<void(ssize_t change)> memory_change;
|
||||
state* master;
|
||||
bool interruptable;
|
||||
size_t memory_limit;
|
||||
size_t memory_use;
|
||||
lua_State* lua_handle;
|
||||
state(state&);
|
||||
state& operator=(state&);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _library__lua_class__hpp__included__
|
||||
#define _library__lua_class__hpp__included__
|
||||
|
||||
#include <functional>
|
||||
#include "lua-base.hpp"
|
||||
#include "lua-pin.hpp"
|
||||
|
||||
|
@ -220,28 +221,32 @@ template<class T> class _class : public class_base
|
|||
template<typename... U> T* _create(state& _state, U... args)
|
||||
{
|
||||
size_t overcommit = T::overcommit(args...);
|
||||
void* obj = _state.newuserdata(sizeof(T) + overcommit);
|
||||
void* obj = NULL;
|
||||
auto st = &_state;
|
||||
_state.run_interruptable([st, overcommit, &obj]() {
|
||||
obj = st->newuserdata(sizeof(T) + overcommit);
|
||||
}, 0, 1);
|
||||
load_metatable(_state);
|
||||
_state.setmetatable(-2);
|
||||
T* _obj = reinterpret_cast<T*>(obj);
|
||||
new(_obj) T(_state, args...);
|
||||
try {
|
||||
new(_obj) T(_state, args...);
|
||||
} catch(...) {
|
||||
//CTOR FAILED. Get rid of the dtor (since it would error) and then dump the object.
|
||||
_state.newtable();
|
||||
_state.setmetatable(-2);
|
||||
_state.pop(1);
|
||||
throw;
|
||||
}
|
||||
return _obj;
|
||||
}
|
||||
|
||||
static int class_bind_trampoline(lua_State* LS)
|
||||
static int class_bind_trampoline(state& L)
|
||||
{
|
||||
try {
|
||||
class_binding<T>* b = (class_binding<T>*)lua_touserdata(LS, lua_upvalueindex(1));
|
||||
state L(*b->_state, LS);
|
||||
T* p = _class<T>::get(L, 1, b->fname);
|
||||
lua::parameters P(L, b->fname);
|
||||
return (p->*(b->fn))(L, P);
|
||||
} catch(std::exception& e) {
|
||||
std::string err = e.what();
|
||||
lua_pushlstring(LS, err.c_str(), err.length());
|
||||
lua_error(LS);
|
||||
}
|
||||
return 0; //NOTREACHED
|
||||
class_binding<T>* b = (class_binding<T>*)L.touserdata(L.trampoline_upval(1));
|
||||
T* p = _class<T>::get(L, 1, b->fname);
|
||||
lua::parameters P(L, b->fname);
|
||||
return (p->*(b->fn))(L, P);
|
||||
}
|
||||
|
||||
T* _get(state& _state, int arg, const std::string& fname, bool optional = false)
|
||||
|
@ -298,7 +303,7 @@ badtype:
|
|||
bdata->_state = &_state.get_master();
|
||||
std::copy(fname.begin(), fname.end(), bdata->fname);
|
||||
bdata->fname[fname.length()] = 0;
|
||||
_state.pushcclosure(class_bind_trampoline, 1);
|
||||
_state.push_trampoline(class_bind_trampoline, 1);
|
||||
_state.rawset(-3);
|
||||
_state.pop(1);
|
||||
}
|
||||
|
@ -451,30 +456,27 @@ public:
|
|||
return r;
|
||||
}
|
||||
private:
|
||||
static int dogc(lua_State* LS)
|
||||
static int dogc(state& L)
|
||||
{
|
||||
T* obj = reinterpret_cast<T*>(lua_touserdata(LS, 1));
|
||||
T* obj = reinterpret_cast<T*>(L.touserdata(1));
|
||||
obj->~T();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int newindex(lua_State* LS)
|
||||
static int newindex(state& L)
|
||||
{
|
||||
lua_pushstring(LS, "Writing metatables of classes is not allowed");
|
||||
lua_error(LS);
|
||||
return 0;
|
||||
throw std::runtime_error("Writing metatables of classes is not allowed");
|
||||
}
|
||||
|
||||
static int index(lua_State* LS)
|
||||
static int index(state& L)
|
||||
{
|
||||
lua_getmetatable(LS, 1);
|
||||
lua_pushvalue(LS, 2);
|
||||
lua_rawget(LS, -2);
|
||||
if(lua_type(LS, -1) == LUA_TNIL) {
|
||||
std::string err = std::string("Class '") + lua_tostring(LS, lua_upvalueindex(1)) +
|
||||
"' does not have class method '" + lua_tostring(LS, 2) + "'";
|
||||
lua_pushstring(LS, err.c_str());
|
||||
lua_error(LS);
|
||||
L.getmetatable(1);
|
||||
L.pushvalue(2);
|
||||
L.rawget(-2);
|
||||
if(L.type(-1) == LUA_TNIL) {
|
||||
std::string err = std::string("Class '") + L.tostring(L.trampoline_upval(1)) +
|
||||
"' does not have class method '" + L.tostring(2) + "'";
|
||||
throw std::runtime_error(err);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -491,14 +493,14 @@ again:
|
|||
_state.pushvalue(-1);
|
||||
_state.setmetatable(-2);
|
||||
_state.pushstring("__gc");
|
||||
_state.pushcfunction(&_class<T>::dogc);
|
||||
_state.push_trampoline(&_class<T>::dogc, 0);
|
||||
_state.rawset(-3);
|
||||
_state.pushstring("__newindex");
|
||||
_state.pushcfunction(&_class<T>::newindex);
|
||||
_state.push_trampoline(&_class<T>::newindex, 0);
|
||||
_state.rawset(-3);
|
||||
_state.pushstring("__index");
|
||||
_state.pushlstring(name);
|
||||
_state.pushcclosure(&_class<T>::index, 1);
|
||||
_state.push_trampoline(&_class<T>::index, 1);
|
||||
_state.rawset(-3);
|
||||
_state.rawset(LUA_REGISTRYINDEX);
|
||||
goto again;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _library__lua_function__hpp__included__
|
||||
#define _library__lua_function__hpp__included__
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace lua
|
||||
{
|
||||
class parameters;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _library__memorywatch_fb__hpp__included__
|
||||
#define _library__memorywatch_fb__hpp__included__
|
||||
|
||||
#include <functional>
|
||||
#include "framebuffer.hpp"
|
||||
#include "memorywatch.hpp"
|
||||
#include "mathexpr.hpp"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define _library__memorywatch__hpp__included__
|
||||
|
||||
#include "mathexpr.hpp"
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
|
52
include/library/memtracker.hpp
Normal file
52
include/library/memtracker.hpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
#ifndef _library__memtracker__hpp__included__
|
||||
#define _library__memtracker__hpp__included__
|
||||
|
||||
#include "threads.hpp"
|
||||
#include <map>
|
||||
|
||||
class memtracker
|
||||
{
|
||||
public:
|
||||
memtracker();
|
||||
~memtracker();
|
||||
void operator()(const char* category, ssize_t change);
|
||||
void reset(const char* category, size_t value);
|
||||
std::map<std::string, size_t> report();
|
||||
static memtracker& singleton();
|
||||
class autorelease
|
||||
{
|
||||
public:
|
||||
autorelease(memtracker& _track, const char* cat, size_t amount)
|
||||
: tracker(_track), category(cat), committed(amount)
|
||||
{
|
||||
tracker(category, committed);
|
||||
}
|
||||
~autorelease()
|
||||
{
|
||||
tracker(category, -(ssize_t)committed);
|
||||
}
|
||||
void operator()(ssize_t delta)
|
||||
{
|
||||
if(delta < 0 && committed < (size_t)-delta) {
|
||||
tracker(category, -(ssize_t)committed);
|
||||
committed = 0;
|
||||
} else {
|
||||
tracker(category, delta);
|
||||
committed = committed + delta;
|
||||
}
|
||||
}
|
||||
private:
|
||||
memtracker& tracker;
|
||||
const char* category;
|
||||
size_t committed;
|
||||
};
|
||||
private:
|
||||
bool invalid;
|
||||
threads::lock mut;
|
||||
std::map<std::string, size_t> data;
|
||||
memtracker(const memtracker&);
|
||||
memtracker& operator=(const memtracker&);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -5,6 +5,7 @@
|
|||
#include <cstdint>
|
||||
#include <stdexcept>
|
||||
#include "portctrl-data.hpp"
|
||||
#include "memtracker.hpp"
|
||||
|
||||
/**
|
||||
* Movie being played back or recorded
|
||||
|
@ -320,6 +321,8 @@ private:
|
|||
uint64_t cached_subframe;
|
||||
//Count present subframes in frame starting from first_subframe (returns 0 if out of movie).
|
||||
uint32_t count_changes(uint64_t first_subframe) throw();
|
||||
//Tracker.
|
||||
memtracker::autorelease tracker;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <set>
|
||||
#include "json.hpp"
|
||||
#include "threads.hpp"
|
||||
#include "memtracker.hpp"
|
||||
|
||||
namespace binarystream
|
||||
{
|
||||
|
@ -48,6 +49,7 @@ namespace binarystream
|
|||
|
||||
namespace portctrl
|
||||
{
|
||||
extern const char* movie_page_id;
|
||||
/**
|
||||
* Is not field terminator.
|
||||
*
|
||||
|
@ -1241,6 +1243,10 @@ 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.
|
||||
*
|
||||
|
@ -1320,7 +1326,11 @@ private:
|
|||
class page
|
||||
{
|
||||
public:
|
||||
page() { memset(content, 0, CONTROLLER_PAGE_SIZE); }
|
||||
page() {
|
||||
memtracker::singleton()(movie_page_id, CONTROLLER_PAGE_SIZE + 36);
|
||||
memset(content, 0, CONTROLLER_PAGE_SIZE);
|
||||
}
|
||||
~page() { memtracker::singleton()(movie_page_id, -CONTROLLER_PAGE_SIZE - 36); }
|
||||
unsigned char content[CONTROLLER_PAGE_SIZE];
|
||||
};
|
||||
size_t frames_per_page;
|
||||
|
@ -1342,6 +1352,7 @@ private:
|
|||
cache_page_num--;
|
||||
cache_page = NULL;
|
||||
}
|
||||
memtracker::autorelease tracker;
|
||||
};
|
||||
|
||||
void frame::sync(bool x) throw()
|
||||
|
|
|
@ -7,35 +7,31 @@
|
|||
|
||||
namespace serialization
|
||||
{
|
||||
template<typename T> struct unsigned_of {};
|
||||
template<> struct unsigned_of<int8_t> { typedef uint8_t t; };
|
||||
template<> struct unsigned_of<uint8_t> { typedef uint8_t t; };
|
||||
template<> struct unsigned_of<int16_t> { typedef uint16_t t; };
|
||||
template<> struct unsigned_of<uint16_t> { typedef uint16_t t; };
|
||||
template<> struct unsigned_of<int32_t> { typedef uint32_t t; };
|
||||
template<> struct unsigned_of<uint32_t> { typedef uint32_t t; };
|
||||
template<> struct unsigned_of<int64_t> { typedef uint64_t t; };
|
||||
template<> struct unsigned_of<uint64_t> { typedef uint64_t t; };
|
||||
template<size_t n> struct unsigned_of {};
|
||||
template<> struct unsigned_of<1> { typedef uint8_t t; };
|
||||
template<> struct unsigned_of<2> { typedef uint16_t t; };
|
||||
template<> struct unsigned_of<4> { typedef uint32_t t; };
|
||||
template<> struct unsigned_of<8> { typedef uint64_t t; };
|
||||
|
||||
template<typename T1, bool be>
|
||||
void write_common(uint8_t* target, T1 value)
|
||||
{
|
||||
for(size_t i = 0; i < sizeof(T1); i++)
|
||||
if(be)
|
||||
target[i] = static_cast<typename unsigned_of<T1>::t>(value) >> 8 * (sizeof(T1) - i - 1);
|
||||
target[i] = static_cast<typename unsigned_of<sizeof(T1)>::t>(value) >> 8 * (sizeof(T1) - i - 1);
|
||||
else
|
||||
target[i] = static_cast<typename unsigned_of<T1>::t>(value) >> 8 * i;
|
||||
target[i] = static_cast<typename unsigned_of<sizeof(T1)>::t>(value) >> 8 * i;
|
||||
}
|
||||
|
||||
template<typename T1, bool be>
|
||||
T1 read_common(const uint8_t* source)
|
||||
{
|
||||
typename unsigned_of<T1>::t value = 0;
|
||||
typename unsigned_of<sizeof(T1)>::t value = 0;
|
||||
for(size_t i = 0; i < sizeof(T1); i++)
|
||||
if(be)
|
||||
value |= static_cast<typename unsigned_of<T1>::t>(source[i]) << 8 * (sizeof(T1) - i - 1);
|
||||
value |= static_cast<typename unsigned_of<sizeof(T1)>::t>(source[i]) << 8 * (sizeof(T1) - i - 1);
|
||||
else
|
||||
value |= static_cast<typename unsigned_of<T1>::t>(source[i]) << 8 * i;
|
||||
value |= static_cast<typename unsigned_of<sizeof(T1)>::t>(source[i]) << 8 * i;
|
||||
return static_cast<T1>(value);
|
||||
}
|
||||
|
||||
|
|
|
@ -390,7 +390,7 @@ public:
|
|||
/**
|
||||
* Get setting.
|
||||
*/
|
||||
valtype_t get() throw(std::bad_alloc)
|
||||
valtype_t get() const throw(std::bad_alloc)
|
||||
{
|
||||
threads::arlock h(get_setting_lock());
|
||||
return model::transform(value);
|
||||
|
@ -398,7 +398,7 @@ public:
|
|||
/**
|
||||
* Get setting.
|
||||
*/
|
||||
operator valtype_t()
|
||||
operator valtype_t() const
|
||||
{
|
||||
return get();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _library__string__hpp__included__
|
||||
#define _library__string__hpp__included__
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
|
@ -230,14 +231,30 @@ private:
|
|||
regex_results regex(const std::string& regex, const std::string& str, const char* ex = NULL)
|
||||
throw(std::bad_alloc, std::runtime_error);
|
||||
|
||||
enum regex_match_mode
|
||||
{
|
||||
REGEX_MATCH_REGEX = 0,
|
||||
REGEX_MATCH_LITERIAL = 1,
|
||||
REGEX_MATCH_IWILDCARDS = 2,
|
||||
REGEX_MATCH_IREGEX = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* Regexp a string and return match result.
|
||||
*
|
||||
* Parameter regex: The regexp to apply.
|
||||
* Parameter str: The string to apply the regexp to.
|
||||
* Parameter mode: Match mode.
|
||||
* Returns: True if matches, false if not.
|
||||
*/
|
||||
bool regex_match(const std::string& regex, const std::string& str) throw(std::bad_alloc, std::runtime_error);
|
||||
bool regex_match(const std::string& regex, const std::string& str, enum regex_match_mode mode = REGEX_MATCH_REGEX)
|
||||
throw(std::bad_alloc, std::runtime_error);
|
||||
|
||||
/**
|
||||
* Try match a case-insensitive string fragment and return the result.
|
||||
*
|
||||
* \param pattern The pattern to match a
|
||||
*/
|
||||
|
||||
/**
|
||||
* Cast string to bool.
|
||||
|
@ -249,6 +266,11 @@ bool regex_match(const std::string& regex, const std::string& str) throw(std::ba
|
|||
*/
|
||||
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.
|
||||
*/
|
||||
|
@ -299,7 +321,7 @@ template<typename T> inline T parse_value(const std::string& value) throw(std::b
|
|||
}
|
||||
return val;
|
||||
}
|
||||
return boost::lexical_cast<T>(value);
|
||||
return raw_lexical_cast<T>(value);
|
||||
} catch(std::exception& e) {
|
||||
throw std::runtime_error("Can't parse value '" + value + "': " + e.what());
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _library_triplebuffer__hpp__included__
|
||||
#define _library_triplebuffer__hpp__included__
|
||||
|
||||
#include <functional>
|
||||
#include <stdexcept>
|
||||
#include "threads.hpp"
|
||||
|
||||
|
@ -45,6 +46,12 @@ 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
|
||||
|
@ -103,6 +110,15 @@ 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;
|
||||
|
|
|
@ -145,12 +145,12 @@ public:
|
|||
/**
|
||||
* This iterator iterates members of ZIP archive in forward order.
|
||||
*/
|
||||
typedef iterator_class<std::map<std::string, unsigned long long>::iterator, std::string> iterator;
|
||||
typedef iterator_class<std::map<std::string, uint64_t>::iterator, std::string> iterator;
|
||||
|
||||
/**
|
||||
* This iterator iterates members of ZIP archive in reverse order
|
||||
*/
|
||||
typedef iterator_class<std::map<std::string, unsigned long long>::reverse_iterator, std::string>
|
||||
typedef iterator_class<std::map<std::string, uint64_t>::reverse_iterator, std::string>
|
||||
riterator;
|
||||
|
||||
/**
|
||||
|
@ -278,7 +278,7 @@ public:
|
|||
private:
|
||||
reader(reader&);
|
||||
reader& operator=(reader&);
|
||||
std::map<std::string, unsigned long long> offsets;
|
||||
std::map<std::string, uint64_t> offsets;
|
||||
std::ifstream* zipstream;
|
||||
size_t* refcnt;
|
||||
};
|
||||
|
@ -421,10 +421,10 @@ public:
|
|||
private:
|
||||
struct file_info
|
||||
{
|
||||
unsigned long crc;
|
||||
unsigned long uncompressed_size;
|
||||
unsigned long compressed_size;
|
||||
unsigned long offset;
|
||||
uint32_t crc;
|
||||
uint32_t uncompressed_size;
|
||||
uint32_t compressed_size;
|
||||
uint32_t offset;
|
||||
};
|
||||
|
||||
writer(writer&);
|
||||
|
|
|
@ -28,4 +28,4 @@ private:
|
|||
uint64_t addr;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#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"
|
||||
|
||||
|
@ -55,11 +56,14 @@ 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
|
||||
|
@ -79,11 +83,14 @@ 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
|
||||
|
@ -99,5 +106,75 @@ 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
|
||||
|
|
|
@ -10,4 +10,4 @@ void handle_registerX(lua::state& L, uint64_t addr, int lfn);
|
|||
template<debug_context::etype type>
|
||||
void handle_unregisterX(lua::state& L, uint64_t addr, int lfn);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
23
include/lua/halo.hpp
Normal file
23
include/lua/halo.hpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef _lua__halo__hpp__included__
|
||||
#define _lua__halo__hpp__included__
|
||||
|
||||
#include <cstdlib>
|
||||
#include "library/framebuffer.hpp"
|
||||
|
||||
/**
|
||||
* Render a 1px wide halo around monochrome image.
|
||||
*
|
||||
* Parameter pixmap: The pixmap to render halo on. Must be aligned to 32 bytes.
|
||||
* Parameter width: Width of the pixmap. Must be multiple of 32 bytes.
|
||||
* Parameter height: Height of the pixmap.
|
||||
*/
|
||||
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();
|
||||
|
||||
#endif
|
|
@ -10,6 +10,8 @@
|
|||
#include "library/framebuffer.hpp"
|
||||
#include "library/lua-base.hpp"
|
||||
#include "library/lua-framebuffer.hpp"
|
||||
#include "library/memtracker.hpp"
|
||||
#include "library/settingvar.hpp"
|
||||
|
||||
namespace command { class group; }
|
||||
namespace keyboard { class key; }
|
||||
|
@ -17,12 +19,14 @@ namespace keyboard { class key; }
|
|||
#define LUA_TIMED_HOOK_IDLE 0
|
||||
#define LUA_TIMED_HOOK_TIMER 1
|
||||
|
||||
void init_lua() throw();
|
||||
void quit_lua() throw();
|
||||
class emulator_instance;
|
||||
|
||||
void init_lua(emulator_instance& inst) throw();
|
||||
void quit_lua(emulator_instance& inst) throw();
|
||||
|
||||
struct lua_state
|
||||
{
|
||||
lua_state(lua::state& _L, command::group& _command);
|
||||
lua_state(lua::state& _L, command::group& _command, settingvar::group& settings);
|
||||
~lua_state();
|
||||
|
||||
lua::state::callback_list* on_paint;
|
||||
|
@ -73,8 +77,7 @@ struct lua_state
|
|||
void callback_snoop_input(uint32_t port, uint32_t controller, uint32_t index, short value) throw();
|
||||
void callback_quit() throw();
|
||||
void callback_keyhook(const std::string& key, keyboard::key& p) throw();
|
||||
void callback_do_unsafe_rewind(const std::vector<char>& save, uint64_t secs, uint64_t ssecs, movie& mov,
|
||||
void* u);
|
||||
void callback_do_unsafe_rewind(movie& mov, void* u);
|
||||
bool callback_do_button(uint32_t port, uint32_t controller, uint32_t index, const char* type);
|
||||
void callback_movie_lost(const char* what);
|
||||
void callback_do_latch(std::list<std::string>& args);
|
||||
|
@ -103,6 +106,7 @@ struct lua_state
|
|||
lua::render_context* renderq_saved;
|
||||
lua::render_context* renderq_last;
|
||||
bool renderq_redirect;
|
||||
void set_memory_limit(size_t max_mb);
|
||||
|
||||
std::list<std::string> startup_scripts;
|
||||
std::map<std::string, std::u32string> watch_vars;
|
||||
|
@ -120,6 +124,22 @@ private:
|
|||
command::_fnptr<const std::string&> evalcmd;
|
||||
command::_fnptr<const std::string&> evalcmd2;
|
||||
command::_fnptr<command::arg_filename> runcmd;
|
||||
struct _listener : public settingvar::listener
|
||||
{
|
||||
_listener(settingvar::group& group, lua_state& _obj)
|
||||
: obj(_obj), grp(group)
|
||||
{
|
||||
group.add_listener(*this);
|
||||
}
|
||||
~_listener() throw()
|
||||
{
|
||||
grp.remove_listener(*this);
|
||||
}
|
||||
void on_setting_change(settingvar::group& grp, const settingvar::base& val);
|
||||
lua_state& obj;
|
||||
settingvar::group& grp;
|
||||
};
|
||||
_listener listener;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,22 +3,19 @@
|
|||
|
||||
#include "library/lua-base.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "core/moviefile.hpp"
|
||||
|
||||
struct lua_unsaferewind
|
||||
{
|
||||
lua_unsaferewind(lua::state& L);
|
||||
static size_t overcommit() { return 0; }
|
||||
std::vector<char> state;
|
||||
uint64_t frame;
|
||||
uint64_t lag;
|
||||
//The console state.
|
||||
dynamic_state console_state;
|
||||
//Extra state variable involved in fast movie restore. It is not part of normal console state.
|
||||
uint64_t ptr;
|
||||
uint64_t secs;
|
||||
uint64_t ssecs;
|
||||
std::vector<uint32_t> pollcounters;
|
||||
std::vector<char> hostmemory;
|
||||
std::string print()
|
||||
{
|
||||
return (stringfmt() << "to frame " << frame).str();
|
||||
return (stringfmt() << "to frame " << console_state.save_frame).str();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define _plat_wxwidgets__menu_branches__hpp__included__
|
||||
|
||||
#include "core/dispatch.hpp"
|
||||
#include <functional>
|
||||
#include <wx/string.h>
|
||||
#include <wx/wx.h>
|
||||
#include <map>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#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"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "core/dispatch.hpp"
|
||||
#include "library/recentfiles.hpp"
|
||||
#include <functional>
|
||||
#include <wx/string.h>
|
||||
#include <wx/wx.h>
|
||||
#include <map>
|
||||
|
@ -14,7 +15,7 @@ class emulator_instance;
|
|||
class projects_menu : public wxMenu
|
||||
{
|
||||
public:
|
||||
projects_menu(wxWindow* win, emulator_instance& _inst, int wxid_low, int wxid_high, const std::string& cfg,
|
||||
projects_menu(wxWindow* win, emulator_instance& _inst, int wxid_low, int wxid_high, const std::string& cfg,
|
||||
std::function<void(const std::string& id)> cb);
|
||||
~projects_menu();
|
||||
void on_select(wxCommandEvent& e);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define _plat_wxwidgets__menu_tracelog__hpp__included__
|
||||
|
||||
#include "core/dispatch.hpp"
|
||||
#include <functional>
|
||||
#include <wx/string.h>
|
||||
#include <wx/wx.h>
|
||||
#include <map>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "core/window.hpp"
|
||||
#include "library/threads.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <cstdlib>
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
@ -135,6 +136,8 @@ public:
|
|||
|
||||
//Prompt for stuff. These all can throw canceled_exception.
|
||||
std::string pick_file_member(wxWindow* parent, const std::string& title, const std::string& startdir);
|
||||
unsigned pick_among_index(wxWindow* parent, const std::string& title, const std::string& prompt,
|
||||
const std::vector<std::string>& choices, unsigned defaultchoice = 0);
|
||||
std::string pick_among(wxWindow* parent, const std::string& title, const std::string& prompt,
|
||||
const std::vector<std::string>& choices, unsigned defaultchoice = 0);
|
||||
std::string pick_text(wxWindow* parent, const std::string& title, const std::string& prompt,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#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>
|
||||
|
|
BIN
lua.pdf
BIN
lua.pdf
Binary file not shown.
12
manual.lyx
12
manual.lyx
|
@ -947,11 +947,19 @@ Misc.
|
|||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection
|
||||
reload-rom [<file>]
|
||||
load-rom <file>
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Reloads the main ROM image from <file>.
|
||||
Loads ROM (format autodetected) from <file>.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection
|
||||
reload-rom
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
Reloads the main ROM image from.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsubsection
|
||||
|
|
14
manual.txt
14
manual.txt
|
@ -448,20 +448,24 @@ Enable/Disable sound.
|
|||
|
||||
5.8 Misc.
|
||||
|
||||
5.8.1 reload-rom [<file>]
|
||||
5.8.1 load-rom <file>
|
||||
|
||||
Reloads the main ROM image from <file>.
|
||||
Loads ROM (format autodetected) from <file>.
|
||||
|
||||
5.8.2 +tangent
|
||||
5.8.2 reload-rom
|
||||
|
||||
Reloads the main ROM image from.
|
||||
|
||||
5.8.3 +tangent
|
||||
|
||||
Tangent for recording voice for commentary track. While pressed,
|
||||
record a stream.
|
||||
|
||||
5.8.3 advance-subframe-timeout
|
||||
5.8.4 advance-subframe-timeout
|
||||
|
||||
Subframe advance timeout in milliseconds. Default is 100.
|
||||
|
||||
5.8.4 set-speed <speed>
|
||||
5.8.5 set-speed <speed>
|
||||
|
||||
Set the speed multiplier. <speed> may be positive number (1 is
|
||||
normal speed) or “turbo” for turbo.
|
||||
|
|
|
@ -66,6 +66,12 @@ FONT_SRC=unifontfull-5.1.20080820.hex
|
|||
# - Default value is 'lua'.
|
||||
LUA=lua
|
||||
|
||||
# Regex package to use.
|
||||
# Currently supported:
|
||||
# - NATIVE: std::thread
|
||||
# - BOOST: boost_thread
|
||||
REGEX=NATIVE
|
||||
|
||||
# Threading package to use.
|
||||
# Currently supported:
|
||||
# - NATIVE: std::thread
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue