| 57 | #define DEBUG_LAUNCHARG 0 // show lots of helpful console messages as the launch arguments are passed to the game |
| 58 | |
| 59 | void cpuReset() |
| 60 | { |
| 61 | std::memset(&cpuRegs, 0, sizeof(cpuRegs)); |
| 62 | std::memset(&fpuRegs, 0, sizeof(fpuRegs)); |
| 63 | std::memset(&tlb, 0, sizeof(tlb)); |
| 64 | cachedTlbs.count = 0; |
| 65 | |
| 66 | cpuRegs.pc = 0xbfc00000; //set pc reg to stack |
| 67 | cpuRegs.CP0.n.Config = 0x440; |
| 68 | cpuRegs.CP0.n.Status.val= 0x70400004; //0x10900000 <-- wrong; // COP0 enabled | BEV = 1 | TS = 1 |
| 69 | cpuRegs.CP0.n.PRid = 0x00002e20; // PRevID = Revision ID, same as R5900 |
| 70 | fpuRegs.fprc[0] = 0x00002e30; // fpu Revision.. |
| 71 | fpuRegs.fprc[31] = 0x01000001; // fpu Status/Control |
| 72 | |
| 73 | cpuRegs.nextEventCycle = cpuRegs.cycle + 4; |
| 74 | EEsCycle = 0; |
| 75 | EEoCycle = cpuRegs.cycle; |
| 76 | |
| 77 | psxReset(); |
| 78 | pgifInit(); |
| 79 | |
| 80 | extern void Deci2Reset(); // lazy, no good header for it yet. |
| 81 | Deci2Reset(); |
| 82 | |
| 83 | AllowParams1 = !VMManager::Internal::IsFastBootInProgress(); |
| 84 | AllowParams2 = !VMManager::Internal::IsFastBootInProgress(); |
| 85 | ParamsRead = false; |
| 86 | |
| 87 | g_eeloadMain = 0; |
| 88 | g_eeloadExec = 0; |
| 89 | g_osdsys_str = 0; |
| 90 | |
| 91 | CBreakPoints::ClearSkipFirst(); |
| 92 | } |
| 93 | |
| 94 | __ri void cpuException(u32 code, u32 bd) |
| 95 | { |
no test coverage detected