|
|
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: (SC) Simon Schubiger - removed all MFP related code. NeXT does not have an MFP
8: */
9:
10: #ifndef HATARI_CYCINT_H
11: #define HATARI_CYCINT_H
12:
13: #ifdef __cplusplus
14: extern "C" {
15: #endif
16:
17: /* Interrupt handlers in system */
18: typedef enum
19: {
20: INTERRUPT_NULL,
21: INTERRUPT_VIDEO_VBL,
22: INTERRUPT_HARDCLOCK,
23: INTERRUPT_MOUSE,
24: INTERRUPT_ESP,
25: INTERRUPT_ESP_IO,
26: INTERRUPT_M2M_IO,
27: INTERRUPT_MO,
28: INTERRUPT_MO_IO,
29: INTERRUPT_ECC_IO,
30: INTERRUPT_ENET_IO,
31: INTERRUPT_FLP_IO,
32: INTERRUPT_SND_OUT,
33: INTERRUPT_SND_IN,
34: INTERRUPT_LP_IO,
35: INTERRUPT_EVENT_LOOP,
36: INTERRUPT_ND_VBL,
37: INTERRUPT_ND_VIDEO_VBL,
38: MAX_INTERRUPTS
39: } interrupt_id;
40:
41: /* Event timer structure - keeps next timer to occur in structure so don't need
42: * to check all entries */
43:
44: enum {
45: CYC_INT_NONE,
46: CYC_INT_CPU,
47: CYC_INT_US,
48: };
49:
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:
57: extern INTERRUPTHANDLER PendingInterrupt;
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);
73:
74: #ifdef __cplusplus
75: }
76: #endif
77:
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.