newfont.c

来自「redboy for gba 是BPNS为GBA编写的一个小软件。软件的邹形是B」· C语言 代码 · 共 686 行 · 第 1/2 页

C
686
字号
#include <CsAgb.h>
#include <graph.h>
#include <Qgraph.h>
#include <rb_mem.h>
#include <string.h>
#include <rb_string.h>

#define mVRAM (u16 *) 0x06000000
#define file_bas 0x080E1000
#define fnt_bas fnt_sets.font
#define f_xp fnt_sets.xp
#define f_yp fnt_sets.yp
#define f_xd fnt_sets.xd
#define f_yd fnt_sets.yd
#define f_tp fnt_sets.type
extern u8 rb_xp,rb_yp;
extern void new_scroll1(u32 lc,u32 len);
extern u32 _fid,_iid,_line;
extern u8 rb_xp,rb_yp,is_basic_run;
extern char text_menus[4][15];
extern char font_menus[3][15];
extern char is_in_text_help;
extern void win_plate(char *tit,char *mes,u16 bg);
extern char _file[40];
extern void title(char *);
extern int menu(char *items,int n);
extern void text_deamon();
extern const u16 text_colors[];
extern void text(char *text,u16 color,u16 bg,u32 *sav);//文本显示
typedef struct
{
   u32 font;
   u8 yp;
   u8 xp;
   u8 yd;
   u8 xd;
   u8 on;
   u8 type;//GBK:1 GB2312:0
} fnt_mes;
#define SET_BAS 10344
#define font_set_M 680 //12字节 书字体设置
fnt_mes fnt_sets;

void font_set(u8 act)
{
   CS_SeekInSRAM(SRAM_SEEK_START,SET_BAS+font_set_M);
   if (act==1) CS_SaveToSRAM(&fnt_sets,sizeof(fnt_mes));//设置
   else if (act==2) CS_LoadFromSRAM(&fnt_sets,sizeof(fnt_mes));//取数
}
void chg_fnt_mod()
{
   if (fnt_sets.on)
   {
      arlt("操作成功:","文本显示模式已经更改为默认方式,启用更改请重启浏览器");
   }
   else
   {
      arlt("操作成功:","文本显示模式已经更改为自定义方式,启用更改请重启浏览器");
   }
   fnt_sets.on=!fnt_sets.on;
   font_set(1);
}
void ebk_select_font()
{
   u8 temp=is_basic_run;
   u32 loc;
   u8 xp,yp;
   is_basic_run=1;
   r_box(0,16,239,159,RGB(0,9,16),1);
   r_box(0,0,239,159,RGB(30,30,30),0);
   title("请选择字体文件:");
   loc=(u32)list_fsys(0);
   if (loc)
   {
      _file[3]='\0';
      str_up(_file);
      if (strcmp(_file,"GBK")==0) f_tp=1;
      else if(strcmp(_file,"GB2")==0) f_tp=0;
      else
      {
         arlt("系统提示:","你选择的字库系统不能识别!");
         is_basic_run=temp;
         return;
      }
      yp=_file[4]-48;
      yp=yp*10+_file[5]-48;
      xp=_file[7]-48;
      xp=10*xp+_file[8]-48;
      if (yp<16 || yp>48 || xp<10 || xp>48)
      {
         arlt("系统提示:","字体大小超出范围!");
         is_basic_run=temp;
         return;
      }
      fnt_sets.font=loc;
      fnt_sets.yp=yp;
      fnt_sets.xp=xp;
      font_set(1);//保存设置
      arlt("设置成功:","字体设置成功,应用新字体请重启浏览器");
   }
   is_basic_run=temp;
}

const u8 new_ascii_fnt[]={//8X16
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0000
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0001
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0002
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0003
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0004
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0005
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0006
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0007
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0008
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0009
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//000a
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//000b
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//000c
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//000d
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//000e
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//000f
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0010
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0011
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0012
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0013
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0014
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0015
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0016
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0017
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0018
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//0019
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//001a
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//001b
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//001c
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//001d
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//001e
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//001f
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//0020
0x00,0x00,0x00,0x18,0x3c,0x3c,0x3c,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,//0021
0x00,0x00,0x00,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//0022
0x00,0x00,0x00,0x36,0x36,0x7f,0x36,0x36,0x36,0x7f,0x36,0x36,0x00,0x00,0x00,0x00,//0023
0x00,0x18,0x18,0x3c,0x66,0x60,0x30,0x18,0x0c,0x06,0x66,0x3c,0x18,0x18,0x00,0x00,//0024
0x00,0x00,0x70,0xd8,0xda,0x76,0x0c,0x18,0x30,0x6e,0x5b,0x1b,0x0e,0x00,0x00,0x00,//0025
0x00,0x00,0x00,0x38,0x6c,0x6c,0x38,0x60,0x6f,0x66,0x66,0x3b,0x00,0x00,0x00,0x00,//0026
0x00,0x00,0x00,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//0027
0x00,0x00,0x00,0x0c,0x18,0x18,0x30,0x30,0x30,0x30,0x30,0x18,0x18,0x0c,0x00,0x00,//0028
0x00,0x00,0x00,0x30,0x18,0x18,0x0c,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x30,0x00,0x00,//0029
0x00,0x00,0x00,0x00,0x00,0x36,0x1c,0x7f,0x1c,0x36,0x00,0x00,0x00,0x00,0x00,0x00,//002a
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,//002b
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x1c,0x0c,0x18,0x00,0x00,//002c
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//002d
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x1c,0x00,0x00,0x00,0x00,//002e
0x00,0x00,0x00,0x06,0x06,0x0c,0x0c,0x18,0x18,0x30,0x30,0x60,0x60,0x00,0x00,0x00,//002f
0x00,0x00,0x00,0x1e,0x33,0x37,0x37,0x33,0x3b,0x3b,0x33,0x1e,0x00,0x00,0x00,0x00,//0030
0x00,0x00,0x00,0x0c,0x1c,0x7c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x00,0x00,0x00,0x00,//0031
0x00,0x00,0x00,0x3c,0x66,0x66,0x06,0x0c,0x18,0x30,0x60,0x7e,0x00,0x00,0x00,0x00,//0032
0x00,0x00,0x00,0x3c,0x66,0x66,0x06,0x1c,0x06,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,//0033
0x00,0x00,0x00,0x30,0x30,0x36,0x36,0x36,0x66,0x7f,0x06,0x06,0x00,0x00,0x00,0x00,//0034
0x00,0x00,0x00,0x7e,0x60,0x60,0x60,0x7c,0x06,0x06,0x0c,0x78,0x00,0x00,0x00,0x00,//0035
0x00,0x00,0x00,0x1c,0x18,0x30,0x7c,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,//0036
0x00,0x00,0x00,0x7e,0x06,0x0c,0x0c,0x18,0x18,0x30,0x30,0x30,0x00,0x00,0x00,0x00,//0037
0x00,0x00,0x00,0x3c,0x66,0x66,0x76,0x3c,0x6e,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,//0038
0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3e,0x0c,0x18,0x38,0x00,0x00,0x00,0x00,//0039
0x00,0x00,0x00,0x00,0x00,0x1c,0x1c,0x00,0x00,0x00,0x1c,0x1c,0x00,0x00,0x00,0x00,//003a
0x00,0x00,0x00,0x00,0x00,0x1c,0x1c,0x00,0x00,0x00,0x1c,0x1c,0x0c,0x18,0x00,0x00,//003b
0x00,0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00,0x00,//003c
0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//003d
0x00,0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,0x00,0x00,//003e
0x00,0x00,0x00,0x3c,0x66,0x66,0x0c,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,//003f
0x00,0x00,0x00,0x7e,0xc3,0xc3,0xcf,0xdb,0xdb,0xcf,0xc0,0x7f,0x00,0x00,0x00,0x00,//0040
0x00,0x00,0x00,0x18,0x3c,0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x00,0x00,0x00,0x00,//0041
0x00,0x00,0x00,0x7c,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00,//0042
0x00,0x00,0x00,0x3c,0x66,0x66,0x60,0x60,0x60,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,//0043
0x00,0x00,0x00,0x78,0x6c,0x66,0x66,0x66,0x66,0x66,0x6c,0x78,0x00,0x00,0x00,0x00,//0044
0x00,0x00,0x00,0x7e,0x60,0x60,0x60,0x7c,0x60,0x60,0x60,0x7e,0x00,0x00,0x00,0x00,//0045
0x00,0x00,0x00,0x7e,0x60,0x60,0x60,0x7c,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,//0046
0x00,0x00,0x00,0x3c,0x66,0x66,0x60,0x60,0x6e,0x66,0x66,0x3e,0x00,0x00,0x00,0x00,//0047
0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,//0048
0x00,0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00,//0049
0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,//004a
0x00,0x00,0x00,0x66,0x66,0x6c,0x6c,0x78,0x6c,0x6c,0x66,0x66,0x00,0x00,0x00,0x00,//004b
0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x7e,0x00,0x00,0x00,0x00,//004c
0x00,0x00,0x00,0x63,0x63,0x77,0x6b,0x6b,0x6b,0x63,0x63,0x63,0x00,0x00,0x00,0x00,//004d
0x00,0x00,0x00,0x63,0x63,0x73,0x7b,0x6f,0x67,0x63,0x63,0x63,0x00,0x00,0x00,0x00,//004e
0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,//004f
0x00,0x00,0x00,0x7c,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,//0050
0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x0c,0x06,0x00,0x00,//0051
0x00,0x00,0x00,0x7c,0x66,0x66,0x66,0x7c,0x6c,0x66,0x66,0x66,0x00,0x00,0x00,0x00,//0052
0x00,0x00,0x00,0x3c,0x66,0x60,0x30,0x18,0x0c,0x06,0x66,0x3c,0x00,0x00,0x00,0x00,//0053
0x00,0x00,0x00,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,//0054
0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,//0055
0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x18,0x00,0x00,0x00,0x00,//0056
0x00,0x00,0x00,0x63,0x63,0x63,0x6b,0x6b,0x6b,0x36,0x36,0x36,0x00,0x00,0x00,0x00,//0057
0x00,0x00,0x00,0x66,0x66,0x34,0x18,0x18,0x2c,0x66,0x66,0x66,0x00,0x00,0x00,0x00,//0058
0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x3c,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,//0059
0x00,0x00,0x00,0x7e,0x06,0x06,0x0c,0x18,0x30,0x60,0x60,0x7e,0x00,0x00,0x00,0x00,//005a
0x00,0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,//005b
0x00,0x00,0x00,0x60,0x60,0x30,0x30,0x18,0x18,0x0c,0x0c,0x06,0x06,0x00,0x00,0x00,//005c
0x00,0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,//005d
0x00,0x18,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//005e
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,//005f
0x00,0x38,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//0060
0x00,0x00,0x00,0x00,0x00,0x3c,0x06,0x06,0x3e,0x66,0x66,0x3e,0x00,0x00,0x00,0x00,//0061
0x00,0x00,0x00,0x60,0x60,0x7c,0x66,0x66,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00,//0062
0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x60,0x66,0x3c,0x00,0x00,0x00,0x00,//0063
0x00,0x00,0x00,0x06,0x06,0x3e,0x66,0x66,0x66,0x66,0x66,0x3e,0x00,0x00,0x00,0x00,//0064
0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x66,0x7e,0x60,0x60,0x3c,0x00,0x00,0x00,0x00,//0065
0x00,0x00,0x00,0x1e,0x30,0x30,0x30,0x7e,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,//0066
0x00,0x00,0x00,0x00,0x00,0x3e,0x66,0x66,0x66,0x66,0x66,0x3e,0x06,0x06,0x7c,0x00,//0067
0x00,0x00,0x00,0x60,0x60,0x7c,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,//0068
0x00,0x00,0x18,0x18,0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00,//0069
0x00,0x00,0x0c,0x0c,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x78,0x00,//006a
0x00,0x00,0x00,0x60,0x60,0x66,0x66,0x6c,0x78,0x6c,0x66,0x66,0x00,0x00,0x00,0x00,//006b
0x00,0x00,0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00,//006c
0x00,0x00,0x00,0x00,0x00,0x7e,0x6b,0x6b,0x6b,0x6b,0x6b,0x63,0x00,0x00,0x00,0x00,//006d
0x00,0x00,0x00,0x00,0x00,0x7c,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,//006e
0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00,//006f
0x00,0x00,0x00,0x00,0x00,0x7c,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x00,//0070
0x00,0x00,0x00,0x00,0x00,0x3e,0x66,0x66,0x66,0x66,0x66,0x3e,0x06,0x06,0x06,0x00,//0071
0x00,0x00,0x00,0x00,0x00,0x66,0x6e,0x70,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,//0072
0x00,0x00,0x00,0x00,0x00,0x3e,0x60,0x60,0x3c,0x06,0x06,0x7c,0x00,0x00,0x00,0x00,//0073
0x00,0x00,0x00,0x30,0x30,0x7e,0x30,0x30,0x30,0x30,0x30,0x1e,0x00,0x00,0x00,0x00,//0074
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3e,0x00,0x00,0x00,0x00,//0075
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3c,0x18,0x00,0x00,0x00,0x00,//0076
0x00,0x00,0x00,0x00,0x00,0x63,0x6b,0x6b,0x6b,0x6b,0x36,0x36,0x00,0x00,0x00,0x00,//0077
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x3c,0x18,0x3c,0x66,0x66,0x00,0x00,0x00,0x00,//0078
0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3c,0x0c,0x18,0xf0,0x00,//0079
0x00,0x00,0x00,0x00,0x00,0x7e,0x06,0x0c,0x18,0x30,0x60,0x7e,0x00,0x00,0x00,0x00,//007a
0x00,0x00,0x00,0x0c,0x18,0x18,0x18,0x30,0x60,0x30,0x18,0x18,0x18,0x0c,0x00,0x00,//007b
0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,//007c
0x00,0x00,0x00,0x30,0x18,0x18,0x18,0x0c,0x06,0x0c,0x18,0x18,0x18,0x30,0x00,0x00,//007d
0x00,0x00,0x00,0x71,0xdb,0x8e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//007e
0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x00,//007f
};
extern void (*sys_deamon)();
extern u32 TM_CN;
extern void book_mark_deamon();

void new_ascii(char ch,u8 xp,u8 yp,u16 color)
{
   int i,j;
   u8 *loc=new_ascii_fnt+(ch<<4);
   int lc=240*yp+xp;
   int dot;
   int fmask;
   for (i=0;i<16;i++)
   {
      dot=*loc;
      fmask=0x80;
      for (j=0;j<8;j++)
      {
         if (dot&fmask) *(mVRAM+lc+j)=color;
         fmask>>=1;
      }
      loc++;
      dot=*loc;
      lc+=240;
   }
}
void fnt_dis()
{
   if (fnt_sets.xd>6) fnt_sets.xd=0;
   if (fnt_sets.yd>6) fnt_sets.yd=0;
   r_box(41,32,201,101,0,0);
   Q_box(40,30,200,100,RGB(27,27,26));
   r_box(40,30,200,100,RGB(30,30,30),0);
   Q_box(41,31,199,45,RGB(3,7,15));
   r_line(41,46,199,46,RGB(30,30,30),1);
   r_line(40,70,200,70,0,1);
   cwrite(42,33,RGB(30,30,30),"字距设置:");
   cwrite(45,73,RGB(3,7,15),"A   :确 定 B   :取 消");
   cwrite(45,87,RGB(3,7,15),"方向健:更改行列间距");
   //r_box(45,55,195,70,RGB(3,7,15),0);
   cwrite(45,52,RGB(3,7,15),"行距:");
   Q_box(75,50,90,66,RGB(27,27,26));
   new_ascii(48+fnt_sets.yd,75,50,RGB(3,7,15));
   cwrite(120,52,RGB(3,7,15),"列距:");
   Q_box(150,50,165,66,RGB(27,27,26));
   new_ascii(48+fnt_sets.xd,150,50,RGB(3,7,15));
   while(1)
   {
      readkey();
      if (CS_IsKeyDown(KEY_UP))//更改列距
      {
         fnt_sets.xd=(fnt_sets.xd+5)%6;
         Q_box(150,50,165,66,RGB(27,27,26));
         new_ascii(48+fnt_sets.xd,150,50,RGB(3,7,15));
      }
      else if(CS_IsKeyDown(KEY_DOWN))
      {
         fnt_sets.xd=(fnt_sets.xd+1)%6;
         Q_box(150,50,165,66,RGB(27,27,26));
         new_ascii(48+fnt_sets.xd,150,50,RGB(3,7,15));
      }
      else if (CS_IsKeyDown(KEY_LEFT))//更改行距
      {
         fnt_sets.yd=(fnt_sets.yd+5)%6;
         Q_box(75,50,90,66,RGB(27,27,26));
         new_ascii(48+fnt_sets.yd,75,50,RGB(3,7,15));
      }
      else if (CS_IsKeyDown(KEY_RIGHT))//更改行距
      {
         fnt_sets.yd=(fnt_sets.yd+1)%6;
         Q_box(75,50,90,66,RGB(27,27,26));
         new_ascii(48+fnt_sets.yd,75,50,RGB(3,7,15));
      }
      else if (CS_IsKeyDown(KEY_A))
      {
         font_set(1);
         arlt("设置成功:","字距设置成功,应用新设置请重启浏览器");
         return;
      }
      else if (CS_IsKeyDown(KEY_B)) return;
   }
}
void new_font(u8 xp,u8 yp,u16 color,char *ch)//GBK
{
   int loc,ploc;
   int i,j;
   u8 dot,mask;
   if (f_tp) //GBK
   {
      loc=(ch[0]-129)*190+ch[1]-64;
      if (ch[1]>127) loc--;
   }
   else loc=(ch[0]-161)*94+ch[1]-161;//GB2312
   loc*=(f_yp*((f_xp+7)>>3));
   ploc=240*yp+xp;
   for(i=0;i<f_yp;i++)
   {
      for (j=0;j<f_xp;j++)
      {
         if ((j&7)==0)
         {
            mask=0x80;
            dot=*(u8 *)(fnt_bas+loc);
            loc++;
         }
         if (dot&mask) {*(mVRAM+ploc+j)=color;}
         mask>>=1;
      }
      ploc+=240;
   }
}

⌨️ 快捷键说明

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