Exemple #1
0
/*--------------------------------------------------------------------------*/
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
}
Exemple #2
0
/*--------------------------------------------------------------------------*/
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);
}
Exemple #3
0
/*--------------------------------------------------------------------------*/
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);
}
Exemple #4
0
/*--------------------------------------------------------------------------*/
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;
}
Exemple #5
0
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
}
Exemple #6
0
/*--------------------------------------------------------------------------*/
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();
    }
}
Exemple #7
0
/*--------------------------------------------------------------------------*/
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;
}
Exemple #8
0
/*--------------------------------------------------------------------------*/
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;
        }
    }
}
Exemple #9
0
/*--------------------------------------------------------------------------*/
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);
}
Exemple #10
0
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
}
Exemple #11
0
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
}
Exemple #12
0
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;
}