summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common/file_util.cpp18
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp21
-rw-r--r--src/core/hle/svc.cpp2
3 files changed, 24 insertions, 17 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 4c7113390..052c0ecd6 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -427,6 +427,9 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo
// How many files + directories we found
unsigned found_entries = 0;
+ // Save the status of callback function
+ bool callback_error = false;
+
#ifdef _WIN32
// Find the first file in the directory.
WIN32_FIND_DATA ffd;
@@ -455,8 +458,10 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo
continue;
unsigned ret_entries;
- if (!callback(&ret_entries, directory, virtual_name))
+ if (!callback(&ret_entries, directory, virtual_name)) {
+ callback_error = true;
break;
+ }
found_entries += ret_entries;
#ifdef _WIN32
@@ -467,9 +472,14 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo
closedir(dirp);
#endif
- // num_entries_out is allowed to be specified nullptr, in which case we shouldn't try to set it
- if (num_entries_out != nullptr)
- *num_entries_out = found_entries;
+ if (!callback_error) {
+ // num_entries_out is allowed to be specified nullptr, in which case we shouldn't try to set it
+ if (num_entries_out != nullptr)
+ *num_entries_out = found_entries;
+ return true;
+ } else {
+ return false;
+ }
}
unsigned ScanDirectoryTree(const std::string &directory, FSTEntry& parent_entry)
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index 459877eae..87b2b715b 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -4696,18 +4696,15 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) {
mrc_inst* inst_cream = (mrc_inst*)inst_base->component;
- unsigned int inst = inst_cream->inst;
- if (inst_cream->Rd == 15) {
- DEBUG_MSG;
- }
- if (inst_cream->inst == 0xeef04a10) {
- // Undefined instruction fmrx
- RD = 0x20000000;
- CITRA_IGNORE_EXIT(-1);
- goto END;
- } else {
- if (inst_cream->cp_num == 15)
- RD = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2);
+ if (inst_cream->cp_num == 15) {
+ const uint32_t value = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2);
+
+ if (inst_cream->Rd == 15) {
+ cpu->Cpsr = (cpu->Cpsr & ~0xF0000000) | (value & 0xF0000000);
+ LOAD_NZCVT;
+ } else {
+ RD = value;
+ }
}
}
cpu->Reg[15] += cpu->GetInstructionSize();
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 9acebeb36..e39edcc16 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -807,7 +807,7 @@ static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) {
}
break;
case SystemInfoType::KERNEL_ALLOCATED_PAGES:
- LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param=%d", type, param);
+ LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param=%d", param);
*out = 0;
break;
case SystemInfoType::KERNEL_SPAWNED_PIDS: