mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-08 18:11:32 -06:00
Merge branch 'main' into dialogs_fixups
This commit is contained in:
commit
c11782345f
@ -14,10 +14,7 @@ namespace Libraries::Np::NpPartner {
|
||||
static bool g_library_init = false;
|
||||
std::mutex g_library_mutex{};
|
||||
|
||||
/**
|
||||
* Terminates the library
|
||||
*/
|
||||
s32 PS4_SYSV_ABI Func_A4CC5784DA33517F() {
|
||||
s32 PS4_SYSV_ABI sceNpEAAccessTerminate() {
|
||||
LOG_ERROR(Lib_NpPartner, "(STUBBED) called");
|
||||
if (!g_library_init) {
|
||||
return ORBIS_NP_PARTNER_ERROR_NOT_INITIALIZED;
|
||||
@ -27,10 +24,7 @@ s32 PS4_SYSV_ABI Func_A4CC5784DA33517F() {
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Aborts requests started by Func_F8E9DB52CD425743
|
||||
*/
|
||||
s32 PS4_SYSV_ABI Func_A507D84D91F39CC7() {
|
||||
s32 PS4_SYSV_ABI sceNpHasEAAccessSubscriptionAbortRequest() {
|
||||
LOG_ERROR(Lib_NpPartner, "(STUBBED) called");
|
||||
if (!g_library_init) {
|
||||
return ORBIS_NP_PARTNER_ERROR_NOT_INITIALIZED;
|
||||
@ -39,20 +33,15 @@ s32 PS4_SYSV_ABI Func_A507D84D91F39CC7() {
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the library
|
||||
*/
|
||||
s32 PS4_SYSV_ABI Func_EC2C48E74FF19429() {
|
||||
s32 PS4_SYSV_ABI sceNpEAAccessInitialize() {
|
||||
LOG_ERROR(Lib_NpPartner, "(STUBBED) called");
|
||||
g_library_init = true;
|
||||
// Also retrieves and sends compiled SDK version to server.
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an NP request to determine if the user has a subscription to EA's services.
|
||||
*/
|
||||
s32 PS4_SYSV_ABI Func_F8E9DB52CD425743(UserService::OrbisUserServiceUserId user_id, bool* result) {
|
||||
s32 PS4_SYSV_ABI sceNpHasEAAccessSubscription(UserService::OrbisUserServiceUserId user_id,
|
||||
bool* result) {
|
||||
LOG_ERROR(Lib_NpPartner, "(STUBBED) called");
|
||||
if (!g_library_init) {
|
||||
return ORBIS_NP_PARTNER_ERROR_NOT_INITIALIZED;
|
||||
@ -71,13 +60,13 @@ s32 PS4_SYSV_ABI Func_F8E9DB52CD425743(UserService::OrbisUserServiceUserId user_
|
||||
|
||||
void RegisterLib(Core::Loader::SymbolsResolver* sym) {
|
||||
LIB_FUNCTION("pMxXhNozUX8", "libSceNpPartner001", 1, "libSceNpPartner001",
|
||||
Func_A4CC5784DA33517F);
|
||||
sceNpEAAccessTerminate);
|
||||
LIB_FUNCTION("pQfYTZHznMc", "libSceNpPartner001", 1, "libSceNpPartner001",
|
||||
Func_A507D84D91F39CC7);
|
||||
sceNpHasEAAccessSubscriptionAbortRequest);
|
||||
LIB_FUNCTION("7CxI50-xlCk", "libSceNpPartner001", 1, "libSceNpPartner001",
|
||||
Func_EC2C48E74FF19429);
|
||||
sceNpEAAccessInitialize);
|
||||
LIB_FUNCTION("+OnbUs1CV0M", "libSceNpPartner001", 1, "libSceNpPartner001",
|
||||
Func_F8E9DB52CD425743);
|
||||
sceNpHasEAAccessSubscription);
|
||||
};
|
||||
|
||||
} // namespace Libraries::Np::NpPartner
|
||||
@ -177,19 +177,18 @@ int PS4_SYSV_ABI scePadGetIdleCount() {
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePadGetInfo(u32* data) {
|
||||
int PS4_SYSV_ABI scePadGetInfo(OrbisPadInfo* data) {
|
||||
LOG_WARNING(Lib_Pad, "(DUMMY) called");
|
||||
if (!data) {
|
||||
return ORBIS_PAD_ERROR_INVALID_ARG;
|
||||
}
|
||||
data[0] = 0x1; // index but starting from one?
|
||||
data[1] = 0x0; // index?
|
||||
data[2] = 1; // pad handle
|
||||
data[3] = 0x0101; // ???
|
||||
data[4] = 0x0; // ?
|
||||
data[5] = 0x0; // ?
|
||||
data[6] = 0x00ff0000; // colour(?)
|
||||
data[7] = 0x0; // ?
|
||||
auto& controllers = *Common::Singleton<GameControllers>::Instance();
|
||||
auto col = controllers[0]->GetLightBarRGB();
|
||||
std::memset(data, 0, sizeof(OrbisPadInfo));
|
||||
data->unk1 = 0x1;
|
||||
data->pad_handle = 1;
|
||||
data->unk3 = 0x00000101;
|
||||
data->colour = col.r + (col.g << 8) + (col.b << 16);
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -253,6 +253,18 @@ struct OrbisPadVibrationParam {
|
||||
u8 smallMotor;
|
||||
};
|
||||
|
||||
struct OrbisPadInfo {
|
||||
u32 unk1;
|
||||
u32 unk2;
|
||||
u32 pad_handle;
|
||||
u32 unk3;
|
||||
u32 unk4;
|
||||
u32 unk5;
|
||||
u32 colour;
|
||||
u32 unk6;
|
||||
u32 unk[30];
|
||||
};
|
||||
|
||||
int PS4_SYSV_ABI scePadClose(s32 handle);
|
||||
int PS4_SYSV_ABI scePadConnectPort();
|
||||
int PS4_SYSV_ABI scePadDeviceClassGetExtendedInformation(
|
||||
@ -280,7 +292,7 @@ int PS4_SYSV_ABI scePadGetFeatureReport();
|
||||
int PS4_SYSV_ABI scePadGetHandle(Libraries::UserService::OrbisUserServiceUserId userId, s32 type,
|
||||
s32 index);
|
||||
int PS4_SYSV_ABI scePadGetIdleCount();
|
||||
int PS4_SYSV_ABI scePadGetInfo(u32* data);
|
||||
int PS4_SYSV_ABI scePadGetInfo(OrbisPadInfo* data);
|
||||
int PS4_SYSV_ABI scePadGetInfoByPortType();
|
||||
int PS4_SYSV_ABI scePadGetLicenseControllerInformation();
|
||||
int PS4_SYSV_ABI scePadGetMotionSensorPosition();
|
||||
|
||||
@ -157,6 +157,10 @@ void GameController::SetLightBarRGB(u8 r, u8 g, u8 b) {
|
||||
}
|
||||
}
|
||||
|
||||
Colour GameController::GetLightBarRGB() {
|
||||
return colour;
|
||||
}
|
||||
|
||||
void GameController::PollLightColour() {
|
||||
if (m_sdl_gamepad != nullptr) {
|
||||
SDL_SetGamepadLED(m_sdl_gamepad, colour.r, colour.g, colour.b);
|
||||
|
||||
@ -126,6 +126,7 @@ public:
|
||||
void UpdateAcceleration(const float acceleration[3]);
|
||||
void UpdateAxisSmoothing();
|
||||
void SetLightBarRGB(u8 r, u8 g, u8 b);
|
||||
Colour GetLightBarRGB();
|
||||
void PollLightColour();
|
||||
bool SetVibration(u8 smallMotor, u8 largeMotor);
|
||||
void SetTouchpadState(int touchIndex, bool touchDown, float x, float y);
|
||||
|
||||
@ -1089,7 +1089,8 @@ void PatchImageArgs(IR::Block& block, IR::Inst& inst, Info& info) {
|
||||
}
|
||||
|
||||
const auto image_handle = inst.Arg(0);
|
||||
const auto& image_res = info.images[image_handle.U32() & 0xFFFF];
|
||||
const auto binding_index = image_handle.U32() & 0xFFFF;
|
||||
const auto& image_res = info.images[binding_index];
|
||||
auto image = image_res.GetSharp(info);
|
||||
|
||||
// Sample instructions must be handled separately using address register data.
|
||||
@ -1098,7 +1099,7 @@ void PatchImageArgs(IR::Block& block, IR::Inst& inst, Info& info) {
|
||||
}
|
||||
|
||||
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
|
||||
const auto inst_info = inst.Flags<IR::TextureInstInfo>();
|
||||
auto inst_info = inst.Flags<IR::TextureInstInfo>();
|
||||
const auto view_type = image.GetViewType(image_res.is_array);
|
||||
|
||||
// Now that we know the image type, adjust texture coordinate vector.
|
||||
@ -1109,8 +1110,26 @@ void PatchImageArgs(IR::Block& block, IR::Inst& inst, Info& info) {
|
||||
return {body->Arg(0), body->Arg(1)};
|
||||
case AmdGpu::ImageType::Color1DArray: // x, slice, [lod]
|
||||
case AmdGpu::ImageType::Color2D: // x, y, [lod]
|
||||
case AmdGpu::ImageType::Color2DMsaa: // x, y. (sample is passed on different argument)
|
||||
return {ir.CompositeConstruct(body->Arg(0), body->Arg(1)), body->Arg(2)};
|
||||
case AmdGpu::ImageType::Color2DMsaa: // x, y. (sample is passed on different argument)
|
||||
{
|
||||
auto skip_lod = false;
|
||||
if (inst_info.has_lod) {
|
||||
const auto mipid = body->Arg(2);
|
||||
if (mipid.IsImmediate() && mipid.U32() == 0) {
|
||||
// if image_x_mip refers to a MSAA image, and mipid is 0, it is safe to be
|
||||
// skipped and fragid is taken from the next arg
|
||||
LOG_WARNING(Render_Recompiler, "Encountered a _mip instruction with MSAA "
|
||||
"image, and mipid is 0, skipping LoD");
|
||||
inst_info.has_lod.Assign(false);
|
||||
skip_lod = true;
|
||||
} else {
|
||||
UNREACHABLE_MSG(
|
||||
"Encountered a _mip instruction with MSAA image, and mipid is non-zero");
|
||||
}
|
||||
}
|
||||
return {ir.CompositeConstruct(body->Arg(0), body->Arg(1)), body->Arg(skip_lod ? 3 : 2)};
|
||||
}
|
||||
case AmdGpu::ImageType::Color2DArray: // x, y, slice, [lod]
|
||||
case AmdGpu::ImageType::Color2DMsaaArray: // x, y, slice. (sample is passed on different
|
||||
// argument)
|
||||
|
||||
@ -105,7 +105,7 @@ void RingAccessElimination(const IR::Program& program, const RuntimeInfo& runtim
|
||||
output_vertices = info.gs_copy_data.output_vertices;
|
||||
}
|
||||
u32 dwords_per_vertex = gs_info.out_vertex_data_size;
|
||||
if (info.gs_copy_data.num_comps && info.gs_copy_data.num_comps != dwords_per_vertex) {
|
||||
if (info.gs_copy_data.num_comps && info.gs_copy_data.num_comps > dwords_per_vertex) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"VERT_ITEMSIZE {} is different than actual number of dwords per vertex {}",
|
||||
dwords_per_vertex, info.gs_copy_data.num_comps);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user