File:  [HATARI the Atari ST Emulator] / hatari / src / uae-cpu / events.h
Revision 1.1.1.4 (vendor branch): download - view: text, annotated - select for diffs
Mon Apr 1 07:10:25 2019 UTC (7 years, 2 months ago) by root
Branches: hatari, MAIN
CVS tags: hatari00045, hatari00040, hatari00030, hatari00025, HEAD
hatari 0.25

 /*
  * Events
  * These are best for low-frequency events. Having too many of them,
  * or using them for events that occur too frequently, can cause massive
  * slowdown.
  */

#ifndef UAE_EVENTS_H
#define UAE_EVENTS_H

#include "../includes/main.h"
#include "../includes/decode.h"
#include "../includes/mfp.h"


STATIC_INLINE void do_cycles(unsigned long cycles_to_add)
{
  cycles_to_add = (cycles_to_add+3)&0xfffffffc;
  lastInstructionCycles = cycles_to_add;     /* Store to find how many cycles last instruction took to execute */
  SoundCycles += cycles_to_add;              /* Add in cycle time to get cycle-accurate sample playback */
  PendingInterruptCount -= (short)cycles_to_add;     /* Add cycle time including effective address time */
  if( PendingInterruptCount<=0 || PendingInterruptFlag)	/* Check for any interrupts or flag to service */
  {
    if( PendingInterruptFlag&PENDING_INTERRUPT_FLAG_MFP )
      MFP_CheckPendingInterrupts();
    if( PendingInterruptCount<=0 && PendingInterruptFunction )
      CALL_VAR(PendingInterruptFunction);
  }
}

#endif  /* UAE_EVENTS_H */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.