⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m1b_lin.c

📁 nucleus 文件系统,内核和彩色图形系统,在小系统上非常好用
💻 C
📖 第 1 页 / 共 3 页
字号:
		{
			*dstPtr |= pxBit;
		}
		else
		{
			*dstPtr = *dstPtr & ~pxBit;
		}

		pxBit = (pxBit >> 1);
		if(pxBit == 0)
		{
			dstPtr++;
			pxBit = 0x80;
		}
	}

	return;
}


/* Vertical top->bottom replace. */
void M1BURV()
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		if(lclPenColor)
		{
			*dstPtr |= pxBit;
		}
		else
		{
			*dstPtr = *dstPtr & ~pxBit;
		}

		rowTablePtr[0]++;
	}

	return;
}


/* Diagonal top->bottom, right->left replace. */
void M1BURDRL(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		if(lclPenColor)
		{
			*dstPtr |= pxBit;
		}
		else
		{
			*dstPtr = *dstPtr & ~pxBit;
		}

		rowTablePtr[0]++;
		pxBit = (pxBit << 1);
		if(pxBit == 0)
		{
			dstBgnByte--;
			pxBit = 0x01;
		}
	}

	return;
}


/* Diagonal top->bottom, left->right replace. */
void M1BURDLR(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		if(lclPenColor)
		{
			*dstPtr |= pxBit;
		}
		else
		{
			*dstPtr = *dstPtr & ~pxBit;
		}

		rowTablePtr[0]++;
		pxBit = (pxBit >> 1);
		if(pxBit == 0)
		{
			dstBgnByte++;
			pxBit = 0x80;
		}
	}

	return;
}


/* Y major top->bottom, left->right replace. */
void M1BURYMLR(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		if(lclPenColor)
		{
			*dstPtr |= pxBit;
		}
		else
		{
			*dstPtr = *dstPtr & ~pxBit;
		}

		rowTablePtr[0]++;
		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			pxBit = (pxBit >> 1);
			if(pxBit == 0)
			{
				dstBgnByte++;
				pxBit = 0x80;
			}
		}
	}

	return;
}


/* Y major top->bottom, right->left replace. */
void M1BURYMRL(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		if(lclPenColor)
		{
			*dstPtr |= pxBit;
		}
		else
		{
			*dstPtr = *dstPtr & ~pxBit;
		}

		rowTablePtr[0]++;
		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			pxBit = (pxBit << 1);
			if(pxBit == 0)
			{
				dstBgnByte--;
				pxBit = 0x01;
			}
		}
	}

	return;
}


/* X major top->bottom, left->right replace. */
void M1BURXMLR(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		if(lclPenColor)
		{
			*dstPtr |= pxBit;
		}
		else
		{
			*dstPtr = *dstPtr & ~pxBit;
		}

		pxBit = (pxBit >> 1);
		if(pxBit == 0)
		{
			dstBgnByte++;
			pxBit = 0x80;
		}

		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			rowTablePtr[0]++;
		}
	}

	return;
}


/* X major top->bottom, right->left replace. */
void M1BURXMRL(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		if(lclPenColor)
		{
			*dstPtr |= pxBit;
		}
		else
		{
			*dstPtr = *dstPtr & ~pxBit;
		}

		pxBit = (pxBit << 1);
		if(pxBit == 0)
		{
			dstBgnByte--;
			pxBit = 0x01;
		}

		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			rowTablePtr[0]++;
		}
	}

	return;
}


/*	Horizontal left->right XOR.	*/
void M1BUXH(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstPtr = (byte *) *rowTablePtr[0] + (dRect.Xmin >> 3);
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		*dstPtr ^= pxBit;

		pxBit = (pxBit >> 1);
		if(pxBit == 0)
		{
			dstPtr++;
			pxBit = 0x80;
		}
	}

	return;
}


/* Vertical top->bottom XOR. */
void M1BUXV()
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		*dstPtr = *dstPtr ^ pxBit;
		rowTablePtr[0]++;
	}

	return;
}


/* Diagonal top->bottom, right->left XOR. */
void M1BUXDRL(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		*dstPtr = *dstPtr ^ pxBit;
		rowTablePtr[0]++;
		pxBit = (pxBit << 1);
		if(pxBit == 0)
		{
			dstBgnByte--;
			pxBit = 0x01;
		}

	}

	return;
}


/* Diagonal top->bottom, left->right XOR. */
void M1BUXDLR(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		*dstPtr = *dstPtr ^ pxBit;
		rowTablePtr[0]++;
		pxBit = (pxBit >> 1);
		if(pxBit == 0)
		{
			dstBgnByte++;
			pxBit = 0x80;
		}
	}

	return;
}


/* Y major top->bottom, left->right XOR. */
void M1BUXYMLR(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		*dstPtr = *dstPtr ^ pxBit;
		rowTablePtr[0]++;
		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			pxBit = (pxBit >> 1);
			if(pxBit == 0)
			{
				dstBgnByte++;
				pxBit = 0x80;
			}
		}
	}

	return;
}


/* Y major top->bottom, right->left XOR. */
void M1BUXYMRL(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		*dstPtr = *dstPtr ^ pxBit;
		rowTablePtr[0]++;
		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			pxBit = (pxBit << 1);
			if(pxBit == 0)
			{
				dstBgnByte--;
				pxBit = 0x01;
			}
		}
	}
	return;
}


/* X major top->bottom, left->right XOR. */
void M1BUXXMLR(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		*dstPtr = *dstPtr ^ pxBit;
		pxBit = (pxBit >> 1);
		if(pxBit == 0)
		{
			dstBgnByte++;
			pxBit = 0x80;
		}
		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			rowTablePtr[0]++;
		}
	}

	return;
}


/* X major top->bottom, right->left XOR. */
void M1BUXXMRL(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		*dstPtr = *dstPtr ^ pxBit;
		pxBit = (pxBit << 1);
		if(pxBit == 0)
		{
			dstBgnByte--;
			pxBit = 0x01;
		}
		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			rowTablePtr[0]++;
		}
	}

	return;
}


/* Y major top->bottom, left->right masked, OR. */
/* #define M1BMOYMLR M1BMOV */
/* Y major top->bottom, vertical masked, OR. */
void M1BMOV(void)
{
	int i;
	byte pxBit;

	pxBit = (byte) (0x80 >> (dRect.Xmin & 0x07));
	dstBgnByte = dRect.Xmin >> 3;
	for (i = 0; i <= majorAxisLengthM1; i++)
	{
		dstPtr = (byte *) *rowTablePtr[0] + dstBgnByte;
		*dstPtr = *dstPtr | pxBit;
		rowTablePtr[0]++;
		errTermL += errTermAdjUpL;
		if (errTermL >= 0)
		{	/* minor axis advance */
			errTermL -= errTermAdjDownL;
			pxBit = (pxBit >> 1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -