Exemplo n.º 1
0
int  Driver_Set_Graphics( int  mode )
{
    union REGS  regs;


    switch ( mode )
    {
    case Graphics_Mode_Mono:    /* Standard VGA 640x480x16 mode */
        reg_ax = 0x12;
        int86( 0x10, &regs, &regs );

        vio_ScanLineWidth = 80;
        vio_Width         = 640;
        vio_Height        = 480;
        break;

    case Graphics_Mode_Gray:    /* Standard VGA 320x200x256 mode */
        reg_ax = 0x13;
        int86( 0x10, &regs, &regs );

        vio_ScanLineWidth = 320;
        vio_Width         = 320;
        vio_Height        = 200;

        /* default gray_palette takes the gray levels of the standard VGA */
        /* 256 colors mode                                                */

        gray_palette[0] = 0;
        gray_palette[1] = 23;
        gray_palette[2] = 27;
        gray_palette[3] = 29;
        gray_palette[4] = 31;
        break;

    default:
        return 0;                 /* failure */
    }

#if defined( __EMX__ )
    Vio = _memaccess( 0xA0000, 0xAFFFF, 1 );
#elif defined( DJGPP )
    Vio = (char *)0xA0000;
#elif defined( __WATCOMC__ ) && defined( __386__ )
    Vio = (char *)0xA0000;
#elif defined( DOSX286 )
    {
        unsigned short  sel;


        if ( DosMapRealSeg( 0xA000, (long)vio_ScanLineWidth*vio_Height, &sel ) )
            return 0;                 /* failure */

        Vio = (char*)MK_FP( sel, 0 );
    }
#else
    Vio = (char*)MK_FP( 0xA000, 0 );
#endif

    return 1;                   /* success */
}
Exemplo n.º 2
0
void _InitSegments( void )
//========================

{
    int                 i;
    struct seg_table    *p;

    p = _SegTable;
    for( i = 0; i < NUM_SELECTORS; ++i, ++p ) {
        DosMapRealSeg( p->seg, p->length, p->desc );
    }
    DosGetBIOSSeg( &_BiosSeg );
    _BiosOff = 0;
    _RomOff = 0;
    DosCreateCSAlias( FP_SEG( &i ), &_StackSeg );
}