Skip to content

Commit

Permalink
修正汉化
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed Sep 10, 2014
1 parent 1b1d5d1 commit f2fcd66
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions 05_day/bootpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void init_screen(char *vram, int x, int y);

void HariMain(void)
{
char *vram;
char *vram;/* 声明变量vram、用于BYTE [...]地址 */
int xsize, ysize;
short *binfo_scrnx, *binfo_scrny;
int *binfo_vram;
Expand All @@ -51,42 +51,42 @@ void HariMain(void)
void init_palette(void)
{
static unsigned char table_rgb[16 * 3] = {
0x00, 0x00, 0x00, /* 0:�� */
0xff, 0x00, 0x00, /* 1:���邢�� */
0x00, 0xff, 0x00, /* 2:���邢�� */
0xff, 0xff, 0x00, /* 3:���邢���F */
0x00, 0x00, 0xff, /* 4:���邢�� */
0xff, 0x00, 0xff, /* 5:���邢�� */
0x00, 0xff, 0xff, /* 6:���邢���F */
0xff, 0xff, 0xff, /* 7:�� */
0xc6, 0xc6, 0xc6, /* 8:���邢�D�F */
0x84, 0x00, 0x00, /* 9:���� */
0x00, 0x84, 0x00, /* 10:���� */
0x84, 0x84, 0x00, /* 11:�����F */
0x00, 0x00, 0x84, /* 12:���� */
0x84, 0x00, 0x84, /* 13:���� */
0x00, 0x84, 0x84, /* 14:�����F */
0x84, 0x84, 0x84 /* 15:���D�F */
0x00, 0x00, 0x00, /* 0: */
0xff, 0x00, 0x00, /* 1:梁红 */
0x00, 0xff, 0x00, /* 2:亮绿 */
0xff, 0xff, 0x00, /* 3:亮黄 */
0x00, 0x00, 0xff, /* 4:亮蓝 */
0xff, 0x00, 0xff, /* 5:亮紫 */
0x00, 0xff, 0xff, /* 6:浅亮蓝 */
0xff, 0xff, 0xff, /* 7: */
0xc6, 0xc6, 0xc6, /* 8:亮灰 */
0x84, 0x00, 0x00, /* 9:暗红 */
0x00, 0x84, 0x00, /* 10:暗绿 */
0x84, 0x84, 0x00, /* 11:暗黄 */
0x00, 0x00, 0x84, /* 12:暗青 */
0x84, 0x00, 0x84, /* 13:暗紫 */
0x00, 0x84, 0x84, /* 14:浅暗蓝 */
0x84, 0x84, 0x84 /* 15:暗灰 */
};
set_palette(0, 15, table_rgb);
return;

/* static char ���߂́A�f�[�^�ɂ����g���Ȃ�����DB���ߑ��� */
/* C语言中的static char语句只能用于数据,相当于汇编中的DB指令 */
}

void set_palette(int start, int end, unsigned char *rgb)
{
int i, eflags;
eflags = io_load_eflags(); /* ���荞�݋��ƒt���O�̒l���L�^���� */
io_cli(); /* ���ƒt���O��0�ɂ��Ċ��荞�݋֎~�ɂ��� */
eflags = io_load_eflags(); /* 记录中断许可标志的值 */
io_cli(); /* 将中断许可标志置为0,禁止中断 */
io_out8(0x03c8, start);
for (i = start; i <= end; i++) {
io_out8(0x03c9, rgb[0] / 4);
io_out8(0x03c9, rgb[1] / 4);
io_out8(0x03c9, rgb[2] / 4);
rgb += 3;
}
io_store_eflags(eflags); /* ���荞�݋��ƒt���O�����ɖ߂� */
io_store_eflags(eflags); /* 复原中断许可标志 */
return;
}

Expand Down

0 comments on commit f2fcd66

Please sign in to comment.