|
|
1.1 root 1: /*
2: * Events
3: * These are best for low-frequency events. Having too many of them,
4: * or using them for events that occur too frequently, can cause massive
5: * slowdown.
6: */
7:
1.1.1.4 ! root 8: #ifndef UAE_EVENTS_H
! 9: #define UAE_EVENTS_H
! 10:
1.1 root 11: #include "../includes/main.h"
1.1.1.3 root 12: #include "../includes/decode.h"
1.1.1.4 ! root 13: #include "../includes/mfp.h"
! 14:
1.1 root 15:
16: STATIC_INLINE void do_cycles(unsigned long cycles_to_add)
17: {
1.1.1.4 ! root 18: cycles_to_add = (cycles_to_add+3)&0xfffffffc;
! 19: lastInstructionCycles = cycles_to_add; /* Store to find how many cycles last instruction took to execute */
! 20: SoundCycles += cycles_to_add; /* Add in cycle time to get cycle-accurate sample playback */
! 21: PendingInterruptCount -= (short)cycles_to_add; /* Add cycle time including effective address time */
! 22: if( PendingInterruptCount<=0 || PendingInterruptFlag) /* Check for any interrupts or flag to service */
1.1 root 23: {
1.1.1.4 ! root 24: if( PendingInterruptFlag&PENDING_INTERRUPT_FLAG_MFP )
! 25: MFP_CheckPendingInterrupts();
! 26: if( PendingInterruptCount<=0 && PendingInterruptFunction )
! 27: CALL_VAR(PendingInterruptFunction);
1.1 root 28: }
29: }
1.1.1.4 ! root 30:
! 31: #endif /* UAE_EVENTS_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.