| 141 | } |
| 142 | |
| 143 | std::string_view c0_reg_write_action(int cop0_reg) { |
| 144 | switch (static_cast<Cop0Reg>(cop0_reg)) { |
| 145 | case Cop0Reg::RSP_COP0_SP_SEMAPHORE: |
| 146 | return ""; // Ignore semaphore functionality |
| 147 | case Cop0Reg::RSP_COP0_SP_STATUS: |
| 148 | return ""; // Ignore writes to the status flags since yielding is ignored |
| 149 | case Cop0Reg::RSP_COP0_SP_DRAM_ADDR: |
| 150 | return "SET_DMA_DRAM"; |
| 151 | case Cop0Reg::RSP_COP0_SP_MEM_ADDR: |
| 152 | return "SET_DMA_MEM"; |
| 153 | case Cop0Reg::RSP_COP0_SP_RD_LEN: |
| 154 | return "DO_DMA_READ"; |
| 155 | case Cop0Reg::RSP_COP0_SP_WR_LEN: |
| 156 | return "DO_DMA_WRITE"; |
| 157 | default: |
| 158 | fmt::print(stderr, "Unhandled mtc0: {}\n", cop0_reg); |
| 159 | throw std::runtime_error("Unhandled mtc0"); |
| 160 | } |
| 161 | |
| 162 | } |
| 163 | |
| 164 | bool is_c0_reg_write_dma_read(int cop0_reg) { |
| 165 | return static_cast<Cop0Reg>(cop0_reg) == Cop0Reg::RSP_COP0_SP_RD_LEN; |
no outgoing calls
no test coverage detected