mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-25 22:50:15 +00:00
Fix various warnings
This commit is contained in:
parent
eb8a7a92c1
commit
f80c1cd820
@ -25,8 +25,8 @@
|
|||||||
namespace {
|
namespace {
|
||||||
QImage LoadTexture(const u8* src, const Pica::Texture::TextureInfo& info) {
|
QImage LoadTexture(const u8* src, const Pica::Texture::TextureInfo& info) {
|
||||||
QImage decoded_image(info.width, info.height, QImage::Format_ARGB32);
|
QImage decoded_image(info.width, info.height, QImage::Format_ARGB32);
|
||||||
for (int y = 0; y < info.height; ++y) {
|
for (unsigned int y = 0; y < info.height; ++y) {
|
||||||
for (int x = 0; x < info.width; ++x) {
|
for (unsigned int x = 0; x < info.width; ++x) {
|
||||||
Math::Vec4<u8> color = Pica::Texture::LookupTexture(src, x, y, info, true);
|
Math::Vec4<u8> color = Pica::Texture::LookupTexture(src, x, y, info, true);
|
||||||
decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a()));
|
decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a()));
|
||||||
}
|
}
|
||||||
|
@ -82,14 +82,15 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
|
|||||||
|
|
||||||
ResultStatus init_result{Init(emu_window, system_mode.get())};
|
ResultStatus init_result{Init(emu_window, system_mode.get())};
|
||||||
if (init_result != ResultStatus::Success) {
|
if (init_result != ResultStatus::Success) {
|
||||||
LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!", init_result);
|
LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!",
|
||||||
|
static_cast<int>(init_result));
|
||||||
System::Shutdown();
|
System::Shutdown();
|
||||||
return init_result;
|
return init_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Loader::ResultStatus load_result{app_loader->Load()};
|
const Loader::ResultStatus load_result{app_loader->Load()};
|
||||||
if (Loader::ResultStatus::Success != load_result) {
|
if (Loader::ResultStatus::Success != load_result) {
|
||||||
LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", load_result);
|
LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", static_cast<int>(load_result));
|
||||||
System::Shutdown();
|
System::Shutdown();
|
||||||
|
|
||||||
switch (load_result) {
|
switch (load_result) {
|
||||||
|
@ -302,7 +302,9 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) {
|
|||||||
auto bp = p.find(addr);
|
auto bp = p.find(addr);
|
||||||
if (bp != p.end()) {
|
if (bp != p.end()) {
|
||||||
LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: %08x bytes at %08x of type %d\n",
|
LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: %08x bytes at %08x of type %d\n",
|
||||||
bp->second.len, bp->second.addr, type);
|
static_cast<u32>(bp->second.len),
|
||||||
|
static_cast<u32>(bp->second.addr),
|
||||||
|
static_cast<int>(type));
|
||||||
p.erase(addr);
|
p.erase(addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -348,7 +350,8 @@ bool CheckBreakpoint(PAddr addr, BreakpointType type) {
|
|||||||
|
|
||||||
if (bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) {
|
if (bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) {
|
||||||
LOG_DEBUG(Debug_GDBStub,
|
LOG_DEBUG(Debug_GDBStub,
|
||||||
"Found breakpoint type %d @ %08x, range: %08x - %08x (%d bytes)\n", type,
|
"Found breakpoint type %d @ %08x, range: %08x - %08x (%d bytes)\n",
|
||||||
|
static_cast<int>(type),
|
||||||
addr, bp->second.addr, bp->second.addr + len, len);
|
addr, bp->second.addr, bp->second.addr + len, len);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -734,7 +737,8 @@ static bool CommitBreakpoint(BreakpointType type, PAddr addr, u32 len) {
|
|||||||
breakpoint.len = len;
|
breakpoint.len = len;
|
||||||
p.insert({addr, breakpoint});
|
p.insert({addr, breakpoint});
|
||||||
|
|
||||||
LOG_DEBUG(Debug_GDBStub, "gdb: added %d breakpoint: %08x bytes at %08x\n", type, breakpoint.len,
|
LOG_DEBUG(Debug_GDBStub, "gdb: added %d breakpoint: %08x bytes at %08x\n",
|
||||||
|
static_cast<int>(type), breakpoint.len,
|
||||||
breakpoint.addr);
|
breakpoint.addr);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -62,7 +62,7 @@ ResultCode Applet::Create(Service::APT::AppletId id) {
|
|||||||
applets[id] = std::make_shared<Mint>(id);
|
applets[id] = std::make_shared<Mint>(id);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(Service_APT, "Could not create applet %u", id);
|
LOG_ERROR(Service_APT, "Could not create applet %u", static_cast<u32>(id));
|
||||||
// TODO(Subv): Find the right error code
|
// TODO(Subv): Find the right error code
|
||||||
return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet,
|
return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet,
|
||||||
ErrorSummary::NotSupported, ErrorLevel::Permanent);
|
ErrorSummary::NotSupported, ErrorLevel::Permanent);
|
||||||
@ -82,7 +82,7 @@ std::shared_ptr<Applet> Applet::Get(Service::APT::AppletId id) {
|
|||||||
static void AppletUpdateEvent(u64 applet_id, int cycles_late) {
|
static void AppletUpdateEvent(u64 applet_id, int cycles_late) {
|
||||||
Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_id);
|
Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_id);
|
||||||
std::shared_ptr<Applet> applet = Applet::Get(id);
|
std::shared_ptr<Applet> applet = Applet::Get(id);
|
||||||
ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id=%08X", id);
|
ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id=%08X", static_cast<u32>(id));
|
||||||
|
|
||||||
applet->Update();
|
applet->Update();
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address,
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(Kernel, "unknown type=%d", type);
|
LOG_ERROR(Kernel, "unknown type=%d", static_cast<int>(type));
|
||||||
return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel,
|
return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel,
|
||||||
ErrorSummary::WrongArgument, ErrorLevel::Usage);
|
ErrorSummary::WrongArgument, ErrorLevel::Usage);
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,9 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) {
|
|||||||
mapping.size = Memory::PAGE_SIZE;
|
mapping.size = Memory::PAGE_SIZE;
|
||||||
mapping.writable = true; // TODO: Not sure if correct
|
mapping.writable = true; // TODO: Not sure if correct
|
||||||
mapping.unk_flag = false;
|
mapping.unk_flag = false;
|
||||||
|
|
||||||
|
// Missing line??
|
||||||
|
address_mappings.push_back(mapping);
|
||||||
} else if ((type & 0xFE0) == 0xFC0) { // 0x01FF
|
} else if ((type & 0xFE0) == 0xFC0) { // 0x01FF
|
||||||
// Kernel version
|
// Kernel version
|
||||||
kernel_version = descriptor & 0xFFFF;
|
kernel_version = descriptor & 0xFFFF;
|
||||||
|
@ -42,7 +42,7 @@ void FindContentInfos(Service::Interface* self) {
|
|||||||
am_content_count[media_type] = cmd_buff[4];
|
am_content_count[media_type] = cmd_buff[4];
|
||||||
|
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016llx, content_cound=%u, "
|
LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016lx, content_cound=%u, "
|
||||||
"content_ids_pointer=0x%08x, content_info_pointer=0x%08x",
|
"content_ids_pointer=0x%08x, content_info_pointer=0x%08x",
|
||||||
media_type, title_id, am_content_count[media_type], content_ids_pointer,
|
media_type, title_id, am_content_count[media_type], content_ids_pointer,
|
||||||
content_info_pointer);
|
content_info_pointer);
|
||||||
|
@ -353,12 +353,12 @@ void PrepareToStartLibraryApplet(Service::Interface* self) {
|
|||||||
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
||||||
auto applet = HLE::Applets::Applet::Get(applet_id);
|
auto applet = HLE::Applets::Applet::Get(applet_id);
|
||||||
if (applet) {
|
if (applet) {
|
||||||
LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id);
|
LOG_WARNING(Service_APT, "applet has already been started id=%08X", static_cast<u32>(applet_id));
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
} else {
|
} else {
|
||||||
cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw;
|
cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw;
|
||||||
}
|
}
|
||||||
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
|
LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast<u32>(applet_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreloadLibraryApplet(Service::Interface* self) {
|
void PreloadLibraryApplet(Service::Interface* self) {
|
||||||
@ -366,12 +366,13 @@ void PreloadLibraryApplet(Service::Interface* self) {
|
|||||||
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
||||||
auto applet = HLE::Applets::Applet::Get(applet_id);
|
auto applet = HLE::Applets::Applet::Get(applet_id);
|
||||||
if (applet) {
|
if (applet) {
|
||||||
LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id);
|
LOG_WARNING(Service_APT, "applet has already been started id=%08X",
|
||||||
|
static_cast<u32>(applet_id));
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
} else {
|
} else {
|
||||||
cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw;
|
cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw;
|
||||||
}
|
}
|
||||||
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
|
LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast<u32>(applet_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartLibraryApplet(Service::Interface* self) {
|
void StartLibraryApplet(Service::Interface* self) {
|
||||||
@ -379,10 +380,10 @@ void StartLibraryApplet(Service::Interface* self) {
|
|||||||
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
||||||
std::shared_ptr<HLE::Applets::Applet> applet = HLE::Applets::Applet::Get(applet_id);
|
std::shared_ptr<HLE::Applets::Applet> applet = HLE::Applets::Applet::Get(applet_id);
|
||||||
|
|
||||||
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
|
LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast<u32>(applet_id));
|
||||||
|
|
||||||
if (applet == nullptr) {
|
if (applet == nullptr) {
|
||||||
LOG_ERROR(Service_APT, "unknown applet id=%08X", applet_id);
|
LOG_ERROR(Service_APT, "unknown applet id=%08X", static_cast<u32>(applet_id));
|
||||||
cmd_buff[1] = -1; // TODO(Subv): Find the right error code
|
cmd_buff[1] = -1; // TODO(Subv): Find the right error code
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -415,7 +416,7 @@ void SetScreenCapPostPermission(Service::Interface* self) {
|
|||||||
cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
|
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
|
||||||
screen_capture_post_permission);
|
static_cast<u32>(screen_capture_post_permission));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetScreenCapPostPermission(Service::Interface* self) {
|
void GetScreenCapPostPermission(Service::Interface* self) {
|
||||||
@ -425,7 +426,7 @@ void GetScreenCapPostPermission(Service::Interface* self) {
|
|||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
cmd_buff[2] = static_cast<u32>(screen_capture_post_permission);
|
cmd_buff[2] = static_cast<u32>(screen_capture_post_permission);
|
||||||
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
|
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
|
||||||
screen_capture_post_permission);
|
static_cast<u32>(screen_capture_post_permission));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetAppletInfo(Service::Interface* self) {
|
void GetAppletInfo(Service::Interface* self) {
|
||||||
@ -444,7 +445,7 @@ void GetAppletInfo(Service::Interface* self) {
|
|||||||
ErrorSummary::NotFound, ErrorLevel::Status)
|
ErrorSummary::NotFound, ErrorLevel::Status)
|
||||||
.raw;
|
.raw;
|
||||||
}
|
}
|
||||||
LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id);
|
LOG_WARNING(Service_APT, "(stubbed) called appid=%u", static_cast<int>(app_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetStartupArgument(Service::Interface* self) {
|
void GetStartupArgument(Service::Interface* self) {
|
||||||
@ -466,7 +467,7 @@ void GetStartupArgument(Service::Interface* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x",
|
LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x",
|
||||||
startup_argument_type, parameter_size);
|
static_cast<u32>(startup_argument_type), parameter_size);
|
||||||
|
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
cmd_buff[2] = 0;
|
cmd_buff[2] = 0;
|
||||||
|
@ -296,7 +296,8 @@ static void WriteProcessPipe(Service::Interface* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ASSERT_MSG(Memory::IsValidVirtualAddress(buffer),
|
ASSERT_MSG(Memory::IsValidVirtualAddress(buffer),
|
||||||
"Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe, size, buffer);
|
"Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X",
|
||||||
|
static_cast<u32>(pipe), size, buffer);
|
||||||
|
|
||||||
std::vector<u8> message(size);
|
std::vector<u8> message(size);
|
||||||
for (u32 i = 0; i < size; i++) {
|
for (u32 i = 0; i < size; i++) {
|
||||||
@ -336,7 +337,8 @@ static void ReadPipeIfPossible(Service::Interface* self) {
|
|||||||
DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index);
|
DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index);
|
||||||
|
|
||||||
ASSERT_MSG(Memory::IsValidVirtualAddress(addr),
|
ASSERT_MSG(Memory::IsValidVirtualAddress(addr),
|
||||||
"Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown,
|
"Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X",
|
||||||
|
static_cast<u32>(pipe), unknown,
|
||||||
size, addr);
|
size, addr);
|
||||||
|
|
||||||
cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2);
|
cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2);
|
||||||
@ -380,8 +382,8 @@ static void ReadPipe(Service::Interface* self) {
|
|||||||
DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index);
|
DSP::HLE::DspPipe pipe = static_cast<DSP::HLE::DspPipe>(pipe_index);
|
||||||
|
|
||||||
ASSERT_MSG(Memory::IsValidVirtualAddress(addr),
|
ASSERT_MSG(Memory::IsValidVirtualAddress(addr),
|
||||||
"Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown,
|
"Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X",
|
||||||
size, addr);
|
static_cast<u32>(pipe), unknown, size, addr);
|
||||||
|
|
||||||
if (DSP::HLE::GetPipeReadableSize(pipe) >= size) {
|
if (DSP::HLE::GetPipeReadableSize(pipe) >= size) {
|
||||||
std::vector<u8> response = DSP::HLE::PipeRead(pipe, size);
|
std::vector<u8> response = DSP::HLE::PipeRead(pipe, size);
|
||||||
|
@ -106,7 +106,7 @@ void File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_ses
|
|||||||
|
|
||||||
if (offset + length > backend->GetSize()) {
|
if (offset + length > backend->GetSize()) {
|
||||||
LOG_ERROR(Service_FS,
|
LOG_ERROR(Service_FS,
|
||||||
"Reading from out of bounds offset=0x%llX length=0x%08X file_size=0x%llX",
|
"Reading from out of bounds offset=0x%lX length=0x%08X file_size=0x%lX",
|
||||||
offset, length, backend->GetSize());
|
offset, length, backend->GetSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ void File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_ses
|
|||||||
|
|
||||||
// Unknown command...
|
// Unknown command...
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd);
|
LOG_ERROR(Service_FS, "Unknown command=0x%08X!", static_cast<u32>(cmd));
|
||||||
ResultCode error = UnimplementedFunction(ErrorModule::FS);
|
ResultCode error = UnimplementedFunction(ErrorModule::FS);
|
||||||
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
|
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
|
||||||
return;
|
return;
|
||||||
@ -232,7 +232,7 @@ void Directory::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> serve
|
|||||||
|
|
||||||
// Unknown command...
|
// Unknown command...
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd);
|
LOG_ERROR(Service_FS, "Unknown command=0x%08X!", static_cast<u32>(cmd));
|
||||||
ResultCode error = UnimplementedFunction(ErrorModule::FS);
|
ResultCode error = UnimplementedFunction(ErrorModule::FS);
|
||||||
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
|
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
|
||||||
return;
|
return;
|
||||||
@ -300,7 +300,7 @@ ResultCode RegisterArchiveType(std::unique_ptr<FileSys::ArchiveFactory>&& factor
|
|||||||
|
|
||||||
auto& archive = result.first->second;
|
auto& archive = result.first->second;
|
||||||
LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(),
|
LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(),
|
||||||
id_code);
|
static_cast<u32>(id_code));
|
||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,7 +475,7 @@ ResultCode DeleteExtSaveData(MediaType media_type, u32 high, u32 low) {
|
|||||||
} else if (media_type == MediaType::SDMC) {
|
} else if (media_type == MediaType::SDMC) {
|
||||||
media_type_directory = FileUtil::GetUserPath(D_SDMC_IDX);
|
media_type_directory = FileUtil::GetUserPath(D_SDMC_IDX);
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR(Service_FS, "Unsupported media type %u", media_type);
|
LOG_ERROR(Service_FS, "Unsupported media type %u", static_cast<u32>(media_type));
|
||||||
return ResultCode(-1); // TODO(Subv): Find the right error code
|
return ResultCode(-1); // TODO(Subv): Find the right error code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ static void CreateFile(Service::Interface* self) {
|
|||||||
|
|
||||||
FileSys::Path file_path(filename_type, filename_size, filename_ptr);
|
FileSys::Path file_path(filename_type, filename_size, filename_ptr);
|
||||||
|
|
||||||
LOG_DEBUG(Service_FS, "type=%u size=%llu data=%s", static_cast<u32>(filename_type), file_size,
|
LOG_DEBUG(Service_FS, "type=%u size=%lu data=%s", static_cast<u32>(filename_type), file_size,
|
||||||
file_path.DebugStr().c_str());
|
file_path.DebugStr().c_str());
|
||||||
|
|
||||||
cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw;
|
cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw;
|
||||||
|
@ -32,7 +32,8 @@ void EnterExclusiveState(Service::Interface* self) {
|
|||||||
|
|
||||||
cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
||||||
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state);
|
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ",
|
||||||
|
static_cast<u32>(exclusive_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LeaveExclusiveState(Service::Interface* self) {
|
void LeaveExclusiveState(Service::Interface* self) {
|
||||||
@ -41,7 +42,8 @@ void LeaveExclusiveState(Service::Interface* self) {
|
|||||||
|
|
||||||
cmd_buff[0] = IPC::MakeHeader(0x2, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x2, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
||||||
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state);
|
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ",
|
||||||
|
static_cast<u32>(exclusive_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryExclusiveMode(Service::Interface* self) {
|
void QueryExclusiveMode(Service::Interface* self) {
|
||||||
@ -50,7 +52,8 @@ void QueryExclusiveMode(Service::Interface* self) {
|
|||||||
cmd_buff[0] = IPC::MakeHeader(0x3, 2, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x3, 2, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
||||||
cmd_buff[2] = static_cast<u32>(exclusive_state);
|
cmd_buff[2] = static_cast<u32>(exclusive_state);
|
||||||
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ", exclusive_state);
|
LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x%08X ",
|
||||||
|
static_cast<u32>(exclusive_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LockState(Service::Interface* self) {
|
void LockState(Service::Interface* self) {
|
||||||
@ -84,7 +87,8 @@ void SuspendDaemons(Service::Interface* self) {
|
|||||||
|
|
||||||
cmd_buff[0] = IPC::MakeHeader(0x6, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x6, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
||||||
LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", daemon_bit_mask);
|
LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ",
|
||||||
|
static_cast<u32>(daemon_bit_mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResumeDaemons(Service::Interface* self) {
|
void ResumeDaemons(Service::Interface* self) {
|
||||||
@ -99,7 +103,8 @@ void ResumeDaemons(Service::Interface* self) {
|
|||||||
|
|
||||||
cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
||||||
LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ", daemon_bit_mask);
|
LOG_WARNING(Service_NDM, "(STUBBED) daemon_bit_mask=0x%08X ",
|
||||||
|
static_cast<u32>(daemon_bit_mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SuspendScheduler(Service::Interface* self) {
|
void SuspendScheduler(Service::Interface* self) {
|
||||||
@ -198,7 +203,8 @@ void OverrideDefaultDaemons(Service::Interface* self) {
|
|||||||
|
|
||||||
cmd_buff[0] = IPC::MakeHeader(0x14, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x14, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
||||||
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask);
|
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ",
|
||||||
|
static_cast<u32>(default_daemon_bit_mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetDefaultDaemons(Service::Interface* self) {
|
void ResetDefaultDaemons(Service::Interface* self) {
|
||||||
@ -207,7 +213,8 @@ void ResetDefaultDaemons(Service::Interface* self) {
|
|||||||
|
|
||||||
cmd_buff[0] = IPC::MakeHeader(0x15, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x15, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
||||||
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask);
|
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ",
|
||||||
|
static_cast<u32>(default_daemon_bit_mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetDefaultDaemons(Service::Interface* self) {
|
void GetDefaultDaemons(Service::Interface* self) {
|
||||||
@ -216,7 +223,8 @@ void GetDefaultDaemons(Service::Interface* self) {
|
|||||||
cmd_buff[0] = IPC::MakeHeader(0x16, 2, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x16, 2, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
||||||
cmd_buff[2] = static_cast<u32>(default_daemon_bit_mask);
|
cmd_buff[2] = static_cast<u32>(default_daemon_bit_mask);
|
||||||
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ", default_daemon_bit_mask);
|
LOG_WARNING(Service_NDM, "(STUBBED) default_daemon_bit_mask=0x%08X ",
|
||||||
|
static_cast<u32>(default_daemon_bit_mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearHalfAwakeMacFilter(Service::Interface* self) {
|
void ClearHalfAwakeMacFilter(Service::Interface* self) {
|
||||||
|
@ -89,7 +89,7 @@ static void SetInputFormat(Interface* self) {
|
|||||||
cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
|
|
||||||
LOG_DEBUG(Service_Y2R, "called input_format=%hhu", conversion.input_format);
|
LOG_DEBUG(Service_Y2R, "called input_format=%hhu", static_cast<int>(conversion.input_format));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GetInputFormat(Interface* self) {
|
static void GetInputFormat(Interface* self) {
|
||||||
@ -99,7 +99,7 @@ static void GetInputFormat(Interface* self) {
|
|||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
cmd_buff[2] = static_cast<u32>(conversion.input_format);
|
cmd_buff[2] = static_cast<u32>(conversion.input_format);
|
||||||
|
|
||||||
LOG_DEBUG(Service_Y2R, "called input_format=%hhu", conversion.input_format);
|
LOG_DEBUG(Service_Y2R, "called input_format=%hhu", static_cast<int>(conversion.input_format));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetOutputFormat(Interface* self) {
|
static void SetOutputFormat(Interface* self) {
|
||||||
@ -110,7 +110,8 @@ static void SetOutputFormat(Interface* self) {
|
|||||||
cmd_buff[0] = IPC::MakeHeader(0x3, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x3, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
|
|
||||||
LOG_DEBUG(Service_Y2R, "called output_format=%hhu", conversion.output_format);
|
LOG_DEBUG(Service_Y2R, "called output_format=%hhu",
|
||||||
|
static_cast<int>(conversion.output_format));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GetOutputFormat(Interface* self) {
|
static void GetOutputFormat(Interface* self) {
|
||||||
@ -120,7 +121,8 @@ static void GetOutputFormat(Interface* self) {
|
|||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
cmd_buff[2] = static_cast<u32>(conversion.output_format);
|
cmd_buff[2] = static_cast<u32>(conversion.output_format);
|
||||||
|
|
||||||
LOG_DEBUG(Service_Y2R, "called output_format=%hhu", conversion.output_format);
|
LOG_DEBUG(Service_Y2R, "called output_format=%hhu",
|
||||||
|
static_cast<int>(conversion.output_format));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetRotation(Interface* self) {
|
static void SetRotation(Interface* self) {
|
||||||
@ -131,7 +133,7 @@ static void SetRotation(Interface* self) {
|
|||||||
cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x5, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
|
|
||||||
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", conversion.rotation);
|
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", static_cast<int>(conversion.rotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GetRotation(Interface* self) {
|
static void GetRotation(Interface* self) {
|
||||||
@ -141,7 +143,7 @@ static void GetRotation(Interface* self) {
|
|||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
cmd_buff[2] = static_cast<u32>(conversion.rotation);
|
cmd_buff[2] = static_cast<u32>(conversion.rotation);
|
||||||
|
|
||||||
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", conversion.rotation);
|
LOG_DEBUG(Service_Y2R, "called rotation=%hhu", static_cast<int>(conversion.rotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetBlockAlignment(Interface* self) {
|
static void SetBlockAlignment(Interface* self) {
|
||||||
@ -152,7 +154,8 @@ static void SetBlockAlignment(Interface* self) {
|
|||||||
cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0);
|
cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0);
|
||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
|
|
||||||
LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu", conversion.block_alignment);
|
LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu",
|
||||||
|
static_cast<int>(conversion.block_alignment));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GetBlockAlignment(Interface* self) {
|
static void GetBlockAlignment(Interface* self) {
|
||||||
@ -162,7 +165,8 @@ static void GetBlockAlignment(Interface* self) {
|
|||||||
cmd_buff[1] = RESULT_SUCCESS.raw;
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
||||||
cmd_buff[2] = static_cast<u32>(conversion.block_alignment);
|
cmd_buff[2] = static_cast<u32>(conversion.block_alignment);
|
||||||
|
|
||||||
LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu", conversion.block_alignment);
|
LOG_DEBUG(Service_Y2R, "called block_alignment=%hhu",
|
||||||
|
static_cast<int>(conversion.block_alignment));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -664,8 +668,10 @@ cleanup:
|
|||||||
Service_Y2R,
|
Service_Y2R,
|
||||||
"called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu "
|
"called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu "
|
||||||
"input_line_width=%hu input_lines=%hu standard_coefficient=%hhu reserved=%hhu alpha=%hX",
|
"input_line_width=%hu input_lines=%hu standard_coefficient=%hhu reserved=%hhu alpha=%hX",
|
||||||
params->input_format, params->output_format, params->rotation, params->block_alignment,
|
static_cast<int>(params->input_format), static_cast<int>(params->output_format),
|
||||||
params->input_line_width, params->input_lines, params->standard_coefficient,
|
static_cast<int>(params->rotation), static_cast<int>(params->block_alignment),
|
||||||
|
params->input_line_width, params->input_lines,
|
||||||
|
static_cast<int>(params->standard_coefficient),
|
||||||
params->padding, params->alpha);
|
params->padding, params->alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -784,4 +790,4 @@ Y2R_U::~Y2R_U() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Y2R
|
} // namespace Y2R
|
||||||
} // namespace Service
|
} // namespace Service
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& nonce,
|
std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& nonce,
|
||||||
size_t slot_id) {
|
size_t slot_id) {
|
||||||
if (!IsNormalKeyAvailable(slot_id)) {
|
if (!IsNormalKeyAvailable(slot_id)) {
|
||||||
LOG_ERROR(HW_AES, "Key slot %d not available. Will use zero key.", slot_id);
|
LOG_ERROR(HW_AES, "Key slot %d not available. Will use zero key.", static_cast<int>(slot_id));
|
||||||
}
|
}
|
||||||
const AESKey normal = GetNormalKey(slot_id);
|
const AESKey normal = GetNormalKey(slot_id);
|
||||||
std::vector<u8> cipher(pdata.size() + CCM_MAC_SIZE);
|
std::vector<u8> cipher(pdata.size() + CCM_MAC_SIZE);
|
||||||
@ -67,7 +67,8 @@ std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& non
|
|||||||
std::vector<u8> DecryptVerifyCCM(const std::vector<u8>& cipher, const CCMNonce& nonce,
|
std::vector<u8> DecryptVerifyCCM(const std::vector<u8>& cipher, const CCMNonce& nonce,
|
||||||
size_t slot_id) {
|
size_t slot_id) {
|
||||||
if (!IsNormalKeyAvailable(slot_id)) {
|
if (!IsNormalKeyAvailable(slot_id)) {
|
||||||
LOG_ERROR(HW_AES, "Key slot %d not available. Will use zero key.", slot_id);
|
LOG_ERROR(HW_AES, "Key slot %d not available. Will use zero key.",
|
||||||
|
static_cast<int>(slot_id));
|
||||||
}
|
}
|
||||||
const AESKey normal = GetNormalKey(slot_id);
|
const AESKey normal = GetNormalKey(slot_id);
|
||||||
const std::size_t pdata_size = cipher.size() - CCM_MAC_SIZE;
|
const std::size_t pdata_size = cipher.size() - CCM_MAC_SIZE;
|
||||||
|
@ -64,7 +64,7 @@ static Math::Vec4<u8> DecodePixel(Regs::PixelFormat input_format, const u8* src_
|
|||||||
return Color::DecodeRGBA4(src_pixel);
|
return Color::DecodeRGBA4(src_pixel);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(HW_GPU, "Unknown source framebuffer format %x", input_format);
|
LOG_ERROR(HW_GPU, "Unknown source framebuffer format %x", static_cast<u8>(input_format));
|
||||||
return {0, 0, 0, 0};
|
return {0, 0, 0, 0};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(HW_GPU, "Unknown destination framebuffer format %x",
|
LOG_ERROR(HW_GPU, "Unknown destination framebuffer format %x",
|
||||||
config.output_format.Value());
|
static_cast<u32>(config.output_format.Value()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ struct FramebufferRegs {
|
|||||||
case ColorFormat::RGBA4:
|
case ColorFormat::RGBA4:
|
||||||
return 2;
|
return 2;
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unknown color format %u", format);
|
LOG_CRITICAL(HW_GPU, "Unknown color format %u", static_cast<int>(format));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ struct FramebufferRegs {
|
|||||||
case DepthFormat::D24S8:
|
case DepthFormat::D24S8:
|
||||||
return 4;
|
return 4;
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unknown depth format %u", format);
|
LOG_CRITICAL(HW_GPU, "Unknown depth format %u", static_cast<u32>(format));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,7 +270,7 @@ struct FramebufferRegs {
|
|||||||
case DepthFormat::D24S8:
|
case DepthFormat::D24S8:
|
||||||
return 24;
|
return 24;
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unknown depth format %u", format);
|
LOG_CRITICAL(HW_GPU, "Unknown depth format %u", static_cast<u32>(format));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1125,7 +1125,8 @@ void RasterizerOpenGL::SyncCullMode() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown cull mode %d", regs.rasterizer.cull_mode.Value());
|
LOG_CRITICAL(Render_OpenGL, "Unknown cull mode %d",
|
||||||
|
static_cast<int>(regs.rasterizer.cull_mode.Value()));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ static void AppendSource(std::string& out, const PicaShaderConfig& config,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
out += "vec4(0.0)";
|
out += "vec4(0.0)";
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown source op %u", source);
|
LOG_CRITICAL(Render_OpenGL, "Unknown source op %u", static_cast<int>(source));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ static void AppendColorModifier(std::string& out, const PicaShaderConfig& config
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
out += "vec3(0.0)";
|
out += "vec3(0.0)";
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown color modifier op %u", modifier);
|
LOG_CRITICAL(Render_OpenGL, "Unknown color modifier op %u", static_cast<int>(modifier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ static void AppendAlphaModifier(std::string& out, const PicaShaderConfig& config
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
out += "0.0";
|
out += "0.0";
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op %u", modifier);
|
LOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op %u", static_cast<int>(modifier));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -235,7 +235,8 @@ static void AppendColorCombiner(std::string& out, TevStageConfig::Operation oper
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
out += "vec3(0.0)";
|
out += "vec3(0.0)";
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: %u", operation);
|
LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: %u",
|
||||||
|
static_cast<int>(operation));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
out += ", vec3(0.0), vec3(1.0))"; // Clamp result to 0.0, 1.0
|
out += ", vec3(0.0), vec3(1.0))"; // Clamp result to 0.0, 1.0
|
||||||
@ -275,7 +276,8 @@ static void AppendAlphaCombiner(std::string& out, TevStageConfig::Operation oper
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
out += "0.0";
|
out += "0.0";
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: %u", operation);
|
LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: %u",
|
||||||
|
static_cast<int>(operation));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
out += ", 0.0, 1.0)";
|
out += ", 0.0, 1.0)";
|
||||||
@ -305,7 +307,7 @@ static void AppendAlphaTestCondition(std::string& out, FramebufferRegs::CompareF
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
out += "false";
|
out += "false";
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition %u", func);
|
LOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition %u", static_cast<int>(func));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ inline GLenum BlendEquation(Pica::FramebufferRegs::BlendEquation equation) {
|
|||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if (static_cast<size_t>(equation) >= ARRAY_SIZE(blend_equation_table)) {
|
if (static_cast<size_t>(equation) >= ARRAY_SIZE(blend_equation_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown blend equation %d", equation);
|
LOG_CRITICAL(Render_OpenGL, "Unknown blend equation %d", static_cast<int>(equation));
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
return GL_FUNC_ADD;
|
return GL_FUNC_ADD;
|
||||||
@ -119,7 +119,7 @@ inline GLenum BlendFunc(Pica::FramebufferRegs::BlendFactor factor) {
|
|||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if (static_cast<size_t>(factor) >= ARRAY_SIZE(blend_func_table)) {
|
if (static_cast<size_t>(factor) >= ARRAY_SIZE(blend_func_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown blend factor %d", factor);
|
LOG_CRITICAL(Render_OpenGL, "Unknown blend factor %d", static_cast<int>(factor));
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
return GL_ONE;
|
return GL_ONE;
|
||||||
@ -150,7 +150,7 @@ inline GLenum LogicOp(Pica::FramebufferRegs::LogicOp op) {
|
|||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if (static_cast<size_t>(op) >= ARRAY_SIZE(logic_op_table)) {
|
if (static_cast<size_t>(op) >= ARRAY_SIZE(logic_op_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown logic op %d", op);
|
LOG_CRITICAL(Render_OpenGL, "Unknown logic op %d", static_cast<int>(op));
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
return GL_COPY;
|
return GL_COPY;
|
||||||
@ -173,7 +173,7 @@ inline GLenum CompareFunc(Pica::FramebufferRegs::CompareFunc func) {
|
|||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if (static_cast<size_t>(func) >= ARRAY_SIZE(compare_func_table)) {
|
if (static_cast<size_t>(func) >= ARRAY_SIZE(compare_func_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown compare function %d", func);
|
LOG_CRITICAL(Render_OpenGL, "Unknown compare function %d", static_cast<int>(func));
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
return GL_ALWAYS;
|
return GL_ALWAYS;
|
||||||
@ -196,7 +196,7 @@ inline GLenum StencilOp(Pica::FramebufferRegs::StencilAction action) {
|
|||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if (static_cast<size_t>(action) >= ARRAY_SIZE(stencil_op_table)) {
|
if (static_cast<size_t>(action) >= ARRAY_SIZE(stencil_op_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown stencil op %d", action);
|
LOG_CRITICAL(Render_OpenGL, "Unknown stencil op %d", static_cast<int>(action));
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
return GL_KEEP;
|
return GL_KEEP;
|
||||||
|
@ -808,7 +808,7 @@ void JitShader::Compile_NextInstr() {
|
|||||||
} else {
|
} else {
|
||||||
// Unhandled instruction
|
// Unhandled instruction
|
||||||
LOG_CRITICAL(HW_GPU, "Unhandled instruction: 0x%02x (0x%08x)",
|
LOG_CRITICAL(HW_GPU, "Unhandled instruction: 0x%02x (0x%08x)",
|
||||||
instr.opcode.Value().EffectiveOpCode(), instr.hex);
|
static_cast<u32>(instr.opcode.Value().EffectiveOpCode()), instr.hex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ void DrawPixel(int x, int y, const Math::Vec4<u8>& color) {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x",
|
LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x",
|
||||||
framebuffer.color_format.Value());
|
static_cast<u32>(framebuffer.color_format.Value()));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ const Math::Vec4<u8> GetPixel(int x, int y) {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x",
|
LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x",
|
||||||
framebuffer.color_format.Value());
|
static_cast<u32>(framebuffer.color_format.Value()));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,8 @@ u32 GetDepth(int x, int y) {
|
|||||||
case FramebufferRegs::DepthFormat::D24S8:
|
case FramebufferRegs::DepthFormat::D24S8:
|
||||||
return Color::DecodeD24S8(src_pixel).x;
|
return Color::DecodeD24S8(src_pixel).x;
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", framebuffer.depth_format);
|
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u",
|
||||||
|
static_cast<u32>(framebuffer.depth_format));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -151,7 +152,7 @@ u8 GetStencil(int x, int y) {
|
|||||||
LOG_WARNING(
|
LOG_WARNING(
|
||||||
HW_GPU,
|
HW_GPU,
|
||||||
"GetStencil called for function which doesn't have a stencil component (format %u)",
|
"GetStencil called for function which doesn't have a stencil component (format %u)",
|
||||||
framebuffer.depth_format);
|
static_cast<int>(framebuffer.depth_format));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -184,7 +185,8 @@ void SetDepth(int x, int y, u32 value) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", framebuffer.depth_format);
|
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u",
|
||||||
|
static_cast<u32>(framebuffer.depth_format));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -215,7 +217,8 @@ void SetStencil(int x, int y, u8 value) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u", framebuffer.depth_format);
|
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u",
|
||||||
|
static_cast<u32>(framebuffer.depth_format));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -250,7 +253,7 @@ u8 PerformStencilAction(FramebufferRegs::StencilAction action, u8 old_stencil, u
|
|||||||
return old_stencil - 1;
|
return old_stencil - 1;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unknown stencil action %x", (int)action);
|
LOG_CRITICAL(HW_GPU, "Unknown stencil action %x", static_cast<int>(action));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -294,7 +297,7 @@ Math::Vec4<u8> EvaluateBlendEquation(const Math::Vec4<u8>& src, const Math::Vec4
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unknown RGB blend equation %x", equation);
|
LOG_CRITICAL(HW_GPU, "Unknown RGB blend equation %x", static_cast<u32>(equation));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,8 +309,10 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
|
|||||||
(texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder &&
|
(texture.config.wrap_t == TexturingRegs::TextureConfig::ClampToBorder &&
|
||||||
(t < 0 || static_cast<u32>(t) >= texture.config.height))) {
|
(t < 0 || static_cast<u32>(t) >= texture.config.height))) {
|
||||||
auto border_color = texture.config.border_color;
|
auto border_color = texture.config.border_color;
|
||||||
texture_color[i] = {border_color.r, border_color.g, border_color.b,
|
texture_color[i] = {static_cast<u8>(border_color.r),
|
||||||
border_color.a};
|
static_cast<u8>(border_color.r),
|
||||||
|
static_cast<u8>(border_color.r),
|
||||||
|
static_cast<u8>(border_color.r)};
|
||||||
} else {
|
} else {
|
||||||
// Textures are laid out from bottom to top, hence we invert the t coordinate.
|
// Textures are laid out from bottom to top, hence we invert the t coordinate.
|
||||||
// NOTE: This may not be the right place for the inversion.
|
// NOTE: This may not be the right place for the inversion.
|
||||||
@ -342,10 +344,10 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
|
|||||||
Math::Vec4<u8> combiner_output;
|
Math::Vec4<u8> combiner_output;
|
||||||
Math::Vec4<u8> combiner_buffer = {0, 0, 0, 0};
|
Math::Vec4<u8> combiner_buffer = {0, 0, 0, 0};
|
||||||
Math::Vec4<u8> next_combiner_buffer = {
|
Math::Vec4<u8> next_combiner_buffer = {
|
||||||
regs.texturing.tev_combiner_buffer_color.r,
|
static_cast<u8>(regs.texturing.tev_combiner_buffer_color.r),
|
||||||
regs.texturing.tev_combiner_buffer_color.g,
|
static_cast<u8>(regs.texturing.tev_combiner_buffer_color.g),
|
||||||
regs.texturing.tev_combiner_buffer_color.b,
|
static_cast<u8>(regs.texturing.tev_combiner_buffer_color.b),
|
||||||
regs.texturing.tev_combiner_buffer_color.a,
|
static_cast<u8>(regs.texturing.tev_combiner_buffer_color.a),
|
||||||
};
|
};
|
||||||
|
|
||||||
for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
|
for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
|
||||||
@ -378,8 +380,10 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
|
|||||||
return combiner_buffer;
|
return combiner_buffer;
|
||||||
|
|
||||||
case Source::Constant:
|
case Source::Constant:
|
||||||
return {tev_stage.const_r, tev_stage.const_g, tev_stage.const_b,
|
return {static_cast<u8>(tev_stage.const_r),
|
||||||
tev_stage.const_a};
|
static_cast<u8>(tev_stage.const_g),
|
||||||
|
static_cast<u8>(tev_stage.const_b),
|
||||||
|
static_cast<u8>(tev_stage.const_a)};
|
||||||
|
|
||||||
case Source::Previous:
|
case Source::Previous:
|
||||||
return combiner_output;
|
return combiner_output;
|
||||||
@ -697,7 +701,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
|
|||||||
return std::min(combiner_output.a(), static_cast<u8>(255 - dest.a()));
|
return std::min(combiner_output.a(), static_cast<u8>(255 - dest.a()));
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_CRITICAL(HW_GPU, "Unknown blend factor %x", factor);
|
LOG_CRITICAL(HW_GPU, "Unknown blend factor %x", static_cast<u32>(factor));
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user