mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Fix some bugs and warnings from a pass of static analysis
This commit is contained in:
@@ -896,7 +896,10 @@ void ARM64XEmitter::SetJumpTarget(FixupBranch const& branch)
|
|||||||
switch (branch.type)
|
switch (branch.type)
|
||||||
{
|
{
|
||||||
case 1: // CBNZ
|
case 1: // CBNZ
|
||||||
|
{
|
||||||
Not = true;
|
Not = true;
|
||||||
|
[[fallthrough]];
|
||||||
|
}
|
||||||
case 0: // CBZ
|
case 0: // CBZ
|
||||||
{
|
{
|
||||||
_assert_msg_(IsInRangeImm19(distance), "%s(%d): Received too large distance: %llx", __FUNCTION__, branch.type, distance);
|
_assert_msg_(IsInRangeImm19(distance), "%s(%d): Received too large distance: %llx", __FUNCTION__, branch.type, distance);
|
||||||
@@ -910,7 +913,10 @@ void ARM64XEmitter::SetJumpTarget(FixupBranch const& branch)
|
|||||||
inst = (0x2A << 25) | (MaskImm19(distance) << 5) | branch.cond;
|
inst = (0x2A << 25) | (MaskImm19(distance) << 5) | branch.cond;
|
||||||
break;
|
break;
|
||||||
case 4: // TBNZ
|
case 4: // TBNZ
|
||||||
|
{
|
||||||
Not = true;
|
Not = true;
|
||||||
|
[[fallthrough]];
|
||||||
|
}
|
||||||
case 3: // TBZ
|
case 3: // TBZ
|
||||||
{
|
{
|
||||||
_assert_msg_(IsInRangeImm14(distance), "%s(%d): Received too large distance: %llx", __FUNCTION__, branch.type, distance);
|
_assert_msg_(IsInRangeImm14(distance), "%s(%d): Received too large distance: %llx", __FUNCTION__, branch.type, distance);
|
||||||
|
|||||||
@@ -1166,6 +1166,7 @@ void ARMXEmitter::WriteStoreOp(u32 Op, ARMReg Rt, ARMReg Rn, Operand2 Rm, bool R
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Intentional fallthrough: TYPE_IMMSREG not supported for misc addressing.
|
// Intentional fallthrough: TYPE_IMMSREG not supported for misc addressing.
|
||||||
|
[[fallthrough]];
|
||||||
default:
|
default:
|
||||||
// RSR not supported for any of these
|
// RSR not supported for any of these
|
||||||
// We already have the warning above
|
// We already have the warning above
|
||||||
|
|||||||
@@ -1771,6 +1771,7 @@ bool D3D11DrawContext::CopyFramebufferToMemory(Framebuffer *src, Aspect channelB
|
|||||||
case Aspect::STENCIL_BIT:
|
case Aspect::STENCIL_BIT:
|
||||||
if (!fb)
|
if (!fb)
|
||||||
return false;
|
return false;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,9 +213,9 @@ bool CheckGLExtensions() {
|
|||||||
// Start by assuming we're at 2.0.
|
// Start by assuming we're at 2.0.
|
||||||
int parsed[2] = {2, 0};
|
int parsed[2] = {2, 0};
|
||||||
{ // Grab the version and attempt to parse.
|
{ // Grab the version and attempt to parse.
|
||||||
char buffer[128] = { 0 };
|
char buffer[128]{};
|
||||||
strncpy(buffer, versionStr, sizeof(buffer) - 1);
|
truncate_cpy(buffer, versionStr);
|
||||||
|
|
||||||
const int len = (int)strlen(buffer);
|
const int len = (int)strlen(buffer);
|
||||||
bool beforeDot = true;
|
bool beforeDot = true;
|
||||||
int lastDigit = 0;
|
int lastDigit = 0;
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ TabHolder::TabHolder(Orientation orientation, float stripSize, TabHolderFlags fl
|
|||||||
void TabHolder::AddBack(UIScreen *parent) {
|
void TabHolder::AddBack(UIScreen *parent) {
|
||||||
if (tabContainer_) {
|
if (tabContainer_) {
|
||||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||||
|
tabContainer_->Add(new UI::Spacer(8.0f));
|
||||||
tabContainer_->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK"), new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 0.0f, Margins(0, 0, 10, 10))))->OnClick.Handle<UIScreen>(parent, &UIScreen::OnBack);
|
tabContainer_->Add(new Choice(di->T("Back"), ImageID("I_NAVIGATE_BACK"), new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 0.0f, Margins(0, 0, 10, 10))))->OnClick.Handle<UIScreen>(parent, &UIScreen::OnBack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,8 +243,10 @@ void MemSlabMap::DoState(PointerWrap &p) {
|
|||||||
|
|
||||||
Slab *slab = first_;
|
Slab *slab = first_;
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
slab->next->DoState(p);
|
if (slab->next) {
|
||||||
slab = slab->next;
|
slab->next->DoState(p);
|
||||||
|
slab = slab->next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ void WebSocketCPUGetReg(DebuggerRequest &req) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int cat, reg;
|
int cat, reg;
|
||||||
uint32_t val;
|
uint32_t val = 0;
|
||||||
switch (ValidateCatReg(req, &cat, ®)) {
|
switch (ValidateCatReg(req, &cat, ®)) {
|
||||||
case DebuggerRegType::NORMAL:
|
case DebuggerRegType::NORMAL:
|
||||||
val = cpuDebug->GetRegValue(cat, reg);
|
val = cpuDebug->GetRegValue(cat, reg);
|
||||||
|
|||||||
@@ -1285,6 +1285,9 @@ static u32 sceIoWrite(int id, u32 data_addr, int size) {
|
|||||||
int us;
|
int us;
|
||||||
bool complete = __IoWrite(result, id, data_addr, size, us);
|
bool complete = __IoWrite(result, id, data_addr, size, us);
|
||||||
if (!complete) {
|
if (!complete) {
|
||||||
|
if (!f) {
|
||||||
|
return hleLogError(Log::sceIo, error, "bad file descriptor");
|
||||||
|
}
|
||||||
__IoSchedSync(f, id, us);
|
__IoSchedSync(f, id, us);
|
||||||
__KernelWaitCurThread(WAITTYPE_IO, id, 0, 0, false, "io write");
|
__KernelWaitCurThread(WAITTYPE_IO, id, 0, 0, false, "io write");
|
||||||
f->waitingSyncThreads.push_back(__KernelGetCurThread());
|
f->waitingSyncThreads.push_back(__KernelGetCurThread());
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ struct VTimer : public KernelObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NativeVTimer nvt;
|
NativeVTimer nvt{};
|
||||||
};
|
};
|
||||||
|
|
||||||
KernelObject *__KernelVTimerObject() {
|
KernelObject *__KernelVTimerObject() {
|
||||||
return new VTimer;
|
return new VTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
static u64 __getVTimerRunningTime(const VTimer *vt) {
|
static u64 __getVTimerRunningTime(const VTimer *vt) {
|
||||||
|
|||||||
@@ -1189,10 +1189,9 @@ int DoBlockingPtpConnect(AdhocSocketRequest& req, s64& result, AdhocSendTargets&
|
|||||||
}
|
}
|
||||||
|
|
||||||
int sockerr = 0, ret;
|
int sockerr = 0, ret;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin{};
|
||||||
// Try to connect again if the first attempt failed due to remote side was not listening yet (ie. ECONNREFUSED or ETIMEDOUT)
|
// Try to connect again if the first attempt failed due to remote side was not listening yet (ie. ECONNREFUSED or ETIMEDOUT)
|
||||||
if (ptpsocket.state == ADHOC_PTP_STATE_CLOSED) {
|
if (ptpsocket.state == ADHOC_PTP_STATE_CLOSED) {
|
||||||
memset(&sin, 0, sizeof(sin));
|
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
sin.sin_addr.s_addr = targetPeer.peers[0].ip;
|
sin.sin_addr.s_addr = targetPeer.peers[0].ip;
|
||||||
sin.sin_port = htons(ptpsocket.pport + targetPeer.peers[0].portOffset);
|
sin.sin_port = htons(ptpsocket.pport + targetPeer.peers[0].portOffset);
|
||||||
@@ -1247,7 +1246,6 @@ int DoBlockingPtpConnect(AdhocSocketRequest& req, s64& result, AdhocSendTargets&
|
|||||||
// Check whether the connection has been established or not
|
// Check whether the connection has been established or not
|
||||||
if (!serverHasRelay && ret != SOCKET_ERROR) {
|
if (!serverHasRelay && ret != SOCKET_ERROR) {
|
||||||
socklen_t sinlen = sizeof(sin);
|
socklen_t sinlen = sizeof(sin);
|
||||||
memset(&sin, 0, sinlen);
|
|
||||||
// Note: "getpeername" shouldn't failed if the connection has been established, but on Windows it may succeed even when "connect" is still in-progress and not accepted yet (ie. "Tales of VS" on Windows)
|
// Note: "getpeername" shouldn't failed if the connection has been established, but on Windows it may succeed even when "connect" is still in-progress and not accepted yet (ie. "Tales of VS" on Windows)
|
||||||
ret = getpeername(ptpsocket.id, (struct sockaddr*)&sin, &sinlen);
|
ret = getpeername(ptpsocket.id, (struct sockaddr*)&sin, &sinlen);
|
||||||
if (ret == SOCKET_ERROR) {
|
if (ret == SOCKET_ERROR) {
|
||||||
|
|||||||
@@ -528,6 +528,7 @@ namespace MIPSInt
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 4: //mtc1
|
case 4: //mtc1
|
||||||
FI(fs) = R(rt);
|
FI(fs) = R(rt);
|
||||||
|
|||||||
@@ -595,6 +595,8 @@ bool Jit::ReplaceJalTo(u32 dest) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Jit::Comp_ReplacementFunc(MIPSOpcode op) {
|
void Jit::Comp_ReplacementFunc(MIPSOpcode op) {
|
||||||
// We get here if we execute the first instruction of a replaced function. This means
|
// We get here if we execute the first instruction of a replaced function. This means
|
||||||
// that we do need to return to RA.
|
// that we do need to return to RA.
|
||||||
|
|||||||
@@ -2627,7 +2627,7 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst
|
|||||||
if (PSP_CoreParameter().compat.flags().BlockTransferAllowCreateFB ||
|
if (PSP_CoreParameter().compat.flags().BlockTransferAllowCreateFB ||
|
||||||
GetSkipGPUReadbackMode() == SkipGPUReadbackMode::COPY_TO_TEXTURE ||
|
GetSkipGPUReadbackMode() == SkipGPUReadbackMode::COPY_TO_TEXTURE ||
|
||||||
(PSP_CoreParameter().compat.flags().IntraVRAMBlockTransferAllowCreateFB &&
|
(PSP_CoreParameter().compat.flags().IntraVRAMBlockTransferAllowCreateFB &&
|
||||||
Memory::IsVRAMAddress(srcRect.vfb->fb_address) && Memory::IsVRAMAddress(dstBasePtr))) {
|
(srcRect.vfb && Memory::IsVRAMAddress(srcRect.vfb->fb_address)) && Memory::IsVRAMAddress(dstBasePtr))) {
|
||||||
GEBufferFormat ramFormat;
|
GEBufferFormat ramFormat;
|
||||||
// Try to guess the appropriate format. We only know the bpp from the block transfer command (16 or 32 bit).
|
// Try to guess the appropriate format. We only know the bpp from the block transfer command (16 or 32 bit).
|
||||||
if (srcRect.channel == RASTER_COLOR) {
|
if (srcRect.channel == RASTER_COLOR) {
|
||||||
@@ -2719,9 +2719,11 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Getting to the more complex cases. Have not actually seen much of these yet.
|
// Getting to the more complex cases. Have not actually seen much of these yet.
|
||||||
WARN_LOG_N_TIMES(blockformat, 5, Log::G3D, "Mismatched buffer formats in block transfer: %s->%s (%dx%d)",
|
if (srcRect.vfb && dstRect.vfb) {
|
||||||
GeBufferFormatToString(srcRect.vfb->Format(srcRect.channel)), GeBufferFormatToString(dstRect.vfb->Format(dstRect.channel)),
|
WARN_LOG_N_TIMES(blockformat, 5, Log::G3D, "Mismatched buffer formats in block transfer: %s->%s (%dx%d)",
|
||||||
width, height);
|
GeBufferFormatToString(srcRect.vfb->Format(srcRect.channel)), GeBufferFormatToString(dstRect.vfb->Format(dstRect.channel)),
|
||||||
|
width, height);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
@@ -2753,7 +2755,7 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst
|
|||||||
srcBasePtr, srcRect.x_bytes / bpp, srcRect.y, srcStride,
|
srcBasePtr, srcRect.x_bytes / bpp, srcRect.y, srcStride,
|
||||||
dstBasePtr, dstRect.x_bytes / bpp, dstRect.y, dstStride);
|
dstBasePtr, dstRect.x_bytes / bpp, dstRect.y, dstStride);
|
||||||
FlushBeforeCopy();
|
FlushBeforeCopy();
|
||||||
if (GetSkipGPUReadbackMode() == SkipGPUReadbackMode::NO_SKIP && !srcRect.vfb->memoryUpdated) {
|
if (GetSkipGPUReadbackMode() == SkipGPUReadbackMode::NO_SKIP && srcRect.vfb && !srcRect.vfb->memoryUpdated) {
|
||||||
const int srcBpp = BufferFormatBytesPerPixel(srcRect.vfb->fb_format);
|
const int srcBpp = BufferFormatBytesPerPixel(srcRect.vfb->fb_format);
|
||||||
const float srcXFactor = (float)bpp / srcBpp;
|
const float srcXFactor = (float)bpp / srcBpp;
|
||||||
const bool tooTall = srcY + srcRect.h > srcRect.vfb->bufferHeight;
|
const bool tooTall = srcY + srcRect.h > srcRect.vfb->bufferHeight;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ struct DecVtxFormat {
|
|||||||
|
|
||||||
void GetIndexBounds(const void *inds, int count, u32 vertType, u16 *indexLowerBound, u16 *indexUpperBound);
|
void GetIndexBounds(const void *inds, int count, u32 vertType, u16 *indexLowerBound, u16 *indexUpperBound);
|
||||||
|
|
||||||
inline int RoundUp4(int x) {
|
inline int constexpr RoundUp4(int x) {
|
||||||
return (x + 3) & ~3;
|
return (x + 3) & ~3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -431,8 +431,8 @@ struct GPUgstate {
|
|||||||
|
|
||||||
bool vertTypeIsSkinningEnabled(u32 vertType);
|
bool vertTypeIsSkinningEnabled(u32 vertType);
|
||||||
|
|
||||||
inline int vertTypeGetNumBoneWeights(u32 vertType) { return 1 + ((vertType & GE_VTYPE_WEIGHTCOUNT_MASK) >> GE_VTYPE_WEIGHTCOUNT_SHIFT); }
|
inline constexpr int vertTypeGetNumBoneWeights(u32 vertType) { return 1 + ((vertType & GE_VTYPE_WEIGHTCOUNT_MASK) >> GE_VTYPE_WEIGHTCOUNT_SHIFT); }
|
||||||
inline int vertTypeGetWeightMask(u32 vertType) { return vertType & GE_VTYPE_WEIGHT_MASK; }
|
inline constexpr int vertTypeGetWeightMask(u32 vertType) { return vertType & GE_VTYPE_WEIGHT_MASK; }
|
||||||
|
|
||||||
// The rest is cached simplified/converted data for fast access.
|
// The rest is cached simplified/converted data for fast access.
|
||||||
// Does not need to be saved when saving/restoring context.
|
// Does not need to be saved when saving/restoring context.
|
||||||
|
|||||||
@@ -590,6 +590,7 @@ std::string DescribeSamplerID(const SamplerID &id) {
|
|||||||
break;
|
break;
|
||||||
case GE_TEXFUNC_ADD:
|
case GE_TEXFUNC_ADD:
|
||||||
name += ":ADD";
|
name += ":ADD";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -501,7 +501,7 @@ void ImGePixelViewer::UpdateTexture(Draw::DrawContext *draw) {
|
|||||||
case GE_FORMAT_5551:
|
case GE_FORMAT_5551:
|
||||||
if (showAlpha) {
|
if (showAlpha) {
|
||||||
uint32_t *dst32 = (uint32_t *)dst;
|
uint32_t *dst32 = (uint32_t *)dst;
|
||||||
uint16_t *src16 = (uint16_t *)dst;
|
const uint16_t *src16 = (const uint16_t *)src;
|
||||||
for (int x = 0; x < width; x++) {
|
for (int x = 0; x < width; x++) {
|
||||||
dst32[x] = (src16[x] >> 15) ? 0xFFFFFFFF : 0xFF000000;
|
dst32[x] = (src16[x] >> 15) ? 0xFFFFFFFF : 0xFF000000;
|
||||||
}
|
}
|
||||||
@@ -514,7 +514,7 @@ void ImGePixelViewer::UpdateTexture(Draw::DrawContext *draw) {
|
|||||||
break;
|
break;
|
||||||
case GE_FORMAT_DEPTH16:
|
case GE_FORMAT_DEPTH16:
|
||||||
{
|
{
|
||||||
uint16_t *src16 = (uint16_t *)src;
|
const uint16_t *src16 = (const uint16_t *)src;
|
||||||
float scale = this->scale / 256.0f;
|
float scale = this->scale / 256.0f;
|
||||||
for (int x = 0; x < width; x++) {
|
for (int x = 0; x < width; x++) {
|
||||||
// Just pick off the upper bits by adding 1 to the byte address
|
// Just pick off the upper bits by adding 1 to the byte address
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ static void DrawBuiltInContent(const BuiltIn &builtIn, const u32 address) {
|
|||||||
break;
|
break;
|
||||||
case BuiltInType::Void:
|
case BuiltInType::Void:
|
||||||
ImGui::Text("<void type>");
|
ImGui::Text("<void type>");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -287,7 +287,7 @@ void GameButton::Draw(UIContext &dc) {
|
|||||||
switch (ginfo->fileType) {
|
switch (ginfo->fileType) {
|
||||||
case IdentifiedFileType::UNKNOWN_ELF: imageIcon = ImageID("I_DEBUGGER"); break;
|
case IdentifiedFileType::UNKNOWN_ELF: imageIcon = ImageID("I_DEBUGGER"); break;
|
||||||
case IdentifiedFileType::PPSSPP_GE_DUMP: imageIcon = ImageID("I_DISPLAY"); break;
|
case IdentifiedFileType::PPSSPP_GE_DUMP: imageIcon = ImageID("I_DISPLAY"); break;
|
||||||
case IdentifiedFileType::PSX_ISO: imageIcon = ImageID("I_PSX_ISO"); break;
|
case IdentifiedFileType::PSX_ISO:
|
||||||
case IdentifiedFileType::PSP_PS1_PBP: imageIcon = ImageID("I_PSX_ISO"); break;
|
case IdentifiedFileType::PSP_PS1_PBP: imageIcon = ImageID("I_PSX_ISO"); break;
|
||||||
case IdentifiedFileType::PS2_ISO: imageIcon = ImageID("I_PS2_ISO"); break;
|
case IdentifiedFileType::PS2_ISO: imageIcon = ImageID("I_PS2_ISO"); break;
|
||||||
case IdentifiedFileType::PS3_ISO: imageIcon = ImageID("I_PS3_ISO"); break;
|
case IdentifiedFileType::PS3_ISO: imageIcon = ImageID("I_PS3_ISO"); break;
|
||||||
@@ -296,6 +296,7 @@ void GameButton::Draw(UIContext &dc) {
|
|||||||
case IdentifiedFileType::PPSSPP_SAVESTATE:
|
case IdentifiedFileType::PPSSPP_SAVESTATE:
|
||||||
case IdentifiedFileType::ERROR_IDENTIFYING:
|
case IdentifiedFileType::ERROR_IDENTIFYING:
|
||||||
case IdentifiedFileType::UNKNOWN_BIN: imageIcon = ImageID("I_FILE"); break;
|
case IdentifiedFileType::UNKNOWN_BIN: imageIcon = ImageID("I_FILE"); break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imageIcon.isValid()) {
|
if (imageIcon.isValid()) {
|
||||||
|
|||||||
+11
-12
@@ -35,7 +35,7 @@ void SystemInfoScreen::update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: How can we de-duplicate this and SystemInfoScreen::CreateTabs?
|
// TODO: How can we de-duplicate this and SystemInfoScreen::CreateTabs?
|
||||||
void SystemInfoScreen::CopySummaryToClipboard(UI::EventParams &e) {
|
static void CopySummaryToClipboard(Draw::DrawContext *draw) {
|
||||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||||
auto si = GetI18NCategory(I18NCat::DIALOG);
|
auto si = GetI18NCategory(I18NCat::DIALOG);
|
||||||
|
|
||||||
@@ -56,7 +56,6 @@ void SystemInfoScreen::CopySummaryToClipboard(UI::EventParams &e) {
|
|||||||
std::string board = System_GetProperty(SYSPROP_BOARDNAME);
|
std::string board = System_GetProperty(SYSPROP_BOARDNAME);
|
||||||
if (!board.empty())
|
if (!board.empty())
|
||||||
w.C("Board: ").W(board).endl();
|
w.C("Board: ").W(board).endl();
|
||||||
Draw::DrawContext *draw = screenManager()->getDrawContext();
|
|
||||||
w.C("3D API: ").W(draw->GetInfoString(Draw::InfoField::APINAME)).endl();
|
w.C("3D API: ").W(draw->GetInfoString(Draw::InfoField::APINAME)).endl();
|
||||||
w.C("API version: ").W(draw->GetInfoString(Draw::InfoField::APIVERSION)).endl();
|
w.C("API version: ").W(draw->GetInfoString(Draw::InfoField::APIVERSION)).endl();
|
||||||
w.C("Device API version: ").W(draw->GetInfoString(Draw::InfoField::DEVICE_API_VERSION)).endl();
|
w.C("Device API version: ").W(draw->GetInfoString(Draw::InfoField::DEVICE_API_VERSION)).endl();
|
||||||
@@ -117,7 +116,9 @@ void SystemInfoScreen::CreateDeviceInfoTab(UI::LinearLayout *deviceSpecs) {
|
|||||||
|
|
||||||
UI::CollapsibleSection *systemInfo = deviceSpecs->Add(new UI::CollapsibleSection(si->T("System Information")));
|
UI::CollapsibleSection *systemInfo = deviceSpecs->Add(new UI::CollapsibleSection(si->T("System Information")));
|
||||||
|
|
||||||
systemInfo->Add(new Choice(si->T("Copy summary to clipboard"), ImageID("I_FILE_COPY")))->OnClick.Handle(this, &SystemInfoScreen::CopySummaryToClipboard);
|
Draw::DrawContext *draw = screenManager()->getDrawContext();
|
||||||
|
|
||||||
|
systemInfo->Add(new Choice(si->T("Copy summary to clipboard"), ImageID("I_FILE_COPY")))->OnClick.Add([draw](UI::EventParams &e) { CopySummaryToClipboard(draw); });
|
||||||
systemInfo->Add(new InfoItem(si->T("System Name"), System_GetProperty(SYSPROP_NAME)));
|
systemInfo->Add(new InfoItem(si->T("System Name"), System_GetProperty(SYSPROP_NAME)));
|
||||||
#if PPSSPP_PLATFORM(ANDROID)
|
#if PPSSPP_PLATFORM(ANDROID)
|
||||||
systemInfo->Add(new InfoItem(si->T("System Version"), StringFromInt(System_GetPropertyInt(SYSPROP_SYSTEMVERSION))));
|
systemInfo->Add(new InfoItem(si->T("System Version"), StringFromInt(System_GetPropertyInt(SYSPROP_SYSTEMVERSION))));
|
||||||
@@ -139,7 +140,7 @@ void SystemInfoScreen::CreateDeviceInfoTab(UI::LinearLayout *deviceSpecs) {
|
|||||||
UI::CollapsibleSection *cpuInfo = deviceSpecs->Add(new UI::CollapsibleSection(si->T("CPU Information")));
|
UI::CollapsibleSection *cpuInfo = deviceSpecs->Add(new UI::CollapsibleSection(si->T("CPU Information")));
|
||||||
|
|
||||||
// Don't bother showing the CPU name if we don't have one.
|
// Don't bother showing the CPU name if we don't have one.
|
||||||
if (strcmp(cpu_info.brand_string, "Unknown") != 0) {
|
if (equals(cpu_info.brand_string, "Unknown")) {
|
||||||
cpuInfo->Add(new InfoItem(si->T("CPU Name"), cpu_info.brand_string));
|
cpuInfo->Add(new InfoItem(si->T("CPU Name"), cpu_info.brand_string));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,8 +153,6 @@ void SystemInfoScreen::CreateDeviceInfoTab(UI::LinearLayout *deviceSpecs) {
|
|||||||
|
|
||||||
CollapsibleSection *gpuInfo = deviceSpecs->Add(new CollapsibleSection(si->T("GPU Information")));
|
CollapsibleSection *gpuInfo = deviceSpecs->Add(new CollapsibleSection(si->T("GPU Information")));
|
||||||
|
|
||||||
DrawContext *draw = screenManager()->getDrawContext();
|
|
||||||
|
|
||||||
const std::string apiNameKey = draw->GetInfoString(InfoField::APINAME);
|
const std::string apiNameKey = draw->GetInfoString(InfoField::APINAME);
|
||||||
std::string_view apiName = gr->T(apiNameKey);
|
std::string_view apiName = gr->T(apiNameKey);
|
||||||
gpuInfo->Add(new InfoItem(si->T("3D API"), apiName));
|
gpuInfo->Add(new InfoItem(si->T("3D API"), apiName));
|
||||||
@@ -177,10 +176,10 @@ void SystemInfoScreen::CreateDeviceInfoTab(UI::LinearLayout *deviceSpecs) {
|
|||||||
#endif
|
#endif
|
||||||
if (GetGPUBackend() == GPUBackend::OPENGL) {
|
if (GetGPUBackend() == GPUBackend::OPENGL) {
|
||||||
gpuInfo->Add(new InfoItem(si->T("Core Context"), gl_extensions.IsCoreContext ? di->T("Active") : di->T("Inactive")));
|
gpuInfo->Add(new InfoItem(si->T("Core Context"), gl_extensions.IsCoreContext ? di->T("Active") : di->T("Inactive")));
|
||||||
int highp_int_min = gl_extensions.range[1][5][0];
|
const int highp_int_min = gl_extensions.range[1][5][0];
|
||||||
int highp_int_max = gl_extensions.range[1][5][1];
|
const int highp_int_max = gl_extensions.range[1][5][1];
|
||||||
int highp_float_min = gl_extensions.range[1][2][0];
|
const int highp_float_min = gl_extensions.range[1][2][0];
|
||||||
int highp_float_max = gl_extensions.range[1][2][1];
|
const int highp_float_max = gl_extensions.range[1][2][1];
|
||||||
if (highp_int_max != 0) {
|
if (highp_int_max != 0) {
|
||||||
char temp[128];
|
char temp[128];
|
||||||
snprintf(temp, sizeof(temp), "%d-%d", highp_int_min, highp_int_max);
|
snprintf(temp, sizeof(temp), "%d-%d", highp_int_min, highp_int_max);
|
||||||
@@ -188,7 +187,7 @@ void SystemInfoScreen::CreateDeviceInfoTab(UI::LinearLayout *deviceSpecs) {
|
|||||||
}
|
}
|
||||||
if (highp_float_max != 0) {
|
if (highp_float_max != 0) {
|
||||||
char temp[128];
|
char temp[128];
|
||||||
snprintf(temp, sizeof(temp), "%d-%d", highp_int_min, highp_int_max);
|
snprintf(temp, sizeof(temp), "%d-%d", highp_float_min, highp_float_max);
|
||||||
gpuInfo->Add(new InfoItem(si->T("High precision float range"), temp));
|
gpuInfo->Add(new InfoItem(si->T("High precision float range"), temp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,7 +281,7 @@ void SystemInfoScreen::CreateDeviceInfoTab(UI::LinearLayout *deviceSpecs) {
|
|||||||
if (draw->GetDeviceCaps().presentModesSupported & Draw::PresentMode::FIFO) presentModes += "FIFO, ";
|
if (draw->GetDeviceCaps().presentModesSupported & Draw::PresentMode::FIFO) presentModes += "FIFO, ";
|
||||||
if (draw->GetDeviceCaps().presentModesSupported & Draw::PresentMode::IMMEDIATE) presentModes += "IMMEDIATE, ";
|
if (draw->GetDeviceCaps().presentModesSupported & Draw::PresentMode::IMMEDIATE) presentModes += "IMMEDIATE, ";
|
||||||
if (draw->GetDeviceCaps().presentModesSupported & Draw::PresentMode::MAILBOX) presentModes += "MAILBOX, ";
|
if (draw->GetDeviceCaps().presentModesSupported & Draw::PresentMode::MAILBOX) presentModes += "MAILBOX, ";
|
||||||
if (!presentModes.empty()) {
|
if (presentModes.size() > 2) {
|
||||||
presentModes.pop_back();
|
presentModes.pop_back();
|
||||||
presentModes.pop_back();
|
presentModes.pop_back();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ public:
|
|||||||
void resized() override { RecreateViews(); }
|
void resized() override { RecreateViews(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void CopySummaryToClipboard(UI::EventParams &e);
|
|
||||||
bool ShowSearchControls() const override { return false; }
|
bool ShowSearchControls() const override { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ INT_PTR CALLBACK DumpMemoryWindow::dlgFunc(HWND hwnd, UINT iMsg, WPARAM wParam,
|
|||||||
EndDialog(hwnd,false);
|
EndDialog(hwnd,false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ static std::set<u32> DetectXInputVIDPIDs() {
|
|||||||
|
|
||||||
while (SUCCEEDED(pEnumDevices->Next(10000, 32, pDevices, &uReturned)) && uReturned > 0) {
|
while (SUCCEEDED(pEnumDevices->Next(10000, 32, pDevices, &uReturned)) && uReturned > 0) {
|
||||||
for (ULONG i = 0; i < uReturned; i++) {
|
for (ULONG i = 0; i < uReturned; i++) {
|
||||||
VARIANT var;
|
VARIANT var{};
|
||||||
if (SUCCEEDED(pDevices[i]->Get(L"DeviceID", 0, &var, nullptr, nullptr)))
|
if (SUCCEEDED(pDevices[i]->Get(L"DeviceID", 0, &var, nullptr, nullptr)))
|
||||||
{
|
{
|
||||||
if (wcsstr(var.bstrVal, L"IG_"))
|
if (wcsstr(var.bstrVal, L"IG_"))
|
||||||
|
|||||||
@@ -314,6 +314,7 @@ void CGEDebugger::SetupPreviews() {
|
|||||||
case ID_GEDBG_ENABLE_PREVIEW:
|
case ID_GEDBG_ENABLE_PREVIEW:
|
||||||
previewsEnabled_ ^= 1;
|
previewsEnabled_ ^= 1;
|
||||||
primaryWindow->Redraw();
|
primaryWindow->Redraw();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -362,6 +363,7 @@ void CGEDebugger::SetupPreviews() {
|
|||||||
case ID_GEDBG_ENABLE_PREVIEW:
|
case ID_GEDBG_ENABLE_PREVIEW:
|
||||||
previewsEnabled_ ^= 2;
|
previewsEnabled_ ^= 2;
|
||||||
secondWindow->Redraw();
|
secondWindow->Redraw();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -576,9 +578,11 @@ void CGEDebugger::UpdatePreviews() {
|
|||||||
UpdatePrimPreview(primOp, 3);
|
UpdatePrimPreview(primOp, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar_t primCounter[1024]{};
|
if (gpuDebug) {
|
||||||
swprintf(primCounter, ARRAY_SIZE(primCounter), L"%d/%d", gpuDebug->PrimsThisFrame(), gpuDebug->PrimsLastFrame());
|
wchar_t primCounter[1024]{};
|
||||||
SetDlgItemText(m_hDlg, IDC_GEDBG_PRIMCOUNTER, primCounter);
|
swprintf(primCounter, ARRAY_SIZE(primCounter), L"%d/%d", gpuDebug->PrimsThisFrame(), gpuDebug->PrimsLastFrame());
|
||||||
|
SetDlgItemText(m_hDlg, IDC_GEDBG_PRIMCOUNTER, primCounter);
|
||||||
|
}
|
||||||
|
|
||||||
for (GEDebuggerTab &tabState : tabStates_) {
|
for (GEDebuggerTab &tabState : tabStates_) {
|
||||||
UpdateTab(&tabState);
|
UpdateTab(&tabState);
|
||||||
|
|||||||
+10
-9
@@ -155,15 +155,16 @@ int jsonParse(char *s, char **endptr, JsonValue *value, JsonAllocator &allocator
|
|||||||
*endptr = s;
|
*endptr = s;
|
||||||
return JSON_BAD_NUMBER;
|
return JSON_BAD_NUMBER;
|
||||||
}
|
}
|
||||||
case '0':
|
[[fallthrough]];
|
||||||
case '1':
|
case '0': [[fallthrough]];
|
||||||
case '2':
|
case '1': [[fallthrough]];
|
||||||
case '3':
|
case '2': [[fallthrough]];
|
||||||
case '4':
|
case '3': [[fallthrough]];
|
||||||
case '5':
|
case '4': [[fallthrough]];
|
||||||
case '6':
|
case '5': [[fallthrough]];
|
||||||
case '7':
|
case '6': [[fallthrough]];
|
||||||
case '8':
|
case '7': [[fallthrough]];
|
||||||
|
case '8': [[fallthrough]];
|
||||||
case '9':
|
case '9':
|
||||||
o = JsonValue(string2double(*endptr, &s));
|
o = JsonValue(string2double(*endptr, &s));
|
||||||
if (!isdelim(*s)) {
|
if (!isdelim(*s)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user