mtp: support overriding vid/pid.
This commit is contained in:
@@ -394,7 +394,7 @@ endif()
|
||||
if (ENABLE_LIBHAZE)
|
||||
FetchContent_Declare(libhaze
|
||||
GIT_REPOSITORY https://github.com/ITotalJustice/libhaze.git
|
||||
GIT_TAG f0b2a14
|
||||
GIT_TAG d60ba60
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(libhaze)
|
||||
|
||||
@@ -338,6 +338,10 @@ public:
|
||||
// todo: move this into it's own menu
|
||||
option::OptionLong m_text_scroll_speed{"accessibility", "text_scroll_speed", 1}; // normal
|
||||
|
||||
// mtp options.
|
||||
option::OptionLong m_mtp_vid{"mtp", "vid", 0x057e}; // nintendo
|
||||
option::OptionLong m_mtp_pid{"mtp", "pid", 0x201d}; // switch
|
||||
|
||||
std::shared_ptr<fs::FsNativeSd> m_fs{};
|
||||
audio::SongID m_background_music{};
|
||||
|
||||
|
||||
@@ -1427,7 +1427,7 @@ App::App(const char* argv0) {
|
||||
// init fs for app use.
|
||||
m_fs = std::make_shared<fs::FsNativeSd>(true);
|
||||
|
||||
auto cb = [](const mTCHAR *Section, const mTCHAR *Key, const mTCHAR *Value, void *UserData) -> int {
|
||||
static const auto cb = [](const mTCHAR *Section, const mTCHAR *Key, const mTCHAR *Value, void *UserData) -> int {
|
||||
auto app = static_cast<App*>(UserData);
|
||||
|
||||
if (!std::strcmp(Section, INI_SECTION)) {
|
||||
@@ -1478,6 +1478,9 @@ App::App(const char* argv0) {
|
||||
else if (app->m_nsz_compress_ldm.LoadFrom(Key, Value)) {}
|
||||
else if (app->m_nsz_compress_block.LoadFrom(Key, Value)) {}
|
||||
else if (app->m_nsz_compress_block_exponent.LoadFrom(Key, Value)) {}
|
||||
} else if (!std::strcmp(Section, "mtp")) {
|
||||
if (app->m_mtp_vid.LoadFrom(Key, Value)) {}
|
||||
else if (app->m_mtp_pid.LoadFrom(Key, Value)) {}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -579,7 +579,7 @@ bool Init() {
|
||||
g_fs_entries.emplace_back(std::make_shared<FsInstallProxy>("install", "Install (NSP, XCI, NSZ, XCZ)"));
|
||||
|
||||
g_should_exit = false;
|
||||
if (!::haze::Initialize(haze_callback, THREAD_PRIO, THREAD_CORE, g_fs_entries)) {
|
||||
if (!::haze::Initialize(haze_callback, THREAD_PRIO, THREAD_CORE, g_fs_entries, App::GetApp()->m_mtp_vid.Get(), App::GetApp()->m_mtp_pid.Get())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user