diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/set/set.cpp | 30 | ||||
| -rw-r--r-- | src/core/hle/service/set/set.h | 21 | ||||
| -rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/engines/fermi_2d.h | 5 |
5 files changed, 56 insertions, 10 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 19fadcb8e..c123e7809 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include "core/hle/service/apm/apm.h" | 12 | #include "core/hle/service/apm/apm.h" |
| 13 | #include "core/hle/service/filesystem/filesystem.h" | 13 | #include "core/hle/service/filesystem/filesystem.h" |
| 14 | #include "core/hle/service/nvflinger/nvflinger.h" | 14 | #include "core/hle/service/nvflinger/nvflinger.h" |
| 15 | #include "core/hle/service/set/set.h" | ||
| 15 | #include "core/settings.h" | 16 | #include "core/settings.h" |
| 16 | 17 | ||
| 17 | namespace Service::AM { | 18 | namespace Service::AM { |
| @@ -537,10 +538,11 @@ void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) { | |||
| 537 | } | 538 | } |
| 538 | 539 | ||
| 539 | void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) { | 540 | void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) { |
| 541 | // TODO(bunnei): This should be configurable | ||
| 540 | IPC::ResponseBuilder rb{ctx, 4}; | 542 | IPC::ResponseBuilder rb{ctx, 4}; |
| 541 | rb.Push(RESULT_SUCCESS); | 543 | rb.Push(RESULT_SUCCESS); |
| 542 | rb.Push<u64>(SystemLanguage::English); | 544 | rb.Push(static_cast<u64>(Service::Set::LanguageCode::EN_US)); |
| 543 | NGLOG_WARNING(Service_AM, "(STUBBED) called"); | 545 | NGLOG_DEBUG(Service_AM, "called"); |
| 544 | } | 546 | } |
| 545 | 547 | ||
| 546 | void IApplicationFunctions::InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) { | 548 | void IApplicationFunctions::InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index ece29aa70..f0572bed6 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp | |||
| @@ -14,15 +14,33 @@ namespace Service::Set { | |||
| 14 | void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { | 14 | void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { |
| 15 | IPC::RequestParser rp{ctx}; | 15 | IPC::RequestParser rp{ctx}; |
| 16 | u32 id = rp.Pop<u32>(); | 16 | u32 id = rp.Pop<u32>(); |
| 17 | constexpr std::array<u8, 13> lang_codes{}; | ||
| 18 | |||
| 19 | ctx.WriteBuffer(lang_codes.data(), lang_codes.size()); | ||
| 20 | |||
| 21 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 22 | 17 | ||
| 18 | static constexpr std::array<LanguageCode, 17> available_language_codes = {{ | ||
| 19 | LanguageCode::JA, | ||
| 20 | LanguageCode::EN_US, | ||
| 21 | LanguageCode::FR, | ||
| 22 | LanguageCode::DE, | ||
| 23 | LanguageCode::IT, | ||
| 24 | LanguageCode::ES, | ||
| 25 | LanguageCode::ZH_CN, | ||
| 26 | LanguageCode::KO, | ||
| 27 | LanguageCode::NL, | ||
| 28 | LanguageCode::PT, | ||
| 29 | LanguageCode::RU, | ||
| 30 | LanguageCode::ZH_TW, | ||
| 31 | LanguageCode::EN_GB, | ||
| 32 | LanguageCode::FR_CA, | ||
| 33 | LanguageCode::ES_419, | ||
| 34 | LanguageCode::ZH_HANS, | ||
| 35 | LanguageCode::ZH_HANT, | ||
| 36 | }}; | ||
| 37 | ctx.WriteBuffer(available_language_codes.data(), available_language_codes.size()); | ||
| 38 | |||
| 39 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 23 | rb.Push(RESULT_SUCCESS); | 40 | rb.Push(RESULT_SUCCESS); |
| 41 | rb.Push(static_cast<u64>(available_language_codes.size())); | ||
| 24 | 42 | ||
| 25 | NGLOG_WARNING(Service_SET, "(STUBBED) called"); | 43 | NGLOG_DEBUG(Service_SET, "called"); |
| 26 | } | 44 | } |
| 27 | 45 | ||
| 28 | SET::SET() : ServiceFramework("set") { | 46 | SET::SET() : ServiceFramework("set") { |
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h index 6a465949f..ec0df0152 100644 --- a/src/core/hle/service/set/set.h +++ b/src/core/hle/service/set/set.h | |||
| @@ -8,6 +8,27 @@ | |||
| 8 | 8 | ||
| 9 | namespace Service::Set { | 9 | namespace Service::Set { |
| 10 | 10 | ||
| 11 | /// This is "nn::settings::LanguageCode", which is a NUL-terminated string stored in a u64. | ||
| 12 | enum class LanguageCode : u64 { | ||
| 13 | JA = 0x000000000000616A, | ||
| 14 | EN_US = 0x00000053552D6E65, | ||
| 15 | FR = 0x0000000000007266, | ||
| 16 | DE = 0x0000000000006564, | ||
| 17 | IT = 0x0000000000007469, | ||
| 18 | ES = 0x0000000000007365, | ||
| 19 | ZH_CN = 0x0000004E432D687A, | ||
| 20 | KO = 0x0000000000006F6B, | ||
| 21 | NL = 0x0000000000006C6E, | ||
| 22 | PT = 0x0000000000007470, | ||
| 23 | RU = 0x0000000000007572, | ||
| 24 | ZH_TW = 0x00000057542D687A, | ||
| 25 | EN_GB = 0x00000042472D6E65, | ||
| 26 | FR_CA = 0x00000041432D7266, | ||
| 27 | ES_419 = 0x00003931342D7365, | ||
| 28 | ZH_HANS = 0x00736E61482D687A, | ||
| 29 | ZH_HANT = 0x00746E61482D687A, | ||
| 30 | }; | ||
| 31 | |||
| 11 | class SET final : public ServiceFramework<SET> { | 32 | class SET final : public ServiceFramework<SET> { |
| 12 | public: | 33 | public: |
| 13 | explicit SET(); | 34 | explicit SET(); |
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index 9019f2504..6b9382f06 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp | |||
| @@ -59,12 +59,12 @@ void Fermi2D::HandleSurfaceCopy() { | |||
| 59 | // If the input is tiled and the output is linear, deswizzle the input and copy it over. | 59 | // If the input is tiled and the output is linear, deswizzle the input and copy it over. |
| 60 | Texture::CopySwizzledData(regs.src.width, regs.src.height, src_bytes_per_pixel, | 60 | Texture::CopySwizzledData(regs.src.width, regs.src.height, src_bytes_per_pixel, |
| 61 | dst_bytes_per_pixel, src_buffer, dst_buffer, true, | 61 | dst_bytes_per_pixel, src_buffer, dst_buffer, true, |
| 62 | regs.src.block_height); | 62 | regs.src.BlockHeight()); |
| 63 | } else { | 63 | } else { |
| 64 | // If the input is linear and the output is tiled, swizzle the input and copy it over. | 64 | // If the input is linear and the output is tiled, swizzle the input and copy it over. |
| 65 | Texture::CopySwizzledData(regs.src.width, regs.src.height, src_bytes_per_pixel, | 65 | Texture::CopySwizzledData(regs.src.width, regs.src.height, src_bytes_per_pixel, |
| 66 | dst_bytes_per_pixel, dst_buffer, src_buffer, false, | 66 | dst_bytes_per_pixel, dst_buffer, src_buffer, false, |
| 67 | regs.dst.block_height); | 67 | regs.dst.BlockHeight()); |
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | 70 | ||
diff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.h index 0c5b413cc..70667cb94 100644 --- a/src/video_core/engines/fermi_2d.h +++ b/src/video_core/engines/fermi_2d.h | |||
| @@ -49,6 +49,11 @@ public: | |||
| 49 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | | 49 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | |
| 50 | address_low); | 50 | address_low); |
| 51 | } | 51 | } |
| 52 | |||
| 53 | u32 BlockHeight() const { | ||
| 54 | // The block height is stored in log2 format. | ||
| 55 | return 1 << block_height; | ||
| 56 | } | ||
| 52 | }; | 57 | }; |
| 53 | static_assert(sizeof(Surface) == 0x28, "Surface has incorrect size"); | 58 | static_assert(sizeof(Surface) == 0x28, "Surface has incorrect size"); |
| 54 | 59 | ||