Changeset 152 for sbliveos2


Ignore:
Timestamp:
Jul 17, 2000, 8:37:33 PM (25 years ago)
Author:
sandervl
Message:

misc updates

Location:
sbliveos2/trunk
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/ChangeLog

    r151 r152  
    11$Id$
     2
     3 2000-07-13: Sander van Leeuwen <sandervl@xs4all.nl>
     4        - Added different levels of debug logging (dprintf2/3/4)
     5
     6 2000-06-19: Sander van Leeuwen <sandervl@xs4all.nl>
     7        - Added configuration output in 16 bits driver
     8        - Check for 0 size in memcopy Linux apis (fixed trap d on some machines)
     9        - Added extra checks for null pointers, fixed null pointer check
     10          in drv16\ossidc16.cpp (IDC16_MALLOC)
    211
    312 2000-05-20: Sander van Leeuwen <sandervl@xs4all.nl>
  • sbliveos2/trunk/drv16/commdbg.c

    r142 r152  
    3939#include <os2.h>
    4040#include "dbgos2.h"
     41#include "commdbg.h"
    4142
    4243BOOL fLineTerminate=TRUE;
    43 #ifdef  DEBUG
    4444
    4545#define CR 0x0d
     
    5050#define SIGNIFICANT_FIELD       0x0007
    5151
     52int dbglevel = 2;
    5253
    5354char hextab[]="0123456789ABCDEF";
    5455
    5556                                        //-------------------- DecWordToASCII -
    56 char far * DecWordToASCII(char far *StrPtr, USHORT wDecVal, USHORT Option)
     57char far * cdecl DecWordToASCII(char far *StrPtr, USHORT wDecVal, USHORT Option)
    5758{
    5859  BOOL fNonZero=FALSE;
     
    9798
    9899                                        //-------------------- DecLongToASCII -
    99 char far * DecLongToASCII(char far *StrPtr, ULONG lDecVal,USHORT Option)
     100char far * cdecl DecLongToASCII(char far *StrPtr, ULONG lDecVal,USHORT Option)
    100101{
    101102   BOOL  fNonZero=FALSE;
     
    148149}
    149150                                        //-------------------- HexWordToASCII -
    150 char far * HexWordToASCII(char far *StrPtr, USHORT wHexVal, USHORT Option)
     151char far * cdecl HexWordToASCII(char far *StrPtr, USHORT wHexVal, USHORT Option)
    151152{
    152153   BOOL fNonZero=FALSE;
     
    176177
    177178                                        //-------------------- HexLongToASCII -
    178 char far * HexLongToASCII(char far *StrPtr, ULONG wHexVal, USHORT Option)
     179char far * cdecl HexLongToASCII(char far *StrPtr, ULONG wHexVal, USHORT Option)
    179180{
    180181   BOOL  fNonZero=FALSE;
     
    217218}
    218219
     220#ifdef  DEBUG
    219221char BuildString[1024];
    220 #endif          // DEBUG
    221 #ifdef DEBUG
    222222
    223223                                        //------------------------- PrintfOut -
  • sbliveos2/trunk/drv16/init.cpp

    r151 r152  
    5555#include <include.h>                   // Pragmas and more.
    5656#include <sbversion.h>
     57#include "commdbg.h"
     58#include <dbgos2.h>
    5759
    5860#ifndef PCI_VENDOR_ID_CREATIVE
     
    7274static char NEWLINE[]     = "\r\n";
    7375static char szSBLiveNotFound[] = "SB Live! hardware not detected!";
    74 static char szAltF1[]     = "Reboot, press Alt-F1 during OS/2 startup and select Enable Hardware Detection";
     76static char szSBLiveConfig1[]  = "SB Live! configuration: IRQ ";
     77static char szSBLiveConfig2[]  = ", IO Port 0x";
     78
    7579
    7680//
     
    7882// Name is copied from header at runtime.
    7983//
    80 char  szPddName [9]  = {0};
     84char  szPddName[9]  = {0};
     85char  digit[16]     = {0};
    8186
    8287ResourceManager* pRM = 0;               // Resource manager object.
     
    122127
    123128        DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
    124         DosWrite(1, (VOID FAR*)szSBLive, strlen(szSBLive), &result);
     129        DosWrite(1, (VOID FAR*)szSBLive, sizeof(szSBLive)-1, &result);
    125130        DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
    126131
     
    137142      return;
    138143   }
    139    else if (pRM->getState() != rmDriverCreated) {
    140       return;
    141    }
    142144
    143145   //SvL: Check if SB Live hardware has been detected by the resource manager
    144    //     If not, tell user to reboot, press alt-f1 and enable hardware detection
    145    if(!pRM->bIsDevDetected(PCI_ID, SEARCH_ID_DEVICEID, TRUE)) {
     146   if(pRM->getState() != rmDriverCreated || !pRM->bIsDevDetected(PCI_ID, SEARCH_ID_DEVICEID, TRUE))
     147   {
     148hardware_notfound:
    146149        USHORT result;
    147150
    148         DosWrite(1, (VOID FAR*)szSBLiveNotFound, strlen(szSBLiveNotFound), &result);
    149         DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
    150         DosWrite(1, (VOID FAR*)szAltF1, sizeof(szAltF1), &result);
     151        DosWrite(1, (VOID FAR*)szSBLiveNotFound, sizeof(szSBLiveNotFound)-1, &result);
     152        DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
    151153        DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
    152154        return;
    153155   }
     156   LDev_Resources *pResources = pRM->pGetDevResources(PCI_ID, SEARCH_ID_DEVICEID, TRUE);
     157   if ((!pResources) || pResources->isEmpty()) {
     158        goto hardware_notfound;
     159   }
     160
     161   if (fVerbose) {
     162        USHORT result;
     163
     164        DecWordToASCII(digit, (USHORT)pResources->uIRQLevel[0], 0);
     165        DosWrite(1, (VOID FAR*)szSBLiveConfig1, sizeof(szSBLiveConfig1)-1, &result);
     166        DosWrite(1, (VOID FAR*)digit, strlen(digit), &result);
     167
     168        DosWrite(1, (VOID FAR*)szSBLiveConfig2, sizeof(szSBLiveConfig2)-1, &result);
     169        HexWordToASCII(digit, pResources->uIOBase[0], 0);
     170        DosWrite(1, (VOID FAR*)digit, strlen(digit), &result);
     171
     172        DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
     173        DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
     174   }
     175   delete pResources;
    154176
    155177   // Build the MPU401 object only if we got a good 2115 init.
  • sbliveos2/trunk/drv16/irq.cpp

    r142 r152  
    270270            cli();
    271271            if (_handlerList[i].pfnHandler(_usIRQLevel)) {  // Call handler.
     272               cli();
    272273               // We've cleared all service requests.  Send EOI and clear
    273274               // the carry flag (tells OS/2 kernel that Int was handled).
  • sbliveos2/trunk/drv16/ossidc16.cpp

    r151 r152  
    182182//******************************************************************************
    183183//******************************************************************************
     184ULONG OSS16_StreamGetSpace(STREAM *stream)
     185{
     186   return (BOOL)CallOSS32(IDC32_STREAM_GETSPACE, stream->ulSysFileNum, MMPMToOSSStreamType(stream->ulStreamType), stream->ulStreamId, 0, 0);
     187}
     188//******************************************************************************
     189//******************************************************************************
    184190ULONG CallOSS32(USHORT cmd, ULONG fileid, ULONG param1, ULONG param2, ULONG param3, ULONG param4)
    185191{
     
    292298                idcres->memlength[i] = pResources->uMemLength[i];
    293299        }
    294 
     300        delete pResources;
    295301        return 1;
    296302   }
     
    298304   {
    299305        LIN linaddr;
    300         ULONG far *addr = (ULONG far *)malloc((USHORT)packet->malloc.size+4);
    301 
    302         if(addr == NULL) {
     306        ULONG near *addr16 = (ULONG near *)malloc((USHORT)packet->malloc.size+4);
     307        ULONG far *addr = (ULONG far *)addr16;
     308
     309        if(addr16 == NULL) {
    303310                return 0;
    304311        }
  • sbliveos2/trunk/drv16/parse.c

    r142 r152  
    189189
    190190   switch (cParm) {
     191      case '3':
     192         fInt3BeforeInit = TRUE;
     193         break;
    191194      case 'J':            // which MIDI.  MPU by default, if /J then FMSYNTH
    192195         fFMforMIDI = TRUE;
  • sbliveos2/trunk/drv16/rm.cpp

    r151 r152  
    167167#if 1
    168168   //Manual detection in ResourceManager class constructor;
    169    return _state == rmDriverCreated;
     169   return (_state == rmDriverCreated || _state == rmAdapterCreated);
    170170#else
    171171   BOOL bReturn = FALSE;
     
    375375   if (_state != rmAdapterCreated) {
    376376      rc = _rmCreateAdapter();
    377    }
    378 
    379    // Register the device with OS/2 RM.
    380    _rmCreateDevice((unsigned char __far *)DeviceName, pahResources );
     377
     378      // Register the device with OS/2 RM.
     379      _rmCreateDevice((unsigned char __far *)DeviceName, pahResources );
     380   }
    381381
    382382exit:
  • sbliveos2/trunk/drv16/wavestrm.cpp

    r151 r152  
    3434#include "ioctl.h"
    3535
     36#ifndef min
     37#define min(a,b) (a>b) ? b : a
     38#endif
     39
    3640//
    3741//  _vRealignBuffer
     
    152156void WAVESTREAM::AddBuffers(void)
    153157{
     158 ULONG space, byteswritten;
     159
    154160   if (ulStreamType & STREAM_WRITE) {
    155161        if(!qhInProcess.Head() && !qhDone.Head()) {
     
    160166                return;
    161167        }
    162         AddBuffer();
    163         AddBuffer();
     168        space = OSS16_StreamGetSpace(this);
     169        if(space > 128) {
     170                space -= 128;
     171        }
     172        while(space) {
     173                byteswritten = AddBuffer(space);
     174                space -= byteswritten;
     175                if(byteswritten == 0) break;
     176        }       
    164177   }
    165178}
     
    171184// there are buffers on pHead... BEWARE
    172185//
    173 void WAVESTREAM::AddBuffer()
     186ULONG WAVESTREAM::AddBuffer(ULONG space)
    174187{
    175188   PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone.Head();
     
    180193        pTemp = (PSTREAMBUFFER)qhInProcess.Head();
    181194   }
    182    if(!pTemp) return;
     195   if(!pTemp) return 0;
    183196
    184197   // get the buffer pointer and amount of data remaining
     
    187200
    188201   // write the audio buffer
     202   Buff_left = min(Buff_left, space);
    189203   byteswritten = OSS16_StreamAddBuffer(this, pdataBuf, Buff_left);
    190204   if(byteswritten == 0) {
    191         return; //no more room
    192    }
    193 
    194 //   dprintf(("AddBuffer %lx size %d, bytes written %d", pdataBuf, (USHORT)Buff_left, (USHORT)byteswritten));
     205        return 0; //no more room
     206   }
    195207
    196208   // update the buffer pos counter
     
    200212      qhDone.PushOnTail(qhInProcess.PopHead());
    201213   }
     214   dprintf4(("AddBuffer %lx size %d, bytes written %d", pdataBuf, (USHORT)Buff_left, (USHORT)byteswritten));
     215   return byteswritten;
    202216}
    203217
     
    226240   }
    227241
    228 ////   dprintf(("_vReadAudioBuf %lx size %d, bytes read %d", pdataBuf, Buff_left, bytesread));
     242   dprintf4(("_vReadAudioBuf %lx size %d, bytes read %d", pdataBuf, Buff_left, bytesread));
    229243
    230244   // update the buffer pos counter
     
    236250   }
    237251   if(pTemp->ulBuffpos == pTemp->ulBuffsz) {
    238         dprintf(("_vReadAudioBuf return buffer %lx size %ld, bytes read %ld", (ULONG)pTemp->pBuffptr, pTemp->ulBuffsz, bytesread));
     252        dprintf4(("_vReadAudioBuf return buffer %lx size %ld, bytes read %ld", (ULONG)pTemp->pBuffptr, pTemp->ulBuffsz, bytesread));
    239253        ReturnBuffer();
    240254   }
     
    280294                        //calc position in next buffer
    281295                        bytesinc = ptemp->ulDonepos - ptemp->ulBuffsz;
    282 ////                    dprintf(("Process: Return buffer %lx size %d", ptemp->pBuffptr, ptemp->ulBuffsz));
     296                        dprintf3(("Process: Return buffer %lx size %d", ptemp->pBuffptr, ptemp->ulBuffsz));
    283297                        ReturnBuffer();
    284298                }
     
    309323{
    310324   qhInProcess.PushOnTail((PQUEUEELEMENT)new STREAMBUFFER(uLength, pbuf));
    311 ////   dprintf(("WAVESTREAM::Write: Push on tail %lx %d", ((PSTREAMBUFFER)qhInProcess.Head())->pBuffptr, ((PSTREAMBUFFER)qhInProcess.Head())->ulBuffsz));
     325   dprintf2(("WAVESTREAM::Write: Push on tail %lx %d", ((PSTREAMBUFFER)qhInProcess.Head())->pBuffptr, ((PSTREAMBUFFER)qhInProcess.Head())->ulBuffsz));
    312326   if(fUnderrun) {
    313327        fUnderrun = FALSE;
     
    323337{
    324338   qhInProcess.PushOnTail((PQUEUEELEMENT)new STREAMBUFFER(uLength, pbuf));
    325    dprintf(("WAVESTREAM::Read: Push on tail %lx %d", ((PSTREAMBUFFER)qhInProcess.Head())->pBuffptr, ((PSTREAMBUFFER)qhInProcess.Head())->ulBuffsz));
     339   dprintf2(("WAVESTREAM::Read: Push on tail %lx %d", ((PSTREAMBUFFER)qhInProcess.Head())->pBuffptr, ((PSTREAMBUFFER)qhInProcess.Head())->ulBuffsz));
    326340   return 0;
    327341}
     
    384398 ULONG         fragsize;
    385399
     400#ifdef DEBUG
     401   int oldlevel = dbglevel;
     402   dbglevel = 4;
     403#endif
    386404   // configure the wave device
    387405   ((PWAVEAUDIO)pahw)->ConfigDev(this, &_configinfo);
     
    421439        OSS16_StartStream(this);
    422440   }
     441#ifdef DEBUG
     442   dbglevel = oldlevel;
     443#endif
    423444
    424445   //Must set volume after adding buffers (voices inside sblive driver might not
  • sbliveos2/trunk/drv16/wavestrm.hpp

    r142 r152  
    6262   void    _vRealignPausedBuffers(ULONG endpos = 0);
    6363   void    AddBuffers();            // Initialize the audio buffer object
    64    void    AddBuffer();             // write one buffer to the audio buffer
     64   ULONG   AddBuffer(ULONG space);             // write one buffer to the audio buffer
    6565   BOOL    _vReadAudioBuf(void);    // read data from the audio buffer
    6666
  • sbliveos2/trunk/drv32/idc.c

    r151 r152  
    113113  case IDC32_STREAM_RESET:
    114114        return OSS32_StreamReset(pPacket->startstop.streamtype, pPacket->startstop.streamid);
     115
     116  case IDC32_STREAM_GETSPACE:
     117        return OSS32_StreamGetSpace(pPacket->getspace.streamtype, pPacket->getspace.streamid);
    115118 
    116119  case IDC32_STREAM_IOCTL:
  • sbliveos2/trunk/drv32/makefile.os2

    r148 r152  
    4545CFLAGS  = $(CFLAGS) -mf -DKEE
    4646ASFLAGS = $(ASFLAGS) -D:KEE
     47LNKFILE = sblivekee.lnk
    4748!else
    4849CFLAGS  = $(CFLAGS) -mc -zu
     50LNKFILE = sblive.lnk
    4951!endif
    5052
     
    113115all: $(TARGET).sys
    114116
    115 $(TARGET).lnk: makefile.os2 ..\include\version.mak
     117$(LNKFILE): makefile.os2 ..\include\version.mak
    116118    @%write $^@ name $(TARGET).sys
    117119    @%write $^@ option alignment=16
     
    124126    @%write $^@ library $(%WATCOM)\lib386\os2\clib3r.lib
    125127
    126 $(TARGET).sys: $(TARGET).lnk $(FILES)
    127      $(LINK) @$(TARGET).lnk
     128$(TARGET).sys: $(LNKFILE) $(FILES)
     129     $(LINK) @$(LNKFILE)
    128130     ..\drv16\wat2map $(WMAPNAME) $(TARGET).MAP
    129131     mapsym $(TARGET).MAP
  • sbliveos2/trunk/lib32/memory.cpp

    r148 r152  
    129129void __copy_user(void *to, const void *from, unsigned long n)
    130130{
     131        if(to == NULL || from == NULL) {
     132                DebugInt3();
     133                return;
     134        }
     135        if(n == 0) return;
    131136#ifdef KEE
    132137        memcpy(to, from, n);
     
    139144unsigned long copy_to_user(void *to, const void *from, unsigned long n)
    140145{
     146        if(to == NULL || from == NULL) {
     147                DebugInt3();
     148                return 0;
     149        }
     150        if(n == 0) return 0;
    141151#ifdef KEE
    142152        memcpy(to, from, n);
     
    150160void __copy_user_zeroing(void *to, const void *from, unsigned long n)
    151161{
     162        if(to == NULL || from == NULL) {
     163                DebugInt3();
     164                return;
     165        }
     166        if(n == 0) return;
    152167        copy_to_user(to, from, n);
    153168}
     
    156171unsigned long copy_from_user(void *to, const void *from, unsigned long n)
    157172{
     173        if(to == NULL || from == NULL) {
     174                DebugInt3();
     175                return 0;
     176        }
     177        if(n == 0) return 0;
    158178#ifdef KEE
    159179        memcpy(to, from, n);
     
    167187int get_user(int size, void *dest, void *src)
    168188{
     189        if(size == 0)   return 0;
     190
     191        if(dest == NULL || src == NULL) {
     192                DebugInt3();
     193                return 0;
     194        }
    169195#ifdef KEE
    170196        memcpy(dest, src, size);
     
    178204int put_user(int x, void *ptr)
    179205{
     206        if(ptr == NULL) {
     207                DebugInt3();
     208                return 0;
     209        }
     210
    180211        *(int *)ptr = x;
    181212        return 0;
     
    200231 char near *addr;
    201232
     233  if(size == 0) {
     234        DebugInt3();
     235        return NULL;
     236  }
    202237  if(size > 1024) {
    203238#ifdef KEE
  • sbliveos2/trunk/lib32/sound.c

    r151 r152  
    451451//******************************************************************************
    452452//******************************************************************************
     453ULONG OSS32_StreamGetSpace(ULONG streamtype, ULONG streamid)
     454{
     455 struct inode   ossinode;
     456 struct file    ossfile;
     457 struct dentry  ossdentry;
     458 ULONG          ossid = streamtype & OSS_IDMASK;
     459 audio_buf_info info;
     460 char NEAR     *tmpbuf;
     461 ULONG          cmd;
     462 int            transferred;
     463
     464  ossinode.i_rdev = ossid;
     465  ossfile.private_data = (void *)streamid;
     466  ossfile.f_flags = 0;
     467  ossfile.f_dentry = &ossdentry;
     468  ossdentry.d_inode = &ossinode;
     469
     470  switch(streamtype) {
     471  case OSS_STREAM_WAVEOUT:
     472        ossfile.f_mode = FMODE_WRITE;
     473        cmd = SNDCTL_DSP_GETOSPACE;
     474        break;
     475  case OSS_STREAM_WAVEIN:
     476        ossfile.f_mode = FMODE_READ;
     477        cmd = SNDCTL_DSP_GETISPACE;
     478        break;
     479  case OSS_STREAM_MIDIOUT:
     480        ossfile.f_mode = FMODE_WRITE;
     481        break;
     482  case OSS_STREAM_MIDIIN:
     483        ossfile.f_mode = FMODE_READ;
     484        break;
     485  }
     486
     487  if(!oss_devices[ossid].write || !oss_devices[ossid].read || !oss_devices[ossid].ioctl) {
     488        return 0;
     489  }
     490  //check how much room is left in the circular dma buffer
     491#ifdef KEE
     492  tmpbuf = (char NEAR *)&info;
     493#else
     494  tmpbuf = (char NEAR *)__StackToFlat((ULONG)&info);
     495#endif
     496  if(oss_devices[ossid].ioctl(&ossinode, &ossfile, cmd, (ULONG)tmpbuf)) {
     497        return 0;
     498  }
     499  return info.bytes;
     500}
     501//******************************************************************************
     502//******************************************************************************
    453503ULONG OSS32_SetVolume(ULONG streamtype, ULONG streamid, ULONG cmd, ULONG volume)
    454504{
  • sbliveos2/trunk/readme.txt

    r151 r152  
    1             SoundBlaster Live! OS/2 Audio driver version 0.35 (beta)
     1            SoundBlaster Live! OS/2 Audio driver version 0.50 (beta)
    22            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    33
    44Contents
    55========
    6 1   Description
    7 2   Features
    8 3   Requirements
    9 4   Installation/uninstall
    10 5   Config.sys options
    11 6   Known problems
    12 7   File listing
    13 8   Source code
    14 9   Contacting the author
    15 9.1 SoundBlaster Live OS/2 mailinglist
    16 10  Warranty
     61    Description
     72    Features
     83    History
     94    Requirements
     105    Installation/uninstall
     116    Config.sys options
     127    Known problems
     138    File listing
     149    Source code
     1510   Contacting the author
     1610.1 SoundBlaster Live OS/2 mailinglist
     1711   Warranty
    1718
    1819
     
    3839
    3940
    40 3 Requirements
     413 History
     42=========
     430.50
     44- Added RTMIDI playback & recording (MPU401)
     45- Manually detect SB Live! hardware
     46- Bugfix for TRAP D when starting playback/recording
     47
     480.25
     49- First public beta release
     50
     51
     524 Requirements
    4153==============
    4254- OS/2 Warp 4 or Warp Server for e-Business
     
    4557
    4658
    47 4 Installation/uninstall
     595 Installation/uninstall
    4860========================
    4961To install the SB Live driver:
     
    5668as described above, but select zero SB Live cards when asked.
    5769
    58 5 Config.sys options
     706 Config.sys options
    5971====================
    6072DEVICE=J:\MMOS2\SBLIVE16.SYS /V /C /M /L
     
    7183
    7284
    73 6 Known problems
     857 Known problems
    7486================
    7587- Users have reported that sometimes applications can no longer play audio
     
    101113        - reboot
    102114
    103 7 File listing
     1158 File listing
    104116==============
    105117Installation files:
     
    124136
    125137
    126 8 Source code
     1389 Source code
    127139=============
    128140As this driver is based on the open source SoundBlaster Live Linux driver,
     
    135147
    136148
    137 9 Contacting the author
     14910 Contacting the author
    138150=======================
    139151When you find a bug in the driver, you can contact the author by
     
    156168
    157169
    158 9.1 SoundBlaster Live OS/2 mailinglist
     17010.1 SoundBlaster Live OS/2 mailinglist
    159171======================================
    160172A mailinglist to discuss the OS/2 sblive driver has been created at egroups.com.
     
    162174
    163175
    164 10 Warranty
     17611 Warranty
    165177===========
    166178EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED
  • sbliveos2/trunk/sblive/cardwo.c

    r142 r152  
    518518        /* Save the stop position */
    519519        emu10k1_voice_getcontrol(wave_out->voice, CCCA_CURRADDR, &wavexferbuf->stopposition);
    520 
    521520        wavexferbuf->stopposition -= wave_out->voice->params.start;
     521#ifdef TARGET_OS2
     522        wavexferbuf->stopposition &= CCCA_CURRADDR_MASK; //SvL: mask off CCCA_8BITSELECT
     523#endif
    522524
    523525        /* Refer to voicemgr.c, CA is not started at zero.  We need to take this into account. */
     
    721723
    722724                emu10k1_voice_getcontrol(wave_out->voice, CCCA_CURRADDR, &curpos);
    723 
    724725                curpos -= wave_out->voice->params.start;
     726#ifdef TARGET_OS2
     727                curpos &= CCCA_CURRADDR_MASK; //SvL: mask off CCCA_8BITSELECT
     728#endif
    725729
    726730                /* Get number of bytes in play buffer per channel.
Note: See TracChangeset for help on using the changeset viewer.