New timing scheme lot's of new functions.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@504
This commit is contained in:
parent
f5b3b79c95
commit
30284bfaa4
1 changed files with 23 additions and 1 deletions
|
@ -19,7 +19,12 @@
|
|||
#ifndef __PIC_H
|
||||
#define __PIC_H
|
||||
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
typedef void (PIC_EOIHandler) (void);
|
||||
typedef void (* PIC_EventHandler)(void);
|
||||
|
||||
|
||||
#define PIC_MAXIRQ 15
|
||||
#define PIC_NOIRQ 0xFF
|
||||
|
@ -27,7 +32,20 @@ typedef void (PIC_EOIHandler) (void);
|
|||
|
||||
extern Bitu PIC_IRQCheck;
|
||||
extern Bitu PIC_IRQActive;
|
||||
extern bool PIC_IRQAgain;
|
||||
|
||||
extern Bitu PIC_Ticks;
|
||||
|
||||
INLINE Bitu PIC_Index(void) {
|
||||
return ((CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)*1000)/CPU_CycleMax;
|
||||
}
|
||||
|
||||
INLINE Bits PIC_MakeCycles(Bitu amount) {
|
||||
return (CPU_CycleMax*amount)/1000;
|
||||
}
|
||||
|
||||
INLINE Bit64u PIC_MicroCount(void) {
|
||||
return PIC_Ticks*1000+PIC_Index();
|
||||
}
|
||||
|
||||
void PIC_ActivateIRQ(Bit32u irq);
|
||||
|
||||
|
@ -37,8 +55,12 @@ void PIC_runIRQs(void);
|
|||
|
||||
void PIC_RegisterIRQ(Bit32u irq,PIC_EOIHandler handler,char * name);
|
||||
void PIC_FreeIRQ(Bit32u irq);
|
||||
Bitu PIC_RunQueue(void);
|
||||
|
||||
void PIC_AddIRQ(Bitu irq,Bitu delay);
|
||||
void PIC_AddEvent(PIC_EventHandler handler,Bitu delay);
|
||||
|
||||
void PIC_RemoveEvents(PIC_EventHandler handler);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue