diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/cam/cam.h | 156 | ||||
-rw-r--r-- | src/core/hle/service/gsp_gpu.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/service/y2r_u.cpp | 2 |
3 files changed, 161 insertions, 5 deletions
diff --git a/src/core/hle/service/cam/cam.h b/src/core/hle/service/cam/cam.h index edd524841..e9abdcb1f 100644 --- a/src/core/hle/service/cam/cam.h +++ b/src/core/hle/service/cam/cam.h @@ -10,6 +10,162 @@ namespace Service { namespace CAM { +enum class Port : u8 { + None = 0, + Cam1 = 1, + Cam2 = 2, + Both = Cam1 | Cam2 +}; + +enum class CameraSelect : u8 { + None = 0, + Out1 = 1, + In1 = 2, + Out2 = 4, + In1Out1 = Out1 | In1, + Out1Out2 = Out1 | Out2, + In1Out2 = In1 | Out2, + All = Out1 | In1 | Out2 +}; + +enum class Effect : u8 { + None = 0, + Mono = 1, + Sepia = 2, + Negative = 3, + Negafilm = 4, + Sepia01 = 5 +}; + +enum class Context : u8 { + None = 0, + A = 1, + B = 2, + Both = A | B +}; + +enum class Flip : u8 { + None = 0, + Horizontal = 1, + Vertical = 2, + Reverse = 3 +}; + +enum class Size : u8 { + VGA = 0, + QVGA = 1, + QQVGA = 2, + CIF = 3, + QCIF = 4, + DS_LCD = 5, + DS_LCDx4 = 6, + CTR_TOP_LCD = 7, + CTR_BOTTOM_LCD = QVGA +}; + +enum class FrameRate : u8 { + Rate_15 = 0, + Rate_15_To_5 = 1, + Rate_15_To_2 = 2, + Rate_10 = 3, + Rate_8_5 = 4, + Rate_5 = 5, + Rate_20 = 6, + Rate_20_To_5 = 7, + Rate_30 = 8, + Rate_30_To_5 = 9, + Rate_15_To_10 = 10, + Rate_20_To_10 = 11, + Rate_30_To_10 = 12 +}; + +enum class ShutterSoundType : u8 { + Normal = 0, + Movie = 1, + MovieEnd = 2 +}; + +enum class WhiteBalance : u8 { + BalanceAuto = 0, + Balance3200K = 1, + Balance4150K = 2, + Balance5200K = 3, + Balance6000K = 4, + Balance7000K = 5, + BalanceMax = 6, + BalanceNormal = BalanceAuto, + BalanceTungsten = Balance3200K, + BalanceWhiteFluorescentLight = Balance4150K, + BalanceDaylight = Balance5200K, + BalanceCloudy = Balance6000K, + BalanceHorizon = Balance6000K, + BalanceShade = Balance7000K +}; + +enum class PhotoMode : u8 { + Normal = 0, + Portrait = 1, + Landscape = 2, + Nightview = 3, + Letter0 = 4 +}; + +enum class LensCorrection : u8 { + Off = 0, + On70 = 1, + On90 = 2, + Dark = Off, + Normal = On70, + Bright = On90 +}; + +enum class Contrast : u8 { + Pattern01 = 1, + Pattern02 = 2, + Pattern03 = 3, + Pattern04 = 4, + Pattern05 = 5, + Pattern06 = 6, + Pattern07 = 7, + Pattern08 = 8, + Pattern09 = 9, + Pattern10 = 10, + Pattern11 = 11, + Low = Pattern05, + Normal = Pattern06, + High = Pattern07 +}; + +enum class OutputFormat : u8 { + YUV422 = 0, + RGB565 = 1 +}; + +struct PackageParameterCameraSelect { + CameraSelect camera; + s8 exposure; + WhiteBalance white_balance; + s8 sharpness; + bool auto_exposure; + bool auto_white_balance; + FrameRate frame_rate; + PhotoMode photo_mode; + Contrast contrast; + LensCorrection lens_correction; + bool noise_filter; + u8 padding; + s16 auto_exposure_window_x; + s16 auto_exposure_window_y; + s16 auto_exposure_window_width; + s16 auto_exposure_window_height; + s16 auto_white_balance_window_x; + s16 auto_white_balance_window_y; + s16 auto_white_balance_window_width; + s16 auto_white_balance_window_height; +}; + +static_assert(sizeof(PackageParameterCameraSelect) == 28, "PackageParameterCameraSelect structure size is wrong"); + /// Initialize CAM service(s) void Init(); diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index 481da0c9f..98b11c798 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp @@ -275,7 +275,7 @@ static void FlushDataCache(Service::Interface* self) { u32 size = cmd_buff[2]; u32 process = cmd_buff[4]; - VideoCore::g_renderer->hw_rasterizer->NotifyFlush(Memory::VirtualToPhysicalAddress(address), size); + VideoCore::g_renderer->rasterizer->InvalidateRegion(Memory::VirtualToPhysicalAddress(address), size); // TODO(purpasmart96): Verify return header on HW @@ -365,7 +365,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { // GX request DMA - typically used for copying memory from GSP heap to VRAM case CommandId::REQUEST_DMA: - VideoCore::g_renderer->hw_rasterizer->NotifyPreRead(Memory::VirtualToPhysicalAddress(command.dma_request.source_address), + VideoCore::g_renderer->rasterizer->FlushRegion(Memory::VirtualToPhysicalAddress(command.dma_request.source_address), command.dma_request.size); memcpy(Memory::GetPointer(command.dma_request.dest_address), @@ -373,7 +373,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { command.dma_request.size); SignalInterrupt(InterruptId::DMA); - VideoCore::g_renderer->hw_rasterizer->NotifyFlush(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address), + VideoCore::g_renderer->rasterizer->InvalidateRegion(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address), command.dma_request.size); break; @@ -467,7 +467,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { if (region.size == 0) break; - VideoCore::g_renderer->hw_rasterizer->NotifyFlush( + VideoCore::g_renderer->rasterizer->InvalidateRegion( Memory::VirtualToPhysicalAddress(region.address), region.size); } break; diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index 6b1b71fe4..0429927f2 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -267,7 +267,7 @@ static void StartConversion(Service::Interface* self) { // dst_image_size would seem to be perfect for this, but it doesn't include the gap :( u32 total_output_size = conversion.input_lines * (conversion.dst.transfer_unit + conversion.dst.gap); - VideoCore::g_renderer->hw_rasterizer->NotifyFlush( + VideoCore::g_renderer->rasterizer->InvalidateRegion( Memory::VirtualToPhysicalAddress(conversion.dst.address), total_output_size); LOG_DEBUG(Service_Y2R, "called"); |