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

misc updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.
Note: See TracChangeset for help on using the changeset viewer.