source: trunk/src/dsound/os2helper.cpp@ 2012

Last change on this file since 2012 was 1744, checked in by hugh, 26 years ago

Implemented fake soundcard
The Bufferpos will be advanced based on the elapsed time
since start playing

File size: 986 bytes
Line 
1#define INCL_DOSMISC
2#define INCL_DOSPROFILE
3#include <os2wrap.h>
4#include <misc.h>
5
6typedef ULONG DWORD ;
7
8#if 0
9DWORD GetTickCountOS2()
10{
11 ULONG ulTickCount;
12 APIRET rc;
13 rc = DosQuerySysInfo( QSV_MS_COUNT,
14 QSV_MS_COUNT,
15 &ulTickCount,
16 sizeof(ULONG));
17 return 0==rc?ulTickCount:0x00FFDEAD;
18}
19#else
20DWORD GetTickCountOS2()
21{
22 QWORD qwTickCount;
23 ULONG ulFreq;
24 DWORD dwTick;
25 APIRET rc;
26
27 rc = DosTmrQueryFreq( &ulFreq);
28 if(0==rc)
29 {
30 rc = DosTmrQueryTime(&qwTickCount);
31 if(0==rc)
32 {
33 ulFreq /=1000;
34 dwTick = qwTickCount.ulLo / ulFreq;
35 //dwTick = ( (qwTickCount.ulHi <<24)+ (qwTickCount.ulLo>>8)) / (ulFreq>>8);
36 }
37 }
38 //dprintf(("DSOUND: GetTickCountOS2 Freq: %d(%08X) Time %d(%08X) : %d(%08X)\n",
39 // ulFreq, ulFreq,
40 // qwTickCount.ulHi, qwTickCount.ulHi,
41 // qwTickCount.ulLo,qwTickCount.ulLo));
42 return 0==rc?dwTick:0x00FFDEAD;
43}
44#endif
Note: See TracBrowser for help on using the repository browser.