Changeset 561


Ignore:
Timestamp:
Jul 28, 2011, 11:16:56 AM (14 years ago)
Author:
rudi
Message:

SBLliveOS2: Adapt to newer OpenWatcom versions

Location:
sbliveos2/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/drv16/commdbg.c

    r152 r561  
    5353
    5454char hextab[]="0123456789ABCDEF";
     55
     56#ifdef DEBUG
     57//#define       MAGIC_COMM_PORT 0x3f8           // pulled from word ptr 40:0
     58#define         MAGIC_COMM_PORT 0x2f8           // pulled from word ptr 40:0
     59
     60
     61#define UART_DATA               0x00            // UART Data port
     62#define UART_INT_ENAB           0x01            // UART Interrupt enable
     63#define UART_INT_ID             0x02            // interrupt ID
     64#define UART_LINE_CTRL          0x03            // line control registers
     65#define UART_MODEM_CTRL         0x04            // modem control register
     66#define UART_LINE_STAT          0x05            // line status register
     67#define UART_MODEM_STAT         0x06            // modem status regiser
     68#define UART_DIVISOR_LO         0x00            // divisor latch least sig
     69#define UART_DIVISOR_HI         0x01h           // divisor latch most sig
     70
     71#define DELAY   nop
     72#endif
     73
     74#ifdef DEBUG                            //--------------------------- CharOut -
     75void CharOut(char c)
     76{
     77        _asm    {
     78
     79        mov     dx, MAGIC_COMM_PORT     // address of PS/2's first COM port
     80        add     dx, UART_LINE_STAT
     81
     82ReadyCheck:
     83        in      al, dx                                                          // wait for comm port ready signal
     84
     85        DELAY
     86        DELAY
     87        DELAY
     88
     89        test    al, 020h
     90        jz      ReadyCheck
     91
     92        // Send the character
     93
     94        add     dx, UART_DATA - UART_LINE_STAT
     95        mov     al,c
     96        out     dx, al
     97
     98        DELAY
     99        DELAY
     100        DELAY
     101        }
     102}
     103#endif
     104
     105#ifdef DEBUG                            //------------------------- StringOut -
     106void StringOut(char far *DbgStr)
     107{
     108   while (*DbgStr)
     109      CharOut(*DbgStr++);
     110
     111   if (fLineTerminate)
     112   {
     113      CharOut(CR);                              // append carriage return,
     114      CharOut(LF);                              // linefeed
     115   }
     116}
     117#endif
    55118
    56119                                        //-------------------- DecWordToASCII -
     
    330393#endif                            //DEBUG
    331394
    332 
    333 #ifdef DEBUG                            //------------------------- StringOut -
    334 void StringOut(char far *DbgStr)
    335 {
    336    while (*DbgStr)
    337       CharOut(*DbgStr++);
    338 
    339    if (fLineTerminate)
    340    {
    341       CharOut(CR);                              // append carriage return,
    342       CharOut(LF);                              // linefeed
    343    }
    344 }
    345 #endif
    346 
    347 #ifdef DEBUG
    348 //#define       MAGIC_COMM_PORT 0x3f8           // pulled from word ptr 40:0
    349 #define         MAGIC_COMM_PORT 0x2f8           // pulled from word ptr 40:0
    350 
    351 
    352 #define UART_DATA               0x00            // UART Data port
    353 #define UART_INT_ENAB           0x01            // UART Interrupt enable
    354 #define UART_INT_ID             0x02            // interrupt ID
    355 #define UART_LINE_CTRL          0x03            // line control registers
    356 #define UART_MODEM_CTRL         0x04            // modem control register
    357 #define UART_LINE_STAT          0x05            // line status register
    358 #define UART_MODEM_STAT         0x06            // modem status regiser
    359 #define UART_DIVISOR_LO         0x00            // divisor latch least sig
    360 #define UART_DIVISOR_HI         0x01h           // divisor latch most sig
    361 
    362 #define DELAY   nop
    363 #endif
    364 
    365 #ifdef DEBUG                            //--------------------------- CharOut -
    366 void CharOut(char c)
    367 {
    368         _asm    {
    369 
    370         mov     dx, MAGIC_COMM_PORT     // address of PS/2's first COM port
    371         add     dx, UART_LINE_STAT
    372 
    373 ReadyCheck:
    374         in      al, dx                                                          // wait for comm port ready signal
    375 
    376         DELAY
    377         DELAY
    378         DELAY
    379 
    380         test    al, 020h
    381         jz      ReadyCheck
    382 
    383         // Send the character
    384 
    385         add     dx, UART_DATA - UART_LINE_STAT
    386         mov     al,c
    387         out     dx, al
    388 
    389         DELAY
    390         DELAY
    391         DELAY
    392         }
    393 }
    394 #endif
  • sbliveos2/trunk/drv16/irq.hpp

    r205 r561  
    4747#endif
    4848
    49 // clude <stddef.h>             //### NULL?  to be removed
    50 
    51 // ###IHV:  IRQ sharing flag.  Set this to "0" for ISA bus, "1" for PCI
    52 // PCI and Microchannel environments (where hardware can share an IRQ level.
    53 const IRQ_HW_Sharing = 1;               // 13 Jun 07 MF
    54 
    5549// Max num of int handlers per IRQ level.
    56 const MAX_HandlersPerIRQLevel = 3;
     50const int MAX_HandlersPerIRQLevel = 3;
    5751
    5852// PFN_InterruptHandler:  Pointer to an interrupt handler.  This is a near
  • sbliveos2/trunk/drv16/maudio.cpp

    r205 r561  
    5656// if these haven't been redefined by the sub-classes.
    5757
    58 virtual int MIDIAUDIO::writeByte(BYTE b)
     58int MIDIAUDIO::writeByte(BYTE b)
    5959{
    6060   return 0;    // Failure.
    6161}
    6262
    63 virtual int MIDIAUDIO::readByte(void)
     63int MIDIAUDIO::readByte(void)
    6464{
    6565   return -1;   // Failure.
  • sbliveos2/trunk/drv16/midimsg.hpp

    r142 r561  
    5555
    5656// Byte length of the IBM Sysex Signature (0xF000003A).
    57 const IBMSysexSigLen = 4;
     57const int IBMSysexSigLen = 4;
    5858
    5959// Miscellaneous error codes, must be <0.
     
    6868// Longest message at time of this writing is 4 byte IBM Sysex signature
    6969// plus 4 bytes sysex command and data == 8 bytes.  We'll tack on 2 extra.
    70 const MAX_MidiMsgLen = (IBMSysexSigLen + 4 + 2);
     70const int MAX_MidiMsgLen = (IBMSysexSigLen + 4 + 2);
    7171
    7272// We use this class to build up MIDI messages as we receive the bytes.
  • sbliveos2/trunk/drv16/midistrm.hpp

    r142 r561  
    3939
    4040// Number of notes in the MIDI definition.
    41 const NUM_MidiNotes = 128;
     41const USHORT NUM_MidiNotes = 128;
    4242
    4343// Number of channels in the MIDI definition.
    44 const NUM_MidiChannels = 16;
     44const USHORT NUM_MidiChannels = 16;
    4545
    4646// The MIDI parser is always in one of the following states.
  • sbliveos2/trunk/drv16/mpu401.cpp

    r205 r561  
    6363}
    6464
    65 virtual void MPU_401::noteOff( BYTE mchan, BYTE note, BYTE velocity )
     65void MPU_401::noteOff( BYTE mchan, BYTE note, BYTE velocity )
    6666{
    6767   writeByte( (BYTE) 0x80 | mchan );
     
    7070}
    7171
    72 virtual void MPU_401::noteOn( BYTE mchan, BYTE note, BYTE velocity )
     72void MPU_401::noteOn( BYTE mchan, BYTE note, BYTE velocity )
    7373{
    7474   writeByte( (BYTE) 0x90 | mchan );
     
    7777}
    7878
    79 virtual void MPU_401::polyphonicPressure( BYTE mchan, BYTE note, BYTE value )
     79void MPU_401::polyphonicPressure( BYTE mchan, BYTE note, BYTE value )
    8080{
    8181   writeByte( (BYTE) 0xA0 | mchan );
     
    8484}
    8585
    86 virtual void MPU_401::controlChange( BYTE mchan, BYTE control_number, BYTE value )
     86void MPU_401::controlChange( BYTE mchan, BYTE control_number, BYTE value )
    8787{
    8888   writeByte( (BYTE) 0xB0 | mchan );
     
    9191}
    9292
    93 virtual void MPU_401::programChange( BYTE mchan, BYTE program_number )
     93void MPU_401::programChange( BYTE mchan, BYTE program_number )
    9494{
    9595   writeByte( (BYTE) 0xC0 | mchan );
     
    9797}
    9898
    99 virtual void MPU_401::channelPressure( BYTE mchan, BYTE value )
     99void MPU_401::channelPressure( BYTE mchan, BYTE value )
    100100{
    101101   writeByte( (BYTE) 0xD0 | mchan );
     
    103103}
    104104
    105 virtual void MPU_401::pitchBend( BYTE mchan, BYTE value_lsb, BYTE value_msb )
     105void MPU_401::pitchBend( BYTE mchan, BYTE value_lsb, BYTE value_msb )
    106106{
    107107   writeByte( (BYTE) 0xE0 | mchan );
  • sbliveos2/trunk/drv16/sizedefs.h

    r142 r561  
    2424#define SIZEDEFS_H
    2525
    26 const NumLogicalDevices = 5; // Number of PNP logical devices on adapter.
    27 
    2826#define HEAP_SIZE         16384         // must be a multiple of 4
    2927#define DEFAULT_HEAP      4096
  • sbliveos2/trunk/drv16/stream.cpp

    r181 r561  
    189189
    190190#pragma off (unreferenced)
    191 virtual ULONG STREAM::Write(PSTREAMBUF pbuf, ULONG uLength, BOOL fLooping)
     191ULONG STREAM::Write(PSTREAMBUF pbuf, ULONG uLength, BOOL fLooping)
    192192#pragma on (unreferenced)
    193193{
  • sbliveos2/trunk/drv16/timer.cpp

    r178 r561  
    250250 * @notes Maps operation to _iStop (Stop and Pause are identical).
    251251 */
    252 virtual int TIMER::Stop( void )
     252int TIMER::Stop( void )
    253253{
    254254   return _iStop();
     
    262262 * @notes Maps operation to _iStop (Stop and Pause are identical).
    263263 */
    264 virtual int TIMER::Pause( void )
     264int TIMER::Pause( void )
    265265{
    266266   return _iStop();
     
    274274 * @notes Maps operation to _iStart (Start and Resume are identical).
    275275 */
    276 virtual int TIMER::Resume( void )
     276int TIMER::Resume( void )
    277277{
    278278   return _iStart();
  • sbliveos2/trunk/drv16/waudio.cpp

    r178 r561  
    291291 */
    292292#pragma off (unreferenced)
    293 virtual void WAVEAUDIO::ConfigDev(STREAM *stream, PWAVECONFIGINFO pConfigInfo)
     293void WAVEAUDIO::ConfigDev(STREAM *stream, PWAVECONFIGINFO pConfigInfo)
    294294#pragma on (unreferenced)
    295295{
  • sbliveos2/trunk/drv16/waveplay.cpp

    r142 r561  
    6565/*                                                                            */
    6666/******************************************************************************/
    67 virtual int WAVEPLAY::Start(STREAM *stream)
     67int WAVEPLAY::Start(STREAM *stream)
    6868{
    6969   return OSS16_StartStream(stream) != TRUE;
     
    7474/*                                                                            */
    7575/******************************************************************************/
    76 virtual int WAVEPLAY::Stop(STREAM *stream)
     76int WAVEPLAY::Stop(STREAM *stream)
    7777{
    7878   return OSS16_StopStream(stream) != TRUE;
    7979}
    8080
    81 virtual void WAVEPLAY::ConfigDev(STREAM *stream, PWAVECONFIGINFO pConfigInfo)
     81void WAVEPLAY::ConfigDev(STREAM *stream, PWAVECONFIGINFO pConfigInfo)
    8282{
    8383 FORMAT_INFO formatInfo;
  • sbliveos2/trunk/drv16/waverec.cpp

    r142 r561  
    6565/*                                                                            */
    6666/******************************************************************************/
    67 virtual int WAVEREC::Start(STREAM *stream)
     67int WAVEREC::Start(STREAM *stream)
    6868{
    6969   return OSS16_StartStream(stream) != TRUE;
     
    7474/*                                                                            */
    7575/******************************************************************************/
    76 virtual int WAVEREC::Stop(STREAM *stream)
     76int WAVEREC::Stop(STREAM *stream)
    7777{
    7878   return OSS16_StopStream(stream) != TRUE;
    7979}
    8080
    81 virtual void WAVEREC::ConfigDev(STREAM *stream, PWAVECONFIGINFO pConfigInfo)
     81void WAVEREC::ConfigDev(STREAM *stream, PWAVECONFIGINFO pConfigInfo)
    8282{
    8383 FORMAT_INFO formatInfo;
  • sbliveos2/trunk/lib32/debug.c

    r151 r561  
    5050
    5151char hextab[]="0123456789ABCDEF";
     52
     53#ifdef DEBUG                            //--------------------------- CharOut -
     54void CharOut(char c)
     55{
     56        _asm    {
     57
     58        mov     dx, MAGIC_COMM_PORT     // address of PS/2's first COM port
     59        add     dx, UART_LINE_STAT
     60
     61ReadyCheck:
     62        in      al, dx                                                          // wait for comm port ready signal
     63
     64        DELAY
     65        DELAY
     66        DELAY
     67
     68        test    al, 020h
     69        jz      ReadyCheck
     70
     71        // Send the character
     72
     73        add     dx, UART_DATA - UART_LINE_STAT
     74        mov     al,c
     75        out     dx, al
     76
     77        DELAY
     78        DELAY
     79        DELAY
     80        }
     81}
     82#endif
     83
     84#ifdef DEBUG                            //------------------------- StringOut -
     85void StringOut(char *DbgStr)
     86{
     87   while (*DbgStr)
     88      CharOut(*DbgStr++);
     89
     90   if (fLineTerminate)
     91   {
     92      CharOut(CR);                              // append carriage return,
     93      CharOut(LF);                              // linefeed
     94   }
     95}
     96#endif
     97
    5298
    5399                                        //-------------------- DecLongToASCII -
     
    373419}
    374420
    375 #ifdef DEBUG                            //------------------------- StringOut -
    376 void StringOut(char *DbgStr)
    377 {
    378    while (*DbgStr)
    379       CharOut(*DbgStr++);
    380 
    381    if (fLineTerminate)
    382    {
    383       CharOut(CR);                              // append carriage return,
    384       CharOut(LF);                              // linefeed
    385    }
    386 }
    387 #endif
    388 
    389421#ifdef DEBUG
    390422//#define       MAGIC_COMM_PORT 0x3f8           // pulled from word ptr 40:0
     
    405437#endif
    406438
    407 #ifdef DEBUG                            //--------------------------- CharOut -
    408 void CharOut(char c)
    409 {
    410         _asm    {
    411 
    412         mov     dx, MAGIC_COMM_PORT     // address of PS/2's first COM port
    413         add     dx, UART_LINE_STAT
    414 
    415 ReadyCheck:
    416         in      al, dx                                                          // wait for comm port ready signal
    417 
    418         DELAY
    419         DELAY
    420         DELAY
    421 
    422         test    al, 020h
    423         jz      ReadyCheck
    424 
    425         // Send the character
    426 
    427         add     dx, UART_DATA - UART_LINE_STAT
    428         mov     al,c
    429         out     dx, al
    430 
    431         DELAY
    432         DELAY
    433         DELAY
    434         }
    435 }
    436 #endif
Note: See TracChangeset for help on using the changeset viewer.