|
|
1.1 ! root 1: /* ! 2: Hatari - cycInt.h ! 3: ! 4: This file is distributed under the GNU Public License, version 2 or at ! 5: your option any later version. Read the file gpl.txt for details. ! 6: */ ! 7: ! 8: #ifndef HATARI_CYCINT_H ! 9: #define HATARI_CYCINT_H ! 10: ! 11: /* Interrupt handlers in system */ ! 12: typedef enum ! 13: { ! 14: INTERRUPT_NULL, ! 15: INTERRUPT_VIDEO_VBL, ! 16: INTERRUPT_VIDEO_HBL, ! 17: INTERRUPT_VIDEO_ENDLINE, ! 18: INTERRUPT_MFP_TIMERA, ! 19: INTERRUPT_MFP_TIMERB, ! 20: INTERRUPT_MFP_TIMERC, ! 21: INTERRUPT_MFP_TIMERD, ! 22: INTERRUPT_IKBD_RESETTIMER, ! 23: INTERRUPT_IKBD_ACIA, ! 24: INTERRUPT_IKBD_MFP, ! 25: INTERRUPT_IKBD_AUTOSEND, ! 26: INTERRUPT_DMASOUND, ! 27: INTERRUPT_DMASOUND_MICROWIRE, ! 28: INTERRUPT_CROSSBAR_25MHZ, ! 29: INTERRUPT_CROSSBAR_32MHZ, ! 30: INTERRUPT_FDC, ! 31: INTERRUPT_BLITTER, ! 32: INTERRUPT_MIDI, ! 33: ! 34: MAX_INTERRUPTS ! 35: } interrupt_id; ! 36: ! 37: ! 38: #define INT_CPU_CYCLE 1 ! 39: #define INT_MFP_CYCLE 2 ! 40: ! 41: #define INT_CPU_TO_INTERNAL 9600 ! 42: #define INT_MFP_TO_INTERNAL 31333 ! 43: ! 44: /* Convert cpu or mfp cycles to internal cycles */ ! 45: #define INT_CONVERT_TO_INTERNAL( cyc , type ) ( type == INT_CPU_CYCLE ? (cyc)*INT_CPU_TO_INTERNAL : (cyc)*INT_MFP_TO_INTERNAL ) ! 46: /* ! 47: #define INT_CONVERT_TO_INTERNAL( cyc , type ) ( type == INT_CPU_CYCLE ? cyc*INT_CPU_TO_INTERNAL :\ ! 48: ( ( (cyc*INT_MFP_TO_INTERNAL + INT_CPU_TO_INTERNAL*4 - 1) / (INT_CPU_TO_INTERNAL*4) ) * INT_CPU_TO_INTERNAL*4 ) ) ! 49: */ ! 50: ! 51: /* Convert internal cycles to real mfp or cpu cycles */ ! 52: /* Rounding is important : for example 9500 internal is 0.98 cpu and should give 1 cpu cycle, not 0 */ ! 53: /* so we do (9500+9600-1)/9600 to get the closest higher integer */ ! 54: //#define INT_CONVERT_FROM_INTERNAL( cyc , type ) ( type == INT_CPU_CYCLE ? (cyc+INT_CPU_TO_INTERNAL-1)/INT_CPU_TO_INTERNAL : (cyc+INT_MFP_TO_INTERNAL-1)/INT_MFP_TO_INTERNAL ) ! 55: #define INT_CONVERT_FROM_INTERNAL( cyc , type ) ( type == INT_CPU_CYCLE ? (cyc)/INT_CPU_TO_INTERNAL : ((cyc)+INT_MFP_TO_INTERNAL-1)/INT_MFP_TO_INTERNAL ) ! 56: ! 57: ! 58: ! 59: extern void (*PendingInterruptFunction)(void); ! 60: extern int PendingInterruptCount; ! 61: ! 62: extern void CycInt_Reset(void); ! 63: extern void CycInt_MemorySnapShot_Capture(bool bSave); ! 64: extern void CycInt_AcknowledgeInterrupt(void); ! 65: extern void CycInt_AddAbsoluteInterrupt(int CycleTime, int CycleType, interrupt_id Handler); ! 66: extern void CycInt_AddRelativeInterrupt(int CycleTime, int CycleType, interrupt_id Handler); ! 67: extern void CycInt_AddRelativeInterruptNoOffset(int CycleTime, int CycleType, interrupt_id Handler); ! 68: extern void CycInt_AddRelativeInterruptWithOffset(int CycleTime, int CycleType, interrupt_id Handler, int CycleOffset); ! 69: extern void CycInt_RemovePendingInterrupt(interrupt_id Handler); ! 70: extern void CycInt_ResumeStoppedInterrupt(interrupt_id Handler); ! 71: extern bool CycInt_InterruptActive(interrupt_id Handler); ! 72: extern int CycInt_FindCyclesPassed(interrupt_id Handler, int CycleType); ! 73: ! 74: #endif /* ifndef HATARI_CYCINT_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.