changes for improved timing event system
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1968
This commit is contained in:
parent
5c26302fc2
commit
dfbb195418
13 changed files with 103 additions and 116 deletions
|
@ -32,21 +32,20 @@ typedef void (* PIC_EventHandler)(Bitu val);
|
|||
#define PIC_MAXIRQ 15
|
||||
#define PIC_NOIRQ 0xFF
|
||||
|
||||
|
||||
extern Bitu PIC_IRQCheck;
|
||||
extern Bitu PIC_IRQActive;
|
||||
extern Bitu PIC_Ticks;
|
||||
|
||||
INLINE Bitu PIC_Index(void) {
|
||||
return ((CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)*1000)/CPU_CycleMax;
|
||||
INLINE float PIC_TickIndex(void) {
|
||||
return (CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)/(float)CPU_CycleMax;
|
||||
}
|
||||
|
||||
INLINE Bits PIC_MakeCycles(Bitu amount) {
|
||||
return (CPU_CycleMax*amount)/1000;
|
||||
INLINE Bits PIC_MakeCycles(double amount) {
|
||||
return (Bits)(CPU_CycleMax*amount);
|
||||
}
|
||||
|
||||
INLINE Bit64u PIC_MicroCount(void) {
|
||||
return PIC_Ticks*1000+PIC_Index();
|
||||
INLINE double PIC_FullIndex(void) {
|
||||
return PIC_Ticks+PIC_TickIndex();
|
||||
}
|
||||
|
||||
void PIC_ActivateIRQ(Bitu irq);
|
||||
|
@ -55,7 +54,8 @@ void PIC_DeActivateIRQ(Bitu irq);
|
|||
void PIC_runIRQs(void);
|
||||
bool PIC_RunQueue(void);
|
||||
|
||||
void PIC_AddEvent(PIC_EventHandler handler,Bitu delay,Bitu val=0);
|
||||
//Delay in milliseconds
|
||||
void PIC_AddEvent(PIC_EventHandler handler,float delay,Bitu val=0);
|
||||
void PIC_RemoveEvents(PIC_EventHandler handler);
|
||||
|
||||
void PIC_SetIRQMask(Bitu irq, bool masked);
|
||||
|
|
|
@ -89,7 +89,6 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
bool resizing;
|
||||
bool drawing;
|
||||
Bitu width;
|
||||
Bitu height;
|
||||
Bitu blocks;
|
||||
|
@ -106,20 +105,21 @@ typedef struct {
|
|||
Bitu parts_lines;
|
||||
Bitu parts_left;
|
||||
struct {
|
||||
Bitu vtotal;
|
||||
Bitu vstart;
|
||||
Bitu vend;
|
||||
Bitu htotal;
|
||||
Bitu hstart;
|
||||
Bitu hend;
|
||||
Bitu parts;
|
||||
} micro;
|
||||
float vtotal;
|
||||
float vstart;
|
||||
float vend;
|
||||
float htotal;
|
||||
float hstart;
|
||||
float hend;
|
||||
float parts;
|
||||
} delay;
|
||||
bool double_scan;
|
||||
bool doublewidth,doubleheight;
|
||||
Bit8u font[64*1024];
|
||||
Bit8u * font_tables[2];
|
||||
Bitu blinking;
|
||||
struct {
|
||||
Bitu address;
|
||||
Bit8u sline,eline;
|
||||
Bit8u count,delay;
|
||||
Bit8u enabled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue