Support multiple cores at once
Yes, this can really be built to have both bsnes and gambatte cores at once (even if the result can't be distributed).
This commit is contained in:
parent
f14acf07de
commit
a6f4d2dae1
31 changed files with 164 additions and 92 deletions
51
Makefile
51
Makefile
|
@ -10,11 +10,16 @@ REALCC = $(CROSS_PREFIX)$(CC)
|
|||
REALLD = $(CROSS_PREFIX)$(LD)
|
||||
REALRANLIB = $(CROSS_PREFIX)$(RANLIB)
|
||||
|
||||
ifeq ($(CORE_TYPE), BSNES)
|
||||
CORE_PATH=$(shell pwd)/bsnes
|
||||
CORE_SUBDIR=bsnes
|
||||
CORE_OBJECT=bsnes/out/libsnes.$(ARCHIVE_SUFFIX)
|
||||
CORE_DEFINE=-DCORETYPE_BSNES=1
|
||||
CORE_DEFINE=
|
||||
CORE_OBJECT=
|
||||
CORE_OBJECTS=
|
||||
CORE_PATH=
|
||||
|
||||
ifdef BSNES_VERSION
|
||||
CORE_PATH+=-I$(shell pwd)/bsnes
|
||||
CORE_OBJECT+=../bsnes/out/libsnes.$(ARCHIVE_SUFFIX)
|
||||
CORE_OBJECTS+=bsnes/out/libsnes.$(ARCHIVE_SUFFIX)
|
||||
CORE_DEFINE+=-DCORETYPE_BSNES=1
|
||||
ifdef BSNES_IS_COMPAT
|
||||
CFLAGS += -DBSNES_IS_COMPAT
|
||||
BSNES_PROFILE_STRING=profile=compatibility
|
||||
|
@ -30,29 +35,25 @@ BSNES_PROFILE_STRING+=options=debugger
|
|||
CFLAGS += -DBSNES_HAS_DEBUGGER
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BSNES_VERSION), 087)
|
||||
BSNES_TARGET_STRING=target=libsnes
|
||||
else
|
||||
BSNES_TARGET_STRING=ui=ui-libsnes
|
||||
endif
|
||||
CFLAGS += -DBSNES_V${BSNES_VERSION}
|
||||
else
|
||||
ifeq ($(CORE_TYPE), GAMBATTE)
|
||||
CORE_PATH=$(shell pwd)/gambatte
|
||||
CORE_SUBDIR=gambatte
|
||||
CORE_OBJECT=gambatte/libgambatte/libgambatte.$(ARCHIVE_SUFFIX)
|
||||
CORE_DEFINE=-DCORETYPE_GAMBATTE=1
|
||||
BSNES_PROFILE_STRING=
|
||||
BSNES_TARGET_STRING=
|
||||
else
|
||||
$(error "Bad value for CORETYPE (expected BSNES or GAMBATTE)")
|
||||
BUILD_BSNES=1
|
||||
endif
|
||||
|
||||
ifdef BUILD_GAMBATTE
|
||||
CORE_PATH+=-I$(shell pwd)/gambatte
|
||||
CORE_OBJECT+=../gambatte/libgambatte/libgambatte.$(ARCHIVE_SUFFIX)
|
||||
CORE_OBJECTS+=gambatte/libgambatte/libgambatte.$(ARCHIVE_SUFFIX)
|
||||
CORE_DEFINE+=-DCORETYPE_GAMBATTE=1
|
||||
endif
|
||||
|
||||
#Flags.
|
||||
HOSTCCFLAGS = -std=gnu++0x
|
||||
CFLAGS += -I$(CORE_PATH) $(CORE_DEFINE) -std=gnu++0x $(USER_CFLAGS)
|
||||
CFLAGS += $(CORE_PATH) $(CORE_DEFINE) -std=gnu++0x $(USER_CFLAGS)
|
||||
ifdef BOOST_NEEDS_MT
|
||||
BOOST_LIB_POSTFIX=-mt
|
||||
else
|
||||
|
@ -83,11 +84,19 @@ LDFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --libs)
|
|||
compiler=$(subst ++,cc,$(REALCC))
|
||||
gambatte_compiler=$(REALCC)
|
||||
|
||||
$(CORE_OBJECT): forcelook
|
||||
$(MAKE) -C $(CORE_SUBDIR) $(BSNES_PROFILE_STRING) $(BSNES_TARGET_STRING)
|
||||
$(REALRANLIB) $@
|
||||
ifdef BUILD_BSNES
|
||||
bsnes/out/libsnes.$(ARCHIVE_SUFFIX): forcelook
|
||||
$(MAKE) -C bsnes $(BSNES_PROFILE_STRING) $(BSNES_TARGET_STRING)
|
||||
$(REALRANLIB) bsnes/out/libsnes.$(ARCHIVE_SUFFIX)
|
||||
endif
|
||||
|
||||
src/__all_files__: src/core/version.cpp forcelook $(CORE_OBJECT)
|
||||
ifdef BUILD_GAMBATTE
|
||||
gambatte/libgambatte/libgambatte.$(ARCHIVE_SUFFIX): forcelook
|
||||
$(MAKE) -C gambatte
|
||||
$(REALRANLIB) gambatte/libgambatte/libgambatte.$(ARCHIVE_SUFFIX)
|
||||
endif
|
||||
|
||||
src/__all_files__: src/core/version.cpp forcelook $(CORE_OBJECTS)
|
||||
$(MAKE) -C src precheck
|
||||
$(MAKE) -C src
|
||||
cp src/lsnes$(DOT_EXECUTABLE_SUFFIX) .
|
||||
|
|
|
@ -361,6 +361,16 @@ public:
|
|||
* Call on_dumper_update on on all objects.
|
||||
*/
|
||||
static void do_dumper_update() throw();
|
||||
/**
|
||||
* Notify that core changed.
|
||||
*
|
||||
* Default implementation does nothing.
|
||||
*/
|
||||
virtual void on_core_change();
|
||||
/**
|
||||
* Call on_dumper_update on on all objects.
|
||||
*/
|
||||
static void do_core_change() throw();
|
||||
protected:
|
||||
/**
|
||||
* Call to indicate this target is interested in sound sample data.
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef _emucore__hpp__included__
|
||||
#define _emucore__hpp__included__
|
||||
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include "library/framebuffer.hpp"
|
||||
#include "library/controller-data.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "interface/callbacks.hpp"
|
||||
|
||||
//Valid port types.
|
||||
|
||||
//Emulator core.
|
||||
extern core_core* emulator_core;
|
||||
|
||||
#endif
|
|
@ -138,6 +138,7 @@ struct core_romimage
|
|||
struct core_core
|
||||
{
|
||||
core_core(core_core_params& params);
|
||||
~core_core() throw();
|
||||
bool set_region(core_region& region);
|
||||
std::pair<uint32_t, uint32_t> get_video_rate();
|
||||
std::pair<uint32_t, uint32_t> get_audio_rate();
|
||||
|
@ -159,6 +160,9 @@ struct core_core
|
|||
void set_pflag(unsigned pflag);
|
||||
void request_reset(long delay);
|
||||
port_type** get_port_types() { return port_types; }
|
||||
static std::set<core_core*> all_cores();
|
||||
static void install_all_handlers();
|
||||
static void uninstall_all_handlers();
|
||||
private:
|
||||
std::string (*_core_identifier)();
|
||||
bool (*_set_region)(core_region& region);
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#define PROFILE_ACCURACY
|
||||
#endif
|
||||
|
||||
extern std::string bsnes_core_version;
|
||||
extern std::string lsnes_version;
|
||||
extern std::string lsnes_git_revision;
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ void signal_program_exit();
|
|||
void signal_resize_needed();
|
||||
void _runuifun_async(void (*fn)(void*), void* arg);
|
||||
void show_projectwindow(wxWindow* modwin);
|
||||
void signal_core_change();
|
||||
|
||||
//Editor dialogs.
|
||||
void wxeditor_authors_display(wxWindow* parent);
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
void notify_update_status() throw();
|
||||
void notify_resized() throw();
|
||||
void notify_exit() throw();
|
||||
void refresh_title() throw();
|
||||
void on_close(wxCloseEvent& e);
|
||||
void menu_start(wxString name);
|
||||
void menu_special(wxString name, wxMenu* menu);
|
||||
|
|
|
@ -99,13 +99,10 @@ JOYSTICK=DUMMY
|
|||
# This is used for high-quality samplerate conversion for dumping.
|
||||
SECRET_RABBIT_CODE=
|
||||
|
||||
# Core to use.
|
||||
# Currently supported:
|
||||
# - BNSES: BSNES
|
||||
# - GAMBATTE: GAMBATTE
|
||||
CORE_TYPE=BSNES
|
||||
# Set to non-empty value (e.g. 'yes') to build the gambatte core.
|
||||
BUILD_GAMBATTE=
|
||||
|
||||
# Bsnes version used.
|
||||
# Bsnes version used. Non-empty value also causes bsnes core to be built.
|
||||
# 087 has different layout from the rest.
|
||||
BSNES_VERSION=085
|
||||
|
||||
|
|
|
@ -63,10 +63,10 @@ video/$(ALLOBJECT): forcelook
|
|||
.PRECIOUS: %.$(OBJECT_SUFFIX) util/%.$(OBJECT_SUFFIX)
|
||||
|
||||
%.util$(DOT_EXECUTABLE_SUFFIX): %.$(OBJECT_SUFFIX) $(DUMMY_LIBRARY_OBJS)
|
||||
$(REALCC) -o $@ $^ $(LDFLAGS) ../$(CORE_OBJECT) `cat $(DUMMY_LIBRARY_FLAGS)`
|
||||
$(REALCC) -o $@ $^ $(LDFLAGS) $(CORE_OBJECT) `cat $(DUMMY_LIBRARY_FLAGS)`
|
||||
|
||||
lsnes$(DOT_EXECUTABLE_SUFFIX): $(PLATFORM_LIBRARY_OBJS)
|
||||
$(REALCC) -o $@ $^ $(LDFLAGS) ../$(CORE_OBJECT) `cat $(PLATFORM_LIBRARY_FLAGS)`
|
||||
$(REALCC) -o $@ $^ $(LDFLAGS) $(CORE_OBJECT) `cat $(PLATFORM_LIBRARY_FLAGS)`
|
||||
|
||||
precheck:
|
||||
$(MAKE) -C core precheck
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
#include <climits>
|
||||
#include "core/audioapi.hpp"
|
||||
#include "core/misc.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
#include "core/command.hpp"
|
||||
#include "core/controllerframe.hpp"
|
||||
#include "core/dispatch.hpp"
|
||||
#include "core/framebuffer.hpp"
|
||||
#include "core/settings.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "interface/setting.hpp"
|
||||
#include "interface/callbacks.hpp"
|
||||
#include "library/pixfmt-lrgb.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/portfn.hpp"
|
||||
|
@ -1476,7 +1477,4 @@ again2:
|
|||
#endif
|
||||
}
|
||||
|
||||
core_core* emulator_core = &bsnes_core;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "lsnes.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/command.hpp"
|
||||
#include "core/controller.hpp"
|
||||
|
@ -8,6 +7,7 @@
|
|||
#include "core/mainloop.hpp"
|
||||
#include "core/misc.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/string.hpp"
|
||||
|
||||
#include <map>
|
||||
|
@ -148,10 +148,15 @@ namespace
|
|||
static int done = 0;
|
||||
if(done)
|
||||
return;
|
||||
auto ptypes = emulator_core->get_port_types();
|
||||
std::vector<port_type*> ptypes;
|
||||
for(auto i : core_core::all_cores()) {
|
||||
auto _ptypes = i->get_port_types();
|
||||
for(unsigned j = 0; _ptypes[j]; j++)
|
||||
ptypes.push_back(_ptypes[j]);
|
||||
}
|
||||
for(unsigned i = 0;; i++) {
|
||||
bool any = false;
|
||||
for(unsigned j = 0; ptypes[j]; j++) {
|
||||
for(unsigned j = 0; j < ptypes.size(); j++) {
|
||||
if(!ptypes[j]->legal(i))
|
||||
continue;
|
||||
any = true;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/controllerframe.hpp"
|
||||
#include "core/dispatch.hpp"
|
||||
#include "core/misc.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
|
|
@ -465,3 +465,19 @@ void information_dispatch::do_dumper_update() throw()
|
|||
END_EH_BLOCK(i, "on_dumper_update");
|
||||
}
|
||||
}
|
||||
|
||||
void information_dispatch::on_core_change()
|
||||
{
|
||||
//Do nothing.
|
||||
}
|
||||
|
||||
void information_dispatch::do_core_change() throw()
|
||||
{
|
||||
if(in_global_ctors())
|
||||
return;
|
||||
for(auto& i : dispatch()) {
|
||||
START_EH_BLOCK
|
||||
i->on_core_change();
|
||||
END_EH_BLOCK(i, "on_core_change");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
#include <vector>
|
||||
#include "core/audioapi.hpp"
|
||||
#include "core/misc.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
#include "core/command.hpp"
|
||||
#include "core/controllerframe.hpp"
|
||||
#include "core/dispatch.hpp"
|
||||
#include "core/framebuffer.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include "interface/callbacks.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/pixfmt-rgb32.hpp"
|
||||
#include "library/string.hpp"
|
||||
|
@ -547,6 +547,4 @@ namespace
|
|||
});
|
||||
}
|
||||
|
||||
core_core* emulator_core = &gambatte_core;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "lsnes.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/command.hpp"
|
||||
#include "core/controller.hpp"
|
||||
|
@ -19,6 +18,8 @@
|
|||
#include "core/rrdata.hpp"
|
||||
#include "core/settings.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include "interface/callbacks.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/framebuffer.hpp"
|
||||
#include "library/pixfmt-lrgb.hpp"
|
||||
|
||||
|
@ -221,6 +222,8 @@ namespace
|
|||
messages << "Can't reload ROM: " << e.what() << std::endl;
|
||||
return false;
|
||||
}
|
||||
messages << "Using core: " << our_rom->rtype->get_core_identifier() << std::endl;
|
||||
information_dispatch::do_core_change();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -878,7 +881,7 @@ void main_loop(struct loaded_rom& rom, struct moviefile& initial, bool load_has_
|
|||
lsnes_callbacks lsnes_callbacks_obj;
|
||||
ecore_callbacks = &lsnes_callbacks_obj;
|
||||
movb.get_movie().set_pflag_handler(&lsnes_pflag_handler);
|
||||
emulator_core->install_handler();
|
||||
core_core::install_all_handlers();
|
||||
|
||||
//Load our given movie.
|
||||
bool first_round = false;
|
||||
|
@ -961,6 +964,6 @@ void main_loop(struct loaded_rom& rom, struct moviefile& initial, bool load_has_
|
|||
lua_callback_do_frame();
|
||||
}
|
||||
information_dispatch::do_dump_end();
|
||||
emulator_core->uninstall_handler();
|
||||
core_core::uninstall_all_handlers();
|
||||
voicethread_kill();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/command.hpp"
|
||||
#include "core/memorymanip.hpp"
|
||||
|
@ -6,6 +5,7 @@
|
|||
#include "core/misc.hpp"
|
||||
#include "core/rom.hpp"
|
||||
#include "core/rrdata.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
#include "library/memorysearch.hpp"
|
||||
|
|
|
@ -255,5 +255,3 @@ void reached_main()
|
|||
lsnes_cmd.set_oom_panic(OOM_panic);
|
||||
lsnes_cmd.set_output(platform::out());
|
||||
}
|
||||
|
||||
std::string bsnes_core_version;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "lsnes.hpp"
|
||||
|
||||
#include "core/emucore.hpp"
|
||||
#include "core/misc.hpp"
|
||||
#include "core/movie.hpp"
|
||||
#include "core/rom.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "lsnes.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/command.hpp"
|
||||
#include "core/controller.hpp"
|
||||
|
@ -12,6 +11,7 @@
|
|||
#include "core/rrdata.hpp"
|
||||
#include "core/settings.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
|
@ -299,16 +299,16 @@ void do_load_state(struct moviefile& _movie, int lmode)
|
|||
if(our_rom->orig_region && !our_rom->orig_region->compatible_with(_movie.gametype->get_region()))
|
||||
throw std::runtime_error("NTSC/PAL select of movie and loaded ROM don't match");
|
||||
|
||||
if(our_rom->rtype && _movie.coreversion != bsnes_core_version) {
|
||||
if(our_rom->rtype && _movie.coreversion != our_rom->rtype->get_core_identifier()) {
|
||||
if(will_load_state) {
|
||||
std::ostringstream x;
|
||||
x << "ERROR: Emulator core version mismatch!" << std::endl
|
||||
<< "\tThis version: " << bsnes_core_version << std::endl
|
||||
<< "\tThis version: " << our_rom->rtype->get_core_identifier() << std::endl
|
||||
<< "\tFile is from: " << _movie.coreversion << std::endl;
|
||||
throw std::runtime_error(x.str());
|
||||
} else
|
||||
messages << "WARNING: Emulator core version mismatch!" << std::endl
|
||||
<< "\tThis version: " << bsnes_core_version << std::endl
|
||||
<< "\tThis version: " << our_rom->rtype->get_core_identifier() << std::endl
|
||||
<< "\tFile is from: " << _movie.coreversion << std::endl;
|
||||
}
|
||||
bool rom_ok = true;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "core/emucore.hpp"
|
||||
#include "core/misc.hpp"
|
||||
#include "core/moviedata.hpp"
|
||||
#include "core/moviefile.hpp"
|
||||
#include "core/rrdata.hpp"
|
||||
#include "library/zip.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <boost/iostreams/copy.hpp>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "lsnes.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/command.hpp"
|
||||
#include "core/dispatch.hpp"
|
||||
|
@ -10,6 +9,7 @@
|
|||
#include "core/rom.hpp"
|
||||
#include "core/settings.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/portfn.hpp"
|
||||
#include "library/patch.hpp"
|
||||
#include "library/sha256.hpp"
|
||||
|
|
|
@ -12,6 +12,14 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
bool install_handlers_automatically;
|
||||
|
||||
std::set<core_core*>& all_cores_set()
|
||||
{
|
||||
static std::set<core_core*> x;
|
||||
return x;
|
||||
}
|
||||
|
||||
std::map<std::string, core_sysregion*>& sysregions()
|
||||
{
|
||||
static std::map<std::string, core_sysregion*> x;
|
||||
|
@ -326,6 +334,14 @@ core_core::core_core(core_core_params& params)
|
|||
_set_pflag = params.set_pflag;
|
||||
_request_reset = params.request_reset;
|
||||
port_types = params.port_types;
|
||||
all_cores_set().insert(this);
|
||||
if(install_handlers_automatically)
|
||||
install_handler();
|
||||
}
|
||||
|
||||
core_core::~core_core() throw()
|
||||
{
|
||||
all_cores().erase(this);
|
||||
}
|
||||
|
||||
bool core_core::set_region(core_region& region)
|
||||
|
@ -356,6 +372,25 @@ std::string core_core::get_core_identifier()
|
|||
return _core_identifier();
|
||||
}
|
||||
|
||||
std::set<core_core*> core_core::all_cores()
|
||||
{
|
||||
return all_cores_set();
|
||||
}
|
||||
|
||||
void core_core::install_all_handlers()
|
||||
{
|
||||
install_handlers_automatically = true;
|
||||
for(auto i : all_cores_set())
|
||||
i->install_handler();
|
||||
}
|
||||
|
||||
void core_core::uninstall_all_handlers()
|
||||
{
|
||||
install_handlers_automatically = false;
|
||||
for(auto i : all_cores_set())
|
||||
i->uninstall_handler();
|
||||
}
|
||||
|
||||
std::map<std::string, std::vector<char>> core_core::save_sram() throw(std::bad_alloc)
|
||||
{
|
||||
return _save_sram();
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "core/command.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
#include "lua/internal.hpp"
|
||||
#include "core/framerate.hpp"
|
||||
#include "core/moviefile.hpp"
|
||||
#include "core/moviedata.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "core/keymapper.hpp"
|
||||
#include "lua/internal.hpp"
|
||||
#include "core/movie.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
#include "core/moviedata.hpp"
|
||||
#include "core/controller.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <wx/radiobut.h>
|
||||
|
||||
#include "library/string.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
|
||||
class wxeditor_watchexpr : public wxDialog
|
||||
{
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <wx/radiobut.h>
|
||||
|
||||
#include "library/string.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
|
||||
class wxeditor_subtitles : public wxDialog
|
||||
{
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#include <wx/wx.h>
|
||||
|
||||
#include "lsnes.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/command.hpp"
|
||||
#include "core/controller.hpp"
|
||||
|
@ -16,6 +15,7 @@
|
|||
#include "core/rrdata.hpp"
|
||||
#include "core/settings.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/zip.hpp"
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
|||
#include <wx/cmdline.h>
|
||||
#include <iostream>
|
||||
|
||||
#define UISERV_REFRESH_TITLE 9990
|
||||
#define UISERV_RESIZED 9991
|
||||
#define UISERV_UIFUN 9992
|
||||
//#define UISERV_UI_IRQ 9993 Not in use anymore, can be recycled.
|
||||
|
@ -101,6 +102,9 @@ namespace
|
|||
wxMessageBox(_T("Panic: Unrecoverable error, can't continue"), _T("Error"), wxICON_ERROR |
|
||||
wxOK);
|
||||
panic_ack = true;
|
||||
} else if(c == UISERV_REFRESH_TITLE) {
|
||||
if(main_window)
|
||||
main_window->refresh_title();
|
||||
} else if(c == UISERV_RESIZED) {
|
||||
if(main_window)
|
||||
main_window->notify_resized();
|
||||
|
@ -435,11 +439,9 @@ bool lsnes_app::OnInit()
|
|||
ui_mutex = &mutex::aquire();
|
||||
ui_condition = &condition::aquire(*ui_mutex);
|
||||
|
||||
bsnes_core_version = emulator_core->get_core_identifier();
|
||||
ui_thread = &thread_id::me();
|
||||
platform::init();
|
||||
|
||||
messages << "BSNES version: " << bsnes_core_version << std::endl;
|
||||
messages << "lsnes version: lsnes rr" << lsnes_version << std::endl;
|
||||
|
||||
loaded_rom dummy_rom;
|
||||
|
@ -505,9 +507,9 @@ bool lsnes_app::OnInit()
|
|||
auto ctrldata = rom->rtype->controllerconfig(mov->settings);
|
||||
port_type_set& ports = port_type_set::make(ctrldata.ports, ctrldata.portindex);
|
||||
mov->input.clear(ports);
|
||||
mov->coreversion = rom->rtype->get_core_identifier();
|
||||
if(c_rom != "") {
|
||||
//Initialize the remainder.
|
||||
mov->coreversion = bsnes_core_version;
|
||||
mov->projectid = get_random_hexstring(40);
|
||||
mov->rerecords = "0";
|
||||
for(size_t i = 0; i < sizeof(rom->romimg)/sizeof(rom->romimg[0]); i++) {
|
||||
|
@ -517,6 +519,7 @@ bool lsnes_app::OnInit()
|
|||
}
|
||||
mov->gametype = &rom->rtype->combine_region(*rom->region);
|
||||
}
|
||||
our_rom = rom;
|
||||
mov->start_paused = true;
|
||||
boot_emulator(*rom, *mov);
|
||||
|
||||
|
@ -559,6 +562,11 @@ void graphics_plugin::notify_screen() throw()
|
|||
post_ui_event(UISERV_UPDATE_SCREEN);
|
||||
}
|
||||
|
||||
void signal_core_change()
|
||||
{
|
||||
post_ui_event(UISERV_REFRESH_TITLE);
|
||||
}
|
||||
|
||||
bool graphics_plugin::modal_message(const std::string& text, bool confirm) throw()
|
||||
{
|
||||
mutex::holder h(*ui_mutex);
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "platform/wxwidgets/window_messages.hpp"
|
||||
#include "platform/wxwidgets/window_status.hpp"
|
||||
|
||||
#include "core/emucore.hpp"
|
||||
#include "core/audioapi.hpp"
|
||||
#include "core/command.hpp"
|
||||
#include "core/controller.hpp"
|
||||
|
@ -15,6 +14,7 @@
|
|||
#include "core/dispatch.hpp"
|
||||
#include "core/framebuffer.hpp"
|
||||
#include "core/framerate.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/loadlib.hpp"
|
||||
#include "lua/lua.hpp"
|
||||
#include "core/mainloop.hpp"
|
||||
|
@ -163,7 +163,8 @@ namespace
|
|||
|
||||
wxString getname()
|
||||
{
|
||||
std::string windowname = "lsnes rr" + lsnes_version + "[" + bsnes_core_version + "]";
|
||||
std::string windowname = "lsnes rr" + lsnes_version + " [" + our_rom->rtype->get_core_identifier()
|
||||
+ "]";
|
||||
return towxstring(windowname);
|
||||
}
|
||||
|
||||
|
@ -179,6 +180,7 @@ namespace
|
|||
struct emu_args* args = reinterpret_cast<struct emu_args*>(_args);
|
||||
try {
|
||||
our_rom = args->rom;
|
||||
messages << "Using core: " << our_rom->rtype->get_core_identifier() << std::endl;
|
||||
struct moviefile* movie = args->initial;
|
||||
bool has_to_succeed = args->load_has_to_succeed;
|
||||
platform::flush_command_queue();
|
||||
|
@ -319,6 +321,7 @@ namespace
|
|||
void on_mode_change(bool readonly) throw();
|
||||
void on_autohold_update(unsigned port, unsigned controller, unsigned ctrlnum, bool newstate);
|
||||
void on_autohold_reconfigure();
|
||||
void on_core_change();
|
||||
private:
|
||||
wxwin_mainwindow* mainw;
|
||||
sound_select_menu* sounddev;
|
||||
|
@ -440,6 +443,11 @@ namespace
|
|||
mainw = win;
|
||||
}
|
||||
|
||||
void broadcast_listener::on_core_change()
|
||||
{
|
||||
signal_core_change();
|
||||
}
|
||||
|
||||
void broadcast_listener::set_sound_select(sound_select_menu* sdev)
|
||||
{
|
||||
sounddev = sdev;
|
||||
|
@ -918,6 +926,11 @@ void wxwin_mainwindow::handle_menu_click(wxCommandEvent& e)
|
|||
}
|
||||
}
|
||||
|
||||
void wxwin_mainwindow::refresh_title() throw()
|
||||
{
|
||||
SetTitle(getname());
|
||||
}
|
||||
|
||||
void wxwin_mainwindow::handle_menu_click_cancelable(wxCommandEvent& e)
|
||||
{
|
||||
std::string filename;
|
||||
|
@ -1085,7 +1098,7 @@ void wxwin_mainwindow::handle_menu_click_cancelable(wxCommandEvent& e)
|
|||
std::ostringstream str;
|
||||
str << "Version: lsnes rr" << lsnes_version << std::endl;
|
||||
str << "Revision: " << lsnes_git_revision << std::endl;
|
||||
str << "Core: " << bsnes_core_version << std::endl;
|
||||
str << "Core: " << our_rom->rtype->get_core_identifier() << std::endl;
|
||||
wxMessageBox(towxstring(str.str()), _T("About"), wxICON_INFORMATION | wxOK, this);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
#include <wx/notebook.h>
|
||||
|
||||
#include "lsnes.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/moviedata.hpp"
|
||||
#include "core/framerate.hpp"
|
||||
#include "core/settings.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "interface/setting.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/zip.hpp"
|
||||
|
@ -317,7 +317,7 @@ struct moviefile wxwin_project::make_movie()
|
|||
if(!i.second.get_setting()->validate(f.settings[i.first]))
|
||||
throw std::runtime_error((stringfmt() << "Bad value for setting " << i.first).str());
|
||||
}
|
||||
f.coreversion = bsnes_core_version;
|
||||
f.coreversion = our_rom->rtype->get_core_identifier();
|
||||
f.gamename = tostdstring(projectname->GetValue());
|
||||
f.prefix = sanitize_prefix(tostdstring(prefix->GetValue()));
|
||||
f.projectid = get_random_hexstring(40);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "lsnes.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
|
||||
#include "core/advdumper.hpp"
|
||||
#include "core/command.hpp"
|
||||
#include "core/dispatch.hpp"
|
||||
#include "core/framerate.hpp"
|
||||
#include "core/keymapper.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/loadlib.hpp"
|
||||
#include "lua/lua.hpp"
|
||||
#include "core/mainloop.hpp"
|
||||
|
@ -232,7 +232,6 @@ int main(int argc, char** argv)
|
|||
adv_dumper& dumper = get_dumper(cmdline, mode, prefix, length);
|
||||
|
||||
set_random_seed();
|
||||
bsnes_core_version = emulator_core->get_core_identifier();
|
||||
platform::init();
|
||||
init_lua();
|
||||
|
||||
|
@ -307,6 +306,7 @@ int main(int argc, char** argv)
|
|||
throw std::runtime_error("Can't load any of the movies specified");
|
||||
//Load ROM before starting the dumper.
|
||||
our_rom = &r;
|
||||
messages << "Using core: " << our_rom->rtype->get_core_identifier() << std::endl;
|
||||
our_rom->region = &movie.gametype->get_region();
|
||||
our_rom->load(movie.settings, movie.movie_rtc_second, movie.movie_rtc_subsecond);
|
||||
startup_lua_scripts(cmdline);
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
#if defined(BSNES_V084) || defined(BSNES_V085) || defined(BSNES_V086) || defined(BSNES_V087)
|
||||
#include "lsnes.hpp"
|
||||
#include <core/emucore.hpp>
|
||||
#include "core/advdumper.hpp"
|
||||
#include "core/dispatch.hpp"
|
||||
#include "core/emucore.hpp"
|
||||
#include "core/moviedata.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/serialization.hpp"
|
||||
#include "video/tcp.hpp"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue