forked from KolibriOS/kolibrios
efc7e9446f
- Does not terminate if there is no sound. - Added --nosound parameter. - Fixed uSDL_Delay again. git-svn-id: svn://kolibrios.org@9133 a494cfbc-eb01-0410-851d-a64ba20cac60
29 lines
580 B
C
29 lines
580 B
C
static unsigned __starttime;
|
|
|
|
void uSDL_StartTicks(void){
|
|
__asm__ __volatile__ (
|
|
"int $0x40"
|
|
:"=a"(__starttime)
|
|
:"a"(26),"b"(9)
|
|
:"memory"
|
|
);
|
|
}
|
|
|
|
unsigned uSDL_GetTicks(void){
|
|
unsigned __curtime;
|
|
__asm__ __volatile__(
|
|
"int $0x40"
|
|
:"=a"(__curtime)
|
|
:"a"(26),"b"(9)
|
|
:"memory"
|
|
);
|
|
return (__curtime-__starttime)*10;
|
|
}
|
|
|
|
void uSDL_Delay(unsigned ms){
|
|
unsigned start = uSDL_GetTicks();
|
|
do{
|
|
__asm__ __volatile__("int $0x40" :: "a"(5),"b"(1));
|
|
}while (uSDL_GetTicks()-start < ms);
|
|
}
|