<commit_before>#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>

#include "font.h"
#include "draw.h"
#include "filepack.h"

int current_y = 1;

unsigned char* tmpscreen = 0x26000000;

void ClearScreen(unsigned char *screen, int color)
{
    int i;
//    unsigned char *screenPos = screen;
    color = color >> 16 & 0xFF | color & 0xFF00 | color << 16 & 0xFF0000;
    for (i = 0; i < SCREEN_SIZE; i += 4)
    {
//        *(screenPos++) = color >> 16; //B
//        *(screenPos++) = color >> 8; //G
//        *(screenPos++) = color & 0xFF; //R
        color |= color << 24;
        *(unsigned *)(screen + i) = color;
        color >>= 8;
    }

    //memset(screen,color,SCREEN_SIZE);
    //memset(screen + SCREEN_SIZE + 16,color,SCREEN_SIZE);
}

void DrawCharacter(unsigned char *screen, int character, int x, int y, int color, int bgcolor)
{
    int yy, xx;
    int xDisplacement = x * SCREEN_HEIGHT;
    int yDisplacement = SCREEN_HEIGHT - y - 1;
    unsigned char *screenPos = screen + (xDisplacement + yDisplacement) * BYTES_PER_PIXEL;
    for (yy = 0; yy < 8; yy++)
    {
        unsigned char charPos = font[character * 8 + yy];
        for (xx = 7; xx >= 0; xx--)
        {
            if ((charPos >> xx) & 1)
            {
				if(color != TRANSPARENT){
					*(screenPos++) = color >> 16; //B
					*(screenPos++) = color >> 8; //G
					*(screenPos++) = color & 0xFF; //R
				}
            }
            else
            {
				if(bgcolor != TRANSPARENT){
					*(screenPos++) = bgcolor >> 16; //B
					*(screenPos++) = bgcolor >> 8; //G
					*(screenPos++) = bgcolor & 0xFF; //R
				}
            }
            screenPos += BYTES_PER_PIXEL * SCREEN_HEIGHT - 3;
        }
        screenPos -= BYTES_PER_PIXEL * (SCREEN_HEIGHT * 8 + 1);
    }
    if(screen = TOP_SCREEN && TOP_SCREEN2){
        screen = TOP_SCREEN2;
        int xDisplacement = x * SCREEN_HEIGHT;
        int yDisplacement = SCREEN_HEIGHT - y - 1;
        unsigned char *screenPos = screen + (xDisplacement + yDisplacement) * BYTES_PER_PIXEL;
        for (yy = 0; yy < 8; yy++)
        {
            unsigned char charPos = font[character * 8 + yy];
            for (xx = 7; xx >= 0; xx--)
            {
                if ((charPos >> xx) & 1)<commit_msg>Fixed an embarassing comparision<commit_after>#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>

#include "font.h"
#include "draw.h"
#include "filepack.h"

int current_y = 1;

unsigned char* tmpscreen = 0x26000000;

void ClearScreen(unsigned char *screen, int color)
{
    int i;
//    unsigned char *screenPos = screen;
    color = color >> 16 & 0xFF | color & 0xFF00 | color << 16 & 0xFF0000;
    for (i = 0; i < SCREEN_SIZE; i += 4)
    {
//        *(screenPos++) = color >> 16; //B
//        *(screenPos++) = color >> 8; //G
//        *(screenPos++) = color & 0xFF; //R
        color |= color << 24;
        *(unsigned *)(screen + i) = color;
        color >>= 8;
    }

    //memset(screen,color,SCREEN_SIZE);
    //memset(screen + SCREEN_SIZE + 16,color,SCREEN_SIZE);
}

void DrawCharacter(unsigned char *screen, int character, int x, int y, int color, int bgcolor)
{
    int yy, xx;
    int xDisplacement = x * SCREEN_HEIGHT;
    int yDisplacement = SCREEN_HEIGHT - y - 1;
    unsigned char *screenPos = screen + (xDisplacement + yDisplacement) * BYTES_PER_PIXEL;
    for (yy = 0; yy < 8; yy++)
    {
        unsigned char charPos = font[character * 8 + yy];
        for (xx = 7; xx >= 0; xx--)
        {
            if ((charPos >> xx) & 1)
            {
				if(color != TRANSPARENT){
					*(screenPos++) = color >> 16; //B
					*(screenPos++) = color >> 8; //G
					*(screenPos++) = color & 0xFF; //R
				}
            }
            else
            {
				if(bgcolor != TRANSPARENT){
					*(screenPos++) = bgcolor >> 16; //B
					*(screenPos++) = bgcolor >> 8; //G
					*(screenPos++) = bgcolor & 0xFF; //R
				}
            }
            screenPos += BYTES_PER_PIXEL * SCREEN_HEIGHT - 3;
        }
        screenPos -= BYTES_PER_PIXEL * (SCREEN_HEIGHT * 8 + 1);
    }
    if(screen == TOP_SCREEN && TOP_SCREEN2){
        screen = TOP_SCREEN2;
        int xDisplacement = x * SCREEN_HEIGHT;
        int yDisplacement = SCREEN_HEIGHT - y - 1;
        unsigned char *screenPos = screen + (xDisplacement + yDisplacement) * BYTES_PER_PIXEL;
        for (yy = 0; yy < 8; yy++)
        {
            unsigned char charPos = font[character * 8 + yy];
            for (xx = 7; xx >= 0; xx--)
            {
                if ((charPos >> xx) & 1)
{'fraction_non_alphanumeric': 0.15423654015887026, 'fraction_numerical': 0.026919682259488084, 'mean_word_length': 2.022, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2979732', 'n_tokens_mistral': 1767, 'n_tokens_neox': 1578, 'n_words': 422}