Assorted log spam reductions.

Also let Java know of some important events. Not used for anything yet.
This commit is contained in:
Henrik Rydgard 2013-12-04 17:41:59 +01:00
parent 7eaec209d3
commit 32f479b0a6
18 changed files with 47 additions and 26 deletions

View file

@ -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;
}

View file

@ -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
}

View file

@ -544,7 +544,6 @@ int ElfReader::LoadInto(u32 loadAddress)
}
}
NOTICE_LOG(LOADER,"ELF loading completed successfully.");
return SCE_KERNEL_ERROR_OK;
}

View file

@ -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;

View file

@ -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);

View file

@ -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);
}

View file

@ -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)
{

View file

@ -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<Module>(*mod, error);
if (!module->isFake) {
if (resultBufferOffset < resultBufferSize) {
if (resultBufferOffset < (int)resultBufferSize) {
Memory::Write_U32(module->GetUID(), resultBuffer + resultBufferOffset);
resultBufferOffset += 4;
}

View file

@ -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) {

View file

@ -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.

View file

@ -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

View file

@ -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();

View file

@ -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;

View file

@ -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);

View file

@ -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

View file

@ -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;

View file

@ -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?
}

2
native

@ -1 +1 @@
Subproject commit 9140f10e2f0a7e99e2a690c9fb5323cf2c5a067c
Subproject commit 563e0051019f22c0a87315c291da0d0c323ac6ff