| 27 | void intEventTest(); |
| 28 | |
| 29 | void intUpdateCPUCycles() |
| 30 | { |
| 31 | const bool lowcycles = (cpuBlockCycles <= 40); |
| 32 | const s8 cyclerate = EmuConfig.Speedhacks.EECycleRate; |
| 33 | u32 scale_cycles = 0; |
| 34 | |
| 35 | if (cyclerate == 0 || lowcycles || cyclerate < -99 || cyclerate > 3) |
| 36 | scale_cycles = cpuBlockCycles >> 3; |
| 37 | |
| 38 | else if (cyclerate > 1) |
| 39 | scale_cycles = cpuBlockCycles >> (2 + cyclerate); |
| 40 | |
| 41 | else if (cyclerate == 1) |
| 42 | scale_cycles = (cpuBlockCycles >> 3) / 1.3f; // Adds a mild 30% increase in clockspeed for value 1. |
| 43 | |
| 44 | else if (cyclerate == -1) // the mildest value. |
| 45 | // These values were manually tuned to yield mild speedup with high compatibility |
| 46 | scale_cycles = (cpuBlockCycles <= 80 || cpuBlockCycles > 168 ? 5 : 7) * cpuBlockCycles / 32; |
| 47 | |
| 48 | else |
| 49 | scale_cycles = ((5 + (-2 * (cyclerate + 1))) * cpuBlockCycles) >> 5; |
| 50 | |
| 51 | // Ensure block cycle count is never less than 1. |
| 52 | cpuRegs.cycle += (scale_cycles < 1) ? 1 : scale_cycles; |
| 53 | |
| 54 | if (cyclerate > 1) |
| 55 | { |
| 56 | cpuBlockCycles &= (0x1 << (cyclerate + 2)) - 1; |
| 57 | } |
| 58 | else |
| 59 | { |
| 60 | cpuBlockCycles &= 0x7; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | // These macros are used to assemble the repassembler functions |
| 65 |
no outgoing calls
no test coverage detected