📄 font.c
字号:
/* * Copyright (C) 2005,2006 Pawel Kolodziejski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */void drawChar(int x, int y, int c, int reverse, unsigned short color) { int px, py, pixel; unsigned short *vidbuffer = (unsigned short *)0xA3000000; unsigned char *fontdata_8x8 = (unsigned char *)0xA203F800; for (py = 0; py < 8; py++) { int line = fontdata_8x8[py + c * 8]; for (px = 0; px < 8; px++) { pixel = line & 0x80; line <<= 1; if (reverse == 0) { if (pixel) *(vidbuffer + (py + y) * 240 + (px + x)) = color; else *(vidbuffer + (py + y) * 240 + (px + x)) = 0xffff; } else { if (pixel) *(vidbuffer + (py + y) * 240 + (px + x)) = 0xffff; else *(vidbuffer + (py + y) * 240 + (px + x)) = color; } } }}void drawText(int x, int y, char *text, int reverse, unsigned short color) { int l; for (l = 0; l < (int)strlen(text); l++) { drawChar((x * 8) + (l * 8), y * 8, text[l], reverse, color); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -