예제 #1
0
파일: 1376scr8.cpp 프로젝트: garyqinyu/abv
/*--------------------------------------------------------------------------*/
SED1376Screen8::SED1376Screen8(PegRect &Rect) : PegScreen(Rect)
{
    mdNumColors = 256;

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();

    mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
    UCHAR PEGFAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = CurrentPtr;
        CurrentPtr += mwHRes;
    }

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;

    ConfigureController();        // set up controller registers
    SetPalette(0, 232, DefPalette256);

#ifdef PEGWIN32
    mwWinRectXOffset = 0;
    mwWinRectYOffset = 0;
#endif
}
예제 #2
0
파일: dragon4.cpp 프로젝트: garyqinyu/abv
/*--------------------------------------------------------------------------*/
Dragon4Screen::Dragon4Screen(PegRect &Rect) : PegScreen(Rect)
{
    mdNumColors = 16;  

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();

    mpScanPointers = new UCHAR *[Rect.Height()];

    UCHAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = CurrentPtr;
        CurrentPtr += mwHRes >> 1;
    }

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;

    ConfigureController();        // set up controller registers

    SetPalette(0, 16, GrayPalette);
}
예제 #3
0
파일: 1355scrn.cpp 프로젝트: garyqinyu/abv
/*--------------------------------------------------------------------------*/
SED1355Screen::SED1355Screen(PegRect &Rect, BOOL bDual) : PegScreen(Rect)
{
    mdNumColors = 256;
    mbDualMode = bDual;

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();

    mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
    UCHAR PEGFAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = CurrentPtr;
        CurrentPtr += mwHRes;
    }

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;

    ConfigureController();        // set up controller registers
    SetPalette(0, 232, DefPalette256);
}
예제 #4
0
파일: SVGASCR8.CPP 프로젝트: garyqinyu/abv
/*--------------------------------------------------------------------------*/
GenericSvgaScreen::GenericSvgaScreen(PegRect &Rect) : PegScreen(Rect)
{
	mdNumColors = 256;

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();
    WORD wPitch = mwHRes;

    ConfigureController();        // set up controller registers

    SetPalette(0, 232, DefPalette256);

    mpScanPointers = new UCHAR *[Rect.Height()];
    UCHAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = CurrentPtr;
        CurrentPtr += wPitch;
    }

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;
}
예제 #5
0
파일: 1353scr4.cpp 프로젝트: garyqinyu/abv
SED1353Screen::SED1353Screen(HWND hWnd, PegRect &Rect) : PegScreen(Rect)
#else
SED1353Screen::SED1353Screen(PegRect &Rect) : PegScreen(Rect)
#endif
{
    mdNumColors = 16;  

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();

    mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];

    UCHAR PEGFAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = CurrentPtr;
        CurrentPtr += mwHRes >> 1;
    }

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;

    ConfigureController();        // set up controller registers


#ifdef PEGWIN32

   // Some setup stuff for the BitBlitting function:

   mHWnd = hWnd;
   mhPalette = NULL;
   RECT lSize;
   ::GetClientRect(mHWnd, &lSize);

   mwWinRectXOffset = (lSize.right - mwHRes) / 2;
   mwWinRectYOffset = (lSize.bottom -mwVRes) / 2;
#endif

    SetPalette(0, 16, DefPalette16);
}


/*--------------------------------------------------------------------------*/
// *** This function must be filled in by the developer ***
/*--------------------------------------------------------------------------*/
UCHAR PEGFAR *SED1353Screen::GetVideoAddress(void)
{
#ifdef PEGWIN32

    DWORD dSize = mwHRes / 2 * mwVRes;
    UCHAR *pMem = new UCHAR[dSize];
    return pMem; 

#else
    return (UCHAR *) VID_MEM_BASE;
#endif
}
예제 #6
0
파일: pmenu.cpp 프로젝트: garyqinyu/abv
/*--------------------------------------------------------------------------*/
void PegMenuBar::PositionButtons(void)
{
    PegRect Put;
    PegRect Current;
    Put.wTop = mReal.wTop + 2;
    Put.wLeft = mReal.wLeft + 2;
    Put.wRight = Put.wLeft;
    PegMessage NewMessage;

    // I have to figure out where my children go!

    PegMenuButton *pButton = (PegMenuButton *) First();

    while(pButton)
    {
        Put.wLeft = Put.wRight + 4;
        Current = pButton->GetMinSize(TYPE_MENU_BAR);
        Put.wRight = Put.wLeft + Current.Width();
        Put.wBottom = Put.wTop + Current.Height() - 1;
        NewMessage.wType = PM_SIZE;
        NewMessage.Rect = Put;
        pButton->Message(NewMessage);
        pButton = (PegMenuButton *) pButton->Next();
    }
}
예제 #7
0
파일: pmenu.cpp 프로젝트: garyqinyu/abv
/*--------------------------------------------------------------------------*/
PegRect PegMenu::GetMinSize(void)
{
    PegRect SizeRect;
    PegRect CurrentSize;
    SizeRect.Set(0, 0, 0, 0);

    PegMenuButton *pButton = (PegMenuButton *) First();

    while(pButton)
    {
        CurrentSize = pButton->GetMinSize(TYPE_MENU);
        if (CurrentSize.Width() > SizeRect.Width())
        {
            SizeRect.wRight += CurrentSize.Width() - SizeRect.Width();
        }
        SizeRect.wBottom += CurrentSize.Height();
        pButton = (PegMenuButton *) pButton->Next();
    }
    SizeRect.wBottom += 6;
    SizeRect.wRight += 6;
    return SizeRect;
}
예제 #8
0
파일: pwindow.cpp 프로젝트: garyqinyu/abv
/*--------------------------------------------------------------------------*/
void PegWindow::CheckResizeRect(PegRect &NewSize)
{
    if (muMoveMode == PMM_MOVEALL)
    {
        return;
    }
    SIGNED iChange = mReal.Width() - NewSize.Width();
    SIGNED iMin;

    if (Type() == TYPE_WINDOW)
    {
        iMin = mClient.Width() - 4;
    }
    else
    {
        iMin = mReal.Width() - PEG_SCROLL_WIDTH * 5;
    }

    if (iChange > iMin)
    {
        switch(muMoveMode)
        {
        case PMM_MOVELEFT:
        case PMM_MOVEUL:
        case PMM_MOVELL:
            NewSize.wLeft -= iChange - iMin;
            break;

        default:
            NewSize.wRight += iChange - iMin;
        }
    }

    iChange = mReal.Height() - NewSize.Height();
    iMin = mClient.Height();

    if (iChange > iMin)
    {
        switch(muMoveMode)
        {
        case PMM_MOVETOP:
        case PMM_MOVEUL:
        case PMM_MOVEUR:
            NewSize.wTop -= iChange - iMin;
            break;

        default:
            NewSize.wBottom += iChange - iMin;
        }
    }
}
예제 #9
0
파일: permedia.cpp 프로젝트: garyqinyu/abv
/*--------------------------------------------------------------------------*/
Permedia2Screen::Permedia2Screen(PegRect &Rect) : PegScreen(Rect)
{
    mdNumColors = 256;

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();

    mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
    UCHAR PEGFAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = CurrentPtr;
        CurrentPtr += mwHRes;
    }

    ConfigureController();        // set up controller registers

   #ifdef USE_VID_MEM_MANAGER
    UCHAR *pStart = CurrentPtr;
            
    #ifdef HARDWARE_CURSOR
    pStart += 4 * 1024;        // leave 4K for mouse pointer bitmaps
    #endif

    UCHAR *pEnd = mpVidMemBase;
    pEnd += VID_MEM_SIZE - 1;
    InitVidMemManager(pStart, pEnd);
   #endif

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;

    SetPalette(0, 232, DefPalette256);
}
예제 #10
0
파일: 1375scr8.cpp 프로젝트: garyqinyu/abv
SED1375Screen8::SED1375Screen8(HWND hWnd, PegRect &Rect) : PegScreen(Rect)
#else
SED1375Screen8::SED1375Screen8(PegRect &Rect) : PegScreen(Rect)
#endif
{
    mdNumColors = 256;

   #ifdef PEGWIN32
    mhPalette = NULL;
   #endif

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();

    mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
    UCHAR PEGFAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = CurrentPtr;
        CurrentPtr += mwHRes;
    }

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;

    ConfigureController();        // set up controller registers


#ifdef PEGWIN32

   // Some setup stuff for the BitBlitting function:

   mHWnd = hWnd;
   RECT lSize;
   ::GetClientRect(mHWnd, &lSize);

   mwWinRectXOffset = (lSize.right - mwHRes) / 2;
   mwWinRectYOffset = (lSize.bottom -mwVRes) / 2;
   mhPalette = NULL;
#endif

    SetPalette(0, 232, DefPalette256);
}

/*--------------------------------------------------------------------------*/
// *** This function must be filled in by the developer ***
/*--------------------------------------------------------------------------*/
UCHAR PEGFAR *SED1375Screen8::GetVideoAddress(void)
{
#ifdef PEGWIN32

    DWORD dSize = mwHRes * mwVRes;
    UCHAR *pMem = new UCHAR[dSize];
    return pMem; 

#else

    // for an example, just allocate a buffer in dynamic memory:
   #ifdef DOUBLE_BUFFER
    DWORD dSize = mwHRes * mwVRes;
    UCHAR PEGFAR *pMem = new UCHAR[dSize];
    return pMem; 
   #else
	 return((UCHAR PEGFAR *) VID_MEM_BASE);
   #endif

#endif
}
예제 #11
0
파일: l24scrn.cpp 프로젝트: garyqinyu/abv
L24Screen::L24Screen(HWND hWnd, PegRect &Rect) : PegScreen(Rect)
#else
L24Screen::L24Screen(PegRect &Rect) : PegScreen(Rect)
#endif
{
    mdNumColors = 256;

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();

    mpScanPointers = new COLORVAL PEGFAR *[Rect.Height()];
    UCHAR PEGFAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = (COLORVAL *) CurrentPtr;
        CurrentPtr += mwHRes * 3;
    }

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;

    ConfigureController();        // set up controller registers

#ifdef PEGWIN32

   // Some setup stuff for the BitBlitting function:

   mHWnd = hWnd;
   RECT lSize;
   ::GetClientRect(mHWnd, &lSize);

   mwWinRectXOffset = (lSize.right - mwHRes) / 2;
   mwWinRectYOffset = (lSize.bottom -mwVRes) / 2;
#endif

    SetPalette(0, 232, DefPalette256);
}

/*--------------------------------------------------------------------------*/
// *** This function must be filled in by the developer ***
/*--------------------------------------------------------------------------*/
UCHAR PEGFAR *L24Screen::GetVideoAddress(void)
{
#ifdef PEGWIN32

    DWORD dSize = mwHRes * mwVRes * 3;
    UCHAR *pMem = new UCHAR[dSize];
    return pMem; 

#else

    #ifdef STATIC_FRAME_BUFFER

    // just return the address of the static array:
    UCHAR PEGFAR *pMem = (UCHAR PEGFAR *) gbVMemory;

    #else

    #if 0
    // for an example, just allocate a buffer in dynamic memory:

    DWORD dSize = mwHRes * mwVRes * 3;
    UCHAR *pMem = new UCHAR[dSize];

    #else
    UCHAR *pMem = (UCHAR *) 0x00800000L;
    #endif

    #endif
    return pMem; 

#endif
}
예제 #12
0
파일: l8scrn.cpp 프로젝트: garyqinyu/abv
L8Screen::L8Screen(HWND hWnd, PegRect &Rect) : PegScreen(Rect)
#else
L8Screen::L8Screen(PegRect &Rect) : PegScreen(Rect)
#endif
{
    mdNumColors = 256;

#ifdef PEGWIN32
    mhPalette = NULL;
#endif

    mwHRes = Rect.Width();
    mwVRes = Rect.Height();
    WORD wPitch = mwHRes;

#ifdef PEGWIN32

    // Windows bitmaps must be modulo-4 byte in width:
    wPitch += 3;
    wPitch &= 0xfffc;

#endif

    mpScanPointers = new UCHAR PEGFAR *[Rect.Height()];
    UCHAR PEGFAR *CurrentPtr = GetVideoAddress();

    for (SIGNED iLoop = 0; iLoop < Rect.Height(); iLoop++)
    {
        mpScanPointers[iLoop] = CurrentPtr;
        CurrentPtr += wPitch;
    }

    mLastPointerPos.x = Rect.Width() / 2;
    mLastPointerPos.y = Rect.Height() / 2;
    mbPointerHidden = FALSE;
    mwDrawNesting = 0;

    ConfigureController();        // set up controller registers


#ifdef PEGWIN32

    // Some setup stuff for the BitBlitting function:

    mHWnd = hWnd;
    RECT lSize;
    ::GetClientRect(mHWnd, &lSize);

    mwWinRectXOffset = (lSize.right - mwHRes) / 2;
    mwWinRectYOffset = (lSize.bottom -mwVRes) / 2;
    mhPalette = NULL;
#endif

    SetPalette(0, 232, DefPalette256);
}

/*--------------------------------------------------------------------------*/
// *** This function must be filled in by the developer ***
/*--------------------------------------------------------------------------*/
UCHAR PEGFAR *L8Screen::GetVideoAddress(void)
{
    UCHAR PEGFAR *pMem;

#ifdef PEGWIN32

    DWORD dSize = mwHRes;
    dSize += 3;
    dSize &= 0xfffffffc;
    dSize *= mwVRes;
    pMem = new UCHAR[dSize];

#else

#ifdef STATIC_FRAME_BUFFER

    // simply return the address of the static array:

    pMem = (UCHAR PEGFAR *) gbVMemory;

#else

    // For an example, allocate a buffer in dynamic memory. This
    // would normally be an address specific to your hardware.

    DWORD dSize = mwHRes * mwVRes;

#ifdef DOUBLE_BUFFER
    dSize *= 2;
#endif

    pMem = new UCHAR[dSize];
#endif

#ifdef DOUBLE_BUFFER
    pMem += (DWORD) mwHRes * (DWORD) mwVRes;
#endif
#endif

    return pMem;
}