FreeBSD/sys/dev/fb/vga.c
/*
 * save_palette():
 * Read DAC values. The values have expressed in 8 bits.
 *
 * VGA
 */
Read DAC values. The values have expressed in 8 bits.

VGA
Read DAC values . The values have expressed in 8 bits . VGA
static int
vga_save_palette(video_adapter_t *adp, u_char *palette)
{
    int bits;
    int i;
    prologue(adp, V_ADP_PALETTE, ENODEV);
    outb(PALRADR, 0x00);
    bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2;
    for (i = 0; i < 256*3; ++i)
	palette[i] = inb(PALDATA) << bits; 
    inb(adp->va_crtc_addr + 6);	
    return 0;
}
static int vga_save_palette ( video_adapter_t * adp , u_char * palette ) { int bits ; int i ; prologue ( adp , V_ADP_PALETTE , ENODEV ) ; outb ( PALRADR , 0x00 ) ; bits = ( adp -> va_flags & V_ADP_DAC8 ) != 0 ? 0 : 2 ; for ( i = 0 ; i < 256 * 3 ; ++ i ) palette [ i ] = inb ( PALDATA ) << bits ; inb ( adp -> va_crtc_addr + 6 ) ; return 0 ; }
save_palette():
 Read DAC values.
save_palette () : Read DAC values .
/* 
     * We store 8 bit values in the palette buffer, while the standard
     * VGA has 6 bit DAC .
     */ /* reset flip/flop */