Exemplo n.º 1
0
void NewportRestoreXmap9s( ScrnInfoPtr pScrn)
{
	NewportPtr pNewport = NEWPORTPTR(pScrn);
	NewportRegsPtr pNewportRegs = NEWPORTREGSPTR(pScrn);

	/* mode register 0 */
	NewportXmap9SetModeRegister( pNewportRegs , 0, pNewport->txt_xmap9_mod0 );
	NewportBfwait(pNewport->pNewportRegs);
	/* mode index register */
	pNewportRegs->set.dcbmode = (DCB_XMAP_ALL | W_DCB_XMAP9_PROTOCOL |
				XM9_CRS_MODE_REG_INDEX | NPORT_DMODE_W1 );
	pNewportRegs->set.dcbdata0.bytes.b3 = pNewport->txt_xmap9_mi;
	NewportBfwait(pNewport->pNewportRegs);
	/* cfg xmap0 */
	pNewportRegs->set.dcbmode = (DCB_XMAP0 | W_DCB_XMAP9_PROTOCOL |
				XM9_CRS_CONFIG | NPORT_DMODE_W1 );
	pNewportRegs->set.dcbdata0.bytes.b3 = pNewport->txt_xmap9_cfg0;
	NewportBfwait(pNewport->pNewportRegs);
	/* cfg xmap1 */
	pNewportRegs->set.dcbmode = (DCB_XMAP1 | W_DCB_XMAP9_PROTOCOL |
				XM9_CRS_CONFIG | NPORT_DMODE_W1 );
	pNewportRegs->set.dcbdata0.bytes.b3 = pNewport->txt_xmap9_cfg1;
	/* cursor cmap msb */
	pNewportRegs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
			XM9_CRS_CURS_CMAP_MSB | NPORT_DMODE_W1 );
	pNewportRegs->set.dcbdata0.bytes.b3 = pNewport->txt_xmap9_ccmsb;
}
Exemplo n.º 2
0
void NewportBackupXmap9s( ScrnInfoPtr pScrn)
{
	NewportPtr pNewport = NEWPORTPTR(pScrn);
	NewportRegsPtr pNewportRegs = NEWPORTREGSPTR(pScrn);

	NewportBfwait(pNewport->pNewportRegs);
	/* config of xmap0 */
	pNewportRegs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
			XM9_CRS_CONFIG | NPORT_DMODE_W1 );
	pNewport->txt_xmap9_cfg0 = pNewportRegs->set.dcbdata0.bytes.b3;
	NewportBfwait(pNewport->pNewportRegs);
	/* config of xmap1 */
	pNewportRegs->set.dcbmode = (DCB_XMAP1 | R_DCB_XMAP9_PROTOCOL |
				XM9_CRS_CONFIG | NPORT_DMODE_W1 );
	pNewport->txt_xmap9_cfg1 = pNewportRegs->set.dcbdata0.bytes.b3;
	NewportBfwait(pNewport->pNewportRegs);
	/* mode index register of xmap0 */
	pNewportRegs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
				XM9_CRS_MODE_REG_INDEX | NPORT_DMODE_W1 );
	pNewport->txt_xmap9_mi = pNewportRegs->set.dcbdata0.bytes.b3; 
	/* mode register 0 of xmap 0 */
	pNewport->txt_xmap9_mod0 = NewportXmap9GetModeRegister(pNewportRegs, 0, 0);
	/* cursor cmap msb */
	pNewportRegs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
			XM9_CRS_CURS_CMAP_MSB | NPORT_DMODE_W1 );
	pNewport->txt_xmap9_ccmsb = pNewportRegs->set.dcbdata0.bytes.b3;
}
Exemplo n.º 3
0
/* wait til an entry in the Xmap9's Mode Fifo is free (xmapChip = DCB_XMAP0 | DCB_XMAP1) */
static void
NewportXmap9FifoWait(NewportRegsPtr pNewportRegs, unsigned long xmapChip)
{
	while(1) {
		NewportBfwait( pNewportRegs);
		pNewportRegs->set.dcbmode = (xmapChip | R_DCB_XMAP9_PROTOCOL |
						XM9_CRS_FIFO_AVAIL | NPORT_DMODE_W1);
		if( (pNewportRegs->set.dcbdata0.bytes.b3) & 7 ) 
			break;
	}
}
/* Load a colormap into the hardware */
void NewportLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, \
			LOCO* colors, VisualPtr pVisual)
{
	int i,index;
	NewportRegsPtr pNewportRegs = NEWPORTPTR(pScrn)->pNewportRegs;
	
	for(i = 0; i < numColors; i++) {
		index=indices[i];
 		NewportBfwait(pNewportRegs);
		NewportCmapSetRGB(pNewportRegs, index, colors[index]);
        }
}
/* set the colormap entry at addr to color */
void NewportCmapSetRGB( NewportRegsPtr pNewportRegs, unsigned short addr, LOCO color)
{
	NewportWait(pNewportRegs);	/* this one should not be necessary */
	NewportBfwait(pNewportRegs);
	pNewportRegs->set.dcbmode = (NPORT_DMODE_ACMALL | NCMAP_PROTOCOL |
				NPORT_DMODE_SENDIAN | NPORT_DMODE_ECINC |
				NCMAP_REGADDR_AREG | NPORT_DMODE_W2);
	pNewportRegs->set.dcbdata0.hwords.s1 = addr;
	pNewportRegs->set.dcbmode = (NPORT_DMODE_ACMALL | NCMAP_PROTOCOL |
				 NCMAP_REGADDR_PBUF | NPORT_DMODE_W3);
	pNewportRegs->set.dcbdata0.all = (color.red << 24) |
						(color.green << 16) |
						(color.blue << 8);
}
/* get the colormap entry at addr */
static void NewportCmapGetRGB( NewportRegsPtr pNewportRegs, unsigned short addr, LOCO* color)
{
	npireg_t tmp;

	NewportBfwait(pNewportRegs);
	pNewportRegs->set.dcbmode = (NPORT_DMODE_ACM0 | NCMAP_PROTOCOL |
				NPORT_DMODE_SENDIAN | NPORT_DMODE_ECINC |
				NCMAP_REGADDR_AREG | NPORT_DMODE_W2);
	pNewportRegs->set.dcbdata0.hwords.s1 = addr;
	pNewportRegs->set.dcbmode = (NPORT_DMODE_ACM0 | NCMAP_PROTOCOL |
				 NCMAP_REGADDR_PBUF | NPORT_DMODE_W3);
	tmp = pNewportRegs->set.dcbdata0.all;
	color->red = (tmp >> 24) & 0xff;
	color->green = (tmp >> 16) & 0xff;
	color->blue = (tmp >> 8) & 0xff;
}
Exemplo n.º 7
0
void
NewportBackupVc2Cursor( ScrnInfoPtr pScrn)
{
	int i;
	CARD16 tmp, *data;
	NewportPtr pNewport = NEWPORTPTR(pScrn);
	NewportRegsPtr pNewportRegs = NEWPORTREGSPTR(pScrn);

	data = (CARD16*)pNewport->txt_vc2cur_data;
	/* address of cursor data in vc2's ram */
        tmp = NewportVc2Get( pNewportRegs, VC2_IREG_CENTRY);
 	/* this is where we want to write to: */
        NewportVc2Set( pNewportRegs, VC2_IREG_RADDR, tmp);
        pNewportRegs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
                               		NPORT_DMODE_W2 | VC2_PROTOCOL);
	/* read cursor data */
        for (i = 0; i < 128; i++) {
		NewportBfwait(pNewportRegs);
		*data = pNewportRegs->set.dcbdata0.hwords.s1;
		data++;
        }
}