/* fonts can be up to 16 bits wide */ static void DrawChar(char const Char, unsigned char Op) { unsigned int MaskBit = BIT0; //src unsigned char Rows = GetCurrentFontHeight(); unsigned char CharWidth = GetCharacterWidth(Char); unsigned int bitmap[MAX_FONT_ROWS]; GetCharacterBitmap(Char, (unsigned int *)&bitmap); /* do things bit by bit */ unsigned char i; unsigned char row; for (i = 0; i < CharWidth && gColumn < BYTES_PER_LINE; i++) { for (row = 0; row < Rows; row++) { // if ((MaskBit & bitmap[row])) pMyBuffer[gRow+row].Data[gColumn] |= gBitColumnMask; BitOp(&pMyBuffer[gRow+row].Data[gColumn], gBitColumnMask, MaskBit & bitmap[row], Op); } /* the shift direction seems backwards... */ MaskBit <<= 1; gBitColumnMask <<= 1; if (gBitColumnMask == 0) { gBitColumnMask = BIT0; gColumn++; } } }
// <math_bits> ::= <math_expression> [<bit_op> <math_expression>]* void Bits(CPU *cpu, Files file){ Expression(cpu, file); while(IsBitOp(file)){ cpu->PushValue(); BitOp(cpu, file); } }