diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/file_util.cpp | 18 | ||||
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 21 | ||||
| -rw-r--r-- | src/core/hle/svc.cpp | 2 |
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 | |||
| 427 | // How many files + directories we found | 427 | // How many files + directories we found |
| 428 | unsigned found_entries = 0; | 428 | unsigned found_entries = 0; |
| 429 | 429 | ||
| 430 | // Save the status of callback function | ||
| 431 | bool callback_error = false; | ||
| 432 | |||
| 430 | #ifdef _WIN32 | 433 | #ifdef _WIN32 |
| 431 | // Find the first file in the directory. | 434 | // Find the first file in the directory. |
| 432 | WIN32_FIND_DATA ffd; | 435 | WIN32_FIND_DATA ffd; |
| @@ -455,8 +458,10 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo | |||
| 455 | continue; | 458 | continue; |
| 456 | 459 | ||
| 457 | unsigned ret_entries; | 460 | unsigned ret_entries; |
| 458 | if (!callback(&ret_entries, directory, virtual_name)) | 461 | if (!callback(&ret_entries, directory, virtual_name)) { |
| 462 | callback_error = true; | ||
| 459 | break; | 463 | break; |
| 464 | } | ||
| 460 | found_entries += ret_entries; | 465 | found_entries += ret_entries; |
| 461 | 466 | ||
| 462 | #ifdef _WIN32 | 467 | #ifdef _WIN32 |
| @@ -467,9 +472,14 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo | |||
| 467 | closedir(dirp); | 472 | closedir(dirp); |
| 468 | #endif | 473 | #endif |
| 469 | 474 | ||
| 470 | // num_entries_out is allowed to be specified nullptr, in which case we shouldn't try to set it | 475 | if (!callback_error) { |
| 471 | if (num_entries_out != nullptr) | 476 | // num_entries_out is allowed to be specified nullptr, in which case we shouldn't try to set it |
| 472 | *num_entries_out = found_entries; | 477 | if (num_entries_out != nullptr) |
| 478 | *num_entries_out = found_entries; | ||
| 479 | return true; | ||
| 480 | } else { | ||
| 481 | return false; | ||
| 482 | } | ||
| 473 | } | 483 | } |
| 474 | 484 | ||
| 475 | unsigned ScanDirectoryTree(const std::string &directory, FSTEntry& parent_entry) | 485 | 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) { | |||
| 4696 | if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { | 4696 | if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { |
| 4697 | mrc_inst* inst_cream = (mrc_inst*)inst_base->component; | 4697 | mrc_inst* inst_cream = (mrc_inst*)inst_base->component; |
| 4698 | 4698 | ||
| 4699 | unsigned int inst = inst_cream->inst; | 4699 | if (inst_cream->cp_num == 15) { |
| 4700 | if (inst_cream->Rd == 15) { | 4700 | const uint32_t value = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2); |
| 4701 | DEBUG_MSG; | 4701 | |
| 4702 | } | 4702 | if (inst_cream->Rd == 15) { |
| 4703 | if (inst_cream->inst == 0xeef04a10) { | 4703 | cpu->Cpsr = (cpu->Cpsr & ~0xF0000000) | (value & 0xF0000000); |
| 4704 | // Undefined instruction fmrx | 4704 | LOAD_NZCVT; |
| 4705 | RD = 0x20000000; | 4705 | } else { |
| 4706 | CITRA_IGNORE_EXIT(-1); | 4706 | RD = value; |
| 4707 | goto END; | 4707 | } |
| 4708 | } else { | ||
| 4709 | if (inst_cream->cp_num == 15) | ||
| 4710 | RD = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2); | ||
| 4711 | } | 4708 | } |
| 4712 | } | 4709 | } |
| 4713 | cpu->Reg[15] += cpu->GetInstructionSize(); | 4710 | 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) { | |||
| 807 | } | 807 | } |
| 808 | break; | 808 | break; |
| 809 | case SystemInfoType::KERNEL_ALLOCATED_PAGES: | 809 | case SystemInfoType::KERNEL_ALLOCATED_PAGES: |
| 810 | LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param=%d", type, param); | 810 | LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param=%d", param); |
| 811 | *out = 0; | 811 | *out = 0; |
| 812 | break; | 812 | break; |
| 813 | case SystemInfoType::KERNEL_SPAWNED_PIDS: | 813 | case SystemInfoType::KERNEL_SPAWNED_PIDS: |