misc.cpp

来自「WinCE 3.0 BSP, 包含Inter SA1110, Intel_815」· C++ 代码 · 共 133 行

CPP
133
字号
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995, 1996, 1997, 1998  Microsoft Corporation

Module Name:  

Abstract:  
  Sample MGDI driver (for IGS2010)
  
Functions:


Notes: 


--*/


#include "precomp.h"

#ifdef FB16BPP
ulong BitMasks[] = { 0xF800,0x07E0,0x001F };
#else   // FB16BPP
ulong BitMasks[] = { 0,0,0 };
#endif  // FB16BPP


//
//  WaitForNotBusy - 
//  inputs:  
//  outputs: 
//
void IGS2010::WaitForNotBusy()
{
#ifdef ENABLE_ACCELERATION
    unsigned long i;

    for (i = 0; i < 0x1000000; i++) {
        if ((reg_Cop_control & 0x80) == 0) {
            break;
        }
    }
#else
    return;
#endif
}

//
//  IsBusy - 
//  inputs:  
//  outputs: 
//
int IGS2010::IsBusy()
{
#ifdef ENABLE_ACCELERATION
    return ( ( reg_Cop_control & 0x80 ) != 0 );
#else
    return 0;
#endif
}


#ifdef ENABLE_ACCELERATION
//
//  SelectSolidColor - 
//  inputs:  
//  outputs: 
//
void IGS2010::SelectSolidColor( unsigned long color )
{
    // Set color and mix mode
    WaitForNotBusy();
    reg_Fore_Mix     = (char) Mix_S;
    reg_Fore_Color   = color;

}
#endif

//
//  GetModeInfo - 
//  inputs:  
//  outputs: 
//
SCODE IGS2010::GetModeInfo(
    GPEMode *pMode,
    int modeNo )
{
    if( modeNo<0 || modeNo >= NumModes() ) {
        return E_INVALIDARG;
    }

    *pMode = VGAMode[modeNo].gpeMode;
    return S_OK;
}

//
//  NumModes - 
//  inputs:  
//  outputs: 
//
int IGS2010::NumModes()
{
    return 1;
}


//
//  DrvGetMasks - 
//  inputs:  
//  outputs: 
//
ULONG *APIENTRY DrvGetMasks(
    DHPDEV     dhpdev)
{
    return BitMasks;
}

//
//  GetPhysicalVideoMemory - 
//  inputs:  
//  outputs: 
//
void IGS2010::GetPhysicalVideoMemory(
    unsigned long *pPhysicalMemoryBase,
    unsigned long *pVideoMemorySize )
{
    *pPhysicalMemoryBase = m_nLAWPhysical;
    *pVideoMemorySize = m_nVideoMemorySize;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?