ToDo: Add Status bar for loading OSHLE Patch Symbols.
| 488 | |
| 489 | //ToDo: Add Status bar for loading OSHLE Patch Symbols. |
| 490 | void Patch_RecurseAndFind() |
| 491 | { |
| 492 | s32 nFound; |
| 493 | u32 first; |
| 494 | u32 last; |
| 495 | #ifdef DAEDALUS_DEBUG_CONSOLE |
| 496 | DBGConsole_Msg(0, "Searching for os functions. This may take several seconds..."); |
| 497 | #endif |
| 498 | // Keep looping until a pass does not resolve any more symbols |
| 499 | nFound = 0; |
| 500 | |
| 501 | #ifdef DAEDALUS_DEBUG_CONSOLE |
| 502 | CDebugConsole::Get()->MsgOverwriteStart(); |
| 503 | #else |
| 504 | #ifdef DAEDALUS_PSP |
| 505 | // Load our font here, Intrafont used in UI is destroyed when emulation starts |
| 506 | intraFont* ltn8 = intraFontLoad( "flash0:/font/ltn8.pgf", INTRAFONT_CACHE_ASCII); |
| 507 | intraFontSetStyle( ltn8, 1.0f, 0xFFFFFFFF, 0, 0.f, INTRAFONT_ALIGN_CENTER ); |
| 508 | #endif |
| 509 | #endif |
| 510 | |
| 511 | // Loops through all symbols, until name is nullptr |
| 512 | for (u32 i = 0; i < nPatchSymbols && !gCPUState.IsJobSet( CPU_STOP_RUNNING ); i++) |
| 513 | { |
| 514 | |
| 515 | #ifdef DAEDALUS_DEBUG_CONSOLE |
| 516 | CDebugConsole::Get()->MsgOverwrite(0, "OS HLE: %d / %d Looking for [G%s]", |
| 517 | i, nPatchSymbols, g_PatchSymbols[i]->Name); |
| 518 | fflush(stdout); |
| 519 | #else |
| 520 | #ifdef DAEDALUS_PSP |
| 521 | //Update patching progress on PSPscreen |
| 522 | CGraphicsContext::Get()->BeginFrame(); |
| 523 | CGraphicsContext::Get()->ClearToBlack(); |
| 524 | //intraFontPrintf( ltn8, 480/2, (272>>1)-50, "Searching for os functions. This may take several seconds..."); |
| 525 | intraFontPrintf( ltn8, 480/2, (272>>1), "OS HLE Patching: %d%%", i * 100 / (nPatchSymbols-1)); |
| 526 | intraFontPrintf( ltn8, 480/2, (272>>1)-50, "Searching for %s", g_PatchSymbols[i]->Name ); |
| 527 | CGraphicsContext::Get()->EndFrame(); |
| 528 | CGraphicsContext::Get()->UpdateFrame( true ); |
| 529 | #endif |
| 530 | #endif //DAEDALUS_DEBUG_CONSOLE |
| 531 | // Skip symbol if already found, or if it is a variable |
| 532 | if (g_PatchSymbols[i]->Found) |
| 533 | continue; |
| 534 | |
| 535 | // Symbol not found, attempt to locate on this pass. This may |
| 536 | // fail if all dependent symbols are not found |
| 537 | if (Patch_LocateFunction(g_PatchSymbols[i])) |
| 538 | nFound++; |
| 539 | } |
| 540 | |
| 541 | if ( gCPUState.IsJobSet( CPU_STOP_RUNNING ) ) |
| 542 | { |
| 543 | #ifdef DAEDALUS_DEBUG_CONSOLE |
| 544 | CDebugConsole::Get()->MsgOverwrite( 0, "OS HLE: Aborted" ); |
| 545 | CDebugConsole::Get()->MsgOverwriteEnd(); |
| 546 | #endif |
| 547 |
no test coverage detected