Rev 9097 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9097 | turbocat | 1 | static unsigned __starttime; |
2 | |||
3 | void uSDL_StartTicks(void){ |
||
4 | __asm__ __volatile__ ( |
||
5 | "int $0x40" |
||
6 | :"=a"(__starttime) |
||
7 | :"a"(26),"b"(9) |
||
8 | :"memory" |
||
9 | ); |
||
10 | } |
||
11 | |||
12 | unsigned uSDL_GetTicks(void){ |
||
13 | unsigned __curtime; |
||
14 | __asm__ __volatile__( |
||
15 | "int $0x40" |
||
16 | :"=a"(__curtime) |
||
17 | :"a"(26),"b"(9) |
||
18 | :"memory" |
||
19 | ); |
||
9123 | turbocat | 20 | return (__curtime-__starttime)*10; |
9097 | turbocat | 21 | } |
22 | |||
9123 | turbocat | 23 | void uSDL_Delay(unsigned ms){ |
24 | unsigned start = uSDL_GetTicks(); |
||
25 | do{ |
||
26 | __asm__("int $0x40" :: "a"(68),"b"(1)); |
||
27 | }while (uSDL_GetTicks()-start < ms); |
||
28 | }> |