rem: FRAMEPTR SrcFramePtr;
context: DrawBatch (PPRIMITIVE lpBasePrim, PRIM_LINKS PrimLinks, register		BATCH_FLAGS BatchFlags){	RECT ValidRect;	HOT_SPOT OldHot;	if (GraphicsSystemActive () && GetFrameValidRect (&ValidRect, &OldHot))	{		COUNT CurIndex;		PRIM_LINKS OldLinks;		register PPRIMITIVE lpPrim;		BatchFlags &= BATCH_SINGLE				| BATCH_BUILD_PAGE				| BATCH_XFORM;		BatchFlags |= _get_context_flags () & BATCH_CLIP_GRAPHICS;		BatchGraphics ();		if (BatchFlags & BATCH_BUILD_PAGE)		{			ClearBackGround (&ValidRect);		}		CurIndex = GetPredLink (PrimLinks);		if (BatchFlags & BATCH_SINGLE)		{			if (CurIndex == END_OF_LIST)				BatchFlags &= ~BATCH_SINGLE;			else			{				lpBasePrim += CurIndex;				OldLinks = GetPrimLinks (lpBasePrim);				SetPrimLinks (lpBasePrim, END_OF_LIST, END_OF_LIST);				CurIndex = 0;			}		}		for (; CurIndex != END_OF_LIST; CurIndex = GetSuccLink (GetPrimLinks (lpPrim)))		{			register GRAPHICS_PRIM PrimType;			PPRIMITIVE lpWorkPrim;			RECT ClipRect;			FRAMEPTR SrcFramePtr;			TFB_Palette color;			DWORD c32k;			lpPrim = &lpBasePrim[CurIndex];			PrimType = GetPrimType (lpPrim);			if (!ValidPrimType (PrimType))				continue;			lpWorkPrim = lpPrim;			switch (PrimType)			{				case POINT_PRIM:					c32k = GetPrimColor (lpWorkPrim) >> 8; //shift out color index					color.r = (c32k >> (10 - (8 - 5))) & 0xF8;					color.g = (c32k >> (5 - (8 - 5))) & 0xF8;					color.b = (c32k << (8 - 5)) & 0xF8;										TFB_Prim_Point (&lpWorkPrim->Object.Point, &color);					break;				case STAMP_PRIM:					TFB_Prim_Stamp (&lpWorkPrim->Object.Stamp);					break;				case STAMPFILL_PRIM:					c32k = GetPrimColor (lpWorkPrim) >> 8; //shift out color index					color.r = (c32k >> (10 - (8 - 5))) & 0xF8;					color.g = (c32k >> (5 - (8 - 5))) & 0xF8;					color.b = (c32k << (8 - 5)) & 0xF8;					TFB_Prim_StampFill (&lpWorkPrim->Object.Stamp, &color);					break;				case LINE_PRIM:					c32k = GetPrimColor (lpWorkPrim) >> 8; //shift out color index					color.r = (c32k >> (10 - (8 - 5))) & 0xF8;					color.g = (c32k >> (5 - (8 - 5))) & 0xF8;					color.b = (c32k << (8 - 5)) & 0xF8;					TFB_Prim_Line (&lpWorkPrim->Object.Line, &color);					break;				case TEXT_PRIM:					if (!TextRect (&lpWorkPrim->Object.Text,							&ClipRect, NULL_PTR))						continue;					_save_stamp.origin = ClipRect.corner;										_text_blt (&ClipRect, lpWorkPrim);					break;				case RECT_PRIM:					c32k = GetPrimColor (lpWorkPrim) >> 8; //shift out color index					color.r = (c32k >> (10 - (8 - 5))) & 0xF8;					color.g = (c32k >> (5 - (8 - 5))) & 0xF8;					color.b = (c32k << (8 - 5)) & 0xF8;					TFB_Prim_Rect (&lpWorkPrim->Object.Rect, &color);				case RECTFILL_PRIM:					c32k = GetPrimColor (lpWorkPrim) >> 8; //shift out color index					color.r = (c32k >> (10 - (8 - 5))) & 0xF8;					color.g = (c32k >> (5 - (8 - 5))) & 0xF8;					color.b = (c32k << (8 - 5)) & 0xF8;					TFB_Prim_FillRect (&lpWorkPrim->Object.Rect, &color);					break;			}		}		UnbatchGraphics ();		_CurFramePtr->HotSpot = OldHot;		if (BatchFlags & BATCH_SINGLE)			SetPrimLinks (lpBasePrim,					GetPredLink (OldLinks),					GetSuccLink (OldLinks));	}}