rem: KISAGRPHW(0xbc, (((((bes->hsrcendv >> 16) + 7) & ~8) / 8) - 1));
add: KISAGRPHW(0xbc, ((((bes->hsrcendv >> 16) + 9) >> 3) - 1));
context: void drv_program_bes_ISA(nm_bes_data *bes){	uint8 temp;	/* helper: some cards use pixels to define buffer pitch, others use bytes */	uint16 buf_pitch = bes->ob_width;	/* ISA card */	/* unlock card overlay sequencer registers (b5 = 1) */	temp = (KISAGRPHR(GENLOCK) | 0x20);	/* we need to wait a bit or the card will mess-up it's register values.. (NM2160) */	snooze(10);	KISAGRPHW(GENLOCK, temp);	/* destination rectangle #1 (output window position and size) */	KISAGRPHW(HD1COORD1L, ((bes->hcoordv >> 16) & 0xff));	KISAGRPHW(HD1COORD2L, (bes->hcoordv & 0xff));	KISAGRPHW(HD1COORD21H, (((bes->hcoordv >> 4) & 0xf0) | ((bes->hcoordv >> 24) & 0x0f)));	KISAGRPHW(VD1COORD1L, ((bes->vcoordv >> 16) & 0xff));	KISAGRPHW(VD1COORD2L, (bes->vcoordv & 0xff));	KISAGRPHW(VD1COORD21H, (((bes->vcoordv >> 4) & 0xf0) | ((bes->vcoordv >> 24) & 0x0f)));	/* scaling */	KISAGRPHW(XSCALEL, (bes->hiscalv & 0xff));	KISAGRPHW(XSCALEH, ((bes->hiscalv >> 8) & 0xff));	KISAGRPHW(YSCALEL, (bes->viscalv & 0xff));	KISAGRPHW(YSCALEH, ((bes->viscalv >> 8) & 0xff));	/* inputbuffer #1 origin */	/* (we don't program buffer #2 as it's unused.) */	if (bes->card_type < NM2200)	{		bes->a1orgv >>= 1;		/* horizontal source end does not use subpixelprecision: granularity is 8 pixels */		/* (horizontal source end minimizes used bandwidth) */		KISAGRPHW(0xbc, (((((bes->hsrcendv >> 16) + 7) & ~8) / 8) - 1));	}	else	{		/* NM2200 and later cards use bytes to define buffer pitch */		buf_pitch <<= 1;		/* horizontal source end does not use subpixelprecision: granularity is 16 pixels */		/* (horizontal source end minimizes used bandwidth) */		//fixme? divide by 16 instead of 8 (if >= NM2200 owners report trouble then use 8!)		//fixme? check if overlaybuffer width should also have granularity of 16 now!		KISAGRPHW(0xbc, (((((bes->hsrcendv >> 16) + 15) & ~16) / 16) - 1));	}	KISAGRPHW(BUF1ORGL, (bes->a1orgv & 0xff));	KISAGRPHW(BUF1ORGM, ((bes->a1orgv >> 8) & 0xff));	KISAGRPHW(BUF1ORGH, ((bes->a1orgv >> 16) & 0xff));	/* ??? */	KISAGRPHW(0xbd, 0x02);	KISAGRPHW(0xbe, 0x00);	/* b2 = 0: don't use horizontal mirroring (NM2160) */	/* other bits do ??? */	KISAGRPHW(0xbf, 0x02);	/* destination rectangle #2 (output window position and size) *//*	{		uint16 left = 0;		uint16 right = 128;		uint16 top = 0;		uint16 bottom = 128;		KISASEQW(HD2COORD1L, (left & 0xff));		KISASEQW(HD2COORD2L, (right & 0xff));		KISASEQW(HD2COORD21H, (((right >> 4) & 0xf0) | ((left >> 8) & 0x0f)));		KISASEQW(VD2COORD1L, (top & 0xff));		KISASEQW(VD2COORD2L, (bottom & 0xff));		KISASEQW(VD2COORD21H, (((bottom >> 4) & 0xf0) | ((top >> 8) & 0x0f)));	}*/	/* ??? */    KISASEQW(0x1c, 0xfb);   	KISASEQW(0x1d, 0x00);	KISASEQW(0x1e, 0xe2);   	KISASEQW(0x1f, 0x02);	/* b1 = 0: disable alternating hardware buffers (NM2160) */	/* other bits do ??? */	KISASEQW(0x09, 0x11);	/* we don't use PCMCIA Zoomed Video port capturing, set 1:1 scale just in case */	/* (b6-4 = Y downscale = 100%, b2-0 = X downscale = 100%;	 *  downscaling selectable in 12.5% steps on increasing setting by 1) */	KISASEQW(ZVCAP_DSCAL, 0x00);	/* global BES control */	KISAGRPHW(BESCTRL1, (bes->globctlv & 0xff));	KISASEQW(BESCTRL2, ((bes->globctlv >> 8) & 0xff));	/**************************	 *** setup color keying ***	 **************************/	KISAGRPHW(COLKEY_R, bes->colkey_r);	KISAGRPHW(COLKEY_G, bes->colkey_g);	KISAGRPHW(COLKEY_B, bes->colkey_b);	/*************************	 *** setup misc. stuff ***	 *************************/	/* setup brightness to be 'neutral' (two's complement number) */	KISAGRPHW(BRIGHTNESS, 0x00);	/* setup inputbuffer #1 pitch including slopspace */	/* (we don't program the pitch for inputbuffer #2 as it's unused.) */	KISAGRPHW(BUF1PITCHL, (buf_pitch & 0xff));	KISAGRPHW(BUF1PITCHH, ((buf_pitch >> 8) & 0xff));}