event.cpp 999 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifdef SCPU_CPP
  2. void sCPU::queue_event(unsigned id) {
  3. switch(id) {
  4. //interrupts triggered during (H)DMA do not trigger immediately after
  5. case EventIrqLockRelease: {
  6. status.irq_lock = false;
  7. } break;
  8. //ALU multiplication / division results are not immediately calculated;
  9. //the exact formula for the calculations are unknown, but this lock at least
  10. //allows emulation to avoid returning to fully computed results too soon.
  11. case EventAluLockRelease: {
  12. status.alu_lock = false;
  13. } break;
  14. //S-CPU WRAM consists of two 64kbyte DRAM chips, which must be refreshed
  15. //once per scanline to avoid memory decay.
  16. case EventDramRefresh: {
  17. add_clocks(40);
  18. } break;
  19. //HDMA init routine; occurs once per frame
  20. case EventHdmaInit: {
  21. cycle_edge_state |= EventFlagHdmaInit;
  22. } break;
  23. //HDMA run routine; occurs once per scanline
  24. case EventHdmaRun: {
  25. cycle_edge_state |= EventFlagHdmaRun;
  26. } break;
  27. }
  28. }
  29. #endif