예제 #1
0
파일: Fifo.c 프로젝트: DonCN/haiku
void
FifoUpdateFullscreen(void)
{
	FifoBeginWrite();
	FifoWrite(SVGA_CMD_UPDATE);
	FifoWrite(0);
	FifoWrite(0);
	FifoWrite(gSi->dm.virtual_width);
	FifoWrite(gSi->dm.virtual_height);
	FifoEndWrite();
}
예제 #2
0
파일: twi.c 프로젝트: Cupo/S.M.A.U.G
uint8_t write_to_TwiFIFO(char msg[])
{
	if(FifoWrite(gTwiFIFO, (unsigned char)strlen(msg)))
	{
		display_text("FIFO ERROR 3");
		return 1;
	}
	
	for(int i = 0; i < strlen(msg); ++i)
	{
		if(FifoWrite(gTwiFIFO, msg[i]))
		{
			display_text("FIFO ERROR 4");
			return 1;
		}
	}
	
	return 0;
}
예제 #3
0
파일: bitblt.c 프로젝트: Gaikokujin/WinNT4
VOID
DrvpFillRectangle(
   IN  PRECTL    DstRect,
   IN  ULONG    Color
   )
/*++

Routine Description:

    Place a solid color fill command into the FIFO

Arguments:

   DestRect   -   Rectangle to fill
   Color      -   Fill color

Return Value:

   Status of operation.

--*/
{

    ULONG   X,Y;
    ULONG   XYCmd;
    ULONG   DstAdr;

    //
    // calculate size of the fill.
    //

    X = (ULONG)(DstRect->right - DstRect->left);
    Y = (ULONG)(DstRect->bottom - DstRect->top);
    Y &= 0x3FF;

    XYCmd=(JAGUAR_SOLID_FILL << XYCMD_CMD_SHIFT) | (Y << XYCMD_Y_SHIFT) | X;

    DstAdr= Vxl.JaguarScreenX*DstRect->top + (DstRect->left << Vxl.ColorModeShift);

    //
    //  Write command to the FIFO.
    //

    FifoWrite(DstAdr,Color,XYCmd);

}
예제 #4
0
void
SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count)
{
	uint32 i;
	blit_params *b;

	FifoBeginWrite();
	for (i = 0; i < count; i++) {
		b = &list[i];
#if 0
		TRACE("BLIT %dx%d, %dx%d->%dx%d\n", b->width + 1, b->height + 1,
			b->src_left, b->src_top, b->dest_left, b->dest_top);
#endif
		FifoWrite(SVGA_CMD_RECT_COPY);
		FifoWrite(b->src_left);
		FifoWrite(b->src_top);
		FifoWrite(b->dest_left);
		FifoWrite(b->dest_top);
		FifoWrite(b->width + 1);
		FifoWrite(b->height + 1);
	}
	FifoEndWrite();
	FifoSync();
}
예제 #5
0
파일: bitblt.c 프로젝트: Gaikokujin/WinNT4
VOID
DrvpBitBlt(
   IN PRECTL DstRect,
   IN PPOINTL SrcPoint,
   IN BOOL BltDir
   )
/*++

Routine Description:

    Place a BitBlt command into the FIFO

Arguments:

   DstRect    -   Destination Rectangle
   SrcPoint   -   Source Point
   BltDir     -   FALSE = Left to Right Top to Bottom.
          TRUE = Right to Left Bottom to Top

Return Value:

   None.

--*/
{

    ULONG   X,Y;
    ULONG   XYCmd;
    ULONG   SrcAdr;
    ULONG   DstAdr;

    X = DstRect->right - DstRect->left;
    Y = DstRect->bottom - DstRect->top;
    if (BltDir) {

        //
        // This is a Right To Left Bottom to Top BitBlt
        // Src and Dest adr are the first byte of the pixel to
        // be moved. That is the most significant byte of the pixel.
        // The Rectangle excludes the bottom right corner which
        // is the start address for these sort of bitblts.
        // One is substracted from the Y to exclude the last line.
        // One is substracted from the X after addjusting it to the
        // size of the pixel. So the address of the next pixel is computed
        // and then one is substracted which gives the address of the
        // most significant byte of the previous pixel.
        //

        DstAdr=Vxl.JaguarScreenX*(DstRect->bottom-1) + ((DstRect->right) << Vxl.ColorModeShift) -1;
        SrcAdr=Vxl.JaguarScreenX*(SrcPoint->y+Y-1) + ((SrcPoint->x+X) << Vxl.ColorModeShift) -1;
        XYCmd=JAGUAR_BITBLT_RIGHTLEFT << XYCMD_CMD_SHIFT;

    } else {

        //
        // This is a Left To Right Top to Bottom.
        //

        DstAdr=Vxl.JaguarScreenX*DstRect->top + (DstRect->left << Vxl.ColorModeShift);
        SrcAdr=Vxl.JaguarScreenX*SrcPoint->y + (SrcPoint->x << Vxl.ColorModeShift);
        XYCmd=JAGUAR_BITBLT_LEFTRIGHT << XYCMD_CMD_SHIFT;

    }
    Y &= 0x3FF;

    XYCmd = XYCmd | (Y << XYCMD_Y_SHIFT) | X;
    FifoWrite(DstAdr,SrcAdr,XYCmd);
}