diff --git a/Common/FileUtil.cpp b/Common/FileUtil.cpp index 1fc5bdd0e5..2ae97a644a 100644 --- a/Common/FileUtil.cpp +++ b/Common/FileUtil.cpp @@ -257,11 +257,11 @@ bool CreateDir(const std::string &path) bool CreateFullPath(const std::string &fullPath) { int panicCounter = 100; - INFO_LOG(COMMON, "CreateFullPath: path %s", fullPath.c_str()); + DEBUG_LOG(COMMON, "CreateFullPath: path %s", fullPath.c_str()); if (File::Exists(fullPath)) { - INFO_LOG(COMMON, "CreateFullPath: path exists %s", fullPath.c_str()); + DEBUG_LOG(COMMON, "CreateFullPath: path exists %s", fullPath.c_str()); return true; } diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 4ac3cb558b..70d69e15e3 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -166,10 +166,9 @@ void SavedataParam::Init() #ifdef ANDROID int handle = pspFileSystem.OpenFile(savePath + ".nomedia", (FileAccess)(FILEACCESS_CREATE | FILEACCESS_WRITE), 0); if (handle) { - ILOG("Created .nomedia file"); pspFileSystem.CloseFile(handle); } else { - ILOG("Failed to create .nomedia file"); + ELOG("Failed to create .nomedia file"); } #endif } diff --git a/Core/ELF/ElfReader.cpp b/Core/ELF/ElfReader.cpp index f7c0f7ccc6..3075825b8b 100644 --- a/Core/ELF/ElfReader.cpp +++ b/Core/ELF/ElfReader.cpp @@ -544,7 +544,6 @@ int ElfReader::LoadInto(u32 loadAddress) } } - NOTICE_LOG(LOADER,"ELF loading completed successfully."); return SCE_KERNEL_ERROR_OK; } diff --git a/Core/ELF/ElfReader.h b/Core/ELF/ElfReader.h index b000e283de..d5e81f14ff 100644 --- a/Core/ELF/ElfReader.h +++ b/Core/ELF/ElfReader.h @@ -55,7 +55,6 @@ public: bRelocate(false), entryPoint(0), vaddr(0) { - INFO_LOG(LOADER, "ElfReader: %p", ptr); base = (char*)ptr; base32 = (u32 *)ptr; header = (Elf32_Ehdr*)ptr; diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 21d2af8d0a..6cf9209b43 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -441,8 +441,6 @@ void __IoWakeManager() { } void __IoInit() { - INFO_LOG(SCEIO, "Starting up I/O..."); - MemoryStick_SetFatState(PSP_FAT_MEMORYSTICK_STATE_ASSIGNED); asyncNotifyEvent = CoreTiming::RegisterEvent("IoAsyncNotify", __IoAsyncNotify); @@ -1932,7 +1930,7 @@ int __IoIoctl(u32 id, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 out key_ptr = NULL; } - INFO_LOG(SCEIO, "Decrypting PGD DRM files"); + DEBUG_LOG(SCEIO, "Decrypting PGD DRM files"); pspFileSystem.SeekFile(f->handle, (s32)f->pgd_offset, FILEMOVE_BEGIN); pspFileSystem.ReadFile(f->handle, pgd_header, 0x90); f->pgdInfo = pgd_open(pgd_header, 2, key_ptr); diff --git a/Core/HLE/sceKernel.h b/Core/HLE/sceKernel.h index 77ea28b237..75c99ea6a4 100644 --- a/Core/HLE/sceKernel.h +++ b/Core/HLE/sceKernel.h @@ -451,7 +451,8 @@ public: { if (handle < handleOffset || handle >= handleOffset+maxCount || !occupied[handle-handleOffset]) { - if (handle != 0) + // Tekken 6 spams 0x80020001 gets wrong with no ill effects, also on the real PSP + if (handle != 0 && handle != 0x80020001) { WARN_LOG(SCEKERNEL, "Kernel: Bad object handle %i (%08x)", handle, handle); } diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index 61df2ea715..868f260717 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -245,11 +245,15 @@ void __KernelMemoryDoState(PointerWrap &p) void __KernelMemoryShutdown() { +#ifdef _DEBUG INFO_LOG(SCEKERNEL,"Shutting down user memory pool: "); userMemory.ListBlocks(); +#endif userMemory.Shutdown(); +#ifdef _DEBUG INFO_LOG(SCEKERNEL,"Shutting down \"kernel\" memory pool: "); kernelMemory.ListBlocks(); +#endif kernelMemory.Shutdown(); } @@ -704,7 +708,9 @@ public: address = alloc->AllocAligned(size, 0x100, alignment, type == PSP_SMEM_HighAligned, name); else address = alloc->Alloc(size, type == PSP_SMEM_High, name); +#ifdef _DEBUG alloc->ListBlocks(); +#endif } } ~PartitionMemoryBlock() @@ -1690,7 +1696,9 @@ SceUID sceKernelCreateTlspl(const char *name, u32 partition, u32 attr, u32 block u32 totalSize = blockSize * count; u32 blockPtr = userMemory.Alloc(totalSize, (attr & PSP_TLSPL_ATTR_HIGHMEM) != 0, name); +#ifdef _DEBUG userMemory.ListBlocks(); +#endif if (blockPtr == (u32) -1) { diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 1e683ff7d8..57758a2528 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -694,7 +694,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro } *magic = *magicPtr; if (*magic == 0x5053507e) { // "~PSP" - INFO_LOG(SCEMODULE, "Decrypting ~PSP file"); + DEBUG_LOG(SCEMODULE, "Decrypting ~PSP file"); PSP_Header *head = (PSP_Header*)ptr; const u8 *in = ptr; u32 size = head->elf_size; @@ -716,9 +716,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro module->nm.entry_addr = -1; module->nm.gp_value = -1; return module; - } - else if (ret <= 0) - { + } else if (ret <= 0) { ERROR_LOG(SCEMODULE, "Failed decrypting PRX! That's not normal! ret = %i\n", ret); Reporting::ReportMessage("Failed decrypting the PRX (ret = %i, size = %i, psp_size = %i)!", ret, head->elf_size, head->psp_size); // Fall through to safe exit in the next check. @@ -885,7 +883,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro module->ImportFunc(func); } - if (firstImportStubAddr == NULL || firstImportStubAddr > entry->firstSymAddr) + if (!firstImportStubAddr || firstImportStubAddr > entry->firstSymAddr) firstImportStubAddr = entry->firstSymAddr; } else if (entry->numFuncs > 0) { WARN_LOG_REPORT(LOADER, "Module entry with %d imports but no valid address", entry->numFuncs); @@ -1813,7 +1811,7 @@ u32 sceKernelGetModuleIdList(u32 resultBuffer, u32 resultBufferSize, u32 idCount for (auto mod = loadedModules.begin(), modend = loadedModules.end(); mod != modend; ++mod) { Module *module = kernelObjects.Get(*mod, error); if (!module->isFake) { - if (resultBufferOffset < resultBufferSize) { + if (resultBufferOffset < (int)resultBufferSize) { Memory::Write_U32(module->GetUID(), resultBuffer + resultBufferOffset); resultBufferOffset += 4; } diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index 6873b70aa0..9f73881891 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -113,9 +113,16 @@ int sceNetAdhocctlTerm(); int sceNetAdhocMatchingTerm(); void __NetAdhocShutdown() { - sceNetAdhocTerm(); - sceNetAdhocctlTerm(); - sceNetAdhocMatchingTerm(); + // Checks to avoid confusing logspam + if (netAdhocInited) { + sceNetAdhocTerm(); + } + if (netAdhocctlInited) { + sceNetAdhocctlTerm(); + } + if (netAdhocMatchingInited) { + sceNetAdhocMatchingTerm(); + } } void __NetAdhocDoState(PointerWrap &p) { diff --git a/Core/MIPS/ARM/ArmCompVFPU.cpp b/Core/MIPS/ARM/ArmCompVFPU.cpp index bd28bf1ba7..d2b9f08b33 100644 --- a/Core/MIPS/ARM/ArmCompVFPU.cpp +++ b/Core/MIPS/ARM/ArmCompVFPU.cpp @@ -785,6 +785,7 @@ namespace MIPSComp // Get some extra temps, used by vasin only. ARMReg t2 = INVALID_REG, t3 = INVALID_REG, t4 = INVALID_REG; if (((op >> 16) & 0x1f) == 23) { + // Only get here on vasin. int t[3] = { fpr.GetTempV(), fpr.GetTempV(), fpr.GetTempV() }; fpr.MapRegV(t[0], MAP_NOINIT); fpr.MapRegV(t[1], MAP_NOINIT); @@ -792,8 +793,6 @@ namespace MIPSComp t2 = fpr.V(t[0]); t3 = fpr.V(t[1]); t4 = fpr.V(t[2]); - INFO_LOG(JIT, "t2 %i t3 %i t4 %i", t2, t3, t4); - logBlocks = 1; } // Warning: sregs[i] and tempxregs[i] may be the same reg. @@ -863,7 +862,6 @@ namespace MIPSComp VABS(fpr.V(tempregs[i]), fpr.V(tempregs[i])); break; case 23: // d[i] = asinf(s[i] * (float)M_2_PI); break; //vasin - // DISABLE; // Seems to work well enough but can disable if it becomes a problem. // Should be easy enough to translate to NEON. There we can load all the constants // in one go of course. diff --git a/Core/Util/BlockAllocator.cpp b/Core/Util/BlockAllocator.cpp index 19b19e0c1d..fe94982977 100644 --- a/Core/Util/BlockAllocator.cpp +++ b/Core/Util/BlockAllocator.cpp @@ -382,6 +382,7 @@ void BlockAllocator::ListBlocks() const const Block &b = *bp; INFO_LOG(HLE, "Block: %08x - %08x size %08x taken=%i tag=%s", b.start, b.start+b.size, b.size, b.taken ? 1:0, b.tag); } + INFO_LOG(HLE,"-----------"); } u32 BlockAllocator::GetLargestFreeBlockSize() const diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 6e71befd48..c02400416d 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -65,8 +65,6 @@ EmuScreen::EmuScreen(const std::string &filename) void EmuScreen::bootGame(const std::string &filename) { booted_ = true; std::string fileToStart = filename; - // This is probably where we should start up the emulated PSP. - INFO_LOG(BOOT, "Starting up hardware."); CoreParameter coreParam; coreParam.cpuCore = g_Config.bJit ? CPU_JIT : CPU_INTERPRETER; @@ -100,6 +98,7 @@ void EmuScreen::bootGame(const std::string &filename) { invalid_ = true; errorMessage_ = error_string; ERROR_LOG(BOOT, "%s", errorMessage_.c_str()); + System_SendMessage("event", "failstartgame"); return; } @@ -126,6 +125,7 @@ void EmuScreen::bootGame(const std::string &filename) { osm.Show(s->T("Chainfire3DWarning", "WARNING: Chainfire3D detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true); } + System_SendMessage("event", "startgame"); } EmuScreen::~EmuScreen() { @@ -141,6 +141,7 @@ void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) { // DR_YES means a message sent to PauseMenu by NativeMessageReceived. if (result == DR_OK) { screenManager()->switchScreen(new MainScreen()); + System_SendMessage("event", "exitgame"); } RecreateViews(); @@ -159,6 +160,7 @@ void EmuScreen::sendMessage(const char *message, const char *value) { if (!PSP_Init(PSP_CoreParameter(), &resetError)) { ELOG("Error resetting: %s", resetError.c_str()); screenManager()->switchScreen(new MainScreen()); + System_SendMessage("event", "failstartgame"); return; } host->BootDone(); diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index c35b99689a..2b767d6325 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -424,6 +424,10 @@ UI::EventReturn GameBrowser::NavigateClick(UI::EventParams &e) { return UI::EVENT_DONE; } +void MainScreen() { + System_SendMessage("event", "mainscreen"); +} + void MainScreen::CreateViews() { // Information in the top left. // Back button to the bottom left. @@ -664,6 +668,7 @@ UI::EventReturn MainScreen::OnForums(UI::EventParams &e) { } UI::EventReturn MainScreen::OnExit(UI::EventParams &e) { + System_SendMessage("event", "exitprogram"); NativeShutdown(); exit(0); return UI::EVENT_DONE; diff --git a/Windows/main.cpp b/Windows/main.cpp index 083a8623c2..acea719031 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -155,6 +155,8 @@ std::string System_GetProperty(SystemProperty prop) { } } +void System_SendMessage(const char *command, const char *parameter) {} + void EnableCrashingOnCrashes() { typedef BOOL (WINAPI *tGetPolicy)(LPDWORD lpFlags); diff --git a/android/project.properties b/android/project.properties index babca9a8c9..4e48e04366 100644 --- a/android/project.properties +++ b/android/project.properties @@ -11,5 +11,5 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-10 +target=android-19 android.library.reference.1=../native/android diff --git a/headless/Headless.cpp b/headless/Headless.cpp index c825fc55c1..5f070b2334 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -70,6 +70,7 @@ void NativeUpdate(InputState &input_state) { } void NativeRender() { } std::string System_GetProperty(SystemProperty prop) { return ""; } +void System_SendMessage(const char *command, const char *parameter) {} #ifndef _WIN32 InputState input_state; diff --git a/ios/main.mm b/ios/main.mm index c48cb3ad8e..ad7c652c93 100644 --- a/ios/main.mm +++ b/ios/main.mm @@ -18,6 +18,9 @@ std::string System_GetProperty(SystemProperty prop) { } } +void System_SendMessage(const char *command, const char *parameter) { +} + void Vibrate(int length_ms) { // TODO: Haptic feedback? } diff --git a/native b/native index 9140f10e2f..563e005101 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 9140f10e2f0a7e99e2a690c9fb5323cf2c5a067c +Subproject commit 563e0051019f22c0a87315c291da0d0c323ac6ff