mirror of
https://github.com/InoriRus/Kyty.git
synced 2026-08-28 05:06:40 +00:00
one step closer to run games
This commit is contained in:
@@ -23,12 +23,25 @@ int KYTY_SYSV_ABI AudioOutOutputs(AudioOutOutputParam* param, uint32_t num);
|
||||
|
||||
} // namespace AudioOut
|
||||
|
||||
namespace AudioIn {
|
||||
|
||||
int KYTY_SYSV_ABI AudioInOpen(int user_id, uint32_t type, uint32_t index, uint32_t len, uint32_t freq, uint32_t param);
|
||||
int KYTY_SYSV_ABI AudioInInput(int handle, void* dest);
|
||||
|
||||
} // namespace AudioIn
|
||||
|
||||
namespace VoiceQoS {
|
||||
|
||||
int KYTY_SYSV_ABI VoiceQoSInit(void* mem_block, uint32_t mem_size, int32_t app_type);
|
||||
|
||||
} // namespace VoiceQoS
|
||||
|
||||
namespace Ajm {
|
||||
|
||||
int KYTY_SYSV_ABI AjmInitialize(int64_t reserved, uint32_t* context);
|
||||
|
||||
} // namespace Ajm
|
||||
|
||||
} // namespace Kyty::Libs::Audio
|
||||
|
||||
#endif // KYTY_EMU_ENABLED
|
||||
|
||||
@@ -43,6 +43,7 @@ enum class Axis
|
||||
|
||||
struct PadControllerInformation;
|
||||
struct PadData;
|
||||
struct PadVibrationParam;
|
||||
|
||||
inline int controller_get_axis(int min, int max, int value)
|
||||
{
|
||||
@@ -60,6 +61,8 @@ int KYTY_SYSV_ABI PadOpen(int user_id, int type, int index, const void* param);
|
||||
int KYTY_SYSV_ABI PadSetMotionSensorState(int handle, bool enable);
|
||||
int KYTY_SYSV_ABI PadGetControllerInformation(int handle, PadControllerInformation* info);
|
||||
int KYTY_SYSV_ABI PadReadState(int handle, PadData* data);
|
||||
int KYTY_SYSV_ABI PadRead(int handle, PadData* data, int num);
|
||||
int KYTY_SYSV_ABI PadSetVibration(int handle, const PadVibrationParam* param);
|
||||
|
||||
} // namespace Kyty::Libs::Controller
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef EMULATOR_INCLUDE_EMULATOR_DIALOG_H_
|
||||
#define EMULATOR_INCLUDE_EMULATOR_DIALOG_H_
|
||||
|
||||
#include "Kyty/Core/Common.h"
|
||||
|
||||
#include "Emulator/Common.h"
|
||||
|
||||
#ifdef KYTY_EMU_ENABLED
|
||||
@@ -13,6 +15,14 @@ int KYTY_SYSV_ABI CommonDialogInitialize();
|
||||
|
||||
} // namespace CommonDialog
|
||||
|
||||
namespace SaveDataDialog {
|
||||
|
||||
int KYTY_SYSV_ABI SaveDataDialogUpdateStatus();
|
||||
int KYTY_SYSV_ABI SaveDataDialogTerminate();
|
||||
int KYTY_SYSV_ABI SaveDataDialogProgressBarSetValue(int target, uint32_t rate);
|
||||
|
||||
} // namespace SaveDataDialog
|
||||
|
||||
} // namespace Kyty::Libs::Dialog
|
||||
|
||||
#endif // KYTY_EMU_ENABLED
|
||||
|
||||
@@ -24,6 +24,7 @@ int KYTY_SYSV_ABI GraphicsUpdateVsShader(uint32_t* cmd, uint64_t size, cons
|
||||
int KYTY_SYSV_ABI GraphicsSetPsShader(uint32_t* cmd, uint64_t size, const uint32_t* ps_regs);
|
||||
int KYTY_SYSV_ABI GraphicsSetPsShader350(uint32_t* cmd, uint64_t size, const uint32_t* ps_regs);
|
||||
int KYTY_SYSV_ABI GraphicsUpdatePsShader(uint32_t* cmd, uint64_t size, const uint32_t* ps_regs);
|
||||
int KYTY_SYSV_ABI GraphicsUpdatePsShader350(uint32_t* cmd, uint64_t size, const uint32_t* ps_regs);
|
||||
int KYTY_SYSV_ABI GraphicsSetCsShaderWithModifier(uint32_t* cmd, uint64_t size, const uint32_t* cs_regs, uint32_t shader_modifier);
|
||||
int KYTY_SYSV_ABI GraphicsSetEmbeddedVsShader(uint32_t* cmd, uint64_t size, uint32_t id, uint32_t shader_modifier);
|
||||
int KYTY_SYSV_ABI GraphicsDrawIndex(uint32_t* cmd, uint64_t size, uint32_t index_count, const void* index_addr, uint32_t flags,
|
||||
|
||||
@@ -69,24 +69,29 @@ private:
|
||||
void GraphicsRenderInit();
|
||||
void GraphicsRenderCreateContext();
|
||||
|
||||
void GraphicsRenderDrawIndex(CommandBuffer* buffer, HW::HardwareContext* ctx, HW::UserConfig* ucfg, uint32_t index_type_and_size,
|
||||
uint32_t index_count, const void* index_addr, uint32_t flags, uint32_t type);
|
||||
void GraphicsRenderDrawIndexAuto(CommandBuffer* buffer, HW::HardwareContext* ctx, HW::UserConfig* ucfg, uint32_t index_count,
|
||||
uint32_t flags);
|
||||
void GraphicsRenderWriteAtEndOfPipe(CommandBuffer* buffer, uint64_t* dst_gpu_addr, uint64_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeClockCounter(CommandBuffer* buffer, uint64_t* dst_gpu_addr);
|
||||
void GraphicsRenderWriteAtEndOfPipe(CommandBuffer* buffer, uint32_t* dst_gpu_addr, uint32_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeGds(CommandBuffer* buffer, uint32_t* dst_gpu_addr, uint32_t dw_offset, uint32_t dw_num);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithInterruptWriteBackFlip(CommandBuffer* buffer, uint32_t* dst_gpu_addr, uint32_t value, int handle,
|
||||
int index, int flip_mode, int64_t flip_arg);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithFlip(CommandBuffer* buffer, uint32_t* dst_gpu_addr, uint32_t value, int handle, int index,
|
||||
int flip_mode, int64_t flip_arg);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithWriteBack(CommandBuffer* buffer, uint64_t* dst_gpu_addr, uint64_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithInterruptWriteBack(CommandBuffer* buffer, uint64_t* dst_gpu_addr, uint64_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithInterrupt(CommandBuffer* buffer, uint64_t* dst_gpu_addr, uint64_t value);
|
||||
void GraphicsRenderDrawIndex(uint64_t submit_id, CommandBuffer* buffer, HW::HardwareContext* ctx, HW::UserConfig* ucfg,
|
||||
uint32_t index_type_and_size, uint32_t index_count, const void* index_addr, uint32_t flags, uint32_t type);
|
||||
void GraphicsRenderDrawIndexAuto(uint64_t submit_id, CommandBuffer* buffer, HW::HardwareContext* ctx, HW::UserConfig* ucfg,
|
||||
uint32_t index_count, uint32_t flags);
|
||||
void GraphicsRenderWriteAtEndOfPipe64(uint64_t submit_id, CommandBuffer* buffer, uint64_t* dst_gpu_addr, uint64_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeClockCounter(uint64_t submit_id, CommandBuffer* buffer, uint64_t* dst_gpu_addr);
|
||||
void GraphicsRenderWriteAtEndOfPipe32(uint64_t submit_id, CommandBuffer* buffer, uint32_t* dst_gpu_addr, uint32_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeGds32(uint64_t submit_id, CommandBuffer* buffer, uint32_t* dst_gpu_addr, uint32_t dw_offset,
|
||||
uint32_t dw_num);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithInterruptWriteBackFlip32(uint64_t submit_id, CommandBuffer* buffer, uint32_t* dst_gpu_addr,
|
||||
uint32_t value, int handle, int index, int flip_mode, int64_t flip_arg);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithFlip32(uint64_t submit_id, CommandBuffer* buffer, uint32_t* dst_gpu_addr, uint32_t value, int handle,
|
||||
int index, int flip_mode, int64_t flip_arg);
|
||||
void GraphicsRenderWriteAtEndOfPipeOnlyFlip(uint64_t submit_id, CommandBuffer* buffer, int handle, int index, int flip_mode,
|
||||
int64_t flip_arg);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithWriteBack64(uint64_t submit_id, CommandBuffer* buffer, uint64_t* dst_gpu_addr, uint64_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithInterruptWriteBack64(uint64_t submit_id, CommandBuffer* buffer, uint64_t* dst_gpu_addr,
|
||||
uint64_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithInterrupt64(uint64_t submit_id, CommandBuffer* buffer, uint64_t* dst_gpu_addr, uint64_t value);
|
||||
void GraphicsRenderWriteAtEndOfPipeWithInterrupt32(uint64_t submit_id, CommandBuffer* buffer, uint32_t* dst_gpu_addr, uint32_t value);
|
||||
void GraphicsRenderWriteBack();
|
||||
void GraphicsRenderDispatchDirect(CommandBuffer* buffer, HW::HardwareContext* ctx, uint32_t thread_group_x, uint32_t thread_group_y,
|
||||
uint32_t thread_group_z, uint32_t mode);
|
||||
void GraphicsRenderDispatchDirect(uint64_t submit_id, CommandBuffer* buffer, HW::HardwareContext* ctx, uint32_t thread_group_x,
|
||||
uint32_t thread_group_y, uint32_t thread_group_z, uint32_t mode);
|
||||
void GraphicsRenderMemoryBarrier(CommandBuffer* buffer);
|
||||
void GraphicsRenderRenderTextureBarrier(CommandBuffer* buffer, uint64_t vaddr, uint64_t size);
|
||||
void GraphicsRenderDepthStencilBarrier(CommandBuffer* buffer, uint64_t vaddr, uint64_t size);
|
||||
|
||||
@@ -305,16 +305,42 @@ struct ColorControl
|
||||
uint8_t op = 0xCC;
|
||||
};
|
||||
|
||||
struct ScanModeControl
|
||||
{
|
||||
bool msaa_enable = false;
|
||||
bool vport_scissor_enable = false;
|
||||
bool line_stipple_enable = false;
|
||||
};
|
||||
|
||||
struct AaSampleControl
|
||||
{
|
||||
uint64_t centroid_priority = 0;
|
||||
uint32_t locations[16] = {};
|
||||
};
|
||||
|
||||
struct AaConfig
|
||||
{
|
||||
uint8_t msaa_num_samples = 0;
|
||||
bool aa_mask_centroid_dtmn = false;
|
||||
uint8_t max_sample_dist = 0;
|
||||
uint8_t msaa_exposed_samples = 0;
|
||||
};
|
||||
|
||||
struct Viewport
|
||||
{
|
||||
float zmin = 0.0f;
|
||||
float zmax = 0.0f;
|
||||
float xscale = 0.0f;
|
||||
float xoffset = 0.0f;
|
||||
float yscale = 0.0f;
|
||||
float yoffset = 0.0f;
|
||||
float zscale = 0.0f;
|
||||
float zoffset = 0.0f;
|
||||
float zmin = 0.0f;
|
||||
float zmax = 0.0f;
|
||||
float xscale = 0.0f;
|
||||
float xoffset = 0.0f;
|
||||
float yscale = 0.0f;
|
||||
float yoffset = 0.0f;
|
||||
float zscale = 0.0f;
|
||||
float zoffset = 0.0f;
|
||||
int viewport_scissor_left = 0;
|
||||
int viewport_scissor_top = 0;
|
||||
int viewport_scissor_right = 0;
|
||||
int viewport_scissor_bottom = 0;
|
||||
bool viewport_scissor_window_offset_enable = false;
|
||||
};
|
||||
|
||||
struct ScreenViewport
|
||||
@@ -578,24 +604,30 @@ public:
|
||||
m_cs.cs_shader_modifier = shader_modifier;
|
||||
}
|
||||
|
||||
[[nodiscard]] const BlendColor& GetBlendColor() const { return m_blend_color; }
|
||||
void SetBlendColor(const BlendColor& color) { m_blend_color = color; }
|
||||
[[nodiscard]] const ClipControl& GetClipControl() const { return m_clip_control; }
|
||||
void SetClipControl(const ClipControl& control) { m_clip_control = control; }
|
||||
[[nodiscard]] const RenderControl& GetRenderControl() const { return m_render_control; }
|
||||
void SetRenderControl(const RenderControl& control) { m_render_control = control; }
|
||||
[[nodiscard]] const DepthControl& GetDepthControl() const { return m_depth_control; }
|
||||
void SetDepthControl(const DepthControl& control) { m_depth_control = control; }
|
||||
[[nodiscard]] const ModeControl& GetModeControl() const { return m_mode_control; }
|
||||
void SetModeControl(const ModeControl& control) { m_mode_control = control; }
|
||||
[[nodiscard]] const EqaaControl& GetEqaaControl() const { return m_eqaa_control; }
|
||||
void SetEqaaControl(const EqaaControl& control) { m_eqaa_control = control; }
|
||||
[[nodiscard]] const StencilControl& GetStencilControl() const { return m_stencil_control; }
|
||||
void SetStencilControl(const StencilControl& control) { m_stencil_control = control; }
|
||||
[[nodiscard]] const StencilMask& GetStencilMask() const { return m_stencil_mask; }
|
||||
void SetStencilMask(const StencilMask& mask) { m_stencil_mask = mask; }
|
||||
[[nodiscard]] const ColorControl& GetColorControl() const { return m_color_control; }
|
||||
void SetColorControl(const ColorControl& control) { m_color_control = control; }
|
||||
[[nodiscard]] const BlendColor& GetBlendColor() const { return m_blend_color; }
|
||||
void SetBlendColor(const BlendColor& color) { m_blend_color = color; }
|
||||
[[nodiscard]] const ClipControl& GetClipControl() const { return m_clip_control; }
|
||||
void SetClipControl(const ClipControl& control) { m_clip_control = control; }
|
||||
[[nodiscard]] const RenderControl& GetRenderControl() const { return m_render_control; }
|
||||
void SetRenderControl(const RenderControl& control) { m_render_control = control; }
|
||||
[[nodiscard]] const DepthControl& GetDepthControl() const { return m_depth_control; }
|
||||
void SetDepthControl(const DepthControl& control) { m_depth_control = control; }
|
||||
[[nodiscard]] const ModeControl& GetModeControl() const { return m_mode_control; }
|
||||
void SetModeControl(const ModeControl& control) { m_mode_control = control; }
|
||||
[[nodiscard]] const EqaaControl& GetEqaaControl() const { return m_eqaa_control; }
|
||||
void SetEqaaControl(const EqaaControl& control) { m_eqaa_control = control; }
|
||||
[[nodiscard]] const StencilControl& GetStencilControl() const { return m_stencil_control; }
|
||||
void SetStencilControl(const StencilControl& control) { m_stencil_control = control; }
|
||||
[[nodiscard]] const StencilMask& GetStencilMask() const { return m_stencil_mask; }
|
||||
void SetStencilMask(const StencilMask& mask) { m_stencil_mask = mask; }
|
||||
[[nodiscard]] const ColorControl& GetColorControl() const { return m_color_control; }
|
||||
void SetColorControl(const ColorControl& control) { m_color_control = control; }
|
||||
[[nodiscard]] const ScanModeControl& GetScanModeControl() const { return m_scan_mode_control; }
|
||||
void SetScanModeControl(const ScanModeControl& control) { m_scan_mode_control = control; }
|
||||
[[nodiscard]] const AaSampleControl& GetAaSampleControl() const { return m_aa_sample_control; }
|
||||
void SetAaSampleControl(const AaSampleControl& control) { m_aa_sample_control = control; }
|
||||
[[nodiscard]] const AaConfig& GetAaConfig() const { return m_aa_config; }
|
||||
void SetAaConfig(const AaConfig& config) { m_aa_config = config; }
|
||||
|
||||
void SetVsUserSgpr(uint32_t id, uint32_t value, UserSgprType type)
|
||||
{
|
||||
@@ -636,13 +668,17 @@ public:
|
||||
private:
|
||||
float m_line_width = 1.0f;
|
||||
|
||||
BlendControl m_blend_control[8];
|
||||
BlendColor m_blend_color;
|
||||
RenderTarget m_render_targets[8];
|
||||
uint32_t m_render_target_mask = 0;
|
||||
ScreenViewport m_screen_viewport;
|
||||
ClipControl m_clip_control;
|
||||
ColorControl m_color_control;
|
||||
BlendControl m_blend_control[8];
|
||||
BlendColor m_blend_color;
|
||||
RenderTarget m_render_targets[8];
|
||||
uint32_t m_render_target_mask = 0;
|
||||
ScreenViewport m_screen_viewport;
|
||||
ClipControl m_clip_control;
|
||||
ColorControl m_color_control;
|
||||
ScanModeControl m_scan_mode_control;
|
||||
|
||||
AaSampleControl m_aa_sample_control;
|
||||
AaConfig m_aa_config;
|
||||
|
||||
VertexShaderInfo m_vs;
|
||||
PixelShaderInfo m_ps;
|
||||
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
}
|
||||
|
||||
bool Equal(const uint64_t* other) const override;
|
||||
// bool Reuse(const uint64_t* other) const override;
|
||||
|
||||
[[nodiscard]] create_func_t GetCreateFunc() const override;
|
||||
[[nodiscard]] create_from_objects_func_t GetCreateFromObjectsFunc() const override { return nullptr; };
|
||||
|
||||
@@ -73,6 +73,7 @@ public:
|
||||
KYTY_CLASS_DEFAULT_COPY(GpuObject);
|
||||
|
||||
virtual bool Equal(const uint64_t* other) const = 0;
|
||||
// virtual bool Reuse(const uint64_t* /*other*/) const { return false; };
|
||||
|
||||
[[nodiscard]] virtual create_func_t GetCreateFunc() const = 0;
|
||||
[[nodiscard]] virtual create_from_objects_func_t GetCreateFromObjectsFunc() const = 0;
|
||||
@@ -90,9 +91,10 @@ void GpuMemoryInit();
|
||||
|
||||
void GpuMemorySetAllocatedRange(uint64_t vaddr, uint64_t size);
|
||||
void GpuMemoryFree(GraphicContext* ctx, uint64_t vaddr, uint64_t size, bool unmap);
|
||||
void* GpuMemoryCreateObject(GraphicContext* ctx, CommandBuffer* buffer, uint64_t vaddr, uint64_t size, const GpuObject& info);
|
||||
void* GpuMemoryCreateObject(GraphicContext* ctx, CommandBuffer* buffer, const uint64_t* vaddr, const uint64_t* size, int vaddr_num,
|
||||
void* GpuMemoryCreateObject(uint64_t submit_id, GraphicContext* ctx, CommandBuffer* buffer, uint64_t vaddr, uint64_t size,
|
||||
const GpuObject& info);
|
||||
void* GpuMemoryCreateObject(uint64_t submit_id, GraphicContext* ctx, CommandBuffer* buffer, const uint64_t* vaddr, const uint64_t* size,
|
||||
int vaddr_num, const GpuObject& info);
|
||||
void GpuMemoryResetHash(GraphicContext* ctx, const uint64_t* vaddr, const uint64_t* size, int vaddr_num, GpuMemoryObjectType type);
|
||||
void GpuMemoryDbgDump();
|
||||
void GpuMemoryFlush(GraphicContext* ctx);
|
||||
@@ -101,7 +103,7 @@ void GpuMemoryWriteBack(GraphicContext* ctx);
|
||||
bool GpuMemoryCheckAccessViolation(uint64_t vaddr, uint64_t size);
|
||||
bool GpuMemoryWatcherEnabled();
|
||||
|
||||
Vector<GpuMemoryObject> GpuMemoryFindObjects(uint64_t vaddr, uint64_t size, bool exact, bool only_first);
|
||||
Vector<GpuMemoryObject> GpuMemoryFindObjects(uint64_t vaddr, uint64_t size, GpuMemoryObjectType type, bool exact, bool only_first);
|
||||
|
||||
bool VulkanAllocate(GraphicContext* ctx, VulkanMemory* mem);
|
||||
void VulkanFree(GraphicContext* ctx, VulkanMemory* mem);
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Kyty::Libs::Graphics {
|
||||
|
||||
struct Label;
|
||||
class CommandBuffer;
|
||||
struct GraphicContext;
|
||||
|
||||
void LabelInit();
|
||||
|
||||
@@ -53,7 +54,12 @@ public:
|
||||
[[nodiscard]] update_func_t GetUpdateFunc() const override;
|
||||
};
|
||||
|
||||
void LabelSet(CommandBuffer* buffer, Label* label);
|
||||
Label* LabelCreate64(GraphicContext* ctx, uint64_t* dst_gpu_addr, uint64_t value, LabelGpuObject::callback_t callback_1,
|
||||
LabelGpuObject::callback_t callback_2, const uint64_t* args);
|
||||
Label* LabelCreate32(GraphicContext* ctx, uint32_t* dst_gpu_addr, uint32_t value, LabelGpuObject::callback_t callback_1,
|
||||
LabelGpuObject::callback_t callback_2, const uint64_t* args);
|
||||
void LabelDelete(Label* label);
|
||||
void LabelSet(CommandBuffer* buffer, Label* label);
|
||||
|
||||
} // namespace Kyty::Libs::Graphics
|
||||
|
||||
|
||||
@@ -337,6 +337,14 @@ constexpr uint32_t PA_SU_LINE_CNTL = 0x282;
|
||||
constexpr uint32_t PA_SU_LINE_CNTL_WIDTH_SHIFT = 0;
|
||||
constexpr uint32_t PA_SU_LINE_CNTL_WIDTH_MASK = 0xFFFF;
|
||||
|
||||
constexpr uint32_t PA_SC_MODE_CNTL_0 = 0x292;
|
||||
constexpr uint32_t PA_SC_MODE_CNTL_0_MSAA_ENABLE_SHIFT = 0;
|
||||
constexpr uint32_t PA_SC_MODE_CNTL_0_MSAA_ENABLE_MASK = 0x1;
|
||||
constexpr uint32_t PA_SC_MODE_CNTL_0_VPORT_SCISSOR_ENABLE_SHIFT = 1;
|
||||
constexpr uint32_t PA_SC_MODE_CNTL_0_VPORT_SCISSOR_ENABLE_MASK = 0x1;
|
||||
constexpr uint32_t PA_SC_MODE_CNTL_0_LINE_STIPPLE_ENABLE_SHIFT = 2;
|
||||
constexpr uint32_t PA_SC_MODE_CNTL_0_LINE_STIPPLE_ENABLE_MASK = 0x1;
|
||||
|
||||
constexpr uint32_t DB_HTILE_SURFACE = 0x2AF;
|
||||
constexpr uint32_t DB_HTILE_SURFACE_LINEAR_SHIFT = 0;
|
||||
constexpr uint32_t DB_HTILE_SURFACE_LINEAR_MASK = 0x1;
|
||||
@@ -355,6 +363,20 @@ constexpr uint32_t DB_HTILE_SURFACE_DST_OUTSIDE_ZERO_TO_ONE_MASK = 0x1;
|
||||
|
||||
constexpr uint32_t VGT_SHADER_STAGES_EN = 0x2D5;
|
||||
|
||||
constexpr uint32_t PA_SC_CENTROID_PRIORITY_0 = 0x2F5;
|
||||
|
||||
constexpr uint32_t PA_SC_AA_CONFIG = 0x2F8;
|
||||
constexpr uint32_t PA_SC_AA_CONFIG_MSAA_NUM_SAMPLES_SHIFT = 0;
|
||||
constexpr uint32_t PA_SC_AA_CONFIG_MSAA_NUM_SAMPLES_MASK = 0x7;
|
||||
constexpr uint32_t PA_SC_AA_CONFIG_AA_MASK_CENTROID_DTMN_SHIFT = 4;
|
||||
constexpr uint32_t PA_SC_AA_CONFIG_AA_MASK_CENTROID_DTMN_MASK = 0x1;
|
||||
constexpr uint32_t PA_SC_AA_CONFIG_MAX_SAMPLE_DIST_SHIFT = 13;
|
||||
constexpr uint32_t PA_SC_AA_CONFIG_MAX_SAMPLE_DIST_MASK = 0xF;
|
||||
constexpr uint32_t PA_SC_AA_CONFIG_MSAA_EXPOSED_SAMPLES_SHIFT = 20;
|
||||
constexpr uint32_t PA_SC_AA_CONFIG_MSAA_EXPOSED_SAMPLES_MASK = 0x7;
|
||||
|
||||
constexpr uint32_t PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 = 0x2FE;
|
||||
|
||||
constexpr uint32_t CB_COLOR0_BASE = 0x318;
|
||||
constexpr uint32_t CB_COLOR0_INFO = 0x31C;
|
||||
|
||||
|
||||
@@ -352,10 +352,21 @@ struct ShaderInstruction
|
||||
ShaderOperand dst2;
|
||||
};
|
||||
|
||||
struct ShaderLabel
|
||||
class ShaderLabel
|
||||
{
|
||||
uint32_t dst;
|
||||
uint32_t src;
|
||||
public:
|
||||
explicit ShaderLabel(const ShaderInstruction& inst): m_dst(inst.pc + 4 + inst.src[0].constant.i), m_src(inst.pc) {}
|
||||
~ShaderLabel() = default;
|
||||
KYTY_CLASS_DEFAULT_COPY(ShaderLabel);
|
||||
|
||||
[[nodiscard]] uint32_t GetDst() const { return m_dst; }
|
||||
[[nodiscard]] uint32_t GetSrc() const { return m_src; }
|
||||
|
||||
[[nodiscard]] String ToString() const { return String::FromPrintf("label_%04" PRIx32 "_%04" PRIx32, m_dst, m_src); }
|
||||
|
||||
private:
|
||||
uint32_t m_dst;
|
||||
uint32_t m_src;
|
||||
};
|
||||
|
||||
struct ShaderDebugPrintf
|
||||
@@ -409,6 +420,9 @@ public:
|
||||
[[nodiscard]] uint32_t GetPsEmbeddedId() const { return m_ps_embedded_id; }
|
||||
void SetPsEmbeddedId(uint32_t embedded_id) { m_ps_embedded_id = embedded_id; }
|
||||
|
||||
[[nodiscard]] bool IsDiscardBlock(uint32_t pc) const;
|
||||
[[nodiscard]] bool IsDiscardInstruction(uint32_t index) const;
|
||||
|
||||
private:
|
||||
Vector<ShaderInstruction> m_instructions;
|
||||
Vector<ShaderLabel> m_labels;
|
||||
|
||||
@@ -19,16 +19,22 @@ enum class TileMode
|
||||
// RenderTextureTiled,
|
||||
};
|
||||
|
||||
struct TileSizeAlign
|
||||
{
|
||||
uint32_t size = 0;
|
||||
uint32_t align = 0;
|
||||
};
|
||||
|
||||
void TileInit();
|
||||
void TileConvertTiledToLinear(void* dst, const void* src, TileMode mode, uint32_t width, uint32_t height, bool neo);
|
||||
void TileConvertTiledToLinear(void* dst, const void* src, TileMode mode, uint32_t dfmt, uint32_t nfmt, uint32_t width, uint32_t height,
|
||||
uint32_t levels, bool neo);
|
||||
|
||||
void TileGetDepthSize(uint32_t width, uint32_t height, uint32_t z_format, uint32_t stencil_format, bool htile, bool neo,
|
||||
uint32_t* stencil_size, uint32_t* htile_size, uint32_t* depth_size, uint32_t* pitch);
|
||||
void TileGetVideoOutSize(uint32_t width, uint32_t height, bool tile, bool neo, uint32_t* size, uint32_t* pitch);
|
||||
bool TileGetDepthSize(uint32_t width, uint32_t height, uint32_t pitch, uint32_t z_format, uint32_t stencil_format, bool htile, bool neo,
|
||||
TileSizeAlign* stencil_size, TileSizeAlign* htile_size, TileSizeAlign* depth_size);
|
||||
void TileGetVideoOutSize(uint32_t width, uint32_t height, uint32_t pitch, bool tile, bool neo, TileSizeAlign* size);
|
||||
void TileGetTextureSize(uint32_t dfmt, uint32_t nfmt, uint32_t width, uint32_t height, uint32_t pitch, uint32_t levels, uint32_t tile,
|
||||
bool neo, uint32_t* total_size, uint32_t* level_sizes, uint32_t* padded_width, uint32_t* padded_height);
|
||||
bool neo, TileSizeAlign* total_size, uint32_t* level_sizes, uint32_t* padded_width, uint32_t* padded_height);
|
||||
|
||||
} // namespace Kyty::Libs::Graphics
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ int KYTY_SYSV_ABI KernelStat(const char* path, FileStat* sb);
|
||||
int KYTY_SYSV_ABI KernelFstat(int d, FileStat* sb);
|
||||
int KYTY_SYSV_ABI KernelUnlink(const char* path);
|
||||
int KYTY_SYSV_ABI KernelGetdirentries(int fd, char* buf, int nbytes, int64_t* basep);
|
||||
int KYTY_SYSV_ABI KernelGetdents(int fd, char* buf, int nbytes);
|
||||
int KYTY_SYSV_ABI KernelMkdir(const char* path, uint16_t mode);
|
||||
|
||||
} // namespace Kyty::Libs::LibKernel::FileSystem
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ int KYTY_SYSV_ABI PthreadSetaffinity(Pthread thread, KernelCpumask mask
|
||||
void KYTY_SYSV_ABI PthreadExit(void* value);
|
||||
int KYTY_SYSV_ABI PthreadEqual(Pthread thread1, Pthread thread2);
|
||||
int KYTY_SYSV_ABI PthreadGetname(Pthread thread, char* name);
|
||||
void KYTY_SYSV_ABI PthreadYield();
|
||||
int KYTY_SYSV_ABI KernelUsleep(KernelUseconds microseconds);
|
||||
unsigned int KYTY_SYSV_ABI KernelSleep(unsigned int seconds);
|
||||
int KYTY_SYSV_ABI KernelNanosleep(const KernelTimespec* rqtp, KernelTimespec* rmtp);
|
||||
@@ -160,6 +161,9 @@ uint64_t KYTY_SYSV_ABI KernelGetProcessTimeCounterFrequency();
|
||||
|
||||
namespace Posix {
|
||||
|
||||
int KYTY_SYSV_ABI pthread_create(LibKernel::Pthread* thread, const LibKernel::PthreadAttr* attr, LibKernel::pthread_entry_func_t entry,
|
||||
void* arg);
|
||||
int KYTY_SYSV_ABI pthread_join(LibKernel::Pthread thread, void** value);
|
||||
int KYTY_SYSV_ABI pthread_cond_broadcast(LibKernel::PthreadCond* cond);
|
||||
int KYTY_SYSV_ABI pthread_cond_wait(LibKernel::PthreadCond* cond, LibKernel::PthreadMutex* mutex);
|
||||
int KYTY_SYSV_ABI pthread_mutex_lock(LibKernel::PthreadMutex* mutex);
|
||||
|
||||
@@ -346,6 +346,20 @@ constexpr int AUDIO_OUT_ERROR_INVALID_MIXLEVEL = -2144993260; /* 0x80260014 *
|
||||
constexpr int AUDIO_OUT_ERROR_INVALID_ARG = -2144993259; /* 0x80260015 */
|
||||
constexpr int AUDIO_OUT_ERROR_INVALID_PARAM = -2144993258; /* 0x80260016 */
|
||||
|
||||
constexpr int AUDIO_IN_ERROR_FATAL = -2144993024; /* 0x80260100 */
|
||||
constexpr int AUDIO_IN_ERROR_INVALID_HANDLE = -2144993023; /* 0x80260101 */
|
||||
constexpr int AUDIO_IN_ERROR_INVALID_SIZE = -2144993022; /* 0x80260102 */
|
||||
constexpr int AUDIO_IN_ERROR_INVALID_FREQ = -2144993021; /* 0x80260103 */
|
||||
constexpr int AUDIO_IN_ERROR_INVALID_TYPE = -2144993020; /* 0x80260104 */
|
||||
constexpr int AUDIO_IN_ERROR_INVALID_POINTER = -2144993019; /* 0x80260105 */
|
||||
constexpr int AUDIO_IN_ERROR_INVALID_PARAM = -2144993018; /* 0x80260106 */
|
||||
constexpr int AUDIO_IN_ERROR_PORT_FULL = -2144993017; /* 0x80260107 */
|
||||
constexpr int AUDIO_IN_ERROR_OUT_OF_MEMORY = -2144993016; /* 0x80260108 */
|
||||
constexpr int AUDIO_IN_ERROR_NOT_OPENED = -2144993015; /* 0x80260109 */
|
||||
constexpr int AUDIO_IN_ERROR_BUSY = -2144993014; /* 0x8026010A */
|
||||
constexpr int AUDIO_IN_ERROR_SYSTEM_MEMORY = -2144993013; /* 0x8026010B */
|
||||
constexpr int AUDIO_IN_ERROR_SYSTEM_IPC = -2144993012; /* 0x8026010C */
|
||||
|
||||
} // namespace Audio
|
||||
|
||||
namespace SystemService {
|
||||
|
||||
@@ -35,10 +35,28 @@ int KYTY_SYSV_ABI SslTerm(int ssl_ctx_id);
|
||||
|
||||
namespace Http {
|
||||
|
||||
struct HttpEpoll;
|
||||
|
||||
using HttpEpollHandle = HttpEpoll*;
|
||||
|
||||
using HttpsCallback = int (*)(int, unsigned int, void* const*, int, void*);
|
||||
|
||||
int KYTY_SYSV_ABI HttpInit(int memid, int ssl_ctx_id, uint64_t pool_size);
|
||||
int KYTY_SYSV_ABI HttpTerm(int http_ctx_id);
|
||||
int KYTY_SYSV_ABI HttpCreateTemplate(int http_ctx_id, const char* user_agent, int http_ver, int is_auto_proxy_conf);
|
||||
int KYTY_SYSV_ABI HttpDeleteTemplate(int tmpl_id);
|
||||
int KYTY_SYSV_ABI HttpSetNonblock(int id, int enable);
|
||||
int KYTY_SYSV_ABI HttpCreateEpoll(int http_ctx_id, HttpEpollHandle* eh);
|
||||
int KYTY_SYSV_ABI HttpDestroyEpoll(int http_ctx_id, HttpEpollHandle eh);
|
||||
int KYTY_SYSV_ABI HttpCreateConnectionWithURL(int tmpl_id, const char* url, int enable_keep_alive);
|
||||
int KYTY_SYSV_ABI HttpDeleteConnection(int conn_id);
|
||||
int KYTY_SYSV_ABI HttpCreateRequestWithURL2(int conn_id, const char* method, const char* url, uint64_t content_length);
|
||||
int KYTY_SYSV_ABI HttpDeleteRequest(int req_id);
|
||||
int KYTY_SYSV_ABI HttpAddRequestHeader(int id, const char* name, const char* value, uint32_t mode);
|
||||
int KYTY_SYSV_ABI HttpSetEpoll(int id, HttpEpollHandle eh, void* user_arg);
|
||||
int KYTY_SYSV_ABI HttpUnsetEpoll(int id);
|
||||
int KYTY_SYSV_ABI HttpSendRequest(int request_id, const void* post_data, size_t size);
|
||||
int KYTY_SYSV_ABI HttpsSetSslCallback(int id, HttpsCallback cbfunc, void* user_arg);
|
||||
|
||||
} // namespace Http
|
||||
|
||||
@@ -64,6 +82,9 @@ namespace NpManager {
|
||||
struct NpTitleId;
|
||||
struct NpTitleSecret;
|
||||
struct NpContentRestriction;
|
||||
struct NpId;
|
||||
struct NpOnlineId;
|
||||
struct NpCreateAsyncRequestParameter;
|
||||
|
||||
int KYTY_SYSV_ABI NpCheckCallback();
|
||||
int KYTY_SYSV_ABI NpSetNpTitleId(const NpTitleId* title_id, const NpTitleSecret* title_secret);
|
||||
@@ -71,18 +92,29 @@ int KYTY_SYSV_ABI NpSetContentRestriction(const NpContentRestriction* restricti
|
||||
int KYTY_SYSV_ABI NpRegisterStateCallback(void* callback, void* userdata);
|
||||
void KYTY_SYSV_ABI NpRegisterGamePresenceCallback(void* callback, void* userdata);
|
||||
int KYTY_SYSV_ABI NpRegisterPlusEventCallback(void* callback, void* userdata);
|
||||
int KYTY_SYSV_ABI NpGetNpId(int user_id, NpId* np_id);
|
||||
int KYTY_SYSV_ABI NpGetOnlineId(int user_id, NpOnlineId* online_id);
|
||||
int KYTY_SYSV_ABI NpCreateAsyncRequest(const NpCreateAsyncRequestParameter* param);
|
||||
int KYTY_SYSV_ABI NpDeleteRequest(int req_id);
|
||||
int KYTY_SYSV_ABI NpCheckNpAvailability(int req_id, const char* user, void* result);
|
||||
int KYTY_SYSV_ABI NpPollAsync(int req_id, int* result);
|
||||
int KYTY_SYSV_ABI NpGetState(int user_id, uint32_t* state);
|
||||
|
||||
} // namespace NpManager
|
||||
|
||||
namespace NpManagerForToolkit {
|
||||
|
||||
int KYTY_SYSV_ABI NpRegisterStateCallbackForToolkit(void* callback, void* userdata);
|
||||
int KYTY_SYSV_ABI NpCheckCallbackForLib();
|
||||
|
||||
} // namespace NpManagerForToolkit
|
||||
|
||||
namespace NpTrophy {
|
||||
|
||||
int KYTY_SYSV_ABI NpTrophyCreateHandle(int* handle);
|
||||
int KYTY_SYSV_ABI NpTrophyCreateContext(int* context, int user_id, uint32_t service_label, uint64_t options);
|
||||
int KYTY_SYSV_ABI NpTrophyRegisterContext(int context, int handle, uint64_t options);
|
||||
int KYTY_SYSV_ABI NpTrophyDestroyHandle(int handle);
|
||||
|
||||
} // namespace NpTrophy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user