| 588 | } |
| 589 | |
| 590 | static void intExecute() |
| 591 | { |
| 592 | // This will come back as zero the first time it runs, or on instruction cancel. |
| 593 | // It will come back as nonzero when we exit execution. |
| 594 | if (fastjmp_set(&intJmpBuf) != 0) |
| 595 | return; |
| 596 | |
| 597 | for (;;) |
| 598 | { |
| 599 | if (!VMManager::Internal::HasBootedELF()) |
| 600 | { |
| 601 | // Avoid reloading every instruction. |
| 602 | u32 elf_entry_point = VMManager::Internal::GetCurrentELFEntryPoint(); |
| 603 | u32 eeload_main = g_eeloadMain; |
| 604 | u32 eeload_exec = g_eeloadExec; |
| 605 | |
| 606 | while (true) |
| 607 | { |
| 608 | execI(); |
| 609 | |
| 610 | if (cpuRegs.pc == EELOAD_START) |
| 611 | { |
| 612 | // The EELOAD _start function is the same across all BIOS versions afaik |
| 613 | const u32 mainjump = memRead32(EELOAD_START + 0x9c); |
| 614 | if (mainjump >> 26 == 3) // JAL |
| 615 | g_eeloadMain = ((EELOAD_START + 0xa0) & 0xf0000000U) | (mainjump << 2 & 0x0fffffffU); |
| 616 | |
| 617 | eeload_main = g_eeloadMain; |
| 618 | } |
| 619 | else if (cpuRegs.pc == eeload_main) |
| 620 | { |
| 621 | eeloadHook(); |
| 622 | if (VMManager::Internal::IsFastBootInProgress()) |
| 623 | { |
| 624 | // See comments on this code in iR5900.cpp's recRecompile() |
| 625 | const u32 typeAexecjump = memRead32(EELOAD_START + 0x470); |
| 626 | const u32 typeBexecjump = memRead32(EELOAD_START + 0x5B0); |
| 627 | const u32 typeCexecjump = memRead32(EELOAD_START + 0x618); |
| 628 | const u32 typeDexecjump = memRead32(EELOAD_START + 0x600); |
| 629 | if ((typeBexecjump >> 26 == 3) || (typeCexecjump >> 26 == 3) || (typeDexecjump >> 26 == 3)) // JAL to 0x822B8 |
| 630 | g_eeloadExec = EELOAD_START + 0x2B8; |
| 631 | else if (typeAexecjump >> 26 == 3) // JAL to 0x82170 |
| 632 | g_eeloadExec = EELOAD_START + 0x170; |
| 633 | else |
| 634 | Console.WriteLn("intExecute: Could not enable launch arguments for fast boot mode; unidentified BIOS version! Please report this to the PCSX2 developers."); |
| 635 | |
| 636 | eeload_exec = g_eeloadExec; |
| 637 | } |
| 638 | |
| 639 | elf_entry_point = VMManager::Internal::GetCurrentELFEntryPoint(); |
| 640 | } |
| 641 | else if (cpuRegs.pc == eeload_exec) |
| 642 | { |
| 643 | eeloadHook2(); |
| 644 | } |
| 645 | else if (cpuRegs.pc == elf_entry_point) |
| 646 | { |
| 647 | VMManager::Internal::EntryPointCompilingOnCPUThread(); |
nothing calls this directly
no test coverage detected