diff options
Diffstat (limited to 'src/ffb_attr.c')
-rw-r--r-- | src/ffb_attr.c | 177 |
1 files changed, 0 insertions, 177 deletions
diff --git a/src/ffb_attr.c b/src/ffb_attr.c index 7b0d375..e1a3771 100644 --- a/src/ffb_attr.c +++ b/src/ffb_attr.c @@ -81,180 +81,3 @@ void __FFB_Attr_SFB_VAR(FFBPtr pFfb, unsigned int ppc, unsigned int ppc_mask, un ffb->rop = rop; ffb->pmask = pmask; } - -#define NEED_PPC 0x00000001 -#define NEED_PMASK 0x00000002 -#define NEED_ROP 0x00000004 -#define NEED_DRAWOP 0x00000008 -#define NEED_FG 0x00000010 -#define NEED_BG 0x00000020 -#define NEED_FBC 0x00000040 -#define NEED_WID 0x00000080 - -void __FFB_Attr_GC(FFBPtr pFfb, GCPtr pGC, WindowPtr pWin, unsigned int ppc, int drawop) -{ - ffb_fbcPtr ffb = pFfb->regs; - unsigned int rop, need_mask, need_count; - - need_mask = need_count = 0; - if ((pFfb->ppc_cache & FFB_PPC_GCMASK) != ppc) { - unsigned int newppc = pFfb->ppc_cache & ~FFB_PPC_GCMASK; - - newppc |= (ppc & FFB_PPC_GCMASK); - pFfb->ppc_cache = newppc; - need_mask |= NEED_PPC; - need_count++; - } - - if (pFfb->pmask_cache != pGC->planemask) { - pFfb->pmask_cache = pGC->planemask; - need_mask |= NEED_PMASK; - need_count++; - } - - rop = (pGC->alu | FFB_ROP_EDIT_BIT)|(FFB_ROP_NEW<<8); - if (pFfb->rop_cache != rop) { - pFfb->rop_cache = rop; - need_mask |= NEED_ROP; - need_count++; - } - - if (pFfb->drawop_cache != drawop) { - pFfb->drawop_cache = drawop; - need_mask |= NEED_DRAWOP; - need_count++; - } - - if (pFfb->fg_cache != pGC->fgPixel) { - pFfb->fg_cache = pGC->fgPixel; - need_mask |= NEED_FG; - need_count++; - } - - { - CreatorPrivWinPtr WinPriv = CreatorGetWindowPrivate(pWin); - unsigned int fbc = WinPriv->fbc_base; - - fbc &= ~FFB_FBC_XE_MASK; - fbc |= FFB_FBC_XE_OFF; - - if (pFfb->fbc_cache != fbc) { - pFfb->fbc_cache = fbc; - need_mask |= NEED_FBC; - need_count++; - } - - } - pFfb->rp_active = 1; - - FFBLOG(("WRATTRS_GC: PPC[%08x:%08x] PMSK[%08x] ROP[%08x] " - "DOP[%08x] FG[%08x] FBC[%08x]\n", - pFfb->ppc_cache & FFB_PPC_GCMASK, FFB_PPC_GCMASK, - pFfb->pmask_cache, pFfb->rop_cache, - pFfb->drawop_cache, pFfb->fg_cache, pFfb->fbc_cache)); - - FFBFifo(pFfb, need_count); - if (need_mask & NEED_PPC) - ffb->ppc = (pFfb->ppc_cache & FFB_PPC_GCMASK); - if (need_mask & NEED_PMASK) - ffb->pmask = pFfb->pmask_cache; - if (need_mask & NEED_ROP) - ffb->rop = pFfb->rop_cache; - if (need_mask & NEED_DRAWOP) - ffb->drawop = pFfb->drawop_cache; - if (need_mask & NEED_FG) - ffb->fg = pFfb->fg_cache; - if (need_mask & NEED_FBC) - ffb->fbc = pFfb->fbc_cache; -} - -void __FFB_Attr_FastfillWin(FFBPtr pFfb, WindowPtr pWin, - unsigned int ppc, unsigned int pixel) -{ - ffb_fbcPtr ffb = pFfb->regs; - unsigned int rop, need_mask, need_count; - - need_mask = need_count = 0; - if ((pFfb->ppc_cache & FFB_PPC_WINMASK) != ppc) { - unsigned int newppc = pFfb->ppc_cache & ~FFB_PPC_WINMASK; - - newppc |= (ppc & FFB_PPC_WINMASK); - pFfb->ppc_cache = newppc; - need_mask |= NEED_PPC; - need_count++; - } - - if (pFfb->pmask_cache != 0x00ffffff) { - pFfb->pmask_cache = 0x00ffffff; - need_mask |= NEED_PMASK; - need_count++; - } - - rop = FFB_ROP_NEW | (FFB_ROP_NEW<<8); - if (pFfb->rop_cache != rop) { - pFfb->rop_cache = rop; - need_mask |= NEED_ROP; - need_count++; - } - - if (pFfb->drawop_cache != FFB_DRAWOP_FASTFILL) { - pFfb->drawop_cache = FFB_DRAWOP_FASTFILL; - need_mask |= NEED_DRAWOP; - need_count++; - } - - if (pFfb->fg_cache != pixel) { - pFfb->fg_cache = pixel; - need_mask |= NEED_FG; - need_count++; - } - - { - CreatorPrivWinPtr pWinPriv = CreatorGetWindowPrivate(pWin); - unsigned int fbc = pWinPriv->fbc_base; - - if (pFfb->has_double_buffer) { - fbc &= ~FFB_FBC_WB_MASK; - fbc |= FFB_FBC_WB_AB; - } - fbc &= ~(FFB_FBC_XE_MASK | FFB_FBC_RGBE_MASK); - fbc |= FFB_FBC_XE_ON | FFB_FBC_RGBE_ON; - if (pFfb->ffb_res == ffb_res_high) - fbc |= FFB_FBC_WB_B; - - if (pFfb->fbc_cache != fbc) { - pFfb->fbc_cache = fbc; - need_mask |= NEED_FBC; - need_count++; - } - - if (pFfb->wid_cache != pWinPriv->wid) { - pFfb->wid_cache = pWinPriv->wid; - need_mask |= NEED_WID; - need_count++; - } - } - - pFfb->rp_active = 1; - - FFBLOG(("WRATTRS_GC: PPC[%08x:%08x] PMSK[%08x] ROP[%08x] DOP[%08x] FG[%08x] FBC[%08x] WID[%02x]\n", - pFfb->ppc_cache & FFB_PPC_WINMASK, FFB_PPC_WINMASK, - pFfb->pmask_cache, pFfb->rop_cache, - pFfb->drawop_cache, pFfb->fg_cache, pFfb->fbc_cache, pFfb->wid_cache)); - - FFBFifo(pFfb, need_count); - if (need_mask & NEED_PPC) - ffb->ppc = (pFfb->ppc_cache & FFB_PPC_WINMASK); - if (need_mask & NEED_PMASK) - ffb->pmask = pFfb->pmask_cache; - if (need_mask & NEED_ROP) - ffb->rop = pFfb->rop_cache; - if (need_mask & NEED_DRAWOP) - ffb->drawop = pFfb->drawop_cache; - if (need_mask & NEED_FG) - ffb->fg = pFfb->fg_cache; - if (need_mask & NEED_FBC) - ffb->fbc = pFfb->fbc_cache; - if (need_mask & NEED_WID) - ffb->wid = pFfb->wid_cache; -} |