@@ -28,7 +28,7 @@ void init_screen(char *vram, int x, int y);
28
28
29
29
void HariMain (void )
30
30
{
31
- char * vram ;
31
+ char * vram ;/* 声明变量vram、用于BYTE [...]地址 */
32
32
int xsize , ysize ;
33
33
short * binfo_scrnx , * binfo_scrny ;
34
34
int * binfo_vram ;
@@ -51,42 +51,42 @@ void HariMain(void)
51
51
void init_palette (void )
52
52
{
53
53
static unsigned char table_rgb [16 * 3 ] = {
54
- 0x00 , 0x00 , 0x00 , /* 0:�� */
55
- 0xff , 0x00 , 0x00 , /* 1:���邢�� */
56
- 0x00 , 0xff , 0x00 , /* 2:���邢�� */
57
- 0xff , 0xff , 0x00 , /* 3:���邢���F */
58
- 0x00 , 0x00 , 0xff , /* 4:���邢�� */
59
- 0xff , 0x00 , 0xff , /* 5:���邢�� */
60
- 0x00 , 0xff , 0xff , /* 6:���邢���F */
61
- 0xff , 0xff , 0xff , /* 7:�� */
62
- 0xc6 , 0xc6 , 0xc6 , /* 8:���邢�D�F */
63
- 0x84 , 0x00 , 0x00 , /* 9:���� */
64
- 0x00 , 0x84 , 0x00 , /* 10:���� */
65
- 0x84 , 0x84 , 0x00 , /* 11:�����F */
66
- 0x00 , 0x00 , 0x84 , /* 12:���� */
67
- 0x84 , 0x00 , 0x84 , /* 13:���� */
68
- 0x00 , 0x84 , 0x84 , /* 14:�����F */
69
- 0x84 , 0x84 , 0x84 /* 15:���D�F */
54
+ 0x00 , 0x00 , 0x00 , /* 0:黑 */
55
+ 0xff , 0x00 , 0x00 , /* 1:梁红 */
56
+ 0x00 , 0xff , 0x00 , /* 2:亮绿 */
57
+ 0xff , 0xff , 0x00 , /* 3:亮黄 */
58
+ 0x00 , 0x00 , 0xff , /* 4:亮蓝 */
59
+ 0xff , 0x00 , 0xff , /* 5:亮紫 */
60
+ 0x00 , 0xff , 0xff , /* 6:浅亮蓝 */
61
+ 0xff , 0xff , 0xff , /* 7:白 */
62
+ 0xc6 , 0xc6 , 0xc6 , /* 8:亮灰 */
63
+ 0x84 , 0x00 , 0x00 , /* 9:暗红 */
64
+ 0x00 , 0x84 , 0x00 , /* 10:暗绿 */
65
+ 0x84 , 0x84 , 0x00 , /* 11:暗黄 */
66
+ 0x00 , 0x00 , 0x84 , /* 12:暗青 */
67
+ 0x84 , 0x00 , 0x84 , /* 13:暗紫 */
68
+ 0x00 , 0x84 , 0x84 , /* 14:浅暗蓝 */
69
+ 0x84 , 0x84 , 0x84 /* 15:暗灰 */
70
70
};
71
71
set_palette (0 , 15 , table_rgb );
72
72
return ;
73
73
74
- /* static char ���߂́A�f�[�^�ɂ����g���Ȃ�����DB���ߑ��� */
74
+ /* C语言中的static char语句只能用于数据,相当于汇编中的DB指令 */
75
75
}
76
76
77
77
void set_palette (int start , int end , unsigned char * rgb )
78
78
{
79
79
int i , eflags ;
80
- eflags = io_load_eflags (); /* ���荞���t���O�̒l���L�^���� */
81
- io_cli (); /* ���t���O��0�ɂ��Ċ��荞�֎~�ɂ��� */
80
+ eflags = io_load_eflags (); /* 记录中断许可标志的值 */
81
+ io_cli (); /* 将中断许可标志置为0,禁止中断 */
82
82
io_out8 (0x03c8 , start );
83
83
for (i = start ; i <= end ; i ++ ) {
84
84
io_out8 (0x03c9 , rgb [0 ] / 4 );
85
85
io_out8 (0x03c9 , rgb [1 ] / 4 );
86
86
io_out8 (0x03c9 , rgb [2 ] / 4 );
87
87
rgb += 3 ;
88
88
}
89
- io_store_eflags (eflags ); /* ���荞���t���O�����ɖ߂� */
89
+ io_store_eflags (eflags ); /* 复原中断许可标志 */
90
90
return ;
91
91
}
92
92
0 commit comments