Changeset 151 for sbliveos2/trunk/lib32


Ignore:
Timestamp:
May 28, 2000, 6:50:46 PM (25 years ago)
Author:
sandervl
Message:

update

Location:
sbliveos2/trunk/lib32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/lib32/debug.c

    r142 r151  
    3939#include <os2.h>
    4040
    41 #ifdef  DEBUG
    4241
    4342#define CR 0x0d
     
    146145}
    147146
     147#ifdef  DEBUG
    148148char BuildString[1024];
    149149#endif          // DEBUG
  • sbliveos2/trunk/lib32/misc.c

    r142 r151  
    5050}
    5151
     52#define CR 0x0d
     53#define LF 0x0a
     54
     55
     56#define LEADING_ZEROES          0x8000
     57#define SIGNIFICANT_FIELD       0x0007
     58
     59char *HexLongToASCII(char *StrPtr, unsigned long wHexVal, unsigned short Option);
     60char *DecLongToASCII(char *StrPtr, unsigned long lDecVal, unsigned short Option);
     61
     62
     63//SvL: Not safe to use in non-KEE driver
    5264int sprintf (char *buffer, const char *format, ...)
    5365{
    54   return 0;
     66   char *BuildPtr=buffer;
     67   char *pStr = (char *) format;
     68   char *SubStr;
     69   union {
     70         void   *VoidPtr;
     71         unsigned short *WordPtr;
     72         unsigned long  *LongPtr;
     73#ifdef KEE
     74         unsigned long  *StringPtr;
     75#else
     76         double *StringPtr;
     77#endif
     78         } Parm;
     79   int wBuildOption;
     80
     81   Parm.VoidPtr=(void *) &format;
     82   Parm.StringPtr++;                            // skip size of string pointer
     83
     84   while (*pStr)
     85      {
     86      switch (*pStr)
     87         {
     88         case '%':
     89            wBuildOption=0;
     90            pStr++;
     91            if (*pStr=='0')
     92               {
     93               wBuildOption|=LEADING_ZEROES;
     94               pStr++;
     95               }
     96            if (*pStr=='u')                                                         // always unsigned
     97               pStr++;
     98
     99            switch(*pStr)
     100               {
     101               case 'x':
     102               case 'X':
     103                  BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption);
     104                  pStr++;
     105                  continue;
     106
     107               case 'd':
     108                  BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption);
     109                  pStr++;
     110                  continue;
     111
     112#ifdef KEE
     113               case 's':
     114                  SubStr=(char *)*Parm.StringPtr;
     115                  while (*BuildPtr++ = *SubStr++);
     116                  Parm.StringPtr++;
     117                  BuildPtr--;                      // remove the \0
     118                  pStr++;
     119                  continue;
     120#endif
     121               case 'l':
     122                  pStr++;
     123                  switch (*pStr)
     124                  {
     125                  case 'x':
     126                  case 'X':
     127                  BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption);
     128                  pStr++;
     129                  continue;
     130
     131                  case 'd':
     132                     BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption);
     133                     pStr++;
     134                     continue;
     135                  } // end switch
     136                  continue;                        // dunno what he wants
     137
     138               case 0:
     139                  continue;
     140               } // end switch
     141            break;
     142
     143      case '\\':
     144         pStr++;
     145         switch (*pStr)
     146            {
     147            case 'n':
     148            *BuildPtr++=LF;
     149            pStr++;
     150            continue;
     151
     152            case 'r':
     153            *BuildPtr++=CR;
     154            pStr++;
     155            continue;
     156
     157            case 0:
     158            continue;
     159            break;
     160            } // end switch
     161
     162         break;
     163         } // end switch
     164
     165      *BuildPtr++=*pStr++;
     166      } // end while
     167
     168   *BuildPtr=0;                                 // cauterize the string
     169   return 1; //not correct
    55170}
    56171
  • sbliveos2/trunk/lib32/ossidc.cpp

    r148 r151  
    9696extern "C" int OSS32_ProcessIRQ(int fWaveOut, unsigned long streamid)
    9797{
    98   return CallOSS16(IDC16_PROCESS, fWaveOut, streamid);
     98  return CallOSS16(IDC16_PROCESS, (fWaveOut) ? IDC16_WAVEOUT_IRQ : IDC16_WAVEIN_IRQ, streamid);
    9999}
    100100//******************************************************************************
    101101//******************************************************************************
     102extern "C" int OSS32_ProcessMidiIRQ(unsigned long streamid)
     103{
     104  return CallOSS16(IDC16_PROCESS, IDC16_MIDI_IRQ, streamid);
     105}
     106//******************************************************************************
     107//******************************************************************************
  • sbliveos2/trunk/lib32/pci.c

    r142 r151  
    7777        pcidev->device     = device;
    7878       
    79         devid     = (vendor << 16) | device;
     79        devid     = (device << 16) | vendor;
    8080
    8181#ifdef KEE
  • sbliveos2/trunk/lib32/sound.c

    r147 r151  
    3030#include <asm/uaccess.h>
    3131#include <asm/hardirq.h>
     32#include "..\sblive\icardmid.h"
     33#include "..\sblive\cardmi.h"
     34#include "..\sblive\midi.h"
    3235
    3336#define LINUX
     
    563566//******************************************************************************
    564567//******************************************************************************
     568unsigned long OSS32_StreamMidiWrite(unsigned long streamid, unsigned long midiByte)
     569{
     570 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *)streamid;
     571
     572  return emu10k1_mpu_write_data(midi_dev->card, (u8)midiByte) == 0;
     573}
     574//******************************************************************************
     575//******************************************************************************
     576unsigned long OSS32_StreamMidiRead(unsigned long streamid, char near *buffer, unsigned long bufsize)
     577{
     578 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *)streamid;
     579 int count = 0;
     580 u8  MPUIvalue;
     581
     582  while(TRUE) {
     583        if(emu10k1_mpu_read_data(midi_dev->card, &MPUIvalue) == 0) {
     584                buffer[count] = MPUIvalue;
     585                count++;
     586        }
     587        else    break;
     588
     589        if(count >= bufsize) {
     590                break;
     591        }
     592  }
     593  return count;
     594}
     595//******************************************************************************
     596//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.