|
|
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.
1.1.1.4 root 6:
7: (SC) Simon Schubiger - removed all MFP related code. NeXT does not have an MFP
1.1 root 8: */
9:
10: #ifndef HATARI_CYCINT_H
11: #define HATARI_CYCINT_H
12:
1.1.1.5 ! root 13: #ifdef __cplusplus
! 14: extern "C" {
! 15: #endif
! 16:
1.1 root 17: /* Interrupt handlers in system */
18: typedef enum
19: {
20: INTERRUPT_NULL,
21: INTERRUPT_VIDEO_VBL,
1.1.1.2 root 22: INTERRUPT_HARDCLOCK,
1.1.1.3 root 23: INTERRUPT_MOUSE,
24: INTERRUPT_ESP,
25: INTERRUPT_ESP_IO,
1.1.1.4 root 26: INTERRUPT_M2M_IO,
1.1.1.3 root 27: INTERRUPT_MO,
28: INTERRUPT_MO_IO,
29: INTERRUPT_ECC_IO,
30: INTERRUPT_ENET_IO,
31: INTERRUPT_FLP_IO,
1.1.1.4 root 32: INTERRUPT_SND_OUT,
33: INTERRUPT_SND_IN,
1.1.1.3 root 34: INTERRUPT_LP_IO,
1.1.1.4 root 35: INTERRUPT_EVENT_LOOP,
36: INTERRUPT_ND_VBL,
37: INTERRUPT_ND_VIDEO_VBL,
1.1 root 38: MAX_INTERRUPTS
39: } interrupt_id;
40:
1.1.1.4 root 41: /* Event timer structure - keeps next timer to occur in structure so don't need
42: * to check all entries */
1.1 root 43:
1.1.1.4 root 44: enum {
45: CYC_INT_NONE,
46: CYC_INT_CPU,
47: CYC_INT_US,
48: };
1.1 root 49:
1.1.1.4 root 50: typedef struct
51: {
52: int type; /* Type of time (CPU Cycles, microseconds) or NONE for inactive */
53: int64_t time; /* number of CPU cycles to go until interupt or absolute microsecond timeout until interrupt */
54: void (*pFunction)(void);
55: } INTERRUPTHANDLER;
56:
1.1.1.5 ! root 57: extern INTERRUPTHANDLER PendingInterrupt;
1.1.1.4 root 58:
59: extern int64_t nCyclesMainCounter;
60: extern int64_t nCyclesOver;
61:
62: extern int usCheckCycles;
63:
64: void CycInt_Reset(void);
65: void CycInt_MemorySnapShot_Capture(bool bSave);
66: void CycInt_AcknowledgeInterrupt(void);
67: void CycInt_AddRelativeInterruptCycles(int64_t CycleTime, interrupt_id Handler);
68: void CycInt_AddRelativeInterruptUs(int64_t us, int64_t usreal, interrupt_id Handler);
69: void CycInt_AddRelativeInterruptUsCycles(int64_t us, int64_t usreal, interrupt_id Handler);
70: void CycInt_RemovePendingInterrupt(interrupt_id Handler);
71: bool CycInt_InterruptActive(interrupt_id Handler);
72: bool CycInt_SetNewInterruptUs(void);
1.1 root 73:
1.1.1.5 ! root 74: #ifdef __cplusplus
! 75: }
! 76: #endif
! 77:
1.1 root 78: #endif /* ifndef HATARI_CYCINT_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.