diff options
Diffstat (limited to 'src/core/hle/service')
| -rw-r--r-- | src/core/hle/service/bcat/backend/boxcat.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/keyboard.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 25 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/mii/manager.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/sockets_translate.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/sockets_translate.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_zone_manager.cpp | 21 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 2 |
9 files changed, 36 insertions, 52 deletions
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index ca021a99f..589e288df 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp | |||
| @@ -196,7 +196,9 @@ private: | |||
| 196 | const std::string& content_type_name) { | 196 | const std::string& content_type_name) { |
| 197 | if (client == nullptr) { | 197 | if (client == nullptr) { |
| 198 | client = std::make_unique<httplib::SSLClient>(BOXCAT_HOSTNAME, PORT); | 198 | client = std::make_unique<httplib::SSLClient>(BOXCAT_HOSTNAME, PORT); |
| 199 | client->set_timeout_sec(timeout_seconds); | 199 | client->set_connection_timeout(timeout_seconds); |
| 200 | client->set_read_timeout(timeout_seconds); | ||
| 201 | client->set_write_timeout(timeout_seconds); | ||
| 200 | } | 202 | } |
| 201 | 203 | ||
| 202 | httplib::Headers headers{ | 204 | httplib::Headers headers{ |
| @@ -255,7 +257,7 @@ private: | |||
| 255 | return out; | 257 | return out; |
| 256 | } | 258 | } |
| 257 | 259 | ||
| 258 | std::unique_ptr<httplib::Client> client; | 260 | std::unique_ptr<httplib::SSLClient> client; |
| 259 | std::string path; | 261 | std::string path; |
| 260 | u64 title_id; | 262 | u64 title_id; |
| 261 | u64 build_id; | 263 | u64 build_id; |
| @@ -443,7 +445,9 @@ std::optional<std::vector<u8>> Boxcat::GetLaunchParameter(TitleIDVersion title) | |||
| 443 | Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global, | 445 | Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global, |
| 444 | std::map<std::string, EventStatus>& games) { | 446 | std::map<std::string, EventStatus>& games) { |
| 445 | httplib::SSLClient client{BOXCAT_HOSTNAME, static_cast<int>(PORT)}; | 447 | httplib::SSLClient client{BOXCAT_HOSTNAME, static_cast<int>(PORT)}; |
| 446 | client.set_timeout_sec(static_cast<int>(TIMEOUT_SECONDS)); | 448 | client.set_connection_timeout(static_cast<int>(TIMEOUT_SECONDS)); |
| 449 | client.set_read_timeout(static_cast<int>(TIMEOUT_SECONDS)); | ||
| 450 | client.set_write_timeout(static_cast<int>(TIMEOUT_SECONDS)); | ||
| 447 | 451 | ||
| 448 | httplib::Headers headers{ | 452 | httplib::Headers headers{ |
| 449 | {std::string("Game-Assets-API-Version"), std::string(BOXCAT_API_VERSION)}, | 453 | {std::string("Game-Assets-API-Version"), std::string(BOXCAT_API_VERSION)}, |
diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp index 0b896d5ad..59b694cd4 100644 --- a/src/core/hle/service/hid/controllers/keyboard.cpp +++ b/src/core/hle/service/hid/controllers/keyboard.cpp | |||
| @@ -42,8 +42,8 @@ void Controller_Keyboard::OnUpdate(const Core::Timing::CoreTiming& core_timing, | |||
| 42 | cur_entry.modifier = 0; | 42 | cur_entry.modifier = 0; |
| 43 | if (Settings::values.keyboard_enabled) { | 43 | if (Settings::values.keyboard_enabled) { |
| 44 | for (std::size_t i = 0; i < keyboard_keys.size(); ++i) { | 44 | for (std::size_t i = 0; i < keyboard_keys.size(); ++i) { |
| 45 | cur_entry.key[i / KEYS_PER_BYTE] |= | 45 | auto& entry = cur_entry.key[i / KEYS_PER_BYTE]; |
| 46 | (keyboard_keys[i]->GetStatus() << (i % KEYS_PER_BYTE)); | 46 | entry = static_cast<u8>(entry | (keyboard_keys[i]->GetStatus() << (i % KEYS_PER_BYTE))); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | for (std::size_t i = 0; i < keyboard_mods.size(); ++i) { | 49 | for (std::size_t i = 0; i < keyboard_mods.size(); ++i) { |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 2de4ed348..e311bc18c 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -269,7 +269,6 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) { | |||
| 269 | auto& rstick_entry = npad_pad_states[controller_idx].r_stick; | 269 | auto& rstick_entry = npad_pad_states[controller_idx].r_stick; |
| 270 | const auto& button_state = buttons[controller_idx]; | 270 | const auto& button_state = buttons[controller_idx]; |
| 271 | const auto& analog_state = sticks[controller_idx]; | 271 | const auto& analog_state = sticks[controller_idx]; |
| 272 | const auto& motion_state = motions[controller_idx]; | ||
| 273 | const auto [stick_l_x_f, stick_l_y_f] = | 272 | const auto [stick_l_x_f, stick_l_y_f] = |
| 274 | analog_state[static_cast<std::size_t>(JoystickId::Joystick_Left)]->GetStatus(); | 273 | analog_state[static_cast<std::size_t>(JoystickId::Joystick_Left)]->GetStatus(); |
| 275 | const auto [stick_r_x_f, stick_r_y_f] = | 274 | const auto [stick_r_x_f, stick_r_y_f] = |
| @@ -391,18 +390,6 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* | |||
| 391 | 390 | ||
| 392 | libnx_entry.connection_status.raw = 0; | 391 | libnx_entry.connection_status.raw = 0; |
| 393 | libnx_entry.connection_status.IsConnected.Assign(1); | 392 | libnx_entry.connection_status.IsConnected.Assign(1); |
| 394 | auto& full_sixaxis_entry = | ||
| 395 | npad.sixaxis_full.sixaxis[npad.sixaxis_full.common.last_entry_index]; | ||
| 396 | auto& handheld_sixaxis_entry = | ||
| 397 | npad.sixaxis_handheld.sixaxis[npad.sixaxis_handheld.common.last_entry_index]; | ||
| 398 | auto& dual_left_sixaxis_entry = | ||
| 399 | npad.sixaxis_dual_left.sixaxis[npad.sixaxis_dual_left.common.last_entry_index]; | ||
| 400 | auto& dual_right_sixaxis_entry = | ||
| 401 | npad.sixaxis_dual_right.sixaxis[npad.sixaxis_dual_right.common.last_entry_index]; | ||
| 402 | auto& left_sixaxis_entry = | ||
| 403 | npad.sixaxis_left.sixaxis[npad.sixaxis_left.common.last_entry_index]; | ||
| 404 | auto& right_sixaxis_entry = | ||
| 405 | npad.sixaxis_right.sixaxis[npad.sixaxis_right.common.last_entry_index]; | ||
| 406 | 393 | ||
| 407 | switch (controller_type) { | 394 | switch (controller_type) { |
| 408 | case NPadControllerType::None: | 395 | case NPadControllerType::None: |
| @@ -541,18 +528,6 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing | |||
| 541 | } | 528 | } |
| 542 | } | 529 | } |
| 543 | 530 | ||
| 544 | auto& main_controller = | ||
| 545 | npad.main_controller_states.npad[npad.main_controller_states.common.last_entry_index]; | ||
| 546 | auto& handheld_entry = | ||
| 547 | npad.handheld_states.npad[npad.handheld_states.common.last_entry_index]; | ||
| 548 | auto& dual_entry = npad.dual_states.npad[npad.dual_states.common.last_entry_index]; | ||
| 549 | auto& left_entry = npad.left_joy_states.npad[npad.left_joy_states.common.last_entry_index]; | ||
| 550 | auto& right_entry = | ||
| 551 | npad.right_joy_states.npad[npad.right_joy_states.common.last_entry_index]; | ||
| 552 | auto& pokeball_entry = | ||
| 553 | npad.pokeball_states.npad[npad.pokeball_states.common.last_entry_index]; | ||
| 554 | auto& libnx_entry = npad.libnx.npad[npad.libnx.common.last_entry_index]; | ||
| 555 | |||
| 556 | auto& full_sixaxis_entry = | 531 | auto& full_sixaxis_entry = |
| 557 | npad.sixaxis_full.sixaxis[npad.sixaxis_full.common.last_entry_index]; | 532 | npad.sixaxis_full.sixaxis[npad.sixaxis_full.common.last_entry_index]; |
| 558 | auto& handheld_sixaxis_entry = | 533 | auto& handheld_sixaxis_entry = |
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 71dbaba7f..8918946a1 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -475,7 +475,7 @@ void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) { | |||
| 475 | 475 | ||
| 476 | void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) { | 476 | void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) { |
| 477 | IPC::RequestParser rp{ctx}; | 477 | IPC::RequestParser rp{ctx}; |
| 478 | const auto enable{rp.Pop<bool>()}; | 478 | [[maybe_unused]] const auto enable{rp.Pop<bool>()}; |
| 479 | const auto handle{rp.Pop<u32>()}; | 479 | const auto handle{rp.Pop<u32>()}; |
| 480 | const auto applet_resource_user_id{rp.Pop<u64>()}; | 480 | const auto applet_resource_user_id{rp.Pop<u64>()}; |
| 481 | 481 | ||
diff --git a/src/core/hle/service/mii/manager.cpp b/src/core/hle/service/mii/manager.cpp index 4730070cb..8e433eb41 100644 --- a/src/core/hle/service/mii/manager.cpp +++ b/src/core/hle/service/mii/manager.cpp | |||
| @@ -428,7 +428,7 @@ bool MiiManager::IsFullDatabase() const { | |||
| 428 | } | 428 | } |
| 429 | 429 | ||
| 430 | u32 MiiManager::GetCount(SourceFlag source_flag) const { | 430 | u32 MiiManager::GetCount(SourceFlag source_flag) const { |
| 431 | u32 count{}; | 431 | std::size_t count{}; |
| 432 | if ((source_flag & SourceFlag::Database) != SourceFlag::None) { | 432 | if ((source_flag & SourceFlag::Database) != SourceFlag::None) { |
| 433 | // TODO(bunnei): We don't implement the Mii database, but when we do, update this | 433 | // TODO(bunnei): We don't implement the Mii database, but when we do, update this |
| 434 | count += 0; | 434 | count += 0; |
| @@ -436,7 +436,7 @@ u32 MiiManager::GetCount(SourceFlag source_flag) const { | |||
| 436 | if ((source_flag & SourceFlag::Default) != SourceFlag::None) { | 436 | if ((source_flag & SourceFlag::Default) != SourceFlag::None) { |
| 437 | count += DefaultMiiCount; | 437 | count += DefaultMiiCount; |
| 438 | } | 438 | } |
| 439 | return count; | 439 | return static_cast<u32>(count); |
| 440 | } | 440 | } |
| 441 | 441 | ||
| 442 | ResultVal<MiiInfo> MiiManager::UpdateLatest([[maybe_unused]] const MiiInfo& info, | 442 | ResultVal<MiiInfo> MiiManager::UpdateLatest([[maybe_unused]] const MiiInfo& info, |
diff --git a/src/core/hle/service/sockets/sockets_translate.cpp b/src/core/hle/service/sockets/sockets_translate.cpp index 139743e1d..2e626fd86 100644 --- a/src/core/hle/service/sockets/sockets_translate.cpp +++ b/src/core/hle/service/sockets/sockets_translate.cpp | |||
| @@ -89,9 +89,9 @@ Network::Protocol Translate(Type type, Protocol protocol) { | |||
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | u16 TranslatePollEventsToHost(u16 flags) { | 92 | u16 TranslatePollEventsToHost(u32 flags) { |
| 93 | u16 result = 0; | 93 | u32 result = 0; |
| 94 | const auto translate = [&result, &flags](u16 from, u16 to) { | 94 | const auto translate = [&result, &flags](u32 from, u32 to) { |
| 95 | if ((flags & from) != 0) { | 95 | if ((flags & from) != 0) { |
| 96 | flags &= ~from; | 96 | flags &= ~from; |
| 97 | result |= to; | 97 | result |= to; |
| @@ -105,12 +105,12 @@ u16 TranslatePollEventsToHost(u16 flags) { | |||
| 105 | translate(POLL_NVAL, Network::POLL_NVAL); | 105 | translate(POLL_NVAL, Network::POLL_NVAL); |
| 106 | 106 | ||
| 107 | UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags); | 107 | UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags); |
| 108 | return result; | 108 | return static_cast<u16>(result); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | u16 TranslatePollEventsToGuest(u16 flags) { | 111 | u16 TranslatePollEventsToGuest(u32 flags) { |
| 112 | u16 result = 0; | 112 | u32 result = 0; |
| 113 | const auto translate = [&result, &flags](u16 from, u16 to) { | 113 | const auto translate = [&result, &flags](u32 from, u32 to) { |
| 114 | if ((flags & from) != 0) { | 114 | if ((flags & from) != 0) { |
| 115 | flags &= ~from; | 115 | flags &= ~from; |
| 116 | result |= to; | 116 | result |= to; |
| @@ -125,7 +125,7 @@ u16 TranslatePollEventsToGuest(u16 flags) { | |||
| 125 | translate(Network::POLL_NVAL, POLL_NVAL); | 125 | translate(Network::POLL_NVAL, POLL_NVAL); |
| 126 | 126 | ||
| 127 | UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags); | 127 | UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags); |
| 128 | return result; | 128 | return static_cast<u16>(result); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | Network::SockAddrIn Translate(SockAddrIn value) { | 131 | Network::SockAddrIn Translate(SockAddrIn value) { |
diff --git a/src/core/hle/service/sockets/sockets_translate.h b/src/core/hle/service/sockets/sockets_translate.h index 8ed041e31..e498913d4 100644 --- a/src/core/hle/service/sockets/sockets_translate.h +++ b/src/core/hle/service/sockets/sockets_translate.h | |||
| @@ -31,10 +31,10 @@ Network::Type Translate(Type type); | |||
| 31 | Network::Protocol Translate(Type type, Protocol protocol); | 31 | Network::Protocol Translate(Type type, Protocol protocol); |
| 32 | 32 | ||
| 33 | /// Translate abstract poll event flags to guest poll event flags | 33 | /// Translate abstract poll event flags to guest poll event flags |
| 34 | u16 TranslatePollEventsToHost(u16 flags); | 34 | u16 TranslatePollEventsToHost(u32 flags); |
| 35 | 35 | ||
| 36 | /// Translate guest poll event flags to abstract poll event flags | 36 | /// Translate guest poll event flags to abstract poll event flags |
| 37 | u16 TranslatePollEventsToGuest(u16 flags); | 37 | u16 TranslatePollEventsToGuest(u32 flags); |
| 38 | 38 | ||
| 39 | /// Translate guest socket address structure to abstract socket address structure | 39 | /// Translate guest socket address structure to abstract socket address structure |
| 40 | Network::SockAddrIn Translate(SockAddrIn value); | 40 | Network::SockAddrIn Translate(SockAddrIn value); |
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index 69152d0ac..bdf0439f2 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp | |||
| @@ -820,7 +820,10 @@ static ResultCode ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, Calend | |||
| 820 | const ResultCode result{ | 820 | const ResultCode result{ |
| 821 | ToCalendarTimeInternal(rules, time, calendar_time, calendar.additiona_info)}; | 821 | ToCalendarTimeInternal(rules, time, calendar_time, calendar.additiona_info)}; |
| 822 | calendar.time.year = static_cast<s16>(calendar_time.year); | 822 | calendar.time.year = static_cast<s16>(calendar_time.year); |
| 823 | calendar.time.month = calendar_time.month + 1; // Internal impl. uses 0-indexed month | 823 | |
| 824 | // Internal impl. uses 0-indexed month | ||
| 825 | calendar.time.month = static_cast<s8>(calendar_time.month + 1); | ||
| 826 | |||
| 824 | calendar.time.day = calendar_time.day; | 827 | calendar.time.day = calendar_time.day; |
| 825 | calendar.time.hour = calendar_time.hour; | 828 | calendar.time.hour = calendar_time.hour; |
| 826 | calendar.time.minute = calendar_time.minute; | 829 | calendar.time.minute = calendar_time.minute; |
| @@ -872,13 +875,15 @@ ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, | |||
| 872 | const CalendarTime& calendar_time, s64& posix_time) const { | 875 | const CalendarTime& calendar_time, s64& posix_time) const { |
| 873 | posix_time = 0; | 876 | posix_time = 0; |
| 874 | 877 | ||
| 875 | CalendarTimeInternal internal_time{}; | 878 | CalendarTimeInternal internal_time{ |
| 876 | internal_time.year = calendar_time.year; | 879 | .year = calendar_time.year, |
| 877 | internal_time.month = calendar_time.month - 1; // Internal impl. uses 0-indexed month | 880 | // Internal impl. uses 0-indexed month |
| 878 | internal_time.day = calendar_time.day; | 881 | .month = static_cast<s8>(calendar_time.month - 1), |
| 879 | internal_time.hour = calendar_time.hour; | 882 | .day = calendar_time.day, |
| 880 | internal_time.minute = calendar_time.minute; | 883 | .hour = calendar_time.hour, |
| 881 | internal_time.second = calendar_time.second; | 884 | .minute = calendar_time.minute, |
| 885 | .second = calendar_time.second, | ||
| 886 | }; | ||
| 882 | 887 | ||
| 883 | s32 hour{internal_time.hour}; | 888 | s32 hour{internal_time.hour}; |
| 884 | s32 minute{internal_time.minute}; | 889 | s32 minute{internal_time.minute}; |
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 480d34725..d380c60fb 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -159,7 +159,7 @@ public: | |||
| 159 | header.data_size = static_cast<u32_le>(write_index - sizeof(Header)); | 159 | header.data_size = static_cast<u32_le>(write_index - sizeof(Header)); |
| 160 | header.data_offset = sizeof(Header); | 160 | header.data_offset = sizeof(Header); |
| 161 | header.objects_size = 4; | 161 | header.objects_size = 4; |
| 162 | header.objects_offset = sizeof(Header) + header.data_size; | 162 | header.objects_offset = static_cast<u32>(sizeof(Header) + header.data_size); |
| 163 | std::memcpy(buffer.data(), &header, sizeof(Header)); | 163 | std::memcpy(buffer.data(), &header, sizeof(Header)); |
| 164 | 164 | ||
| 165 | return buffer; | 165 | return buffer; |