Commit 68dd5608 authored by Alexandre Julliard's avatar Alexandre Julliard

winedos: Always run the BIOS tick timer.

parent 404aecb8
......@@ -115,7 +115,6 @@ BOOL load_winedos(void)
GET_ADDR(outport);
GET_ADDR(EmulateInterruptPM);
GET_ADDR(CallBuiltinHandler);
GET_ADDR(BiosTick);
#undef GET_ADDR
}
RtlRemoveVectoredExceptionHandler( dosmem_handler );
......
......@@ -106,13 +106,6 @@ static BOOL INSTR_ReplaceSelector( CONTEXT86 *context, WORD *sel )
{
if (*sel == 0x40)
{
static WORD sys_timer = 0;
if (!sys_timer)
{
if (!winedos.BiosTick) load_winedos();
if (winedos.BiosTick)
sys_timer = CreateSystemTimer( 55, winedos.BiosTick );
}
*sel = DOSMEM_BiosDataSeg;
return TRUE;
}
......
......@@ -137,7 +137,6 @@ extern struct winedos_exports
void (WINAPI *CallBuiltinHandler)( CONTEXT86 *context, BYTE intnum );
DWORD (WINAPI *inport)( int port, int size );
void (WINAPI *outport)( int port, int size, DWORD val );
void (* BiosTick)(WORD timer);
} winedos;
/* returns directory handle for named objects */
......
......@@ -224,10 +224,25 @@ static void DOSMEM_FillBiosSegments(void)
*
* Increment the BIOS tick counter. Called by timer signal handler.
*/
void BiosTick( WORD timer )
static void CALLBACK BiosTick( LPVOID arg, DWORD low, DWORD high )
{
BIOSDATA *pBiosData = DOSVM_BiosData();
if (pBiosData) pBiosData->Ticks++;
BIOSDATA *pBiosData = arg;
pBiosData->Ticks++;
}
/***********************************************************************
* timer_thread
*/
static DWORD CALLBACK timer_thread( void *arg )
{
LARGE_INTEGER when;
HANDLE timer;
if (!(timer = CreateWaitableTimerA( NULL, FALSE, NULL ))) return 0;
when.u.LowPart = when.u.HighPart = 0;
SetWaitableTimer( timer, &when, 55 /* actually 54.925 */, BiosTick, arg, FALSE );
for (;;) SleepEx( INFINITE, TRUE );
}
/***********************************************************************
......@@ -488,6 +503,8 @@ BOOL DOSMEM_InitDosMemory(void)
* Set DOS memory base and initialize conventional memory.
*/
DOSMEM_InitMemory(DOSMEM_dosmem + reserve);
CloseHandle( CreateThread( NULL, 0, timer_thread, DOSVM_BiosData(), 0, NULL ));
return TRUE;
}
......
......@@ -11,6 +11,3 @@
@ cdecl FreeDosBlock(ptr) DOSMEM_FreeBlock
@ cdecl AllocDosBlock(long ptr) DOSMEM_AllocBlock
@ cdecl ResizeDosBlock(ptr long long) DOSMEM_ResizeBlock
# BIOS functions
@ cdecl BiosTick(long)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment